From 62b483cc627b0a5f7d626d6b333a3ef7c7c1f4f4 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 25 二月 2026 18:41:01 +0800
Subject: [PATCH] 调试
---
mini-program/pages/search/search.vue | 36 ++++++++++++++++++++++++++++++------
1 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/mini-program/pages/search/search.vue b/mini-program/pages/search/search.vue
index 2700b46..6ec5f00 100644
--- a/mini-program/pages/search/search.vue
+++ b/mini-program/pages/search/search.vue
@@ -7,7 +7,7 @@
<view class="history" v-if="historyList && historyList.length > 0">
<view class="history-title">鍘嗗彶鎼滅储</view>
<view class="history-list">
- <view class="history-list-item" v-for="(item, index) in historyList" :key="index">{{item.content}}</view>
+ <view class="history-list-item" v-for="(item, index) in historyList" :key="index" @click="seleContent(item.content)">{{item.content}}</view>
</view>
</view>
<template v-if="isSearch">
@@ -54,23 +54,38 @@
page: 1,
next: true,
isSearch: false,
- historyList: []
+ historyList: [],
+ categoryId: null,
+ applicableBrandId: null
};
},
- onLoad() {
+ onLoad(option) {
+ if (option.categoryId) {
+ this.categoryId = option.categoryId
+ this.isSearch = true
+ this.getGoodsList()
+ }
+ if (option.applicableBrandId) {
+ this.applicableBrandId = option.applicableBrandId
+ this.isSearch = true
+ this.getGoodsList()
+ }
this.gethistary()
},
onReachBottom() {
this.getGoodsList()
},
methods: {
+ seleContent(val) {
+ this.goodsName = val
+ this.search()
+ },
gethistary() {
if (!this.userInfo) return
this.$u.api.searchHistoryList({
memberId: this.userInfo.id
}).then(res => {
if (res.code === 200) {
- console.log(res)
this.historyList = res.data
}
})
@@ -92,10 +107,14 @@
model: {
type: 0,
sortInfo: 3,
- goodsName: this.goodsName
+ goodsName: this.goodsName,
+ memberId: this.userInfo.id,
+ categoryId: this.categoryId,
+ applicableBrandId: this.applicableBrandId
}
}).then(res => {
if (res.code === 200) {
+ this.gethistary()
res.data.records.forEach(item => {
item.minPrice = item.minPrice.toFixed(2).split('.')
})
@@ -111,6 +130,11 @@
}
</script>
+<style>
+ page {
+ background-color: #F9F9FB;
+ }
+</style>
<style lang="scss" scoped>
.box {
width: 100%;
@@ -152,7 +176,7 @@
margin-right: 24rpx;
margin-bottom: 24rpx;
&:last-child {
- margin: 0 !important;
+ margin-right: 0 !important;
}
}
}
--
Gitblit v1.9.3