Feat:供应商发送商品链接至商城用户

This commit is contained in:
linxi
2026-09-20 11:56:39 +08:00
parent c8119933af
commit 64ea2d7332
5 changed files with 60 additions and 15 deletions
+29 -5
View File
@@ -13,6 +13,27 @@
<view class="msg" v-if="item.msg_type===1">
<image class="img" :src="imgUrl(item.msg_content)" @click="preview(imgUrl(item.msg_content))"></image>
</view>
<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>
<view class="conent v12-ml-3 v12-justify-between v12-flex-column">
<view class="">
<view class="goodsName one-t v12-font-26">
{{ wsJson(item.msg_content).goodsName }}
</view>
<view class="goodsSku v12-secondary-dark-text v12-font-22 v12-font-weight-400 one-t">
{{ wsJson(item.msg_content).skuStr }}
</view>
</view>
<view class="price v12-primary-text v12-font-24" v-if="wsJson(item.msg_content).isNegotiable !== 1">
{{ wsJson(item.msg_content).price }}
</view>
<view class="price v12-primary-text v12-font-24" v-else>
价格面议
</view>
</view>
</view>
</view>
</view>
@@ -155,7 +176,9 @@ export default {
methods: {
toGoods(item) {
const itemJson = this.wsJson(item.msg_content)
if(!itemJson.goodsId) {
// 兼容不同来源字段:自家发的是 goodsId,供应商发的是 productId
const goodsId = itemJson.goodsId || itemJson.productId
if (!goodsId) {
// 提示数据错误
// uni.showToast({
// title: '数据错误',
@@ -163,12 +186,13 @@ export default {
// })
return
}
const query = { id: goodsId }
// 批发商品采购授权uuid,详情接口和加购接口都需要
if (itemJson.uuid) query.purchaseGrantUuid = itemJson.uuid
this.$yrouter.push({
path: '/pages/shop/GoodsCon/index',
query: {
id: itemJson.goodsId
}
query
})
},
wsJson(json) {