【bug】手机号必填校验
This commit is contained in:
@@ -175,6 +175,15 @@ Page({
|
||||
})
|
||||
return
|
||||
}
|
||||
// 手机号验证
|
||||
if(formData.phone === '' || formData.phone === undefined ){
|
||||
wx.showToast({
|
||||
title: '请输入手机号',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
return
|
||||
}
|
||||
// 缴费方式
|
||||
if (formData.payMode === '') {
|
||||
wx.showToast({
|
||||
|
||||
@@ -79,7 +79,7 @@ Page({
|
||||
// 参会身份
|
||||
identity: '',
|
||||
// 是否有邀请码
|
||||
isInviteCode:'',
|
||||
isInviteCode: '',
|
||||
// 缴费方式
|
||||
payMethod: '',
|
||||
// 缴费方式
|
||||
@@ -192,21 +192,21 @@ Page({
|
||||
})
|
||||
},
|
||||
// 是否有邀请码的选择
|
||||
changeInviteCode(e){
|
||||
changeInviteCode(e) {
|
||||
let value = e.detail.value
|
||||
this.setData({
|
||||
isInviteCode: value,
|
||||
inviteCode:'',
|
||||
inviteCode: '',
|
||||
})
|
||||
if(value === '1'){
|
||||
if (value === '1') {
|
||||
// 选择是 将身份设置为嘉宾
|
||||
this.setData({
|
||||
identity:'1'
|
||||
identity: '1'
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
|
||||
this.setData({
|
||||
identity:'',
|
||||
identity: '',
|
||||
vipBool: false,
|
||||
speakerBool: false,
|
||||
cooperatieBool: false,
|
||||
@@ -326,7 +326,7 @@ Page({
|
||||
validateBtnBool: false
|
||||
})
|
||||
break
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -532,6 +532,15 @@ Page({
|
||||
})
|
||||
return
|
||||
}
|
||||
// 手机号验证
|
||||
if (formData.phone === '' || formData.phone === undefined) {
|
||||
wx.showToast({
|
||||
title: '请输入手机号',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
})
|
||||
return
|
||||
}
|
||||
// 缴费方式 选择嘉宾不需要校验
|
||||
if (formData.payMode === '' && this.data.guestType !== '1') {
|
||||
wx.showToast({
|
||||
@@ -550,7 +559,7 @@ Page({
|
||||
})
|
||||
return
|
||||
}
|
||||
if(formData.identity == '2' && this.data.selectedPostPerson.id ==- '' || this.data.selectedPostPerson.id === undefined ){
|
||||
if (formData.identity == '2' && this.data.selectedPostPerson.id == -'' || this.data.selectedPostPerson.id === undefined) {
|
||||
wx.showToast({
|
||||
title: '请选择邮寄联系人',
|
||||
icon: 'none',
|
||||
@@ -577,7 +586,7 @@ Page({
|
||||
return
|
||||
}
|
||||
// 是否用餐
|
||||
if (this.data.guestType !== '4' && this.data.identity === '1' && (formData.haveMeals == '' || formData.haveMeals === undefined)) {
|
||||
if (this.data.guestType !== '4' && this.data.identity === '1' && (formData.haveMeals == '' || formData.haveMeals === undefined)) {
|
||||
wx.showToast({
|
||||
title: '请选择是否用餐',
|
||||
icon: 'none',
|
||||
@@ -712,16 +721,16 @@ Page({
|
||||
return
|
||||
}
|
||||
// 会议id
|
||||
if( this.data.selectedMeeting.id){
|
||||
formData.meetingId = this.data.selectedMeeting.id
|
||||
}else{
|
||||
wx.getStorage({
|
||||
key:"meetingId",
|
||||
success(res){
|
||||
formData.meetingId = res.data
|
||||
}
|
||||
})
|
||||
}
|
||||
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
|
||||
@@ -739,12 +748,12 @@ Page({
|
||||
console.log(formData);
|
||||
wx.showLoading({
|
||||
title: '加载中',
|
||||
mask:true
|
||||
mask: true
|
||||
})
|
||||
signUpApi.signUpMeeting(formData).then(res => {
|
||||
if (res.success) {
|
||||
wx.hideLoading({
|
||||
|
||||
|
||||
})
|
||||
// 成功 清除缓存 跳转报名成功页面
|
||||
wx.removeStorage({
|
||||
@@ -763,11 +772,11 @@ 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`,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user