新增运行时 openPage/takePageQuery,tabBar 页自动使用 switchTab 并传递参数 - 编译器写入 tabPages,并拒绝 navigateTo/redirectTo 到 tabBar 页或 switchTab 带参数 - 阿成首页、套餐、出摊、主理人、详情、记录、成功页跳转统一改用 openPage - 套餐筛选改用后台业务提供项分类;详情跳咨询时携带业务提供项 - 移除 capability-booking:小程序无入口且依赖已删除的 /public/brand,需求由咨询表单覆盖"
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
Component({
|
|
properties: {
|
|
brand: { type: Object, value: {} },
|
|
presentation: { type: Object, value: {} },
|
|
offerings: { type: Array, value: [] },
|
|
categories: { type: Array, value: [] },
|
|
category: { type: String, value: "all" },
|
|
},
|
|
data: { query: "", visibleOfferings: [] },
|
|
observers: {
|
|
"offerings, query"(offerings, query) {
|
|
const keyword = String(query || "")
|
|
.trim()
|
|
.toLowerCase();
|
|
this.setData({
|
|
visibleOfferings: (offerings || []).filter((item) => {
|
|
if (!keyword) return true;
|
|
return [item.name, item.desc, ...(item.keywords || [])].some((value) =>
|
|
String(value || "")
|
|
.toLowerCase()
|
|
.includes(keyword),
|
|
);
|
|
}),
|
|
});
|
|
},
|
|
},
|
|
methods: {
|
|
search(e) {
|
|
this.setData({ query: e.detail.value });
|
|
},
|
|
chooseCategory(e) {
|
|
this.triggerEvent("category", { key: e.currentTarget.dataset.key });
|
|
},
|
|
open(e) {
|
|
this.triggerEvent("open", { id: e.currentTarget.dataset.id });
|
|
},
|
|
inquire() {
|
|
this.triggerEvent("inquire");
|
|
},
|
|
},
|
|
});
|