代客下单修改是否售尽判断

This commit is contained in:
YeMingfei666 2024-08-26 09:51:03 +08:00
parent f2c73eca9a
commit 5e14f29ecb
1 changed files with 31 additions and 30 deletions

View File

@ -504,10 +504,7 @@
<template v-if="layout.sel === 'img-and-text'">
<div
class="sell-out-svg"
v-if="
item.isPauseSale ||
(item.typeEnum !== 'sku' && item.stockNumber <= 0)
"
v-if="isSellOut(item)"
>
<svg
t="1724234807994"
@ -552,10 +549,7 @@
<template v-if="layout.sel === 'text'">
<div class="text-sell-out flex">
<svg
v-if="
item.isPauseSale ||
(item.typeEnum !== 'sku' && item.stockNumber <= 0)
"
v-if="isSellOut(item)"
t="1724236049267"
class="icon"
viewBox="0 0 1024 1024"
@ -591,13 +585,7 @@
<div class="stockNumber"></div>
<div class="">{{ item.lowPrice }}</div>
<template v-if="layout.sel === 'default'">
<div
class="flex"
v-if="
item.isPauseSale ||
(item.typeEnum !== 'sku' && item.stockNumber <= 0)
"
>
<div class="flex" v-if="isSellOut(item)">
<div class="timeSale">售罄</div>
</div>
</template>
@ -1428,10 +1416,17 @@ export default {
},
},
mounted() {
this.getGoods();
this.getCategory();
// this.getGoods();
// this.getCategory();
},
methods: {
//
isSellOut(item) {
return (
item.isPauseSale ||
(item.typeEnum !== "sku" && item.specList[0].stockNumber <= 0)
);
},
toggleFullScreen() {
if (!document.fullscreenElement) {
this.enterFullScreen();
@ -1729,17 +1724,22 @@ export default {
const order = this.prveOrder.list[sel];
const orderMasterId = order.carList[0].masterId;
//
const nowOrderIsPrverOrder =this.isPrverOrder && orderMasterId === this.masterId
const nowOrderIsPrverOrder =
this.isPrverOrder && orderMasterId === this.masterId;
if (nowOrderIsPrverOrder) {
const res= await this.$confirm("您正在删除当前购物车订单,是否删除?", "提示", {
const res = await this.$confirm(
"您正在删除当前购物车订单,是否删除?",
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).catch(err=>{
console.log(err)
})
}
).catch((err) => {
console.log(err);
});
if (!res) {
return
return;
}
}
if (isRequest) {
@ -1747,8 +1747,8 @@ export default {
orderId: order.orderId,
});
if (nowOrderIsPrverOrder) {
this.note.content=''
this.order.list=[]
this.note.content = "";
this.order.list = [];
}
this.$notify({
message: "删除成功",
@ -2376,6 +2376,7 @@ export default {
this.masterId = res.masterId;
this.getCart();
this.getGoods();
this.getCategory();
// this.getPrveCart();
this.getCacheOrder();
},