fix(wechat): 协议挂起请求仅在离开页面时结算并集中映射错误文案
自动发布开发环境 Nacos 配置 / publish (push) Successful in 18s

This commit is contained in:
2026-11-05 10:51:40 +08:00
parent 3f825682fb
commit 942718b8d9
20 changed files with 141 additions and 70 deletions
@@ -4,6 +4,7 @@ const customersApi = require('../../api/customers')
const dateUtil = require('../../utils/date')
const { markPlanningRefresh } = require('../../utils/planning-refresh')
const { uploadObjectFile } = require('../../utils/upload')
const { showErrorToast } = require('../../utils/toast')
const DRAFT_STORAGE_PREFIX = 'managerAppointmentDraft'
const DRAFT_TTL_MS = 7 * 24 * 60 * 60 * 1000
@@ -665,7 +666,7 @@ Page({
try {
draft = readDraft()
} catch (error) {
wx.showToast({ title: error.message || '预约草稿读取失败', icon: 'none' })
showErrorToast(error, '预约草稿读取失败')
}
}
const draftForm = draft && draft.form ? draft.form : {}
@@ -1121,7 +1122,7 @@ Page({
return true
} catch (error) {
this.setData({ draftSavedAtText: '草稿保存失败,请点击保存草稿重试' })
if (showToast) wx.showToast({ title: error.message || '草稿保存失败', icon: 'none' })
if (showToast) showErrorToast(error, '草稿保存失败')
return false
}
},
@@ -1148,7 +1149,7 @@ Page({
try {
removeDraftForm()
} catch (error) {
wx.showToast({ title: error.message || '草稿清理失败,请稍后重试', icon: 'none' })
showErrorToast(error, '草稿清理失败,请稍后重试')
return
}
const defaults = this._entryDefaults || {}
@@ -1417,7 +1418,7 @@ Page({
wx.showToast({ title: `已添加${filePaths.length}张图片`, icon: 'success' })
}
} catch (error) {
wx.showToast({ title: error.message || '图片上传失败', icon: 'none' })
showErrorToast(error, '图片上传失败')
} finally {
this.setData({ manualImageUploading: false })
}
@@ -1962,7 +1963,7 @@ Page({
this.setData({ 'form.createCustomerRecord': Boolean(createChoice.confirm) })
return true
} catch (error) {
wx.showToast({ title: error.message || '客户校验失败,请稍后重试', icon: 'none' })
showErrorToast(error, '客户校验失败,请稍后重试')
return false
} finally {
this.setData({ loading: false })
@@ -2080,7 +2081,7 @@ Page({
if ((error.message || '').includes('有效期') || (error.message || '').includes('到期')) {
await showBusinessExpiryNotice()
} else {
wx.showToast({ title: error.message || '提交失败', icon: 'none' })
showErrorToast(error, '提交失败')
}
} finally {
this.setData({ loading: false })