统一历史补录与新建预约表单体验

This commit is contained in:
2026-10-31 03:48:49 +08:00
parent ddc04705e3
commit c8e0806c4d
6 changed files with 153 additions and 718 deletions
@@ -9,8 +9,15 @@ public class PlanningBackfillOrderCreateDTO {
private Long productId;
private String manualProductTitle;
private BigDecimal manualProductPrice;
private Integer durationMinutes;
private String manualProductDescription;
private String manualProductTags;
private String manualProductTargetAudience;
private String manualProductPrecautions;
private String manualProductImageFileIds;
private Long customerUserId;
private String customerName;
private String wechatId;
private String phone;
private String serviceDate;
private String serviceTime;
@@ -270,6 +270,14 @@ public class PlanningServiceImpl implements PlanningService {
BigDecimal price = dto.getManualProductPrice() == null ? dto.getAmount() : dto.getManualProductPrice();
if (price == null || price.compareTo(BigDecimal.ZERO) < 0) throw new RuntimeException("项目金额不能小于0");
product = new ProductDO(); product.setShopId(shopId); product.setTitle(title); product.setPrice(price);
product.setDescription(trimToNull(dto.getManualProductDescription()));
product.setTags(trimToNull(dto.getManualProductTags()));
product.setTargetAudience(trimToNull(dto.getManualProductTargetAudience()));
product.setPrecautions(trimToNull(dto.getManualProductPrecautions()));
product.setImageFileIds(trimToNull(dto.getManualProductImageFileIds()));
int durationMinutes = dto.getDurationMinutes() == null || dto.getDurationMinutes() <= 0 ? DEFAULT_DURATION_MINUTES : dto.getDurationMinutes();
product.setApproximateDuration(durationMinutes + "分钟");
product.setBookableArtists(String.valueOf(dto.getArtistId()));
product.setSourceType(PRODUCT_SOURCE_TYPE_MANAGER_APPOINTMENT); product.setFrontVisible(0);
product.setLikeCount(0); product.setCollectCount(0); product.setIsDelete(0); productMapper.insert(product);
}
+54 -75
View File
@@ -3,91 +3,70 @@ const employeesApi = require('../../api/employees')
const productsApi = require('../../api/products')
const customersApi = require('../../api/customers')
const dateUtil = require('../../utils/date')
const { uploadObjectFile } = require('../../utils/upload')
function normalizeProduct(product, artists) {
const artistIds = String(product.bookableArtists || '').split(',').map(id => id.trim()).filter(Boolean)
const artistNames = artistIds.map(id => artists.find(artist => String(artist.id) === id)).filter(Boolean).map(artist => artist.name)
const imageUrls = Array.isArray(product.imageUrls) ? product.imageUrls : []
const tags = Array.isArray(product.tagList) ? product.tagList : String(product.tags || '').split(/[;,,、]/).map(tag => tag.trim()).filter(Boolean)
return { ...product, title: product.title || '未命名款式', coverImage: imageUrls[0] || '', priceText: product.price == null ? '价格待定' : `¥${product.price}`, durationText: product.approximateDuration || (product.serviceDurationMinutes ? `${product.serviceDurationMinutes}分钟` : '时长待定'), artistText: artistIds.length ? artistNames.join('、') || `${artistIds.length}位美甲师可做` : '全部美甲师', tagList: tags.slice(0, 3) }
}
function normalizeCustomer(customer) {
const name = customer.nickname || customer.name || customer.account || ''
const phone = customer.contactPhone || customer.phone || ''
return { ...customer, id: customer.id, name, phone, title: name || phone || '客户', subtitle: phone || '未填写手机号' }
}
function imagePatch(images) {
const normalized = (images || []).slice(0, 9)
return { 'form.manualProductImages': normalized, 'form.manualProductImageFileIds': normalized.map(image => image.fileId).filter(Boolean).join(','), 'form.manualProductImageUrl': normalized[0] ? normalized[0].previewUrl || normalized[0].fileUrl || '' : '' }
}
function chooseImages(count) {
return new Promise((resolve, reject) => wx.chooseMedia({ count: Math.min(9, Math.max(1, count)), mediaType: ['image'], sourceType: ['album', 'camera'], sizeType: ['compressed'], success: result => resolve((result.tempFiles || []).map(file => file.tempFilePath).filter(Boolean)), fail: error => String(error && error.errMsg || '').includes('cancel') ? resolve([]) : reject(new Error(`选择图片失败:${error && error.errMsg || '未知错误'}`)) }))
}
Page({
data: { form: { serviceDate: dateUtil.formatDate(new Date()), manualProductTitle: '', amount: '', customerName: '', phone: '', serviceTime: '', status: 4, remark: '', artistId: '', productId: '', customerUserId: '' }, manualProductDraft: { title: '', price: '' }, artists: [], artistOptions: [], allProductOptions: [], productOptions: [], customerOptions: [], allCustomerOptions: [], productSelectorVisible: false, manualProductSheetVisible: false, artistSelectorVisible: false, customerSelectorVisible: false, loadingProducts: false, loadingArtists: false, loadingCustomers: false, productKeyword: '', artistKeyword: '', customerKeyword: '', productError: '', artistError: '', customerError: '', selectedArtistName: '', selectedProduct: {}, selectedProductTitle: '', selectedProductPriceText: '', submitting: false },
onLoad(options = {}) {
const serviceDate = options.serviceDate || this.data.form.serviceDate
const artistId = options.artistId || ''
this.setData({ 'form.serviceDate': serviceDate, 'form.artistId': artistId })
this.loadArtists(artistId); this.loadProducts(); this.loadCustomers()
data: {
form: { serviceDate: dateUtil.formatDate(new Date()), serviceTime: '', artistId: '', productId: '', manualProductTitle: '', manualProductDescription: '', manualProductTags: '', manualProductTargetAudience: '', manualProductPrecautions: '', manualProductImageFileIds: '', manualProductImageUrl: '', manualProductImages: [], customerUserId: '', customerName: '', wechatId: '', phone: '', amount: '', durationMinutes: '60', status: 4, remark: '' },
manualProductDraft: { title: '', price: '', durationMinutes: '60', description: '' },
artists: [], artistOptions: [], products: [], productOptions: [], allCustomerOptions: [], customerOptions: [], productSelectorVisible: false, manualProductSheetVisible: false, artistSelectorVisible: false, customerSelectorVisible: false, loadingProducts: false, loadingArtists: false, loadingCustomers: false, manualImageUploading: false, submitting: false, productKeyword: '', artistKeyword: '', customerKeyword: '', productError: '', artistError: '', customerError: '', selectedArtistName: '', selectedProduct: {}, selectedProductTitle: '', selectedProductPriceText: '', manualProductTitleLength: 0, manualProductMoreVisible: false
},
async loadArtists(preferredArtistId) {
try {
const result = await employeesApi.list({ page: 1, size: 100 })
const list = result.list || result || []
const normalized = list.map(item => ({ ...item, name: item.name || item.nickname || item.account || `美甲师${item.id}` }))
const selected = normalized.find(item => String(item.id) === String(preferredArtistId || this.data.form.artistId))
this.setData({ artists: normalized, artistOptions: normalized.map(item => ({ id: item.id, title: item.name, subtitle: item.phone || '' })), selectedArtistName: selected ? selected.name : '', 'form.artistId': selected ? selected.id : '' })
this.refreshProductOptions()
} catch (error) { wx.showToast({ title: error.message || '美甲师加载失败', icon: 'none' }) }
},
async loadProducts() { this.setData({ loadingProducts: true }); try { const result = await productsApi.list({ page: 1, size: 100 }); const list = result.list || result || []; this.setData({ products: list, productError: '' }); this.refreshProductOptions() } catch (error) { this.setData({ products: [], allProductOptions: [], productOptions: [], productError: error.message || '项目加载失败' }) } finally { this.setData({ loadingProducts: false }) } },
refreshProductOptions() {
const options = (this.data.products || []).map(item => {
const artistIds = String(item.bookableArtists || '').split(',').map(id => id.trim()).filter(Boolean)
const artistNames = artistIds.map(id => this.data.artists.find(artist => String(artist.id) === id)).filter(Boolean).map(artist => artist.name)
const tagList = Array.isArray(item.tagList) ? item.tagList : Array.isArray(item.tagInfos) ? item.tagInfos.map(tag => tag.tagName).filter(Boolean) : String(item.tags || '').split(/[;,,、]/).map(tag => tag.trim()).filter(Boolean)
return {
id: item.id,
title: item.title,
price: item.price,
priceText: item.price == null ? '价格待定' : `¥${item.price}`,
coverImage: Array.isArray(item.imageUrls) ? item.imageUrls[0] || '' : '',
durationText: item.approximateDuration || (item.serviceDurationMinutes ? `${item.serviceDurationMinutes}分钟` : '时长待定'),
artistText: artistIds.length ? artistNames.join('、') || `${artistIds.length}位美甲师可做` : '全部美甲师',
tagList: tagList.slice(0, 3)
}
})
const keyword = String(this.data.productKeyword || '').trim().toLowerCase()
this.setData({ allProductOptions: options, productOptions: options.filter(item => !keyword || `${item.title} ${item.artistText} ${item.tagList.join(' ')}`.toLowerCase().includes(keyword)) })
},
async loadCustomers() { this.setData({ loadingCustomers: true }); try { const result = await customersApi.list({ page: 1, size: 30 }); const list = result.list || result || []; const options = list.map(item => ({ id: item.id, title: item.nickname || item.name || item.account, subtitle: item.phone || item.contactPhone || '' })); this.setData({ allCustomerOptions: options, customerOptions: options, customerError: '' }) } catch (error) { this.setData({ customerError: error.message || '客户加载失败' }) } finally { this.setData({ loadingCustomers: false }) } },
openProductSelector() { this.setData({ manualProductSheetVisible: true }) },
onLoad(options = {}) { this.setData({ 'form.serviceDate': options.serviceDate || this.data.form.serviceDate, 'form.artistId': options.artistId || '' }); this.loadArtists(options.artistId); this.loadProducts(); this.loadCustomers() },
async loadArtists(preferredArtistId) { this.setData({ loadingArtists: true }); try { const result = await employeesApi.list({ page: 1, size: 100 }); const list = result.list || result || []; const artists = list.map(item => ({ ...item, name: item.name || item.nickname || item.account || `美甲师${item.id}` })); const selected = artists.find(item => String(item.id) === String(preferredArtistId || this.data.form.artistId)); this.setData({ artists, artistOptions: artists.map(item => ({ id: item.id, title: item.name, subtitle: item.phone || '' })), selectedArtistName: selected ? selected.name : '', 'form.artistId': selected ? selected.id : '', artistError: '' }); this.refreshProductOptions() } catch (error) { this.setData({ artists: [], artistOptions: [], artistError: error.message || '美甲师加载失败' }) } finally { this.setData({ loadingArtists: false }) } },
async loadProducts() { this.setData({ loadingProducts: true }); try { const result = await productsApi.list({ page: 1, size: 100 }); this.setData({ products: result.list || result || [], productError: '' }); this.refreshProductOptions() } catch (error) { this.setData({ products: [], productOptions: [], productError: error.message || '款式加载失败' }) } finally { this.setData({ loadingProducts: false }) } },
refreshProductOptions() { const keyword = String(this.data.productKeyword || '').trim().toLowerCase(); const all = (this.data.products || []).map(product => normalizeProduct(product, this.data.artists)); this.setData({ productOptions: all.filter(item => !keyword || `${item.title} ${item.artistText} ${item.durationText} ${item.tagList.join(' ')}`.toLowerCase().includes(keyword)) }) },
async loadCustomers() { this.setData({ loadingCustomers: true }); try { const result = customersApi.listForAppointment ? await customersApi.listForAppointment({ page: 1, size: 100 }) : await customersApi.list({ page: 1, size: 100 }); const options = (result.list || result || []).map(normalizeCustomer); this.setData({ allCustomerOptions: options, customerOptions: options, customerError: '' }) } catch (error) { this.setData({ customerError: error.message || '客户加载失败' }) } finally { this.setData({ loadingCustomers: false }) } },
openProductSelector() { this.setData({ manualProductSheetVisible: true, manualProductTitleLength: String(this.data.manualProductDraft.title || '').length }) },
openProductLibrary() { this.setData({ manualProductSheetVisible: false, productSelectorVisible: true }) },
closeProductSelector() { this.setData({ productSelectorVisible: false }) },
closeManualProduct() { this.setData({ manualProductSheetVisible: false }) },
openManualProduct() { this.setData({ productSelectorVisible: false, manualProductSheetVisible: true }) },
onManualProductInput(e) {
const field = e.currentTarget && e.currentTarget.dataset.field || e.detail.field
this.setData({ [`manualProductDraft.${field}`]: e.detail.value })
},
openManualProduct() { this.setData({ productSelectorVisible: false, manualProductSheetVisible: true, manualProductMoreVisible: false }) },
toggleManualProductMore() { this.setData({ manualProductMoreVisible: !this.data.manualProductMoreVisible }) },
onManualProductInput(event) { const field = event.currentTarget.dataset.field; const patch = { [`manualProductDraft.${field}`]: event.detail.value }; if (field === 'title') { patch.manualProductTitleLength = String(event.detail.value || '').length; if (this.data.form.productId) { patch['form.productId'] = ''; patch.selectedProduct = {}; patch.selectedProductTitle = ''; patch.selectedProductPriceText = '' } } this.setData(patch) },
stopTap() {},
stopTouchMove() {},
openArtistSelector() { this.setData({ artistSelectorVisible: true }) },
closeArtistSelector() { this.setData({ artistSelectorVisible: false }) },
openCustomerSelector() { this.setData({ customerSelectorVisible: true }) },
closeCustomerSelector() { this.setData({ customerSelectorVisible: false }) },
searchProducts(e) { const keyword = String(e.detail.value || '').trim().toLowerCase(); this.setData({ productKeyword: keyword, productOptions: this.data.allProductOptions.filter(item => !keyword || `${item.title} ${item.artistText} ${item.tagList.join(' ')}`.toLowerCase().includes(keyword)) }) },
searchArtists(e) { const keyword = String(e.detail.value || '').toLowerCase(); this.setData({ artistKeyword: keyword, artistOptions: this.data.artists.map(item => ({ id: item.id, title: item.name, subtitle: item.phone || '' })).filter(item => !keyword || item.title.toLowerCase().includes(keyword)) }) },
searchCustomers(e) { const keyword = String(e.detail.value || '').toLowerCase(); this.setData({ customerKeyword: keyword, customerOptions: this.data.allCustomerOptions.filter(item => !keyword || String(item.title).toLowerCase().includes(keyword) || String(item.subtitle).includes(keyword)) }) },
selectProduct(e) { const item = e.detail.item; this.setData({ 'form.productId': item.id, selectedProduct: item, selectedProductTitle: item.title, selectedProductPriceText: item.priceText || (item.price == null ? '价格待定' : `¥${item.price}`), 'form.manualProductTitle': '', manualProductDraft: { title: '', price: '' }, 'form.amount': item.price == null ? this.data.form.amount : String(item.price), productSelectorVisible: false, manualProductSheetVisible: false }) },
selectArtist(e) { const item = e.detail.item; this.setData({ 'form.artistId': item.id, selectedArtistName: item.title, artistSelectorVisible: false }) },
selectCustomer(e) { const item = e.detail.item; this.setData({ 'form.customerUserId': item.id, 'form.customerName': item.title, 'form.phone': item.subtitle, customerSelectorVisible: false }) },
useWalkIn() { this.setData({ 'form.customerUserId': '', 'form.customerName': '', 'form.phone': '', customerSelectorVisible: false }) },
onCustomerNameInput(e) { this.setData({ 'form.customerName': e.detail.value, 'form.customerUserId': '' }) },
useManualProduct() {
const title = String(this.data.manualProductDraft.title || '').trim()
const priceText = String(this.data.manualProductDraft.price === undefined ? '' : this.data.manualProductDraft.price).trim()
const price = Number(priceText)
if (!title || !priceText || !Number.isFinite(price) || price < 0) {
wx.showToast({ title: '请填写作品名称和价格', icon: 'none' })
return
}
this.setData({ 'form.productId': '', 'form.manualProductTitle': title, selectedProduct: {}, selectedProductTitle: '', selectedProductPriceText: `¥${price}`, 'form.amount': String(price), productSelectorVisible: false, manualProductSheetVisible: false })
},
onInput(e) { this.setData({ [`form.${e.currentTarget.dataset.field}`]: e.detail.value }) },
onDateChange(e) { this.setData({ 'form.serviceDate': e.detail.value }) },
onTimeChange(e) { this.setData({ 'form.serviceTime': e.detail.value }) },
onArtistChange(e) { const index = Number(e.detail.value); const item = this.data.artists[index] || {}; this.setData({ artistIndex: index, selectedArtistName: item.name || item.nickname || '', 'form.artistId': item.id }) },
selectStatus(e) { this.setData({ 'form.status': Number(e.currentTarget.dataset.status) }) },
async submit() {
const form = this.data.form
if (!form.serviceDate || (!form.productId && !form.manualProductTitle) || !form.amount || !form.artistId) { wx.showToast({ title: '请填写项目、金额、日期和美甲师', icon: 'none' }); return }
if (form.phone && !/^1[3-9]\d{9}$/.test(form.phone)) { wx.showToast({ title: '手机号格式不正确', icon: 'none' }); return }
this.setData({ submitting: true })
try { await planningApi.createBackfillOrder(form); wx.showToast({ title: '补单已保存', icon: 'success' }); const app = getApp(); app.globalData.planningNeedRefresh = true; setTimeout(() => wx.navigateBack(), 500) }
catch (error) { wx.showToast({ title: error.message || '保存失败', icon: 'none' }) }
finally { this.setData({ submitting: false }) }
}
searchProducts(event) { const keyword = String(event.detail.value || '').trim().toLowerCase(); this.setData({ productKeyword: keyword }); this.refreshProductOptions() },
searchArtists(event) { const keyword = String(event.detail.value || '').toLowerCase(); this.setData({ artistKeyword: keyword, artistOptions: this.data.artists.map(item => ({ id: item.id, title: item.name, subtitle: item.phone || '' })).filter(item => !keyword || item.title.toLowerCase().includes(keyword)) }) },
searchCustomers(event) { const keyword = String(event.detail.value || '').toLowerCase(); this.setData({ customerKeyword: keyword, customerOptions: this.data.allCustomerOptions.filter(item => !keyword || `${item.name} ${item.phone}`.toLowerCase().includes(keyword)) }) },
selectProduct(event) { const item = event.detail.item || {}; const duration = String(item.serviceDurationMinutes || String(item.approximateDuration || '').replace(/[^0-9]/g, '') || '60'); this.setData({ 'form.productId': item.id, 'form.manualProductTitle': '', 'form.amount': item.price == null ? this.data.form.amount : String(item.price), 'form.durationMinutes': duration, selectedProduct: item, selectedProductTitle: item.title, selectedProductPriceText: item.priceText || '价格待定', manualProductDraft: { title: '', price: '', durationMinutes: duration, description: '' }, productSelectorVisible: false, manualProductSheetVisible: false }) },
selectArtist(event) { const item = event.detail.item; this.setData({ 'form.artistId': item.id, selectedArtistName: item.title, artistSelectorVisible: false }) },
selectCustomer(event) { const item = event.detail.item || {}; this.setData({ 'form.customerUserId': item.id, 'form.customerName': item.name || item.title, 'form.phone': item.phone || '', customerSelectorVisible: false }) },
useWalkIn() { this.setData({ 'form.customerUserId': '', 'form.customerName': '', 'form.wechatId': '', 'form.phone': '', customerSelectorVisible: false }) },
onCustomerInput(event) { this.setData({ [`form.${event.currentTarget.dataset.field}`]: event.detail.value, 'form.customerUserId': '' }) },
useManualProduct() { const title = String(this.data.manualProductDraft.title || '').trim(); const priceText = String(this.data.manualProductDraft.price || this.data.form.amount || '').trim(); const price = Number(priceText); const images = this.data.form.manualProductImages || []; if (this.data.form.productId) { if (!priceText || !Number.isFinite(price) || price < 0) { wx.showToast({ title: '请输入正确的款式价格', icon: 'none' }); return } this.setData({ 'form.amount': priceText, 'form.durationMinutes': String(this.data.manualProductDraft.durationMinutes || '60'), manualProductSheetVisible: false }); return } if (!title && !images.length) { wx.showToast({ title: '请填写款式名称或添加图片', icon: 'none' }); return } if (!priceText || !Number.isFinite(price) || price < 0) { wx.showToast({ title: '请输入正确的款式价格', icon: 'none' }); return } const duration = String(this.data.manualProductDraft.durationMinutes || '60'); this.setData({ 'form.productId': '', 'form.manualProductTitle': title, 'form.manualProductDescription': this.data.manualProductDraft.description || '', 'form.manualProductPrice': priceText, 'form.amount': priceText, 'form.durationMinutes': duration, 'manualProductDraft.price': priceText, selectedProduct: {}, selectedProductTitle: title, selectedProductPriceText: `¥${price}`, productSelectorVisible: false, manualProductSheetVisible: false }) },
async chooseManualProductImage() { if (this.data.manualImageUploading) return; const remaining = 9 - (this.data.form.manualProductImages || []).length; if (remaining <= 0) { wx.showToast({ title: '最多添加9张图片', icon: 'none' }); return } try { this.setData({ manualImageUploading: true }); const paths = await chooseImages(remaining); for (const filePath of paths) { const result = await uploadObjectFile(filePath); const fileId = result.id || result.fileId; if (!fileId) throw new Error('图片上传成功但未返回文件ID'); this.setData(imagePatch((this.data.form.manualProductImages || []).concat({ fileId: String(fileId), fileUrl: result.fileUrl || result.primaryUrl || '', previewUrl: filePath }))) } } catch (error) { wx.showToast({ title: error.message || '图片上传失败', icon: 'none' }) } finally { this.setData({ manualImageUploading: false }) } },
removeManualProductImage(event) { const index = Number(event.currentTarget.dataset.index); this.setData(imagePatch((this.data.form.manualProductImages || []).filter((item, itemIndex) => itemIndex !== index))) },
onManualProductImageError(event) { const index = Number(event.currentTarget.dataset.index); const images = this.data.form.manualProductImages || []; if (!images[index] || !images[index].fileUrl) return; const fallback = images.slice(); fallback[index] = { ...fallback[index], previewUrl: fallback[index].fileUrl }; this.setData(imagePatch(fallback)) },
onInput(event) { const field = event.currentTarget.dataset.field; const value = event.detail.value; this.setData({ [`form.${field}`]: value, ...(field === 'amount' ? { 'manualProductDraft.price': value } : {}) }) },
onDateChange(event) { this.setData({ 'form.serviceDate': event.detail.value }) },
onTimeChange(event) { this.setData({ 'form.serviceTime': event.detail.value }) },
selectStatus(event) { this.setData({ 'form.status': Number(event.currentTarget.dataset.status) }) },
async submit() { const form = this.data.form; if (!form.serviceDate || (!form.productId && !String(form.manualProductTitle || '').trim() && !(form.manualProductImages || []).length) || !String(form.amount || '').trim() || !form.artistId) { wx.showToast({ title: '请补全款式、金额、日期和美甲师', icon: 'none' }); return } if (form.phone && !/^1[3-9]\d{9}$/.test(String(form.phone).trim())) { wx.showToast({ title: '请输入正确手机号', icon: 'none' }); return } this.setData({ submitting: true }); try { const payload = { ...form, amount: Number(form.amount), manualProductPrice: Number(form.manualProductPrice || form.amount), durationMinutes: Number(form.durationMinutes) || 60, manualProductImageFileIds: String(form.manualProductImageFileIds || '').trim() || undefined, customerName: String(form.customerName || '').trim() || undefined, wechatId: String(form.wechatId || '').trim() || undefined, phone: String(form.phone || '').trim() || undefined, serviceTime: String(form.serviceTime || '').trim() || undefined }; if (!payload.manualProductTitle && payload.manualProductImageFileIds) payload.manualProductTitle = String(form.customerName || '').trim() || '散客款式'; await planningApi.createBackfillOrder(payload); wx.showToast({ title: '历史补单已保存', icon: 'success' }); const app = getApp(); app.globalData.planningNeedRefresh = true; setTimeout(() => wx.navigateBack(), 500) } catch (error) { wx.showToast({ title: error.message || '保存失败', icon: 'none' }) } finally { this.setData({ submitting: false }) } }
})
+60 -76
View File
@@ -1,82 +1,64 @@
<view class="page no-tab backfill-page">
<view class="backfill-hero">
<view class="backfill-hero-copy">
<text class="backfill-eyebrow">HISTORICAL ORDER</text>
<text class="backfill-title">补录一笔历史订单</text>
<view class="page no-tab appointment-page backfill-page">
<view class="appointment-hero">
<view class="appointment-hero-copy">
<text class="appointment-eyebrow">HISTORICAL ORDER</text>
<text class="appointment-title">补录一笔历史订单</text>
</view>
<view class="backfill-date-pill"><text class="date-pill-icon">◷</text><text>{{form.serviceDate}}</text></view>
<view class="appointment-date-pill"><text class="date-pill-icon">◷</text><text>{{form.serviceDate}}</text></view>
</view>
<view class="card form-card backfill-card style-section">
<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>
<text class="section-caption">手动录入为主,也可从款式库快速选择</text>
<button class="link-action" bindtap="openProductLibrary">款式库</button>
</view>
<button class="field-card backfill-field-card full" bindtap="openProductSelector">
<image wx:if="{{selectedProduct.coverImage}}" class="field-icon style-entry-image" src="{{selectedProduct.coverImage}}" mode="aspectFill"></image>
<button wx:if="{{!form.productId}}" class="field-card appointment-field-card full" bindtap="openManualProduct">
<image wx:if="{{form.manualProductImages.length}}" class="field-icon style-entry-image" src="{{form.manualProductImages[0].previewUrl || form.manualProductImages[0].fileUrl}}" mode="aspectFill" data-index="0" binderror="onManualProductImageError"></image>
<view wx:else class="field-icon">✦</view>
<view class="field-text">
<text class="field-label">项目款式</text>
<text class="field-value {{selectedProductTitle || form.manualProductTitle ? '' : 'placeholder'}}">{{selectedProductTitle || form.manualProductTitle || '请选择美甲款式'}}</text>
<text wx:if="{{selectedProductPriceText}}" class="field-meta">参考价 {{selectedProductPriceText}}</text>
<text wx:else class="field-meta">点击录入款式,或从款式库选择</text>
<text wx:if="{{form.manualProductTitle}}" class="field-value">{{form.manualProductTitle}}</text>
<text wx:elif="{{form.manualProductImages.length}}" class="field-value">已添加 {{form.manualProductImages.length}} 张款式图片</text>
<text wx:else class="field-value placeholder">填写款式名称或添加图片</text>
<text wx:if="{{form.amount || form.durationMinutes}}" class="field-meta">{{form.amount || '待填'}} 元 · 预计 {{form.durationMinutes || '60'}} 分钟</text>
<text class="field-label">{{form.manualProductImages.length ? '已添加图片 · 点击可编辑' : '点击手动录入,提交后自动加入款式库'}}</text>
</view>
<text class="chevron">›</text>
</button>
<view class="backfill-amount-field">
<text class="field-label required">实际成交金额(元)</text>
<view class="number-input-wrap"><input type="digit" value="{{form.amount}}" data-field="amount" bindinput="onInput" placeholder="请输入本次实际金额" /><text class="number-unit">元</text></view>
<view wx:else class="selected-style-card" bindtap="openManualProduct">
<image wx:if="{{selectedProduct.coverImage}}" class="selected-style-image" src="{{selectedProduct.coverImage}}" mode="aspectFill"></image>
<view wx:else class="field-icon">✦</view>
<view class="selected-style-copy"><text class="selected-style-title">{{selectedProduct.title}}</text><text class="selected-style-meta">参考价 {{selectedProductPriceText || '待定'}} · 本次 {{form.amount || '待填'}} 元 · {{form.durationMinutes || '60'}} 分钟</text></view>
<button class="switch-manual-action" catchtap="openManualProduct">调整</button>
</view>
<view class="style-remark-field backfill-remark-field">
<text class="field-label">补单备注</text>
<textarea value="{{form.remark}}" data-field="remark" bindinput="onInput" placeholder="可记录服务说明或其他信息(选填)" />
</view>
<text class="style-hint">参考价会自动带入金额;补录订单按实际成交金额统计,可根据本次服务情况调整。</text>
<text class="style-hint">名称和图片至少填写一项;名称未填时会使用客户姓名,未选择客户则使用“散客款式”。</text>
</view>
<view class="card form-card backfill-card service-info-section">
<view class="section-heading">
<view><text class="section-title-main">服务信息</text><text class="section-caption">记录本次服务的日期、时间和美甲师</text></view>
</view>
<picker class="backfill-picker-field first" mode="date" value="{{form.serviceDate}}" bindchange="onDateChange">
<view class="field-card backfill-field-card">
<view class="field-icon">▣</view>
<view class="field-text"><text class="field-label">服务日期</text><text class="field-value">{{form.serviceDate}}</text></view>
<text class="chevron">›</text>
</view>
<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>
<picker mode="date" value="{{form.serviceDate}}" bindchange="onDateChange">
<view class="field-card appointment-field-card"><view class="field-icon">▣</view><view class="field-text"><text class="field-label">服务日期</text><text class="field-value">{{form.serviceDate}}</text></view><text class="chevron">›</text></view>
</picker>
<picker class="backfill-picker-field" mode="time" value="{{form.serviceTime}}" bindchange="onTimeChange">
<view class="field-card backfill-field-card">
<view class="field-icon">◷</view>
<view class="field-text"><text class="field-label">服务时间</text><text class="field-value {{form.serviceTime ? '' : 'placeholder'}}">{{form.serviceTime || '时间未记录'}}</text><text class="field-meta">时间可留空,仅按服务日期统计</text></view>
<text class="chevron">›</text>
</view>
<picker mode="time" value="{{form.serviceTime}}" bindchange="onTimeChange">
<view class="field-card appointment-field-card"><view class="field-icon">◷</view><view class="field-text"><text class="field-label">服务时间</text><text class="field-value {{form.serviceTime ? '' : 'placeholder'}}">{{form.serviceTime || '时间未记录'}}</text><text class="field-meta">可留空,仅按服务日期统计</text></view><text class="chevron">›</text></view>
</picker>
<view class="field-card backfill-field-card service-artist-field" bindtap="openArtistSelector">
<view class="field-icon">♙</view>
<view class="field-text"><text class="field-label">服务美甲师</text><text class="field-value {{selectedArtistName ? '' : 'placeholder'}}">{{selectedArtistName || '请选择美甲师'}}</text></view>
<text class="chevron">›</text>
</view>
<view class="field-card appointment-field-card" bindtap="openArtistSelector"><view class="field-icon">♙</view><view class="field-text"><text class="field-label">服务美甲师</text><text class="field-value {{selectedArtistName ? '' : 'placeholder'}}">{{selectedArtistName || '请选择美甲师'}}</text></view><text class="chevron">›</text></view>
</view>
<view class="card form-card backfill-card customer-section">
<view class="section-heading">
<view><text class="section-title-main">客户</text><text class="section-caption">可选择已有客户或直接填写,留空时按散客记录</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>
<view class="customer-entry">
<view class="customer-fields">
<input class="customer-name-input" value="{{form.customerName}}" data-field="customerName" bindinput="onCustomerNameInput" placeholder="客户姓名(可选)" />
<input class="customer-phone-input" value="{{form.phone}}" data-field="phone" bindinput="onInput" type="number" maxlength="11" placeholder="手机号(可选)" />
<input class="customer-name-input" value="{{form.customerName}}" data-field="customerName" bindinput="onCustomerInput" placeholder="客户姓名(可选)" />
<input class="customer-wechat-input" value="{{form.wechatId}}" data-field="wechatId" bindinput="onCustomerInput" placeholder="微信号(可选)" />
<input class="customer-phone-input" value="{{form.phone}}" data-field="phone" bindinput="onCustomerInput" type="number" maxlength="11" placeholder="手机号(可选)" />
</view>
<button class="customer-library-btn" aria-label="选择已有客户" catchtap="openCustomerSelector"><text class="customer-library-icon">⌕</text></button>
</view>
<view wx:if="{{form.customerUserId}}" class="customer-selected-tip">已选择系统客户</view>
</view>
<view class="card form-card backfill-card service-status-section">
<view class="section-heading">
<view><text class="section-title-main">服务状态</text><text class="section-caption">补单直接进入选择的状态</text></view>
</view>
<view class="card form-card service-status-section">
<view class="section-heading"><view><text class="section-title-main">服务状态</text><text class="section-caption">补录订单直接进入选择的状态</text></view></view>
<view class="status-segment">
<view class="status-option {{form.status == 4 ? 'active' : ''}}" data-status="4" bindtap="selectStatus"><text class="status-indicator in-service"></text><text>服务中</text></view>
<view class="status-option {{form.status == 2 ? 'active' : ''}}" data-status="2" bindtap="selectStatus"><text class="status-indicator completed"></text><text>已完成</text></view>
@@ -84,30 +66,32 @@
<text class="style-hint">历史补单不校验美甲师排班,也不会占用预约时段。</text>
</view>
<view class="fixed-bottom backfill-bottom">
<button class="primary-btn backfill-submit-btn" loading="{{submitting}}" disabled="{{submitting}}" bindtap="submit">保存历史补单</button>
</view>
<view class="fixed-bottom"><button class="primary-btn submit-btn" loading="{{submitting}}" disabled="{{submitting}}" bindtap="submit">保存历史补单</button></view>
<product-selector-sheet visible="{{productSelectorVisible}}" mode="list" title="选择已有款式" keyword="{{productKeyword}}" placeholder="搜索款式名称" items="{{productOptions}}" selected-id="{{form.productId}}" loading="{{loadingProducts}}" error-text="{{productError}}" empty-text="暂无款式" show-manual-action="{{true}}" bind:search="searchProducts" bind:select="selectProduct" bind:openmanual="openManualProduct" bind:close="closeProductSelector" bind:retry="loadProducts" />
<view wx:if="{{manualProductSheetVisible}}" class="modal-mask backfill-manual-product-mask" bindtap="closeManualProduct" catchtouchmove="stopTouchMove">
<view class="manual-style-sheet backfill-manual-style-sheet" catchtap="stopTap" catchtouchmove="stopTouchMove">
<view class="modal-head">
<view><text class="modal-title">录入本次美甲款式</text><text class="modal-subtitle">款式名称和价格必填</text></view>
<view class="modal-close" bindtap="closeManualProduct" aria-label="关闭款式录入"></view>
</view>
<scroll-view class="manual-style-content" scroll-y enhanced show-scrollbar="{{false}}">
<view class="style-name-row backfill-manual-fields">
<input class="style-name-input backfill-manual-product-name" value="{{manualProductDraft.title}}" data-field="title" bindinput="onManualProductInput" placeholder="请输入款式名称" />
<input class="style-name-input backfill-manual-product-price" value="{{manualProductDraft.price}}" data-field="price" bindinput="onManualProductInput" type="digit" placeholder="参考价格" />
</view>
<text class="manual-style-hint">参考价会自动带入实际成交金额,保存前仍可按本次服务情况调整。</text>
</scroll-view>
<view class="manual-style-footer">
<button class="manual-style-confirm" bindtap="useManualProduct">用于本次补录</button>
<button class="manual-style-library-link" bindtap="openProductLibrary">从款式库中选择</button>
</view>
</view>
</view>
<product-selector-sheet visible="{{productSelectorVisible}}" mode="list" title="选择已有款式" keyword="{{productKeyword}}" placeholder="搜索款式、标签、美甲师" items="{{productOptions}}" selected-id="{{form.productId}}" loading="{{loadingProducts}}" error-text="{{productError}}" empty-text="暂无匹配款式" show-manual-action="{{true}}" bind:search="searchProducts" bind:select="selectProduct" bind:openmanual="openManualProduct" bind:close="closeProductSelector" bind:retry="loadProducts" />
<entity-selector-sheet visible="{{artistSelectorVisible}}" title="选择美甲师" keyword="{{artistKeyword}}" placeholder="搜索美甲师姓名" items="{{artistOptions}}" selected-id="{{form.artistId}}" loading="{{loadingArtists}}" error-text="{{artistError}}" empty-text="暂无可选美甲师" bind:search="searchArtists" bind:select="selectArtist" bind:retry="loadArtists" bind:close="closeArtistSelector" />
<entity-selector-sheet visible="{{customerSelectorVisible}}" title="选择客户" keyword="{{customerKeyword}}" placeholder="搜索客户姓名或手机号" items="{{customerOptions}}" selected-id="{{form.customerUserId}}" loading="{{loadingCustomers}}" error-text="{{customerError}}" empty-text="暂无客户,可留空记为散客" action-text="按散客记录" bind:search="searchCustomers" bind:select="selectCustomer" bind:retry="loadCustomers" bind:action="useWalkIn" bind:close="closeCustomerSelector" />
<view wx:if="{{manualProductSheetVisible}}" class="modal-mask manual-product-mask" bindtap="closeManualProduct" catchtouchmove="stopTouchMove">
<view class="manual-style-sheet backfill-manual-style-sheet" catchtap="stopTap" catchtouchmove="stopTouchMove">
<view class="modal-head"><view><text class="modal-title">{{form.productId ? '调整补录款式' : '录入本次美甲款式'}}</text><text class="modal-subtitle">名称或图片至少填写一项 · 可添加多张图片</text></view><view class="modal-close" bindtap="closeManualProduct" aria-label="关闭款式录入"></view></view>
<scroll-view class="manual-style-content" scroll-y enhanced show-scrollbar="{{false}}">
<view class="manual-style-name-field"><view class="manual-style-field-heading"><text>名称</text><text class="manual-style-character-count">{{manualProductTitleLength}} / 100</text></view><input class="manual-style-title-input" value="{{manualProductDraft.title}}" maxlength="100" data-field="title" bindinput="onManualProductInput" placeholder="留空时默认使用客户姓名" /></view>
<view class="manual-style-price-duration-row">
<view class="manual-style-compact-field"><text class="manual-style-field-label">实际成交金额</text><view class="manual-style-input-wrap"><input type="digit" value="{{form.amount || manualProductDraft.price}}" data-field="amount" bindinput="onInput" placeholder="例如 268" /><text>元</text></view></view>
<view class="manual-style-compact-field"><text class="manual-style-field-label">预计时长</text><view class="manual-style-input-wrap"><input type="number" value="{{manualProductDraft.durationMinutes}}" data-field="durationMinutes" bindinput="onManualProductInput" placeholder="60" /><text>分钟</text></view></view>
</view>
<view class="manual-style-images">
<view class="manual-style-image-heading"><text>款式图片</text><text class="manual-style-image-count">{{form.manualProductImages.length}} / 9</text></view>
<scroll-view class="manual-style-image-scroll" scroll-x="true" enhanced="true" show-scrollbar="false"><view class="manual-style-image-grid">
<view wx:for="{{form.manualProductImages}}" wx:key="fileId" class="manual-style-image-tile"><image src="{{item.previewUrl || item.fileUrl}}" mode="aspectFill" data-index="{{index}}" binderror="onManualProductImageError"></image><text wx:if="{{index === 0}}" class="manual-style-image-cover">封面</text><button class="manual-style-image-remove" data-index="{{index}}" disabled="{{manualImageUploading}}" catchtap="removeManualProductImage" aria-label="移除图片">×</button></view>
<button wx:if="{{form.manualProductImages.length < 9}}" class="manual-style-add-image" bindtap="chooseManualProductImage" loading="{{manualImageUploading}}" disabled="{{manualImageUploading}}"><text class="manual-style-add-icon">+</text><text>点击添加图片</text></button>
</view></scroll-view><text class="manual-style-image-tip">第一张图片会作为款式封面</text>
</view>
<view class="manual-style-description-field"><text class="manual-style-field-label">款式描述 / 补单备注(选填)</text><textarea value="{{manualProductDraft.description}}" data-field="description" bindinput="onManualProductInput" placeholder="可填写颜色、工艺、服务说明等" maxlength="500" /></view>
<view class="manual-style-more"><view class="manual-style-more-toggle" bindtap="toggleManualProductMore"><text>补充信息</text><text class="manual-style-more-arrow">{{manualProductMoreVisible ? '⌃' : '⌄'}}</text></view><view wx:if="{{manualProductMoreVisible}}" class="manual-style-more-fields"><input value="{{form.manualProductTags}}" data-field="manualProductTags" bindinput="onInput" placeholder="标签,多个用逗号分隔" /><input value="{{form.manualProductTargetAudience}}" data-field="manualProductTargetAudience" bindinput="onInput" placeholder="适合人群" /><input value="{{form.manualProductPrecautions}}" data-field="manualProductPrecautions" bindinput="onInput" placeholder="注意事项" /></view></view>
</scroll-view>
<view class="manual-style-footer"><button class="manual-style-confirm" bindtap="useManualProduct">用于本次补录</button><button class="manual-style-library-link" bindtap="openProductLibrary">从款式库中选择</button></view>
</view>
</view>
</view>
+21 -566
View File
@@ -1,428 +1,13 @@
.backfill-page {
padding-top: 24rpx;
padding-bottom: 220rpx;
background: #f3f7f4;
color: #17211f;
}
@import "../appointment-form/index.wxss";
.backfill-hero {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 18rpx;
margin: 0 0 30rpx;
}
.backfill-page { padding-bottom: 180rpx; }
.backfill-hero-copy {
display: flex;
min-width: 0;
flex-direction: column;
}
.backfill-eyebrow {
color: #247b63;
font-size: 22rpx;
font-weight: 800;
line-height: 1.3;
}
.backfill-title {
margin-top: 6rpx;
color: #17211f;
font-size: 52rpx;
font-weight: 900;
line-height: 1.15;
}
.backfill-date-pill {
display: flex;
flex: 0 0 auto;
align-items: center;
gap: 8rpx;
min-height: 58rpx;
padding: 0 16rpx;
border: 2rpx solid #e7ece9;
border-radius: 26rpx;
background: #fff;
color: #52645d;
font-size: 22rpx;
white-space: nowrap;
}
.date-pill-icon {
color: #247b63;
font-size: 25rpx;
}
.backfill-page .backfill-card {
margin-bottom: 24rpx;
padding: 28rpx 30rpx 24rpx;
border: 2rpx solid #e7ece9;
border-radius: 38rpx;
background: #fff;
box-shadow: 0 8rpx 26rpx rgba(41, 73, 62, 0.04);
}
.backfill-page .section-heading {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16rpx;
margin: 0 0 20rpx;
}
.section-title-row {
display: flex;
align-items: baseline;
}
.section-title-main,
.section-caption {
display: block;
}
.section-title-main {
color: #17211f;
font-size: 30rpx;
font-weight: 900;
}
.section-caption {
margin-top: 5rpx;
color: #71807a;
font-size: 21rpx;
line-height: 1.4;
}
.required-mark {
margin-left: 5rpx;
color: #e98669;
font-size: 24rpx;
font-weight: 800;
}
.field-card {
display: flex;
width: 100%;
min-height: 124rpx;
align-items: center;
gap: 22rpx;
padding: 20rpx 22rpx;
border: 2rpx dashed #cbdcd5;
border-radius: 30rpx;
background: #fbfdfc;
text-align: left;
line-height: 1.35;
.backfill-page .manual-style-sheet {
box-sizing: border-box;
}
button.full{
width: 100%;
box-sizing: border-box;
margin: 0; /* 清除小程序button自带左右margin */
}
.backfill-field-card {
display: flex;
width: 100%;
min-height: 124rpx;
align-items: center;
gap: 22rpx;
margin: 0;
padding: 20rpx 22rpx;
border: 2rpx dashed #cbdcd5;
border-radius: 30rpx;
background: #fbfdfc;
text-align: left;
line-height: 1.35;
}
button.full{
width: 100%;
box-sizing: border-box;
margin: 0; /* 清除小程序button自带左右margin */
}
.backfill-page .field-icon {
display: flex;
width: 76rpx;
height: 76rpx;
flex: 0 0 76rpx;
align-items: center;
justify-content: center;
border-radius: 24rpx;
background: #e5f4ed;
color: #247b63;
font-size: 34rpx;
}
.style-entry-image {
object-fit: cover;
}
.field-text {
display: flex;
min-width: 0;
flex: 1;
flex-direction: column;
}
.field-label {
width: auto;
color: #71807a;
font-size: 21rpx;
font-weight: 600;
line-height: 1.35;
}
.field-label.required::after {
content: " *";
color: #e98669;
font-weight: 900;
}
.field-value {
display: block;
min-width: 0;
flex: 0 0 auto;
margin-top: 5rpx;
overflow: hidden;
color: #17211f;
font-size: 27rpx;
font-weight: 800;
line-height: 1.35;
text-overflow: ellipsis;
white-space: nowrap;
}
.field-value.placeholder {
color: #9aa9a3;
font-weight: 600;
}
.field-meta {
display: block;
margin-top: 5rpx;
color: #71807a;
font-size: 20rpx;
line-height: 1.35;
}
.chevron {
flex: 0 0 auto;
color: #91a29a;
font-size: 40rpx;
line-height: 1;
}
.backfill-amount-field {
display: flex;
flex-direction: column;
gap: 10rpx;
margin-top: 20rpx;
}
.backfill-amount-field > .field-label {
color: #52645d;
font-size: 21rpx;
font-weight: 700;
}
.number-input-wrap {
display: flex;
height: 82rpx;
align-items: center;
gap: 8rpx;
padding: 0 18rpx;
border: 2rpx solid #dce6e1;
border-radius: 24rpx;
background: #fbfdfc;
}
.number-input-wrap input {
min-width: 0;
height: 78rpx;
flex: 1;
color: #17211f;
font-size: 25rpx;
font-weight: 700;
text-align: left;
}
.number-unit {
color: #71807a;
font-size: 20rpx;
}
.style-hint {
display: block;
padding-top: 18rpx;
color: #82928a;
font-size: 20rpx;
line-height: 1.5;
}
.service-info-section .backfill-picker-field {
margin-top: 16rpx;
}
.service-info-section .backfill-picker-field.first {
margin-top: 0;
}
.service-info-section .service-artist-field {
margin-top: 16rpx;
}
.backfill-remark-field {
margin-top: 20rpx;
}
.backfill-remark-field textarea {
box-sizing: border-box;
width: 100%;
min-height: 132rpx;
margin-top: 10rpx;
padding: 16rpx 20rpx;
border: 2rpx solid #dce6e1;
border-radius: 24rpx;
background: #fbfdfc;
color: #17211f;
font-size: 23rpx;
line-height: 1.5;
}
.status-segment {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 12rpx;
padding: 8rpx;
border-radius: 26rpx;
background: #f1f5f3;
}
.status-option {
display: flex;
min-height: 84rpx;
align-items: center;
justify-content: center;
gap: 12rpx;
border: 2rpx solid transparent;
border-radius: 20rpx;
color: #71807a;
font-size: 25rpx;
font-weight: 700;
}
.status-option.active {
border-color: #b8daca;
background: #e5f4ed;
color: #247b63;
}
.status-indicator {
width: 14rpx;
height: 14rpx;
border-radius: 50%;
background: #91a29a;
}
.status-option.active .status-indicator.in-service {
background: #d28b55;
box-shadow: 0 0 0 6rpx rgba(210, 139, 85, 0.14);
}
.status-option.active .status-indicator.completed {
background: #247b63;
box-shadow: 0 0 0 6rpx rgba(36, 123, 99, 0.14);
}
.backfill-page .customer-section {
padding-bottom: 26rpx;
}
.customer-entry {
display: flex;
align-items: stretch;
gap: 14rpx;
margin-top: 18rpx;
}
.customer-fields {
display: grid;
min-width: 0;
flex: 1;
grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
gap: 12rpx;
}
.customer-entry .customer-name-input,
.customer-entry .customer-phone-input {
box-sizing: border-box;
width: 100%;
min-width: 0;
height: 88rpx;
margin: 0;
padding: 0 16rpx;
border: 2rpx solid #dce6e1;
border-radius: 24rpx;
background: #fbfdfc;
color: #17211f;
font-size: 22rpx;
}
.customer-library-btn {
display: flex;
width: 88rpx;
min-width: 88rpx;
max-width: 88rpx;
height: 88rpx;
align-items: center;
justify-content: center;
border-radius: 24rpx;
background: #e5f4ed;
color: #247b63;
}
.customer-library-icon {
font-size: 38rpx;
line-height: 1;
}
.customer-selected-tip {
display: block;
margin-top: 12rpx;
color: #247b63;
font-size: 20rpx;
}
.backfill-bottom {
padding-top: 20rpx;
border-top: 2rpx solid #e7ece9;
background: rgba(255, 255, 255, 0.97);
box-shadow: 0 -8rpx 22rpx rgba(23, 33, 31, 0.04);
}
.backfill-page .backfill-submit-btn {
min-height: 88rpx;
border-radius: 24rpx;
background: #17211f;
color: #fff;
box-shadow: 0 10rpx 22rpx rgba(23, 33, 31, 0.16);
}
.backfill-manual-product-mask {
position: fixed;
inset: 0;
z-index: 140;
display: flex;
align-items: flex-end;
justify-content: center;
background: rgba(16, 29, 25, 0.44);
}
.backfill-manual-style-sheet {
display: flex;
width: 100%;
height: 70vh;
max-height: 82vh;
height: 88vh;
max-height: 88vh;
flex-direction: column;
overflow: hidden;
padding: 28rpx 28rpx calc(24rpx + env(safe-area-inset-bottom));
@@ -430,151 +15,21 @@ button.full{
background: #fff;
box-shadow: 0 -20rpx 48rpx rgba(24, 48, 40, 0.14);
}
.backfill-manual-style-sheet .modal-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 20rpx;
margin-bottom: 20rpx;
}
.backfill-manual-style-sheet .modal-title,
.backfill-manual-style-sheet .modal-subtitle {
display: block;
}
.backfill-manual-style-sheet .modal-title {
color: #17211f;
font-size: 34rpx;
font-weight: 900;
}
.backfill-manual-style-sheet .modal-subtitle {
margin-top: 8rpx;
color: #71807a;
font-size: 24rpx;
}
.backfill-manual-style-sheet .modal-close {
position: relative;
display: flex;
width: 48rpx;
min-width: 48rpx;
height: 48rpx;
align-items: center;
justify-content: center;
border: 1rpx solid #e7ece9;
border-radius: 50%;
background: #fff;
}
.backfill-manual-style-sheet .modal-close::before,
.backfill-manual-style-sheet .modal-close::after {
position: absolute;
width: 22rpx;
height: 3rpx;
border-radius: 999rpx;
background: #247b63;
content: "";
}
.backfill-manual-style-sheet .modal-close::before {
transform: rotate(45deg);
}
.backfill-manual-style-sheet .modal-close::after {
transform: rotate(-45deg);
}
.backfill-manual-style-sheet .manual-style-content {
height: 0;
min-height: 0;
flex: 1;
padding: 8rpx 0 20rpx;
}
.backfill-manual-fields {
display: flex;
align-items: center;
gap: 14rpx;
}
.backfill-manual-fields .style-name-input {
box-sizing: border-box;
width: 100%;
height: 82rpx;
padding: 0 18rpx;
border: 1rpx solid #dce6e1;
border-radius: 24rpx;
background: #fbfdfc;
color: #17211f;
font-size: 24rpx;
}
.backfill-manual-fields .backfill-manual-product-name {
min-width: 0;
flex: 1;
}
.backfill-manual-fields .backfill-manual-product-price {
min-width: 0;
flex: 0 0 220rpx;
}
.backfill-manual-style-sheet .manual-style-hint {
display: block;
margin-top: 18rpx;
color: #71807a;
font-size: 21rpx;
line-height: 1.5;
}
.backfill-manual-style-sheet .manual-style-footer {
flex: 0 0 auto;
padding-top: 16rpx;
border-top: 2rpx solid #e7ece9;
}
.backfill-manual-style-sheet .manual-style-confirm {
width: 100%;
height: 84rpx;
margin: 0;
border-radius: 24rpx;
background: #17211f;
color: #fff;
font-size: 26rpx;
font-weight: 800;
line-height: 84rpx;
}
.backfill-manual-style-sheet .manual-style-library-link {
height: 64rpx;
margin: 10rpx auto 0;
color: #247b63;
font-size: 22rpx;
line-height: 64rpx;
}
.backfill-page .appointment-title { max-width: 560rpx; }
.backfill-page .appointment-info-section .field-card,
.backfill-page .customer-section .customer-entry,
.backfill-page .service-status-section .status-segment { margin-top: 16rpx; }
.backfill-page .customer-fields { display: grid; min-width: 0; flex: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10rpx; }
.backfill-page .customer-entry .customer-name-input,
.backfill-page .customer-entry .customer-wechat-input,
.backfill-page .customer-entry .customer-phone-input { box-sizing: border-box; width: 100%; min-width: 0; height: 76rpx; margin: 0; padding: 0 14rpx; border: 1rpx solid #e7ece9; border-radius: 18rpx; background: #f3f7f4; color: #17211f; font-size: 21rpx; }
.backfill-page .customer-library-btn { width: 76rpx; min-width: 76rpx; height: 76rpx; border-radius: 18rpx; }
.backfill-page .service-status-section { padding-bottom: 24rpx; }
.backfill-page .submit-btn { width: 100%; }
.backfill-manual-style-sheet { height: 70vh; }
@media (max-width: 360px) {
.backfill-title {
font-size: 44rpx;
}
.backfill-date-pill {
gap: 5rpx;
padding: 0 10rpx;
font-size: 19rpx;
}
.customer-fields {
grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
gap: 8rpx;
}
.customer-entry .customer-name-input,
.customer-entry .customer-phone-input {
padding: 0 12rpx;
font-size: 20rpx;
}
.backfill-page .customer-fields { gap: 6rpx; }
.backfill-page .customer-entry .customer-name-input,
.backfill-page .customer-entry .customer-wechat-input,
.backfill-page .customer-entry .customer-phone-input { padding: 0 10rpx; font-size: 19rpx; }
}
@@ -57,5 +57,7 @@ const wxss = fs.readFileSync(path.join(__dirname, 'index.wxss'), 'utf8')
assert.match(wxml, /class="manual-style-sheet backfill-manual-style-sheet"/)
assert.match(wxml, /class="modal-close" bindtap="closeManualProduct"/)
assert.match(wxml, /bindtap="openProductLibrary">从款式库中选择<\/button>/)
assert.match(wxss, /\.backfill-manual-style-sheet\s*\{[^}]*height:\s*70vh/s)
assert.match(wxml, /manual-style-images/)
assert.match(wxml, /service-status-section/)
assert.match(wxss, /@import\s+"\.\.\/appointment-form\/index\.wxss"/)