回溯点:保存注册预约客户流程修复进度
This commit is contained in:
@@ -16,7 +16,11 @@ Page({
|
||||
selectedShopName: '',
|
||||
loading: false,
|
||||
avatarUploading: false,
|
||||
ticketInvalid: false
|
||||
ticketInvalid: false,
|
||||
registrationStatus: null,
|
||||
registrationStatusText: '',
|
||||
contentStatusText: '',
|
||||
contentStatusReason: ''
|
||||
},
|
||||
|
||||
async onLoad(options) {
|
||||
@@ -95,6 +99,29 @@ Page({
|
||||
|
||||
goBackStep() { this.setData({ step: 1 }) },
|
||||
|
||||
mapRegistrationStatus(result) {
|
||||
const statusText = {
|
||||
APPROVED: '已通过',
|
||||
REJECTED: '已驳回',
|
||||
PENDING_ADMIN: '待平台审核',
|
||||
PENDING_MANAGER: '待店长审核'
|
||||
}[String(result && result.status || '').toUpperCase()] || '状态未知'
|
||||
const moderationStatus = String(result && result.contentModerationStatus || '').toUpperCase()
|
||||
const contentStatusText = {
|
||||
APPROVED: '资料内容审核已通过',
|
||||
REJECTED: '资料内容审核未通过',
|
||||
PENDING: '资料内容正在审核,审核完成前不会展示',
|
||||
RETRY: '资料内容待重新审核,审核完成前不会展示',
|
||||
MISSING: '资料尚未进入审核,请联系门店负责人确认'
|
||||
}[moderationStatus] || ''
|
||||
return {
|
||||
registrationStatus: result || null,
|
||||
registrationStatusText: statusText,
|
||||
contentStatusText,
|
||||
contentStatusReason: result && result.contentModerationReason || ''
|
||||
}
|
||||
},
|
||||
|
||||
async submit() {
|
||||
const form = this.data.form
|
||||
if (!this.data.registrationTicket) {
|
||||
@@ -109,7 +136,7 @@ Page({
|
||||
}
|
||||
this.setData({ loading: true })
|
||||
try {
|
||||
await authApi.register({
|
||||
const result = await authApi.register({
|
||||
registrationTicket: this.data.registrationTicket,
|
||||
applicationId: this.data.applicationId || undefined,
|
||||
shopName: String(form.shopName || '').trim(),
|
||||
@@ -120,9 +147,14 @@ Page({
|
||||
applicantAvatarFileId: this.data.role === 'staff' ? form.applicantAvatarFileId || undefined : undefined,
|
||||
agreementAccepted: true
|
||||
})
|
||||
this.setData({ step: 3, registrationTicket: '' })
|
||||
this.setData({ step: 3, registrationTicket: '', ...this.mapRegistrationStatus(result) })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '提交失败', icon: 'none' })
|
||||
const message = String(error.message || '提交失败')
|
||||
if (/注册票据|注册凭证|一次性.*(失效|消费)|票据.*(失效|过期|已使用)/.test(message)) {
|
||||
this.setData({ ticketInvalid: true })
|
||||
return
|
||||
}
|
||||
wx.showToast({ title: message, icon: 'none' })
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user