小程序提交
This commit is contained in:
@ -5,10 +5,28 @@ import { validate } from "../../../utils/validate";
|
||||
// pages/loginModule/register/register.js
|
||||
Page({
|
||||
|
||||
data: {
|
||||
role: '', // 用户角色
|
||||
placeholder: '', // 输入框显示文本
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
console.log('options--->',options);
|
||||
this.setData({
|
||||
role: options.role
|
||||
})
|
||||
if (options.role === 'supervisor') {
|
||||
this.setData({
|
||||
placeholder: '请输入学校名称'
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
placeholder : '请输入昵称'
|
||||
})
|
||||
}
|
||||
const scene = decodeURIComponent(options.scene)
|
||||
let [key, value] = scene.split('=');
|
||||
this.setData({inviteCode: value})
|
||||
@ -136,6 +154,9 @@ Page({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
|
||||
const { role } = this.data;
|
||||
|
||||
const res = await requestAsync({
|
||||
url: baseUrl + '/userInfo/register',
|
||||
method: 'POST',
|
||||
@ -145,7 +166,8 @@ Page({
|
||||
phoneNumber: phone,
|
||||
verificationCode: captcha,
|
||||
invitationCode: inviteCode,
|
||||
userPassword: password
|
||||
userPassword: password,
|
||||
userRole: role
|
||||
}
|
||||
});
|
||||
console.log('注册信息---->',res.data);
|
||||
@ -157,8 +179,8 @@ Page({
|
||||
});
|
||||
wx.hideLoading()
|
||||
setTimeout(() => {
|
||||
wx.navigateTo({
|
||||
url: '/pages/loginModule/pwdLogin/pwdLogin',
|
||||
wx.navigateBack()({
|
||||
// url: '/pages/loginModule/pwdLogin/pwdLogin',
|
||||
success: () => {
|
||||
this.setData({ nickname:'', phone:'', captcha:'', inviteCode:'', password:'', agree:false });
|
||||
}
|
||||
|
Reference in New Issue
Block a user