From 5edfca8ff2b3efbe77e3aab6bc33007c0f38cb61 Mon Sep 17 00:00:00 2001 From: wangxiaowei <1121133807@qq.com> Date: Mon, 13 Apr 2026 01:53:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bundle/combo/desc.vue | 111 ++++++++++++++++++++++++++++ bundle/combo/details.vue | 88 ++++++++++++++++------ bundle/combo/face-list.vue | 47 +++++++++--- bundle/combo/info.vue | 147 ++++++++++++++++++++++++++----------- bundle/reserve/notice.vue | 2 +- pages.json | 6 ++ 6 files changed, 326 insertions(+), 75 deletions(-) create mode 100644 bundle/combo/desc.vue diff --git a/bundle/combo/desc.vue b/bundle/combo/desc.vue new file mode 100644 index 0000000..68d2bf2 --- /dev/null +++ b/bundle/combo/desc.vue @@ -0,0 +1,111 @@ + + + \ No newline at end of file diff --git a/bundle/combo/details.vue b/bundle/combo/details.vue index a361f5a..e62cb1b 100644 --- a/bundle/combo/details.vue +++ b/bundle/combo/details.vue @@ -103,7 +103,7 @@ 温馨提示 × - 检测到您未填写相关信息,为不影响使用请尽快完善 + {{ infoModalDesc }} 立即去完善 @@ -115,7 +115,7 @@ 会员购买 - + 月卡 @@ -124,7 +124,7 @@ 指导价{{ info.m_price }}元/月 - + 季卡 @@ -135,13 +135,25 @@ - - 开通成功之后,需要录入人脸信息 + + ·查看注意事项 {{ isRenewal ? '立即续费' : '立即开通' }} + + + + + + 注意事项 + × + + 我知道了 + + + @@ -167,8 +179,10 @@ export default { navHeight: 44, comboType: 'adult', // 套餐类型:adult(成人卡) youth(青年卡) family(亲子卡) showInfoModal: false, // 完善信息提示弹窗 + infoModalDesc: '检测到您未填写相关信息,为不影响使用请尽快完善', // 完善信息提示文案 showBuyModal: false, // 会员购买弹窗 showSuccessModal: false, // 购买成功弹窗 + showNoticeModal: false, // 注意事项弹窗 selectedPlan: 1, // 选择的套餐 1-月卡 2-季卡 info: { order: { @@ -215,6 +229,7 @@ export default { () => { } ); + }, handleGetDetails() { @@ -224,6 +239,11 @@ export default { { id: self.id }, result => { self.info = result.data; + if (self.info.month_price && self.info.month_price > 0) { + self.selectedPlan = 1; + } else if (self.info.seasonal_price && self.info.seasonal_price > 0) { + self.selectedPlan = 2; + } console.log("🚀 ~ self.info:", self.info) }, false, @@ -243,27 +263,37 @@ export default { if (!self.result) { // 没有填写过信息,弹出完善信息提示弹窗 + self.infoModalDesc = '检测到您未填写相关信息,为不影响使用请尽快完善'; self.showInfoModal = true; return false; } - const birthDate = new Date(self.result.both); - const today = new Date(); - let age = today.getFullYear() - birthDate.getFullYear(); - const m = today.getMonth() - birthDate.getMonth(); - if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) { - age--; + const getAge = (dateStr) => { + if (!dateStr) return 0; + const birthDate = new Date(dateStr); + const today = new Date(); + let age = today.getFullYear() - birthDate.getFullYear(); + const m = today.getMonth() - birthDate.getMonth(); + if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) { + age--; + } + return age; + }; + + let isAgeInvalid = false; + if (self.result && self.result.group_id == 1) { + if (getAge(self.result.both) >= 18) isAgeInvalid = true; + } else if (self.result && self.result.group_id == 3) { + if (self.result.child && self.result.child[0] && getAge(self.result.child[0].both) >= 18) isAgeInvalid = true; + } else if (self.result && self.result.group_id == 4) { + if (self.result.child && self.result.child[0] && getAge(self.result.child[0].both) >= 18) isAgeInvalid = true; + if (self.result.child && self.result.child[1] && getAge(self.result.child[1].both) >= 18) isAgeInvalid = true; } - if (self.result && self.result.group_id == 1 && age >= 18) { - // 没有填写过信息,弹出完善信息提示弹窗 - self.showInfoModal = true; - return false; - } - - if (self.result && (self.result.group_id == 3 || self.result.group_id == 4) && age >= 18) { - // 没有填写过信息,弹出完善信息提示弹窗 + if (isAgeInvalid) { + // 没有填写过信息或者由于年龄不合规,弹出完善信息提示弹窗 self.showInfoModal = true; + self.infoModalDesc = '所填信息年龄已满18周岁,需要重新填写信息'; return false; } @@ -280,13 +310,15 @@ export default { }, 100); // 没有填写过信息,弹出完善信息提示弹窗 self.showInfoModal = true; + self.infoModalDesc = '检测到您未填写相关信息,为不影响使用请尽快完善'; return false; } + if (self.result.status == 1) { // 已经审核通过,弹出开通会员弹窗 self.showBuyModal = true; - return false; + return true; } }, closeInfoModal() { @@ -347,7 +379,7 @@ export default { setTimeout(() => { self.handleGetDetails(); self.showSuccessModal = true; - }, 1000); + }, 200); }, fail: res => { setTimeout(() => { @@ -383,6 +415,17 @@ export default { }); }, + openNoticeModal() { + uni.navigateTo({ + url: '/bundle/combo/desc' + }); + // this.showNoticeModal = true; + }, + + closeNoticeModal() { + this.showNoticeModal = false; + }, + hanldeTakePhoto() { if (this.result.status == 0) { setTimeout(() => { @@ -782,7 +825,8 @@ page { .plan-list { display: flex; - justify-content: space-between; + justify-content: center; + gap: 4%; margin-bottom: 40rpx; .plan-item { diff --git a/bundle/combo/face-list.vue b/bundle/combo/face-list.vue index d848223..29ba78b 100644 --- a/bundle/combo/face-list.vue +++ b/bundle/combo/face-list.vue @@ -28,16 +28,30 @@ - + - 子女录入 + 子女1录入 - {{ childFace ? '已录入' : '去录入' }} + {{ child1Face ? '已录入' : '去录入' }} + + + + + + + + + 子女2录入 + + + {{ child2Face ? '已录入' : '去录入' }} @@ -57,7 +71,7 @@ - @@ -80,7 +94,8 @@ order_id: 0, youthFace: '', adultFace: '', - childFace: '', + child1Face: '', + child2Face: '', parent1Face: '', parent2Face: '', } @@ -103,7 +118,14 @@ if (result.data && result.data.face_url) { self.youthFace = result.data.face_url; self.adultFace = result.data.face_url; - self.childFace = result.data.face_url; + } + + if (result.data && result.data.face_url) { + self.child1Face = result.data.face_url; + } + + if (result.data && result.data.face_url1) { + self.child2Face = result.data.face_url1; } if (result.data && result.data.parent.length > 0) { @@ -135,9 +157,16 @@ return false; } - if (type === 'child' && this.childFace) { + if (type === 'child1' && this.child1Face) { uni.previewImage({ - urls: [this.childFace] + urls: [this.child1Face] + }); + return false; + } + + if (type === 'child2' && this.child2Face) { + uni.previewImage({ + urls: [this.child2Face] }); return false; } diff --git a/bundle/combo/info.vue b/bundle/combo/info.vue index 864e4ee..ee02b97 100644 --- a/bundle/combo/info.vue +++ b/bundle/combo/info.vue @@ -95,7 +95,7 @@ - + 家长2基本信息 * @@ -124,23 +124,23 @@ - + - 随行子女信息 * + 随行子女1信息 * 姓名 + v-model="formData.child[0].name" /> 出生年月 - - - {{ formData.child.both || '请选择出生年月' }} + + + {{ formData.child[0].both || '请选择出生年月' }} @@ -150,7 +150,37 @@ 身份证号 + v-model="formData.child[0].card" /> + + + + + + + 随行子女2信息 * + + + + 姓名 + + + + + 出生年月 + + + {{ formData.child[1].both || '请选择出生年月' }} + + + + + + + 身份证号 + @@ -230,11 +260,10 @@ export default { { id: 0, name: '', both: '', card: '' }, { id: 0, name: '', both: '', card: '' } ], - child: { - name: '', - both: '', - card: '', - }, + child: [ + { id: 0, name: '', both: '', card: '' }, + { id: 0, name: '', both: '', card: '' } + ], phone: '', group_id: 0 }, @@ -289,27 +318,46 @@ export default { if (data.group_id == 3 || data.group_id == 4) { // 亲子卡 if (data.parent && data.parent.length > 0) { - self.formData.parents[0] = { + self.$set(self.formData.parents, 0, { id: data.parent[0].id, name: data.parent[0].name, both: data.parent[0].both, card: data.parent[0].card, - } + }); } if (data.parent && data.parent.length > 1) { - self.formData.parents[1] = { - id: data.parent[0].id, + self.$set(self.formData.parents, 1, { + id: data.parent[1].id, name: data.parent[1].name, both: data.parent[1].both, card: data.parent[1].card, - } + }); } - self.formData.child = { - name: data.name, - both: data.both, - card: data.card, + if (data.child && data.child.length > 0) { + self.$set(self.formData.child, 0, { + id: data.child[0].id, + name: data.child[0].name, + both: data.child[0].both, + card: data.child[0].card, + }); + } else { + self.$set(self.formData.child, 0, { + id: 0, + name: data.name || '', + both: data.both || '', + card: data.card || '', + }); + } + + if (data.child && data.child.length > 1) { + self.$set(self.formData.child, 1, { + id: data.child[1].id, + name: data.child[1].name, + both: data.child[1].both, + card: data.child[1].card, + }); } } } @@ -347,8 +395,8 @@ export default { this.formData.parents[index].both = e.detail.value; }, - onChildDateChange(e) { - this.formData.child.both = e.detail.value; + onChildDateChange(e, index) { + this.formData.child[index].both = e.detail.value; }, contactUs() { @@ -424,28 +472,38 @@ export default { let err0 = validateCardAndAgeMatch(p0.card, p0.both, '家长1', 'adult'); if (err0) return uni.showToast({ title: err0, 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 (!regex.test(p1.card)) { - return uni.showToast({ title: '请输入正确的家长2身份证号码', icon: 'none' }); - } - let err1 = validateCardAndAgeMatch(p1.card, p1.both, '家长2', 'adult'); - if (err1) return uni.showToast({ title: err1, icon: 'none' }); + let p1 = self.formData.parents[1]; + if (!p1 || !p1.name || !p1.both || !p1.card) { + return uni.showToast({ title: '请填写完整家长2基本信息', icon: 'none' }); } + if (!regex.test(p1.card)) { + return uni.showToast({ title: '请输入正确的家长2身份证号码', icon: 'none' }); + } + let err1 = validateCardAndAgeMatch(p1.card, p1.both, '家长2', 'adult'); + if (err1) return uni.showToast({ title: err1, icon: 'none' }); - let child = self.formData.child; - if (!child || !child.name || !child.both || !child.card) { - return uni.showToast({ title: '请填写完整随行子女信息', icon: 'none' }); + let child0 = self.formData.child[0]; + if (!child0 || !child0.name || !child0.both || !child0.card) { + return uni.showToast({ title: '请填写完整随行子女1信息', icon: 'none' }); } - if (!regex.test(child.card)) { - return uni.showToast({ title: '请输入正确的子女身份证号码', icon: 'none' }); + if (!regex.test(child0.card)) { + return uni.showToast({ title: '请输入正确的子女1身份证号码', icon: 'none' }); + } + let errC0 = validateCardAndAgeMatch(child0.card, child0.both, '子女1', 'child'); + if (errC0) return uni.showToast({ title: errC0, icon: 'none' }); + + // id == 4 时(第二个亲子卡),还需要额外验证 child[1] 属性 + if (self.id == 4) { + let child1 = self.formData.child[1]; + if (!child1 || !child1.name || !child1.both || !child1.card) { + return uni.showToast({ title: '请填写完整随行子女2信息', icon: 'none' }); + } + if (!regex.test(child1.card)) { + return uni.showToast({ title: '请输入正确的子女2身份证号码', icon: 'none' }); + } + let errC1 = validateCardAndAgeMatch(child1.card, child1.both, '子女2', 'child'); + if (errC1) return uni.showToast({ title: errC1, icon: 'none' }); } - let errC = validateCardAndAgeMatch(child.card, child.both, '子女', 'child'); - if (errC) return uni.showToast({ title: errC, icon: 'none' }); } // 所有场景必填联系电话 @@ -483,7 +541,10 @@ export default { { name: '', both: '', card: '' }, { name: '', both: '', card: '' } ], - child: { name: '', both: '', card: '' }, + child: [ + { name: '', both: '', card: '' }, + { name: '', both: '', card: '' } + ], phone: '', group_id: self.id }; diff --git a/bundle/reserve/notice.vue b/bundle/reserve/notice.vue index 80113ea..7394044 100644 --- a/bundle/reserve/notice.vue +++ b/bundle/reserve/notice.vue @@ -55,7 +55,7 @@ seeOrder() { uni.navigateTo({ - url: '/pages/order/cg-my-order' + url: '/pages/order/cg-my-order?type=' + this.ground_type }); }, diff --git a/pages.json b/pages.json index 92da744..462bbb0 100644 --- a/pages.json +++ b/pages.json @@ -1078,6 +1078,12 @@ "style": { "navigationBarTitleText": "人脸列表" } + }, + { + "path": "combo/desc", + "style": { + "navigationBarTitleText": "注意事项" + } } ] }],