diff --git a/bundle/combo/details.vue b/bundle/combo/details.vue index 32f9418..e252982 100644 --- a/bundle/combo/details.vue +++ b/bundle/combo/details.vue @@ -81,7 +81,8 @@ - 立即开通 + 录入人脸 + 立即开通 @@ -125,9 +126,8 @@ - 提示文字在此处显示提示文字在此处显示提示文字在此处显示提示文字在此处显示提示文字在此处显示 + 开通成功之后,需要录入人脸信息 - 立即开通 @@ -162,6 +162,7 @@ export default { selectedPlan: 1, // 选择的套餐 1-月卡 2-季卡 info: { order: { + id: 0, group_id: 0, // 套餐ID end_time: '', // 会员到期时间 }, @@ -204,20 +205,22 @@ export default { let self = this; // 判断之前是否开通过任意一张会员卡,如果开通过且没有过期,提示"您已购买过套餐卡,无需重复购买" - if (self.info.order.end_time) { + if (self.info.order?.end_time) { uni.showToast({ title: '您已购买过套餐卡,无需重复购买', icon: 'none' }); return false; } //TODO 如果信息审核没有通过,uni.showToast提示"信息审核没通过,请耐心等待" // 成人卡不需要提交资料 - if (self.id == 2) { - self.showBuyModal = true; - } else { + // if (self.id == 2) { + // self.showBuyModal = true; + // } else { + // 其他卡需要先判断是否提交过资料,如果没有提交过资料,弹出提示完善信息的弹窗;如果提交过资料,根据审核状态提示不同的消息或者弹窗 self._post( 'ground.group/getGroupData', null, result => { + console.log("🚀 ~ result.data:", result.data) if (!result.data) { // 没有填写过信息,弹出完善信息提示弹窗 self.showInfoModal = true; @@ -225,23 +228,32 @@ export default { } if (result.data.status == 0) { - uni.showToast({ title: '信息审核中,请耐心等待', icon: 'none' }); + setTimeout(() => { + uni.showToast({ title: '信息审核中,请耐心等待', icon: 'none' }); + }, 100); + return false; } if (result.data.status == 2) { - uni.showToast({ title: '审核失败,请重新提交', icon: 'none' }); + setTimeout(() => { + uni.showToast({ title: '审核失败,请重新提交', icon: 'none' }); + }, 100); + // 没有填写过信息,弹出完善信息提示弹窗 + self.showInfoModal = true; + return false; } if (result.data.status == 1) { // 已经审核通过,弹出开通会员弹窗 self.showBuyModal = true; + return false; } }, false, () => { } ); - } + // } }, closeInfoModal() { this.showInfoModal = false; @@ -291,6 +303,7 @@ export default { success: res => { uni.hideLoading(); setTimeout(() => { + self.handleGetDetails(); self.showSuccessModal = true; }, 1000); }, @@ -317,6 +330,15 @@ export default { }, closeSuccessModal() { this.showSuccessModal = false; + uni.navigateTo({ + url: '/bundle/combo/face-list?id=' + this.id + '&order_id=' + this.info.order.id + }); + }, + + hanldeTakePhoto() { + uni.navigateTo({ + url: '/bundle/combo/face-list?id=' + this.id + '&order_id=' + this.info.order.id + }); } } } @@ -390,8 +412,6 @@ page { display: flex; justify-content: flex-end; align-items: center; - - } } diff --git a/bundle/combo/face-list.vue b/bundle/combo/face-list.vue new file mode 100644 index 0000000..203cd6f --- /dev/null +++ b/bundle/combo/face-list.vue @@ -0,0 +1,227 @@ + + + \ No newline at end of file diff --git a/bundle/combo/face-photo.vue b/bundle/combo/face-photo.vue new file mode 100644 index 0000000..932e6b6 --- /dev/null +++ b/bundle/combo/face-photo.vue @@ -0,0 +1,36 @@ + + + \ No newline at end of file diff --git a/bundle/combo/info.vue b/bundle/combo/info.vue index 279fcdf..4dfd95e 100644 --- a/bundle/combo/info.vue +++ b/bundle/combo/info.vue @@ -3,7 +3,7 @@ - + 基本信息 * @@ -33,6 +33,37 @@ + + + + 基本信息 * + + + + 姓名 + + + + + 出生年月 + + + {{ formData.adult.both || '请选择出生年月' }} + + + + + + + 身份证号 + + + + + @@ -185,15 +216,20 @@ export default { showSuccessPopup: false, comboType: 'adult', // 套餐类型:adult(成人卡) youth(青年卡) family(亲子卡) formData: { - parents: [ - { name: '', both: '', card: '' }, - { name: '', both: '', card: '' } - ], youth: { name: '', both: '', card: '', }, + adult: { + name: '', + both: '', + card: '', + }, + parents: [ + { name: '', both: '', card: '' }, + { name: '', both: '', card: '' } + ], child: { name: '', both: '', @@ -214,6 +250,10 @@ export default { methods: { onYouthDateChange(e) { this.formData.youth.both = e.detail.value; + }, + + onAdultDateChange(e) { + this.formData.adult.both = e.detail.value; }, onParentDateChange(e, index) { @@ -230,6 +270,7 @@ export default { submitForm() { let self = this; + const regex = /^[1-9]\d{5}(18|19|20)?\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dXx]$/; // id == 1 验证 youth 属性 if (self.id == 1) { @@ -237,6 +278,21 @@ export default { if (!youth || !youth.name || !youth.both || !youth.card) { return uni.showToast({ title: '请填写完整基本信息', icon: 'none' }); } + if (!regex.test(youth.card)) { + return uni.showToast({ title: '请输入正确的身份证号码', icon: 'none' }); + } + } + + // 成人卡 + if (self.id == 2) { + // 购买成人卡时,需要验证 adult 属性 + let adult = self.formData.adult; + if (!adult || !adult.name || !adult.both || !adult.card) { + return uni.showToast({ title: '请填写完整基本信息', icon: 'none' }); + } + if (!regex.test(adult.card)) { + return uni.showToast({ title: '请输入正确的身份证号码', icon: 'none' }); + } } // id == 3(第一个亲子卡) 或 4 时,验证 parents[0] 和 child 属性 @@ -245,18 +301,27 @@ export default { if (!p0 || !p0.name || !p0.both || !p0.card) { return uni.showToast({ title: '请填写完整家长1基本信息', icon: 'none' }); } + if (!regex.test(p0.card)) { + return uni.showToast({ title: '请输入正确的家长1身份证号码', 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 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 (!regex.test(child.card)) { + return uni.showToast({ title: '请输入正确的子女身份证号码', icon: 'none' }); } } @@ -276,8 +341,9 @@ export default { let submitData = { ...self.formData, - parents: JSON.stringify(self.formData.parents), youth: JSON.stringify(self.formData.youth), + adult: JSON.stringify(self.formData.adult), + parents: JSON.stringify(self.formData.parents), child: JSON.stringify(self.formData.child) }; @@ -288,11 +354,12 @@ export default { uni.hideLoading(); if (result.code) { self.formData = { + youth: { name: '', both: '', card: '' }, + adult: { name: '', both: '', card: '' }, parents: [ { name: '', both: '', card: '' }, { name: '', both: '', card: '' } ], - youth: { name: '', both: '', card: '' }, child: { name: '', both: '', card: '' }, phone: '', group_id: self.id diff --git a/pages.json b/pages.json index 4b68212..92da744 100644 --- a/pages.json +++ b/pages.json @@ -1066,6 +1066,18 @@ "style": { "navigationStyle": "custom" } + }, + { + "path": "combo/face-photo", + "style": { + "navigationBarTitleText": "" + } + }, + { + "path": "combo/face-list", + "style": { + "navigationBarTitleText": "人脸列表" + } } ] }], diff --git a/uni_modules/hao-camera/components/hao-camera/hao-camera.vue b/uni_modules/hao-camera/components/hao-camera/hao-camera.vue index d8df35e..e64ba6f 100644 --- a/uni_modules/hao-camera/components/hao-camera/hao-camera.vue +++ b/uni_modules/hao-camera/components/hao-camera/hao-camera.vue @@ -157,8 +157,9 @@ export default { .item { width: 90rpx; height: 90rpx; + position: absolute; + right: 40rpx; } - } }