Commit 7dbeb4b9 by 岑成威

fix: 更新版本

1 parent 20f1a2f6
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
></view> ></view>
</view> </view>
<view <view
v-if="item.type === 'single' && hasMinSellPrice(item.minSellPrice)" v-if="item.type === 'single' && hasActivityPrice(item.activityPrice)"
class="min-price" class="min-price"
>活动价 ¥ {{ item.minSellPrice }}</view> >活动价 ¥ {{ item.activityPrice }}</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -50,9 +50,9 @@ ...@@ -50,9 +50,9 @@
<view class="child-name">{{ child.name }}</view> <view class="child-name">{{ child.name }}</view>
</view> </view>
<view <view
v-if="hasMinSellPrice(child.minSellPrice)" v-if="hasActivityPrice(child.activityPrice)"
class="min-price" class="min-price"
>活动价 ¥ {{ child.minSellPrice }}</view> >活动价 ¥ {{ child.activityPrice }}</view>
</view> </view>
<view class="card-right"> <view class="card-right">
<view class="current-price">¥ {{ child.sellPrice }}</view> <view class="current-price">¥ {{ child.sellPrice }}</view>
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
} }
}, },
methods: { methods: {
hasMinSellPrice(value) { hasActivityPrice(value) {
return value != null && value !== '' return value != null && value !== ''
}, },
shouldShowMarketingIcon(item) { shouldShowMarketingIcon(item) {
......
...@@ -10,6 +10,14 @@ export function getGoodsDisplayName(goods) { ...@@ -10,6 +10,14 @@ export function getGoodsDisplayName(goods) {
return goods.goodsAlias || goods.upgradeGoodsName || goods.goodsInfo?.goodsName || goods.baseGoodsName || '' return goods.goodsAlias || goods.upgradeGoodsName || goods.goodsInfo?.goodsName || goods.baseGoodsName || ''
} }
// 活动价:商品列表返回的原始售价,加入订单时快照,不随用户改价变化
export function getGoodsActivityPrice(goods) {
if (!goods) return undefined
const price = goods.oldPrice ?? goods.upgradePrice ?? goods.price
if (price == null || price === '') return undefined
return price
}
function buildSingleApprovalItem(item, goods, number) { function buildSingleApprovalItem(item, goods, number) {
const sellPrice = normalizeGoodsPrice(goods.sellPrice) const sellPrice = normalizeGoodsPrice(goods.sellPrice)
if (!isBelowMinSellPrice(goods, sellPrice)) return null if (!isBelowMinSellPrice(goods, sellPrice)) return null
...@@ -17,7 +25,7 @@ function buildSingleApprovalItem(item, goods, number) { ...@@ -17,7 +25,7 @@ function buildSingleApprovalItem(item, goods, number) {
type: 'single', type: 'single',
name: getGoodsDisplayName(goods), name: getGoodsDisplayName(goods),
sellPrice, sellPrice,
minSellPrice: goods.minSellPrice, activityPrice: getGoodsActivityPrice(goods),
number: number || '1', number: number || '1',
sourceItem: item sourceItem: item
} }
...@@ -47,7 +55,7 @@ function buildPackageApprovalItem(item, orderTypeCode) { ...@@ -47,7 +55,7 @@ function buildPackageApprovalItem(item, orderTypeCode) {
return { return {
name: getGoodsDisplayName(goods), name: getGoodsDisplayName(goods),
sellPrice, sellPrice,
minSellPrice: goods.minSellPrice, activityPrice: getGoodsActivityPrice(goods),
number: item.packageGoods.number || '1', number: item.packageGoods.number || '1',
sourceGoods: goods sourceGoods: goods
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!