Merge branch 'master' of http://git.njrzwl.cn:3000/wangmingchuan/yanzong_qianduan
commit
2e04ef9cb2
@ -1,58 +1,70 @@ |
||||
<template> |
||||
<view> |
||||
<!-- <view class="con">{{ content }}</view> --> |
||||
<view class="con" v-html="content"> |
||||
<!-- <rich-text style="white-space: normal;" :nodes="content"></rich-text> --> |
||||
<view class="con" > |
||||
<rich-text style="white-space: normal;" :nodes="content"></rich-text> |
||||
</view> |
||||
</view> |
||||
</template> |
||||
|
||||
<script> |
||||
import * as help from '@/api/help' |
||||
export default { |
||||
data() { |
||||
return { |
||||
pageFlag: 1, |
||||
content: '' |
||||
}; |
||||
}, |
||||
onShow() { |
||||
this.getTextData() |
||||
}, |
||||
onLoad(params) { |
||||
let that = this |
||||
that.pageFlag = params.pageFlag |
||||
uni.setNavigationBarTitle({ |
||||
title: that.pageFlag == 1 ? '用户服务协议' : that.pageFlag == 2 ? '隐私政策' : '关于我们' |
||||
}) |
||||
}, |
||||
methods: { |
||||
async getTextData() { |
||||
uni.showLoading({ |
||||
title: "加载中" |
||||
import * as help from '@/api/help' |
||||
export default { |
||||
data() { |
||||
return { |
||||
pageFlag: 1, |
||||
content: '', |
||||
uniqueKey: 0 |
||||
}; |
||||
}, |
||||
onShow() { |
||||
this.getTextData() |
||||
}, |
||||
onLoad(params) { |
||||
let that = this |
||||
that.pageFlag = params.pageFlag |
||||
uni.setNavigationBarTitle({ |
||||
title: that.pageFlag == 1 ? '用户服务协议' : that.pageFlag == 2 ? '隐私政策' : '关于我们' |
||||
}) |
||||
let typeVal = this.pageFlag == 1 ? 'user' : this.pageFlag == 2 ? 'policy' : 'about' |
||||
let { |
||||
status, |
||||
data |
||||
} = await help.getAgreement({ type: typeVal }); |
||||
if (status == 200) { |
||||
uni.hideLoading(); |
||||
this.content = data.detail.content |
||||
}, |
||||
watch: { |
||||
richContent() { |
||||
this.uniqueKey = this.generateUniqueKey(); |
||||
} |
||||
}, |
||||
methods: { |
||||
generateUniqueKey() { |
||||
return Date.now() + Math.random(); |
||||
}, |
||||
async getTextData() { |
||||
uni.showLoading({ |
||||
title: "加载中" |
||||
}) |
||||
let typeVal = this.pageFlag == 1 ? 'user' : this.pageFlag == 2 ? 'policy' : 'about' |
||||
let { |
||||
status, |
||||
data |
||||
} = await help.getAgreement({ |
||||
type: typeVal |
||||
}); |
||||
if (status == 200) { |
||||
uni.hideLoading(); |
||||
this.content = data.detail.content |
||||
} |
||||
}, |
||||
|
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
.con { |
||||
font-size: 28rpx; |
||||
padding: 20rpx 40rpx; |
||||
line-height: 28px; |
||||
|
||||
.con { |
||||
font-size: 28rpx; |
||||
padding: 20rpx 40rpx; |
||||
line-height: 28px; |
||||
span{ |
||||
white-space: normal !important |
||||
span { |
||||
white-space: normal !important |
||||
} |
||||
} |
||||
} |
||||
</style> |
Loading…
Reference in new issue