【bug】消息报名的参会单位不可更改

This commit is contained in:
fengachen
2021-11-04 11:56:01 +08:00
parent 33bb8f954f
commit 3306eadb0d
6 changed files with 219 additions and 145 deletions
+124 -104
View File
@@ -65,10 +65,10 @@ Page({
},
],
// 选中的参会身份 默认参会人
selectedIdentity:'2',
selectedIdentity: '2',
// 是否选择发票的选中的索引 默认需要
index: -1,
paymentMethod:'1',
paymentMethod: '1',
// 抵达时间
arrivalTime: '请选择抵达时间',
// 离开时间
@@ -82,17 +82,17 @@ Page({
// 选中的会议
selectedMeeting: {},
// 会议id
meetingId:'',
meetingId: '',
// 是否正确填写信息
flag: false,
// 是否是首页消息进来的
indexMsgBool:false,
indexMsgBool: false,
// 首页消息
indexMsg: '',
// 扫码报名的 需要调用无限制接口
nolimitBool:false,
nolimitBool: false,
// 会议费用
meetingCost:''
meetingCost: ''
},
// 是否需要发票的选择
needInvoiceChange(e) {
@@ -113,68 +113,70 @@ Page({
})
},
// 选择参会身份
changeIdentity(e){
changeIdentity(e) {
const that = this
this.setData({
selectedIdentity:e.detail.value
})
console.log(e.detail.value);
// 参会身份选择嘉宾和内部企业 会议费用为 0
if(e.detail.value === '2'){
// 标协会议需要判断选中的企业是否是标协成员
if(this.data.selectedMeeting.meetingType === '2'){
signUpApi.validateStandard({companyName:that.data.selectedCompany.companyName}).then(result => {
if(result.result){
that.setData({
meetingCost:that.data.selectedMeeting.meetingCostsVip
})
}else{
that.setData({
meetingCost:that.data.selectedMeeting.meetingCosts
})
}
})
}else{
this.setData({
meetingCost:that.data.selectedMeeting.meetingCosts
})
}
}else{
this.setData({
meetingCost:'0.00'
selectedIdentity: e.detail.value
})
}
console.log(e.detail.value);
// 参会身份选择嘉宾和内部企业 会议费用为 0
if (e.detail.value === '2') {
// 标协会议需要判断选中的企业是否是标协成员
if (this.data.selectedMeeting.meetingType === '2') {
signUpApi.validateStandard({
companyName: that.data.selectedCompany.companyName
}).then(result => {
if (result.result) {
that.setData({
meetingCost: that.data.selectedMeeting.meetingCostsVip
})
} else {
that.setData({
meetingCost: that.data.selectedMeeting.meetingCosts
})
}
})
} else {
this.setData({
meetingCost: that.data.selectedMeeting.meetingCosts
})
}
} else {
this.setData({
meetingCost: '0.00'
})
}
},
// 缴费方式的选择
paymentMethodRadioChange(e){
paymentMethodRadioChange(e) {
this.setData({
paymentMethod:e.detail.value
paymentMethod: e.detail.value
})
},
// 确定
formSubmit(e) {
const formData = Object.assign({}, e.detail.value)
// 会议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.meetingType = this.data.selectedMeeting.meetingType
console.log(formData);
// 会议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.meetingType = this.data.selectedMeeting.meetingType
console.log(formData);
if (this.data.flag) {
wx.showToast({
title: '信息输入有误',
@@ -193,7 +195,7 @@ Page({
return
}
// 手机号验证
if(formData.phone === '' || formData.phone === undefined ){
if (formData.phone === '' || formData.phone === undefined) {
wx.showToast({
title: '请输入手机号',
icon: 'none',
@@ -247,32 +249,32 @@ Page({
return
}
// 校验时间
if(formData.arrivalTime && formData.departureTime){
let flag = compareDate(formData.arrivalTime,formData.departureTime)
if(flag){
if (formData.arrivalTime && formData.departureTime) {
let flag = compareDate(formData.arrivalTime, formData.departureTime)
if (flag) {
// 抵达时间大于离开时间
wx.showToast({
title: '抵达时间不能大于离开时间',
icon:'none',
duration:2000
icon: 'none',
duration: 2000
})
return
}
}
wx.showLoading({
title: '加载中',
mask:true
mask: true
})
signUpApi.signUpMeeting(formData).then(res => {
if (res.success) {
wx.hideLoading({
})
wx.showToast({
title: '报名成功',
icon:'loading',
duration:1500
icon: 'loading',
duration: 1500
})
// 成功 清除缓存 跳转报名成功页面
wx.removeStorage({
@@ -285,19 +287,19 @@ Page({
key: 'currentMeetingInfo',
success() {
// 跳转报名成功页面
if(formData.payMode){
if (formData.payMode) {
wx.navigateTo({
url: `../signUpSuccess/signUpSuccess?payMode=${formData.payMode}`,
})
}else{
} else {
wx.navigateTo({
url: `../signUpSuccess/signUpSuccess`,
})
}
}
})
}else{
} else {
wx.showToast({
title: res.message,
icon: 'none',
@@ -314,12 +316,26 @@ Page({
},
// 选择参会单位
selectCompany() {
console.log('选择参会单位',this.data.nolimitBool);
if(this.data.nolimitBool){
let flag
wx.getStorage({
key: 'companyDisabled',
success(res) {
if (res.data) {
flag = res.data
}
}
})
if (flag) {
return
}
console.log('选择参会单位', this.data.nolimitBool);
if (this.data.nolimitBool) {
wx.navigateTo({
url: `../companyList/companyList?nolimit=nolimt`,
})
}else{
} else {
wx.navigateTo({
url: `../companyList/companyList`,
})
@@ -341,21 +357,23 @@ Page({
}
},
// 根据会议id查询会议信息
queryMeetingInfo(id){
MeetingApi.meetingDetail({id:id}).then(res => {
queryMeetingInfo(id) {
MeetingApi.meetingDetail({
id: id
}).then(res => {
console.log(res);
if(res.success){
if (res.success) {
this.setData({
selectedMeeting:res.result,
meetingCost:res.result.meetingCosts
selectedMeeting: res.result,
meetingCost: res.result.meetingCosts
})
// 存储会议信息
wx.setStorage({
key:'currentMeetingInfo',
data:res.result
key: 'currentMeetingInfo',
data: res.result
})
}
}).catch( () => {
}).catch(() => {
wx.showToast({
title: '加载失败',
icon: 'none',
@@ -367,33 +385,33 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if(options.type){
if (options.type) {
this.setData({
indexMsg: options.type,
})
}
if(options.nolimit){
if (options.nolimit) {
this.setData({
nolimitBool:true
nolimitBool: true
})
}
// this.queryMeetingInfo('1455359606691979265')
if(options.meetingId){
console.log(options.meetingId,'options.meetingId');
if (options.meetingId) {
console.log(options.meetingId, 'options.meetingId');
this.queryMeetingInfo(options.meetingId)
this.setData({
meetingId:options.meetingId
meetingId: options.meetingId
})
wx.setStorage({
key:'meetingId',
data:options.meetingId
key: 'meetingId',
data: options.meetingId
})
}
const that = this
// 是否是从首页消息进来的报名
if (options.type === 'indexMsg') {
this.setData({
indexMsgBool:true
indexMsgBool: true
})
// 默认填写个人信息
@@ -408,10 +426,10 @@ Page({
'selectedPerson.id': res.data.id,
'selectedCompany.id': res.data.companyId,
phone: res.data.phone,
'selectedPostPerson.id':res.data.id,
'selectedPostPerson.name':res.data.name,
'selectedPostPerson.contactAddress':res.data.contactAddress,
'selectedPostPerson.postalCode':res.data.postalCode,
'selectedPostPerson.id': res.data.id,
'selectedPostPerson.name': res.data.name,
'selectedPostPerson.contactAddress': res.data.contactAddress,
'selectedPostPerson.postalCode': res.data.postalCode,
})
}
})
@@ -499,7 +517,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
console.log(this.data.selectedMeeting,'this.selectedMeeting');
console.log(this.data.selectedMeeting, 'this.selectedMeeting');
const that = this
// 是否是从首页消息进来的报名
if (this.data.type === 'indexMsg') {
@@ -558,15 +576,17 @@ Page({
selectedMeeting: res.data
})
// 标协会议需要判断单位是否是会员单位
if(that.data.selectedCompany.companyName && res.data.meetingType+'' === '2' ){
signUpApi.validateStandard({companyName:that.data.selectedCompany.companyName}).then(result => {
if(result.result){
if (that.data.selectedCompany.companyName && res.data.meetingType + '' === '2') {
signUpApi.validateStandard({
companyName: that.data.selectedCompany.companyName
}).then(result => {
if (result.result) {
that.setData({
meetingCost:res.data.meetingCostsVip
meetingCost: res.data.meetingCostsVip
})
}else{
} else {
that.setData({
meetingCost:res.data.meetingCosts
meetingCost: res.data.meetingCosts
})
}
})
@@ -610,4 +630,4 @@ Page({
onShareAppMessage: function () {
}
})
})