作者 mxd

用户协议

隐私政策
@@ -2,13 +2,13 @@ @@ -2,13 +2,13 @@
2 <view class="oneSetting"> 2 <view class="oneSetting">
3 <view class="oneSettingV2"> 3 <view class="oneSettingV2">
4 <view class="oneSettingV2-c"> 4 <view class="oneSettingV2-c">
5 - <view class="oneSettingV2-c-1" @click="toRichText"> 5 + <view class="oneSettingV2-c-1" @click="toRichText('yszc')">
6 <view class="oneSettingV2-c-1-l">隐私政策</view> 6 <view class="oneSettingV2-c-1-l">隐私政策</view>
7 <view class="oneSettingV2-c-1-r"> 7 <view class="oneSettingV2-c-1-r">
8 <u-icon name="arrow-right"></u-icon> 8 <u-icon name="arrow-right"></u-icon>
9 </view> 9 </view>
10 </view> 10 </view>
11 - <view class="oneSettingV2-c-1" @click="toRichText"> 11 + <view class="oneSettingV2-c-1" @click="toRichText('yhxy')">
12 <view class="oneSettingV2-c-1-l">用户协议</view> 12 <view class="oneSettingV2-c-1-l">用户协议</view>
13 <view class="oneSettingV2-c-1-r"> 13 <view class="oneSettingV2-c-1-r">
14 <u-icon name="arrow-right"></u-icon> 14 <u-icon name="arrow-right"></u-icon>
@@ -41,37 +41,21 @@ @@ -41,37 +41,21 @@
41 mapState, 41 mapState,
42 mapMutations 42 mapMutations
43 } from 'vuex' 43 } from 'vuex'
44 - var that  
45 export default { 44 export default {
46 data() { 45 data() {
47 return { 46 return {
48 - imgUrl: '/static/images/tx.png',  
49 - userName: "学员01",  
50 - gender: "男",  
51 - studentNum: "ZZ202012058",  
52 - identity:0,  
53 - userdata:{  
54 - img:''  
55 - },  
56 - cache: ''  
57 } 47 }
58 }, 48 },
59 onLoad(option) { 49 onLoad(option) {
60 - that=this  
61 - console.log(option);  
62 - this.identity=uni.getStorageSync('identity')  
63 - this.userdata=this.userDatas  
64 // #ifdef APP-PLUS 50 // #ifdef APP-PLUS
65 this.getCache() 51 this.getCache()
66 // #endif 52 // #endif
67 }, 53 },
68 - computed: {  
69 - ...mapState(['hasLogin', 'forcedLogin', 'userName', 'userinfo','nowtime', 'userDatas']),  
70 - }, 54 + computed: {},
71 methods: { 55 methods: {
72 - toRichText() { 56 + toRichText(type) {
73 uni.navigateTo({ 57 uni.navigateTo({
74 - url: '/pagesB/richText/richText' 58 + url: '/pagesB/richText/richText?type=' + type
75 }) 59 })
76 }, 60 },
77 getCache(){ 61 getCache(){
@@ -93,90 +77,6 @@ @@ -93,90 +77,6 @@
93 console.log(this.cache) 77 console.log(this.cache)
94 }) 78 })
95 }, 79 },
96 - // 更新头像  
97 - myUpload(rsp) {  
98 - var avatar = rsp.path  
99 - // console.log(avatar)  
100 - // Vue.set(that.userdata,'head_portrait',avatar)  
101 - // return  
102 - this.$service.wx_upload(avatar).then(res => {  
103 -  
104 - that.btn_kg = 0  
105 - console.log(res)  
106 - if (res.code == 1) {  
107 - var datas = res.data  
108 - console.log(that.userdata)  
109 - Vue.set(that.userdata,'img',datas)  
110 - that.setmsg()  
111 - } else {  
112 - if (res.msg) {  
113 - uni.showToast({  
114 - icon: 'none',  
115 - title: res.msg  
116 - })  
117 - } else {  
118 - uni.showToast({  
119 - icon: "none",  
120 - title: "上传失败"  
121 - })  
122 - }  
123 - }  
124 - }).catch(e => {  
125 - that.btn_kg = 0  
126 - console.log(e)  
127 - uni.showToast({  
128 - icon: 'none',  
129 - title: '操作失败'  
130 - })  
131 - })  
132 - },  
133 - setmsg(){  
134 - var datas = {  
135 - img:that.userdata.img  
136 - }  
137 - var jkurl = '/my/save'  
138 -  
139 - that.$service.P_post(jkurl, datas).then(res => {  
140 - that.btnkg = 0  
141 - console.log(res)  
142 - if (res.code == 1) {  
143 - that.htmlReset = 0  
144 - var datas = res.data  
145 - console.log(typeof datas)  
146 -  
147 - if (typeof datas == 'string') {  
148 - datas = JSON.parse(datas)  
149 - }  
150 - console.log(res)  
151 -  
152 - } else {  
153 -  
154 - if (res.msg) {  
155 - uni.showToast({  
156 - icon: 'none',  
157 - title: res.msg  
158 - })  
159 - } else {  
160 - uni.showToast({  
161 - icon: 'none',  
162 - title: '获取数据失败'  
163 - })  
164 - }  
165 - }  
166 - }).catch(e => {  
167 - that.htmlReset = 1  
168 - that.btnkg = 0  
169 - // that.$refs.htmlLoading.htmlReset_fuc(1)  
170 - console.log(e)  
171 - uni.showToast({  
172 - icon: 'none',  
173 - title: '获取数据失败,请检查您的网络连接'  
174 - })  
175 - })  
176 - },  
177 - getimg(img){  
178 - return this.$service.getimg(img)  
179 - },  
180 logout_fuc(){ 80 logout_fuc(){
181 uni.removeStorageSync('token') 81 uni.removeStorageSync('token')
182 uni.reLaunch({ 82 uni.reLaunch({
1 <template> 1 <template>
2 <view style="padding: 20rpx 25rpx;"> 2 <view style="padding: 20rpx 25rpx;">
3 - 123456 3 + <rich-text :nodes="info.content || ''"></rich-text>
4 </view> 4 </view>
5 </template> 5 </template>
6 6
@@ -8,11 +8,59 @@ @@ -8,11 +8,59 @@
8 export default { 8 export default {
9 data() { 9 data() {
10 return { 10 return {
11 - 11 + info: {}
12 } 12 }
13 }, 13 },
  14 + onLoad(option) {
  15 + this.getInfo(option.type)
  16 + },
14 methods: { 17 methods: {
  18 + getInfo(type) {
  19 + uni.showLoading({
  20 + title: '加载中',
  21 + mask: true
  22 + })
15 23
  24 + let api = '';
  25 + if(type === 'yszc') {
  26 + api = '/config/policy';
  27 + uni.setNavigationBarTitle({
  28 + title: '隐私政策'
  29 + });
  30 + }else if(type === 'yhxy') {
  31 + api = '/config/agreement';
  32 + uni.setNavigationBarTitle({
  33 + title: '用户协议'
  34 + });
  35 + }
  36 +
  37 + this.$service.P_get(api).then(res => {
  38 + uni.hideLoading();
  39 + if (res.code == 1) {
  40 + this.info = res.data;
  41 + }else {
  42 + if (res.msg) {
  43 + uni.showToast({
  44 + icon: 'none',
  45 + title: res.msg
  46 + })
  47 + } else {
  48 + uni.showToast({
  49 + icon: 'none',
  50 + title: '获取数据失败'
  51 + })
  52 + }
  53 + }
  54 +
  55 +
  56 + }).catch(e => {
  57 + uni.hideLoading()
  58 + uni.showToast({
  59 + icon: 'none',
  60 + title: '获取数据失败,请检查您的网络连接'
  61 + })
  62 + })
  63 + }
16 } 64 }
17 } 65 }
18 </script> 66 </script>