From b35ae89a354d29643af99cc150812241b940352d Mon Sep 17 00:00:00 2001 From: ZZJ <10913410+zzj2100@user.noreply.gitee.com> Date: 星期五, 15 七月 2022 14:44:46 +0800 Subject: [PATCH] bugxiufu --- src/components/IndexHeader.vue | 39 ++++++++++++++++++++++++++++++++------- 1 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/components/IndexHeader.vue b/src/components/IndexHeader.vue index 3602825..f1dfd76 100644 --- a/src/components/IndexHeader.vue +++ b/src/components/IndexHeader.vue @@ -8,7 +8,7 @@ </router-link> <div class="title" @click="$router.push('/')">宸ヤ笟浜掕仈缃戝钩鍙�</div> <div class="label" @click="$router.push('/')">棣栭〉</div> - <div class="label">浜戞湇鍔�</div> + <!-- <div class="label">浜戞湇鍔�</div> --> <div class="label" @click="$router.push('/manageCenter')">绠$悊涓績</div> <div class="label" @click="$router.push('/product')">搴旂敤鍟嗗煄</div> </div> @@ -23,7 +23,9 @@ > <div class="iconList" slot="suffix"> <i class="search iconfont" v-if="!isShow"></i> - <i class="search iconfont" v-if="isShow"></i> + <i class="search iconfont" @click="search" v-if="isShow" + ></i + > <i class="del iconfont" v-if="isShow" @click="showInputBox(false)" ></i > @@ -116,14 +118,18 @@ <div class="hotKey"> <div class="title">鐑棬鎼滅储</div> <ul class="keyCard"> - <li class="keyItem" v-for="(item, index) in hotKeyArr" :key="index"> + <li + class="keyItem" + @click="jumpToSearch(item)" + v-for="(item, index) in hotKeyArr" + :key="index" + > {{ item }} </li> - x </ul> </div> - <div class="historyKey"> + <!-- <div class="historyKey"> <div class="title colorLight">鍘嗗彶鎼滅储</div> <ul class="keyCard"> @@ -135,7 +141,7 @@ {{ item }} </li> </ul> - </div> + </div> --> </div> <!-- 閬僵灞� --> @@ -165,7 +171,7 @@ return { keyWord: "", //杈撳叆妗嗗唴瀹� isShow: false, //鏄剧ず涓嬫媺妗� - hotKeyArr: ["绠楁硶", "鏅鸿兘AI", "浜戞湇鍔�", "绠$悊涓績", "瀹炴椂闊宠棰�", "鐭俊"], //鐑棬鍏抽敭璇� + hotKeyArr: ["鎵撶數璇�", "绂诲矖", "鐫″矖", "鍏ヤ镜", "绂诲矖", "瀹夊叏甯�"], //鐑棬鍏抽敭璇� historyKeyArr: ["浜戞湇鍔�", "绠楁硶", "绠$悊鏈嶅姟", "搴旂敤"], //鍘嗗彶鍏抽敭璇� isShowBox: false, //杈撳叆涓嬫媺妗� userInfo: null, //鐢ㄦ埛淇℃伅 @@ -178,6 +184,7 @@ showInputBox(toggle) { this.isShow = toggle; this.isShowBox = toggle; + this.keyWord = ""; this.$emit("showInputBox", toggle); }, @@ -225,6 +232,24 @@ }, }); }, + + search() { + this.$router.push({ + path: "/product", + query: { + keyWord: this.keyWord, + }, + }); + }, + + jumpToSearch(keyWord) { + this.$router.push({ + path: "/product", + query: { + keyWord, + }, + }); + }, }, }; </script> -- Gitblit v1.8.0