update
This commit is contained in:
parent
caba7797f1
commit
4234ea9dd9
@ -158,9 +158,15 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.getUserPoints();
|
||||
async onLoad() {
|
||||
// this.getUserPoints();
|
||||
// this.handleGetUserDetail()
|
||||
const results = await Promise.all([
|
||||
this.getUserPoints(),
|
||||
this.handleGetUserDetail()
|
||||
]);
|
||||
this.userPoints = results[0]
|
||||
this.platformUserPoints = results[1]
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
@ -171,13 +177,13 @@ export default {
|
||||
// 拿到用户详情
|
||||
async handleGetUserDetail() {
|
||||
let _this = this;
|
||||
_this.$api
|
||||
|
||||
const data = await _this.$api
|
||||
.getCoop({
|
||||
action_type: "GetMembershipInfo",
|
||||
WechatUserId: _this.user.WechatUserId,
|
||||
noLoading: true,
|
||||
})
|
||||
.then(function (data) {
|
||||
if (data.ResultCode === "100") {
|
||||
let _data = data;
|
||||
_this.userInfo = _data.Data
|
||||
@ -202,14 +208,15 @@ export default {
|
||||
_this.user.TEST_MEMBER = _data.Data.TEST_MEMBER || "";
|
||||
_this.$store.commit("setUser", _this.user);
|
||||
|
||||
_this.platformUserPoints = _data.Data.MEMBERSHIP_POINT
|
||||
// _this.platformUserPoints = _data.Data.MEMBERSHIP_POINT
|
||||
|
||||
_this.$forceUpdate()
|
||||
return _data.Data.MEMBERSHIP_POINT
|
||||
} else {
|
||||
// _this.setUser({});
|
||||
_this.$store.commit("setUser", user);
|
||||
return 0
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 切换兑换方向
|
||||
@ -232,12 +239,14 @@ export default {
|
||||
const data = await this.$api.$post('/MemberApi/ThirdInterface/GetYTSLMemberPoint', req)
|
||||
uni.hideLoading()
|
||||
if (data.Result_Code === 100) {
|
||||
this.userPoints = data.Result_Data.balance;
|
||||
// this.userPoints = data.Result_Data.balance;
|
||||
return data.Result_Data.balance;
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: data.Result_Desc,
|
||||
icon: 'none'
|
||||
});
|
||||
return 0
|
||||
}
|
||||
},
|
||||
|
||||
@ -326,8 +335,16 @@ export default {
|
||||
});
|
||||
this.sourcePointsInput = '';
|
||||
this.destinationPointsOutput = 0;
|
||||
this.getUserPoints(); // 刷新ETC积分
|
||||
this.handleGetUserDetail(); // 刷新彩云驿积分
|
||||
// this.getUserPoints(); // 刷新ETC积分
|
||||
// this.handleGetUserDetail(); // 刷新彩云驿积分
|
||||
|
||||
const results = await Promise.all([
|
||||
this.getUserPoints(),
|
||||
this.handleGetUserDetail()
|
||||
]);
|
||||
this.userPoints = results[0]
|
||||
this.platformUserPoints = results[1]
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: data.Result_Desc,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user