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
+2 -1
View File
@@ -1001,7 +1001,8 @@ export default {
return Number(order && order._status && order._status._type)
},
isCollectiveWholesalerOrder(order) {
return this.getCollectiveScenarioCode(order) === 22
// 22=集采批发,25=直购批发
return [22, 25].includes(this.getCollectiveScenarioCode(order))
},
isCollectiveCustomGiftOrder(order) {
return this.getCollectiveScenarioCode(order) === 24
+4 -2
View File
@@ -514,7 +514,8 @@ export default {
usePoints: this.usePointsCheck ? 1 : 0,
shipping_type: parseInt(this.shipping_type) + 1
}).then(res => {
this.couponList = res.data.result.couponList
// 批发商品不参与优惠券,后端返回 couponList 为 null,兜底保证结构一致
this.couponList = res.data.result.couponList || { usable: [], unusable: [] }
if (this.isLotteryOrder()) {
this.couponTitle = ''
if (this.couponId !== 0) {
@@ -556,7 +557,8 @@ export default {
_this.offlinePayStatus = data.offline_pay_status
_this.orderGroupInfo = data
_this.deduction = data.deduction
_this.couponList = data.couponList
// 批发商品不参与优惠券,后端返回 couponList 为 null,兜底保证结构一致
_this.couponList = data.couponList || { usable: [], unusable: [] }
if (_this.couponId > 0) {
_this.couponList['usable'].map((item, index) => {
if (item.id === _this.couponId) {
+21 -4
View File
@@ -67,7 +67,7 @@
</view>
<view class="introduce bold">{{ storeInfo.storeName }}</view>
<!-- :style="giftBg ? `background: url('${giftBg}') no-repeat center/cover` : ''" -->
<view v-if="storeInfo.isGiftCard === 1"
<view v-if="storeInfo.isGiftCard === 1 && !purchaseGrantUuid"
@click="toGift"
class=" v12-white-text v12-px-2 v12-py-1 v12-mt-2 v12-radius-20 v12-font-bold v12-justify-between v12-align-center gift-wrap"
:style="giftBg ? 'background: url(' + giftBg + ') no-repeat center/cover' : ''"
@@ -442,13 +442,13 @@
<button class="cus-btn" @click="goRoom"></button>
</view>
<view @click="goShoppingCart()" v-if="animated" class="item animated bounceIn">
<view @click="goShoppingCart()" v-if="animated && !purchaseGrantUuid" class="item animated bounceIn">
<view class="iconfont icon-gouwuche1">
<text class="num bg-color-lightred" v-if="CartCount > 0">{{ CartCount }}</text>
</view>
<text style="text-align: center;">购物车</text>
</view>
<view @click="goShoppingCart()" class="item animated" v-if="!animated">
<view @click="goShoppingCart()" class="item animated" v-if="!animated && !purchaseGrantUuid">
<view class="iconfont icon-gouwuche1">
<text class="num bg-color-lightred v12-primary" v-if="CartCount > 0">{{ CartCount }}</text>
</view>
@@ -468,6 +468,7 @@
style="background: transparent !important;border-radius: 0 !important;"
>
<view
v-if="!purchaseGrantUuid"
class="btn-car v12-primary-text v12-primary-border"
:class="{
'btn-car-disabled': (attr.productSelect.stock === 0 && attr.cartAttr) || storeInfo.stock === 0 || storeInfo.isNegotiable === 1
@@ -479,7 +480,8 @@
<view
class="btn-buy"
:class="{
'btn-buy-disabled': (attr.productSelect.stock === 0 && attr.cartAttr) || storeInfo.stock === 0 || storeInfo.isNegotiable === 1
'btn-buy-disabled': (attr.productSelect.stock === 0 && attr.cartAttr) || storeInfo.stock === 0 || storeInfo.isNegotiable === 1,
'btn-buy-full': !!purchaseGrantUuid
}"
@click="tapBuy"
>
@@ -610,6 +612,7 @@ export default {
productValueArr: [],
id: null,
partnerId: null,
purchaseGrantUuid: '', // 批发商品采购授权uuid,从聊天卡片带入;有值即为批发模式
activityId: 0, // v4 add
source: '', // v4 add
preInfo: {},
@@ -783,6 +786,7 @@ export default {
} else if (options.id) {
this.id = pageQuery.id || options.id || null
this.partnerId = pageQuery.partnerId || options.partnerId || null
this.purchaseGrantUuid = pageQuery.purchaseGrantUuid || options.purchaseGrantUuid || ''
this.activityId = Number(pageQuery.activityId || pageQuery.drawActivityId || 0)
this.source = pageQuery.from || ''
} else {
@@ -1147,6 +1151,10 @@ export default {
if (this.source === 'kill') {
from.seckillId = this.activityId
}
// 批发商品详情需要携带采购授权uuid才返回数据
if (this.purchaseGrantUuid) {
from.purchaseGrantUuid = this.purchaseGrantUuid
}
uni.showLoading({
title: '加载中',
mask: true
@@ -1511,6 +1519,10 @@ export default {
uniqueId: that.attr.productSelect !== undefined ?
that.attr.productSelect.unique : ""
}
// 批发商品加购/直购需要携带采购授权uuid
if (this.purchaseGrantUuid) {
q.purchaseGrantUuid = this.purchaseGrantUuid
}
// v4 新增活动ID
switch (this.source) {
case "pre":
@@ -1933,6 +1945,11 @@ export default {
color: #FFFFFF;
}
// 批发模式隐藏了加入购物车按钮,立即购买占满按钮区
.btn-buy-full {
width: 420rpx;
}
.btn-buy-disabled {
background: #9D9D9D !important;
color: #FFFFFF !important;
+4 -3
View File
@@ -882,8 +882,8 @@ export default {
goGoodsCon(item, isGiftCardReceiveBlind, isDrawOrder, scenarioCode) {
if(isGiftCardReceiveBlind) return
if(isDrawOrder) return
// 采购批发订单(集采中心)商品卡片不跳转批发商品详情页
if (Number(scenarioCode) === 22) return
// 采购批发订单(集采中心/直购批发)商品卡片不跳转批发商品详情页
if ([22, 25].includes(Number(scenarioCode))) return
if (Number(scenarioCode) === 24) return
const activityId = Number(
item.drawActivityId ||
@@ -1065,7 +1065,8 @@ export default {
return Number(order && order.scenarioCode)
},
isWholesalerOrder(order = this.orderInfo) {
return this.getOrderScenarioCode(order) === 22
// 22=集采批发,25=直购批发
return [22, 25].includes(this.getOrderScenarioCode(order))
},
isCustomGiftOrder(order = this.orderInfo) {
return this.getOrderScenarioCode(order) === 24
+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) {