From 2a95c0e1761df8ffb9113a7568e9973071d55d26 Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Sat, 11 Apr 2026 00:23:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E8=B4=AD=E4=B9=B0=E8=AF=A6?= =?UTF-8?q?=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bundle/combo/details.vue | 164 +++++++++++++++++++++++++-------------- 1 file changed, 107 insertions(+), 57 deletions(-) diff --git a/bundle/combo/details.vue b/bundle/combo/details.vue index 946aee3..32f9418 100644 --- a/bundle/combo/details.vue +++ b/bundle/combo/details.vue @@ -6,11 +6,13 @@ - {{ info.eg_name }} + {{ info.eg_name }} + {{ info.name }} - - - 有效期:2026.03.05到期 + + + + 有效期:{{ info.order.end_time }}到期 @@ -26,13 +28,15 @@ - + + - + VIP优惠 @@ -41,7 +45,8 @@ - + 入场不限次 @@ -50,7 +55,8 @@ - + 专属客服 @@ -62,7 +68,8 @@ - + + 权益说明 更多会员专属权益与服务内容 @@ -95,7 +102,7 @@ 会员购买 - + 月卡 @@ -130,10 +137,12 @@ - + + 确定 - + @@ -151,7 +160,12 @@ export default { showBuyModal: false, // 会员购买弹窗 showSuccessModal: false, // 购买成功弹窗 selectedPlan: 1, // 选择的套餐 1-月卡 2-季卡 - info: null, // 套餐详情数据 + info: { + order: { + group_id: 0, // 套餐ID + end_time: '', // 会员到期时间 + }, + }, // 套餐详情数据 }; }, created() { @@ -188,45 +202,45 @@ export default { handleSubmit() { let self = this; + + // 判断之前是否开通过任意一张会员卡,如果开通过且没有过期,提示"您已购买过套餐卡,无需重复购买" + if (self.info.order.end_time) { + uni.showToast({ title: '您已购买过套餐卡,无需重复购买', icon: 'none' }); + return false; + } + //TODO 如果信息审核没有通过,uni.showToast提示"信息审核没通过,请耐心等待" // 成人卡不需要提交资料 if (self.id == 2) { self.showBuyModal = true; } else { self._post( - 'ground.group/getGroupData', - null, - result => { - if (!result.data) { - // 没有填写过信息,弹出完善信息提示弹窗 - self.showInfoModal = true; - return false; - } + 'ground.group/getGroupData', + null, + result => { + if (!result.data) { + // 没有填写过信息,弹出完善信息提示弹窗 + self.showInfoModal = true; + return false; + } - if (result.data.status == 0) { - uni.showToast({ title: '信息审核中,请耐心等待', icon: 'none' }); - } + if (result.data.status == 0) { + uni.showToast({ title: '信息审核中,请耐心等待', icon: 'none' }); + } - if (result.data.status == 2) { - uni.showToast({ title: '审核失败,请重新提交', icon: 'none' }); - } + if (result.data.status == 2) { + uni.showToast({ title: '审核失败,请重新提交', icon: 'none' }); + } - if (result.data.status == 1) { - // 已经审核通过,弹出开通会员弹窗 - self.showBuyModal = true; + if (result.data.status == 1) { + // 已经审核通过,弹出开通会员弹窗 + self.showBuyModal = true; + } + }, + false, + () => { } - }, - false, - () => { - } - ); - // const hasFilledInfo = true; - // if (!hasFilledInfo) { - // self.showInfoModal = true; - // } else { - // // 已经填写过信息,弹出开通会员弹窗 - // self.showBuyModal = true; - // } + ); } }, closeInfoModal() { @@ -252,20 +266,54 @@ export default { 'order.group/submitStoreOrder', { group_id: self.id, - type: self.selectedPlan, // 1-月卡 2-季卡 + group_type: self.selectedPlan, // 1-月卡 2-季卡 order_amount: self.selectedPlan === 1 ? self.info.month_price : self.info.seasonal_price }, result => { - console.log("🚀 ~ result:", result) + if (result.code == 1) { + uni.showLoading({ + title: '支付中' + }); + const payId = result.data.lists.id; + self._post( + 'order.group/Pay', { + order_id: payId, + }, + function (pay) { + console.log("🚀 ~ pay:", pay) + uni.requestPayment({ + provider: 'wxpay', + timeStamp: pay.data.payment.timeStamp, + nonceStr: pay.data.payment.nonceStr, + package: 'prepay_id=' + pay.data.payment.prepay_id, + signType: 'MD5', + paySign: pay.data.payment.paySign, + success: res => { + uni.hideLoading(); + setTimeout(() => { + self.showSuccessModal = true; + }, 1000); + }, + fail: res => { + setTimeout(() => { + uni.showToast({ + title: '支付失败', + icon: 'none' + }); + }, 200); + }, + }); + } + ); + } else { + uni.showToast({ title: result.msg || '订单创建失败', icon: 'none' }); + } }, false, () => { } ) - setTimeout(() => { - self.showSuccessModal = true; - }, 1000); }, closeSuccessModal() { this.showSuccessModal = false; @@ -287,7 +335,7 @@ page { position: relative; width: 100%; height: 460rpx; - + .bg-img { position: absolute; top: 0; @@ -310,6 +358,7 @@ page { font-weight: 500; margin-bottom: 8rpx; } + .zh { font-size: 32rpx; color: #D19A57; @@ -324,6 +373,7 @@ page { font-weight: 500; margin-bottom: 8rpx; } + .zh { font-size: 32rpx; color: #834B08; @@ -340,8 +390,8 @@ page { display: flex; justify-content: flex-end; align-items: center; - - + + } } @@ -373,11 +423,11 @@ page { position: relative; z-index: 1; padding: 40rpx 30rpx 0; - + .card-img { width: 100%; border-radius: 20rpx; - box-shadow: 0 10rpx 20rpx rgba(0,0,0,0.1); + box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.1); } } } @@ -496,7 +546,7 @@ page { box-sizing: border-box; .btn-submit { - background: linear-gradient( 90deg, #F6E1B0 0%, #EDC66E 100%); + background: linear-gradient(90deg, #F6E1B0 0%, #EDC66E 100%); color: #333; font-size: 32rpx; font-weight: bold; @@ -617,7 +667,7 @@ page { padding: 50rpx 40rpx; padding-bottom: calc(50rpx + env(safe-area-inset-bottom)); z-index: 101; - + .buy-modal-title { text-align: center; font-size: 36rpx; @@ -681,7 +731,7 @@ page { height: 40rpx; background-color: #D4B481; border-radius: 20rpx 0 0 0; - + &::after { content: ''; position: absolute; @@ -705,7 +755,7 @@ page { } .buy-modal-btn { - background: linear-gradient( 90deg, #F6E1B0 0%, #EDC66E 100%); + background: linear-gradient(90deg, #F6E1B0 0%, #EDC66E 100%); color: #333; font-size: 32rpx; font-weight: bold; @@ -763,7 +813,7 @@ page { transform: translateX(-50%); width: 396rpx; height: 88rpx; - background: linear-gradient( 90deg, #F6E1B0 0%, #EDC66E 100%); + background: linear-gradient(90deg, #F6E1B0 0%, #EDC66E 100%); border-radius: 44rpx; display: flex; align-items: center;