From 6e4c20cfbed6f05334a2667137f088fbd511b6e5 Mon Sep 17 00:00:00 2001 From: fengachen <373943794@qq.com> Date: Tue, 14 Dec 2021 09:37:37 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=BC=80=E5=8F=91=E3=80=91=20?= =?UTF-8?q?=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 1 + assets/images/basic-info.png | Bin 0 -> 803 bytes assets/images/info.png | Bin 0 -> 672 bytes assets/images/lishi.png | Bin 0 -> 942 bytes assets/images/notice.png | Bin 0 -> 709 bytes assets/images/train.png | Bin 0 -> 907 bytes assets/js/http/userApi.js | 4 + pages/addCompany/addCompany.js | 21 +- pages/companyList/companyList.js | 14 +- pages/login/login.js | 7 + pages/login/login.wxml | 1 + pages/meeting/meeting.js | 57 +- pages/meeting/meeting.wxml | 4 + pages/register/register.js | 661 +++++++++++++++++++++++ pages/register/register.json | 4 + pages/register/register.wxml | 151 ++++++ pages/register/register.wxss | 258 +++++++++ pages/standardRouter/standardRouter.js | 108 ++++ pages/standardRouter/standardRouter.json | 4 + pages/standardRouter/standardRouter.wxml | 17 + pages/standardRouter/standardRouter.wxss | 41 ++ 21 files changed, 1321 insertions(+), 32 deletions(-) create mode 100644 assets/images/basic-info.png create mode 100644 assets/images/info.png create mode 100644 assets/images/lishi.png create mode 100644 assets/images/notice.png create mode 100644 assets/images/train.png create mode 100644 pages/register/register.js create mode 100644 pages/register/register.json create mode 100644 pages/register/register.wxml create mode 100644 pages/register/register.wxss create mode 100644 pages/standardRouter/standardRouter.js create mode 100644 pages/standardRouter/standardRouter.json create mode 100644 pages/standardRouter/standardRouter.wxml create mode 100644 pages/standardRouter/standardRouter.wxss 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 0000000000000000000000000000000000000000..dc73f594630f8610642ca781ed2ae92b4de9654d GIT binary patch literal 803 zcmV+;1Kj+HP)Px%-AP12R5(wKlwWAoWf;dl-}jueb53)AoWq0}7Kx^p-3aB)BJ5^sq;poJw1T37 zzzE8lu#1GcFbN6IC^mI8CxGBuLs)NJpRd6;UQoH5E^9wTyxNyfBMQBmmb*j z&y9O^zzrwg?@DEI!-8&`^i5zO8GJbrgBQ2;p1!_^S>XQt;jS%r?{bW9Bie5Yn>{Q^ zyyq4@eci^Cj!PfRfd4QYOOza)r1=6+gRygGtko$$I=VKS_Fg&e239R>yBUl8EQc49 zkoi`z^o-=SwFhk*&d&f_j=#Gxgit`b7rQ~r=`ZYkSIdm#Ls*qf$ER)9)POUs7r$5Q zI|n;rzWs>cAsY8@lzhf<`jHY@GFI1h&}_D(LUq6u)qHH|aY!8oH#byOR4hJ9%u8wW z3St}9{7F_3YoJe=GS?s?AAL+L>4foxUYCsoc?_E0~o_ zc@FprdDqmQr+&?j6xO5gInb@>l h=GNNPYOIdu{s;M$7v{QO!;%01002ovPDHLkV1hhqlJx)p literal 0 HcmV?d00001 diff --git a/assets/images/info.png b/assets/images/info.png new file mode 100644 index 0000000000000000000000000000000000000000..280f270e468f6b7f3396e14520d9395174f41b41 GIT binary patch literal 672 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 literal 0 HcmV?d00001 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}} + + + + 密码 + + + + + + + + + + 确认密码 + + + + + + + + + + + + 企业名称 + + + + + + + 姓名 + + + + + + + 邮政编码 + + + + + + + 手机号 + + + + + + + 职务 + + + + + + + 性别 + + + + + + + + + 通讯地址 + + + + + + + 邮箱 + + + + + + + 备注 + +