Fix:团购订单核销后没有同步弹出体验券领取弹窗,用户首次进入该团购订单详情页才会显示弹窗

This commit is contained in:
linxi
2026-04-23 12:58:43 +08:00
parent ef36b27c54
commit a86b416ed8
+21 -7
View File
@@ -107,7 +107,7 @@
</view> -->
<view class="experience-actions v12-align-center">
<view class="v12-font-28 v12-dark-border v12-radius-100 v12-px-2 close-btn" @click="showExperienceCouponPopup = !showExperienceCouponPopup">暂不领取</view>
<view class="v12-font-28 v12-dark-border v12-radius-100 v12-px-2 close-btn" @click="handleCloseExperienceCouponPopup">暂不领取</view>
<view class="v12-font-28 v12-primary-text v12-primary-border v12-radius-100 v12-px-2 go-btn" @click="goExperienceCoupon">去领取体验券</view>
</view>
</u-popup>
@@ -241,14 +241,14 @@ export default {
isView: 0,
showExperienceCouponPopup: false,
experienceCouponId: null,
hasCheckedExperienceCoupon: false,
experienceCouponPopupDismissed: false,
orderStatusTimer: null
}
},
onLoad(otps) {
this.key = otps.id;
this.isView = otps.isView || 0;
this.hasCheckedExperienceCoupon = false;
this.experienceCouponPopupDismissed = false;
},
onShow() {
this.getSojoumOrderDetail();
@@ -331,7 +331,7 @@ export default {
* 获取旅居团购订单详情
*/
async getSojoumOrderDetail(options = {}) {
const { showLoading = true } = options;
const { showLoading = true, checkCoupon = true } = options;
const params = {
key: this.key
}
@@ -347,8 +347,7 @@ export default {
this.orderInfo = res.data;
this.orderInfo.minBookingDays = this.getDaysCount();
this.startOrderStatusPolling();
if (!this.hasCheckedExperienceCoupon) {
this.hasCheckedExperienceCoupon = true;
if (checkCoupon) {
this.checkExperienceCouponStatus();
}
}
@@ -398,13 +397,27 @@ export default {
return;
}
if (!showPopup) {
this.showExperienceCouponPopup = false;
return;
}
this.experienceCouponId = data.couponId || null;
const couponId = data.couponId || null;
if (
this.experienceCouponPopupDismissed &&
couponId &&
couponId === this.experienceCouponId
) {
return;
}
this.experienceCouponId = couponId;
this.experienceCouponPopupDismissed = false;
this.showExperienceCouponPopup = true;
} catch (e) {
}
},
handleCloseExperienceCouponPopup() {
this.showExperienceCouponPopup = false;
this.experienceCouponPopupDismissed = true;
},
/**
* 格式化日期
* @param {string} dateStr - 格式为 yyyy-MM-dd 的日期字符串
@@ -496,6 +509,7 @@ export default {
},
goExperienceCoupon() {
this.showExperienceCouponPopup = false;
this.experienceCouponPopupDismissed = false;
const couponId = this.experienceCouponId;
let url = '/pkg_product/views/experienceCoupon';
if (couponId) {