tj
2025-05-30 d9a780fa538cb7a83aefa04e75cb53185d690d7d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<template>
    <view :class="['app', theme]">
       <view class="protocol-page">
            <up-parse :content="protocol.content"></up-parse>
       </view>
    </view>
</template>
<script setup lang="ts">
import { ref, onMounted,getCurrentInstance } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { ProtocolData } from '@/types/index'
const instance = getCurrentInstance()
const $message = instance?.proxy?.$message
const $http = instance?.proxy?.$http
// 主题
const theme = ref('light')
onMounted(() => {
    const localTheme = uni.getStorageSync('theme') || 'light'
    theme.value = localTheme
})
 
onLoad((options: { title?: string }) => {
    const title = options.title ? decodeURIComponent(options.title) : '';
    uni.setNavigationBarTitle({
    title: title
});
    getProtocol(title)
});
 
const protocol = ref<ProtocolData | null>(null)
const getProtocol =async (title: string) => {
    $message.showLoading()
    const { data } = await $http.request('get', '/api/config/content/list/view?id=' +title, {})
    $message.hideLoading()
    protocol.value=data
}
 
</script>
<style lang="scss" scoped>
.protocol-page{
    padding: 20rpx;
}
</style>