Files
FreeERP.Applet/miniprogram/pages/components/search-popup/search-popup.ts
zhengw b1ecd88641 feat: 添加组件配置文件并优化页面结构
- 新增 components.d.json 文件,包含所有组件的属性配置
- 添加 card-item-plugin 组件及其相关文件(json、ts、wxml、wxss)
- 在 app.json 中添加新的生产流程管理页面路径
- 添加多个SVG图标文件用于菜单项
- 重构 popup-plugin 组件样式和关闭逻辑
- 更新 tab-bar-plugin 的激活状态逻辑
- 优化 search-popup 使用全局样式类
- 在首页添加菜单配置和页面跳转功能
- 调整组件样式细节和间距
2026-01-14 16:54:47 +08:00

80 lines
1.5 KiB
TypeScript

Component({
options: { multipleSlots: true, addGlobalClass: true },
/**
* 组件的属性列表
*/
properties: {
useFooterSlot: {
type: Boolean,
},
dataKey: {
type: String,
},
placeholder: {
type: String,
},
value: null,
hideMore: {
type: Boolean,
},
hideInput: {
type: Boolean,
},
customStyle: {
type: String,
value: "",
},
useInputSlot: {
type: Boolean,
},
},
/**
* 组件的初始数据
*/
data: {
show: false,
},
/**
* 组件的方法列表
*/
methods: {
showSearch() {
this.setData({ show: true });
this.triggerEvent("showChange", true);
},
close() {
this.setData({ show: false });
this.triggerEvent("showChange", false);
},
ok() {
this.setData({ show: false });
this.triggerEvent("showChange", false);
this.triggerEvent("ok");
},
change(e: any) {
this.triggerEvent("change", e.detail);
},
scanCode() {
const _this = this;
wx.scanCode({
onlyFromCamera: true,
scanType: ["qrCode"],
success: (res) => {
const qrcode = res.result || "";
_this.triggerEvent("change", { value: qrcode });
_this.triggerEvent("ok");
},
});
},
search() {
this.triggerEvent("ok");
},
clear() {
this.triggerEvent("change", { value: "" });
this.triggerEvent("ok");
},
},
});