增加新功能

This commit is contained in:
hejiangming
2025-03-23 20:36:06 +08:00
parent 2ae62b59ed
commit 78270eeda0
184 changed files with 2690 additions and 1496 deletions
+35 -10
View File
@@ -35,14 +35,28 @@ const _sfc_main = {
}
],
// 搜索历史记录
form: {
keyword: null,
type: null,
categoryId: null,
//
page: 1,
pageSize: 20
},
isShowSearch: false,
searchVal: null,
poductList: [],
// 产品列表
imgSize: "min"
// big:大,min:笑
};
},
onLoad(option) {
const id = option.categoryId;
if (id && id !== 0) {
this.form.categoryId = id;
this.searchClickFun();
}
},
methods: {
jumpHome() {
common_vendor.index.switchTab({
@@ -51,24 +65,35 @@ const _sfc_main = {
},
// 删除历史
searchHistoryDelete(item) {
common_vendor.index.__f__("log", "at pages/search/search.vue:141", "item", item);
common_vendor.index.__f__("log", "at pages/search/search.vue:154", "item", item);
this.isShowSearch = false;
},
/**
* 查询产品
*/
async searchClick(item) {
this.searchVal = item.name;
this.form.keyword = item.name;
this.searchClickFun();
},
/**
* 查询产品
*/
async searchClickFun() {
const param = {
keyword: this.searchVal
const form = this.form;
const params = {
page: form.page,
pageSize: form.pageSize
};
const resp = await api_product.searchList(param);
if (form.categoryId) {
params.categoryId = form.categoryId;
}
if (form.keyword) {
params.keyword = form.keyword;
}
if (form.type) {
params.type = form.type;
}
const resp = await api_product.searchList(params);
if (resp && resp.bizcode === 100) {
this.poductList = resp.data;
}
@@ -115,7 +140,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
bgColor: "#f1f6ff00"
}),
e: common_vendor.o((...args) => $options.searchClickFun && $options.searchClickFun(...args)),
f: common_vendor.o(($event) => $data.searchVal = $event),
f: common_vendor.o(($event) => $data.form.keyword = $event),
g: common_vendor.p({
placeholder: "搜索关键字(商品、店铺、品牌)",
customStyle: {
@@ -124,10 +149,10 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
"border-radius": "20rpx !important",
"width": "590rpx"
},
modelValue: $data.searchVal
modelValue: $data.form.keyword
}),
h: !$data.searchVal
}, !$data.searchVal ? common_vendor.e({
h: !$data.poductList || $data.poductList.length === 0
}, !$data.poductList || $data.poductList.length === 0 ? common_vendor.e({
i: common_vendor.o(($event) => {
$data.isShowSearch = true;
}),