From edef6ae8f59823258ce610c9074d32e698958b51 Mon Sep 17 00:00:00 2001 From: ZZJ <10913410+zzj2100@user.noreply.gitee.com> Date: 星期四, 28 七月 2022 15:30:44 +0800 Subject: [PATCH] 本地图片适配 --- src/components/IndexHeader.vue | 70 +++++++++++++++++++++++++--------- 1 files changed, 51 insertions(+), 19 deletions(-) diff --git a/src/components/IndexHeader.vue b/src/components/IndexHeader.vue index ec0e7b0..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 > @@ -49,11 +51,12 @@ <!-- 宸茬櫥褰曟儏鍐� --> <img class="userImg" - src="/images/index/default.png" + src="/images/index/8.jpg" alt="" v-if="userInfo" @mouseenter="showUserBox" @mouseleave="hiddenUserBox" + style="border-radius: 50%" /> </div> </div> @@ -67,14 +70,14 @@ > <div class="userName">{{ userInfo.username }}</div> <ul> - <li class="money"> + <!-- <li class="money"> <div class="label">浣欓</div> <div class="content"> <span class="button">鍏呭��</span> <span class="number">锟�0</span> </div> </li> - + --> <li class="personal"> <div class="label"> <router-link to="/personalCenter">涓汉涓績</router-link> @@ -86,19 +89,19 @@ </li> <li> - <div class="label" @click="jump(1)">璁㈠崟绠$悊</div> + <div class="label" @click="jump(0)">璁㈠崟绠$悊</div> </li> - <li> + <!-- <li> <div class="label">浜у搧缁垂</div> - </li> + </li> --> - <li> + <!-- <li> <div class="label">鏈娑堟伅</div> - </li> + </li> --> <li> - <div class="label">鏈敮浠樿鍗�</div> + <div class="label" @click="jump(0, 1)">鏈敮浠樿鍗�</div> </li> <li> @@ -115,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"> @@ -134,7 +141,7 @@ {{ item }} </li> </ul> - </div> + </div> --> </div> <!-- 閬僵灞� --> @@ -164,7 +171,7 @@ return { keyWord: "", //杈撳叆妗嗗唴瀹� isShow: false, //鏄剧ず涓嬫媺妗� - hotKeyArr: ["绠楁硶", "鏅鸿兘AI", "浜戞湇鍔�", "绠$悊涓績", "瀹炴椂闊宠棰�", "鐭俊"], //鐑棬鍏抽敭璇� + hotKeyArr: ["鎵撶數璇�", "绂诲矖", "鐫″矖", "鍏ヤ镜", "绂诲矖", "瀹夊叏甯�"], //鐑棬鍏抽敭璇� historyKeyArr: ["浜戞湇鍔�", "绠楁硶", "绠$悊鏈嶅姟", "搴旂敤"], //鍘嗗彶鍏抽敭璇� isShowBox: false, //杈撳叆涓嬫媺妗� userInfo: null, //鐢ㄦ埛淇℃伅 @@ -177,6 +184,7 @@ showInputBox(toggle) { this.isShow = toggle; this.isShowBox = toggle; + this.keyWord = ""; this.$emit("showInputBox", toggle); }, @@ -213,11 +221,32 @@ }); }, - jump(id) { + jump(id, type) { + if (type) { + sessionStorage.setItem("type", type); + } this.$router.push({ path: "/personalCenter", query: { id: id, + }, + }); + }, + + search() { + this.$router.push({ + path: "/product", + query: { + keyWord: this.keyWord, + }, + }); + }, + + jumpToSearch(keyWord) { + this.$router.push({ + path: "/product", + query: { + keyWord, }, }); }, @@ -327,6 +356,9 @@ .label { color: #3d3d3d; + &:hover { + color: #0065ff; + } } } .right { @@ -440,7 +472,7 @@ top: 64px; padding: 0 20px; width: 240px; - height: 427px; + height: 327px; background-color: #fff; box-shadow: 0px 4px 12px rgba(96, 100, 106, 0.12); border-radius: 4px; @@ -452,7 +484,7 @@ } ul { - height: 300px; + height: 200px; border-top: 1px solid #e9ebee; border-bottom: 1px solid #e9ebee; -- Gitblit v1.8.0