实现Salon工作台注册审核闭环
This commit is contained in:
@@ -17,6 +17,15 @@ Page({
|
||||
countdownTimer: null
|
||||
},
|
||||
|
||||
async onLoad() {
|
||||
try {
|
||||
const shopOptions = await authApi.getAvailableRegistrationShops()
|
||||
this.setData({ shopOptions: Array.isArray(shopOptions) ? shopOptions : [] })
|
||||
} catch (error) {
|
||||
this.setData({ shopOptions: [] })
|
||||
}
|
||||
},
|
||||
|
||||
onInput(event) { this.setData({ [`form.${event.currentTarget.dataset.field}`]: event.detail.value }) },
|
||||
|
||||
togglePasswordMode() { this.setData({ passwordMode: !this.data.passwordMode }) },
|
||||
@@ -56,7 +65,7 @@ Page({
|
||||
if (this.data.role === 'staff') { wx.showToast({ title: '店员申请功能即将开放', icon: 'none' }); return }
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
await authApi.register({ phone: form.phone, code: form.code, password: form.password, confirmPassword: form.confirmPassword, shopName: form.shopName, shopAddress: form.shopAddress, role: this.data.role })
|
||||
await authApi.register({ phone: form.phone, verificationCode: form.code, password: form.password, confirmPassword: form.confirmPassword, shopName: form.shopName, shopAddress: form.shopAddress, shopId: form.shopId, roleType: this.data.role === 'manager' ? 'MANAGER' : 'STAFF', agreementAccepted: true })
|
||||
this.setData({ step: 4 })
|
||||
} catch (error) { wx.showToast({ title: error.message || '提交失败', icon: 'none' }) } finally { this.setData({ loading: false }) }
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user