功能:优化Salon作品选择与历史补单
发布 Nacos 配置 / publish (push) Successful in 30s
环境分支晋级检查 / environment-promotion-source (pull_request_target) Successful in 1s

This commit is contained in:
2026-10-14 00:47:10 +08:00
parent 4101ab3408
commit 261723bc6e
29 changed files with 454 additions and 332 deletions
+7 -3
View File
@@ -245,7 +245,7 @@ Page({
}
const appointmentDate = dateUtil.formatDate(event.currentTarget.dataset.date)
if (appointmentDate < dateUtil.formatDate(new Date())) {
wx.showToast({ title: '不能为历史日期新增预约', icon: 'none' })
this.openBackfillOrder(appointmentDate)
return
}
this.openAppointmentForm(appointmentDate)
@@ -630,12 +630,16 @@ Page({
this.openAppointmentForm(this.data.currentDateText)
},
openBackfillOrder() {
openBackfillOrder(serviceDate) {
if (!this.data.canCreateAppointment) {
wx.showToast({ title: '当前账号仅支持查看预约', icon: 'none' })
return
}
wx.navigateTo({ url: '/pages/backfill-order/index' })
const query = [`serviceDate=${encodeURIComponent(serviceDate || this.data.currentDateText)}`]
if (this.data.selectedArtistId) {
query.push(`artistId=${encodeURIComponent(this.data.selectedArtistId)}`)
}
wx.navigateTo({ url: `/pages/backfill-order/index?${query.join('&')}` })
},
openAppointmentForm(appointmentDate) {
+4 -2
View File
@@ -115,13 +115,15 @@ async function run() {
quickCreatePage.quickCreateAppointment({ currentTarget: { dataset: { date: '2099-12-31' } } })
assert.strictEqual(navigations.pop(), '/pages/appointment-form/index?date=2099-12-31&artistId=88')
quickCreatePage.quickCreateAppointment({ currentTarget: { dataset: { date: '2000-01-01' } } })
assert.strictEqual(navigations.pop(), '/pages/backfill-order/index?serviceDate=2000-01-01&artistId=88')
quickCreatePage.data.selectedArtistId = ''
quickCreatePage.quickCreateAppointment({ currentTarget: { dataset: { date: '2099-11-30' } } })
assert.strictEqual(navigations.pop(), '/pages/appointment-form/index?date=2099-11-30')
quickCreatePage.quickCreateAppointment({ currentTarget: { dataset: { date: '2000-01-01' } } })
assert.strictEqual(navigations.length, 0)
assert.strictEqual(toasts.pop(), '不能为历史日期新增预约')
assert.strictEqual(navigations.pop(), '/pages/backfill-order/index?serviceDate=2000-01-01')
const readonlyPage = createPage({ canCreateAppointment: false, selectedArtistId: '88' })
readonlyPage.quickCreateAppointment({ currentTarget: { dataset: { date: '2099-12-31' } } })
@@ -20,7 +20,6 @@
<view class="segmented">
<view wx:for="{{viewModes}}" wx:key="value" class="segment {{viewMode === item.value ? 'active' : ''}}" data-mode="{{item.value}}" bindtap="switchView">{{item.label}}</view>
</view>
<button wx:if="{{canCreateAppointment}}" class="backfill-entry" bindtap="openBackfillOrder">补录历史订单</button>
<scroll-view class="artist-filter" scroll-x enable-flex>
<view class="artist-chip {{!selectedArtistId ? 'active' : ''}}" data-id="" bindtap="selectArtist">全部员工</view>
<view wx:for="{{artists}}" wx:key="id" class="artist-chip {{selectedArtistId == item.id ? 'active' : ''}}" data-id="{{item.id}}" bindtap="selectArtist">
@@ -770,5 +770,4 @@
}
}
.backfill-entry{margin:18rpx 0 0;background:#f1ebe4;color:#4f766d;border:1rpx solid #d9cfc3;font-size:25rpx;line-height:68rpx;height:68rpx;border-radius:12rpx}
.historical-backfill-card{margin:20rpx 0;padding:22rpx}.historical-backfill-row{display:flex;justify-content:space-between;align-items:center;padding:18rpx 0;border-top:1rpx solid #eee7df;font-size:26rpx}.historical-backfill-row .muted{display:block;color:#92887e;font-size:22rpx;margin-top:8rpx}