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;