优化:统一小程序业务引用选择交互

This commit is contained in:
2026-10-12 22:24:24 +08:00
parent fa1fed006e
commit 3b98e4746a
31 changed files with 1378 additions and 504 deletions
@@ -0,0 +1,41 @@
Component({
properties: {
visible: { type: Boolean, value: false },
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: '暂无可选内容' },
actionText: { type: String, value: '' },
showSearch: { type: Boolean, value: true }
},
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 })
},
retry() {
this.triggerEvent('retry')
},
action() {
this.triggerEvent('action')
}
}
})