|
|
@@ -1,44 +1,42 @@
|
|
|
<template>
|
|
|
<div class="search-list">
|
|
|
- <div class="search-item">
|
|
|
+ <div class="search-item" v-if="productList.expose > 0 || productList.brands">
|
|
|
<span :class="activeType=='store'?'active':''" @click="clickType('store')">仅看有货</span>
|
|
|
<span :class="activeType=='support'?'active':''" @click="clickType('support')">店铺自营</span>
|
|
|
</div>
|
|
|
|
|
|
- <div class="brand-list-content" v-if="!productList.brands && productList.expose">
|
|
|
+ <div class="brand-list-content" v-if="!productList.brands && productList.expose > 0 && brandList && brandList.length > 1">
|
|
|
<div class="brand-list-top">
|
|
|
<span>品牌墙</span>
|
|
|
- <span @click="onclick()">展开<i class="iconfont icon-arrow-down"></i></span>
|
|
|
+ <span @click="onclick()" v-if="brandList.length > 8">{{!isShow?'收起':'展开'}}<i :class="{'iconfont icon-arrow-down':isShow,'icon-icon-shang iconfont':!isShow}"></i></span>
|
|
|
</div>
|
|
|
- <div class="brand-list-item" :style="isShow?'max-height:2.1rem;':'min-height:2.1rem;'" >
|
|
|
- <div v-for="item in brandList">
|
|
|
- <nuxt-link to="/">
|
|
|
+ <div class="brand-list-item" >
|
|
|
+ <div v-for="item in isShow?brandList.slice(0, 8):brandList">
|
|
|
+ <nuxt-link :to="'/mobile/brand/'+item.br_uuid">
|
|
|
<img :src="item.logoUrl ||'/images/component/default.png'"/>
|
|
|
</nuxt-link>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="detail-brand-content" v-if="productList.brands">
|
|
|
+ <div class="detail-brand-content" v-if="productList.brands" @click="goBrand(list.uuid)">
|
|
|
<h4>主营产品</h4>
|
|
|
<div class="brand-list">
|
|
|
<div class="list-left">
|
|
|
- <img :src="brandDetail.logoUrl || '/images/component/default.png'" :alt="brandDetail.nameEn"/>
|
|
|
- <span>{{brandDetail.nameCn}}</span>
|
|
|
+ <img :src="list.logoUrl || '/images/component/default.png'" :alt="list.nameEn"/>
|
|
|
+ <span>{{list.nameCn}}</span>
|
|
|
</div>
|
|
|
- <p>{{brandDetail.series}}</p>
|
|
|
+ <p>{{list.series}}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="detail-brand" v-for="(item, index) in productList.components" v-if="productList.components">
|
|
|
- <nuxt-link :to="'/mobile/brand/componentDetail/'+ item.uuid">
|
|
|
- <div class="brand-item">
|
|
|
- <p>型号:<span>{{item.code}}</span></p>
|
|
|
- <p>品牌:<span>{{item.brand.nameCn}}</span></p>
|
|
|
- <p>产品描述:<span>{{item.kind.nameCn}}</span></p>
|
|
|
- <i class="iconfont icon-shoucang" :style="(item.isFocus==='true')?'color:#ff7800':'color:#333'"></i>
|
|
|
- </div>
|
|
|
- </nuxt-link>
|
|
|
+ <div class="brand-item" @click="goComponent(item.uuid)">
|
|
|
+ <p>型号:<span>{{item.code}}</span></p>
|
|
|
+ <p>品牌:<span>{{item.brand.nameCn}}</span></p>
|
|
|
+ <p>产品描述:<span>{{item.kind.nameCn}}</span></p>
|
|
|
+ <i class="iconfont icon-shoucang" :style="(item.isFocus)?'color:#ff7800':'color:#333'" @click="collect(item, $event)"></i>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<div class="none-state" v-if="!productList.expose">
|
|
|
@@ -59,34 +57,32 @@
|
|
|
sorting: {},
|
|
|
isShow: true,
|
|
|
isMove: '',
|
|
|
- isFocus: false
|
|
|
+ isFocus: false,
|
|
|
+ isClickCollect: false
|
|
|
}
|
|
|
},
|
|
|
fetch ({store, route}) {
|
|
|
return Promise.all([
|
|
|
- store.dispatch('searchData/searchForList', {count: 15, filter: {}, keyword: route.query.w, page: 1, sorting: {'GO_RESERVE': 'DESC', 'GO_SEARCH': 'DESC'}}),
|
|
|
+ store.dispatch('searchData/searchForListInMobile', {count: 15, filter: {}, keyword: route.query.w, page: 1, sorting: {'GO_RESERVE': 'DESC', 'GO_SEARCH': 'DESC'}}),
|
|
|
store.dispatch('searchData/searchForBrands', {collectList: 'goods_brand', keyword: route.query.w, paramJSON: {}})
|
|
|
])
|
|
|
},
|
|
|
computed: {
|
|
|
productList () {
|
|
|
-// const listData = this.$store.state.provider.stores.storeList.data
|
|
|
-// for (let i = 0; i < listData.components.length; i++) {
|
|
|
-// this.$http.get('/trade/storeFocus/ifFocus?storeid=' + listData.components[i].id)
|
|
|
-// .then(
|
|
|
-// function (response) {
|
|
|
-// listData.components[i].isFocus = response.data
|
|
|
-// }
|
|
|
-// )
|
|
|
-// }
|
|
|
-// return listData
|
|
|
- return this.$store.state.provider.stores.storeList.data
|
|
|
+ return this.$store.state.searchData.searchList.lists.data
|
|
|
},
|
|
|
brandList () {
|
|
|
return this.$store.state.searchData.searchBrands.brands.data
|
|
|
},
|
|
|
brandDetail () {
|
|
|
- return this.$store.state.searchData.searchDetail.detail.data
|
|
|
+ return this.$store.state.searchData.searchList.lists.data.brands
|
|
|
+ },
|
|
|
+ list () {
|
|
|
+ let list = this.$store.state.searchData.searchDetail.detail.data
|
|
|
+ if (list.application && list.application !== '') {
|
|
|
+ this.applications = list.application.split(',')
|
|
|
+ }
|
|
|
+ return list
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -102,6 +98,29 @@
|
|
|
this.activeType = 'support'
|
|
|
this.$store.dispatch('searchData/searchForList', {count: 15, filter: {'goods_store_type': ['ORIGINAL_FACTORY', 'AGENCY', 'DISTRIBUTION']}, keyword: this.$route.query.w, page: 1, sorting: {'GO_RESERVE': 'DESC', 'GO_SEARCH': 'DESC'}})
|
|
|
}
|
|
|
+ },
|
|
|
+ goBrand: function (uuid) {
|
|
|
+ this.$router.push('/mobile/brand/' + uuid)
|
|
|
+ },
|
|
|
+ collect: function (item, $event) {
|
|
|
+ this.isClickCollect = true
|
|
|
+ if (!item.isFocus) {
|
|
|
+ this.$http.post('/trade/collection/save', {componentid: item.cmpId, kind: 2})
|
|
|
+ .then(response => {
|
|
|
+ item.isFocus = true
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$http.delete('/trade/collection/' + item.cmpId).then(response => {
|
|
|
+ item.isFocus = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ goComponent: function (uuid) {
|
|
|
+ if (!this.isClickCollect) {
|
|
|
+ this.$router.push('/mobile/brand/componentDetail/' + uuid)
|
|
|
+ } else {
|
|
|
+ this.isClickCollect = false
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -246,7 +265,7 @@
|
|
|
i{
|
|
|
display:block;
|
|
|
position:absolute;
|
|
|
- top:.2rem;
|
|
|
+ top:.55rem;
|
|
|
right:.1rem;
|
|
|
font-size:.4rem;
|
|
|
color:#ff7800;
|