Commit 2278e7c4 authored by zhanglw's avatar zhanglw

产品卡片可以直接跳转到供应商

parent 1a968448
......@@ -58,7 +58,7 @@
</el-row>
<el-row>
<el-col :span="24">
<div class="subTitle" :title="item.subTitle">{{ item.subTitle }}</div>
<div class="subTitle touch" :title="item.subTitle" @click="goToDetailsSupplier(item, '/supplier/details')">{{ item.subTitle }}</div>
</el-col>
</el-row>
<el-row style="margin-top: 6px">
......@@ -291,6 +291,13 @@ export default {
this.$router.push({ path: `${path}` })
}
},
goToDetailsSupplier(item, path) {
if (item) {
this.$router.push({ path: `${path}/${item.customerId || 123}` })
} else {
this.$router.push({ path: `${path}` })
}
},
// 点击地区top
areaTopClick(text) {
console.log(text)
......
......@@ -82,9 +82,10 @@
<img v-if="item.isGood" src="@/assets/home_images/recommend.png" class="stamp" title="推荐" style="top: 10px;right: 8px">
<img v-if="item.isHot" src="@/assets/home_images/hot.png" class="stamp" title="热门" style="top: 0;left: 0">
<el-image
:src="item.imgSrc?imgSrcStart+'/img'+item.imgSrc:defaultImgProduct"
:preview-src-list="item.imgSrcList.length?item.imgSrcList:[defaultImgProduct]"
class="touch"
:src="item.imgSrc?imgSrcStart+'/productPic/'+item.imgSrc:defaultImgProduct"
style="width:284px;height: 284px;margin: 0 32px 4px"
@click="goToDetails(item, '/product/details')"
>
<div slot="placeholder" class="image-slot">加载中<span class="dot">...</span></div>
</el-image>
......@@ -99,7 +100,7 @@
</el-row>
<el-row>
<el-col :span="24">
<div class="subTitle" :title="item.subTitle">{{ item.subTitle }}</div>
<div class="subTitle touch" :title="item.subTitle" @click="goToDetailsSupplier(item, '/supplier/details')">{{ item.subTitle }}</div>
</el-col>
</el-row>
<el-row style="margin-top: 6px">
......@@ -161,7 +162,7 @@ export default {
query: {
keyword: '',
area: '',
type: '',
type: '1',
subType: '',
sort: false
},
......@@ -297,13 +298,15 @@ export default {
},
mounted() {
this.$nextTick(() => {
this.query = Object.assign(this.query, this.$route.params)
if (this.$route.params) {
this.query = Object.assign(this.query, this.$route.params)
}
})
},
methods: {
onDictReady(dict) {
this.areaOpts = [{ value: '', label: '全部' }, ...dict.area_province]
this.title = dict.product_type[this.$route.params.type - 1].label
this.title = dict.product_type[this.query.type - 1].label
this.subTypeOpts = [{ value: '', label: '全部' }, ...dict['product_type_' + this.query.type]]
},
keywordClick(item, type) {
......@@ -338,6 +341,13 @@ export default {
this.$router.push({ path: `${path}` })
}
},
goToDetailsSupplier(item, path) {
if (item) {
this.$router.push({ path: `${path}/${item.customerId || 123}` })
} else {
this.$router.push({ path: `${path}` })
}
},
pageChange(e) {
this.page = e
this.loadData()
......
......@@ -85,9 +85,10 @@
<img v-if="item.isGood" src="@/assets/home_images/recommend.png" class="stamp" title="推荐" style="top: 10px;right: 8px">
<img v-if="item.isHot" src="@/assets/home_images/hot.png" class="stamp" title="热门" style="top: 0;left: 0">
<el-image
:src="item.imgSrc?imgSrcStart+'/img'+item.imgSrc:defaultImgProduct"
:preview-src-list="item.imgSrcList.length?item.imgSrcList:[defaultImgProduct]"
class="touch"
:src="item.imgSrc?imgSrcStart+'/productPic/'+item.imgSrc:defaultImgProduct"
style="width:284px;height: 284px;margin: 0 32px 4px"
@click="goToDetails(item, '/product/details')"
>
<div slot="placeholder" class="image-slot">加载中<span class="dot">...</span></div>
</el-image>
......@@ -102,7 +103,7 @@
</el-row>
<el-row>
<el-col :span="24">
<div class="subTitle" :title="item.subTitle">{{ item.subTitle }}</div>
<div class="subTitle touch" :title="item.subTitle" @click="goToDetailsSupplier(item, '/supplier/details')">{{ item.subTitle }}</div>
</el-col>
</el-row>
<el-row style="margin-top: 6px">
......@@ -335,6 +336,13 @@ export default {
this.$router.push({ path: `${path}` })
}
},
goToDetailsSupplier(item, path) {
if (item) {
this.$router.push({ path: `${path}/${item.customerId || 123}` })
} else {
this.$router.push({ path: `${path}` })
}
},
// 点击更多
moreTo(type) {
if (type === 'product') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment