提交 Salon 小程序现有调整

This commit is contained in:
2026-10-20 18:02:49 +08:00
parent 527754af02
commit 68533738e0
34 changed files with 98 additions and 95 deletions
@@ -369,7 +369,7 @@ function buildCustomerSelectorItem(customer) {
function buildArtistSelectorItem(artist) {
return {
...artist,
title: artist.name || '未命名员工',
title: artist.name || '未命名美甲师',
subtitle: artist.statusText || '可用于指定预约',
meta: artist.workStartTime && artist.workEndTime ? `${artist.workStartTime.slice(0, 5)}-${artist.workEndTime.slice(0, 5)}` : '',
avatar: artist.avatar || artist.avatarUrl || '/assets/images/default-user-avatar.png'
@@ -555,7 +555,7 @@ Page({
artistSelectorItems: [],
selectedArtist: {},
'form.artistId': '',
artistError: error.message || '员工列表加载失败',
artistError: error.message || '美甲师列表加载失败',
conflictTip: error.message || '美甲师列表加载失败',
conflictLevel: 'danger'
})
@@ -769,7 +769,7 @@ Page({
const result = await new Promise(resolve => {
wx.showModal({
title: '历史日期不能新建预约',
content: '之前的日期只能作为历史补单记录,不会校验员工排班,也不会占用预约时段。',
content: '之前的日期只能作为历史补单记录,不会校验美甲师排班,也不会占用预约时段。',
cancelText: '取消',
confirmText: '去补单',
success: resolve,
@@ -927,7 +927,7 @@ Page({
.filter(item => !keyword || String(item.name || '').toLowerCase().includes(keyword))
.map(buildArtistSelectorItem)
if (!keyword || '暂不分配'.includes(keyword)) {
items.unshift({ id: '__unassigned__', title: '暂不分配', subtitle: '先记录预约,后续再分配员工', badge: '待分配' })
items.unshift({ id: '__unassigned__', title: '暂不分配', subtitle: '先记录预约,后续再分配美甲师', badge: '待分配' })
}
return items
},
@@ -1003,7 +1003,7 @@ Page({
selectedArtist: {},
'form.artistId': '',
'form.appointmentTime': originalTime,
conflictTip: `${availability.tip || '新员工当前排班无法承接'},预约已保持待分配`,
conflictTip: `${availability.tip || '新美甲师当前排班无法承接'},预约已保持待分配`,
conflictLevel: 'danger'
})
}
@@ -1053,7 +1053,7 @@ Page({
...buildTimeWheelState(timePickerSlots, form.appointmentTime),
timeError: '',
timeLoading: false,
timeSelectTip: '请选择预约时间,员工可稍后分配'
timeSelectTip: '请选择预约时间,美甲师可稍后分配'
})
return
}
@@ -1187,7 +1187,7 @@ Page({
return { ok: false, tip }
}
if (!form.artistId) {
const tip = '预约将保存为待分配,当前不会占用员工时间'
const tip = '预约将保存为待分配,当前不会占用美甲师时间'
this.setData({ conflictTip: tip, conflictLevel: 'free' })
return { ok: true, tip }
}
@@ -1362,7 +1362,7 @@ Page({
const result = await new Promise(resolve => {
wx.showModal({
title: '保存为待分配预约',
content: '当前未指定员工,预约会正常保存,但不会占用员工时间。可以稍后在预约详情中分配。',
content: '当前未指定美甲师,预约会正常保存,但不会占用美甲师时间。可以稍后在预约详情中分配。',
cancelText: '返回选择',
confirmText: '继续保存',
success: resolve,
@@ -10,16 +10,18 @@
<view class="card form-card style-section">
<view class="section-heading">
<view class="section-title-row"><text class="section-title-main">美甲款式</text><text class="required-mark">*</text></view>
<button class="link-action" bindtap="openProductModal">{{form.productId ? '更换款式' : '选择已有'}}</button>
<view class="btn-wrap">
<button class="link-action" bindtap="openProductModal">款式库</button>
</view>
</view>
<button wx:if="{{!form.productId}}" class="field-card appointment-field-card" bindtap="openManualProduct">
<button wx:if="{{!form.productId}}" class="field-card appointment-field-card full" bindtap="openManualProduct">
<image wx:if="{{form.manualProductImageUrl}}" class="field-icon style-entry-image" src="{{form.manualProductImageUrl}}" mode="aspectFill"></image>
<view wx:else class="field-icon">✦</view>
<view class="field-text">
<text class="field-label">手动录入为主,提交预约后自动加入作品库</text>
<text wx:if="{{form.manualProductTitle}}" class="field-value">{{form.manualProductTitle}}</text>
<text wx:elif="{{form.manualProductImageUrl}}" class="field-value">已添加款式图片</text>
<text wx:else class="field-value placeholder">填写款式名称或添加图片</text>
<text class="field-label">点击可手动录入,提交预约后自动加入款式库</text>
</view>
<text class="chevron">›</text>
</button>
@@ -39,7 +41,7 @@
<view class="card form-card appointment-info-section">
<view class="section-heading">
<view><text class="section-title-main">预约信息</text><text class="section-caption">员工可暂不分配,之后再安排</text></view>
<view><text class="section-title-main">预约信息</text><text class="section-caption">美甲师可暂不分配,之后再安排</text></view>
</view>
<picker mode="date" value="{{form.appointmentDate}}" bindchange="onDateChange">
<view class="field-card appointment-field-card">
@@ -50,19 +52,19 @@
</picker>
<view class="field-card appointment-field-card" bindtap="openTimeSheet">
<view class="field-icon">◷</view>
<view class="field-text"><text class="field-label">预约时间</text><text wx:if="{{form.appointmentTime}}" class="field-value">{{appointmentDayLabel}} {{form.appointmentTime}} · {{form.durationMinutes}}分钟</text><text wx:else class="field-value placeholder">{{timeSelectTip}}</text><text wx:if="{{form.appointmentTime}}" class="field-meta">{{selectedArtist.name || '暂不分配员工'}}</text></view>
<view class="field-text"><text class="field-label">预约时间</text><text wx:if="{{form.appointmentTime}}" class="field-value">{{appointmentDayLabel}} {{form.appointmentTime}} · {{form.durationMinutes}}分钟</text><text wx:else class="field-value placeholder">{{timeSelectTip}}</text><text wx:if="{{form.appointmentTime}}" class="field-meta">{{selectedArtist.name || '暂不分配美甲师'}}</text></view>
<text class="chevron">›</text>
</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 class="field-value {{selectedArtist.name ? '' : 'placeholder'}}">{{selectedArtist.name || '请选择美甲师或暂不分配'}}</text></view>
<text class="chevron">›</text>
</view>
</view>
<view class="card form-card customer-section">
<view class="section-heading">
<view><text class="section-title-main">客户</text><text class="section-caption">可留空;姓名和手机号都为空时按散客提交</text></view>
<view><text class="section-title-main">客户</text><text class="section-caption">可留空,留空时系统会生成临时客户以便报表查询</text></view>
</view>
<view class="customer-entry">
<view class="customer-fields">
@@ -79,7 +81,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="{{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" />
<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="openManualProduct" bind:retry="loadOptions" bind:close="closeProductModal" />
<view wx:if="{{manualProductSheetVisible}}" class="modal-mask manual-product-mask" bindtap="closeManualProduct" catchtouchmove="stopTouchMove">
@@ -96,7 +98,7 @@
</view>
<text class="manual-style-hint">没有填写名称时,会使用客户姓名;散客预约会使用“散客款式”。</text>
</scroll-view>
<view class="manual-style-footer"><button class="manual-style-confirm" bindtap="confirmManualProduct">用于本次预约</button><button class="manual-style-library-link" bindtap="openProductModal">选择已有作品</button></view>
<view class="manual-style-footer"><button class="manual-style-confirm" bindtap="confirmManualProduct">用于本次预约</button><button class="manual-style-library-link" bindtap="openProductModal">从款式库中选择</button></view>
</view>
</view>
@@ -469,16 +469,13 @@
font-size: 21rpx;
}
.link-action {
flex: 0 0 auto;
height: 60rpx;
padding: 0 17rpx;
border: 1rpx solid #d7b38e;
border-radius: 14rpx;
background: #fff7ed;
color: #9f5f2d;
font-size: 22rpx;
line-height: 60rpx;
.btn-wrap {
flex-shrink: 0; /* 不让按钮被压缩 */
}
button.link-action {
margin:0;
width:auto;
}
.style-name-row,
@@ -511,6 +508,10 @@
font-size: 23rpx;
line-height: 72rpx;
}
button.image-action {
margin:0;
width:auto;
}
.style-image-preview-row {
justify-content: flex-start;
@@ -49,7 +49,7 @@ async function run() {
await page.refreshAvailableTimes()
assert.strictEqual(page.data.availableTimeGroups.length > 0, true)
assert.strictEqual(page.data.timeSelectTip, '请选择预约时间,员工可稍后分配')
assert.strictEqual(page.data.timeSelectTip, '请选择预约时间,美甲师可稍后分配')
const availability = await page.checkAvailability()
assert.strictEqual(availability.ok, true)
assert.strictEqual(page.data.conflictTip.includes('待分配'), true)