edu/app/src/pages/agreement/agreement.vue

37 lines
776 B
Vue
Raw Normal View History

<template>
<view class="">
2022-09-09 01:06:21 +00:00
<u-parse :html="agreementContent"></u-parse>
</view>
</template>
<script setup lang="ts">
import { reactive, ref } from 'vue'
2022-09-09 01:06:21 +00:00
import { onLoad } from "@dcloudio/uni-app";
import { AgreementEnum } from '@/enums/agreementEnums'
2022-09-09 01:06:21 +00:00
import { getPolicy } from '@/api/app'
2022-09-09 01:06:21 +00:00
let agreementType = ref('') // 协议类型
let agreementContent = ref('') // 协议内容
const getData = async (type) => {
let res = await getPolicy({ type })
console.log(res, 'res')
agreementContent.value = res.content
uni.setNavigationBarTitle({
title: res.name
})
}
onLoad((options: any) => {
if(options.type) {
agreementType = options.type
getData(agreementType)
}
2022-09-09 01:06:21 +00:00
})
</script>
<style lang="scss" scoped>
</style>