This commit is contained in:
2024-11-28 18:27:31 +08:00
2 changed files with 38 additions and 3 deletions

View File

@@ -18,6 +18,12 @@
>
<span>{{ item.name }}</span>
</div>
<div
class="isSeatFee img u-line-1 u-flex u-col-center u-row-center"
v-else-if="!item.productId"
>
<span> 临时菜 </span>
</div>
<img v-else :src="item.coverImg" class="" alt="" />
</div>
<div class="good-info u-p-t-6">

View File

@@ -1069,7 +1069,9 @@
:disabledPayType="disabledPayType"
>
</pay-type>
<el-button @click="guazhangShow" size="medium">挂账</el-button>
<el-button
:disabled="disabledPayType.includes('creditBuyer')"
@click="guazhangShow" size="medium">挂账</el-button>
<div style="margin-top: 20px">
<el-button type="primary" size="medium" @click="payOrder">
<span>立即支付</span>
@@ -2105,7 +2107,7 @@ export default {
watch: {
yinFuJinE: function (newval) {
if (newval <= 0) {
this.disabledPayType = ["scanCode", "deposit"];
this.disabledPayType = ["scanCode", "deposit","creditBuyer"];
} else {
this.disabledPayType = [];
}
@@ -3882,7 +3884,8 @@ export default {
//设置购物车数据
setCart(res) {
console.log(res);
const { seatFee } = res;
try {
const { seatFee } = res;
this.order.seatFee = seatFee
? {
...seatFee,
@@ -3901,6 +3904,32 @@ export default {
this.order.old.list = oldCart ? oldCart : [];
// this.order.gift.list = returnGiftArr(res.records);
console.log(this.order.old.list);
} catch (error) {
//当购物车数据发生错误时会导致页面报错购物车商品不展示
this.$confirm('购物车数据结构错误,是否清空购物车商品?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
$clearCart({
masterId: this.masterId,
tableId: this.table.tableId,
}).then((res) => {
this.order.list = [];
this.changeOrderSel(-1);
this.$message({
type: "success",
message: "清除成功!",
});
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
}
},
//获取购物车数据
async getCart() {