问题修复

This commit is contained in:
2025-11-27 19:01:45 +08:00
parent 3bb09ef0b1
commit fd55c815d3
11 changed files with 83 additions and 42 deletions

View File

@@ -82,7 +82,6 @@ function commonsProcess(showLoading, httpReqCallback) {
let { statusCode, data } = httpData;
// 避免混淆重新命名
let bodyData = data;
console.log('bodyData',bodyData)
if (statusCode == 500) {
isShowErrorToast = true;
@@ -106,6 +105,9 @@ function commonsProcess(showLoading, httpReqCallback) {
if (bodyData.code == 501) {
return Promise.reject(bodyData); // 跳转到catch函数
}
if (data.code == 200 && data.data === null) {
return Promise.resolve(true);
}
return Promise.resolve(bodyData.data);
})
.catch((res) => {

View File

@@ -214,6 +214,29 @@ onShow(async() => {
await getArea();
getTable();
});
/**
* 扫码上传
*/
async function saomaDicanCan() {
uni.scanCode({
success: async (res) => {
console.log("条码类型:" + res.scanType);
console.log("条码内容:" + res.result);
const paramStr = url.split("?")[1];
const paramObj = {};
paramStr.split("&").forEach((item) => {
const [key, value] = item.split("=");
paramObj[key] = value;
});
if (paramObj.tableCode) {
go.to("PAGES_CREATE_ORDER", {
tableCode: paramObj.tableCode,
});
}
},
});
}
</script>
<style lang="scss" scoped>

View File

@@ -1,5 +1,5 @@
export const tableStatus = {
unbound: { label: "未绑定", type: "#909090" },
// unbound: { label: "未绑定", type: "#909090" },
settled: { label: "待清台", type: "#FAAD14" },
ordering: { label: "点餐中", type: "#FF4D4F" },
unsettled: { label: "未结账", type: "#DD3F41" },
@@ -8,4 +8,3 @@ cleaning: { label: "清理中", type: "#909090" },
closed: { label: "关台", type: "#DDDDDD" },
subscribe: { label: "预定", type: "#52C41A" },
};

View File

@@ -293,9 +293,15 @@ const vdata = reactive({
loginType: "merchant",
},
});
vdata.formData.merchantName = "19107220837";
vdata.formData.username = "19111112222";
vdata.formData.pwd = "123456";
vdata.formData.code = "666666";
// #ifdef H5
vdata.formData.username = "xpc";
vdata.formData.pwd = "123";
// vdata.formData.merchantName = "19191703856";
// vdata.formData.username = "18888888888";
// vdata.formData.pwd = "123456";
// vdata.formData.code = "666666";
// #endif
// #ifdef MP-WEIXIN
// vdata.formData.username = '15699991111'
@@ -305,14 +311,9 @@ vdata.formData.pwd = "123";
function accountTypeChange(e) {
// #ifdef H5
if (e == 1) {
vdata.formData.merchantName = "19191703856";
vdata.formData.username = "18888888888";
vdata.formData.pwd = "123456";
vdata.formData.code = "666666";
} else {
}
// #endif
}
const getCode = async () => {

View File

@@ -221,7 +221,7 @@
</view>
<view class="u-m-l-20"> 返回 </view>
</view>
<view class="u-flex">
<view class="u-flex" v-if="accountStore.isPayAfter">
<text class="color-333 u-m-r-20"
>上菜方式{{ returnServingStyleName(subStatus) }}</text
>
@@ -577,7 +577,7 @@ function getshopsInfo() {
async function workerConfirm() {
//debugger
// form.workerAccount=18888888888
form.workerAccount=accountStore.staffUserName
if (!form.workerAccount) {
return infoBox.showToast("请输入服务员账号");
}

View File

@@ -284,8 +284,6 @@
ref="surcharge"
title="添加附加费"
></my-surcharge>
<!-- 登录弹窗 -->
<my-login v-model="modal.login" @loginSuccess="loginSuccess"></my-login>
<!-- 称重 -->
<weigh-item
ref="refweighitem"
@@ -310,8 +308,6 @@ import _ from "lodash";
import * as Api from "@/http/yskApi/Instead.js";
import * as limitTimeDiscountApi from "@/http/yskApi/limitTimeDiscount.js";
import {
$table,
$choseTable,
@@ -364,12 +360,11 @@ import { getNowCart } from "@/pagesCreateOrder/util.js";
import yskUtils from "@/lib/index";
provide("yskUtils", yskUtils);
import {useAccountStore} from '@/stores/account'
const accountStore = useAccountStore()
import { useAccountStore } from "@/stores/account";
const accountStore = useAccountStore();
provide("accountStore", accountStore);
import {
$productCategory,
$layoutpage,
@@ -632,6 +627,9 @@ async function getHistoryOrderDetail() {
let res = await getHistoryOrder({
tableCode: data.table.tableCode,
});
if (!res.id) {
return;
}
data.orderInfo = res;
if (res) {
data.historyOrder = Object.entries(data.orderInfo.detailMap).map(
@@ -2040,7 +2038,7 @@ async function getTableDetail() {
tableCode: data.table.tableCode,
});
console.log(res, "getTableDetail");
if(res){
if (res && res.tableCode) {
data.table = res;
}
}

View File

@@ -32,21 +32,21 @@
</template>
</view>
</view>
<view class="u-flex" style="gap: 54rpx">
<text>{{ item.num }}</text>
<view class="u-flex u-relative">
<text class="limit-price" v-if="showOldPrice">
<view class="u-flex text-center" style="gap: 54rpx;min-width: 348rpx;">
<text class="u-flex-1">{{ item.num }}</text>
<view class="u-flex u-flex-1 u-relative">
<text class="limit-price" v-if="showOldPrice(item)">
{{ returnPrice(item) }}
</text>
<text
class="origin-price"
:class="[showOldPrice ? 'old-price' : '']"
:class="[showOldPrice(item) ? 'old-price' : '']"
>{{ item.price }}</text
>
</view>
<text>{{
<text class="u-flex-1">{{
BigNumber(item.num).times(returnPrice(item)).toFixed(2)
}}</text>
</view>
@@ -119,7 +119,7 @@ function returnPrice(data) {
return data.discountSaleAmount;
}
if (data.isGift) {
return 0
return 0;
}
return data.price;
}

View File

@@ -232,7 +232,8 @@ function toPay() {
orderId: cartStore.order.id,
isNowPay: true,
dinnerType: cartStore.currentDinnerType,
});
personCount: cartStore.personCount,
},'redirect');
}
const areaList = ref([]);

View File

@@ -514,6 +514,11 @@ async function init() {
});
}
pageData.seatNum = order.seatNum;
if (options.personCount) {
seatFeeConfig.personCount = options.personCount;
return;
}
seatFeeConfig.personCount = order.seatNum;
}
@@ -915,7 +920,9 @@ function toQuan() {
go.to("PAGES_ORDER_QUAN", {
orderId: order.id,
shopUserId: pageData.user.id,
orderPrice: BigNumber(payPrice.value).plus(BigNumber(orderCostSummary.value.couponDeductionAmount)).decimalPlaces(2, BigNumber.ROUND_DOWN)
orderPrice: BigNumber(payPrice.value)
.plus(BigNumber(orderCostSummary.value.couponDeductionAmount))
.decimalPlaces(2, BigNumber.ROUND_DOWN),
});
}
@@ -923,10 +930,10 @@ function toQuan() {
* 判断是否可以修改金额
*/
async function discountShow() {
const bol = await hasPermission("yun_xu_da_zhe");
if (bol) {
// const bol = await hasPermission("yun_xu_da_zhe");
// if (bol) {
showModel("editMoney", true);
}
// }
}
/**

View File

@@ -16,7 +16,11 @@ export const useAccountStore = defineStore("account", {
loginType: "",
};
},
getters: {},
getters: {
isPayAfter(state){
return state.shopInfo.registerType==='after'?true:false
}
},
actions: {
//获取员工信息
async getShopStaffInfo() {

View File

@@ -195,6 +195,8 @@ export const useCartStore = defineStore("cart", {
return false;
}
console.log("socket收到消息", msg);
switch (msg.operate_type) {
case "pad_init":
this.cartList = msg.data;
@@ -206,6 +208,8 @@ export const useCartStore = defineStore("cart", {
cartControls(cartItem, "add");
break;
case "pad_edit":
break;
case "bulk_edit":
this.sendMessage({
operate_type: "init",
@@ -216,6 +220,8 @@ export const useCartStore = defineStore("cart", {
getCart();
break;
case "pad_del":
break;
case "del":
cartItem = getNowCart(msg.data, $goods, pageData.user);
cartControls(cartItem, "del");
@@ -269,6 +275,7 @@ export const useCartStore = defineStore("cart", {
* @returns 历史订单数据
*/
async getOrder() {
console.log("获取历史订单数据");
const res = await orderApi.getOrderById({ orderId: this.order.id });
if (res) {
this.setOrder(res);
@@ -289,7 +296,6 @@ export const useCartStore = defineStore("cart", {
);
return pre;
}, []);
},
},
unistorage: true, // 开启后对 state 的数据读写都将持久化