|
|
@@ -15,7 +15,7 @@
|
|
|
<!--<tr>{{$data}}</tr>-->
|
|
|
<tr style="height: 50px;">
|
|
|
<td colspan="5">
|
|
|
- <search-header :outerKeyword="keyword" @searchAction="search" :placeholder="'店铺名/品牌/物料名称/型号'"></search-header>
|
|
|
+ <search-header :storeTypes="storeTypes" :outerKeyword="keyword" :similarUrl="similarUrl" @searchAction="search" :placeholder="'店铺名/品牌/物料名称/型号'"></search-header>
|
|
|
<a @click="goStoreApply" class="btn-sure"><button class="btn btn-primary">立即入驻</button></a>
|
|
|
</td>
|
|
|
</tr>
|
|
|
@@ -80,18 +80,16 @@ export default {
|
|
|
keyword: '',
|
|
|
type: 'ORIGINAL_FACTORY',
|
|
|
field: ''
|
|
|
- }
|
|
|
+ },
|
|
|
+ similarUrl: '/search/similarKeywords/goods',
|
|
|
+ storeTypes: 'ORIGINAL_FACTORY'
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
storeType () {
|
|
|
- if (this.pageParams) {
|
|
|
- this.pageParams.page = 1
|
|
|
- }
|
|
|
return this.$route.params.type
|
|
|
},
|
|
|
stores () {
|
|
|
- console.log(this.$store.state.provider.stores.storeList.data)
|
|
|
return this.$store.state.provider.stores.storeList.data
|
|
|
},
|
|
|
user () {
|
|
|
@@ -137,15 +135,35 @@ export default {
|
|
|
// })
|
|
|
},
|
|
|
handleCurrentChange (page) {
|
|
|
- this.pageParams.type = this.storeType === 'factory' ? 'ORIGINAL_FACTORY' : 'AGENCY-DISTRIBUTION'
|
|
|
- this.pageParams.page = page
|
|
|
- this.pageParams.keyword = this.keyword === '' ? null : this.keyword
|
|
|
-
|
|
|
- this.pageCommodity(this.pageParams)
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ if (localStorage.getItem('pageChange') === 'true') {
|
|
|
+ this.pageParams.type = this.storeType === 'factory' ? 'ORIGINAL_FACTORY' : 'AGENCY-DISTRIBUTION'
|
|
|
+ this.pageParams.page = page
|
|
|
+ this.pageParams.keyword = this.keyword === '' ? null : this.keyword
|
|
|
+ this.pageCommodity(this.pageParams)
|
|
|
+ }
|
|
|
+ // })
|
|
|
},
|
|
|
goStoreDetail (store) {
|
|
|
window.open('/store/' + store.uuid)
|
|
|
}
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ '$route' (to, from) {
|
|
|
+ if (to.params.type === "factory") {
|
|
|
+ this.storeTypes = 'ORIGINAL_FACTORY'
|
|
|
+ } else if (to.params.type === "origin") {
|
|
|
+ this.storeTypes = 'AGENCY,DISTRIBUTION'
|
|
|
+ } else {
|
|
|
+ this.storeTypes = ''
|
|
|
+ }
|
|
|
+ localStorage.setItem('pageChange', 'true')
|
|
|
+ this.handleCurrentChange(1)
|
|
|
+ // if (to.fullPath)
|
|
|
+ // this.keyword = to.query.keyword
|
|
|
+ // this.displayKeyword = to.query.keyword
|
|
|
+ // this.setChangelistHander(to.query.choosetype)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|