Fix:3119 【商城小程序】用户点击商品卡片不会跳转到对应的商品详情页
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
<view class="msg" v-if="item.msg_type===1">
|
||||
<image class="img" :src="item.msg_content" @click="preview(item.msg_content)"></image>
|
||||
</view>
|
||||
<view class="msg v12-d-flex" style="box-sizing: content-box" v-if="item.msg_type===2">
|
||||
<view class="msg v12-d-flex" style="box-sizing: content-box" v-if="item.msg_type===2" @click="toGoods(item)">
|
||||
<view class="goods-logo">
|
||||
<image class="img v12-radius-8" :src="wsJson(item.msg_content).cover"></image>
|
||||
</view>
|
||||
@@ -126,14 +126,35 @@ export default {
|
||||
this.token = uni.getStorageSync("login_status");
|
||||
this.userInfo = uni.getStorageSync("userInfo");
|
||||
this.uid = this.userInfo.uid
|
||||
this.content = uni.getStorageSync(this.merName+this.uid+this.storeId)
|
||||
this.connectSocketInit()
|
||||
},
|
||||
onUnload() {
|
||||
if (this.socketOpen) {
|
||||
this.socketTask.close();
|
||||
}
|
||||
uni.setStorageSync(this.merName+this.uid+this.storeId, this.content)
|
||||
},
|
||||
methods: {
|
||||
toGoods(item) {
|
||||
console.log(item);
|
||||
const itemJson = JSON.parse(item.msg_content)
|
||||
if(!itemJson.goodsId) {
|
||||
// 提示数据错误
|
||||
// uni.showToast({
|
||||
// title: '数据错误',
|
||||
// icon: 'none'
|
||||
// })
|
||||
return
|
||||
}
|
||||
|
||||
this.$yrouter.push({
|
||||
path: '/pages/shop/GoodsCon/index',
|
||||
query: {
|
||||
id: itemJson.goodsId
|
||||
}
|
||||
})
|
||||
},
|
||||
wsJson(json) {
|
||||
return JSON.parse(json)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user