diff --git a/app.json b/app.json index 2cf76f8..f38af5c 100644 --- a/app.json +++ b/app.json @@ -2,6 +2,7 @@ "pages":[ "pages/home/home", "pages/login/login", + "pages/register/register", "pages/mine/mine", "pages/index/index", "pages/logs/logs", diff --git a/assets/images/basic-info.png b/assets/images/basic-info.png new file mode 100644 index 0000000..dc73f59 Binary files /dev/null and b/assets/images/basic-info.png differ diff --git a/assets/images/info.png b/assets/images/info.png new file mode 100644 index 0000000..280f270 Binary files /dev/null and b/assets/images/info.png differ diff --git a/assets/images/lishi.png b/assets/images/lishi.png new file mode 100644 index 0000000..70cb2fc Binary files /dev/null and b/assets/images/lishi.png differ diff --git a/assets/images/notice.png b/assets/images/notice.png new file mode 100644 index 0000000..e6ee436 Binary files /dev/null and b/assets/images/notice.png differ diff --git a/assets/images/train.png b/assets/images/train.png new file mode 100644 index 0000000..f9425f2 Binary files /dev/null and b/assets/images/train.png differ diff --git a/assets/js/http/userApi.js b/assets/js/http/userApi.js index 10ae66a..c8d0a89 100644 --- a/assets/js/http/userApi.js +++ b/assets/js/http/userApi.js @@ -65,6 +65,10 @@ const UserApi = { committeeDetail: (params) => http.get(`${URL_CONFIG}payCaseCommittee/payCaseCommittee/detail`, params), // 资料网员分页接口 queryDataMemberList: (params) => http.get(`${URL_CONFIG}jero/memberProjectSubitem/pageCompany`, params), + // 获取用户的信息 + getUserInfo: (params) => http.get(`${URL_CONFIG}/sys/user/queryById`, params), + // 注册 + registerUser: (params) => http.post(`${URL_CONFIG}/sys/user/register`, params), } export default UserApi diff --git a/pages/addCompany/addCompany.js b/pages/addCompany/addCompany.js index 4e317c5..afe0e9d 100644 --- a/pages/addCompany/addCompany.js +++ b/pages/addCompany/addCompany.js @@ -72,19 +72,36 @@ Page({ } const that = this + let pages = getCurrentPages() + let prevPage = pages[pages.length - 3]; signUpApi.addCompanyNoLimit(formData).then(res => { if (res.success) { wx.showToast({ title: res.message, icon: "none", duration: 800, - + }); + wx.setStorage({ + key:'selectedCompany', + data:res.result + }) if (that.data.prepage === 'guoji') { wx.navigateTo({ url: '../signUpPageGuoji/signUpPageGuoji', }) - } else { + } else if(that.data.prepage === 'register'){ + prevPage.setData({ + 'selectedCompany.companyName':res.result.companyName, + 'selectedCompany.companyId':res.result.id, + }) + wx.navigateBack({ + delta: 2, + }) + // wx.navigateTo({ + // url: '../register/register', + // }) + } else{ wx.navigateTo({ url: '../signUpPage/signUpPage', }) diff --git a/pages/companyList/companyList.js b/pages/companyList/companyList.js index 637482c..fbfa818 100644 --- a/pages/companyList/companyList.js +++ b/pages/companyList/companyList.js @@ -21,7 +21,7 @@ Page({ dataSource: [], // 是否国际研讨会过来的 page: "", - // 是否需要调用无限制接口 + // 是否需要调用无限制接口 nolimitBool:false }, // 输入查询条件 @@ -104,6 +104,8 @@ Page({ }, // 选中的企业 selectedItem(e) { + let pages = getCurrentPages() + let prevPage = pages[pages.length - 2]; const that = this // 带过去的信息 let selectedCompany = JSON.stringify(e.currentTarget.dataset.company) @@ -117,7 +119,15 @@ Page({ wx.navigateTo({ url: `../signUpPageGuoji/signUpPageGuoji?company=${selectedCompany}`, }) - } else { + } else if(that.data.page === 'register'){ + prevPage.setData({ + 'selectedCompany.companyName':e.currentTarget.dataset.company.companyName, + 'selectedCompany.companyId':e.currentTarget.dataset.company.id, + }) + wx.navigateBack({ + delta: 1, + }) + } else{ wx.navigateTo({ url: `../signUpPage/signUpPage?company=${selectedCompany}`, }) diff --git a/pages/login/login.js b/pages/login/login.js index 4e2559f..321b524 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -91,6 +91,13 @@ Page({ goBack(){ wx.navigateBack() }, + + // 注册 + register() { + wx.navigateTo({ + url: '../register/register', + }) + }, // 微信登录 wxLogin(){ const that = this diff --git a/pages/login/login.wxml b/pages/login/login.wxml index 88f504a..422f68c 100644 --- a/pages/login/login.wxml +++ b/pages/login/login.wxml @@ -33,6 +33,7 @@ 手机密码登录 + 注册 忘记密码? 或用以下方式登录 diff --git a/pages/meeting/meeting.js b/pages/meeting/meeting.js index 150ce66..16bd4fd 100644 --- a/pages/meeting/meeting.js +++ b/pages/meeting/meeting.js @@ -124,36 +124,37 @@ Page({ // 会议详情 meetingDetail(e) { let meetingInfo = JSON.stringify(e.currentTarget.dataset.meetinginfo) - let meetingItem = e.currentTarget.dataset.meetinginfo + wx.navigateTo({ + url: `../meetingDetailSigned/meetingDetailSigned?meetingInfo=${meetingInfo}`, // (已报名) + }) + + // let meetingItem = e.currentTarget.dataset.meetinginfo // 如果是去报名页面需要在缓存中存储会议信息 当报名结束后 需要清除缓存中的当前会议信息 meetingSignUpType 1 可报名 2报名 - if (meetingItem.meetingSignUpType === 1) { - // 从消息报名的参会单位不可更改 - wx.setStorage({ - key:'companyDisabled', - data:true - }) - wx.setStorage({ - key: "currentMeetingInfo", - data: e.currentTarget.dataset.meetinginfo, - success() { - // 国际研讨会去国际研讨会的报名页面 - if (meetingItem.meetingType !== 3) { - wx.navigateTo({ - url: `../signUpPage/signUpPage?type=indexMsg` - }) - } else if (meetingItem.meetingSignUpType === 2) { - wx.navigateTo({ - url: `../signUpPageGuoji/signUpPageGuoji` - }) - } - } - }) - } else if (meetingItem.meetingSignUpType === 2) { - wx.navigateTo({ - url: `../meetingDetailSigned/meetingDetailSigned?meetingInfo=${meetingInfo}`, // (已报名) - }) - } + + // if (meetingItem.meetingSignUpType === 1) { + // // 从消息报名的参会单位不可更改 + // wx.setStorage({ + // key:'companyDisabled', + // data:true + // }) + // wx.setStorage({ + // key: "currentMeetingInfo", + // data: e.currentTarget.dataset.meetinginfo, + // success() { + // // 国际研讨会去国际研讨会的报名页面 + // if (meetingItem.meetingType !== 3) { + // wx.navigateTo({ + // url: `../signUpPage/signUpPage?type=indexMsg` + // }) + // } else if (meetingItem.meetingSignUpType === 2) { + // wx.navigateTo({ + // url: `../signUpPageGuoji/signUpPageGuoji` + // }) + // } + // } + // }) + // } }, // 获取会议列表数据 diff --git a/pages/meeting/meeting.wxml b/pages/meeting/meeting.wxml index ed70747..7bcb8e2 100644 --- a/pages/meeting/meeting.wxml +++ b/pages/meeting/meeting.wxml @@ -43,6 +43,10 @@ {{item.venue + '/' + item.address}} + + + 报名状态:{{ item.signUpStatus_dictText}} + 暂无数据 diff --git a/pages/register/register.js b/pages/register/register.js new file mode 100644 index 0000000..c926aa4 --- /dev/null +++ b/pages/register/register.js @@ -0,0 +1,661 @@ +// pages/register/register.js +import UserApi from '../../assets/js/http/userApi' + +import { + phoneReg, + postcode, + compareDate, + passwordReg, + isEmail, +} from '../../utils/validate' + +import { + encrypt +} from '../../assets/js/jsencrypt/rsa' +var countdown = 60; // 倒计时秒数 +Page({ + + /** + * 页面的初始数据 + */ + data: { + statusBarHeight: wx.getSystemInfoSync()['statusBarHeight'], + showGetCaptcha: true, // 默认显示 获取验证阿门 + phone: '', + password: '', + confirmPassword: '', + captcha: '', + count: 60, + rsaPublicKey: '', + show: true, // 默认显示密码框 + confirmshow: true, // 确认密码的显示 + currentTab: 1, // 当前到哪一步 + selectedCompany: {}, // 选中的企业 + sexList: [{ + name: '男', + val: 1 + }, { + name: '女', + val: 2 + }], + prePageData: {}, // 上一页的数据 + currentInfo: {}, // 当前页的数据 + }, + // 提交 提交完成之后 要清除缓存中 存入的企业信息 并返回登录页 + formSubmit(e) { + // 再次校准姓名, + if (this.data.currentInfo.name === '' || this.data.currentInfo.name === null || this.data.currentInfo.name === undefined) { + wx.showToast({ + title: '请输入姓名', + icon: 'none', + duration: 800 + }) + return + } + + // 邮政编码 + if (this.data.currentInfo.postalCode === '' || this.data.currentInfo.postalCode === null || this.data.currentInfo.postalCode === undefined) { + wx.showToast({ + title: '请输入邮政编码', + icon: 'none', + duration: 800 + }) + return + } else if (this.data.currentInfo.postalCode && !postcode(this.data.currentInfo.postalCode)) { + wx.showToast({ + title: '请输入正确的邮政编码', + icon: 'none', + duration: 800 + }) + return + } + // 手机号 + if (this.data.currentInfo.phone === '' || this.data.currentInfo.phone === null || this.data.currentInfo.phone === undefined) { + wx.showToast({ + title: '请输入手机号', + icon: 'none', + duration: 800 + }) + return + } else if (this.data.currentInfo.phone && !phoneReg(this.data.currentInfo.phone)) { + wx.showToast({ + title: '请输入正确的手机号', + icon: 'none', + duration: 800 + }) + return + } + + // 性别 + if (this.data.currentInfo.gender === '' || this.data.currentInfo.gender === null || this.data.currentInfo.gender === undefined) { + wx.showToast({ + title: '请选择性别', + icon: 'none', + duration: 800 + }) + return + } + + // 通讯地址 + + if (this.data.currentInfo.contactAddress === '' || this.data.currentInfo.contactAddress === null || this.data.currentInfo.contactAddress === undefined) { + wx.showToast({ + title: '请输入通讯地址', + icon: 'none', + duration: 800 + }) + return + } + + // 再次校准email + if (this.data.currentInfo.email === '' || this.data.currentInfo.email === null || this.data.currentInfo.email === undefined) { + wx.showToast({ + title: '请输入邮箱', + icon: 'none', + duration: 800 + }) + return + } else if (this.data.currentInfo.email && !isEmail(this.data.currentInfo.email)) { + wx.showToast({ + title: '请输入正确的邮箱', + icon: 'none', + duration: 800 + }) + return + } + let formData = Object.assign({},this.data.prePageData,this.data.currentInfo,this.data.selectedCompany) + formData.post = e.detail.value.post.trim() + formData.remarks = e.detail.value.remarks.trim() + formData.rsaPublicKey = this.data.rsaPublicKey + formData.phone = encrypt(this.data.rsaPublicKey,formData.phone), + formData.password = encrypt(this.data.rsaPublicKey,formData.password), + formData.confirmPassword = encrypt(this.data.rsaPublicKey,formData.confirmPassword), + console.log('表单提交的数据',formData); + UserApi.registerUser(formData).then(res => { + console.log(res); + wx.navigateTo({ + url: '../login/login', + success(){ + wx.removeStorage({ + key: 'selectedCompany', + }) + } + }) + }).catch(err => { + wx.showToast({ + title: err.message, + icon:none, + duration:800 + }) + }) + + }, + changeGender(e){ + console.log(e); + this.setData({ + 'currentInfo.gender':e.detail.value + }) + }, + // 下一步 + nextStep() { + + // 再次校准手机号 + if (this.data.prePageData.phone === '' || this.data.prePageData.phone === null || this.data.prePageData.phone === undefined) { + wx.showToast({ + title: '请输入手机号', + icon: 'none', + duration: 800 + }) + return + } else if (this.data.prePageData.phone && !phoneReg(this.data.prePageData.phone)) { + wx.showToast({ + title: '请输入正确的手机号', + icon: 'none', + duration: 800 + }) + return + } + // 再次校准验证码 + if (this.data.prePageData.captcha === '' || this.data.prePageData.captcha === null || this.data.prePageData.captcha === undefined) { + wx.showToast({ + title: '请输入验证码', + icon: 'none', + duration: 800 + }) + return + } + // 再次校准密码 + if (this.data.prePageData.password === '' || this.data.prePageData.password === null || this.data.prePageData.password === undefined) { + wx.showToast({ + title: '请输入密码', + icon: 'none', + duration: 800 + }) + return + } else if (this.data.prePageData.password && !passwordReg(this.data.prePageData.password)) { + wx.showToast({ + title: '密码长度至少8位,并包括数字、小写字母、大写字母和特殊符号4类', + icon: 'none', + duration: 800 + }) + return + } + + // 再次校准确认密码 + if (this.data.prePageData.confirmPassword === '' || this.data.prePageData.confirmPassword === null || this.data.prePageData.confirmPassword === undefined) { + wx.showToast({ + title: '请输入确认密码', + icon: 'none', + duration: 800 + }) + return + } else if (this.data.prePageData.phone && this.data.prePageData.password !== this.data.prePageData.confirmPassword) { + wx.showToast({ + title: '密码与确认密码不一致', + icon: 'none', + duration: 800 + }) + return + } + + this.setData({ + currentTab: 2 + }) + }, + // 上一步 + preStep() { + this.setData({ + currentTab: 1 + }) + }, + // 选择企业 + selectCompany() { + wx.navigateTo({ + url: '../companyList/companyList?page=register', + }) + }, + goBack() { + wx.navigateBack() + }, + // 密码框与文本框的切换 + showPassword() { + this.setData({ + show: !this.data.show, + }) + }, + showConfirmPassword() { + this.setData({ + confirmshow: !this.data.confirmshow, + }) + }, + bindInputPhone(e) { + this.data.phone = e.detail.value + this.setData({ + phone: e.detail.value + }) + }, + // 获取验证码 + getVerCode() { + countdown = 60 + if (/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/.test(this.data.phone)) { + UserApi.sendCode({ + phone: this.data.phone, + codeType: 1 + }).then(res => { + // 获取成功,倒计时 start + if (res.success) { + this.countDown() + wx.showToast({ + title: '发送成功', + icon: 'none', + duration: 2000 + }) + } else { + wx.showToast({ + title: res.message, + icon: 'none', + duration: 2000 + }) + } + }).catch(err => { + wx.showToast({ + title: '获取失败', + icon: 'none', + duration: 2000 + }) + }) + } else { + wx.showToast({ + title: '请输入正确的手机号', + icon: 'none', + duration: 2000 + }) + } + }, + // 倒计时 + countDown() { + if (countdown === 0) { + this.setData({ + showGetCaptcha: true + }) + countdown = 60; + return; + } else { + this.setData({ + showGetCaptcha: false + }) + countdown--; + this.setData({ + count: countdown + }) + } + setTimeout(() => { + this.countDown() + }, 1000) + // 倒计时 end + }, + // 校验手机号 + validatePhone(e) { + let value = e.detail.value + this.setData({ + phone: value, + 'prePageData.phone': value + }) + let { + message, + errmsg + } = e.currentTarget.dataset + if (value === '' || value === undefined) { + wx.showToast({ + title: message, + icon: 'none', + duration: 800 + }) + return + } else if (phoneReg(value)) { + this.setData({ + 'prePageData.phone': value + }) + } else { + wx.showToast({ + title: errmsg, + icon: 'none', + duration: 800 + }) + } + + }, + // 校验验证码 + validateVerCode(e) { + let value = e.detail.value + this.setData({ + 'prePageData.captcha': value + }) + let { + message, + errmsg + } = e.currentTarget.dataset + if (value === '' || value === undefined) { + wx.showToast({ + title: message, + icon: 'none', + duration: 800 + }) + return + } else { + this.setData({ + captcha: value, + 'prePageData.captcha': value + }) + } + + }, + // 校验姓名 + validateName(e) { + let value = e.detail.value + this.setData({ + 'currentInfo.name': value, + }) + let { + message, + } = e.currentTarget.dataset + if (value === '' || value === undefined) { + wx.showToast({ + title: message, + icon: 'none', + duration: 800 + }) + return + } else { + this.setData({ + 'currentInfo.name': value + }) + } + }, + // 第二步的校验手机号 + validatePhoneCurent(e) { + let value = e.detail.value + this.setData({ + 'currentInfo.phone': value + }) + let { + message, + errmsg + } = e.currentTarget.dataset + if (value === '' || value === undefined) { + wx.showToast({ + title: message, + icon: 'none', + duration: 800 + }) + return + } else if (phoneReg(value)) { + this.setData({ + 'currentInfo.phone': value + }) + } else { + wx.showToast({ + title: errmsg, + icon: 'none', + duration: 800 + }) + } + + }, + // 校验邮政编码 + validatePostalCode(e) { + let value = e.detail.value + this.setData({ + 'currentInfo.postalCode': value + }) + let { + message, + errmsg + } = e.currentTarget.dataset + if (value === '' || value === undefined) { + wx.showToast({ + title: message, + icon: 'none', + duration: 800 + }) + return + } else if (postcode(value)) { + this.setData({ + 'currentInfo.postalCode': value + }) + } else { + wx.showToast({ + title: errmsg, + icon: 'none', + duration: 800 + }) + } + + }, + // 校验邮箱 + validateEmail(e) { + let value = e.detail.value + this.setData({ + 'currentInfo.email': value + }) + let { + message, + errmsg + } = e.currentTarget.dataset + if (value === '' || value === undefined) { + wx.showToast({ + title: message, + icon: 'none', + duration: 800 + }) + return + } else if (isEmail(value)) { + this.setData({ + 'currentInfo.email': value + }) + } else { + wx.showToast({ + title: errmsg, + icon: 'none', + duration: 800 + }) + } + + }, + // 校验通讯地址 + validateContactAddress(e) { + let value = e.detail.value + this.setData({ + 'currentInfo.contactAddress': value, + }) + let { + message, + } = e.currentTarget.dataset + if (value === '' || value === undefined) { + wx.showToast({ + title: message, + icon: 'none', + duration: 800 + }) + return + } else { + this.setData({ + 'currentInfo.contactAddress': value + }) + } + }, + + // 校验密码 + validatePsd(e) { + console.log(e); + let value = e.detail.value + this.setData({ + password: value, + 'prePageData.password': value + }) + let { + message, + errmsg + } = e.currentTarget.dataset + if (value === '' || value === undefined) { + wx.showToast({ + title: message, + icon: 'none', + duration: 800 + }) + return + } else if (passwordReg(value)) { + this.setData({ + password: value, + 'prePageData.password': value + }) + } else { + wx.showToast({ + title: errmsg, + icon: 'none', + duration: 800 + }) + } + + }, + // 校验确认密码 + validateConfirmPsd(e) { + console.log(e); + let value = e.detail.value + this.setData({ + 'prePageData.confirmPassword': value + }) + let { + message, + errmsg + } = e.currentTarget.dataset + if (value === '' || value === undefined) { + wx.showToast({ + title: message, + icon: 'none', + duration: 800 + }) + return + } else if (e.detail.value === this.data.password) { + this.setData({ + confirmPassword: value, + 'prePageData.confirmPassword': value + }) + } else { + wx.showToast({ + title: errmsg, + icon: 'none', + duration: 800 + }) + } + + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + UserApi.getRSAPublicKey().then(res => { + if (res.success) { + this.setData({ + rsaPublicKey: res.result + }) + wx.setStorage({ + key: 'rsaPublicKey', + data: res.result + }) + }else{ + wx.showToast({ + title: res.message, + icon: 'none', + duration: 2000 + }) + } + }).catch(err => { + wx.showToast({ + title: '加载失败', + icon: 'none', + duration: 2000 + }) + }) + // const that = this + // wx.getStorage({ + // key:'selectedCompany', + // success(res){ + // console.log(res); + // that.setData({ + // 'selectedCompany.companyName':res.data.companyName, + // 'selectedCompany.companyId':res.data.id + // }) + // } + // }) + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/pages/register/register.json b/pages/register/register.json new file mode 100644 index 0000000..965b8e8 --- /dev/null +++ b/pages/register/register.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "navigationStyle": "custom" +} \ No newline at end of file diff --git a/pages/register/register.wxml b/pages/register/register.wxml new file mode 100644 index 0000000..b2a9591 --- /dev/null +++ b/pages/register/register.wxml @@ -0,0 +1,151 @@ + + + + + + + 注册 + + + + + + + 您好,欢迎注册 + 标准所协同工作平台 + + +
+ + + 1 + + + 2 + + + 设置密码 + 完善信息 + + + + 手机号 + + + + + + 验证码 + + + + 获取验证码 + {{count}} + + + + 密码 + + + + + + + + + + 确认密码 + + + + + + + + + + + + 企业名称 + + + + + + + 姓名 + + + + + + + 邮政编码 + + + + + + + 手机号 + + + + + + + 职务 + + + + + + + 性别 + + + + + + + + + 通讯地址 + + + + + + + 邮箱 + + + + + + + 备注 + +