|
|
|
@ -23,15 +23,15 @@ |
|
|
|
</view> |
|
|
|
<view class="lf-flex lf-row-between center-tag"> |
|
|
|
<view class="lf-row-center lf-flex-column" @click="$url('/pages/point/detail/detail')"> |
|
|
|
<view class="lf-font-36 lf-color-white">0</view> |
|
|
|
<view class="lf-font-36 lf-color-white">{{centerInfo.point || 0}}</view> |
|
|
|
<view class="lf-font-24 lf-color-white">积分</view> |
|
|
|
</view> |
|
|
|
<view class="lf-row-center lf-flex-column" @click="$url('/pages/recharge/balance/balance')"> |
|
|
|
<view class="lf-font-36 lf-color-white">0.00</view> |
|
|
|
<view class="lf-font-36 lf-color-white">{{centerInfo.balance || 0}}</view> |
|
|
|
<view class="lf-font-24 lf-color-white">余额(元)</view> |
|
|
|
</view> |
|
|
|
<view class="lf-row-center lf-flex-column" @click="$url('/pages/coupon/index/index')"> |
|
|
|
<view class="lf-font-36 lf-color-white">0</view> |
|
|
|
<view class="lf-font-36 lf-color-white">{{centerInfo.coupon || 0}}</view> |
|
|
|
<view class="lf-font-24 lf-color-white">优惠券</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -152,14 +152,10 @@ |
|
|
|
}], |
|
|
|
userInfo: {mobile_replace: '正在获取'}, // 用户信息 |
|
|
|
token: '', // 用户token |
|
|
|
code: '' |
|
|
|
code: '', |
|
|
|
centerInfo: {} |
|
|
|
} |
|
|
|
}, |
|
|
|
onShow(){ |
|
|
|
var userInfo = this.$cookieStorage.get('user_info'); |
|
|
|
console.log("userInfo", userInfo); |
|
|
|
this.userInfo = userInfo || {}; |
|
|
|
}, |
|
|
|
onLoad(){ |
|
|
|
var token = this.$cookieStorage.get('user_token'); |
|
|
|
this.token = token; |
|
|
|
@ -178,7 +174,8 @@ |
|
|
|
} |
|
|
|
// #endif |
|
|
|
} |
|
|
|
// this.getUserInfo(); |
|
|
|
this.getMeInfo(); |
|
|
|
this.getUcenter(); |
|
|
|
}, |
|
|
|
// 页面滚动 |
|
|
|
onPageScroll(event){ |
|
|
|
@ -189,16 +186,38 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
// 接口获取用户信息 |
|
|
|
getUserInfo(){ |
|
|
|
// 获取页面信息 |
|
|
|
getMeInfo(){ |
|
|
|
this.$http.get({ |
|
|
|
api: 'api/me', |
|
|
|
header: { |
|
|
|
Authorization: this.token |
|
|
|
} |
|
|
|
}).then(res => { |
|
|
|
console.log("---", res); |
|
|
|
this.userInfo = res.data.data; |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 获取积分等信息 |
|
|
|
getUcenter(){ |
|
|
|
this.$http.get({ |
|
|
|
api: 'api/users/ucenter', |
|
|
|
header: { |
|
|
|
Authorization: this.token |
|
|
|
} |
|
|
|
}).then(res => { |
|
|
|
console.log("getUcenter", res); |
|
|
|
this.centerInfo = res.data.data; |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 接口获取更新后的用户信息 |
|
|
|
getUpdateUserInfo(){ |
|
|
|
this.$http.get({ |
|
|
|
api: 'api/user', |
|
|
|
header: { |
|
|
|
Authorization: this.token |
|
|
|
} |
|
|
|
}).then(res => { |
|
|
|
console.log("1111", res) |
|
|
|
this.userInfo = res.data; |
|
|
|
this.$cookieStorage.set('user_info', res.data); |
|
|
|
}) |
|
|
|
}, |
|
|
|
@ -259,7 +278,7 @@ |
|
|
|
res = res.data; |
|
|
|
if (res.status) { |
|
|
|
// #ifdef MP-WEIXIN |
|
|
|
this.getUserInfo(); |
|
|
|
this.getUpdateUserInfo(); |
|
|
|
// #endif |
|
|
|
uni.hideLoading(); |
|
|
|
} else { |
|
|
|
|