【update】国际研讨会关联会议的优化20231102

This commit is contained in:
fengchenchen
2023-11-02 14:18:58 +08:00
parent a0383b4a3e
commit 4ef7bc416f
7 changed files with 312 additions and 47 deletions
@@ -14,6 +14,8 @@ import {
baseUrl,
URL_CONFIG
} from '../../assets/js/project.config.js'
import WasicTopicData from '../../assets/js/wasicStaticData.js'
Page({
/**
@@ -51,7 +53,45 @@ Page({
isMoreTime:false, // 是否超过 会议截止报名时间
meetingTypeText:"", // 会议类型
questionList: [], // 标协会议 存储官宣答疑的数组
wasicChoiceTopics: [], // 选择的会议展示的信息
wasicLinkTopics: [] // 关联会议展示的字段
},
// 处理国际研讨会-WASIC-已经选择的数据如何展示
handleWasicLinkTopics(currentMeetingInfo, dictKey) {
dictKey = dictKey || 'linkTopics'
let resultArr = []
if(currentMeetingInfo[dictKey] && currentMeetingInfo[dictKey + '_dictText']) {
let topicArr = currentMeetingInfo[dictKey].split(',')
let topicTextArr = currentMeetingInfo[dictKey + '_dictText'].split(',')
let opeArr = JSON.parse(JSON.stringify(WasicTopicData))
opeArr.map(tt => {
// 先查询子集中
tt.allChildren = [...tt.children, ...(tt.radioChildren || [])]
let ele = tt.allChildren.find(item => topicArr.includes(item.value))
if(ele) {
let dateItem = {
name: tt.name,
date: tt.date,
children: []
}
tt.allChildren.map(innerItem => {
let index = topicArr.findIndex(a => a === innerItem.value)
if(index > -1) {
dateItem.children.push({
'value': innerItem.value,
'text': topicTextArr[index],
'title': topicTextArr[index]
})
}
})
resultArr.push(dateItem)
}
})
}
return resultArr
},
/*
* 会议类型
* */
@@ -178,9 +218,11 @@ Page({
if(res.result.choiceTopic_dictText) {
res.result.choiceTopicArr = res.result.choiceTopic_dictText.split(',')
}
let wasicChoiceTopics = this.handleWasicLinkTopics(res.result, 'choiceTopic')
this.setData({
singInPersonInfo: res.result,
ordeCode: res.result.orderCode,
wasicChoiceTopics
})
// 演讲ppt、
if (res.result.speechPpt) {
@@ -404,12 +446,16 @@ Page({
meetingInfo.meetingType = meetingInfo.meetingType + ''
meetingInfo.tbMeetingType = meetingInfo.tbMeetingType + ''
// 国际研讨会 关联会议字段有值,则进行处理
let updateObj = {}
if(meetingInfo.linkTopics_dictText) {
meetingInfo.linkTopicsArr = meetingInfo.linkTopics_dictText.split(',')
// WASIC-关联会议的处理
updateObj.wasicLinkTopics = this.handleWasicLinkTopics(meetingInfo)
}
this.setData({
meetingInfo:meetingInfo,
questionList: meetingInfo.questionList || []
questionList: meetingInfo.questionList || [],
...updateObj
})
let flag = this.compareCurrentTime(meetingInfo.registerDeadline)
this.setData({
@@ -423,9 +469,13 @@ Page({
if(res.result.linkTopics_dictText) {
res.result.linkTopicsArr = res.result.linkTopics_dictText.split(',')
}
// WASIC-关联会议的处理
let updateObj = {}
updateObj.wasicLinkTopics = this.handleWasicLinkTopics(meetingInfo)
this.setData({
meetingInfo:res.result,
questionList: res.result.questionList || []
questionList: res.result.questionList || [],
...updateObj
})
let flag = this.compareCurrentTime(res.result.registerDeadline)
this.setData({
@@ -13,11 +13,15 @@
<text>是否WASIC</text>
<text>{{meetingInfo.isWasic_dictText || '否'}}</text>
</view>
<view class="wrap-text-view" wx:if="{{meetingInfo.meetingType === '3' && meetingInfo.isWasic}}">
<view class="sign-in" wx:if="{{meetingInfo.meetingType === '3' && meetingInfo.isWasic}}">
<text class="basic-label">关联会议</text>
<text>
<text class="block-text" wx:for="{{meetingInfo.linkTopicsArr}}" wx:key="item">{{item}}</text>
</text>
<!-- <text> -->
<text class="block-text sign-in-text" wx:for="{{wasicLinkTopics}}" wx:for-item="pItem" wx:key="name">
<text>{{pItem.name}}</text>
<text class="block-text sign-in-text" wx:for="{{pItem.children}}" wx:key="value">{{item.text}}</text>
</text>
<!-- <text class="block-text" wx:for="{{meetingInfo.linkTopicsArr}}" wx:key="item">{{item}}</text> -->
<!-- </text> -->
</view>
<!-- 国际研讨会的判断-是否WASIC--结束 -->
<view>
@@ -191,13 +195,13 @@
<text>身份</text>
<text>{{singInPersonInfo.identity_dictText}}</text>
</view>
<!--是否为WASIC字段判断-->
<view class="wrap-text-view" wx:if="{{meetingInfo.meetingType === '3' && meetingInfo.isWasic}}">
<!--是否为WASIC字段判断-->
<view class="sign-in" wx:if="{{meetingInfo.meetingType === '3' && meetingInfo.isWasic}}">
<text class="basic-label">会议名称</text>
<text>
<text class="block-text" wx:for="{{singInPersonInfo.choiceTopicArr}}" wx:key="item">{{item}}</text>
</text>
<!-- <text>{{singInPersonInfo.choiceTopic_dictText}}</text> -->
<text class="block-text sign-in-text" wx:for="{{wasicChoiceTopics}}" wx:for-item="pItem" wx:key="name">
<text>{{pItem.name}}</text>
<text class="block-text sign-in-text" wx:for="{{pItem.children}}" wx:key="value">{{item.text}}</text>
</text>
</view>
<view>
<text>手机号</text>
@@ -713,4 +717,4 @@
<view class="join-meeting" style="margin-bottom:20px" wx:if="{{showSignInBtn}}">
<!-- 不需要花钱的会议、打包的会议 报名完显示 花钱的会议 现场缴费需要审核凭证通过显示 汇款的报完名显示 并被会议不能是已结束 -->
<text bindtap="toSignUp">去签到</text>
</view>
</view>
+42 -2
View File
@@ -9,6 +9,7 @@ import {
baseUrl,
URL_CONFIG
} from '../../assets/js/project.config.js'
import WasicTopicData from '../../assets/js/wasicStaticData.js'
Page({
@@ -31,8 +32,46 @@ Page({
// 当前会议是否超出时间
isMoreBool: false,
// 标协会议问题征集数据
questionList: []
questionList: [],
// 关联会议展示的字段
wasicLinkTopics: []
},
// 处理国际研讨会-WASIC-已经选择的数据如何展示
handleWasicLinkTopics(currentMeetingInfo, dictKey) {
dictKey = dictKey || 'linkTopics'
let resultArr = []
if(currentMeetingInfo[dictKey] && currentMeetingInfo[dictKey + '_dictText']) {
let topicArr = currentMeetingInfo[dictKey].split(',')
let topicTextArr = currentMeetingInfo[dictKey + '_dictText'].split(',')
let opeArr = JSON.parse(JSON.stringify(WasicTopicData))
opeArr.map(tt => {
// 先查询子集中
tt.allChildren = [...tt.children, ...(tt.radioChildren || [])]
let ele = tt.allChildren.find(item => topicArr.includes(item.value))
if(ele) {
let dateItem = {
name: tt.name,
date: tt.date,
children: []
}
tt.allChildren.map(innerItem => {
let index = topicArr.findIndex(a => a === innerItem.value)
if(index > -1) {
dateItem.children.push({
'value': innerItem.value,
'text': topicTextArr[index],
'title': topicTextArr[index]
})
}
})
resultArr.push(dateItem)
}
})
}
return resultArr
},
compareCurrentTime(time) {
let date = new Date()
let compareTime = new Date(time)
@@ -58,7 +97,8 @@ Page({
payOrCode: baseUrl + URL_CONFIG + 'sys/common/download/' + res.result.paymentQrCode,
tbMeetingType: that.generateTbMeetingType(res.result.tbMeetingType),
hotelContactsList: res.result.hotelContactsList,
questionList: res.result.questionList || []
questionList: res.result.questionList || [],
wasicLinkTopics: this.handleWasicLinkTopics(res.result)
})
console.log(that.data.hotelContactsList);
initFileList(res.result.meetingFiles).then(res => {
+7 -4
View File
@@ -14,12 +14,15 @@
<text>是否WASIC</text>
<text>{{meetingDetailIngfo.isWasic_dictText || '否'}}</text>
</view>
<view class="wrap-text-view" wx:if="{{meetingDetailIngfo.meetingType === '3' && meetingDetailIngfo.isWasic}}">
<view class="sign-in" wx:if="{{meetingDetailIngfo.meetingType === '3' && meetingDetailIngfo.isWasic}}">
<text class="basic-label">关联会议</text>
<text>
<text class="block-text" wx:for="{{meetingDetailIngfo.linkTopicsArr}}" wx:key="item">{{item}}</text>
<text class="sign-in-text block-text" wx:for="{{wasicLinkTopics}}" wx:for-item="pItem" wx:key="name">
<text>{{pItem.name}}</text>
<text class="block-text sign-in-text" wx:for="{{pItem.children}}" wx:key="value">{{item.text}}</text>
</text>
</text>
<!-- <text>{{meetingDetailIngfo.linkTopics_dictText}}</text> -->
</view>
<!-- 国际研讨会的判断-是否WASIC--结束 -->
<view wx:if="{{meetingDetailIngfo.meetingType === '2'}}">
@@ -52,7 +55,7 @@
<text>{{meetingDetailIngfo.councilName || ''}}</text>
</view>
<view class="sign-in">
<view >
<text>召开时间</text>
<text class="sign-in-text">{{meetingDetailIngfo.startTime + '~' + meetingDetailIngfo.endTime }}</text>
</view>
+167 -25
View File
@@ -35,11 +35,85 @@ const LinkTopicsEnums = {
name: '免费专题',
index: 6
},
freeTwo: { name: '免费专题', index: 8 },
default: {
name: '114/22焦点论坛(默认专题)',
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 {
InvoiceTypeEnums,
@@ -62,6 +136,8 @@ Page({
inviteCodeArr: [],
// 可选课题名称的数组
linkTopicsOptionArr: [],
// WASIC可选会议的数组-前端写死
showTopicsArr: [...topicData],
// 国际研讨会-WASIC-选择关联客户的数组
choiceTopicArr: [],
// 是否出现输入邀请码 参会身份选择嘉宾才出现
@@ -368,7 +444,7 @@ Page({
let meetingCostSum = that.data.selectedMeeting.meetingCosts
// 如果当前是WASIC会议 则需要通过会议名称判断会议的费用
if (this.data.meetingDetailInfo.isWasic) {
meetingCostSum = this.handleMeetingCostSum(this.data.linkTopicsOptionArr)
meetingCostSum = this.handleMeetingCostSum(this.data.showTopicsArr)
}
this.setData({
meetingCosts: meetingCostSum
@@ -380,9 +456,22 @@ Page({
}
},
// 多选主题的时候 处理当前显示的费用总数
handleMeetingCostSum(linkTopicsOptionArr) {
handleMeetingCostSum() {
let arr = []
this.data.showTopicsArr.map(tt => {
tt.children && tt.children.map(item => {
if(item.checked) {
arr.push(item.value)
}
})
tt.radioChildren && tt.radioChildren.map(item => {
if(item.checked) {
arr.push(item.value)
}
})
})
let meetingCostSum
let choiceTopicArr = linkTopicsOptionArr.filter(item => item.checked && item.value !== (LinkTopicsEnums.free.index + ''))
let choiceTopicArr = arr.filter(item => (item + '') !== (LinkTopicsEnums.free.index + '') && (item + '') !== (LinkTopicsEnums.freeTwo.index + ''))
if (choiceTopicArr.length > 2) {
meetingCostSum = this.data.meetingDetailInfo.meetingCostsThreeTopic
} else {
@@ -396,25 +485,35 @@ Page({
id: meetingId
}).then(res => {
if (res.success) {
let arr = res.result || []
arr.map(tt => {
tt.name = tt.text
if(tt.value + '' === LinkTopicsEnums.default.index + '') {
tt.checked = true
tt.disabled = true
}
let arr = res.result || []
this.data.showTopicsArr.map(tt => {
tt.children.map(item => {
let ele = arr.find(a => a.value + '' === item.value)
if(ele) {
item.text = ele.text
item.title = ele.title
}
})
tt.radioChildren && tt.radioChildren.map(item => {
let ele = arr.find(a => a.value + '' === item.value)
if(ele) {
item.text = ele.text
item.title = ele.title
}
})
})
const updateObj = {
linkTopicsOptionArr: arr // 参会人信息
// linkTopicsOptionArr: arr // 参会人信息
showTopicsArr: this.data.showTopicsArr
}
// 编辑时 对数据进行处理
if (this.isEdit) {
// 选中的主题
const choiceTopic = (this.model.choiceTopic || '').split(',')
this.updateCheckboxArr(arr, choiceTopic)
this.updateCheckboxArr(this.data.showTopicsArr, choiceTopic, 'all')
// 计算费用
updateObj.meetingCosts = this.handleMeetingCostSum(arr)
updateObj.linkTopicsOptionArr = arr
updateObj.meetingCosts = this.handleMeetingCostSum()
updateObj.showTopicsArr = this.data.showTopicsArr
}
this.setData({
...updateObj
@@ -426,16 +525,36 @@ Page({
// 选择的课题发生改变
changeChoiceTopic(e) {
const values = e.detail.value // 是一个数组 ['1', '2']
this.updateCheckboxArr(this.data.linkTopicsOptionArr, values)
let updateObj = {linkTopicsOptionArr: this.data.linkTopicsOptionArr}
this.updateCheckboxArr(this.data.showTopicsArr, values, 'check')
let updateObj = {showTopicsArr: this.data.showTopicsArr}
// 选择是参会人的时候处理数据
this.selectedCheckTopicsArr = [...values]
if (this.data.identity === '2') {
updateObj.meetingCosts = this.handleMeetingCostSum(this.data.linkTopicsOptionArr)
updateObj.meetingCosts = this.handleMeetingCostSum()
}
this.setData({
...updateObj
})
},
changeRadioTopic(e) {
const value = e.detail.value
let keyName = e.currentTarget.dataset.name
this[keyName] = value
let pIndex = this.data.showTopicsArr.findIndex(tt => tt.radioKey === keyName)
if(pIndex > -1) {
this.data.showTopicsArr[pIndex].radioChildren.map(radioItem => {
radioItem.checked = false
if(radioItem.value === value) {
radioItem.checked = true
}
})
}
let updateObj = {showTopicsArr: this.data.showTopicsArr}
updateObj.meetingCosts = this.handleMeetingCostSum()
this.setData({
...updateObj
})
},
// 设置邀请码的值
bindInputInviteCode(e) {
// 在这里将所有控制表单都设为false 防止显示出问题
@@ -1156,7 +1275,17 @@ Page({
}
// 国际研讨会-WASIC 所选择的 关联会议
if (formData.choiceTopic) {
formData.choiceTopic = formData.choiceTopic.join(',')
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
@@ -1303,14 +1432,27 @@ Page({
},
/**
* 更新Checkbox对应的选中状态
* @param arr-Checkbox对应的数组
* @param arr-Checkbox对应的数组 和 showTopicsArr 对应的数据格式一致
* @param valueArr-选中的值-数组
* @param type-类型 all 单选多选全都匹配; ‘check’-匹配多选 ‘radio’匹配单选
*/
updateCheckboxArr(arr, valueArr) {
updateCheckboxArr(arr, valueArr, type) {
arr.map(tt => {
tt.checked = false
if (valueArr.indexOf(tt.value) > -1) {
tt.checked = true
if (type === 'all' || type === 'check') {
tt.children.map(item =>{
item.checked = false
if (valueArr.indexOf(item.value) > -1) {
item.checked = true
}
})
}
if(type === 'all' || type === 'radio') {
tt.radioChildren && tt.radioChildren.map(item =>{
item.checked = false
if (valueArr.indexOf(item.value) > -1) {
item.checked = true
}
})
}
})
},
@@ -1401,9 +1543,9 @@ Page({
if (this.data.meetingDetailInfo.isWasic) {
// 选中的主题
const choiceTopic = (this.model.choiceTopic || '').split(',')
this.updateCheckboxArr(this.data.linkTopicsOptionArr, choiceTopic)
this.updateCheckboxArr(this.data.showTopicsArr, choiceTopic, 'all')
// 计算费用
updateObj.meetingCosts = this.handleMeetingCostSum(this.data.linkTopicsOptionArr)
updateObj.meetingCosts = this.handleMeetingCostSum()
}
if (this.model.identity === MeetIdentifyTypeEnums.attendee.index) {
this.updateRadioArr(this.data.need, '0')
+17 -3
View File
@@ -31,9 +31,23 @@
</view>
<view>
<checkbox-group name='choiceTopic' bindchange="changeChoiceTopic">
<label class="radio checkbox-item" wx:for="{{linkTopicsOptionArr}}" wx:key="item">
<checkbox class="radio-scale" value="{{item.value}}" color="#069F99" checked="{{item.checked}}" disabled="{{item.disabled}}"/>{{item.text}}
</label>
<view wx:for="{{showTopicsArr}}" wx:for-item="item" wx:key="name">
<view class="topic-title">{{item.name}}</view>
<view class="checkbox-view">
<label class="radio checkbox-item" wx:for="{{item.children}}" wx:for-item="checkItem" wx:key="title">
<checkbox class="radio-scale" value="{{checkItem.value}}" color="#069F99" checked="{{checkItem.checked}}" disabled="{{checkItem.disabled}}" />{{checkItem.text}}
</label>
</view>
<!-- 如果有单选的数据 循环单选的数据 -->
<view class="radio-div" wx:if="{{item.radioChildren}}">
<radio-group name='{{item.radioKey}}' data-name='{{item.radioKey}}' bindchange="changeRadioTopic">
<label class="radio radio-item" wx:for="{{item.radioChildren}}" wx:for-item="radioItem" wx:key="title">
<radio class="radio-scale" value="{{radioItem.value}}" color="#069F99" checked="{{radioItem.checked}}" />{{radioItem.text}}
</label>
</radio-group>
</view>
</view>
</checkbox-group>
</view>
@@ -174,3 +174,15 @@ page{
.checkbox-item {
display: block;
}
.topic-title{
padding: 15rpx 0;
}
.radio-div{
border-top: 1px solid rgba(0, 0, 0, 0.2);
padding-top: 15rpx;
margin-top: 15rpx;
}
.radio-div .radio-item {
display: block;
padding: 15rpx 0;
}