优化代客下单

This commit is contained in:
gyq
2025-11-14 09:14:34 +08:00
parent 65dd9d426b
commit 17e63a2400
2 changed files with 8 additions and 9 deletions

View File

@@ -160,7 +160,6 @@ export const useCartsStore = defineStore("carts", () => {
.flat() .flat()
.map(convertToBaseCartItem); .map(convertToBaseCartItem);
if (cart.length || history.length) { if (cart.length || history.length) {
WebSocketManager.sendMessage({ WebSocketManager.sendMessage({
type: "shopping", type: "shopping",
@@ -169,14 +168,14 @@ export const useCartsStore = defineStore("carts", () => {
shop_id: localStorage.getItem("shopId"), shop_id: localStorage.getItem("shopId"),
data: { data: {
cart: cart.map(item => { cart: cart.map(item => {
console.log('cart.111111', item); // console.log('cart.111111', item);
return { return {
id: item.id, id: item.id,
is_time_discount: limitUtils.canUseLimitTimeDiscount(item, limitDiscountRes.value, shopInfoTyped, vipUser.value, 'product_id') ? 1 : 0 is_time_discount: limitUtils.canUseLimitTimeDiscount(item, limitDiscountRes.value, shopInfoTyped, vipUser.value, 'product_id') ? 1 : 0
} }
}), }),
history: history.map(item => { history: history.map(item => {
console.log('history.222222', item); // console.log('history.222222', item);
return { return {
id: item.id, id: item.id,
is_time_discount: limitUtils.canUseLimitTimeDiscount(item, limitDiscountRes.value, shopInfoTyped, vipUser.value, 'productId') ? 1 : 0 is_time_discount: limitUtils.canUseLimitTimeDiscount(item, limitDiscountRes.value, shopInfoTyped, vipUser.value, 'productId') ? 1 : 0
@@ -185,7 +184,7 @@ export const useCartsStore = defineStore("carts", () => {
}, },
}) })
} }
}, 3000) }, 500)
// 就餐类型 // 就餐类型
let dinnerType = ref<'dine-in' | 'take-out'>('dine-in'); let dinnerType = ref<'dine-in' | 'take-out'>('dine-in');
@@ -243,7 +242,7 @@ export const useCartsStore = defineStore("carts", () => {
shop_id: localStorage.getItem("shopId"), shop_id: localStorage.getItem("shopId"),
data: limitDiscountRes.value, data: limitDiscountRes.value,
}); });
}, 3000); }, 500);
// 代客下单页面商品缓存 // 代客下单页面商品缓存
const goods = useStorage<any[]>("Instead_goods", []); const goods = useStorage<any[]>("Instead_goods", []);
@@ -815,7 +814,7 @@ export const useCartsStore = defineStore("carts", () => {
...data, ...data,
detailMap: returnDetailMap(data.detailMap) detailMap: returnDetailMap(data.detailMap)
}; };
console.log('oldOrder.value.detailMap==', oldOrder.value.detailMap); console.log('oldOrder.value.detailMap==', oldOrder.value);
if (!vipUser.value.id && data.userId) { if (!vipUser.value.id && data.userId) {
const res = await shopUserApi.get({ userId: data.userId }) const res = await shopUserApi.get({ userId: data.userId })
@@ -845,7 +844,7 @@ export const useCartsStore = defineStore("carts", () => {
WebSocketManager.subscribeToTopic(initParams, (msg) => { WebSocketManager.subscribeToTopic(initParams, (msg) => {
console.log("收到消息:", msg); console.log("收到消息:", msg);
if (!msg.status) { if (!msg.status) {
if (msg.hasOwnProperty('status') && msg.status !== 1) { if (msg.hasOwnProperty('status') && msg.status !== 1 && msg.operate_type !== 'bulk_edit') {
return ElMessage.error(msg.message || '操作失败'); return ElMessage.error(msg.message || '操作失败');
} }
} }

View File

@@ -36,9 +36,9 @@
</el-table-column> </el-table-column>
<el-table-column label="手机号" prop="phone" width="160"></el-table-column> <el-table-column label="手机号" prop="phone" width="160"></el-table-column>
<el-table-column label="会员" prop="isVip"> <el-table-column label="会员" prop="isVip" width="140">
<template v-slot="scope"> <template v-slot="scope">
<el-tag type="warning" v-if="scope.row.isVip">会员等级{{ scope.row.isVip }}</el-tag> <el-tag type="warning" v-if="scope.row.isVip">会员等级{{ scope.row.memberLevelName }}</el-tag>
<span v-else></span> <span v-else></span>
</template> </template>
</el-table-column> </el-table-column>