修改部分bug
This commit is contained in:
@ -18,7 +18,17 @@ Page({
|
||||
this.setData({
|
||||
role: options.role
|
||||
})
|
||||
if (options.role === 'supervisor') {
|
||||
const scene = decodeURIComponent(options.scene)
|
||||
if (scene !== 'undefined') {
|
||||
let [key, value] = scene.split('=');
|
||||
console.log(key, value)
|
||||
if (value === 'manager') value = 'supervisor'
|
||||
else if (value === 'supervisor') value = 'staff'
|
||||
else if (value === 'staff') value = 'user'
|
||||
this.setData({inviteCode: key, role: value})
|
||||
}
|
||||
|
||||
if (this.data.role === 'supervisor') {
|
||||
this.setData({
|
||||
placeholder: '请输入学校名称'
|
||||
})
|
||||
@ -27,9 +37,6 @@ Page({
|
||||
placeholder : '请输入昵称'
|
||||
})
|
||||
}
|
||||
const scene = decodeURIComponent(options.scene)
|
||||
let [key, value] = scene.split('=');
|
||||
this.setData({inviteCode: value})
|
||||
},
|
||||
|
||||
/**
|
||||
@ -156,8 +163,7 @@ Page({
|
||||
})
|
||||
|
||||
const { role } = this.data;
|
||||
|
||||
const res = await requestAsync({
|
||||
const res = await requestAsync({
|
||||
url: baseUrl + '/userInfo/register',
|
||||
method: 'POST',
|
||||
header: { 'content-type': 'application/json' },
|
||||
@ -177,10 +183,9 @@ Page({
|
||||
icon: 'success',
|
||||
duration: 1000,
|
||||
});
|
||||
wx.hideLoading()
|
||||
setTimeout(() => {
|
||||
wx.navigateBack()({
|
||||
// url: '/pages/loginModule/pwdLogin/pwdLogin',
|
||||
wx.navigateTo({
|
||||
url: `/pages/loginModule/pwdLogin/pwdLogin?role=${role}`,
|
||||
success: () => {
|
||||
this.setData({ nickname:'', phone:'', captcha:'', inviteCode:'', password:'', agree:false });
|
||||
}
|
||||
@ -189,9 +194,10 @@ Page({
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: res.data.message || '注册失败',
|
||||
icon: 'none'
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
});
|
||||
wx.hideLoading()
|
||||
// wx.hideLoading()
|
||||
}
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user