feat: 增加店长审核模式与门店经营有效期
This commit is contained in:
@@ -26,6 +26,22 @@ function canCreateAppointment() {
|
||||
return Number(userInfo.type) !== 3
|
||||
}
|
||||
|
||||
function isShopBusinessExpired() {
|
||||
const userInfo = getApp().globalData.userInfo || {}
|
||||
return Number(userInfo.type) === 2 && userInfo.shopBusinessExpired === true
|
||||
}
|
||||
|
||||
function showBusinessExpiryNotice() {
|
||||
return new Promise(resolve => wx.showModal({
|
||||
title: '门店经营有效期已到期',
|
||||
content: '当前门店暂不能新增普通预约。历史订单、查询和补录不受影响,请联系平台管理员办理续期。',
|
||||
showCancel: false,
|
||||
confirmText: '知道了',
|
||||
success: () => resolve(),
|
||||
fail: () => resolve()
|
||||
}))
|
||||
}
|
||||
|
||||
function buildDraftKey() {
|
||||
const app = getApp()
|
||||
const userInfo = app.globalData.userInfo || {}
|
||||
@@ -1399,6 +1415,10 @@ Page({
|
||||
wx.showToast({ title: '当前账号仅支持查看预约', icon: 'none' })
|
||||
return
|
||||
}
|
||||
if (isShopBusinessExpired()) {
|
||||
await showBusinessExpiryNotice()
|
||||
return
|
||||
}
|
||||
let form = this.data.form
|
||||
const manualProductTitle = String(form.manualProductTitle || '').trim()
|
||||
const manualProductImageFileIds = String(form.manualProductImageFileIds || '').trim()
|
||||
@@ -1480,7 +1500,11 @@ Page({
|
||||
markPlanningRefresh()
|
||||
wx.redirectTo({ url: `/pages/appointment-detail/index?id=${result.orderItemId}` })
|
||||
} catch (error) {
|
||||
wx.showToast({ title: error.message || '提交失败', icon: 'none' })
|
||||
if ((error.message || '').includes('有效期') || (error.message || '').includes('到期')) {
|
||||
await showBusinessExpiryNotice()
|
||||
} else {
|
||||
wx.showToast({ title: error.message || '提交失败', icon: 'none' })
|
||||
}
|
||||
} finally {
|
||||
this.setData({ loading: false })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user