|
...
|
...
|
@@ -2,13 +2,13 @@ |
|
|
|
<view class="oneSetting">
|
|
|
|
<view class="oneSettingV2">
|
|
|
|
<view class="oneSettingV2-c">
|
|
|
|
<view class="oneSettingV2-c-1" @click="toRichText">
|
|
|
|
<view class="oneSettingV2-c-1" @click="toRichText('yszc')">
|
|
|
|
<view class="oneSettingV2-c-1-l">隐私政策</view>
|
|
|
|
<view class="oneSettingV2-c-1-r">
|
|
|
|
<u-icon name="arrow-right"></u-icon>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="oneSettingV2-c-1" @click="toRichText">
|
|
|
|
<view class="oneSettingV2-c-1" @click="toRichText('yhxy')">
|
|
|
|
<view class="oneSettingV2-c-1-l">用户协议</view>
|
|
|
|
<view class="oneSettingV2-c-1-r">
|
|
|
|
<u-icon name="arrow-right"></u-icon>
|
|
...
|
...
|
@@ -41,37 +41,21 @@ |
|
|
|
mapState,
|
|
|
|
mapMutations
|
|
|
|
} from 'vuex'
|
|
|
|
var that
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
imgUrl: '/static/images/tx.png',
|
|
|
|
userName: "学员01",
|
|
|
|
gender: "男",
|
|
|
|
studentNum: "ZZ202012058",
|
|
|
|
identity:0,
|
|
|
|
userdata:{
|
|
|
|
img:''
|
|
|
|
},
|
|
|
|
cache: ''
|
|
|
|
}
|
|
|
|
},
|
|
|
|
onLoad(option) {
|
|
|
|
that=this
|
|
|
|
console.log(option);
|
|
|
|
this.identity=uni.getStorageSync('identity')
|
|
|
|
this.userdata=this.userDatas
|
|
|
|
// #ifdef APP-PLUS
|
|
|
|
this.getCache()
|
|
|
|
// #endif
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapState(['hasLogin', 'forcedLogin', 'userName', 'userinfo','nowtime', 'userDatas']),
|
|
|
|
},
|
|
|
|
computed: {},
|
|
|
|
methods: {
|
|
|
|
toRichText() {
|
|
|
|
toRichText(type) {
|
|
|
|
uni.navigateTo({
|
|
|
|
url: '/pagesB/richText/richText'
|
|
|
|
url: '/pagesB/richText/richText?type=' + type
|
|
|
|
})
|
|
|
|
},
|
|
|
|
getCache(){
|
|
...
|
...
|
@@ -93,90 +77,6 @@ |
|
|
|
console.log(this.cache)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 更新头像
|
|
|
|
myUpload(rsp) {
|
|
|
|
var avatar = rsp.path
|
|
|
|
// console.log(avatar)
|
|
|
|
// Vue.set(that.userdata,'head_portrait',avatar)
|
|
|
|
// return
|
|
|
|
this.$service.wx_upload(avatar).then(res => {
|
|
|
|
|
|
|
|
that.btn_kg = 0
|
|
|
|
console.log(res)
|
|
|
|
if (res.code == 1) {
|
|
|
|
var datas = res.data
|
|
|
|
console.log(that.userdata)
|
|
|
|
Vue.set(that.userdata,'img',datas)
|
|
|
|
that.setmsg()
|
|
|
|
} else {
|
|
|
|
if (res.msg) {
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
title: res.msg
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
uni.showToast({
|
|
|
|
icon: "none",
|
|
|
|
title: "上传失败"
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catch(e => {
|
|
|
|
that.btn_kg = 0
|
|
|
|
console.log(e)
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
title: '操作失败'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
setmsg(){
|
|
|
|
var datas = {
|
|
|
|
img:that.userdata.img
|
|
|
|
}
|
|
|
|
var jkurl = '/my/save'
|
|
|
|
|
|
|
|
that.$service.P_post(jkurl, datas).then(res => {
|
|
|
|
that.btnkg = 0
|
|
|
|
console.log(res)
|
|
|
|
if (res.code == 1) {
|
|
|
|
that.htmlReset = 0
|
|
|
|
var datas = res.data
|
|
|
|
console.log(typeof datas)
|
|
|
|
|
|
|
|
if (typeof datas == 'string') {
|
|
|
|
datas = JSON.parse(datas)
|
|
|
|
}
|
|
|
|
console.log(res)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (res.msg) {
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
title: res.msg
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
title: '获取数据失败'
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catch(e => {
|
|
|
|
that.htmlReset = 1
|
|
|
|
that.btnkg = 0
|
|
|
|
// that.$refs.htmlLoading.htmlReset_fuc(1)
|
|
|
|
console.log(e)
|
|
|
|
uni.showToast({
|
|
|
|
icon: 'none',
|
|
|
|
title: '获取数据失败,请检查您的网络连接'
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
getimg(img){
|
|
|
|
return this.$service.getimg(img)
|
|
|
|
},
|
|
|
|
logout_fuc(){
|
|
|
|
uni.removeStorageSync('token')
|
|
|
|
uni.reLaunch({
|
...
|
...
|
|