This commit is contained in:
ylj20011123 2025-12-02 18:43:56 +08:00
parent caba7797f1
commit 4234ea9dd9

View File

@ -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,