richText.vue
1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<template>
<view style="padding: 20rpx 25rpx;">
<rich-text :nodes="info.content || ''"></rich-text>
</view>
</template>
<script>
export default {
data() {
return {
info: {}
}
},
onLoad(option) {
this.getInfo(option.type)
},
methods: {
getInfo(type) {
uni.showLoading({
title: '加载中',
mask: true
})
let api = '';
if(type === 'yszc') {
api = '/config/policy';
uni.setNavigationBarTitle({
title: '隐私政策'
});
}else if(type === 'yhxy') {
api = '/config/agreement';
uni.setNavigationBarTitle({
title: '用户协议'
});
}
this.$service.P_get(api).then(res => {
uni.hideLoading();
if (res.code == 1) {
this.info = res.data;
}else {
if (res.msg) {
uni.showToast({
icon: 'none',
title: res.msg
})
} else {
uni.showToast({
icon: 'none',
title: '获取数据失败'
})
}
}
}).catch(e => {
uni.hideLoading()
uni.showToast({
icon: 'none',
title: '获取数据失败,请检查您的网络连接'
})
})
}
}
}
</script>
<style>
</style>