关联微信新账号与注册申请
发布 Nacos 配置 / publish (push) Successful in 34s

This commit is contained in:
2026-09-07 12:14:02 +08:00
parent a26252c020
commit 63b226fe61
4 changed files with 48 additions and 6 deletions
+4 -2
View File
@@ -8,6 +8,7 @@ Page({
role: 'manager',
passwordMode: false,
form: { phone: '', code: '', password: '', confirmPassword: '', shopName: '', shopAddress: '', shopId: '' },
wxCode: '',
shopOptions: [],
shopIndex: 0,
selectedShopName: '',
@@ -17,7 +18,8 @@ Page({
countdownTimer: null
},
async onLoad() {
async onLoad(options) {
this.setData({ wxCode: options && options.wxCode ? options.wxCode : '' })
try {
const shopOptions = await authApi.getAvailableRegistrationShops()
this.setData({ shopOptions: Array.isArray(shopOptions) ? shopOptions : [] })
@@ -65,7 +67,7 @@ Page({
if (this.data.role === 'staff') { wx.showToast({ title: '店员申请功能即将开放', icon: 'none' }); return }
this.setData({ loading: true })
try {
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 })
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, wxCode: this.data.wxCode })
this.setData({ step: 4 })
} catch (error) { wx.showToast({ title: error.message || '提交失败', icon: 'none' }) } finally { this.setData({ loading: false }) }
},