霸王餐更改

This commit is contained in:
wwz
2025-03-25 21:58:59 +08:00
parent 1169e300df
commit 3a6fa55234
14 changed files with 130 additions and 100 deletions

View File

@@ -55,7 +55,7 @@
:class="shopInfo.isVip == 0 || shopInfo.isMemberPrice==0?'lineThrough':''">¥</text>
<!-- 会员价与价格 -->
<text
class="price">{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?item.memberPrice:item.salePrice}}</text>
class="price">{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?(item.memberPrice||item.salePrice):item.salePrice}}</text>
<!-- 原价 -->
<!-- <text class="originalprice" v-if="item.originPrice">¥{{item.originPrice}}</text> -->
<!-- 单位 -->
@@ -77,7 +77,7 @@
:class="shopInfo.isVip ==0 || shopInfo.isMemberPrice==0?'lineThrough':''">¥</text>
<!-- 会员价与价格 -->
<text
class="price">{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?item.memberPrice:item.salePrice}}</text>
class="price">{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?(item.memberPrice|| item.salePrice):item.salePrice}}</text>
<!-- 原价 -->
<!-- <text class="originalprice" v-if="item.originPrice">¥{{item.originPrice}}</text> -->
<!-- 单位 -->
@@ -164,7 +164,7 @@
<view class="money">
<view></view>
<text class="money_num" style="margin-right: 10rpx;">
{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?item1.memberPrice:item1.salePrice}}
{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1 ?(item1.memberPrice||item1.salePrice):item1.salePrice}}
</text>
<text v-if="item1.unitName">/{{item1.unitName}}</text>
</view>
@@ -179,7 +179,7 @@
<view class="money">
<view></view>
<text class="money_num" style="margin-right: 10rpx;">
{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?item1.memberPrice:item1.salePrice}}
{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?(item1.memberPrice||item1.salePrice):item1.salePrice}}
</text>
<text v-if="item1.unitName">/{{item1.unitName}}</text>
</view>
@@ -284,6 +284,10 @@
v-if="specifications.item.result&& specifications.item.result.isPauseSale== 1 && selectedSpecs[specType] === option">
<view>售罄</view>
</view>
<view class="shop_sku_box_item_tip"
v-if="specifications.item.result == 'kong' && canSubmit == false && selectedSpecs[specType] === option">
<view>已下架</view>
</view>
</view>
</view>
</view>
@@ -315,7 +319,7 @@
<view class="price">
<text class="i"></text>
<text
class="num">{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?specifications.item.memberPrice:specifications.item.salePrice}}</text>
class="num">{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1? (specifications.item.memberPrice||specifications.item.salePrice):specifications.item.salePrice}}</text>
<text class="i">/{{specifications.item.unitName}}</text>
</view>
<view class="operation-wrap">
@@ -635,16 +639,23 @@
specInfo: selectedSpecsStr.value,
id: specifications.item.id
});
specifications.sku_id = result.id
specifications.product_id = result.productId
// 添加多规格分组
specifications.item.result = result
console.log(specifications.item)
if (result.isPauseSale == 0) {
canSubmit.value = true;
console.log(result)
if (result != true) {
specifications.sku_id = result.id
specifications.product_id = result.productId
// 添加多规格分组
specifications.item.result = result
console.log(specifications.item)
if (result.isPauseSale == 0) {
canSubmit.value = true;
} else {
canSubmit.value = false;
}
} else {
specifications.item.result = 'kong'
canSubmit.value = false;
}
} else {
canSubmit.value = false;
}
@@ -1152,10 +1163,11 @@
// 是否启用会员价 0否1是
if (shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1) {
// memberPrice会员价
return total + parseFloat(item.memberPrice) * parseFloat(item.cartNumber);
return total + parseFloat(item.memberPrice || item.salePrice) * parseFloat(item
.cartNumber);
} else {
// salePrice销售价
return total + parseFloat(item.salePrice) * parseFloat(item.cartNumber);
return total + parseFloat(item.salePrice || 0) * parseFloat(item.cartNumber);
}
}, 0);
// 向上取整并保留两位小数