Commit f3db6a2e authored by 786817560's avatar 786817560

Merge branch 'ren' into develop

parents 71a990b2 43596535
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Descrip: 产品明细 * @Descrip: 产品明细
* @Author: your name * @Author: your name
* @Date: 2019-10-15 14:30:00 * @Date: 2019-10-15 14:30:00
* @LastEditTime: 2019-10-18 15:35:42 * @LastEditTime: 2019-10-21 15:56:00
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
--> -->
<template> <template>
...@@ -118,14 +118,20 @@ export default { ...@@ -118,14 +118,20 @@ export default {
bgc_flag: true, bgc_flag: true,
collect_flag: false, collect_flag: false,
src: require('@/assets/productQuery/collect.png'), src: require('@/assets/productQuery/collect.png'),
// collect_status: window.sessionStorage.getItem('collect_status'),
} }
}, },
computed: {}, computed: {},
watch: {}, watch: {
},
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
if (from.name === 'ProductList') { if (from.name === 'ProductList') {
next(vm => { next(vm => {
vm.product_id = vm.$route.params.product_id vm.product_id = vm.$route.params.product_id
// vm.collect_status = vm.$route.params.collect_status
// if (vm.$route.params.collect_status === 'Y') {
// vm.src = require('@/assets/productQuery/coll-success.png')
// }
vm.baseMsg() vm.baseMsg()
vm.detailMsg() vm.detailMsg()
vm.confgMsg() vm.confgMsg()
...@@ -134,7 +140,10 @@ export default { ...@@ -134,7 +140,10 @@ export default {
next() next()
}, },
created () { created () {
console.log('collect........', window.sessionStorage.getItem('collect_status'))
if (window.sessionStorage.getItem('collect_status') === 'Y') {
this.src = require('@/assets/productQuery/coll-success.png')
}
}, },
methods: methods:
{ {
...@@ -144,27 +153,32 @@ export default { ...@@ -144,27 +153,32 @@ export default {
}, },
// 收藏 // 收藏
collect () { collect () {
this.collect_flag = true console.log('collect', window.sessionStorage.getItem('collect_status'))
console.log(this.collect_flag) if (window.sessionStorage.getItem('collect_status') === 'Y') {
let vm = this hlsPopup.showLongCenter('该产品已收藏过,请勿重复收藏')
let url = $config.basePath + 'save_collection' } else {
let param = { this.collect_flag = true
master: { console.log(this.collect_flag)
product_id: vm.product_id, let vm = this
user_phone: window.localStorage.user_phone, let url = $config.basePath + 'save_collection'
}, let param = {
} master: {
vm.$post(url, param).then(function (res) { product_id: vm.product_id,
console.log('收藏', res) user_phone: window.localStorage.user_phone,
if (res.result === 'S') { },
vm.src = require('@/assets/productQuery/coll-success.png')
setTimeout(() => {
vm.collect_flag = false
}, 1500)
} else {
hlsPopup.showLongCenter(res.message)
} }
}) vm.$post(url, param).then(function (res) {
console.log('收藏', res)
if (res.result === 'S') {
vm.src = require('@/assets/productQuery/coll-success.png')
setTimeout(() => {
vm.collect_flag = false
}, 1500)
} else {
hlsPopup.showLongCenter(res.message)
}
})
}
}, },
// 基本信息查询 // 基本信息查询
baseMsg () { baseMsg () {
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</div> </div>
</div> </div>
<div slot="right-icon"> <div slot="right-icon">
<img class="arrow" src="@/assets/productQuery/getIn.png" alt="" @click="goDetailed(item.product_id)"> <img class="arrow" src="@/assets/productQuery/getIn.png" alt="" @click="goDetailed(item.product_id,item.collect_status)">
</div> </div>
</item> </item>
</list-item> </list-item>
...@@ -82,11 +82,13 @@ export default { ...@@ -82,11 +82,13 @@ export default {
}) })
}, },
// val:产品id // val:产品id
goDetailed (val) { goDetailed (val, status) {
window.sessionStorage.setItem('collect_status', status)
this.$router.push({ this.$router.push({
name: 'ProDetailed', name: 'ProDetailed',
params: { params: {
product_id: val, product_id: val,
// collect_status: status,
}, },
}) })
}, },
......
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