From c9c458b9abc7bc8e443a42f99da73c776649e012 Mon Sep 17 00:00:00 2001 From: fengchenchen Date: Thu, 2 Nov 2023 22:52:04 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90update=E3=80=91=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E7=A0=94=E8=AE=A8=E4=BC=9A=20=E4=BF=AE=E6=94=B9=E8=B4=B9?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E8=AE=A1=E7=AE=97=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/signUpPageGuoji/signUpPageGuoji.js | 128 ++++++----------------- 1 file changed, 32 insertions(+), 96 deletions(-) diff --git a/pages/signUpPageGuoji/signUpPageGuoji.js b/pages/signUpPageGuoji/signUpPageGuoji.js index e37f653..5f546f6 100644 --- a/pages/signUpPageGuoji/signUpPageGuoji.js +++ b/pages/signUpPageGuoji/signUpPageGuoji.js @@ -41,79 +41,7 @@ const LinkTopicsEnums = { index: 99 } } -const topicData = [ - { - name: '11月27日', - date: '11月27日', - radioKey: 'radioKey', - children: [ - { - 'value': '6', - 'text': '国际发展论坛(09:00-15:00)', - 'title': '国际发展论坛(09:00-15:00)' - } - ], - radioChildren: [ - { - 'value':'5', - 'text':'弱势道路交通参与者(VRU)保护专题(14:00-18:00)', - 'title':'弱势道路交通参与者(VRU)保护专题(14:00-18:00)' - }, - { - 'value':'2', - 'text':'智能网联汽车标准化领航及标准路线图专题(14:00-18:00)', - 'title':'智能网联汽车标准化领航及标准路线图专题(14:00-18:00)' - }, - { - 'value':'4', - 'text':'动力电池安全专题(14:00-18:00)', - 'title':'动力电池安全专题(14:00-18:00)' - } - ] - }, - { - name: '11月28日', - date: '11月28日', - radioKey: 'radioKeyTwo', - children: [ - { - 'value':'99', - 'text':'114/22焦点论坛(08:00-12:00,全体大会)', - 'title':'114/22焦点论坛(08:00-12:00,全体大会)', - 'disabled': true, - checked: true - } - ], - radioChildren: [ - { - 'value':'1', - 'text':'汽车网络安全与数据安全标准合规专题(14:00-18:00)', - 'title':'汽车网络安全与数据安全标准合规专题(14:00-18:00)' - }, - { - 'value':'3', - 'text':'汽车低碳专题(14:00-18:00)', - 'title':'汽车低碳专题(14:00-18:00)' - }, - { - 'value':'7', - 'text':'无人小车专题(14:00-18:00)', - 'title':'无人小车专题(14:00-18:00)' - } - ] - }, - { - name: '11月29日', - date: '11月29日', - children: [ - { - 'value':'8', - 'text':'湾区智联试验场参观(8:30-10:30)', - 'title':'湾区智联试验场参观(8:30-10:30)' - } - ] - } -] +import WasicTopicData from '../../assets/js/wasicStaticData.js' import { InvoiceTypeEnums, @@ -137,7 +65,7 @@ Page({ // 可选课题名称的数组 linkTopicsOptionArr: [], // WASIC可选会议的数组-前端写死 - showTopicsArr: [...topicData], + showTopicsArr: [...WasicTopicData], // 国际研讨会-WASIC-选择关联客户的数组 choiceTopicArr: [], // 是否出现输入邀请码 参会身份选择嘉宾才出现 @@ -457,7 +385,7 @@ Page({ }, // 多选主题的时候 处理当前显示的费用总数 handleMeetingCostSum() { - let arr = [] + let arr = [], radioArr = [] this.data.showTopicsArr.map(tt => { tt.children && tt.children.map(item => { if(item.checked) { @@ -467,16 +395,26 @@ Page({ tt.radioChildren && tt.radioChildren.map(item => { if(item.checked) { arr.push(item.value) + radioArr.push(item.value) } }) }) let meetingCostSum - let choiceTopicArr = arr.filter(item => (item + '') !== (LinkTopicsEnums.free.index + '') && (item + '') !== (LinkTopicsEnums.freeTwo.index + '')) - if (choiceTopicArr.length > 2) { - meetingCostSum = this.data.meetingDetailInfo.meetingCostsThreeTopic + if(arr.length === 0) { + meetingCostSum = '0.00' } else { - meetingCostSum = this.data.meetingDetailInfo.meetingCostsTwoTopic + if(radioArr.length === 2) { + meetingCostSum = this.data.meetingDetailInfo.meetingCostsThreeTopic + } else { + meetingCostSum = this.data.meetingDetailInfo.meetingCostsTwoTopic + } } + // let choiceTopicArr = arr.filter(item => (item + '') !== (LinkTopicsEnums.freeTwo.index + '')) + // if (choiceTopicArr.length > 2) { + // meetingCostSum = this.data.meetingDetailInfo.meetingCostsThreeTopic + // } else { + // meetingCostSum = this.data.meetingDetailInfo.meetingCostsTwoTopic + // } return meetingCostSum }, // 获取国际研讨会-能选择课题的数据字典数据 @@ -485,7 +423,7 @@ Page({ id: meetingId }).then(res => { if (res.success) { - let arr = res.result || [] + let arr = res.result || [] this.data.showTopicsArr.map(tt => { tt.children.map(item => { let ele = arr.find(a => a.value + '' === item.value) @@ -936,14 +874,26 @@ Page({ } // 如果会议是WASIC 需要对是否选择会议名称做校验 if (this.data.meetingDetailInfo.isWasic) { - if (!formData.choiceTopic || formData.choiceTopic.length === 0) { + let choiceArr = formData.choiceTopic + if(formData.radioKey) { + choiceArr.push(formData.radioKey) + delete formData.radioKey + } + if(formData.radioKeyTwo) { + choiceArr.push(formData.radioKeyTwo) + delete formData.radioKeyTwo + } + // 只选择一个免费参观的不能报名成功 + let judgeFlag = choiceArr.filter(tt => tt !== LinkTopicsEnums.freeTwo.index + '') + if(judgeFlag.length === 0) { wx.showToast({ - title: '请选择会议名称', + title: '请至少选择一个非参观类会议', icon: 'none', duration: 2000 }) return } + formData.choiceTopic = choiceArr.join(',') } // 参会身份验证 if (formData.identity === '') { @@ -1273,20 +1223,6 @@ Page({ // 邀请码数据 formData.invitationCode = formData.inviteCode } - // 国际研讨会-WASIC 所选择的 关联会议 - if (formData.choiceTopic) { - let choiceArr = formData.choiceTopic - if(formData.radioKey) { - choiceArr.push(formData.radioKey) - delete formData.radioKey - } - if(formData.radioKeyTwo) { - choiceArr.push(formData.radioKeyTwo) - delete formData.radioKeyTwo - } - - formData.choiceTopic = choiceArr.join(',') - } // 会议类型 // formData.meetingType = this.data.selectedMeeting.meetingType console.log(formData);