diff --git a/pages/venue/detail.vue b/pages/venue/detail.vue index 08e9d06..e058fbf 100644 --- a/pages/venue/detail.vue +++ b/pages/venue/detail.vue @@ -113,7 +113,8 @@ export default { return this.detailType !== '2' }, isPetrol() { - return this.loaded && String(this.shopId) === PETROL_SHOP_ID && !this.isVenue + // xuchao: 后端券服务探活(latest 返回 price)后才展示购券模块——后端未部署期间整模块自动隐藏,无死入口 + return this.loaded && String(this.shopId) === PETROL_SHOP_ID && !this.isVenue && !!(this.voucher && this.voucher.price) }, voucherBtnText() { const s = this.voucher ? this.voucher.statusCode : -1 @@ -170,10 +171,9 @@ export default { if (String(this.shopId) === PETROL_SHOP_ID) this.loadVoucher() }, methods: { - // xuchao: 拉取石油券最新订单状态(未登录不查,按钮保持“¥200 购买”,点击时再引导登录) + // xuchao: 拉取石油券最新订单状态(未登录也调用:作为后端服务探活,price 决定模块显隐) loadVoucher() { - const phone = uni.getStorageSync('phone') - if (!phone) { this.voucher = null; return } + const phone = uni.getStorageSync('phone') || '' this.$u.api.voucherLatest({ phone }).then(res => { this.voucher = bizOk(res) ? bizData(res) : null }).catch(() => { this.voucher = null })