实现Salon工作台注册审核闭环
This commit is contained in:
@@ -294,7 +294,7 @@ Page({
|
||||
draftSavedAtText: draftForm ? '已恢复本机草稿' : ''
|
||||
})
|
||||
if (!creatable) {
|
||||
wx.showToast({ title: '美甲师账号只能查看预约', icon: 'none' })
|
||||
wx.showToast({ title: '当前账号仅支持查看预约', icon: 'none' })
|
||||
return
|
||||
}
|
||||
this.loadOptions()
|
||||
@@ -683,7 +683,7 @@ Page({
|
||||
|
||||
async submit() {
|
||||
if (!this.data.canCreateAppointment) {
|
||||
wx.showToast({ title: '美甲师账号只能查看预约', icon: 'none' })
|
||||
wx.showToast({ title: '当前账号仅支持查看预约', icon: 'none' })
|
||||
return
|
||||
}
|
||||
const form = this.data.form
|
||||
|
||||
@@ -68,7 +68,7 @@ Page({
|
||||
|
||||
createAppointment() {
|
||||
if (!this.data.canCreateAppointment) {
|
||||
wx.showToast({ title: '美甲师账号只能查看预约', icon: 'none' })
|
||||
wx.showToast({ title: '当前账号仅支持查看预约', icon: 'none' })
|
||||
return
|
||||
}
|
||||
const customer = this.data.customer || {}
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
<view class="card menu-card" data-url="/pages/schedule-setting/index" bindtap="go">排班设置</view>
|
||||
<view class="card menu-card" data-url="/pages/leave-management/index" bindtap="go">请假管理</view>
|
||||
<view class="card menu-card" data-url="/pages/color-setting/index" bindtap="go">颜色设置</view>
|
||||
<view class="card menu-card" data-url="/pages/employee-orders/index" bindtap="go">订单记录</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -441,6 +441,10 @@ Page({
|
||||
this.saveLoginPreference()
|
||||
wx.reLaunch({ url: '/pages/planning/index' })
|
||||
} catch (error) {
|
||||
if (String(error.message || '').indexOf('禁用') !== -1) {
|
||||
await this.showRegistrationStatus()
|
||||
return
|
||||
}
|
||||
if (isShopSelectionRequiredError(error)) {
|
||||
try {
|
||||
if (!this.data.shopSelectVisible) {
|
||||
@@ -457,6 +461,22 @@ Page({
|
||||
}
|
||||
},
|
||||
|
||||
async showRegistrationStatus() {
|
||||
try {
|
||||
const phone = this.data.loginMode === 'phone' ? this.data.form.phone : this.data.form.account
|
||||
const status = await authApi.getRegistrationStatus(String(phone || '').trim())
|
||||
const statusText = {
|
||||
PENDING_ADMIN: '管理员审核中',
|
||||
PENDING_MANAGER: '店长审核中',
|
||||
REJECTED: `申请已驳回:${status.rejectReason || '请修改资料后重新提交'}`,
|
||||
APPROVED: '账号已审核,请稍后重试登录'
|
||||
}[status.status] || '账号暂不可用'
|
||||
wx.showToast({ title: statusText, icon: 'none', duration: 3000 })
|
||||
} catch (statusError) {
|
||||
wx.showToast({ title: statusError.message || '账号已被禁用', icon: 'none' })
|
||||
}
|
||||
},
|
||||
|
||||
goRegister() {
|
||||
wx.navigateTo({ url: '/pages/register/index' })
|
||||
},
|
||||
|
||||
@@ -406,7 +406,7 @@ Page({
|
||||
|
||||
createAppointment() {
|
||||
if (!this.data.canCreateAppointment) {
|
||||
wx.showToast({ title: '美甲师账号只能查看预约', icon: 'none' })
|
||||
wx.showToast({ title: '当前账号仅支持查看预约', icon: 'none' })
|
||||
return
|
||||
}
|
||||
wx.navigateTo({
|
||||
|
||||
@@ -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