完善预约待分配状态与月历工具栏布局

This commit is contained in:
2026-10-29 15:07:38 +08:00
parent 48050fb985
commit 6a278616a8
7 changed files with 29 additions and 5 deletions
@@ -1129,7 +1129,7 @@ Page({
const selectedArtist = event.detail.item || {}
if (selectedArtist.id === '__unassigned__') {
this.setData({
selectedArtist: {},
selectedArtist: { id: '__unassigned__', name: '暂不分配美甲师' },
'form.artistId': '',
artistSheetVisible: false,
conflictTip: '',
@@ -53,7 +53,7 @@
</view>
<view class="field-card appointment-field-card" bindtap="openArtistSheet">
<view class="field-icon">♙</view>
<view class="field-text"><text class="field-label">服务美甲师</text><text class="field-value {{selectedArtist.name ? '' : 'placeholder'}}">{{selectedArtist.name || '请选择美甲师或暂不分配'}}</text></view>
<view class="field-text"><text class="field-label">服务美甲师</text><text wx:if="{{selectedArtist.id === '__unassigned__'}}" class="field-value">已选择暂不分配美甲师</text><text wx:else class="field-value {{selectedArtist.name ? '' : 'placeholder'}}">{{selectedArtist.name || '请选择美甲师或暂不分配'}}</text></view>
<text class="chevron">›</text>
</view>
</view>
@@ -77,7 +77,7 @@
<view wx:if="{{conflictTip}}" class="availability-tip card {{conflictLevel}}"><text class="tip-title">时段检查</text><text class="tip-text">{{conflictTip}}</text></view>
<entity-selector-sheet visible="{{customerSheetVisible}}" title="选择客户" keyword="{{customerKeyword}}" placeholder="搜索客户姓名或手机号" items="{{customerOptions}}" selected-id="{{form.customerUserId}}" loading="{{customerLoading}}" error-text="{{customerError}}" empty-text="暂无匹配客户" show-view-switch="{{true}}" view-mode="{{customerViewMode}}" sort-label="{{customerNewestFirst ? '最新添加' : '最早添加'}}" bind:search="onCustomerSearch" bind:select="selectCustomer" bind:retry="retryCustomerSearch" bind:changeview="changeCustomerView" bind:sort="toggleCustomerSort" bind:close="closeCustomerSheet" />
<entity-selector-sheet visible="{{artistSheetVisible}}" title="选择美甲师" keyword="{{artistKeyword}}" placeholder="搜索美甲师姓名" items="{{artistSelectorItems}}" selected-id="{{form.artistId}}" loading="{{false}}" error-text="{{artistError}}" empty-text="暂无匹配美甲师" action-text="快速新增美甲师" bind:search="onArtistSearch" bind:select="selectArtist" bind:retry="retryArtists" bind:action="addEmployeeFromSelector" bind:close="closeArtistSheet" />
<entity-selector-sheet visible="{{artistSheetVisible}}" title="选择美甲师" keyword="{{artistKeyword}}" placeholder="搜索美甲师姓名" items="{{artistSelectorItems}}" selected-id="{{selectedArtist.id}}" loading="{{false}}" error-text="{{artistError}}" empty-text="暂无匹配美甲师" action-text="快速新增美甲师" bind:search="onArtistSearch" bind:select="selectArtist" bind:retry="retryArtists" bind:action="addEmployeeFromSelector" bind:close="closeArtistSheet" />
<product-selector-sheet visible="{{productModalVisible}}" mode="list" title="选择已有款式" keyword="{{productKeyword}}" placeholder="搜索款式、标签、美甲师" items="{{filteredProducts}}" selected-id="{{form.productId}}" loading="{{loadingProducts}}" error-text="{{productError}}" empty-text="暂无匹配款式" show-manual-action="{{true}}" bind:search="onProductSearch" bind:select="selectProduct" bind:openmanual="openManualProductFromLibrary" bind:retry="loadOptions" bind:close="closeProductModal" />
<view wx:if="{{manualProductSheetVisible}}" class="modal-mask manual-product-mask" bindtap="closeManualProduct" catchtouchmove="stopTouchMove">
@@ -1197,6 +1197,7 @@ button.full{
display: inline-flex;
align-items: flex-start;
flex-wrap: nowrap;
justify-content: flex-start;
gap: 16rpx;
min-width: 100%;
height: 206rpx;
@@ -1,4 +1,6 @@
const assert = require('assert')
const fs = require('fs')
const path = require('path')
const planningApi = require('../../api/planning')
let redirectedTo = ''
@@ -36,6 +38,10 @@ function createPage() {
}
async function run() {
const appointmentWxml = fs.readFileSync(path.join(__dirname, 'index.wxml'), 'utf8')
assert.match(appointmentWxml, /已选择暂不分配美甲师/)
assert.match(appointmentWxml, /selected-id="\{\{selectedArtist\.id\}\}"/)
const expiredPage = createPage()
expiredPage.data.canCreateAppointment = true
appGlobalData.userInfo = { type: 2, shopBusinessExpired: true }
@@ -64,6 +70,19 @@ async function run() {
assert.strictEqual(availability.ok, true)
assert.strictEqual(page.data.conflictTip.includes('待分配'), true)
const unassignedPage = createPage()
Object.assign(unassignedPage.data.form, { appointmentTime: '14:00' })
unassignedPage.data.artists = [{ id: 2, name: '小李' }]
unassignedPage.refreshAvailableTimes = async () => {}
const unassignedOption = unassignedPage.filterArtistItems(unassignedPage.data.artists, '')[0]
assert.strictEqual(unassignedOption.id, '__unassigned__')
unassignedPage.selectArtist({ detail: { item: unassignedOption } })
assert.strictEqual(unassignedPage.data.selectedArtist.id, '__unassigned__')
assert.strictEqual(unassignedPage.data.selectedArtist.name, '暂不分配美甲师')
assert.strictEqual(unassignedPage.data.form.artistId, '')
assert.strictEqual(unassignedPage.data.form.appointmentTime, '14:00')
assert.strictEqual(unassignedPage.data.artistSheetVisible, false)
let submittedPayload
planningApi.createAppointment = async payload => {
submittedPayload = payload
+1 -1
View File
@@ -53,7 +53,7 @@ async function run() {
assert.ok(toolbarMarkup[1].indexOf('month-mode-switch') < toolbarMarkup[1].indexOf('row-name-switch'))
const toolbarControlsStyle = planningWxss.match(/\.month-toolbar-controls\s*\{([^}]*)\}/)
assert.ok(toolbarControlsStyle)
assert.doesNotMatch(toolbarControlsStyle[1], /margin-left:\s*auto/)
assert.match(toolbarControlsStyle[1], /margin-left:\s*auto/)
assert.deepStrictEqual(definition.data.viewModes.map(item => item.value), ['month', 'week', 'day'])
assert.strictEqual(definition.data.viewMode, 'month')
@@ -540,6 +540,7 @@
.month-toolbar-title {
flex: 0 0 auto;
margin-right: auto;
color: #615a51;
font-size: 24rpx;
font-weight: 800;
@@ -550,6 +551,7 @@
flex: 0 0 auto;
align-items: center;
gap: 12rpx;
margin-left: auto;
}
.month-mode-switch {
+3 -1
View File
@@ -415,4 +415,6 @@
## 2026-10-29 Salon 月历显示工具栏对齐
- 月历显示模式切换与姓名开关合并为左对齐控制组,紧跟“月历显示”标题排列,不再居中或推到右侧。
- 恢复月历工具栏原布局:标题在左,显示模式与姓名开关作为一组靠右排列。
- 预约款式图片横向滚动内容明确从左侧开始排列,保持图片和添加入口为正方形。
- 美甲师选择器中的“暂不分配”可选中;选择后表单显示“已选择暂不分配美甲师”,但提交仍不携带美甲师 ID,并保留不校验排班占用的行为。