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

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