fix: pass talent context to cinema coupon detail
| | |
| | | const callCinema = () => { if (cinemaMobile.value == '') { uni.showToast({ title: '影城暂未提供联系电话', icon: 'none' }); return }; uni.makePhoneCall({ phoneNumber: cinemaMobile.value, fail: () => uni.showToast({ title: '暂时无法拨打电话', icon: 'none' }) }) } |
| | | const requestClaimCoupon = (item: any) => { if (item.claimed) { uni.showToast({ title: '当前暂无可领取次数', icon: 'none' }); return }; if (item.soldOut) { uni.showToast({ title: item.unavailableReason != null && item.unavailableReason != '' ? item.unavailableReason : '电影券已领完', icon: 'none' }); return }; if (item.quotaRemaining == null || Number(item.quotaRemaining) <= 0) { uni.showToast({ title: '当前暂无可领取次数', icon: 'none' }); return }; pendingCouponId.value = item.id; pendingCouponStock.value = Number(item.quotaRemaining); showClaimDialog.value = true } |
| | | const closeClaimDialog = () => { if (isSubmitting.value) return; showClaimDialog.value = false; pendingCouponId.value = ''; pendingCouponStock.value = 0 } |
| | | const confirmClaimCoupon = () => { if (isSubmitting.value || pendingCouponId.value == '') return; isSubmitting.value = true; claimTicketPackage(pendingCouponId.value, talentId.value, cardId.value, (data: any) => { isSubmitting.value = false; showClaimDialog.value = false; loadCoupons(); const claimId = data.claimId != null ? String(data.claimId) : ''; uni.navigateTo({ url: '/pages/coupon-received/coupon-received?type=ticketPackage&name=' + encodeURIComponent('电影票兑换券') + '&claimId=' + encodeURIComponent(claimId) + '&merchantId=' + encodeURIComponent(merchantId.value) }) }, (error) => { isSubmitting.value = false; uni.showToast({ title: error.message, icon: 'none' }) }, merchantId.value) } |
| | | const confirmClaimCoupon = () => { if (isSubmitting.value || pendingCouponId.value == '') return; isSubmitting.value = true; claimTicketPackage(pendingCouponId.value, talentId.value, cardId.value, (data: any) => { isSubmitting.value = false; showClaimDialog.value = false; loadCoupons(); const claimId = data.claimId != null ? String(data.claimId) : ''; uni.navigateTo({ url: '/pages/coupon-received/coupon-received?type=ticketPackage&name=' + encodeURIComponent('电影票兑换券') + '&claimId=' + encodeURIComponent(claimId) + '&merchantId=' + encodeURIComponent(merchantId.value) + '&talentId=' + encodeURIComponent(talentId.value) }) }, (error) => { isSubmitting.value = false; uni.showToast({ title: error.message, icon: 'none' }) }, merchantId.value) } |
| | | const replaceHeroImage = () => { cinemaHero.value = fallbackImage }; const replaceCouponImage = (item: any) => { item.image = fallbackImage } |
| | | </script> |
| | | |
| | |
| | | // #ifdef MP-WEIXIN |
| | | const capsule = uni.getMenuButtonBoundingClientRect(); const systemInfo = uni.getSystemInfoSync(); navTop.value = capsule.top; navHeight.value = capsule.height; navWidth.value = capsule.width; navRight.value = systemInfo.windowWidth - capsule.right |
| | | // #endif |
| | | if (options != null && options['claimId'] != null) claimId.value = String(options['claimId']); if (options != null && options['merchantId'] != null) merchantId.value = String(options['merchantId']); if (options != null && options['type'] != null) claimType.value = String(options['type']); if (options != null && options['name'] != null) couponName.value = decodeURIComponent(String(options['name'])); const session = getSession(); if (session != null && session.talentId != null) talentId.value = String(session.talentId); if (talentId.value == '' && apiEnvironment == 'development') talentId.value = '2'; loadClaim() |
| | | if (options != null && options['claimId'] != null) claimId.value = String(options['claimId']); if (options != null && options['merchantId'] != null) merchantId.value = String(options['merchantId']); if (options != null && options['type'] != null) claimType.value = String(options['type']); if (options != null && options['name'] != null) couponName.value = decodeURIComponent(String(options['name'])); if (options != null && options['talentId'] != null) talentId.value = String(options['talentId']); const session = getSession(); if (talentId.value == '' && session != null && session.talentId != null) talentId.value = String(session.talentId); if (talentId.value == '' && apiEnvironment == 'development') talentId.value = '2'; loadClaim() |
| | | }) |
| | | const progressPercent = computed(() => annualTotal.value > 0 ? Math.min(100, Math.round(annualClaimed.value * 100 / annualTotal.value)) : 0) |
| | | const canCopy = computed(() => exchangeCodeStatus.value == 'ACTIVE' && exchangeCode.value != '') |
| | |
| | | const detailName = item.detailName != null ? item.detailName as string : item.name as string |
| | | const claimId = item.targetDetailId != null ? item.targetDetailId as string : '' |
| | | const typeParam = item.targetDetailType == 'TICKET_PACKAGE_DETAIL' ? '&type=ticketPackage' : '' |
| | | uni.navigateTo({ url: '/pages/coupon-received/coupon-received?recordId=' + encodeURIComponent(item.id) + '&claimId=' + encodeURIComponent(claimId) + '&name=' + encodeURIComponent(detailName) + typeParam }) |
| | | uni.navigateTo({ url: '/pages/coupon-received/coupon-received?recordId=' + encodeURIComponent(item.id) + '&claimId=' + encodeURIComponent(claimId) + '&name=' + encodeURIComponent(detailName) + typeParam + '&talentId=' + encodeURIComponent(talentId.value) + '&merchantId=' + encodeURIComponent(item.merchantId) }) |
| | | return |
| | | } |
| | | uni.showToast({ title: '记录详情后续接入', icon: 'none' }) |