You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.2 KiB
66 lines
1.2 KiB
<template>
|
|
<view class="assemble">
|
|
<view class="html-style" v-html="text"></view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import agreement from '@/api/agreement.js';
|
|
export default {
|
|
data() {
|
|
return {
|
|
type: 1, //类型 1为用户协议,2为隐私策略
|
|
text: '',
|
|
}
|
|
},
|
|
onLoad(item) {
|
|
console.log(item.type, '类型')
|
|
this.init(item.type)
|
|
},
|
|
methods: {
|
|
//初始化拿数据的接口
|
|
init(type) {
|
|
if (type == 1) {
|
|
//获取用户协议
|
|
agreement.userAgreement('service').then(res => {
|
|
if(res.code == 1){
|
|
this.text = res.data.content
|
|
}else{
|
|
this.text = ''
|
|
}
|
|
})
|
|
uni.setNavigationBarTitle({
|
|
title: '用户协议'
|
|
});
|
|
} else if (type == 2) {
|
|
//获取隐私策略
|
|
agreement.userAgreement('privacy').then(res => {
|
|
if(res.code == 1){
|
|
this.text = res.data.content
|
|
}else{
|
|
this.text = ''
|
|
}
|
|
})
|
|
uni.setNavigationBarTitle({
|
|
title: '隐私策略'
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="less" scoped>
|
|
.assemble {
|
|
width: 100%;
|
|
height: 100vh;
|
|
overflow: auto;
|
|
background-color: #fff;
|
|
}
|
|
|
|
.html-style {
|
|
padding: 10rpx 20rpx;
|
|
line-height: 1.8;
|
|
font-size: 30rpx;
|
|
}
|
|
</style>
|