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.

137 lines
2.9 KiB

7 months ago
<template>
<view class="page">
<view class="info">
<!-- 标题 -->
<!-- <view class="info-title">
{{title}}
</view> -->
<!-- 内容 -->
<view class="info-content">
<mp-html v-if="id==1" :content="html1" :markdown="true" :lazy-load="true"/>
<mp-html v-if="id==2" :content="html2" :markdown="true" :lazy-load="true"/>
<mp-html v-if="id==3" :content="html3" :markdown="true" :lazy-load="true"/>
</view>
</view>
<!-- service 客服-->
<service ref="serviceId" @goservice="goservice"></service>
<!-- top 返回顶部-->
<top ref="topId"></top>
</view>
</template>
<script>
import top from "../components/top.vue";
import service from "../components/service.vue";
export default {
components: {
top,service
},
data() {
return {
3 weeks ago
id:1, // 1、用户服务协议 2、隐私政策条款 3、用户注册协议
7 months ago
title: "用户授权协议",
html1:``,
html2:``,
html3:``,
}
},
onShow(){
},
onLoad(options) {
// 富文本不好二次赋值或者再ready中赋值
if(options.id){
this.id= parseInt(options.id);
}
},
async onReady(){
3 weeks ago
// 1、用户服务协议 2、隐私政策条款 3、用户注册协议
7 months ago
if(this.id==1)
{
uni.setNavigationBarTitle({
3 weeks ago
title: "用户服务协议",
7 months ago
});
this.getxy();
}
else if(this.id==2)
{
uni.setNavigationBarTitle({
3 weeks ago
title: "隐私政策条款",
7 months ago
});
this.getxy();
}
else{
uni.setNavigationBarTitle({
3 weeks ago
title: "用户注册协议",
7 months ago
});
}
},
onPageScroll(e) {
//调用子组件方法
this.$refs.topId.topData(e.scrollTop);
},
methods:{
async getxy(){
if(this.id){
try{
uni.showLoading({
title: '数据加载中...'
});
3 weeks ago
const {data: res} = await uni.$http.get('/yoga/api/privacyPolicy');
// Conten1:用户服务协议
// Conten2:隐私政策条款
7 months ago
// Conten3:用户注册协议
if(res){
if(this.id==1){
3 weeks ago
// 1、用户服务协议 2、隐私政策条款 3、用户注册协议
7 months ago
this.html1=res.content1;
}
else if(this.id==2){
3 weeks ago
// 1、用户服务协议 2、隐私政策条款 3、用户注册协议
7 months ago
this.html2=res.content2;
}
else if(this.id==3){
3 weeks ago
// 1、用户服务协议 2、隐私政策条款 3、用户注册协议
7 months ago
this.html3=res.content3;
}
this.$forceUpdate();
}
}
catch(e){
console.log(e)
}
}
},
goservice(val){
console.log(val);
},
}
}
</script>
<style lang="scss" scoped>
.user{
background-color: #FFFFFF;
min-height: calc(100vh - var(--window-top)) !important;
}
.info{
position: relative;
display: block;
overflow: hidden;
}
.info-content{
padding: 24rpx 24rpx 40rpx 24rpx;
line-height: 2;
color:#0E1521;
font-size: 28rpx;
letter-spacing: 1rpx;
}
</style>