wangdong 9 months ago
commit 2e04ef9cb2
  1. 32
      pages/news1/text.vue

@ -1,19 +1,20 @@
<template> <template>
<view> <view>
<!-- <view class="con">{{ content }}</view> --> <!-- <view class="con">{{ content }}</view> -->
<view class="con" v-html="content"> <view class="con" >
<!-- <rich-text style="white-space: normal;" :nodes="content"></rich-text> --> <rich-text style="white-space: normal;" :nodes="content"></rich-text>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import * as help from '@/api/help' import * as help from '@/api/help'
export default { export default {
data() { data() {
return { return {
pageFlag: 1, pageFlag: 1,
content: '' content: '',
uniqueKey: 0
}; };
}, },
onShow() { onShow() {
@ -26,7 +27,15 @@ export default {
title: that.pageFlag == 1 ? '用户服务协议' : that.pageFlag == 2 ? '隐私政策' : '关于我们' title: that.pageFlag == 1 ? '用户服务协议' : that.pageFlag == 2 ? '隐私政策' : '关于我们'
}) })
}, },
watch: {
richContent() {
this.uniqueKey = this.generateUniqueKey();
}
},
methods: { methods: {
generateUniqueKey() {
return Date.now() + Math.random();
},
async getTextData() { async getTextData() {
uni.showLoading({ uni.showLoading({
title: "加载中" title: "加载中"
@ -35,24 +44,27 @@ export default {
let { let {
status, status,
data data
} = await help.getAgreement({ type: typeVal }); } = await help.getAgreement({
type: typeVal
});
if (status == 200) { if (status == 200) {
uni.hideLoading(); uni.hideLoading();
this.content = data.detail.content this.content = data.detail.content
} }
}, },
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.con {
.con {
font-size: 28rpx; font-size: 28rpx;
padding: 20rpx 40rpx; padding: 20rpx 40rpx;
line-height: 28px; line-height: 28px;
span{
span {
white-space: normal !important white-space: normal !important
} }
} }
</style> </style>
Loading…
Cancel
Save