|
|
|
@ -19,9 +19,7 @@ |
|
|
|
|
<!-- 用户昵称 --> |
|
|
|
|
<view class="t_adm_box"> |
|
|
|
|
<!-- <text class="t_nic">{{nickname}}阳光夏~小葵</text> -- 已登录状态 显示用户昵称 --> |
|
|
|
|
<text class="t_nic" >{{ nickname }}</text> |
|
|
|
|
<!--登录后 退出按钮--> |
|
|
|
|
<!-- <text v-if="isLogin" class="pes_img_tc" @tap="jump('logoutWechat')">退出</text> --> |
|
|
|
|
<text class="t_nic">{{ nicknames }}</text> |
|
|
|
|
</view> |
|
|
|
|
<!-- <input type="nickname" @blur="saveName" class="weui-input" placeholder="请输入昵称"/> --> |
|
|
|
|
</view> |
|
|
|
@ -66,40 +64,7 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view> |
|
|
|
|
<!-- 普通弹窗 --> |
|
|
|
|
<!-- <uni-popup ref="popup" background-color="#fff" > |
|
|
|
|
<view class="w100 fx-box"> |
|
|
|
|
<view class="f-32 color-01 fw-700 flex-c-c"> |
|
|
|
|
设置头像和昵称 |
|
|
|
|
</view> |
|
|
|
|
<view class="m-t-40"> |
|
|
|
|
<view class="flex w00"> |
|
|
|
|
<view class="flex-al-c w100 f-28"> |
|
|
|
|
<view class="w30 tx-tt">设置头像</view> |
|
|
|
|
<view class="w70"> |
|
|
|
|
<button open-type="chooseAvatar" @chooseavatar='onChooseAvatar' class="f-24 wh-106 color-01 m-t-10 tx-btn" |
|
|
|
|
> |
|
|
|
|
<image class="wh-106s" :src="url" mode="scaleToFill"></image> |
|
|
|
|
</button> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
</view> |
|
|
|
|
<view class="flex-c-c flex-column m-t-40 tx-nc"> |
|
|
|
|
<view class="flex-al-c w100 f-28"> |
|
|
|
|
<view class="w30 ">设置昵称</view> |
|
|
|
|
<input class="w70" type="nickname" @blur="blurname" v-model="username" placeholder="请输入昵称"> |
|
|
|
|
</view> |
|
|
|
|
</button> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="flex-c-c tx-sz" @click='conserved'> |
|
|
|
|
<view style="background: #0081f5;width: 300rpx;color: #fff;" class="padd-12 bor-r-10 flex-c-c m-t-40">设置</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</uni-popup> --> |
|
|
|
|
</view> |
|
|
|
|
<view></view> |
|
|
|
|
<!-- 兴趣定制 --> |
|
|
|
|
|
|
|
|
|
<!-- 工具栏 --> |
|
|
|
@ -117,8 +82,9 @@ export default { |
|
|
|
|
avatarUrl: '', |
|
|
|
|
url: '', |
|
|
|
|
username: '', |
|
|
|
|
headimgurl: '../../static/images/adm_img.png', |
|
|
|
|
headimgurl: '', |
|
|
|
|
nickname: '点击授权', |
|
|
|
|
nicknames: '点击授权', |
|
|
|
|
isUpdate: true, |
|
|
|
|
isLogin: false, |
|
|
|
|
isShowOnlinets: 'NO', |
|
|
|
@ -142,11 +108,12 @@ export default { |
|
|
|
|
onShow() { |
|
|
|
|
if (!uni.getStorageSync('unionid') || uni.getStorageSync('unionid') == '' || uni.getStorageSync('unionid') == null) { |
|
|
|
|
this.isLogin = false; |
|
|
|
|
this.headimgurl = '' |
|
|
|
|
this.headimgurl = ''; |
|
|
|
|
} else { |
|
|
|
|
this.nickname = uni.getStorageSync('nickname') |
|
|
|
|
this.headimgurl = uni.getStorageSync('headimgurl') |
|
|
|
|
this.isLogin = true |
|
|
|
|
this.nickname = uni.getStorageSync('nickname'); |
|
|
|
|
this.nicknames = this.$util.entitiestoUtf16(this.nickname); |
|
|
|
|
this.headimgurl = uni.getStorageSync('headimgurl'); |
|
|
|
|
this.isLogin = true; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad(options) { |
|
|
|
@ -158,19 +125,6 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
conserved(e){ |
|
|
|
|
console.log(e,'难定') |
|
|
|
|
let this_ = this; |
|
|
|
|
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
this_.headimgurl = this_.url; |
|
|
|
|
this_.nickname = this_.username; |
|
|
|
|
uni.setStorageSync('nickname', this_.username); |
|
|
|
|
uni.setStorageSync('headimgurl', this_.url); |
|
|
|
|
uni.setStorageSync('oauthTime', new Date().getTime()); |
|
|
|
|
this.$refs.popup.close() |
|
|
|
|
}, 1000) |
|
|
|
|
}, |
|
|
|
|
changean(type) { |
|
|
|
|
let this_ = this; |
|
|
|
|
if (!uni.getStorageSync('unionid') || uni.getStorageSync('unionid') == '' || uni.getStorageSync('unionid') == null) { |
|
|
|
@ -182,7 +136,7 @@ export default { |
|
|
|
|
} else { |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '/pages/personcenter/EditProfile/EditProfile' |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
// this.type = type |
|
|
|
|
// this_.url = this.headimgurl |
|
|
|
|
// this_.username = this.nickname |
|
|
|
@ -206,7 +160,7 @@ export default { |
|
|
|
|
blurname(e) { |
|
|
|
|
let this_ = this; |
|
|
|
|
console.log(e); |
|
|
|
|
this_.username = e.detail.value |
|
|
|
|
this_.username = e.detail.value; |
|
|
|
|
}, |
|
|
|
|
saveLoginLog: function (unionid) { |
|
|
|
|
var that = this; |
|
|
|
@ -261,7 +215,7 @@ export default { |
|
|
|
|
const da = { |
|
|
|
|
userkey: this_.$param.userkey, |
|
|
|
|
openid: obj.openid |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
this_.$Request.post(this_.$config.getUser, da).then((res) => { |
|
|
|
|
if (res.data == null) { |
|
|
|
|
uni.setStorageSync('nickname', '微信用户'); |
|
|
|
@ -270,15 +224,17 @@ export default { |
|
|
|
|
this_.nickname = '微信用户'; |
|
|
|
|
this_.headimgurl = 'https://www.lbgjtoa.com/appImg/icon-person-01.png'; |
|
|
|
|
this_.$forceUpdate(); |
|
|
|
|
this_.saveProfile(); |
|
|
|
|
} else { |
|
|
|
|
uni.setStorageSync('nickname', res.data.wxNickname); |
|
|
|
|
uni.setStorageSync('headimgurl', res.data.wxHeadimgurl); |
|
|
|
|
uni.setStorageSync('oauthTime', new Date().getTime()); |
|
|
|
|
this_.nickname = res.data.wxNickname; |
|
|
|
|
this_.nicknames = this_.$util.entitiestoUtf16(this_.nickname); |
|
|
|
|
this_.headimgurl = res.data.wxHeadimgurl; |
|
|
|
|
this_.$forceUpdate(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
uni.setStorageSync('unionid', obj.openid); |
|
|
|
|
}, |
|
|
|
|
fail: function (err) { |
|
|
|
@ -302,7 +258,7 @@ export default { |
|
|
|
|
// #endif |
|
|
|
|
}, |
|
|
|
|
saveProfile: function () { |
|
|
|
|
let this_ = this |
|
|
|
|
let this_ = this; |
|
|
|
|
// wx.getUserInfo({ |
|
|
|
|
// provider: 'weixin', |
|
|
|
|
// success: (res) => { |
|
|
|
@ -316,20 +272,20 @@ export default { |
|
|
|
|
headimgurl: this_.headimgurl, |
|
|
|
|
openid: uni.getStorageSync('unionid'), |
|
|
|
|
nickname: this_.nickname |
|
|
|
|
} |
|
|
|
|
console.log(obj,'请求参数') |
|
|
|
|
}; |
|
|
|
|
console.log(obj, '请求参数'); |
|
|
|
|
var data = { |
|
|
|
|
"data": JSON.stringify(obj), |
|
|
|
|
data: JSON.stringify(obj), |
|
|
|
|
userkey: this_.$param.userkey |
|
|
|
|
} |
|
|
|
|
this_.$Request.post(this_.$config.saveUser,data).then(res => { |
|
|
|
|
}; |
|
|
|
|
this_.$Request.post(this_.$config.saveUser, data).then((res) => { |
|
|
|
|
var flag = this_.$util.isSuccess(res); |
|
|
|
|
if (!flag) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
var userid = res.data; |
|
|
|
|
console.log(userid,'保存返回') |
|
|
|
|
}) |
|
|
|
|
console.log(userid, '保存返回'); |
|
|
|
|
}); |
|
|
|
|
// }, |
|
|
|
|
// fail: function (error) { |
|
|
|
|
// console.log('login failed ' + error); |
|
|
|
@ -341,16 +297,7 @@ export default { |
|
|
|
|
// duration: 1500 |
|
|
|
|
// }) |
|
|
|
|
}, |
|
|
|
|
callBackMethod: function () { |
|
|
|
|
// clearTimeout(timer); |
|
|
|
|
this.isLogin = true; |
|
|
|
|
that.nickname = aes.aesDecrypt(uni.getStorageSync('nickname')); |
|
|
|
|
that.headimgurl = aes.aesDecrypt(uni.getStorageSync('headimgurl')); |
|
|
|
|
that.getUserInterest(); //回显兴趣定制数据 |
|
|
|
|
that.getAndroidUserKey(); //推送 |
|
|
|
|
uni.hideLoading(); |
|
|
|
|
that.saveLoginLog(uni.getStorageSync('unionid')); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
jump: function (obj) { |
|
|
|
|
if (obj == 'aboutus') { |
|
|
|
|
uni.navigateTo({ |
|
|
|
@ -409,17 +356,6 @@ export default { |
|
|
|
|
uni.removeStorageSync('adminId'); |
|
|
|
|
this.adminId = ''; |
|
|
|
|
this.isAdminLogin = false; |
|
|
|
|
} else if (obj == 'logoutWechat') { |
|
|
|
|
if (!uni.getStorageSync('unionid') || uni.getStorageSync('unionid') == '' || uni.getStorageSync('unionid') == null) { |
|
|
|
|
uni.removeStorageSync('nickname'); |
|
|
|
|
uni.removeStorageSync('headimgurl'); |
|
|
|
|
uni.removeStorageSync('oauthTime'); |
|
|
|
|
uni.removeStorageSync('openid'); |
|
|
|
|
uni.removeStorageSync('unionid'); |
|
|
|
|
this.nickname = '点击授权'; |
|
|
|
|
this.headimgurl = '../../static/images/adm_img.png'; |
|
|
|
|
this.isLogin = false; |
|
|
|
|
} |
|
|
|
|
} else if (obj == 'myComment') { |
|
|
|
|
if (!uni.getStorageSync('unionid') || uni.getStorageSync('unionid') == '' || uni.getStorageSync('unionid') == null) { |
|
|
|
|
uni.showToast({ |
|
|
|
@ -447,7 +383,7 @@ export default { |
|
|
|
|
uni.removeStorageSync('oauthTime'); |
|
|
|
|
uni.removeStorageSync('openid'); |
|
|
|
|
uni.removeStorageSync('unionid'); |
|
|
|
|
that.nickname = '点击授权'; |
|
|
|
|
that.nicknames = '点击授权'; |
|
|
|
|
that.headimgurl = 'https://www.lbgjtoa.com/appImg/icon-person-01.png'; |
|
|
|
|
that.isLogin = false; |
|
|
|
|
} else if (res.cancel) { |
|
|
|
@ -534,7 +470,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style> |
|
|
|
@ -582,9 +518,21 @@ export default { |
|
|
|
|
.t-setting { |
|
|
|
|
width: 50rpx; |
|
|
|
|
height: 50rpx; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
.set-img { |
|
|
|
|
width: 100%; |
|
|
|
|
height: 100% } |
|
|
|
|
height: 100%; |
|
|
|
|
} |
|
|
|
|
.person_inf{ |
|
|
|
|
width: 50%; |
|
|
|
|
} |
|
|
|
|
.pes_inf { |
|
|
|
|
width: 99%; |
|
|
|
|
} |
|
|
|
|
.t_nic { |
|
|
|
|
width: 100%; |
|
|
|
|
white-space: nowrap; |
|
|
|
|
text-overflow: ellipsis; |
|
|
|
|
overflow: hidden; |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|