修复规划页错误展示和迁移发布包

This commit is contained in:
2026-07-21 22:30:08 +08:00
parent 7d4c7539e2
commit 0965a35ed7
8 changed files with 64 additions and 15 deletions
+16 -1
View File
@@ -1,6 +1,16 @@
const planningApi = require('../../api/planning')
const dateUtil = require('../../utils/date')
const CALENDAR_ERROR_FALLBACK_MESSAGE = '规划数据暂时不可用,请稍后重试'
const TECHNICAL_ERROR_PATTERNS = [
/###\s*Error/i,
/SQLSyntaxErrorException/i,
/bad\s+SQL\s+grammar/i,
/Unknown\s+column/i,
/mapper\//i,
/java\./i
]
function canCreateAppointment() {
const app = getApp()
const userInfo = app.globalData.userInfo || {}
@@ -8,7 +18,12 @@ function canCreateAppointment() {
}
function resolveCalendarErrorMessage(error) {
return error && error.message ? error.message : '规划数据加载失败'
const message = error && error.message ? String(error.message).trim() : ''
if (!message) {
return CALENDAR_ERROR_FALLBACK_MESSAGE
}
const hasTechnicalMessage = TECHNICAL_ERROR_PATTERNS.some(pattern => pattern.test(message))
return hasTechnicalMessage ? CALENDAR_ERROR_FALLBACK_MESSAGE : message
}
function toLocalDate(value) {
+5 -2
View File
@@ -27,8 +27,8 @@
.calendar-error-card {
display: flex;
align-items: center;
justify-content: space-between;
flex-direction: column;
align-items: stretch;
gap: 16rpx;
margin-top: 18rpx;
padding: 18rpx;
@@ -52,15 +52,18 @@
}
.calendar-error-message {
display: block;
color: #b06a52;
font-size: 22rpx;
line-height: 1.5;
word-break: break-word;
}
.calendar-error-action {
display: flex;
align-items: center;
justify-content: center;
align-self: flex-end;
width: 96rpx;
min-width: 96rpx;
height: 52rpx;