Files
JayuCloud/JC-Salon-WeChat/components/product-selector-sheet/index.js
T
xiaowang 261723bc6e
发布 Nacos 配置 / publish (push) Successful in 30s
环境分支晋级检查 / environment-promotion-source (pull_request_target) Successful in 1s
功能:优化Salon作品选择与历史补单
2026-10-14 00:47:10 +08:00

39 lines
1.6 KiB
JavaScript

Component({
properties: {
visible: { type: Boolean, value: false },
mode: { type: String, value: 'list' },
title: { type: String, value: '选择作品' },
keyword: { type: String, value: '' },
placeholder: { type: String, value: '搜索作品名称' },
items: { type: Array, value: [] },
selectedId: { type: null, value: '' },
loading: { type: Boolean, value: false },
errorText: { type: String, value: '' },
emptyText: { type: String, value: '暂无作品' },
manualForm: { type: Object, value: {} },
manualMoreExpanded: { type: Boolean, value: false },
showManualExtra: { type: Boolean, value: true },
manualImageUrl: { type: String, value: '' },
manualImageUploading: { type: Boolean, value: false }
},
methods: {
close() { this.triggerEvent('close') },
stopEvent() {},
onSearch(event) { this.triggerEvent('search', { value: event.detail.value }) },
selectItem(event) {
const item = this.data.items[Number(event.currentTarget.dataset.index)]
if (item) this.triggerEvent('select', { item })
},
openManual() { this.triggerEvent('openmanual') },
backToList() { this.triggerEvent('backtolist') },
onManualInput(event) {
this.triggerEvent('manualinput', { field: event.currentTarget.dataset.field, value: event.detail.value })
},
toggleMore() { this.triggerEvent('togglemore') },
chooseImage() { this.triggerEvent('chooseimage') },
removeImage() { this.triggerEvent('removeimage') },
confirmManual() { this.triggerEvent('confirmmanual') },
retry() { this.triggerEvent('retry') }
}
})