From c9c1d74957a552e332b12747198c7930e7ed6ccc Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Fri, 10 Apr 2026 00:16:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A5=97=E9=A4=90=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bundle/combo/combo-list.vue | 64 ++++++--- bundle/combo/details.vue | 174 ++++++++++++----------- bundle/combo/info.vue | 274 +++++++++++++++++++++++++++++------- 3 files changed, 354 insertions(+), 158 deletions(-) diff --git a/bundle/combo/combo-list.vue b/bundle/combo/combo-list.vue index 17ef71d..2e11516 100644 --- a/bundle/combo/combo-list.vue +++ b/bundle/combo/combo-list.vue @@ -4,29 +4,11 @@ - + - - - 立即开通 - - - - - - - - - - 立即开通 - - - - - - - - + + {{ item.eg_name }} + {{ item.name }} 立即开通 @@ -45,10 +27,28 @@ export default { }, data() { return { - + list: [], } }, + onLoad() { + this.handleGetList(); + }, methods: { + handleGetList() { + // 获取套餐卡列表 + let self = this; + self._post( + 'ground.group/getGroupList', + null, + result => { + self.list = result.data; + }, + false, + () => { + } + ); + }, + /*跳转页面*/ jumpPage(path) { this.gotoPage(path); @@ -63,6 +63,24 @@ page { background-color: #fff; } +.kt-eg-name { + position: absolute; + left: 46rpx; + top: 52rpx; + color: #C2863E; + font-size: 36rpx; + font-weight: 400; +} + +.kt-name { + position: absolute; + left: 64rpx; + top: 118rpx; + color: #C2863E; + font-size: 36rpx; + font-weight: 400; +} + .kt-btn-bg { position: absolute; left: 34rpx; diff --git a/bundle/combo/details.vue b/bundle/combo/details.vue index dca178e..6396b1d 100644 --- a/bundle/combo/details.vue +++ b/bundle/combo/details.vue @@ -2,56 +2,18 @@ - - - - - - - - + @@ -105,10 +67,7 @@ 权益说明 更多会员专属权益与服务内容 - · 这里是权益说明内容,这里是内容 - · 这里是权益说明内容,这里是内容 - · 这里是权益说明内容,这里是内容 - · 这里是权益说明内容,这里是内容 + @@ -142,27 +101,18 @@ 月卡 - 50.00 + {{ info.price }} - 指导价50元/月 + 指导价{{ info.month_price }}元/月 季卡 - 128.00 + {{ info.price }} - 指导价128元/季 - - - - 年卡 - - - 218.00 - - 指导价218元/年 + 指导价{{ info.month_price }}元/季 @@ -193,6 +143,7 @@ export default { data() { return { + id: 0, statusBarHeight: 20, navHeight: 44, comboType: 'adult', // 套餐类型:adult(成人卡) youth(青年卡) family(亲子卡) @@ -200,6 +151,7 @@ export default { showBuyModal: false, // 会员购买弹窗 showSuccessModal: false, // 购买成功弹窗 selectedPlan: 0, // 选择的套餐 + info: null, // 套餐详情数据 }; }, created() { @@ -212,25 +164,69 @@ export default { }, onLoad(args) { this.comboType = args.type || 'adult' + this.id = args.id + this.handleGetDetails(); }, methods: { goBack() { uni.navigateBack(); }, - handleSubmit() { - this.showSuccessModal = true; - return false - //TODO 如果信息审核没有通过,uni.showToast提示"信息审核没通过,请耐心等待" + handleGetDetails() { + let self = this; + self._post( + 'ground.group/getGroupDetails', + { id: self.id }, + result => { + self.info = result.data; + }, + false, + () => { + } + ); + }, - // 检测是否填写过表单信息,没有的话需要跳转到信息完善页面 - // 测试:默认 true 弹出购买弹窗。如果为 false 弹出提示完善信息弹窗 - const hasFilledInfo = true; - if (!hasFilledInfo) { - this.showInfoModal = true; + handleSubmit() { + let self = this; + //TODO 如果信息审核没有通过,uni.showToast提示"信息审核没通过,请耐心等待" + // 成人卡不需要提交资料 + if (self.id == 2) { + self.showBuyModal = true; } else { - // 已经填写过信息,弹出开通会员弹窗 - this.showBuyModal = true; + self._post( + '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 == 2) { + uni.showToast({ title: '审核失败,请重新提交', icon: 'none' }); + } + + if (result.data.status == 1) { + // 已经审核通过,弹出开通会员弹窗 + self.showBuyModal = true; + } + }, + false, + () => { + } + ); + // const hasFilledInfo = true; + // if (!hasFilledInfo) { + // self.showInfoModal = true; + // } else { + // // 已经填写过信息,弹出开通会员弹窗 + // self.showBuyModal = true; + // } } }, closeInfoModal() { @@ -239,7 +235,7 @@ export default { goToFillInfo() { this.showInfoModal = false; uni.navigateTo({ - url: '/bundle/combo/info?type=' + this.comboType + url: '/bundle/combo/info?id=' + this.id }); }, closeBuyModal() { @@ -329,16 +325,14 @@ page { justify-content: flex-end; align-items: center; - .diamond { - width: 26rpx; - height: 20rpx; - margin-right: 6rpx; - } + } } .nav-header { - position: relative; + position: absolute; + top: 0; + left: 0; z-index: 1; width: 100%; @@ -480,6 +474,7 @@ page { bottom: 0; left: 0; width: 100%; + z-index: 99; background-color: #fff; padding: 20rpx 40rpx 60rpx; box-sizing: border-box; @@ -621,7 +616,7 @@ page { margin-bottom: 40rpx; .plan-item { - width: 31%; + width: 48%; border: 2rpx solid #EEEEEE; border-radius: 12rpx; padding: 38rpx 0; @@ -769,4 +764,17 @@ page { margin-top: 40rpx; } } + +.info-name { + font-weight: bold; + font-size: 32rpx; + color: #834B08; + line-height: 44rpx; +} + +.diamond { + width: 26rpx; + height: 20rpx; + margin-right: 6rpx; +} \ No newline at end of file diff --git a/bundle/combo/info.vue b/bundle/combo/info.vue index 5a75208..279fcdf 100644 --- a/bundle/combo/info.vue +++ b/bundle/combo/info.vue @@ -4,56 +4,122 @@ - + - 基本信息 * + 基本信息 * - + 姓名 - + - + 出生年月 - - - {{ formData.birth || '请选择出生年月' }} - + + + {{ formData.youth.both || '请选择出生年月' }} + 身份证号 - + + + + + + + + 家长1基本信息 * + + + + 姓名 + + + + + 出生年月 + + + {{ formData.parents[0].both || '请选择出生年月' }} + + + + + + + 身份证号 + + + + + + + + 家长2基本信息 * + + + + 姓名 + + + + + 出生年月 + + + {{ formData.parents[1].both || '请选择出生年月' }} + + + + + + + 身份证号 + - + 随行子女信息 * - + 姓名 - + - + 出生年月 - - - {{ formData.childBirth || '请选择出生年月' }} - + + + {{ formData.child.both || '请选择出生年月' }} + 身份证号 - + @@ -62,10 +128,11 @@ 联系方式 * - + 联系电话 - + @@ -73,7 +140,7 @@ *提交表单申请,工作人员将在3个工作日内进行审核,如需及时了解,请直接电话咨询,我们将在第一时间解答 - + 联系我们 @@ -82,10 +149,11 @@ - + - + 信息提交成功 请您耐心等候,我们将尽快为您审核 好的 @@ -102,45 +170,146 @@ export default { components: { navbar, }, + computed: { + endDate() { + const date = new Date(); + date.setDate(date.getDate() - 1); + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); + const day = String(date.getDate()).padStart(2, '0'); + return `${year}-${month}-${day}`; + } + }, data() { return { showSuccessPopup: false, comboType: 'adult', // 套餐类型:adult(成人卡) youth(青年卡) family(亲子卡) formData: { - name: '', - birth: '', - idCard: '', + parents: [ + { name: '', both: '', card: '' }, + { name: '', both: '', card: '' } + ], + youth: { + name: '', + both: '', + card: '', + }, + child: { + name: '', + both: '', + card: '', + }, phone: '', - childName: '', - childBirth: '', - childIdCard: '' - } + group_id: 0 + }, + id: 0, + isSubmitting: false } }, onLoad(args) { this.comboType = args.type || 'adult' + this.id = args.id + this.formData.group_id = this.id }, methods: { - onDateChange(e) { - this.formData.birth = e.detail.value; + onYouthDateChange(e) { + this.formData.youth.both = e.detail.value; }, + + onParentDateChange(e, index) { + this.formData.parents[index].both = e.detail.value; + }, + onChildDateChange(e) { - this.formData.childBirth = e.detail.value; + this.formData.child.both = e.detail.value; }, + contactUs() { uni.showToast({ title: '正在连接客服...', icon: 'none' }); }, + submitForm() { - if(!this.formData.name || !this.formData.birth || !this.formData.idCard || !this.formData.phone) { - return uni.showToast({ title: '请填写完整包含星号的信息', icon: 'none' }); - } - if(this.comboType === 'family') { - if(!this.formData.childName || !this.formData.childBirth || !this.formData.childIdCard) { - return uni.showToast({ title: '请填写随行子女信息', icon: 'none' }); + let self = this; + + // id == 1 验证 youth 属性 + if (self.id == 1) { + let youth = self.formData.youth; + if (!youth || !youth.name || !youth.both || !youth.card) { + return uni.showToast({ title: '请填写完整基本信息', icon: 'none' }); } } - this.showSuccessPopup = true; + + // id == 3(第一个亲子卡) 或 4 时,验证 parents[0] 和 child 属性 + if (self.id == 3 || self.id == 4) { + let p0 = self.formData.parents[0]; + if (!p0 || !p0.name || !p0.both || !p0.card) { + return uni.showToast({ title: '请填写完整家长1基本信息', icon: 'none' }); + } + + let child = self.formData.child; + if (!child || !child.name || !child.both || !child.card) { + return uni.showToast({ title: '请填写完整随行子女信息', icon: 'none' }); + } + } + + // id == 4 时(第二个亲子卡),还需要额外验证 parents[1] 属性 + if (self.id == 4) { + let p1 = self.formData.parents[1]; + if (!p1 || !p1.name || !p1.both || !p1.card) { + return uni.showToast({ title: '请填写完整家长2基本信息', icon: 'none' }); + } + } + + // 所有场景必填联系电话 + if (!self.formData.phone) { + return uni.showToast({ title: '请填写联系电话', icon: 'none' }); + } + + const phoneReg = /^1[3-9]\d{9}$/; + if (!phoneReg.test(self.formData.phone)) { + return uni.showToast({ title: '请输入正确的手机号码', icon: 'none' }); + } + + if (self.isSubmitting) return; + self.isSubmitting = true; + uni.showLoading({ title: '提交中...', mask: true }); + + let submitData = { + ...self.formData, + parents: JSON.stringify(self.formData.parents), + youth: JSON.stringify(self.formData.youth), + child: JSON.stringify(self.formData.child) + }; + + self._post( + 'ground.group/submitGroupData', + submitData, + result => { + uni.hideLoading(); + if (result.code) { + self.formData = { + parents: [ + { name: '', both: '', card: '' }, + { name: '', both: '', card: '' } + ], + youth: { name: '', both: '', card: '' }, + child: { name: '', both: '', card: '' }, + phone: '', + group_id: self.id + }; + self.showSuccessPopup = true; + } else { + uni.showToast({ title: '提交失败', icon: 'none' }); + } + }, + false, + () => { + uni.hideLoading(); + self.isSubmitting = false; + } + ) }, + confirmSuccess() { this.showSuccessPopup = false; // 点击好的之后,可以跳转或返回上一页 @@ -178,7 +347,7 @@ page { margin-bottom: 30rpx; display: flex; align-items: center; - + .required { color: #E53935; margin-left: 8rpx; @@ -190,27 +359,27 @@ page { margin-bottom: 10rpx; border-bottom: 2rpx solid #F5F5F5; padding-bottom: 16rpx; - + &.no-border { border-bottom: none; margin-bottom: 0; padding-bottom: 0; } - + .label { font-size: 28rpx; color: #666666; margin-bottom: 20rpx; margin-top: 30rpx; } - + .input { font-size: 30rpx; color: #333333; width: 100%; height: 60rpx; } - + .picker-view { font-size: 30rpx; color: #CCCCCC; @@ -218,10 +387,11 @@ page { display: flex; align-items: center; justify-content: space-between; - + &.has-value { color: #333333; } + .arrow-down { font-size: 30rpx; color: #CCCCCC; @@ -235,13 +405,13 @@ page { display: flex; align-items: center; margin-top: 30rpx; - + .label { font-size: 30rpx; color: #333333; width: 160rpx; } - + .input-grey { flex: 1; background-color: #F6F7F8; @@ -282,7 +452,7 @@ page { box-sizing: border-box; display: flex; justify-content: space-between; - + .btn { flex: 1; height: 88rpx; @@ -292,13 +462,13 @@ page { font-size: 32rpx; border-radius: 8rpx; } - + .btn-default { background-color: #FFFFFF; color: #333333; margin-right: 20rpx; } - + .btn-primary { background-color: #3B5B9B; color: #FFFFFF;