diff --git a/pages/addCompany/addCompany.js b/pages/addCompany/addCompany.js
index 6743b2b..6b64568 100644
--- a/pages/addCompany/addCompany.js
+++ b/pages/addCompany/addCompany.js
@@ -1,6 +1,10 @@
// pages/addCompany/addCompany.js
import signUpApi from '../../assets/js/http/signUp'
+import {
+ dutyCode,
+ postcode
+} from '../../utils/validate'
Page({
/**
@@ -8,31 +12,78 @@ Page({
*/
data: {
// 是否是国际研讨会报名的选择
- prepage:''
+ prepage: '',
+ flag: false
},
// 返回选择单位
- backCompanyList(){
+ backCompanyList() {
wx.navigateTo({
url: '../companyList/companyList',
})
},
// 确定
- addCompany(e){
+ addCompany(e) {
const formData = e.detail.value
- const that = this
+ console.log(formData);
+ // 企业名称
+ if (formData.companyName === '') {
+ wx.showToast({
+ title: '请输入企业名称',
+ icon: 'none',
+ duration: 800
+ })
+ return
+ }
+ // 信用代码
+ if (formData.dutyCode === '') {
+ wx.showToast({
+ title: '请输入信用代码',
+ icon: 'none',
+ duration: 800
+ })
+ return
+ }
+ // 公司地址
+ if (formData.companyAddress === '') {
+ wx.showToast({
+ title: '请输入公司地址',
+ icon: 'none',
+ duration: 800
+ })
+ return
+ }
+ // 邮编
+ if (formData.postalCode === '') {
+ wx.showToast({
+ title: '请输入邮编',
+ icon: 'none',
+ duration: 800
+ })
+ return
+ }
+ if(this.data.flag){
+ wx.showToast({
+ title: '信息输入有误',
+ icon: 'none',
+ duration: 800
+ })
+ return
+ }
+
+ const that = this
signUpApi.addCompanyNoLimit(formData).then(res => {
- if(res.success){
+ if (res.success) {
wx.showToast({
title: res.message,
icon: "none",
duration: 800,
});
- if(that.data.prepage === 'guoji' ){
+ if (that.data.prepage === 'guoji') {
wx.navigateTo({
url: '../signUpPageGuoji/signUpPageGuoji',
})
- }else{
+ } else {
wx.navigateTo({
url: '../signUpPage/signUpPage',
})
@@ -43,12 +94,81 @@ Page({
})
},
+ // 信用代码验证
+ 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
+ })
+
+ }
+
+ },
+ // 邮编验证
+ 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
+ })
+
+ }
+
+ },
+
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
- prepage:options.prepage
+ prepage: options.prepage
})
},
@@ -100,4 +220,4 @@ Page({
onShareAppMessage: function () {
}
-})
\ No newline at end of file
+})
diff --git a/pages/addCompany/addCompany.wxml b/pages/addCompany/addCompany.wxml
index 1d17e7c..54736e7 100644
--- a/pages/addCompany/addCompany.wxml
+++ b/pages/addCompany/addCompany.wxml
@@ -6,7 +6,7 @@
企业名称:
-
+
请确保与发票抬头企业名称一致
@@ -14,56 +14,56 @@
信用代码:
-
+
公司地址:
-
+
公司电话:
-
+
银行户名:
-
+
邮编:
-
+
银行账号:
-
+
开户行:
-
+
备注:
-
+
@@ -72,4 +72,4 @@
-
\ No newline at end of file
+
diff --git a/pages/addPerson/addPerson.js b/pages/addPerson/addPerson.js
index d95ba64..7d72a36 100644
--- a/pages/addPerson/addPerson.js
+++ b/pages/addPerson/addPerson.js
@@ -1,6 +1,11 @@
// pages/addPerson/addPerson.js
import signUpApi from '../../assets/js/http/signUp'
+import {
+ isEmail,
+ phoneReg,
+ postcode
+} from '../../utils/validate'
Page({
/**
@@ -8,39 +13,204 @@ Page({
*/
data: {
// 上一个页面选中的企业
- selectedCompany:{},
+ selectedCompany: {},
// 是否是国际研讨会的选择
- prepage:""
+ prepage: "",
+ data: false
},
- // 返回联系人列表
- backPersonList(){
+ // 返回联系人列表
+ backPersonList() {
wx.navigateTo({
url: '../personList/personList',
})
},
+ // 邮编验证
+ validateEmail(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 (isEmail(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
+ })
+
+ }
+
+ },
+ // 手机号验证
+ 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
+ })
+
+ }
+
+ },
// 添加参会人
- addPerson(e){
-
+ addPerson(e) {
+
const that = this
- console.log(that.data.prepage);
- console.log(e);
const formData = e.detail.value
+ console.log(formData);
+ // 姓名
+ if (formData.companyName === '') {
+ wx.showToast({
+ title: '请输入企业名称',
+ icon: 'none',
+ duration: 800
+ })
+ return
+ }
+ // 邮政编码
+ if (formData.postalCode === '') {
+ wx.showToast({
+ title: '请输入邮编',
+ icon: 'none',
+ duration: 800
+ })
+ return
+ }
+ // 手机号
+ if (formData.phone === '') {
+ wx.showToast({
+ title: '请输入手机号',
+ icon: 'none',
+ duration: 800
+ })
+ return
+ }
+ // 性别
+ if (formData.gender === '') {
+ wx.showToast({
+ title: '请选择性别',
+ icon: 'none',
+ duration: 800
+ })
+ return
+ }
+ // 通讯地址
+ if (formData.contactAddress === '') {
+ wx.showToast({
+ title: '请输入通讯地址',
+ icon: 'none',
+ duration: 800
+ })
+ return
+ }
+ // 邮箱
+ if (formData.email === '') {
+ wx.showToast({
+ title: '请输入邮箱',
+ icon: 'none',
+ duration: 800
+ })
+ return
+ }
+ if (this.data.flag) {
+ wx.showToast({
+ title: '信息输入有误',
+ icon: 'none',
+ duration: 800
+ })
+ return
+ }
+
// 参数需要传入公司id
formData.companyId = this.data.selectedCompany.id
signUpApi.addPersonNoLimit(formData).then(res => {
- if(res.success){
+ if (res.success) {
wx.showToast({
title: res.message,
icon: "none",
duration: 800,
});
-
- if(that.data.prepage === 'guoji' ){
+
+ if (that.data.prepage === 'guoji') {
wx.navigateTo({
url: '../signUpPageGuoji/signUpPageGuoji',
})
- }else{
+ } else {
wx.navigateTo({
url: '../signUpPage/signUpPage',
})
@@ -57,11 +227,11 @@ Page({
const that = this
// 从缓存中拿 上个页面选中的企业
wx.getStorage({
- key:'selectedCompany',
+ key: 'selectedCompany',
success(res) {
that.setData({
- selectedCompany:JSON.parse(res.data),
- prepage:options.prepage
+ selectedCompany: JSON.parse(res.data),
+ prepage: options.prepage
})
}
})
@@ -115,4 +285,4 @@ Page({
onShareAppMessage: function () {
}
-})
\ No newline at end of file
+})
diff --git a/pages/addPerson/addPerson.wxml b/pages/addPerson/addPerson.wxml
index 4fad17a..660e724 100644
--- a/pages/addPerson/addPerson.wxml
+++ b/pages/addPerson/addPerson.wxml
@@ -6,39 +6,39 @@
企业名称:
-
+
姓名:
-
+
邮政编码:
-
+
手机号:
-
+
职务:
-
+
-
+
性别:
@@ -54,14 +54,14 @@
通讯地址:
-
+
邮箱:
-
+
@@ -69,7 +69,7 @@
备注:
-
+
diff --git a/pages/meetingDetail/meetingDetail.js b/pages/meetingDetail/meetingDetail.js
index b83c133..d35c385 100644
--- a/pages/meetingDetail/meetingDetail.js
+++ b/pages/meetingDetail/meetingDetail.js
@@ -85,4 +85,4 @@ Page({
onShareAppMessage: function () {
}
-})
\ No newline at end of file
+})
diff --git a/pages/meetingDetail/meetingDetail.json b/pages/meetingDetail/meetingDetail.json
index 28c7f23..86c47b9 100644
--- a/pages/meetingDetail/meetingDetail.json
+++ b/pages/meetingDetail/meetingDetail.json
@@ -1,4 +1,4 @@
{
"navigationBarTitleText": "会议详情",
"usingComponents": {}
-}
\ No newline at end of file
+}
diff --git a/pages/meetingDetail/meetingDetailSigned.wxss b/pages/meetingDetail/meetingDetailSigned.wxss
deleted file mode 100644
index 5ea690f..0000000
--- a/pages/meetingDetail/meetingDetailSigned.wxss
+++ /dev/null
@@ -1,151 +0,0 @@
-page{
- box-sizing: border-box;
- background-color: #F5F5F5;
-}
-.basic-info .title{
- height: 40px;
-}
-.basic-info .title text{
- display: block;
- border-left: 3px solid #069F99;
- height: 14px;
- padding-left: 10px;
- border-radius: 2px;
- display: flex;
- justify-content: center;
- align-items: center;
- color: #333;
- font-size: 15px;
- font-weight: 500;
-}
-.basic-info view{
- background-color: #FFF;
- padding: 15px;
- height: 40px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- color: #333;
- font-size: 14px;
- border-bottom: 0.5px solid #f5f5f5;
- position: relative;
-}
-.basic-info view:last-child{
- border-bottom: 0;
-}
-.meeting-name{
- margin-bottom: 10px;
-}
-.meeting-files{
- margin-top: 10px;
- flex-direction: column;
- align-items: flex-start !important;
- height: auto !important;
-}
-.basic-info .meeting-files .file-name{
- display: flex;
- justify-content: space-between;
- align-items: center;
- width: 100%;
- box-sizing: border-box;
- padding: 0;
- height: 40px;
- margin-top: 10px;
-}
-.file-name view{
- padding: 0;
- height: 30px;
- line-height: 30px;
- border-bottom: 0;
-}
-.file-name view image{
- width: 30px;
- height: 30px;
- margin-right: 10px;
-}
-.basic-info .meeting-files .file-name .look-file{
- color: #069F99;
-}
-.warning-text{
- position: absolute !important;
- top: 5px;
- left: 75px;
- color: #FF5E60 !important;
- font-size: 10px !important;
- padding: 0 !important;
-}
-.warning-text image{
- width: 10px;
- height: 10px;
-}
-.pay-prove-box{
- display: flex !important;
- flex-direction: column !important;
- justify-content: flex-start !important;
- align-items: flex-start !important;
- padding: 0;
- height: 120px !important;
-}
-.pay-prove-box .pay-prove-content{
- margin-top: 20px;
- display: flex;
- justify-content: flex-start;
- align-items: center;
- padding: 0;
- height: 80px;
-}
-.pay-prove-box .pay-prove-content .pay-prove{
- width: 80px;
- height: 80px;
- margin-right: 10px;
- position: relative !important;
- background-color: #D1D1D1;
- padding: 0;
- border-radius: 5px;
- display: flex;
- justify-content: center;
- align-items: center;
-}
-.pay-prove-box .pay-prove-content .pay-prove image{
- width: 80px;
- height: 80px;
-}
-.pay-prove-box .pay-prove-content .pay-prove .delete-image{
- width: 12px;
- height: 12px;
- color: #fff;
- background-color: #FF5E60;
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 7px;
- position: absolute;
- top: -3px;
- right: -3px;
-}
-.sign-up-empty{
- height: 60px;
- width: 100%;
- display: block;
- margin-top: 10px;
-}
-.sign-up{
- width: 100%;
- padding: 10px 15px;
- box-sizing: border-box;
- background-color: #fff;
- position: fixed;
- bottom: 0;
-}
-.sign-up text{
- background-color: #069F99;
- height: 40px;
- border-radius: 10px;
- color: #fff;
- font-size: 16px;
- font-weight: 600;
- display: block;
- text-align: center;
- line-height: 40px;
-}
\ No newline at end of file
diff --git a/pages/signUpPage/signUpPage.js b/pages/signUpPage/signUpPage.js
index 6cc48d0..31c976b 100644
--- a/pages/signUpPage/signUpPage.js
+++ b/pages/signUpPage/signUpPage.js
@@ -1,72 +1,180 @@
// pages/signUpPage/signUpPage.js
import signUpApi from '../../assets/js/http/signUp'
+import {
+ phoneReg,
+ postcode
+} from '../../utils/validate'
Page({
/**
* 页面的初始数据
*/
data: {
// 参会身份
- identifyList:[
- {value: '2', name: '参会人'},
- {value: '1', name: '嘉宾'},
- {value: '3', name: '内部企业'},
+ identifyList: [{
+ value: '2',
+ name: '参会人'
+ },
+ {
+ value: '1',
+ name: '嘉宾'
+ },
+ {
+ value: '3',
+ name: '内部企业'
+ },
],
// 缴费方式
- paymentMethodList:[
- {value: '1', name: '汇款'},
- {value: '2', name: '线上缴费'},
- {value: '3', name: '打包'},
+ paymentMethodList: [{
+ value: '1',
+ name: '汇款'
+ },
+ {
+ value: '2',
+ name: '线上缴费'
+ },
+ {
+ value: '3',
+ name: '打包'
+ },
],
// 是否需要发票
- needInvoiceList:[
- {value: '0', name: '不需要'},
- {value: '1', name: '增值税普通发票'},
- {value: '2', name: '增值税专用发票'},
+ needInvoiceList: [{
+ value: '0',
+ name: '不需要'
+ },
+ {
+ value: '1',
+ name: '增值税普通发票'
+ },
+ {
+ value: '2',
+ name: '增值税专用发票'
+ },
],
// 是否住酒店
- needCheckInHotel:[
- {value: '1', name: '是'},
- {value: '0', name: '否'},
+ needCheckInHotel: [{
+ value: '1',
+ name: '是'
+ },
+ {
+ value: '0',
+ name: '否'
+ },
],
// 是否选择发票的选中的索引
- index:-1,
+ index: -1,
// 抵达时间
- arrivalTime:'请选择抵达时间',
+ arrivalTime: '请选择抵达时间',
// 离开时间
- departureTime:'请选择离开时间',
+ departureTime: '请选择离开时间',
// 选中的参会单位
- selectedCompany:{},
+ selectedCompany: {},
// 选中的联系人
- selectedPerson:{},
+ selectedPerson: {},
// 选中的邮寄联系人
- selectedPostPerson:{},
+ selectedPostPerson: {},
// 选中的会议
- selectedMeeting:{}
+ selectedMeeting: {},
+ // 是否正确填写信息
+ flag: false
},
// 是否需要发票的选择
- needInvoiceChange(e){
+ needInvoiceChange(e) {
this.setData({
- index:e.detail.value
+ index: e.detail.value
})
},
// 抵达时间选择
- bindDateChangeArriveTime(e){
+ bindDateChangeArriveTime(e) {
this.setData({
- arrivalTime:e.detail.value
+ arrivalTime: e.detail.value
})
},
// 离开时间选择
- bindDateChangeLeaveTime(e){
+ bindDateChangeLeaveTime(e) {
this.setData({
- departureTime:e.detail.value
+ departureTime: e.detail.value
})
},
// 确定
- formSubmit(e){
+ formSubmit(e) {
+ console.log(e);
+ const formData = Object.assign({}, e.detail.value)
+
+ if (this.data.flag) {
+ wx.showToast({
+ title: '信息输入有误',
+ icon: 'error',
+ duration: 2000
+ })
+ return
+ }
+ // 参会身份验证
+ if (formData.identity === '') {
+ wx.showToast({
+ title: '请选择参会身份',
+ icon: 'none',
+ duration: 2000
+ })
+ return
+ }
+ // 缴费方式
+ if (formData.payMode === '') {
+ wx.showToast({
+ title: '请选择缴费方式',
+ icon: 'none',
+ duration: 2000
+ })
+ return
+ }
+ // 是否需要发票
+ if (formData.needInvoice === -1) {
+ wx.showToast({
+ title: '请选择发票',
+ icon: 'none',
+ duration: 2000
+ })
+ return
+ }
+ // 邮寄联系人
+ if (formData.postContactId === undefined) {
+ wx.showToast({
+ title: '请选择邮寄联系人',
+ icon: 'none',
+ duration: 2000
+ })
+ return
+ }
+ // 邮寄地址
+ if (formData.postContactAddress === '') {
+ wx.showToast({
+ title: '请输入邮寄地址',
+ icon: 'none',
+ duration: 2000
+ })
+ return
+ }
+ // 邮编
+ if (formData.postCode === '') {
+ wx.showToast({
+ title: '请输入邮编',
+ icon: 'none',
+ duration: 2000
+ })
+ return
+ }
+ // 是否住酒店
+ if (formData.checkInHotel === '') {
+ wx.showToast({
+ title: '请选择是否住酒店',
+ icon: 'none',
+ duration: 2000
+ })
+ return
+ }
- const formData = Object.assign({},e.detail.value)
// 会议id
- formData.meetingId = this.data.selectedMeeting.id
+ formData.meetingId = this.data.selectedMeeting.id
// 参会人id
formData.companyContactId = this.data.selectedPerson.id
// 邮寄联系人id
@@ -78,7 +186,7 @@ Page({
console.log(formData);
signUpApi.signUpMeeting(formData).then(res => {
- if(res.success){
+ if (res.success) {
// 成功 清除缓存 跳转报名成功页面
wx.removeStorage({
key: 'selectedCompany',
@@ -91,7 +199,7 @@ Page({
})
wx.removeStorage({
key: 'currentMeetingInfo',
- success(){
+ success() {
// 跳转报名成功页面
wx.navigateTo({
url: '../signUpSuccess/signUpSuccess',
@@ -102,19 +210,19 @@ Page({
})
},
// 选择参会单位
- selectCompany(){
+ selectCompany() {
wx.navigateTo({
url: '../companyList/companyList',
})
},
// 选择参会人
- selectPerson(e){
+ selectPerson(e) {
console.log(this.data.selectedCompany);
- if(!!this.data.selectedCompany.id){
+ if (!!this.data.selectedCompany.id) {
wx.navigateTo({
url: `../personList/personList?companyId=${this.data.selectedCompany.id}&selectType=${e.currentTarget.dataset.selecttype}`,
})
- }else{
+ } else {
wx.showToast({
title: '请先选择参会单位',
icon: "none",
@@ -134,44 +242,113 @@ Page({
// 从缓存中拿选中的企业
const that = this
wx.getStorage({
- key:'selectedCompany',
+ key: 'selectedCompany',
success(res) {
that.setData({
- selectedCompany:JSON.parse(res.data)
+ selectedCompany: JSON.parse(res.data)
})
}
})
// 从缓存中拿选中的联系人
wx.getStorage({
- key:'selectedPerson',
+ key: 'selectedPerson',
success(res) {
that.setData({
- selectedPerson:res.data
+ selectedPerson: res.data
})
}
})
// 从缓存中拿选中的邮寄联系人
wx.getStorage({
- key:'selectedPostPerson',
+ key: 'selectedPostPerson',
success(res) {
that.setData({
- selectedPostPerson:res.data
+ selectedPostPerson: res.data
})
}
})
// 从缓存中拿选中的会议的信息
wx.getStorage({
- key:'currentMeetingInfo',
+ key: 'currentMeetingInfo',
success(res) {
- console.log(res,'meetingInfo');
+ console.log(res, 'meetingInfo');
that.setData({
- selectedMeeting:res.data
+ selectedMeeting: res.data
})
}
})
},
+ // 手机号验证
+ validatePhone(e) {
+ console.log(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
+ })
+
+ }
+
+ },
/**
* 生命周期函数--监听页面初次渲染完成
diff --git a/pages/signUpPage/signUpPage.wxml b/pages/signUpPage/signUpPage.wxml
index a146456..3b036cd 100644
--- a/pages/signUpPage/signUpPage.wxml
+++ b/pages/signUpPage/signUpPage.wxml
@@ -5,17 +5,17 @@
参会单位:
-
+
参会人:
-
+
手机号:
-
+
@@ -23,7 +23,7 @@
参会身份:
-
+
@@ -56,17 +56,17 @@
邮寄联系人:
-
+
邮寄地址:
-
+
邮编:
-
+
diff --git a/pages/signUpPageGuoji/signUpPageGuoji.js b/pages/signUpPageGuoji/signUpPageGuoji.js
index 4b7c736..c7ceb23 100644
--- a/pages/signUpPageGuoji/signUpPageGuoji.js
+++ b/pages/signUpPageGuoji/signUpPageGuoji.js
@@ -1,7 +1,14 @@
// pages/signUpPageGuoji/signUpPageGuoji.js
import MeetingApi from "../../assets/js/http/meetingApi"
import signUpApi from "../../assets/js/http/signUp"
-import {baseUrl,URL_CONFIG} from '../../assets/js/http/api'
+import {
+ phoneReg,
+ postcode
+} from '../../utils/validate'
+import {
+ baseUrl,
+ URL_CONFIG
+} from '../../assets/js/http/api'
Page({
/**
@@ -57,11 +64,11 @@ Page({
// 是否选择发票的选中的索引
index: -1,
// 上传图片的id
- imageIds:'',
+ imageIds: '',
// 记录临时的文件名 用于回显 小程序上传后后端的名会乱码
- tempFiles:'点击上传',
+ tempFiles: '点击上传',
// ppt Id
- speechPpt:'',
+ speechPpt: '',
// 嘉宾身份
guestType: -1,
// 缴费方式
@@ -101,6 +108,7 @@ Page({
name: '否'
},
],
+ flag:false
},
// 抵达时间选择
bindDateChangeArriveTime(e) {
@@ -251,15 +259,15 @@ Page({
// 获取图片的id
getImagesId(e) {
this.setData({
- imageIds:e.detail.join(',')
+ imageIds: e.detail.join(',')
})
},
// ppt的上传
- uploadPPT(){
+ uploadPPT() {
const that = this
wx.chooseMessageFile({
- count: 1, //能选择文件的数量
- type: 'file', //能选择文件的类型,我这里只允许上传文件.还有视频,图片,或者都可以
+ count: 1, //能选择文件的数量
+ type: 'file', //能选择文件的类型,我这里只允许上传文件.还有视频,图片,或者都可以
success(res) {
console.log(res);
var size = res.tempFiles[0].size;
@@ -267,7 +275,7 @@ Page({
var temporaryPdfArr = [];
temporaryPdfArr.push(res.tempFiles[0]);
var filePath = res.tempFiles[0].path;
- if (size > 10485760 ) { //限制了文件的大小和具体文件类型
+ if (size > 10485760) { //限制了文件的大小和具体文件类型
wx.showToast({
title: '文件大小不能超过10MB',
icon: "none",
@@ -281,9 +289,9 @@ Page({
});
// 如果多个文件 要循环上传
wx.uploadFile({
- url: baseUrl + URL_CONFIG + 'sys/common/upload', //上传的路径
- filePath: filePath, //刚刚在data保存的文件路径
- name: 'file', //后台获取的凭据
+ url: baseUrl + URL_CONFIG + 'sys/common/upload', //上传的路径
+ filePath: filePath, //刚刚在data保存的文件路径
+ name: 'file', //后台获取的凭据
success(res) {
var fileBackDa = JSON.parse(res.data);
console.log(fileBackDa);
@@ -292,8 +300,8 @@ Page({
wx.hideLoading(); //隐藏提示框
//上传成功,
that.setData({
- tempFiles:name,
- speechPpt:fileBackDa.result.id
+ tempFiles: name,
+ speechPpt: fileBackDa.result.id
});
}
})
@@ -301,6 +309,75 @@ Page({
}
})
},
+ // 手机号验证
+ validatePhone(e) {
+ console.log(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 {
@@ -343,8 +420,80 @@ Page({
},
// 确定
formSubmit(e) {
- console.log(e);
const formData = Object.assign({}, e.detail.value)
+ console.log(e);
+
+ if (this.data.flag) {
+ wx.showToast({
+ title: '信息输入有误',
+ icon: 'error',
+ duration: 2000
+ })
+ return
+ }
+ // 参会身份验证
+ if (formData.identity === '') {
+ wx.showToast({
+ title: '请选择参会身份',
+ icon: 'none',
+ duration: 2000
+ })
+ return
+ }
+ // 缴费方式
+ if (formData.payMode === '') {
+ wx.showToast({
+ title: '请选择缴费方式',
+ icon: 'none',
+ duration: 2000
+ })
+ return
+ }
+ // 是否需要发票
+ if (formData.needInvoice === -1) {
+ wx.showToast({
+ title: '请选择发票',
+ icon: 'none',
+ duration: 2000
+ })
+ return
+ }
+ // 邮寄联系人
+ if (formData.postContactId === undefined) {
+ wx.showToast({
+ title: '请选择邮寄联系人',
+ icon: 'none',
+ duration: 2000
+ })
+ return
+ }
+ // 邮寄地址
+ if (formData.postContactAddress === '') {
+ wx.showToast({
+ title: '请输入邮寄地址',
+ icon: 'none',
+ duration: 2000
+ })
+ return
+ }
+ // 邮编
+ if (formData.postCode === '') {
+ wx.showToast({
+ title: '请输入邮编',
+ icon: 'none',
+ duration: 2000
+ })
+ return
+ }
+ // 是否住酒店
+ if (formData.checkInHotel === '') {
+ wx.showToast({
+ title: '请选择是否住酒店',
+ icon: 'none',
+ duration: 2000
+ })
+ return
+ }
// 会议id
formData.meetingId = '1449638073563172866'
// 参会人id
@@ -485,4 +634,4 @@ Page({
onShareAppMessage: function () {
}
-})
\ No newline at end of file
+})
diff --git a/pages/signUpPageGuoji/signUpPageGuoji.wxml b/pages/signUpPageGuoji/signUpPageGuoji.wxml
index d5040d1..1929f3d 100644
--- a/pages/signUpPageGuoji/signUpPageGuoji.wxml
+++ b/pages/signUpPageGuoji/signUpPageGuoji.wxml
@@ -5,20 +5,20 @@
参会单位:
-
参会人:
-
手机号:
-
@@ -75,7 +75,7 @@
邮寄联系人:
+ bindfocus="selectPerson" value="{{selectedPostPerson.name}}" placeholder="请选择邮寄联系人" />
@@ -86,7 +86,7 @@
邮编:
-
+
@@ -136,24 +136,24 @@
- 演讲题目:
+ 演讲题目:
- 演讲PPT:
+ 演讲PPT:
{{tempFiles}}
- 照片:
+ 照片:
- 个人简介:
+ 个人简介:
@@ -307,18 +307,18 @@
- 演讲题目:
+ 演讲题目:
- 演讲PPT:
+ 演讲PPT:
{{tempFiles}}
- 照片:
+ 照片:
@@ -326,7 +326,7 @@
- 个人简介:
+ 个人简介:
@@ -572,4 +572,4 @@
-
\ No newline at end of file
+