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() { async onLoad() {
this.getUserPoints(); // this.getUserPoints();
// this.handleGetUserDetail()
const results = await Promise.all([
this.getUserPoints(),
this.handleGetUserDetail() this.handleGetUserDetail()
]);
this.userPoints = results[0]
this.platformUserPoints = results[1]
}, },
computed: { computed: {
...mapGetters({ ...mapGetters({
@ -171,13 +177,13 @@ export default {
// //
async handleGetUserDetail() { async handleGetUserDetail() {
let _this = this; let _this = this;
_this.$api
const data = await _this.$api
.getCoop({ .getCoop({
action_type: "GetMembershipInfo", action_type: "GetMembershipInfo",
WechatUserId: _this.user.WechatUserId, WechatUserId: _this.user.WechatUserId,
noLoading: true, noLoading: true,
}) })
.then(function (data) {
if (data.ResultCode === "100") { if (data.ResultCode === "100") {
let _data = data; let _data = data;
_this.userInfo = _data.Data _this.userInfo = _data.Data
@ -202,14 +208,15 @@ export default {
_this.user.TEST_MEMBER = _data.Data.TEST_MEMBER || ""; _this.user.TEST_MEMBER = _data.Data.TEST_MEMBER || "";
_this.$store.commit("setUser", _this.user); _this.$store.commit("setUser", _this.user);
_this.platformUserPoints = _data.Data.MEMBERSHIP_POINT // _this.platformUserPoints = _data.Data.MEMBERSHIP_POINT
_this.$forceUpdate() _this.$forceUpdate()
return _data.Data.MEMBERSHIP_POINT
} else { } else {
// _this.setUser({}); // _this.setUser({});
_this.$store.commit("setUser", user); _this.$store.commit("setUser", user);
return 0
} }
});
}, },
// //
@ -232,12 +239,14 @@ export default {
const data = await this.$api.$post('/MemberApi/ThirdInterface/GetYTSLMemberPoint', req) const data = await this.$api.$post('/MemberApi/ThirdInterface/GetYTSLMemberPoint', req)
uni.hideLoading() uni.hideLoading()
if (data.Result_Code === 100) { if (data.Result_Code === 100) {
this.userPoints = data.Result_Data.balance; // this.userPoints = data.Result_Data.balance;
return data.Result_Data.balance;
} else { } else {
uni.showToast({ uni.showToast({
title: data.Result_Desc, title: data.Result_Desc,
icon: 'none' icon: 'none'
}); });
return 0
} }
}, },
@ -326,8 +335,16 @@ export default {
}); });
this.sourcePointsInput = ''; this.sourcePointsInput = '';
this.destinationPointsOutput = 0; this.destinationPointsOutput = 0;
this.getUserPoints(); // ETC // this.getUserPoints(); // ETC
this.handleGetUserDetail(); // 驿 // this.handleGetUserDetail(); // 驿
const results = await Promise.all([
this.getUserPoints(),
this.handleGetUserDetail()
]);
this.userPoints = results[0]
this.platformUserPoints = results[1]
} else { } else {
uni.showToast({ uni.showToast({
title: data.Result_Desc, title: data.Result_Desc,