|
@@ -58,7 +58,7 @@ import CouponModal from "./components/CouponModal.vue";
|
|
|
import CartModal from "./components/CartModal.vue";
|
|
import CartModal from "./components/CartModal.vue";
|
|
|
import SelectCouponModal from "./components/SelectCouponModal.vue";
|
|
import SelectCouponModal from "./components/SelectCouponModal.vue";
|
|
|
import { go } from "@/utils/utils.js";
|
|
import { go } from "@/utils/utils.js";
|
|
|
-import { DiningOrderFood, GetStoreCategories, GetStoreCuisines, GetStoreDetail, getOrderSseConfig, GetOrderCart, PostOrderCartAdd, PostOrderCartUpdate, PostOrderCartClear, PutOrderCartUpdateTableware, GetUserCouponList } from "@/api/dining.js";
|
|
|
|
|
|
|
+import { DiningOrderFood, GetStoreCategories, GetStoreCuisines, GetStoreDetail, getOrderSseConfig, GetOrderCart, PostOrderCartAdd, PostOrderCartUpdate, PostOrderCartClear, PutOrderCartUpdateTableware, GetUserOwnedCouponList } from "@/api/dining.js";
|
|
|
import { createSSEConnection } from "@/utils/sse.js";
|
|
import { createSSEConnection } from "@/utils/sse.js";
|
|
|
|
|
|
|
|
const storeName = ref(''); // 店铺名称,用于导航栏标题
|
|
const storeName = ref(''); // 店铺名称,用于导航栏标题
|
|
@@ -462,11 +462,11 @@ const handleDecrease = (item) => {
|
|
|
if (food && (food.quantity || 0) > 0) updateFoodQuantity(food, -1);
|
|
if (food && (food.quantity || 0) > 0) updateFoodQuantity(food, -1);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-// 拉取用户优惠券列表(GET /dining/coupon/getUserCouponList),列表在 SelectCouponModal 中展示,空时弹窗内显示「暂无可用优惠券」
|
|
|
|
|
|
|
+// 拉取用户优惠券列表(GET /dining/coupon/userOwnedByStore,入参 storeId),列表在 SelectCouponModal 中展示
|
|
|
const fetchUserOwnedCoupons = async () => {
|
|
const fetchUserOwnedCoupons = async () => {
|
|
|
const storeId = uni.getStorageSync('currentStoreId') || '';
|
|
const storeId = uni.getStorageSync('currentStoreId') || '';
|
|
|
try {
|
|
try {
|
|
|
- const res = await GetUserCouponList({ storeId });
|
|
|
|
|
|
|
+ const res = await GetUserOwnedCouponList({ storeId });
|
|
|
// 接口返回 { code, data: [...], msg, success },请求层可能只返回 data,故 res 可能为数组
|
|
// 接口返回 { code, data: [...], msg, success },请求层可能只返回 data,故 res 可能为数组
|
|
|
const list = Array.isArray(res) ? res : (res?.data ?? res?.records ?? res?.list ?? []);
|
|
const list = Array.isArray(res) ? res : (res?.data ?? res?.records ?? res?.list ?? []);
|
|
|
const normalized = (Array.isArray(list) ? list : []).map((item) => normalizeCouponItem(item)).filter(Boolean);
|
|
const normalized = (Array.isArray(list) ? list : []).map((item) => normalizeCouponItem(item)).filter(Boolean);
|