|
|
@@ -37,12 +37,15 @@
|
|
|
<div class="search-hot">
|
|
|
<ul class="list-untyled">
|
|
|
<li class="item item-first">热门搜索</li>
|
|
|
- <li class="item" v-for="w in hotBrand">
|
|
|
+ <li class="item" v-for="w in hotBrand" v-if="ifFloorsHotSearchInValid">
|
|
|
<nuxt-link :to="'/product/brand/' + w.uuid" target="_blank">{{ w.nameEn }}</nuxt-link>
|
|
|
</li>
|
|
|
- <li class="item" v-for="w in hotDevice">
|
|
|
+ <li class="item" v-for="w in hotDevice" v-if="ifFloorsHotSearchInValid">
|
|
|
<nuxt-link :to="'/product/component/' + w.uuid" target="_blank">{{ w.code }}</nuxt-link>
|
|
|
</li>
|
|
|
+ <li class="item" v-if="!ifFloorsHotSearchInValid && index > 0" v-for="(w, index) in hotSearchData.items">
|
|
|
+ <a :href="w.hrefUrl" target="_blank">{{w.body}}</a>
|
|
|
+ </li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -77,6 +80,22 @@
|
|
|
this.associate.show &&
|
|
|
this.similarKeywords.data &&
|
|
|
(this.similarKeywords.data.brand || this.similarKeywords.data.component || this.similarKeywords.data.kind)
|
|
|
+ },
|
|
|
+ hotSearchData () {
|
|
|
+ let list = this.$store.state.floor.list_v3.data
|
|
|
+ let obj = {}
|
|
|
+ if (list && list.length > 0) {
|
|
|
+ obj = list.find(item => item.floorNumber === 2) || {}
|
|
|
+ }
|
|
|
+ return obj
|
|
|
+ },
|
|
|
+ ifFloorsHotSearchInValid () {
|
|
|
+ let obj = this.hotSearchData
|
|
|
+ if (obj.items && obj.items.length) {
|
|
|
+ let result = obj.items.find(item => !item.body || item.body === '') || true
|
|
|
+ return result !== true
|
|
|
+ }
|
|
|
+ return true
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -163,8 +182,6 @@
|
|
|
},
|
|
|
created () {
|
|
|
this.$store.dispatch('resetSearchKeywords')
|
|
|
- this.$store.dispatch('loadHotSearchDevice')
|
|
|
- this.$store.dispatch('loadHotSearchBrand')
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
@@ -208,7 +225,9 @@
|
|
|
margin-top:5px;
|
|
|
.item {
|
|
|
display: inline-block;
|
|
|
- width:22%;
|
|
|
+ max-width:22%;
|
|
|
+ text-align: center;
|
|
|
+ vertical-align: middle;
|
|
|
font-size: $font-size-small;
|
|
|
padding-right: $pad;
|
|
|
a{
|