实现手机号登录自动进入注册审核流程
This commit is contained in:
@@ -276,6 +276,26 @@ Page({
|
||||
return null
|
||||
},
|
||||
|
||||
openRegistrationFlow(data) {
|
||||
const ticket = String(data.registrationTicket || '').trim()
|
||||
const status = data.registrationStatus
|
||||
if (status === 'PENDING_ADMIN' || status === 'PENDING_MANAGER') {
|
||||
wx.showToast({ title: status === 'PENDING_ADMIN' ? '管理员审核中' : '店长审核中', icon: 'none', duration: 2500 })
|
||||
return
|
||||
}
|
||||
if (!ticket) {
|
||||
wx.showToast({ title: data.registrationRejectReason || '该手机号需要先完成身份注册', icon: 'none', duration: 2200 })
|
||||
return
|
||||
}
|
||||
wx.showToast({ title: '手机号已验证,请完成身份注册', icon: 'none', duration: 1600 })
|
||||
const query = [
|
||||
`registrationTicket=${encodeURIComponent(ticket)}`,
|
||||
`phone=${encodeURIComponent(data.phone || this.data.form.phone || '')}`,
|
||||
data.registrationApplicationId ? `applicationId=${encodeURIComponent(data.registrationApplicationId)}` : ''
|
||||
].filter(Boolean).join('&')
|
||||
setTimeout(() => wx.navigateTo({ url: `/pages/register/index?${query}` }), 700)
|
||||
},
|
||||
|
||||
buildLoginRequestData(shopId) {
|
||||
const form = this.data.form
|
||||
if (this.data.loginMode === 'phone') {
|
||||
@@ -433,6 +453,10 @@ Page({
|
||||
try {
|
||||
const app = getApp()
|
||||
const data = await this.requestLogin('')
|
||||
if (this.data.loginMode === 'phone' && data && data.registrationRequired) {
|
||||
this.openRegistrationFlow(data)
|
||||
return
|
||||
}
|
||||
const session = await this.resolveLoginSession(data)
|
||||
if (!session) {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user