|
|
@@ -1,45 +1,29 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<ul class="store-list" v-if="storeData.content && storeData.content.length > 0">
|
|
|
- <li v-for="store in storeData.content">
|
|
|
+ <li v-for="(store, index) in storeData.content">
|
|
|
<div class="store-content-left">
|
|
|
- <img :src="store.logoUrl?store.logoUrl:'/images/all/default.png'" class="storeImg" alt="">
|
|
|
+ <a :href="'/store/' + store.uuid">
|
|
|
+ <img :src="store.logoUrl?store.logoUrl:'/images/all/default.png'" class="storeImg" alt="">
|
|
|
+ </a>
|
|
|
<div class="store-detail">
|
|
|
- <span>{{store.storeName}}</span>
|
|
|
+ <a :href="'/store/' + store.uuid">{{store.storeName}}</a>
|
|
|
</div>
|
|
|
<div class="btn-content">
|
|
|
<span style="position: relative;" class="call-seller">
|
|
|
<img src="static/img/common/songguo.png?_v=1503050008623">
|
|
|
<a name="21059" href="javascript:void(0)" class="contact_btn">联系卖家</a>
|
|
|
</span>
|
|
|
- <a class="focus-store store-btn" @click="focusStore(store)">关注店铺</a>
|
|
|
+ <a class="focus-store store-btn" @click="focusStore(store, index)" v-text="focusData[index] === 'true'?'已关注':'关注店铺'"></a>
|
|
|
<a :href="'/store/' + store.uuid" class="enter-store store-btn">进入店铺</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <ul class="store-component-list">
|
|
|
- <li>
|
|
|
- <img src="/images/all/default.png" alt="">
|
|
|
- <span class="store-component-kind">asdadasdadas</span>
|
|
|
- <span class="store-component-brand">sadasdasda</span>
|
|
|
- <span class="store-component-name">sadasdada</span>
|
|
|
- </li>
|
|
|
- <li>
|
|
|
- <img src="/images/all/default.png" alt="">
|
|
|
- <span class="store-component-kind">asdadasdadas</span>
|
|
|
- <span class="store-component-brand">sadasdasda</span>
|
|
|
- <span class="store-component-name">sadasdada</span>
|
|
|
- </li>
|
|
|
- <li>
|
|
|
- <img src="/images/all/default.png" alt="">
|
|
|
- <span class="store-component-kind">asdadasdadas</span>
|
|
|
- <span class="store-component-brand">sadasdasda</span>
|
|
|
- <span class="store-component-name">sadasdada</span>
|
|
|
- </li>
|
|
|
- <li>
|
|
|
- <img src="/images/all/default.png" alt="">
|
|
|
- <span class="store-component-kind">asdadasdadas</span>
|
|
|
- <span class="store-component-brand">sadasdasda</span>
|
|
|
- <span class="store-component-name">sadasdada</span>
|
|
|
+ <ul class="store-component-list" v-if="componentData">
|
|
|
+ <li v-for="item in componentData[index].content">
|
|
|
+ <a :href="`/product/component/${item.uuid}`"><img :src="item.img?item.img:'/images/all/default.png'" alt=""></a>
|
|
|
+ <a :href="`/product/component/${item.uuid}`" class="store-component-code" v-text="item.code" :title="item.code"></a>
|
|
|
+ <a :href="`/product/brand/${item.branduuid}`" v-text="item.brandNameEn"></a>
|
|
|
+ <a :href="`/product/kind/${item.kindUuid}`" v-text="item.kindNameCn"></a>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</li>
|
|
|
@@ -69,12 +53,22 @@
|
|
|
user () {
|
|
|
return this.$store.state.option.user
|
|
|
},
|
|
|
- storeData () {
|
|
|
+ storeDetail () {
|
|
|
return this.$store.state.searchStore.searchStoreDetail.detail.data
|
|
|
+ },
|
|
|
+ storeData () {
|
|
|
+ console.log(this.storeDetail[0].stores)
|
|
|
+ return this.storeDetail[0].stores
|
|
|
+ },
|
|
|
+ focusData () {
|
|
|
+ return this.storeDetail[1].isFocus
|
|
|
+ },
|
|
|
+ componentData () {
|
|
|
+ return this.storeDetail[1].image
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- focusStore: function (store) {
|
|
|
+ focusStore: function (store, index) {
|
|
|
if (!this.user.logged) {
|
|
|
this.$http.get('/login/page').then(response => {
|
|
|
if (response.data) {
|
|
|
@@ -82,25 +76,23 @@
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
- this.$http.get('/trade/storeFocus/ifFocus', {params: {storeid: store.id}})
|
|
|
- .then(response => {
|
|
|
- if (response.data === 'true') {
|
|
|
- // 已关注
|
|
|
- this.$message.error('店铺已关注,不能重复关注')
|
|
|
- } else {
|
|
|
- // 未关注
|
|
|
- this.$http.post('/trade/storeFocus/save', {storeName: store.storeName, storeid: store.id})
|
|
|
- .then(response => {
|
|
|
- if (response.data === 'success') {
|
|
|
- // 关注成功
|
|
|
- this.dialogVisible = true
|
|
|
- } else {
|
|
|
- // 关注失败
|
|
|
- this.$message.error('关注失败')
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.focusData[index] === 'true') {
|
|
|
+ // 已关注
|
|
|
+ this.$message.error('店铺已关注,不能重复关注')
|
|
|
+ } else {
|
|
|
+ // 未关注
|
|
|
+ this.$http.post('/trade/storeFocus/save', {storeName: store.storeName, storeid: store.id})
|
|
|
+ .then(response => {
|
|
|
+ if (response.data === 'success') {
|
|
|
+ // 关注成功
|
|
|
+ this.dialogVisible = true
|
|
|
+ this.focusData[index] = 'true'
|
|
|
+ } else {
|
|
|
+ // 关注失败
|
|
|
+ this.$message.error('关注失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -109,6 +101,7 @@
|
|
|
<style scoped>
|
|
|
.store-list {
|
|
|
border-right: 1px solid;
|
|
|
+ border-left: 1px solid;
|
|
|
}
|
|
|
.store-list >li{
|
|
|
border-bottom: 1px solid;
|
|
|
@@ -121,10 +114,14 @@
|
|
|
.store-content-left >div {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
- .store-content-left >img.storeImg {
|
|
|
+ .store-content-left >a {
|
|
|
+ color: black;
|
|
|
+ }
|
|
|
+ .store-content-left >a >img.storeImg {
|
|
|
border: 1px solid;
|
|
|
width: 250px;
|
|
|
height: 200px;
|
|
|
+ margin-left: 10px;
|
|
|
}
|
|
|
.btn-content {
|
|
|
position: relative;
|
|
|
@@ -140,6 +137,12 @@
|
|
|
.store-detail {
|
|
|
margin-left: 20px;
|
|
|
}
|
|
|
+ .store-detail >a {
|
|
|
+ color: black;
|
|
|
+ }
|
|
|
+ .store-detail a:hover {
|
|
|
+ color: #f39801;
|
|
|
+ }
|
|
|
.store-detail >span{
|
|
|
font-size: 14px;
|
|
|
font-weight: 700;
|
|
|
@@ -173,7 +176,7 @@
|
|
|
|
|
|
}
|
|
|
.store-component-list {
|
|
|
- width: 639px;
|
|
|
+ width: 638px;
|
|
|
display: inline-block;
|
|
|
vertical-align: middle;
|
|
|
padding-left: 20px;
|
|
|
@@ -184,17 +187,26 @@
|
|
|
padding: 5px 15px;
|
|
|
border: 1px solid;
|
|
|
margin-left: 20px;
|
|
|
+ width: 132px;
|
|
|
+ height: 120px;
|
|
|
}
|
|
|
.store-component-list >li img {
|
|
|
width: 100px;
|
|
|
height:60px;
|
|
|
}
|
|
|
- .store-component-list >li span {
|
|
|
+ .store-component-list >li img:hover {
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ .store-component-list >li a {
|
|
|
display: block;
|
|
|
- font-size: 12px;
|
|
|
+ font-size: 10px;
|
|
|
+ color: black;
|
|
|
+ margin-top: 3px;
|
|
|
}
|
|
|
- .store-component-list .store-component-kind {
|
|
|
- font-size: 14px;
|
|
|
+ .store-component-list >li a:hover {
|
|
|
+ color: #f39801;
|
|
|
+ }
|
|
|
+ .store-component-list .store-component-code {
|
|
|
font-weight: 600;
|
|
|
}
|
|
|
.header-text {
|