代客下单修改,问题修复

This commit is contained in:
2025-11-18 14:55:26 +08:00
parent 67ec915181
commit 93273b796f
17 changed files with 174 additions and 117 deletions

View File

@@ -507,6 +507,8 @@ import { createOrder, getHistoryOrder } from "@/http/api/order.js";
import { shopUserDetail } from "@/http/yskApi/shop-user.js";
import { discountActivity } from "@/http/yskApi/market/discountActivity.js";
import BigNumber from "bignumber.js";
import * as limitTimeDiscountApi from "@/http/yskApi/limitTimeDiscount.js";
const models = new Map();
const modelData = reactive({
@@ -589,6 +591,28 @@ async function getDiscountActivity() {
}
}
const websocketUtil = inject("websocketUtil"); // 注入 WebSocket 工具类实例
const limitTimeDiscountRes = ref(null);
async function getLimit() {
const res = await limitTimeDiscountApi.limitTimeDiscount();
limitTimeDiscountRes.value = res.data;
if (pageData.table.tableCode) {
pageData.limitTimeDiscount = limitTimeDiscountRes.value;
websocketUtil.send(
JSON.stringify({
type: "shopping",
operate_type: "time_discount_save",
table_code: pageData.table.tableCode,
shop_id: uni.getStorageSync("shopInfo").id,
operate_type: "time_discount_save",
data: limitTimeDiscountRes.value,
})
);
console.log("limitTimeDiscount",pageData.limitTimeDiscount );
}
}
onLoad(async (opt) => {
Object.assign(option, opt);
console.log("opt====", opt);
@@ -596,6 +620,8 @@ onLoad(async (opt) => {
pageData.table.id = opt.tableId;
pageData.table.tableCode = opt.tableCode;
}
//获取限时折扣
await getLimit();
//获取满减活动
await getDiscountActivity();
pageData.shopInfo = uni.getStorageSync("shopInfo");
@@ -640,6 +666,7 @@ onUnmounted(() => {
* @param {Object} tableCode
*/
async function getHistoryOrderDetail(tableCode) {
let res = await getHistoryOrder({
tableCode: tableCode,
});
@@ -868,6 +895,9 @@ async function getTableInfo(opt) {
// 获取购物车数据
getCart();
// 获取购物车数据
if(shopInfo.registerType==='before'){
return
}
getHistoryOrderDetail(opt.tableCode);
}

View File

@@ -290,6 +290,7 @@ const is_time_discount = computed(() => {
null,
"id"
);
console.log("isCanuse", isCanuse,props.data);
return isCanuse;
});

View File

@@ -250,7 +250,7 @@ function confirm() {
if (isDisabled.value) {
return;
}
emits("confirm", goods.value, number.value,is_time_discount.value);
emits("confirm", goods.value, number.value,is_time_discount.value?1:0);
}
defineExpose({
open,

View File

@@ -2,7 +2,7 @@
<up-popup :show="popShow" @close="close" @open="open" mode="top" :round="0">
<view class="u-p-32 box u-font-28">
<view style="display: flex;align-items: center;">
<up-search v-model="searchVal" actionText="" @search="search" @clear="search"></up-search>
<up-search v-model="searchVal" actionText="" @search="search" @clear="search" clearabled :onlyClearableOnFocused ="false"></up-search>
<text @tap="search">搜索</text>
</view>
</view>
@@ -54,7 +54,6 @@
}
function search() {
console.log(searchVal.value, '值啊啊啊啊 ')
emits('search', searchVal.value)
close()
}

View File

@@ -344,7 +344,8 @@ import myCar from "./components/car";
import go from "@/commons/utils/go.js";
import infoBox from "@/commons/utils/infoBox.js";
import { getNowCart } from "@/pagesCreateOrder/util.js";
import yskUtils from "ysk-utils";
// import yskUtils from "ysk-utils";
import yskUtils from "@/lib/index";
provide("yskUtils", yskUtils);
import {
$productCategory,