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.
yanzong_qianduan/pages/news1/text.vue

72 lines
1.5 KiB

4 months ago
<template>
<view>
<!-- <view class="con">{{ content }}</view> -->
3 months ago
<view class="con">
<rich-text style="white-space: normal;" :nodes="content"></rich-text>
4 months ago
</view>
</view>
</template>
<script>
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({
3 months ago
title: that.pageFlag == 1 ? '用户服务协议' : that.pageFlag == 2 ? '隐私政策' : that.pageFlag == 3 ?
2 months ago
'商家入驻协议' : that.pageFlag == 4 ?'平台审单协议': that.pageFlag == 5 ?'审单规则':'关于我们'
4 months ago
})
},
watch: {
richContent() {
this.uniqueKey = this.generateUniqueKey();
}
},
methods: {
generateUniqueKey() {
return Date.now() + Math.random();
},
async getTextData() {
uni.showLoading({
title: "加载中"
})
2 months ago
let typeVal = this.pageFlag == 1 ? 'user' : this.pageFlag == 2 ? 'policy' : this.pageFlag == 3?'joinMerchant': this.pageFlag == 4 ?'platform_standard': this.pageFlag == 5 ?'standard':'about'
4 months ago
let {
status,
data
} = await help.getAgreement({
type: typeVal
});
if (status == 200) {
uni.hideLoading();
this.content = data.detail.content
}
},
3 months ago
}
4 months ago
}
</script>
<style scoped lang="scss">
.con {
font-size: 28rpx;
padding: 20rpx 40rpx;
line-height: 28px;
span {
white-space: normal !important
}
}
</style>