1714 lines
47 KiB
JavaScript
1714 lines
47 KiB
JavaScript
// pages/signUpPageGuoji/signUpPageGuoji.js
|
||
import MeetingApi from "../../assets/js/http/meetingApi"
|
||
import signUpApi from "../../assets/js/http/signUp"
|
||
// 引入对发票信息 校验的方法
|
||
let confirmInvoiceModalBehavior = require('../../behavior/confirmInvoiceModal.js')
|
||
import {
|
||
phoneReg,
|
||
postcode,
|
||
compareDate,
|
||
dutyCode
|
||
} from '../../utils/validate'
|
||
import {
|
||
baseUrl,
|
||
URL_CONFIG
|
||
} from '../../assets/js/project.config.js'
|
||
// 所有是否选择框的数据,因为要回显所以不能用一个了
|
||
const NeedArr = [{
|
||
value: '1',
|
||
name: '是'
|
||
},
|
||
{
|
||
value: '0',
|
||
name: '否'
|
||
},
|
||
]
|
||
// 国际研讨会关联会议
|
||
//汽车网络安全与数据安全标准合规专题,
|
||
// 智能网汽车标准化领航及标准路线图专题,
|
||
// 汽车地毯专题,
|
||
// 动力电池安全专题,
|
||
// 弱势道路交通参与者(VRU)保护专题,
|
||
// 免费专题
|
||
const LinkTopicsEnums = {
|
||
free: {
|
||
name: '免费专题',
|
||
index: 6
|
||
},
|
||
freeTwo: { name: '免费专题', index: 8 },
|
||
default: {
|
||
name: '114/22焦点论坛(默认专题)',
|
||
index: 99
|
||
}
|
||
}
|
||
import WasicTopicData from '../../assets/js/wasicStaticData.js'
|
||
|
||
import {
|
||
InvoiceTypeEnums,
|
||
MeetIdentifyTypeEnums,
|
||
GuestTypeEnums
|
||
} from '../../assets/js/Enums/common.js'
|
||
Page({
|
||
behaviors: [confirmInvoiceModalBehavior],
|
||
|
||
/**
|
||
* 页面的初始数据
|
||
*/
|
||
data: {
|
||
// 会议详情
|
||
meetingDetailInfo: {},
|
||
// 参会身份
|
||
identifyList: [],
|
||
isNbqyBool: false,
|
||
// 邀请码数组
|
||
inviteCodeArr: [],
|
||
// 可选课题名称的数组
|
||
linkTopicsOptionArr: [],
|
||
// WASIC可选会议的数组-前端写死
|
||
showTopicsArr: [...WasicTopicData],
|
||
// 国际研讨会-WASIC-选择关联客户的数组
|
||
choiceTopicArr: [],
|
||
// 是否出现输入邀请码 参会身份选择嘉宾才出现
|
||
inviteCodeShowBool: false,
|
||
// 校验邀请码的按钮控制
|
||
validateBtnBool: false,
|
||
// 表单的邀请码值
|
||
inviteCode: "",
|
||
// vip的表单显示
|
||
vipBool: false,
|
||
// 演讲嘉宾的表单显示
|
||
speakerBool: false,
|
||
// 合作伙伴或者参展商的表单显示
|
||
cooperatieBool: false,
|
||
// 特邀嘉宾的显示
|
||
guestBool: false,
|
||
// 选中的参会单位
|
||
selectedCompany: {},
|
||
// 选中的联系人
|
||
selectedPerson: {},
|
||
// 选中的邮寄联系人
|
||
selectedPostPerson: {},
|
||
selectedMeeting: {},
|
||
// 抵达时间
|
||
arrivalTime: '请选择抵达时间',
|
||
// 入住酒店时间
|
||
inHotelTime: '请选择入住酒店时间',
|
||
// 离店时间
|
||
outHotelTime: '请选择离店时间',
|
||
// 离开时间
|
||
departureTime: '请选择离开时间',
|
||
// 是否选择发票的选中的索引
|
||
index: -1,
|
||
// 发票项目选择的索引
|
||
invoiceProjectIndex: -1,
|
||
// 是否需要用餐
|
||
haveMeal: '',
|
||
// 是否住酒店
|
||
needHotel: '',
|
||
// 是否接站
|
||
needPick: '',
|
||
// 是否送站
|
||
needSend: '',
|
||
// 上传图片的id
|
||
imageIds: '',
|
||
// 记录临时的文件名 用于回显 小程序上传后后端的名会乱码
|
||
tempFiles: '点击上传',
|
||
// ppt Id
|
||
speechPpt: '',
|
||
// 嘉宾身份
|
||
guestType: -1,
|
||
// 参会身份
|
||
identity: '',
|
||
// 是否有邀请码
|
||
isInviteCode: '',
|
||
// 缴费方式
|
||
payMethod: '',
|
||
// 缴费方式
|
||
paymentMethodList: [{
|
||
value: '1',
|
||
name: '汇款'
|
||
},
|
||
{
|
||
value: '2',
|
||
name: '现场缴费(仅支持扫码支付)'
|
||
},
|
||
{
|
||
value: '3',
|
||
name: '打包'
|
||
},
|
||
],
|
||
needInvoiceList: [{
|
||
value: '0',
|
||
name: '不需要'
|
||
},
|
||
{
|
||
value: '1',
|
||
name: '增值税普通发票'
|
||
},
|
||
{
|
||
value: '2',
|
||
name: '增值税专用发票'
|
||
},
|
||
],
|
||
// 发票项目
|
||
invoiceProjectList: [{
|
||
value: '1',
|
||
name: '会议费'
|
||
},
|
||
{
|
||
value: '2',
|
||
name: '培训费'
|
||
},
|
||
],
|
||
need: [...NeedArr],
|
||
// 是否用餐
|
||
needHaveMealsArr: [...NeedArr],
|
||
// 是否是否回民
|
||
needHuiPeopleArr: [...NeedArr],
|
||
//是否住酒店
|
||
needCheckInHotelArr: [...NeedArr],
|
||
// 是否需要接站
|
||
needPickUpArr: [...NeedArr],
|
||
// 是否需要送站
|
||
needDeliveryStationArr: [...NeedArr],
|
||
flag: false,
|
||
// 是否调用无限制接口
|
||
nolimitBool: false,
|
||
//会议费用
|
||
meetingCosts: '',
|
||
// 是否是编辑页面
|
||
isEdit: false,
|
||
// 嘉宾类型的显示信息,不保
|
||
guestType_dictText: '',
|
||
// 嘉宾的相关信息
|
||
guestInfo: {
|
||
|
||
}
|
||
},
|
||
// 抵达时间选择
|
||
bindDateChangeArriveTime(e) {
|
||
this.setData({
|
||
arrivalTime: e.detail.value
|
||
})
|
||
},
|
||
// 离开时间选择
|
||
bindDateChangeLeaveTime(e) {
|
||
this.setData({
|
||
departureTime: e.detail.value
|
||
})
|
||
},
|
||
// 入住酒店时间
|
||
bindDateChangeInHotelTime(e) {
|
||
this.setData({
|
||
inHotelTime: e.detail.value
|
||
})
|
||
},
|
||
// 离店时间选择
|
||
bindDateChangeOutHotelTime(e) {
|
||
this.setData({
|
||
outHotelTime: e.detail.value
|
||
})
|
||
},
|
||
// 是否需要发票的选择
|
||
needInvoiceChange(e) {
|
||
this.setData({
|
||
index: e.detail.value
|
||
})
|
||
},
|
||
// 是否用餐
|
||
needHaveMeal(e) {
|
||
let value = e.detail.value
|
||
this.setData({
|
||
haveMeal: value
|
||
})
|
||
},
|
||
// 是否住酒店
|
||
needHotel(e) {
|
||
let value = e.detail.value
|
||
this.setData({
|
||
needHotel: value,
|
||
inHotelTime: '请选择入住酒店时间',
|
||
outHotelTime: '请选择离店时间'
|
||
})
|
||
|
||
},
|
||
// 是否接站
|
||
needPick(e) {
|
||
let value = e.detail.value
|
||
this.setData({
|
||
needPick: value,
|
||
arrivalTime: '请选择抵达时间'
|
||
})
|
||
},
|
||
// 是否送站
|
||
needSend(e) {
|
||
let value = e.detail.value
|
||
this.setData({
|
||
needSend: value,
|
||
departureTime: '请选择离开时间'
|
||
})
|
||
},
|
||
// 缴费方式选择
|
||
paymentMethodRadioChange(e) {
|
||
let value = e.detail.value
|
||
this.setData({
|
||
payMethod: value
|
||
})
|
||
},
|
||
// 是否有邀请码的选择
|
||
changeInviteCode(e) {
|
||
let value = e.detail.value
|
||
this.setData({
|
||
isInviteCode: value,
|
||
inviteCode: '',
|
||
})
|
||
if (value === '1') {
|
||
// 选择是 将身份设置为嘉宾
|
||
this.setData({
|
||
identity: '1'
|
||
})
|
||
} else {
|
||
|
||
const identifyListDisabled = [{
|
||
value: '2',
|
||
name: '参会人',
|
||
disabled: false
|
||
},
|
||
{
|
||
value: '3',
|
||
name: '内部企业',
|
||
disabled: false
|
||
},
|
||
]
|
||
const identifyList = [{
|
||
value: '2',
|
||
name: '参会人',
|
||
disabled: false
|
||
},
|
||
{
|
||
value: '3',
|
||
name: '内部企业',
|
||
disabled: true
|
||
},
|
||
]
|
||
if (this.data.isNbqyBool) {
|
||
// 是内部企业
|
||
this.setData({
|
||
identifyList: identifyListDisabled
|
||
})
|
||
} else {
|
||
this.setData({
|
||
identifyList: identifyList
|
||
})
|
||
}
|
||
this.setData({
|
||
identity: '',
|
||
vipBool: false,
|
||
speakerBool: false,
|
||
cooperatieBool: false,
|
||
guestBool: false,
|
||
guestType: '',
|
||
|
||
})
|
||
}
|
||
},
|
||
// 是否住酒店 参会人与内部企业 清除抵达时间 离开时间
|
||
needHotelNot() {
|
||
this.setData({
|
||
arrivalTime: '请选择抵达时间',
|
||
departureTime: '请选择离开时间'
|
||
})
|
||
},
|
||
// 选择参会单位
|
||
selectCompany(e) {
|
||
let flag
|
||
wx.getStorage({
|
||
key: 'companyDisabled',
|
||
success(res) {
|
||
if (res.data) {
|
||
flag = res.data
|
||
}
|
||
}
|
||
})
|
||
|
||
if (flag) {
|
||
return
|
||
}
|
||
if (this.data.nolimitBool) {
|
||
wx.navigateTo({
|
||
url: `../companyList/companyList?page=${e.currentTarget.dataset.page}&nolimit=nolimit`,
|
||
})
|
||
} else {
|
||
wx.navigateTo({
|
||
url: `../companyList/companyList?page=${e.currentTarget.dataset.page}&nolimit=nolimit`,
|
||
})
|
||
}
|
||
},
|
||
// 选择参会人
|
||
selectPerson(e) {
|
||
const that = this
|
||
if (!!this.data.selectedCompany.id) {
|
||
wx.navigateTo({
|
||
url: `../personList/personList?companyId=${this.data.selectedCompany.id}&selectType=${e.currentTarget.dataset.selecttype}&page=${e.currentTarget.dataset.page}&nolimit=${that.data.nolimitBool}`,
|
||
})
|
||
} else {
|
||
wx.showToast({
|
||
title: '请先选择参会单位',
|
||
icon: "none",
|
||
duration: 800,
|
||
});
|
||
}
|
||
},
|
||
// 改变参会身份
|
||
changeIdentify(e) {
|
||
const that = this
|
||
let value = e.detail.value
|
||
this.setData({
|
||
identity: value,
|
||
index: -1,
|
||
})
|
||
// 国际研讨会嘉宾 内部企业 不需要缴费
|
||
if (value === '2') {
|
||
let meetingCostSum = that.data.selectedMeeting.meetingCosts
|
||
// 如果当前是WASIC会议 则需要通过会议名称判断会议的费用
|
||
if (this.data.meetingDetailInfo.isWasic) {
|
||
meetingCostSum = this.handleMeetingCostSum(this.data.showTopicsArr)
|
||
}
|
||
this.setData({
|
||
meetingCosts: meetingCostSum
|
||
})
|
||
} else {
|
||
this.setData({
|
||
meetingCosts: '0.00'
|
||
})
|
||
}
|
||
},
|
||
// 多选主题的时候 处理当前显示的费用总数
|
||
handleMeetingCostSum() {
|
||
let arr = [], radioArr = []
|
||
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)
|
||
radioArr.push(item.value)
|
||
}
|
||
})
|
||
})
|
||
let meetingCostSum
|
||
if(arr.length === 0) {
|
||
meetingCostSum = '0.00'
|
||
} else {
|
||
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
|
||
},
|
||
// 获取国际研讨会-能选择课题的数据字典数据
|
||
getLinkTopicsOptionArr(meetingId) {
|
||
MeetingApi.getLinkTopics({
|
||
id: meetingId
|
||
}).then(res => {
|
||
if (res.success) {
|
||
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 // 参会人信息
|
||
showTopicsArr: this.data.showTopicsArr
|
||
}
|
||
// 编辑时 对数据进行处理
|
||
if (this.isEdit) {
|
||
// 选中的主题
|
||
const choiceTopic = (this.model.choiceTopic || '').split(',')
|
||
this.updateCheckboxArr(this.data.showTopicsArr, choiceTopic, 'all')
|
||
// 计算费用
|
||
updateObj.meetingCosts = this.handleMeetingCostSum()
|
||
updateObj.showTopicsArr = this.data.showTopicsArr
|
||
}
|
||
this.setData({
|
||
...updateObj
|
||
})
|
||
|
||
}
|
||
})
|
||
},
|
||
// 选择的课题发生改变
|
||
changeChoiceTopic(e) {
|
||
const values = e.detail.value // 是一个数组 ['1', '2']
|
||
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.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 防止显示出问题
|
||
this.setData({
|
||
inviteCode: e.detail.value,
|
||
vipBool: false,
|
||
speakerBool: false,
|
||
cooperatieBool: false,
|
||
guestBool: false,
|
||
})
|
||
},
|
||
// 校验邀请码
|
||
validateCode() {
|
||
if (this.data.inviteCode === '' || this.data.inviteCode === undefined) {
|
||
wx.showToast({
|
||
title: '请输入邀请码',
|
||
icon: "none",
|
||
duration: 800,
|
||
});
|
||
return
|
||
}
|
||
// 通过接口验证当前邀请码是否正确
|
||
|
||
let requestParams = {
|
||
randomCode: this.data.inviteCode
|
||
}
|
||
// 会议id获取形式有多种
|
||
if (this.data.selectedMeeting.id) {
|
||
requestParams.meetingId = this.data.selectedMeeting.id
|
||
} else {
|
||
wx.getStorage({
|
||
key: "meetingId",
|
||
success(res) {
|
||
requestParams.meetingId = res.data
|
||
}
|
||
})
|
||
}
|
||
signUpApi.judgeMeetingCode(requestParams).then(res => {
|
||
if (res.success) {
|
||
wx.showToast({
|
||
title: '邀请码输入正确',
|
||
icon: "success",
|
||
duration: 800,
|
||
});
|
||
validSuccessCallback()
|
||
} else {
|
||
wx.showToast({
|
||
title: '邀请码输入有误',
|
||
icon: "none",
|
||
duration: 800,
|
||
});
|
||
}
|
||
}).catch(err => {
|
||
wx.showToast({
|
||
title: err.message || err,
|
||
icon: "none",
|
||
duration: 800,
|
||
});
|
||
})
|
||
let validSuccessCallback = () => {
|
||
let toUserCode = this.data.inviteCode.substring(0, this.data.inviteCode.indexOf('-'))
|
||
let validateArr = this.data.inviteCodeArr.filter(item => {
|
||
return toUserCode === item.code
|
||
})
|
||
if (validateArr.length === 0) return
|
||
|
||
this.setData({
|
||
guestType: validateArr[0].type,
|
||
haveMeals: '',
|
||
needHotel: '',
|
||
needPick: '',
|
||
needSend: ''
|
||
})
|
||
switch (validateArr[0].type) {
|
||
case '1':
|
||
this.setData({
|
||
vipBool: true,
|
||
validateBtnBool: false
|
||
})
|
||
break
|
||
case '2':
|
||
this.setData({
|
||
speakerBool: true,
|
||
validateBtnBool: false
|
||
})
|
||
break
|
||
case '3':
|
||
this.setData({
|
||
guestBool: true,
|
||
validateBtnBool: false
|
||
})
|
||
break
|
||
case '4':
|
||
this.setData({
|
||
cooperatieBool: true,
|
||
validateBtnBool: false
|
||
})
|
||
break
|
||
case '5':
|
||
this.setData({
|
||
cooperatieBool: true,
|
||
validateBtnBool: false
|
||
})
|
||
break
|
||
}
|
||
|
||
}
|
||
},
|
||
// 获取图片的id
|
||
getImagesId(e) {
|
||
this.setData({
|
||
imageIds: e.detail.join(',')
|
||
})
|
||
},
|
||
// ppt的上传
|
||
uploadPPT() {
|
||
const that = this
|
||
wx.chooseMessageFile({
|
||
count: 1, //能选择文件的数量
|
||
type: 'file', //能选择文件的类型,我这里只允许上传文件.还有视频,图片,或者都可以
|
||
success(res) {
|
||
var size = res.tempFiles[0].size;
|
||
var name = res.tempFiles[0].name;
|
||
var temporaryPdfArr = [];
|
||
temporaryPdfArr.push(res.tempFiles[0]);
|
||
var filePath = res.tempFiles[0].path;
|
||
if (size > 10485760) { //限制了文件的大小和具体文件类型
|
||
wx.showToast({
|
||
title: '文件大小不能超过10MB',
|
||
icon: "none",
|
||
duration: 2000,
|
||
mask: true
|
||
})
|
||
} else {
|
||
wx.showLoading({
|
||
title: '上传中...',
|
||
mask: true,
|
||
});
|
||
// 如果多个文件 要循环上传
|
||
wx.uploadFile({
|
||
url: baseUrl + URL_CONFIG + 'sys/common/upload', //上传的路径
|
||
filePath: filePath, //刚刚在data保存的文件路径
|
||
name: 'file', //后台获取的凭据
|
||
success(res) {
|
||
var fileBackDa = JSON.parse(res.data);
|
||
var backPdfArr = [];
|
||
backPdfArr.push(fileBackDa)
|
||
wx.hideLoading(); //隐藏提示框
|
||
//上传成功,
|
||
that.setData({
|
||
tempFiles: name,
|
||
speechPpt: fileBackDa.result.id
|
||
});
|
||
}
|
||
})
|
||
}
|
||
}
|
||
})
|
||
},
|
||
// 手机号验证
|
||
validatePhone(e) {
|
||
let value = e.detail.value
|
||
let {
|
||
message,
|
||
errmsg
|
||
} = e.currentTarget.dataset
|
||
if (value === '' || value === undefined) {
|
||
wx.showToast({
|
||
title: message,
|
||
icon: 'none',
|
||
duration: 800
|
||
})
|
||
this.setData({
|
||
flag: true
|
||
})
|
||
return
|
||
} else if (phoneReg(value)) {
|
||
this.setData({
|
||
flag: false
|
||
})
|
||
} else {
|
||
wx.showToast({
|
||
title: errmsg,
|
||
icon: 'none',
|
||
duration: 800
|
||
})
|
||
this.setData({
|
||
flag: true
|
||
})
|
||
|
||
}
|
||
|
||
},
|
||
// 邮编验证
|
||
validatePostCode(e) {
|
||
let value = e.detail.value
|
||
let {
|
||
message,
|
||
errmsg
|
||
} = e.currentTarget.dataset
|
||
if (value === '' || value === undefined) {
|
||
wx.showToast({
|
||
title: message,
|
||
icon: 'none',
|
||
duration: 800
|
||
})
|
||
this.setData({
|
||
flag: true
|
||
})
|
||
return
|
||
} else if (postcode(value)) {
|
||
this.setData({
|
||
flag: false
|
||
})
|
||
} else {
|
||
wx.showToast({
|
||
title: errmsg,
|
||
icon: 'none',
|
||
duration: 800
|
||
})
|
||
this.setData({
|
||
flag: true
|
||
})
|
||
|
||
}
|
||
|
||
},
|
||
// 返回一一个邀请码的数组用于校验输入的邀请码显示不同的字段 1VIP 2演讲嘉宾 3特邀嘉宾 4 合作伙伴
|
||
validateCodeArr(obj) {
|
||
let {
|
||
vipInvitationCode,
|
||
speakerInvitationCode,
|
||
guestInvitationCode,
|
||
cooperativeInvitationCode,
|
||
exhibitorInvitationCode
|
||
} = obj
|
||
return [{
|
||
type: '1',
|
||
code: vipInvitationCode
|
||
},
|
||
{
|
||
type: '2',
|
||
code: speakerInvitationCode
|
||
},
|
||
{
|
||
type: '3',
|
||
code: guestInvitationCode
|
||
},
|
||
{
|
||
type: '4',
|
||
code: cooperativeInvitationCode
|
||
},
|
||
{
|
||
type: '5',
|
||
code: exhibitorInvitationCode
|
||
}
|
||
]
|
||
},
|
||
// 信用代码验证
|
||
validateDutyCode(e) {
|
||
let value = e.detail.value
|
||
let {
|
||
message,
|
||
errmsg
|
||
} = e.currentTarget.dataset
|
||
if (value === '' || value === undefined) {
|
||
wx.showToast({
|
||
title: message,
|
||
icon: 'none',
|
||
duration: 800
|
||
})
|
||
// this.setData({
|
||
// flag: true
|
||
// })
|
||
return
|
||
} else if (dutyCode(value)) {
|
||
// this.setData({
|
||
// flag: false
|
||
// })
|
||
} else {
|
||
wx.showToast({
|
||
title: errmsg,
|
||
icon: 'none',
|
||
duration: 800
|
||
})
|
||
// this.setData({
|
||
// flag: true
|
||
// })
|
||
}
|
||
},
|
||
// 发票项目变化的时候触发的方法
|
||
invoiceProjectChange(e) {
|
||
this.setData({
|
||
invoiceProjectIndex: e.detail.value
|
||
})
|
||
},
|
||
// 内部企业是否禁用 只有参会单位是内部企业才能选 否则禁用内部企业
|
||
setIdentityDisabled(bool) {
|
||
this.setData({
|
||
isNbqyBool: bool
|
||
})
|
||
const identifyLiseSelect = [{
|
||
value: '2',
|
||
name: '参会人',
|
||
disabled: false
|
||
},
|
||
{
|
||
value: '3',
|
||
name: '内部企业',
|
||
disabled: false
|
||
},
|
||
]
|
||
const identifyLiseSelectDisabled = [{
|
||
value: '2',
|
||
name: '参会人',
|
||
disabled: false
|
||
},
|
||
{
|
||
value: '3',
|
||
name: '内部企业',
|
||
disabled: true
|
||
},
|
||
]
|
||
if (bool) {
|
||
// bool为真 说明是内部企业可以选择内部企业
|
||
this.setData({
|
||
'identifyList': identifyLiseSelect
|
||
})
|
||
|
||
} else {
|
||
// 否则不能选中
|
||
console.log('不是内部i企业')
|
||
this.setData({
|
||
'identifyList': identifyLiseSelectDisabled
|
||
})
|
||
}
|
||
},
|
||
// 获取会议的详情
|
||
queryMeetingDetail(id) {
|
||
const that = this
|
||
MeetingApi.meetingDetail({
|
||
id: id
|
||
}).then(res => {
|
||
if (res.success) {
|
||
let meetingCosts = res.result.meetingCosts
|
||
// 国际研讨会 且为WASIC 会议
|
||
if (Number(res.result.isWasic)) {
|
||
this.getLinkTopicsOptionArr(res.result.id)
|
||
meetingCosts = res.result.meetingCostsTwoTopic
|
||
}
|
||
this.setData({
|
||
meetingDetailInfo: res.result,
|
||
inviteCodeArr: that.validateCodeArr(res.result),
|
||
selectedMeeting: res.result,
|
||
meetingCosts: meetingCosts
|
||
})
|
||
}
|
||
})
|
||
},
|
||
// 确定
|
||
formSubmit(e) {
|
||
const formData = Object.assign({}, e.detail.value)
|
||
if (!this.data.selectedCompany.id) {
|
||
wx.showToast({
|
||
title: '请选择参会单位',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
|
||
if (!this.data.selectedPerson.id) {
|
||
wx.showToast({
|
||
title: '请选择参会人',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
// 如果会议是WASIC 需要对是否选择会议名称做校验
|
||
if (this.data.meetingDetailInfo.isWasic) {
|
||
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: '请至少选择一个非参观类会议',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
formData.choiceTopic = choiceArr.join(',')
|
||
}
|
||
// 参会身份验证
|
||
if (formData.identity === '') {
|
||
wx.showToast({
|
||
title: '请选择参会身份',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
// 手机号验证
|
||
if (formData.phone === '' || formData.phone === undefined) {
|
||
wx.showToast({
|
||
title: '请输入手机号',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
// 缴费方式 选择嘉宾不需要校验
|
||
if (formData.payMode === '' && this.data.guestType !== '1') {
|
||
wx.showToast({
|
||
title: '请选择缴费方式',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
// 是否需要发票
|
||
if (formData.needInvoice === -1 && this.data.guestType !== '1') {
|
||
wx.showToast({
|
||
title: '请选择是否需要发票',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
// 需要发票的时候 校验发票的信息
|
||
// 20230720 新增需要判断当需要发票时,所有的发票信息是否填写
|
||
if (Number(formData.needInvoice)) {
|
||
if (!formData.dutyCode) {
|
||
wx.showToast({
|
||
title: '请输入信用代码',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
// 验证企业信用代码是否正确
|
||
if (!dutyCode(formData.dutyCode)) {
|
||
wx.showToast({
|
||
title: '请输入正确的信用代码',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
if (Number(formData.needInvoice) === InvoiceTypeEnums.special.index) {
|
||
if (!formData.companyAddress) {
|
||
wx.showToast({
|
||
title: '请输入公司地址',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
if (!formData.companyPhone) {
|
||
wx.showToast({
|
||
title: '请输入公司电话',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
if (!formData.openingBank) {
|
||
wx.showToast({
|
||
title: '请输入开户行',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
if (!formData.bankAccount) {
|
||
wx.showToast({
|
||
title: '请输入银行账号',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
if (!formData.linkBankNumber) {
|
||
wx.showToast({
|
||
title: '请输入联行号',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
}
|
||
if (formData.invoiceProject === undefined || formData.invoiceProject === -1) {
|
||
wx.showToast({
|
||
title: '请选择发票项目',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
formData.invoiceProject = this.data.invoiceProjectList[formData.invoiceProject].value
|
||
}
|
||
// 不需要发票不校验
|
||
if (formData.identity == '2' && (this.data.selectedPostPerson.id === '' || this.data.selectedPostPerson.id === undefined) && (formData.needInvoice !== undefined && formData.needInvoice !== '0')) {
|
||
wx.showToast({
|
||
title: '请选择邮寄联系人',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
// 邮寄地址
|
||
if (formData.postContactAddress === '' && this.data.guestType !== '1' && formData.needInvoice !== '0') {
|
||
wx.showToast({
|
||
title: '请输入邮寄地址',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
// 邮编
|
||
if (formData.postCode === '' && this.data.guestType !== '1' && formData.needInvoice !== '0') {
|
||
wx.showToast({
|
||
title: '请输入邮编',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
// 是否用餐
|
||
if (this.data.guestType !== '4' && this.data.guestType !== '5' && this.data.identity === '1' && (formData.haveMeals == '' || formData.haveMeals === undefined)) {
|
||
wx.showToast({
|
||
title: '请选择是否用餐',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
// 是否回民 选择了是否用餐才去校验
|
||
if (this.data.guestType !== '4' && this.data.guestType !== '5' && this.data.haveMeal === '1' && (formData.huiPeople == '' || formData.huiPeople === undefined)) {
|
||
wx.showToast({
|
||
title: '请选择是否回民',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
|
||
// 是否住酒店 只有嘉宾身份是vip的才去校验
|
||
if (formData.checkInHotel === '' && this.data.guestType === '1') {
|
||
wx.showToast({
|
||
title: '请选择是否住酒店',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
// 入住酒店时间
|
||
|
||
if ((formData.inHotelTime === '' || formData.inHotelTime === null || formData.inHotelTime === undefined) && this.data.needHotel === '1' && this.data.guestType === '1') {
|
||
wx.showToast({
|
||
title: '请选择入住酒店时间',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
|
||
// 离店时间
|
||
|
||
if ((formData.outHotelTime === '' || formData.outHotelTime === null || formData.outHotelTime === undefined) && this.data.needHotel === '1' && this.data.guestType === '1') {
|
||
wx.showToast({
|
||
title: '请选择离店时间',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
if (formData.inHotelTime && formData.outHotelTime) {
|
||
let flag = compareDate(formData.inHotelTime, formData.outHotelTime)
|
||
if (flag) {
|
||
// 入住酒店时间大于离店时间
|
||
wx.showToast({
|
||
title: '入住酒店时间不能大于离店时间',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
}
|
||
|
||
// 房型
|
||
if (formData.roomLayout === '' && this.data.needHotel === '1' && this.data.guestType === '1') {
|
||
wx.showToast({
|
||
title: '请输入房型',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
|
||
// 是否需要接站
|
||
if (this.data.identity === '1' && this.data.guestType !== '4' && formData.pickUp === '') {
|
||
wx.showToast({
|
||
title: '请选择是否需要接站',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
// 抵达时间
|
||
if (this.data.identity === '1' && this.data.needPick === '1' && this.data.guestType !== '4' && (formData.arrivalTime === '' || formData.arrivalTime === null || formData.arrivalTime === undefined)) {
|
||
wx.showToast({
|
||
title: '请选择抵达时间',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
|
||
// 到达站
|
||
if (this.data.identity === '1' && this.data.needPick === '1' && this.data.guestType !== '4' && formData.destination === '') {
|
||
wx.showToast({
|
||
title: '请选择到达站',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
// 到达班次
|
||
if (this.data.identity === '1' && this.data.needPick === '1' && this.data.guestType !== '4' && formData.arrivalShift === '') {
|
||
wx.showToast({
|
||
title: '请输入到达班次',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
// 是否需要送站
|
||
if (this.data.identity === '1' && this.data.guestType !== '4' && formData.deliveryStation === '') {
|
||
wx.showToast({
|
||
title: '请选择是否需要送站',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
|
||
// 离开时间
|
||
if (this.data.identity === '1' && this.data.needSend === '1' && this.data.guestType !== '4' && (formData.departureTime === '' || formData.departureTime === null || formData.departureTime === undefined)) {
|
||
wx.showToast({
|
||
title: '请选择离开时间',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
// 校验时间
|
||
if (formData.arrivalTime && formData.departureTime) {
|
||
let flag = compareDate(formData.arrivalTime, formData.departureTime)
|
||
if (flag) {
|
||
// 抵达时间大于离开时间
|
||
wx.showToast({
|
||
title: '抵达时间不能大于离开时间',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
}
|
||
// 离开站
|
||
if (this.data.identity === '1' && this.data.needSend === '1' && this.data.guestType !== '4' && formData.departureStation === '') {
|
||
wx.showToast({
|
||
title: '请输入离开站',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
// 离开班次
|
||
|
||
if (this.data.identity === '1' && this.data.needSend === '1' && this.data.guestType !== '4' && formData.departureShift === '') {
|
||
wx.showToast({
|
||
title: '请输入离开班次',
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
return
|
||
}
|
||
|
||
|
||
|
||
// 会议id
|
||
if (this.data.selectedMeeting.id) {
|
||
formData.meetingId = this.data.selectedMeeting.id
|
||
} else {
|
||
wx.getStorage({
|
||
key: "meetingId",
|
||
success(res) {
|
||
formData.meetingId = res.data
|
||
}
|
||
})
|
||
}
|
||
// 参会人id
|
||
formData.companyContactId = this.data.selectedPerson.id
|
||
// 邮寄联系人id
|
||
formData.postContactId = this.data.selectedPostPerson.id
|
||
// 参会企业id
|
||
formData.companyId = this.data.selectedCompany.id
|
||
// 嘉宾身份类型
|
||
formData.guestType = this.data.guestType
|
||
// 参会身份
|
||
formData.identity = this.data.identity
|
||
// 国际研讨会嘉宾上传的照片id
|
||
formData.photo = this.data.imageIds
|
||
// 国际研讨会嘉宾上传的ppt
|
||
formData.speechPpt = this.data.speechPpt
|
||
// 判断当前用户选择有邀请码,处理邀请码数据
|
||
if (this.data.isInviteCode === '1') {
|
||
// 邀请码数据
|
||
formData.invitationCode = formData.inviteCode
|
||
}
|
||
// 会议类型
|
||
// formData.meetingType = this.data.selectedMeeting.meetingType
|
||
console.log(formData);
|
||
let callback = () => {
|
||
wx.showLoading({
|
||
title: '加载中',
|
||
mask: true
|
||
})
|
||
let func
|
||
let lastPage // 上一个调换的页面,用于记录编辑成功后返回哪个页面
|
||
const isEdit = this.isEdit
|
||
if (isEdit) {
|
||
func = MeetingApi.editContactsInfo
|
||
formData.id = this.model.id // 编辑参会人的信息
|
||
lastPage = this.lastPage
|
||
} else {
|
||
func = signUpApi.signUpMeeting
|
||
}
|
||
func(formData).then(res => {
|
||
if (res.success) {
|
||
wx.hideLoading({})
|
||
let message = isEdit ? '编辑成功' : '报名成功'
|
||
wx.showToast({
|
||
title: message,
|
||
icon: 'loading',
|
||
duration: 1500
|
||
})
|
||
// 成功 清除缓存 跳转报名成功页面
|
||
wx.removeStorage({
|
||
key: 'selectedCompany',
|
||
})
|
||
wx.removeStorage({
|
||
key: 'selectedPerson',
|
||
})
|
||
wx.removeStorage({
|
||
key: 'selectedPostPerson',
|
||
})
|
||
wx.removeStorage({
|
||
key: 'meetingId',
|
||
})
|
||
wx.removeStorage({
|
||
key: 'currentMeetingInfo',
|
||
success() {
|
||
// 非编辑页面跳转到下一页
|
||
if (!isEdit) {
|
||
// 跳转报名成功页面 res.result为true不需要审核
|
||
if (!res.result) {
|
||
wx.navigateTo({
|
||
url: `../signUpSuccess/signUpSuccess?audit=${res.result}`,
|
||
})
|
||
} else {
|
||
wx.navigateTo({
|
||
url: `../signUpSuccess/signUpSuccess`,
|
||
})
|
||
}
|
||
} else {
|
||
// 编辑页面跳转到会议列表页
|
||
wx.navigateTo({
|
||
url: lastPage,
|
||
})
|
||
}
|
||
}
|
||
})
|
||
} else {
|
||
wx.showToast({
|
||
title: res.message,
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
}
|
||
}).catch(err => {
|
||
wx.showToast({
|
||
title: err.message,
|
||
icon: 'none',
|
||
duration: 2000
|
||
})
|
||
})
|
||
}
|
||
// 如果不需要发票
|
||
if (!Number(formData.needInvoice)) {
|
||
callback && callback()
|
||
return
|
||
}
|
||
//显示 校验发票信息的弹框
|
||
this.showConfirmModal(formData, callback)
|
||
},
|
||
/**
|
||
* 通过嘉宾类型 更新相应的DOM
|
||
* @param guestType
|
||
*/
|
||
updateGuestFlag(guestType) {
|
||
guestType = +guestType
|
||
switch (guestType) {
|
||
case GuestTypeEnums.VIP.index:
|
||
this.setData({
|
||
vipBool: true,
|
||
validateBtnBool: false,
|
||
guestType_dictText: GuestTypeEnums.VIP.name
|
||
})
|
||
break
|
||
case GuestTypeEnums.speaker.index:
|
||
this.setData({
|
||
speakerBool: true,
|
||
validateBtnBool: false,
|
||
guestType_dictText: GuestTypeEnums.speaker.name
|
||
})
|
||
break
|
||
case GuestTypeEnums.guestInvitation.index:
|
||
this.setData({
|
||
guestBool: true,
|
||
validateBtnBool: false,
|
||
guestType_dictText: GuestTypeEnums.guestInvitation.name
|
||
})
|
||
break
|
||
case GuestTypeEnums.cooperative.index:
|
||
this.setData({
|
||
cooperatieBool: true,
|
||
validateBtnBool: false,
|
||
guestType_dictText: GuestTypeEnums.cooperative.name
|
||
})
|
||
break
|
||
case GuestTypeEnums.exhibitor.index:
|
||
this.setData({
|
||
cooperatieBool: true,
|
||
validateBtnBool: false,
|
||
guestType_dictText: GuestTypeEnums.exhibitor.name
|
||
})
|
||
break
|
||
}
|
||
},
|
||
/**
|
||
* 更新radio对应的选中状态
|
||
* @param arr-radio 对应的数组
|
||
* @param value-选中的值
|
||
*/
|
||
updateRadioArr(arr, value) {
|
||
value = value + '' // 修改成字符串 防止匹配不到位
|
||
arr.map(tt => {
|
||
if (tt.value === value) {
|
||
tt.checked = true
|
||
}
|
||
})
|
||
},
|
||
/**
|
||
* 更新Checkbox对应的选中状态
|
||
* @param arr-Checkbox对应的数组 和 showTopicsArr 对应的数据格式一致
|
||
* @param valueArr-选中的值-数组
|
||
* @param type-类型 ‘all’ 单选多选全都匹配; ‘check’-匹配多选 ‘radio’匹配单选
|
||
*/
|
||
updateCheckboxArr(arr, valueArr, type) {
|
||
arr.map(tt => {
|
||
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
|
||
}
|
||
})
|
||
}
|
||
})
|
||
},
|
||
// 通过文件id获取文件的相关信息
|
||
getFileInfo(id) {
|
||
return new Promise(resolve => {
|
||
let result = {}
|
||
MeetingApi.queryFileInfoById({
|
||
id: id
|
||
}).then(res => {
|
||
if (res.success) {
|
||
result = res.result
|
||
}
|
||
}).finally(() => {
|
||
resolve(result)
|
||
})
|
||
})
|
||
},
|
||
// 获取文件信息
|
||
async initFileList(fileIds) {
|
||
if (fileIds) {
|
||
const fileList = []
|
||
let arr = fileIds.split(',')
|
||
for (let i = 0; i < arr.length; i++) {
|
||
let fileObj = {}
|
||
fileObj = await this.getFileInfo(arr[i])
|
||
fileList.push({
|
||
id: fileObj.id,
|
||
name: fileObj.fileName
|
||
})
|
||
}
|
||
return fileList
|
||
}
|
||
},
|
||
// 编辑--用于信息的回显
|
||
async edit(record) {
|
||
this.model = Object.assign({}, record)
|
||
|
||
// 通过接口获取全部的企业信息
|
||
let companyInfo = await this.queryCompanyInfoById(this.model.companyId)
|
||
// 然后和PC端一样对比字段的值,将没有的初始化复制
|
||
let invoiceKeys = ['dutyCode', 'companyAddress', 'companyPhone', 'openingBank', 'bankAccount', 'linkBankNumber']
|
||
let invoiceInfo = {}
|
||
invoiceKeys.map(key => {
|
||
if (this.model[key]) {
|
||
invoiceInfo[key] = this.model[key]
|
||
}
|
||
})
|
||
// 选中的参会单位
|
||
const selectedCompany = Object.assign({}, companyInfo, {
|
||
id: this.model.companyId,
|
||
companyName: this.model.companyName,
|
||
}, invoiceInfo)
|
||
// 选中的参会单位
|
||
// const selectedCompany = {
|
||
// id:this.model.companyId,
|
||
// companyName:this.model.companyName,
|
||
// // 写入发票的信息,因为需要回显
|
||
// dutyCode:this.model.dutyCode, // 信用代码
|
||
// companyAddress:this.model.companyAddress, // 公司地址
|
||
// companyPhone:this.model.companyPhone, // 公司电话
|
||
// openingBank:this.model.openingBank, // 开户行
|
||
// bankAccount:this.model.bankAccount, // 银行账号
|
||
// linkBankNumber:this.model.linkBankNumber // 联行号
|
||
// }
|
||
// 参会人
|
||
const selectedPerson = {
|
||
id: this.model.companyContactTemporaryId,
|
||
name: this.model.companyContactName
|
||
}
|
||
// 如果身份是嘉宾则有邀请码,不是嘉宾则没有邀请码
|
||
this.changeInviteCode({
|
||
detail: {
|
||
value: this.model.identity === MeetIdentifyTypeEnums.guest.index ? '1' : '0'
|
||
}
|
||
})
|
||
|
||
// 选中的身份
|
||
const selectedIdentity = this.model.identity + ''
|
||
// 参会身份选中状态的处理
|
||
this.updateRadioArr(this.data.identifyList, selectedIdentity)
|
||
|
||
// 参会人的时候更新参会人的相关信息
|
||
const updateObj = {
|
||
identity: this.model.identity + '' // 参会人信息
|
||
}
|
||
// 如果当前会议是WASIC需要处理 选中主题字段
|
||
if (this.data.meetingDetailInfo.isWasic) {
|
||
// 选中的主题
|
||
const choiceTopic = (this.model.choiceTopic || '').split(',')
|
||
this.updateCheckboxArr(this.data.showTopicsArr, choiceTopic, 'all')
|
||
// 计算费用
|
||
updateObj.meetingCosts = this.handleMeetingCostSum()
|
||
}
|
||
if (this.model.identity === MeetIdentifyTypeEnums.attendee.index) {
|
||
this.updateRadioArr(this.data.need, '0')
|
||
updateObj.need = this.data.need
|
||
// 缴费方式
|
||
this.updateRadioArr(this.data.paymentMethodList, this.model.payMode)
|
||
updateObj.paymentMethodList = this.data.paymentMethodList
|
||
updateObj.payMethod = this.model.payMode + ''
|
||
// 是否选择发票的选中的索引 默认需要
|
||
const index = this.data.needInvoiceList.findIndex(e => e.value === (this.model.needInvoice + '')) + ''
|
||
updateObj.index = index
|
||
// 发票项目选择的索引
|
||
const invoiceProjectIndex = this.data.invoiceProjectList.findIndex(e => e.value === (this.model.invoiceProject + ''))
|
||
updateObj.invoiceProjectIndex = invoiceProjectIndex
|
||
// 回显邮寄联系人
|
||
const selectedPostPerson = {
|
||
id: this.model.postContactId,
|
||
name: this.model.postContactName,
|
||
contactAddress: this.model.postContactAddress, // 邮寄地址
|
||
postalCode: this.model.postCode, // 邮编
|
||
}
|
||
updateObj.selectedPostPerson = selectedPostPerson
|
||
updateObj.remark = this.model.remark // 备注
|
||
|
||
} else if (this.model.identity === MeetIdentifyTypeEnums.guest.index) {
|
||
// 将验证码相关显示信息回显
|
||
const guestType = this.model.guestType + '' // 嘉宾类型
|
||
this.updateGuestFlag(guestType)
|
||
updateObj.guestType = guestType
|
||
this.updateRadioArr(this.data.need, '1')
|
||
updateObj.need = this.data.need
|
||
this.data.guestInfo.speechTopic = this.model.speechTopic // 演讲题目
|
||
// 演讲PPT--先获取文件的id 处理全局的信息 speechPpt-文件id tempFiles--文件的名称
|
||
if (this.model.speechPpt) {
|
||
//todo PC端可以上传多个文件,但是小程序只做了一个 先按照小程序的处理
|
||
this.initFileList(this.model.speechPpt).then(res => {
|
||
this.setData({
|
||
speechPpt: res[0].id,
|
||
tempFiles: res[0].name,
|
||
})
|
||
})
|
||
} else {
|
||
|
||
}
|
||
updateObj.imageIds = this.model.photo // 照片
|
||
this.data.guestInfo.profile = this.model.profile // 个人简介
|
||
// haveMeals-是否用餐:
|
||
this.updateRadioArr(this.data.needHaveMealsArr, this.model.haveMeals)
|
||
updateObj.haveMeal = this.model.haveMeals + '' // 是否用餐
|
||
updateObj.needHaveMealsArr = this.data.needHaveMealsArr // 是否用餐
|
||
|
||
this.updateRadioArr(this.data.needHuiPeopleArr, this.model.huiPeople) // 是否回民
|
||
updateObj.needHuiPeopleArr = this.data.needHuiPeopleArr
|
||
|
||
this.updateRadioArr(this.data.needCheckInHotelArr, this.model.checkInHotel) // 是否住酒店
|
||
updateObj.needCheckInHotelArr = this.data.needCheckInHotelArr // 是否住酒店radio数组
|
||
updateObj.needHotel = this.model.checkInHotel + '' // 是否住酒店
|
||
updateObj.inHotelTime = this.model.inHotelTime + '' // 入住酒店时间
|
||
updateObj.outHotelTime = this.model.outHotelTime + '' // 离店时间
|
||
this.data.guestInfo.roomLayout = this.model.roomLayout // 房型
|
||
this.updateRadioArr(this.data.needPickUpArr, this.model.pickUp) // 是否需要接站radio数组
|
||
|
||
updateObj.needPickUpArr = this.data.needPickUpArr
|
||
updateObj.needPick = this.model.pickUp + '' // 是否需要接站
|
||
updateObj.arrivalTime = this.model.arrivalTime + '' // 抵达时间
|
||
|
||
this.data.guestInfo.destination = this.model.destination // 到达站
|
||
this.data.guestInfo.arrivalShift = this.model.arrivalShift // 到达班次:
|
||
|
||
this.updateRadioArr(this.data.needDeliveryStationArr, this.model.deliveryStation)
|
||
updateObj.needDeliveryStationArr = this.data.needDeliveryStationArr
|
||
// updateObj.deliveryStation = this.model.deliveryStation + '' // 是否需要送站
|
||
updateObj.needSend = this.model.deliveryStation + '' // 是否需要送站
|
||
|
||
updateObj.departureTime = this.model.departureTime // 离开时间
|
||
this.data.guestInfo.departureStation = this.model.departureStation // 离开站
|
||
this.data.guestInfo.departureShift = this.model.departureShift // 离开班次
|
||
this.data.guestInfo.peer = this.model.peer // 同行人
|
||
this.data.guestInfo.remark = this.model.remark // 备注
|
||
|
||
|
||
}
|
||
this.setData({
|
||
isEdit: true,
|
||
selectedCompany,
|
||
selectedPerson,
|
||
phone: this.model.phone,
|
||
selectedIdentity, // 参会身份
|
||
identifyList: this.data.identifyList, // 参会身份选中
|
||
guestInfo: this.data.guestInfo, // 嘉宾的相关信息
|
||
...updateObj
|
||
})
|
||
|
||
},
|
||
// 通过id获取企业的信息
|
||
queryCompanyInfoById(id) {
|
||
return new Promise(resolve => {
|
||
let result = {}
|
||
MeetingApi.queryCompanyInfoById({
|
||
id
|
||
}).then(callRes => {
|
||
if (callRes.success) {
|
||
result = callRes.result || {}
|
||
}
|
||
}).finally(() => {
|
||
resolve(result)
|
||
})
|
||
})
|
||
},
|
||
/**
|
||
* 生命周期函数--监听页面加载
|
||
*/
|
||
onLoad: async function (options) {
|
||
console.log("------options---------", options)
|
||
// options = {
|
||
// id: "1683047817135579138",
|
||
// meetingId: "1681693843581128706",
|
||
// meetingType: 3,
|
||
// ope: 'edit'
|
||
// }
|
||
// 这个id 可能是是会议活动进来的 或者消息 或者扫码的
|
||
if (options.meetingId) {
|
||
await this.queryMeetingDetail(options.meetingId)
|
||
// this.queryMeetingDetail('1504615517497524226')
|
||
}
|
||
|
||
if (options.nolimit) {
|
||
this.setData({
|
||
nolimitBool: true
|
||
})
|
||
}
|
||
this.setData({
|
||
pageTitle: options.id ? '编辑报名信息' : '会议报名'
|
||
})
|
||
if (options.id) {
|
||
this.isEdit = options.ope === 'edit'
|
||
this.lastPage = `../${options.page}/${options.page}`
|
||
// 对上一个页面的参数进行处理
|
||
this.lastOptions = options.options && JSON.parse(options.options) || {}
|
||
let str = ''
|
||
Object.keys(this.lastOptions).forEach((tt, i) => {
|
||
if (i > 0) {
|
||
str += `&${tt}=${this.lastOptions[tt]}`
|
||
} else {
|
||
str += `?${tt}=${this.lastOptions[tt]}`
|
||
}
|
||
})
|
||
this.lastPage += str
|
||
// 通过id获取参会人信息
|
||
MeetingApi.queryPersongInfoById({
|
||
id: options.id
|
||
}).then(res => {
|
||
if (res.success) {
|
||
this.edit(res.result)
|
||
}
|
||
})
|
||
}
|
||
// 从缓存中拿选中的企业
|
||
const that = this
|
||
|
||
wx.getStorage({
|
||
key: 'selectedCompany',
|
||
success(res) {
|
||
that.setData({
|
||
selectedCompany: JSON.parse(res.data)
|
||
})
|
||
}
|
||
})
|
||
// 从缓存中拿选中的会议的信息
|
||
|
||
wx.getStorage({
|
||
key: 'currentMeetingInfo',
|
||
success(res) {
|
||
that.setData({
|
||
selectedMeeting: res.data
|
||
})
|
||
}
|
||
})
|
||
},
|
||
|
||
/**
|
||
* 生命周期函数--监听页面初次渲染完成
|
||
*/
|
||
onReady: function () {
|
||
|
||
},
|
||
|
||
/**
|
||
* 生命周期函数--监听页面显示
|
||
*/
|
||
onShow: function () {
|
||
|
||
},
|
||
|
||
/**
|
||
* 生命周期函数--监听页面隐藏
|
||
*/
|
||
onHide: function () {
|
||
|
||
},
|
||
|
||
/**
|
||
* 生命周期函数--监听页面卸载
|
||
*/
|
||
onUnload: function () {
|
||
|
||
},
|
||
|
||
/**
|
||
* 页面相关事件处理函数--监听用户下拉动作
|
||
*/
|
||
onPullDownRefresh: function () {
|
||
|
||
},
|
||
|
||
/**
|
||
* 页面上拉触底事件的处理函数
|
||
*/
|
||
onReachBottom: function () {
|
||
|
||
},
|
||
|
||
/**
|
||
* 用户点击右上角分享
|
||
*/
|
||
onShareAppMessage: function () {
|
||
|
||
}
|
||
})
|