Fix:团购订单核销后没有同步弹出体验券领取弹窗,用户首次进入该团购订单详情页才会显示弹窗
(cherry picked from commit a86b416ed8)
This commit is contained in:
@@ -107,7 +107,7 @@
|
|||||||
|
|
||||||
</view> -->
|
</view> -->
|
||||||
<view class="experience-actions v12-align-center">
|
<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 class="v12-font-28 v12-primary-text v12-primary-border v12-radius-100 v12-px-2 go-btn" @click="goExperienceCoupon">去领取体验券</view>
|
||||||
</view>
|
</view>
|
||||||
</u-popup>
|
</u-popup>
|
||||||
@@ -241,14 +241,14 @@ export default {
|
|||||||
isView: 0,
|
isView: 0,
|
||||||
showExperienceCouponPopup: false,
|
showExperienceCouponPopup: false,
|
||||||
experienceCouponId: null,
|
experienceCouponId: null,
|
||||||
hasCheckedExperienceCoupon: false,
|
experienceCouponPopupDismissed: false,
|
||||||
orderStatusTimer: null
|
orderStatusTimer: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(otps) {
|
onLoad(otps) {
|
||||||
this.key = otps.id;
|
this.key = otps.id;
|
||||||
this.isView = otps.isView || 0;
|
this.isView = otps.isView || 0;
|
||||||
this.hasCheckedExperienceCoupon = false;
|
this.experienceCouponPopupDismissed = false;
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getSojoumOrderDetail();
|
this.getSojoumOrderDetail();
|
||||||
@@ -331,7 +331,7 @@ export default {
|
|||||||
* 获取旅居团购订单详情
|
* 获取旅居团购订单详情
|
||||||
*/
|
*/
|
||||||
async getSojoumOrderDetail(options = {}) {
|
async getSojoumOrderDetail(options = {}) {
|
||||||
const { showLoading = true } = options;
|
const { showLoading = true, checkCoupon = true } = options;
|
||||||
const params = {
|
const params = {
|
||||||
key: this.key
|
key: this.key
|
||||||
}
|
}
|
||||||
@@ -347,8 +347,7 @@ export default {
|
|||||||
this.orderInfo = res.data;
|
this.orderInfo = res.data;
|
||||||
this.orderInfo.minBookingDays = this.getDaysCount();
|
this.orderInfo.minBookingDays = this.getDaysCount();
|
||||||
this.startOrderStatusPolling();
|
this.startOrderStatusPolling();
|
||||||
if (!this.hasCheckedExperienceCoupon) {
|
if (checkCoupon) {
|
||||||
this.hasCheckedExperienceCoupon = true;
|
|
||||||
this.checkExperienceCouponStatus();
|
this.checkExperienceCouponStatus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -398,13 +397,27 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!showPopup) {
|
if (!showPopup) {
|
||||||
|
this.showExperienceCouponPopup = false;
|
||||||
return;
|
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;
|
this.showExperienceCouponPopup = true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
handleCloseExperienceCouponPopup() {
|
||||||
|
this.showExperienceCouponPopup = false;
|
||||||
|
this.experienceCouponPopupDismissed = true;
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 格式化日期
|
* 格式化日期
|
||||||
* @param {string} dateStr - 格式为 yyyy-MM-dd 的日期字符串
|
* @param {string} dateStr - 格式为 yyyy-MM-dd 的日期字符串
|
||||||
@@ -496,6 +509,7 @@ export default {
|
|||||||
},
|
},
|
||||||
goExperienceCoupon() {
|
goExperienceCoupon() {
|
||||||
this.showExperienceCouponPopup = false;
|
this.showExperienceCouponPopup = false;
|
||||||
|
this.experienceCouponPopupDismissed = false;
|
||||||
const couponId = this.experienceCouponId;
|
const couponId = this.experienceCouponId;
|
||||||
let url = '/pkg_product/views/experienceCoupon';
|
let url = '/pkg_product/views/experienceCoupon';
|
||||||
if (couponId) {
|
if (couponId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user