Commit 3a27bcf0 authored by 肖健's avatar 肖健

个人中心更改

parent 88204685
......@@ -68,6 +68,13 @@ export default {
},
methods: {
getPrice() {
let token = uni.getStorageSync('userToken');
if(!token){
uni.navigateTo({
url: '/pages/binding/index?url=/pages/main&index=0'
})
return;
}
uni.showToast({
title: "您的免费领取次数已用完",
icon: 'none',
......
......@@ -54,7 +54,7 @@
</div>
</div>
</div>
<div class="ps__btn" @click="loginOut">退出登录</div>
<div class="ps__btn" v-if="logoutFlag" @click="loginOut">退出登录</div>
</view>
<u-gap bgColor="transparent" height="70"></u-gap>
</view>
......@@ -66,6 +66,7 @@ export default {
data() {
return {
show:false,
logoutFlag : true,
menu: [{
icon: require("@/static/my/my12.png"),
title: "我的地址",
......@@ -129,8 +130,8 @@ export default {
uni.removeStorageSync('xcxIndexPath')
// uni.removeStorageSync('openid')
uni.navigateTo({
url: '/pages/binding/index'
uni.reLaunch({
url: '/pages/main'
});
}
})
......@@ -145,7 +146,7 @@ export default {
let token = uni.getStorageSync('userToken');
if(!token){
uni.navigateTo({
url: '/pages/binding/index?url=/pages/main&param=4'
url: '/pages/binding/index?url=/pages/main&index=4'
})
return;
}
......@@ -163,12 +164,17 @@ export default {
url: '/pagesD/pages/personal/userInfo'
});
},
getUserInfo() {
async getUserInfo() {
let token = uni.getStorageSync('userToken');
if(!token){
this.logoutFlag = false
return
}
let opts = {
url: '/app/user/info',
method: 'get'
};
this.http.httpTokenRequest(opts, {}).then(res => {
await this.http.httpTokenRequest(opts, {}).then(res => {
if (res.data.code == 200) {
this.userInfo = res.data.data
if(this.userInfo.avatar){
......@@ -277,6 +283,10 @@ export default {
},
onShow() {
this.getUserInfo()
// setTimeout(() => {
// this.show=true
// }, 100);
},
};
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment