<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>
|