优化店务小程序月视图展示

This commit is contained in:
2026-07-23 12:26:25 +08:00
parent b14a97578e
commit e443db55bb
6 changed files with 35 additions and 66 deletions
+6 -16
View File
@@ -233,13 +233,12 @@ Page({
{ value: 'week', label: '周' },
{ value: 'day', label: '日' }
],
monthDisplayMode: 'count',
monthDisplayMode: 'rows',
monthDisplayModes: [
{ value: 'count', label: '单量' },
{ value: 'blocks', label: '点阵' },
{ value: 'blocks', label: '点状' },
{ value: 'rows', label: '横条' }
],
monthRowLabelVisible: false,
monthRowLabelVisible: true,
weekLabels: ['一', '二', '三', '四', '五', '六', '日'],
currentDate: new Date(),
currentDateText: dateUtil.formatDate(new Date()),
@@ -716,6 +715,7 @@ Page({
return (appointments || []).map((item, index) => {
const artist = artistMap[String(item.artistId)] || {}
const artistName = item.artistName || artist.name || ''
const customerName = item.customerName || item.customerUserName || item.customerPhone || ''
const orderItemId = resolveAppointmentItemId(item)
return {
key: `${mode}-${orderItemId || item.artistId || 'appointment'}-${index}`,
@@ -725,6 +725,7 @@ Page({
color: item.color || artist.color || '#B8B0A6',
shortName: artist.shortName || String(artistName || '?').slice(0, 1),
artistName: artistName || '?',
customerName: customerName || '客户',
statusClass: completedOrCancelledClass(item.status)
}
})
@@ -813,6 +814,7 @@ Page({
color: count.color,
shortName: count.shortName,
artistName: count.artistName || count.shortName,
customerName: count.customerName || '客户',
statusClass: count.statusClass
})
}
@@ -891,18 +893,6 @@ Page({
},
openAppointment(event) {
const currentDataset = event && event.currentTarget && event.currentTarget.dataset ? event.currentTarget.dataset : {}
const count = Number(currentDataset.count || 1)
if (this.data.viewMode === 'month' && this.data.monthDisplayMode === 'count' && count > 1) {
const date = normalizeReturnTargetDate(currentDataset.date)
this.setData({
currentDate: toLocalDate(date),
currentDateText: date,
monthDisplayMode: 'blocks'
})
wx.showToast({ title: '请点击具体预约块查看详情', icon: 'none' })
return
}
const id = resolveAppointmentEventId(event)
if (!id) {
wx.showToast({ title: '缺少预约详情ID', icon: 'none' })