代合合并
This commit is contained in:
@@ -760,6 +760,7 @@
|
||||
usePoints.value = false;
|
||||
cartStore.setUserPoints(0);
|
||||
} else {
|
||||
cartStore.fullReductionActivities = fullReductionActivities;
|
||||
if (back_discountActivity) {
|
||||
calcDiscountActivity();
|
||||
}
|
||||
@@ -795,6 +796,9 @@
|
||||
}
|
||||
console.log("当前满减门槛", discountActivity.value);
|
||||
}
|
||||
|
||||
|
||||
let fullReductionActivities=[]
|
||||
async function getDiscountActivity() {
|
||||
const res = await discountActivityApi.config({
|
||||
shopId: uni.cache.get("shopId"),
|
||||
@@ -804,6 +808,7 @@
|
||||
}
|
||||
discountActivityRes.value = res;
|
||||
cartStore.fullReductionActivities = [res];
|
||||
fullReductionActivities=[res];
|
||||
|
||||
calcDiscountActivity();
|
||||
}
|
||||
|
||||
@@ -150,6 +150,7 @@
|
||||
import {
|
||||
back
|
||||
} from "@/utils/uniapp.js";
|
||||
import * as limitTimeDiscountapi from '@/common/api/market/limitTimeDiscount.js';
|
||||
import {
|
||||
onLoad,
|
||||
onUnload
|
||||
@@ -1096,6 +1097,8 @@
|
||||
Object.assign(listinfo, res);
|
||||
getOrderInfoAfterCalcInit(res);
|
||||
}
|
||||
|
||||
const limitTimeDiscountRes=ref(null)
|
||||
async function init(opt) {
|
||||
await storeuser.actionsproductqueryProduct();
|
||||
|
||||
@@ -1117,6 +1120,17 @@
|
||||
if (res && typeof res == "object") {
|
||||
setOrder(res);
|
||||
}
|
||||
}else{
|
||||
const limitRes = await limitTimeDiscountapi.getConfig({
|
||||
shopId: uni.cache.get('shopId')
|
||||
});
|
||||
if (limitRes && typeof limitRes == 'object') {
|
||||
limitTimeDiscountRes.value = limitRes;
|
||||
|
||||
} else {
|
||||
limitTimeDiscountRes.value = null;
|
||||
|
||||
}
|
||||
}
|
||||
//获取店铺信息
|
||||
const shopInfoRes = await APIusershopInfodetail({
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
<view class="footer-wrap">
|
||||
<view class="btn" @click.stop="$u.debounce(isRemoveOrder(item,index),1000)"
|
||||
v-if="item.status == 'done' || item.status == 'cancelled'"> 删除订单 </view>
|
||||
<view class="btn s" @click.stop="$u.debounce(showpopupclick(item),1000)"
|
||||
<view class="btn s" @click.stop="$u.debounce(orderinfo(item),1000)"
|
||||
v-if="item.status == 'unpaid' || item.status == 'paying'"> 去付款 </view>
|
||||
|
||||
<view class="btn s" @click.stop="agignOrder(item)" v-if="item.status == 'done'"> 再来一单 </view>
|
||||
|
||||
@@ -606,7 +606,8 @@
|
||||
import isBetween from 'dayjs/plugin/isBetween';
|
||||
|
||||
import {
|
||||
APIshopUserInfo,APIusershopInfodetail
|
||||
APIshopUserInfo,
|
||||
APIusershopInfodetail
|
||||
} from "@/common/api/member.js";
|
||||
dayjs.extend(isBetween);
|
||||
import {
|
||||
@@ -1535,10 +1536,10 @@
|
||||
|
||||
for (let cart of arr) {
|
||||
const findItem = cartStore.carts.find(v => v.id == cart.id)
|
||||
if (findItem&&findItem.is_time_discount != cart.is_time_discount) {
|
||||
if (findItem && findItem.is_time_discount != cart.is_time_discount) {
|
||||
result.push({
|
||||
id: cart.id,
|
||||
is_time_discount: findItem.is_time_discount
|
||||
is_time_discount: findItem.is_time_discount
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1555,7 +1556,7 @@
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let socketInitFinished = false
|
||||
// 收到的消息变化
|
||||
async function onMessage(Message) {
|
||||
@@ -1587,9 +1588,33 @@
|
||||
|
||||
}
|
||||
|
||||
if (Message.operate_type == 'rottable_error') {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: Message.msg,
|
||||
showCancel: true,
|
||||
cancelText: '舍弃',
|
||||
confirmText: '合并',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
startUseTable({
|
||||
is_hb: 2
|
||||
})
|
||||
} else {
|
||||
startUseTable({
|
||||
is_hb: 2,
|
||||
give_up: 1
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 转桌成功
|
||||
if (Message.operate_type == 'rottable' && Message.status == 1) {
|
||||
if (Message.operate_type == 'rottable') {
|
||||
|
||||
console.log('转桌成功了');
|
||||
console.log(Message);
|
||||
|
||||
// uni.showToast({
|
||||
// title: '扫码成功,请下单',
|
||||
@@ -1610,7 +1635,7 @@
|
||||
shop_id: uni.cache.get('shopId'),
|
||||
time_dis_info: cartStore.limitTimeDiscount
|
||||
};
|
||||
|
||||
|
||||
useSocket.sendMessage({
|
||||
type: 'shopping',
|
||||
operate_type: 'time_discount_save',
|
||||
@@ -1663,7 +1688,7 @@
|
||||
}
|
||||
|
||||
// 提示
|
||||
if (Message.status == 0 && Message.type != 'no_suit_num' && Message.type != 'time_discount') {
|
||||
if (Message.status == 0 && Message.type != 'no_suit_num' && Message.type != 'time_discount'&&Message.operate_type != 'rottable_error') {
|
||||
uni.showToast({
|
||||
title: Message.msg,
|
||||
icon: 'none'
|
||||
@@ -1683,7 +1708,6 @@
|
||||
}
|
||||
if (Message.operate_type == 'time_discount_save') {
|
||||
cartStore.limitTimeDiscount = Message.data;
|
||||
console.log('time_discount_save', cartStore.limitTimeDiscount);
|
||||
}
|
||||
|
||||
//除去p 每次返回都回执消息
|
||||
@@ -2086,19 +2110,21 @@
|
||||
}
|
||||
|
||||
// 开始换桌
|
||||
function startUseTable() {
|
||||
function startUseTable(par) {
|
||||
tableShopInfo.value = uni.cache.get('shopInfo');
|
||||
const oldTableCode = uni.cache.get('tableCode');
|
||||
const cartIds = cartStore.carts.map((item) => item.id);
|
||||
|
||||
const data = {
|
||||
is_hb: 1,
|
||||
...par,
|
||||
type: 'shopping',
|
||||
operate_type: 'rottable',
|
||||
account: tableShopInfo.value.phone,
|
||||
table_code: oldTableCode,
|
||||
new_table_code: uni.cache.get('shopTable').tableCode,
|
||||
cart_id: cartIds,
|
||||
shop_id: tableShopInfo.value.id
|
||||
shop_id: tableShopInfo.value.id,
|
||||
};
|
||||
|
||||
websocketsendMessage(data);
|
||||
@@ -2183,6 +2209,17 @@
|
||||
} else {
|
||||
await userStore.actionsproductqueryShop(newTableCode);
|
||||
await userStore.actionsproductqueryProduct();
|
||||
const res = await APIhistoryOrder({
|
||||
tableCode: uni.cache.get('tableCode')
|
||||
});
|
||||
|
||||
if (res && res.id) {
|
||||
return uni.showModal({
|
||||
title: '提示',
|
||||
content: '目标台桌使用中无法转桌',
|
||||
showCancel: false
|
||||
})
|
||||
}
|
||||
if (shopInfoRes.shopInfo.isTableFee === 1) {
|
||||
// 免桌位费,直接换桌
|
||||
startUseTable();
|
||||
@@ -2191,6 +2228,7 @@
|
||||
tableInfo.value = uni.cache.get('shopTable');
|
||||
showTableInfoPeopleNumPopup.value = true;
|
||||
}
|
||||
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
@@ -2212,11 +2250,11 @@
|
||||
const shopInfoRes = await APIusershopInfodetail({
|
||||
shopId: uni.cache.get('shopId')
|
||||
});
|
||||
if(shopInfoRes&&shopInfoRes.shopInfo){
|
||||
if (shopInfoRes && shopInfoRes.shopInfo) {
|
||||
Object.assign(shopInfo, shopInfoRes.shopInfo);
|
||||
uni.cache.set('shopInfo',shopInfoRes.shopInfo)
|
||||
uni.cache.set('shopInfo', shopInfoRes.shopInfo)
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (userInfo && typeof userInfo === 'object') {
|
||||
shopUserInfo.value = userInfo
|
||||
@@ -2227,6 +2265,7 @@
|
||||
if (e.one_more_order && e.order_id) {
|
||||
extraInitPar.one_more_order = 1
|
||||
extraInitPar.order_id = e.order_id
|
||||
extraInitPar.user_id = uni.cache.get('userInfo').id||''
|
||||
}
|
||||
|
||||
useSocket.connect({
|
||||
|
||||
Reference in New Issue
Block a user