[update] -国际研讨会修改报名时 邀请码的验证条件

This commit is contained in:
fengchenchen
2022-06-21 17:56:18 +08:00
parent 92c759aef5
commit 3478e93022
2 changed files with 123 additions and 91 deletions
+13 -10
View File
@@ -6,25 +6,28 @@ const signUpApi = {
// 选择参会单位无权限的接口
companyListNoLimit: (params) => http.get(`${URL_CONFIG}company/payCompanyManagement/listMeeting`, params),
// 添加参会单位
addCompany:(params) => http.post(`${URL_CONFIG}company/payCompanyManagement/add`, params),
addCompany: (params) => http.post(`${URL_CONFIG}company/payCompanyManagement/add`, params),
//添加参会单位无权限接口
addCompanyNoLimit:(params) => http.post(`${URL_CONFIG}company/payCompanyManagement/addMeeting`, params),
addCompanyNoLimit: (params) => http.post(`${URL_CONFIG}company/payCompanyManagement/addMeeting`, params),
// 选择联系人接口
personList:(params) => http.get(`${URL_CONFIG}company/payContactsManagement/queryWXByCompany`, params),
personList: (params) => http.get(`${URL_CONFIG}company/payContactsManagement/queryWXByCompany`, params),
// 选择联系人的接口无权限
personListNolimit:(params) => http.get(`${URL_CONFIG}company/payContactsManagement/queryWXByCompany`, params),
personListNolimit: (params) => http.get(`${URL_CONFIG}company/payContactsManagement/queryWXByCompany`, params),
// 添加联系人接口
addPerson: (params) => http.post(`${URL_CONFIG}company/payContactsManagement/add`, params),
// 添加联系人接口无权限
addPersonNoLimit: (params) => http.post(`${URL_CONFIG}company/payContactsManagement/addMeeting`, params),
// 会议报名接口
signUpMeeting:(params) => http.post(`${URL_CONFIG}meeting/payMeetingSituation/signUp`, params),
signUpMeeting: (params) => http.post(`${URL_CONFIG}meeting/payMeetingSituation/signUp`, params),
// 上传汇款凭证
uploadPayRecord:(params) =>http.post(`${URL_CONFIG}meeting/payMeetingSituation/editTerminal`, params),
uploadPayRecord: (params) => http.post(`${URL_CONFIG}meeting/payMeetingSituation/editTerminal`, params),
// 通过单位名称校验是否标协会员
validateStandard:(params) => http.get(`${URL_CONFIG}meeting/internalMeetingSituation/checkMember`,params),
// 判断当前企业是否是内部企业
judgeInternalEnterprise : (params) => http.get(`${URL_CONFIG}company/payCompanyManagement/getInternalEnterprise`,params),
validateStandard: (params) => http.get(`${URL_CONFIG}meeting/internalMeetingSituation/checkMember`, params),
// 判断当前企业是否是内部企业
judgeInternalEnterprise: (params) => http.get(`${URL_CONFIG}company/payCompanyManagement/getInternalEnterprise`, params),
// 国际研讨会-判断当前的邀请码是否可用
judgeMeetingCode: (params) => http.get(`${URL_CONFIG}meeting/payMeetingSituation/validInvitationCode`, params),
}
export default signUpApi
export default signUpApi
+110 -81
View File
@@ -19,9 +19,8 @@ Page({
// 会议详情
meetingDetailInfo: {},
// 参会身份
identifyList: [
],
isNbqyBool:false,
identifyList: [],
isNbqyBool: false,
// 邀请码数组
inviteCodeArr: [],
// 是否出现输入邀请码 参会身份选择嘉宾才出现
@@ -205,38 +204,36 @@ Page({
})
} else {
const identifyListDisabled = [
{
const identifyListDisabled = [{
value: '2',
name: '参会人',
disabled:false
disabled: false
},
{
value: '3',
name: '内部企业',
disabled:false
disabled: false
},
]
const identifyList = [
{
const identifyList = [{
value: '2',
name: '参会人',
disabled:false
disabled: false
},
{
value: '3',
name: '内部企业',
disabled:true
disabled: true
},
]
if(this.data.isNbqyBool){
if (this.data.isNbqyBool) {
// 是内部企业
this.setData({
identifyList:identifyListDisabled
identifyList: identifyListDisabled
})
}else{
} else {
this.setData({
identifyList:identifyList
identifyList: identifyList
})
}
this.setData({
@@ -245,8 +242,8 @@ Page({
speakerBool: false,
cooperatieBool: false,
guestBool: false,
guestType:'',
guestType: '',
})
}
},
@@ -329,6 +326,7 @@ Page({
},
// 校验邀请码
validateCode() {
console.log("--this.data.inviteCode-------", this.data.inviteCode)
if (this.data.inviteCode === '' || this.data.inviteCode === undefined) {
wx.showToast({
title: '请输入邀请码',
@@ -336,60 +334,88 @@ Page({
duration: 800,
});
return
} else {
console.log(this.data.inviteCodeArr);
let validateArr = this.data.inviteCodeArr.filter(item => {
return this.data.inviteCode === item.code
})
}
// 通过接口验证当前邀请码是否正确
if (validateArr.length === 0) {
wx.showToast({
title: '邀请码输入有误',
icon: "error",
duration: 800,
});
} else {
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,
});
console.log(validateArr[0].type);
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
}
validSuccessCallback()
} else {
wx.showToast({
title: '邀请码输入有误',
icon: "none",
duration: 800,
});
}
}).catch(err => {
wx.showToast({
title: err.message || err,
icon: "none",
duration: 800,
});
})
let validSuccessCallback = () => {
console.log(this.data.inviteCodeArr);
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
console.log(validateArr[0].type);
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
}
}
},
// 获取图片的id
@@ -541,45 +567,43 @@ Page({
]
},
// 内部企业是否禁用 只有参会单位是内部企业才能选 否则禁用内部企业
setIdentityDisabled(bool){
setIdentityDisabled(bool) {
this.setData({
isNbqyBool:bool
isNbqyBool: bool
})
const identifyLiseSelect = [
{
const identifyLiseSelect = [{
value: '2',
name: '参会人',
disabled:false
disabled: false
},
{
value: '3',
name: '内部企业',
disabled:false
disabled: false
},
]
const identifyLiseSelectDisabled = [
{
const identifyLiseSelectDisabled = [{
value: '2',
name: '参会人',
disabled:false
disabled: false
},
{
value: '3',
name: '内部企业',
disabled:true
disabled: true
},
]
if(bool){
if (bool) {
// bool为真 说明是内部企业可以选择内部企业
this.setData({
'identifyList':identifyLiseSelect
'identifyList': identifyLiseSelect
})
}else{
} else {
// 否则不能选中
console.log('不是内部i企业')
this.setData({
'identifyList':identifyLiseSelectDisabled
'identifyList': identifyLiseSelectDisabled
})
}
},
@@ -846,7 +870,7 @@ Page({
// 会议id
// 会议id
if (this.data.selectedMeeting.id) {
formData.meetingId = this.data.selectedMeeting.id
} else {
@@ -871,6 +895,11 @@ Page({
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);
@@ -933,7 +962,7 @@ Page({
// 这个id 可能是是会议活动进来的 或者消息 或者扫码的
if (options.meetingId) {
this.queryMeetingDetail(options.meetingId)
// this.queryMeetingDetail('1504615517497524226')
// this.queryMeetingDetail('1504615517497524226')
}
if (options.nolimit) {
@@ -1013,4 +1042,4 @@ Page({
onShareAppMessage: function () {
}
})
})