实现Salon工作台注册审核闭环

This commit is contained in:
2026-09-07 12:09:42 +08:00
parent 28c2c2603e
commit b4af2d6ab1
30 changed files with 584 additions and 22 deletions
+10 -1
View File
@@ -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 }) }
},