Commit 2278e7c4 authored by zhanglw's avatar zhanglw

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

parent 1a968448
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <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-col>
</el-row> </el-row>
<el-row style="margin-top: 6px"> <el-row style="margin-top: 6px">
...@@ -291,6 +291,13 @@ export default { ...@@ -291,6 +291,13 @@ export default {
this.$router.push({ path: `${path}` }) 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 // 点击地区top
areaTopClick(text) { areaTopClick(text) {
console.log(text) console.log(text)
......
...@@ -82,9 +82,10 @@ ...@@ -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.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"> <img v-if="item.isHot" src="@/assets/home_images/hot.png" class="stamp" title="热门" style="top: 0;left: 0">
<el-image <el-image
:src="item.imgSrc?imgSrcStart+'/img'+item.imgSrc:defaultImgProduct" class="touch"
:preview-src-list="item.imgSrcList.length?item.imgSrcList:[defaultImgProduct]" :src="item.imgSrc?imgSrcStart+'/productPic/'+item.imgSrc:defaultImgProduct"
style="width:284px;height: 284px;margin: 0 32px 4px" 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> <div slot="placeholder" class="image-slot">加载中<span class="dot">...</span></div>
</el-image> </el-image>
...@@ -99,7 +100,7 @@ ...@@ -99,7 +100,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <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-col>
</el-row> </el-row>
<el-row style="margin-top: 6px"> <el-row style="margin-top: 6px">
...@@ -161,7 +162,7 @@ export default { ...@@ -161,7 +162,7 @@ export default {
query: { query: {
keyword: '', keyword: '',
area: '', area: '',
type: '', type: '1',
subType: '', subType: '',
sort: false sort: false
}, },
...@@ -297,13 +298,15 @@ export default { ...@@ -297,13 +298,15 @@ export default {
}, },
mounted() { mounted() {
this.$nextTick(() => { 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: { methods: {
onDictReady(dict) { onDictReady(dict) {
this.areaOpts = [{ value: '', label: '全部' }, ...dict.area_province] 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]] this.subTypeOpts = [{ value: '', label: '全部' }, ...dict['product_type_' + this.query.type]]
}, },
keywordClick(item, type) { keywordClick(item, type) {
...@@ -338,6 +341,13 @@ export default { ...@@ -338,6 +341,13 @@ export default {
this.$router.push({ path: `${path}` }) 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) { pageChange(e) {
this.page = e this.page = e
this.loadData() this.loadData()
......
...@@ -85,9 +85,10 @@ ...@@ -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.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"> <img v-if="item.isHot" src="@/assets/home_images/hot.png" class="stamp" title="热门" style="top: 0;left: 0">
<el-image <el-image
:src="item.imgSrc?imgSrcStart+'/img'+item.imgSrc:defaultImgProduct" class="touch"
:preview-src-list="item.imgSrcList.length?item.imgSrcList:[defaultImgProduct]" :src="item.imgSrc?imgSrcStart+'/productPic/'+item.imgSrc:defaultImgProduct"
style="width:284px;height: 284px;margin: 0 32px 4px" 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> <div slot="placeholder" class="image-slot">加载中<span class="dot">...</span></div>
</el-image> </el-image>
...@@ -102,7 +103,7 @@ ...@@ -102,7 +103,7 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24"> <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-col>
</el-row> </el-row>
<el-row style="margin-top: 6px"> <el-row style="margin-top: 6px">
...@@ -335,6 +336,13 @@ export default { ...@@ -335,6 +336,13 @@ export default {
this.$router.push({ path: `${path}` }) 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) { moreTo(type) {
if (type === 'product') { 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