代客下单修改,登录页面修改,部分页面调整,请求封装调整

This commit is contained in:
2025-11-27 18:02:28 +08:00
parent f9cc02e93f
commit 3bb09ef0b1
45 changed files with 4934 additions and 1054 deletions

View File

@@ -611,8 +611,8 @@ async function getDiscountActivity() {
let res = await discountActivity({
shopId: uni.getStorageSync("shopId"),
});
if (res.code == 200) {
fullReductionActivities.value = res.data?[res.data]:[];
if (res) {
fullReductionActivities.value = res?[res]:[];
}
}
const websocketUtil = inject("websocketUtil"); // 注入 WebSocket 工具类实例
@@ -620,7 +620,7 @@ const websocketUtil = inject("websocketUtil"); // 注入 WebSocket 工具类实
const limitTimeDiscountRes = ref(null);
async function getLimit() {
const res = await limitTimeDiscountApi.limitTimeDiscount();
limitTimeDiscountRes.value = res.data;
limitTimeDiscountRes.value = res;
if (pageData.table.tableCode) {
pageData.limitTimeDiscount = limitTimeDiscountRes.value;
@@ -695,7 +695,7 @@ async function getHistoryOrderDetail(tableCode) {
let res = await getHistoryOrder({
tableCode: tableCode,
});
pageData.orderInfo = res.data;
pageData.orderInfo = res;
}
//餐位费
@@ -734,7 +734,7 @@ async function init() {
});
// 获取商品列表
let res = await getProductList({}, "product", false);
$goods = res.data;
$goods = res;
// console.log("商品列表===",$goods)
getTableInfo(pageData.table);
}
@@ -896,16 +896,16 @@ async function getTbShopInfo() {
const res = await getShopInfo({
id: uni.getStorageSync("shopId"),
});
pageData.shopInfo = res.data;
seatFeeConfig.pricePerPerson = res.data.tableFee || 0;
uni.setStorageSync("shopInfo", res.data);
pageData.shopInfo = res;
seatFeeConfig.pricePerPerson = res.tableFee || 0;
uni.setStorageSync("shopInfo", res);
}
/**
* 获取桌台信息
*/
async function getTableInfo(opt) {
const { data: res } = await getShopTableDetail({
const res = await getShopTableDetail({
id: opt.id,
tableCode: opt.tableCode,
});
@@ -939,7 +939,7 @@ function watchChooseuser() {
const res = await shopUserDetail({
userId: data.userId,
});
pageData.user = res.data;
pageData.user = res;
} else {
pageData.user = data;
}
@@ -1267,11 +1267,11 @@ async function createAnOrder() {
if (pageData.orderInfo && pageData.shopInfo.registerType != "before") {
par.orderId = pageData.orderInfo.id;
}
let res = {data:{id:''}};
let res = {id:''}
if (goods.list.length) {
res = await createOrder(par);
console.log(res, "创建订单");
if (res.code != 200) {
if (!res) {
uni.showToast({
title: res.msg || "创建订单失败!",
icon: "none",
@@ -1299,14 +1299,14 @@ async function createAnOrder() {
return go.to(
"PAGES_ORDER_PAY",
{
orderId: res.data.id,
orderId: res.id,
isNowPay: true,
dinnerType: pageData.eatTypes.active,
},
"redirect"
);
} else {
if(!res.data.id&&pageData.orderInfo.id){
if(!res.id&&pageData.orderInfo.id){
return go.to(
"PAGES_ORDER_PAY",
{
@@ -1322,7 +1322,7 @@ async function createAnOrder() {
go.to(
"PAGES_ORDER_DETAIL",
{
id: res.data.id||pageData.orderInfo.id,
id: res.id||pageData.orderInfo.id,
dinnerType: pageData.eatTypes.active,
},
"redirect"