Merge branch 'dev' of https://gitee.com/fengyuze178/xdd-uniapp-new into dev
This commit is contained in:
@@ -1001,7 +1001,8 @@ export default {
|
|||||||
return Number(order && order._status && order._status._type)
|
return Number(order && order._status && order._status._type)
|
||||||
},
|
},
|
||||||
isCollectiveWholesalerOrder(order) {
|
isCollectiveWholesalerOrder(order) {
|
||||||
return this.getCollectiveScenarioCode(order) === 22
|
// 22=集采批发,25=直购批发
|
||||||
|
return [22, 25].includes(this.getCollectiveScenarioCode(order))
|
||||||
},
|
},
|
||||||
isCollectiveCustomGiftOrder(order) {
|
isCollectiveCustomGiftOrder(order) {
|
||||||
return this.getCollectiveScenarioCode(order) === 24
|
return this.getCollectiveScenarioCode(order) === 24
|
||||||
|
|||||||
@@ -514,7 +514,8 @@ export default {
|
|||||||
usePoints: this.usePointsCheck ? 1 : 0,
|
usePoints: this.usePointsCheck ? 1 : 0,
|
||||||
shipping_type: parseInt(this.shipping_type) + 1
|
shipping_type: parseInt(this.shipping_type) + 1
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.couponList = res.data.result.couponList
|
// 批发商品不参与优惠券,后端返回 couponList 为 null,兜底保证结构一致
|
||||||
|
this.couponList = res.data.result.couponList || { usable: [], unusable: [] }
|
||||||
if (this.isLotteryOrder()) {
|
if (this.isLotteryOrder()) {
|
||||||
this.couponTitle = ''
|
this.couponTitle = ''
|
||||||
if (this.couponId !== 0) {
|
if (this.couponId !== 0) {
|
||||||
@@ -556,7 +557,8 @@ export default {
|
|||||||
_this.offlinePayStatus = data.offline_pay_status
|
_this.offlinePayStatus = data.offline_pay_status
|
||||||
_this.orderGroupInfo = data
|
_this.orderGroupInfo = data
|
||||||
_this.deduction = data.deduction
|
_this.deduction = data.deduction
|
||||||
_this.couponList = data.couponList
|
// 批发商品不参与优惠券,后端返回 couponList 为 null,兜底保证结构一致
|
||||||
|
_this.couponList = data.couponList || { usable: [], unusable: [] }
|
||||||
if (_this.couponId > 0) {
|
if (_this.couponId > 0) {
|
||||||
_this.couponList['usable'].map((item, index) => {
|
_this.couponList['usable'].map((item, index) => {
|
||||||
if (item.id === _this.couponId) {
|
if (item.id === _this.couponId) {
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="introduce bold">{{ storeInfo.storeName }}</view>
|
<view class="introduce bold">{{ storeInfo.storeName }}</view>
|
||||||
<!-- :style="giftBg ? `background: url('${giftBg}') no-repeat center/cover` : ''" -->
|
<!-- :style="giftBg ? `background: url('${giftBg}') no-repeat center/cover` : ''" -->
|
||||||
<view v-if="storeInfo.isGiftCard === 1"
|
<view v-if="storeInfo.isGiftCard === 1 && !purchaseGrantUuid"
|
||||||
@click="toGift"
|
@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"
|
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' : ''"
|
:style="giftBg ? 'background: url(' + giftBg + ') no-repeat center/cover' : ''"
|
||||||
@@ -442,13 +442,13 @@
|
|||||||
<button class="cus-btn" @click="goRoom"></button>
|
<button class="cus-btn" @click="goRoom"></button>
|
||||||
</view>
|
</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">
|
<view class="iconfont icon-gouwuche1">
|
||||||
<text class="num bg-color-lightred" v-if="CartCount > 0">{{ CartCount }}</text>
|
<text class="num bg-color-lightred" v-if="CartCount > 0">{{ CartCount }}</text>
|
||||||
</view>
|
</view>
|
||||||
<text style="text-align: center;">购物车</text>
|
<text style="text-align: center;">购物车</text>
|
||||||
</view>
|
</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">
|
<view class="iconfont icon-gouwuche1">
|
||||||
<text class="num bg-color-lightred v12-primary" v-if="CartCount > 0">{{ CartCount }}</text>
|
<text class="num bg-color-lightred v12-primary" v-if="CartCount > 0">{{ CartCount }}</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -468,6 +468,7 @@
|
|||||||
style="background: transparent !important;border-radius: 0 !important;"
|
style="background: transparent !important;border-radius: 0 !important;"
|
||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
|
v-if="!purchaseGrantUuid"
|
||||||
class="btn-car v12-primary-text v12-primary-border"
|
class="btn-car v12-primary-text v12-primary-border"
|
||||||
:class="{
|
:class="{
|
||||||
'btn-car-disabled': (attr.productSelect.stock === 0 && attr.cartAttr) || storeInfo.stock === 0 || storeInfo.isNegotiable === 1
|
'btn-car-disabled': (attr.productSelect.stock === 0 && attr.cartAttr) || storeInfo.stock === 0 || storeInfo.isNegotiable === 1
|
||||||
@@ -479,7 +480,8 @@
|
|||||||
<view
|
<view
|
||||||
class="btn-buy"
|
class="btn-buy"
|
||||||
:class="{
|
: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"
|
@click="tapBuy"
|
||||||
>
|
>
|
||||||
@@ -610,6 +612,7 @@ export default {
|
|||||||
productValueArr: [],
|
productValueArr: [],
|
||||||
id: null,
|
id: null,
|
||||||
partnerId: null,
|
partnerId: null,
|
||||||
|
purchaseGrantUuid: '', // 批发商品采购授权uuid,从聊天卡片带入;有值即为批发模式
|
||||||
activityId: 0, // v4 add
|
activityId: 0, // v4 add
|
||||||
source: '', // v4 add
|
source: '', // v4 add
|
||||||
preInfo: {},
|
preInfo: {},
|
||||||
@@ -783,6 +786,7 @@ export default {
|
|||||||
} else if (options.id) {
|
} else if (options.id) {
|
||||||
this.id = pageQuery.id || options.id || null
|
this.id = pageQuery.id || options.id || null
|
||||||
this.partnerId = pageQuery.partnerId || options.partnerId || null
|
this.partnerId = pageQuery.partnerId || options.partnerId || null
|
||||||
|
this.purchaseGrantUuid = pageQuery.purchaseGrantUuid || options.purchaseGrantUuid || ''
|
||||||
this.activityId = Number(pageQuery.activityId || pageQuery.drawActivityId || 0)
|
this.activityId = Number(pageQuery.activityId || pageQuery.drawActivityId || 0)
|
||||||
this.source = pageQuery.from || ''
|
this.source = pageQuery.from || ''
|
||||||
} else {
|
} else {
|
||||||
@@ -1147,6 +1151,10 @@ export default {
|
|||||||
if (this.source === 'kill') {
|
if (this.source === 'kill') {
|
||||||
from.seckillId = this.activityId
|
from.seckillId = this.activityId
|
||||||
}
|
}
|
||||||
|
// 批发商品详情需要携带采购授权uuid才返回数据
|
||||||
|
if (this.purchaseGrantUuid) {
|
||||||
|
from.purchaseGrantUuid = this.purchaseGrantUuid
|
||||||
|
}
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载中',
|
title: '加载中',
|
||||||
mask: true
|
mask: true
|
||||||
@@ -1511,6 +1519,10 @@ export default {
|
|||||||
uniqueId: that.attr.productSelect !== undefined ?
|
uniqueId: that.attr.productSelect !== undefined ?
|
||||||
that.attr.productSelect.unique : ""
|
that.attr.productSelect.unique : ""
|
||||||
}
|
}
|
||||||
|
// 批发商品加购/直购需要携带采购授权uuid
|
||||||
|
if (this.purchaseGrantUuid) {
|
||||||
|
q.purchaseGrantUuid = this.purchaseGrantUuid
|
||||||
|
}
|
||||||
// v4 新增活动ID
|
// v4 新增活动ID
|
||||||
switch (this.source) {
|
switch (this.source) {
|
||||||
case "pre":
|
case "pre":
|
||||||
@@ -1933,6 +1945,11 @@ export default {
|
|||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 批发模式隐藏了加入购物车按钮,立即购买占满按钮区
|
||||||
|
.btn-buy-full {
|
||||||
|
width: 420rpx;
|
||||||
|
}
|
||||||
|
|
||||||
.btn-buy-disabled {
|
.btn-buy-disabled {
|
||||||
background: #9D9D9D !important;
|
background: #9D9D9D !important;
|
||||||
color: #FFFFFF !important;
|
color: #FFFFFF !important;
|
||||||
|
|||||||
@@ -882,8 +882,8 @@ export default {
|
|||||||
goGoodsCon(item, isGiftCardReceiveBlind, isDrawOrder, scenarioCode) {
|
goGoodsCon(item, isGiftCardReceiveBlind, isDrawOrder, scenarioCode) {
|
||||||
if(isGiftCardReceiveBlind) return
|
if(isGiftCardReceiveBlind) return
|
||||||
if(isDrawOrder) return
|
if(isDrawOrder) return
|
||||||
// 采购批发订单(集采中心)商品卡片不跳转批发商品详情页
|
// 采购批发订单(集采中心/直购批发)商品卡片不跳转批发商品详情页
|
||||||
if (Number(scenarioCode) === 22) return
|
if ([22, 25].includes(Number(scenarioCode))) return
|
||||||
if (Number(scenarioCode) === 24) return
|
if (Number(scenarioCode) === 24) return
|
||||||
const activityId = Number(
|
const activityId = Number(
|
||||||
item.drawActivityId ||
|
item.drawActivityId ||
|
||||||
@@ -1065,7 +1065,8 @@ export default {
|
|||||||
return Number(order && order.scenarioCode)
|
return Number(order && order.scenarioCode)
|
||||||
},
|
},
|
||||||
isWholesalerOrder(order = this.orderInfo) {
|
isWholesalerOrder(order = this.orderInfo) {
|
||||||
return this.getOrderScenarioCode(order) === 22
|
// 22=集采批发,25=直购批发
|
||||||
|
return [22, 25].includes(this.getOrderScenarioCode(order))
|
||||||
},
|
},
|
||||||
isCustomGiftOrder(order = this.orderInfo) {
|
isCustomGiftOrder(order = this.orderInfo) {
|
||||||
return this.getOrderScenarioCode(order) === 24
|
return this.getOrderScenarioCode(order) === 24
|
||||||
|
|||||||
@@ -13,6 +13,27 @@
|
|||||||
<view class="msg" v-if="item.msg_type===1">
|
<view class="msg" v-if="item.msg_type===1">
|
||||||
<image class="img" :src="imgUrl(item.msg_content)" @click="preview(imgUrl(item.msg_content))"></image>
|
<image class="img" :src="imgUrl(item.msg_content)" @click="preview(imgUrl(item.msg_content))"></image>
|
||||||
</view>
|
</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>
|
||||||
</view>
|
</view>
|
||||||
@@ -155,7 +176,9 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
toGoods(item) {
|
toGoods(item) {
|
||||||
const itemJson = this.wsJson(item.msg_content)
|
const itemJson = this.wsJson(item.msg_content)
|
||||||
if(!itemJson.goodsId) {
|
// 兼容不同来源字段:自家发的是 goodsId,供应商发的是 productId
|
||||||
|
const goodsId = itemJson.goodsId || itemJson.productId
|
||||||
|
if (!goodsId) {
|
||||||
// 提示数据错误
|
// 提示数据错误
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
// title: '数据错误',
|
// title: '数据错误',
|
||||||
@@ -163,12 +186,13 @@ export default {
|
|||||||
// })
|
// })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const query = { id: goodsId }
|
||||||
|
// 批发商品采购授权uuid,详情接口和加购接口都需要
|
||||||
|
if (itemJson.uuid) query.purchaseGrantUuid = itemJson.uuid
|
||||||
this.$yrouter.push({
|
this.$yrouter.push({
|
||||||
path: '/pages/shop/GoodsCon/index',
|
path: '/pages/shop/GoodsCon/index',
|
||||||
query: {
|
query
|
||||||
id: itemJson.goodsId
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
wsJson(json) {
|
wsJson(json) {
|
||||||
|
|||||||
Reference in New Issue
Block a user