From 308619fbddf0da76c6a2e2057752aa41f780f690 Mon Sep 17 00:00:00 2001 From: Yer <17633066053@163.com> Date: Thu, 13 Jul 2023 17:24:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20:sparkles:=20buyer=E7=AB=AF=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20=E5=B9=B3=E5=8F=B0/=E5=BA=97=E9=93=BA=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E6=90=9C=E7=B4=A2=EF=BC=8C=E7=AE=A1=E7=90=86=E7=AB=AF?= =?UTF-8?q?=E6=84=8F=E8=A7=81=E6=8C=89=E7=85=A7=E6=97=B6=E9=97=B4=E5=8F=8D?= =?UTF-8?q?=E9=A6=88=E6=8E=92=E5=BA=8F=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buyer/src/components/Search.vue | 28 ++++++-- buyer/yarn.lock | 73 ++++++++++++++++++++ manager/src/views/page/feedback/feedback.vue | 2 + 3 files changed, 99 insertions(+), 4 deletions(-) diff --git a/buyer/src/components/Search.vue b/buyer/src/components/Search.vue index e5843007..5e9dcfdd 100644 --- a/buyer/src/components/Search.vue +++ b/buyer/src/components/Search.vue @@ -22,7 +22,11 @@ @@ -66,9 +71,15 @@ export default { default:'' } }, + watch:{ + storeId(val){ + this.onlyStore = val ? true : false + } + }, data() { return { - searchData: '' // 搜索内容 + searchData: '', // 搜索内容 + onlyStore:false, }; }, methods: { @@ -76,6 +87,9 @@ export default { this.searchData = item; this.search(); }, + research(){ + this.onlyStore = !this.onlyStore + }, search () { // 全平台搜索商品 const url = this.$route.path; if(url == '/goodsList'){ @@ -85,7 +99,7 @@ export default { path:'/goodsList', query: { keyword: this.searchData }, } - if(this.storeId) pushData.query.storeId = this.storeId + if(this.storeId && this.onlyStore) pushData.query.storeId = this.storeId this.$router.push(pushData); @@ -106,6 +120,7 @@ export default { }, created() { this.searchData = this.$route.query.keyword + if (!this.hover) { // 首页顶部固定搜索栏不调用热词接口 // 搜索热词每5分钟请求一次 const reloadTime = storage.getItem('hotWordsReloadTime') @@ -126,6 +141,11 @@ export default { };