扫码排队
This commit is contained in:
parent
e352acbdd0
commit
a95315f42a
|
|
@ -50,17 +50,18 @@ export default (params) => {
|
||||||
switch (res.code) {
|
switch (res.code) {
|
||||||
case '501':
|
case '501':
|
||||||
uni.cache.remove('shopId')
|
uni.cache.remove('shopId')
|
||||||
uni.showToast({
|
// uni.showToast({
|
||||||
title: '',
|
// title: '',
|
||||||
icon: "none",
|
// icon: "none",
|
||||||
success: () => {
|
// success: () => {
|
||||||
|
|
||||||
|
// }
|
||||||
|
// })
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: "/pages/index/index",
|
url: "/pages/index/index",
|
||||||
})
|
})
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
|
||||||
})
|
|
||||||
break;
|
break;
|
||||||
case 404:
|
case 404:
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
|
||||||
|
|
@ -40,12 +40,19 @@ export const APIqueuedetail = (data) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 消息订阅
|
// 消息订阅
|
||||||
export const APIcallTablesubMsg = (data) => {
|
export const APIcallTablesubMsg = (data) => {
|
||||||
return request({
|
return request({
|
||||||
url: urlAccount + '/user/callTable/subMsg',
|
url: urlAccount + '/user/callTable/subMsg',
|
||||||
method: 'get',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 取消排队
|
||||||
|
export const APIqueuecancel = (data) => {
|
||||||
|
return request({
|
||||||
|
url: urlAccount + '/user/callTable/cancel?queueId=' + data.queueId + '&shopId=' + data.shopId,
|
||||||
|
method: 'DELETE'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// const debug = process.env.NODE_ENV == 'development' ? true : false;
|
// const debug = process.env.NODE_ENV == 'development' ? true : false;
|
||||||
const debug = true
|
const debug = false
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
const proxyApi = "/api"
|
const proxyApi = "/api"
|
||||||
// #endif
|
// #endif
|
||||||
|
|
@ -7,10 +7,9 @@ const proxyApi = "/api"
|
||||||
// #ifdef MP-WEIXIN || APP || MP-ALIPAY
|
// #ifdef MP-WEIXIN || APP || MP-ALIPAY
|
||||||
const proxyApi = 'http://192.168.1.31' // 调试地址
|
const proxyApi = 'http://192.168.1.31' // 调试地址
|
||||||
const proxyApiwws = 'ws://192.168.1.31:2348' // 调试地址
|
const proxyApiwws = 'ws://192.168.1.31:2348' // 调试地址
|
||||||
|
// 测试
|
||||||
// // 本地
|
// const proxyApi = "https://fv901fw8033.vicp.fun"
|
||||||
// const proxyApi = 'http://192.168.1.31' // 固定的测试
|
// const proxyApiwws = 'wss://sockets.sxczgkj.com/wss'
|
||||||
// const proxyApiwws = 'ws://192.168.1.43:2348' //宏哥本地
|
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
|
|
|
||||||
|
|
@ -60,13 +60,13 @@
|
||||||
<view class="fixedview_tow" @tap="$u.debounce(istoricalorders,1000)">
|
<view class="fixedview_tow" @tap="$u.debounce(istoricalorders,1000)">
|
||||||
{{paymentmethod.paymentBtnText}}
|
{{paymentmethod.paymentBtnText}}
|
||||||
</view>
|
</view>
|
||||||
<view class="fixedview_tows" @tap="$u.debounce(APIputuserorderclick,1000)">
|
<!-- <view class="fixedview_tows" @tap="$u.debounce(APIputuserorderclick,1000)">
|
||||||
取消订单
|
取消订单
|
||||||
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view style="width: 100%;height: 200rpx;"> </view>
|
||||||
<view style="width: 100%;height: 290rpx;"> </view>
|
|
||||||
<payPassword ref="payPasswordref" :isShow="ispws" @inputComplete="accountPayevent" @close="ispws = false" />
|
<payPassword ref="payPasswordref" :isShow="ispws" @inputComplete="accountPayevent" @close="ispws = false" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -553,8 +553,10 @@
|
||||||
orderVIP.value = uni.cache.get('orderVIP')
|
orderVIP.value = uni.cache.get('orderVIP')
|
||||||
ordershopUserInfo.value = orderVIP.value.shopInfo
|
ordershopUserInfo.value = orderVIP.value.shopInfo
|
||||||
paymentMethodref.value.orderVIPfun(uni.cache.get('orderVIP'))
|
paymentMethodref.value.orderVIPfun(uni.cache.get('orderVIP'))
|
||||||
|
if (orderId.value) {
|
||||||
orderorderInfo()
|
orderorderInfo()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
//TODO handle the exception
|
//TODO handle the exception
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<text class="productName">{{item.productName}}</text>
|
<text class="productName">{{item.productName}}</text>
|
||||||
<text class="productSkuName"
|
<text class="productSkuName"
|
||||||
v-if="item.productSkuName">{{item.productSkuName}}</text>
|
v-if="item.skuName">{{item.skuName}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="price">
|
<view class="price">
|
||||||
|
|
@ -135,7 +135,8 @@
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
cartList: {
|
cartList: {
|
||||||
type: Array
|
type: Array,
|
||||||
|
default: []
|
||||||
},
|
},
|
||||||
cartLists_count: {
|
cartLists_count: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
|
@ -263,6 +264,7 @@
|
||||||
|
|
||||||
// 提交订单
|
// 提交订单
|
||||||
const orderdetail = async () => {
|
const orderdetail = async () => {
|
||||||
|
if (props.cartList.length > 0) {
|
||||||
let res = await storeMemberpay.actionscreateOrder({
|
let res = await storeMemberpay.actionscreateOrder({
|
||||||
dineMode: 'dine-in', //堂食 dine-in 外带 take-out 外卖 take-away
|
dineMode: 'dine-in', //堂食 dine-in 外带 take-out 外卖 take-away
|
||||||
seatNum: uni.cache.get('dinersNum') ? uni.cache.get('dinersNum') : '', //用餐人数
|
seatNum: uni.cache.get('dinersNum') ? uni.cache.get('dinersNum') : '', //用餐人数
|
||||||
|
|
@ -282,52 +284,16 @@
|
||||||
shop_id: uni.cache.get('shopId'),
|
shop_id: uni.cache.get('shopId'),
|
||||||
operate_type: 'cleanup',
|
operate_type: 'cleanup',
|
||||||
})
|
})
|
||||||
// uni.pro.redirectTo('order/detail', {
|
|
||||||
// orderId: res.id,
|
|
||||||
// shopId: uni.cache.get('shopId')
|
|
||||||
// })
|
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/order/detail?orderId=' + res.id + '&shopId=' + uni.cache.get('shopId')
|
url: '/pages/order/detail?orderId=' + res.id + '&shopId=' + uni.cache.get('shopId')
|
||||||
})
|
})
|
||||||
// uni.pro.navigateTo('order/detail', {
|
} else {
|
||||||
// orderId: res.id,
|
uni.reLaunch({
|
||||||
// shopId: uni.cache.get('shopId')
|
url: '/pages/order/detail?orderId=' + props.orderinfo.id + '&shopId=' + uni.cache.get(
|
||||||
// })
|
'shopId')
|
||||||
// uni.showLoading({
|
})
|
||||||
// title: '正在生成订单',
|
}
|
||||||
// mask: true
|
|
||||||
// })
|
|
||||||
// if (res) {
|
|
||||||
// let checkOrderPay = {
|
|
||||||
// orderId: res.id,
|
|
||||||
// vipPrice: shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1 ? 1 : 0, //是否使用会员价0否1是
|
|
||||||
// allPack: is_type.value == 0 ? 0 : 1, //是否整单打包
|
|
||||||
// seatNum: uni.cache.get('dinersNum') ? uni.cache.get('dinersNum') : '', //用餐人数
|
|
||||||
// orderAmount: totalCost.value, //订单原金额(包含打包费+餐位费) 不含折扣价格
|
|
||||||
// discountRatio: 1, //折扣比例(计算时 向上取整保留 两位小数) 写死1
|
|
||||||
// discountAmount: 0, //手动优惠金额 写死0
|
|
||||||
// productCouponDiscountAmount: '', //商品优惠券抵扣金额
|
|
||||||
// fullCouponDiscountAmount: '', //满减优惠券抵扣金额
|
|
||||||
// couponList: '', //用户使用的卡券
|
|
||||||
// orderAmount: totalCost.value, // 最中订单金额
|
|
||||||
// roundAmount: 0, //抹零金额 减免多少钱
|
|
||||||
// pointsDiscountAmount: 0, //积分抵扣金额(tb_points_basic_setting表)
|
|
||||||
// pointsNum: 0, //(扣除各类折扣 enable_deduction后使用)
|
|
||||||
// remark: '', //用户备注
|
|
||||||
// }
|
|
||||||
// let successdata = await storeMemberpay.actionsltPayOrder({
|
|
||||||
// checkOrderPay,
|
|
||||||
// payType: paymentmethod.payType,
|
|
||||||
// buyerRemark: '',
|
|
||||||
// returnUrl: ''
|
|
||||||
// })
|
|
||||||
// if (successdata) {
|
|
||||||
// console.log(res.id, '支付成功res.id')
|
|
||||||
// uni.redirectTo({
|
|
||||||
// url: '/order/detail?orderId=' + res.id
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const dataprocessing = computed(() => {
|
const dataprocessing = computed(() => {
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,26 @@
|
||||||
<up-popup :show="showCart" :round="20" :safeAreaInsetBottom="false" :zIndex="98" :overlayStyle="{ zIndex: 98 }"
|
<up-popup :show="showCart" :round="20" :safeAreaInsetBottom="false" :zIndex="98" :overlayStyle="{ zIndex: 98 }"
|
||||||
@close="close">
|
@close="close">
|
||||||
<view class="cart-list-wrap">
|
<view class="cart-list-wrap">
|
||||||
<view class="cart-header flex-between">
|
<!-- <view class="cart-header flex-between">
|
||||||
<view class="num">已点 {{ cartLists_count }} 份</view>
|
<view class="num">已点 {{ cartLists_count }} 份</view>
|
||||||
<view class="clear" @click="cartclear">
|
<view class="clear" @click="cartclear">
|
||||||
<up-icon name="trash" color="#999"></up-icon>
|
<up-icon name="trash" color="#999"></up-icon>
|
||||||
<text class="t">清空</text>
|
<text class="t">清空</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
<scroll-view scroll-y class="scroll-view">
|
<scroll-view scroll-y class="scroll-view">
|
||||||
<view class="list-wrap">
|
<view class="list-wrap">
|
||||||
<view class="ShoppingCart">
|
<view v-if="cartList.length>0">
|
||||||
|
<view class="ShoppingCart flex-between">
|
||||||
|
<view>
|
||||||
购物车
|
购物车
|
||||||
</view>
|
</view>
|
||||||
|
<view class="flex-between" @click="cartclear">
|
||||||
|
<up-icon name="trash" color="#999" size="20"></up-icon>
|
||||||
|
<text class="t">清空购物车</text>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
<view class="shop-item" v-for="(item,index) in cartList" :key="item.id">
|
<view class="shop-item" v-for="(item,index) in cartList" :key="item.id">
|
||||||
<view class="shop-item-content">
|
<view class="shop-item-content">
|
||||||
<view class="cover" v-if="item.productId!=-999">
|
<view class="cover" v-if="item.productId!=-999">
|
||||||
|
|
@ -65,7 +73,8 @@
|
||||||
<!-- <up-icon name="plus-circle-fill"
|
<!-- <up-icon name="plus-circle-fill"
|
||||||
:color="{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1? '#CECECE' : '#E9AB7A'"
|
:color="{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1? '#CECECE' : '#E9AB7A'"
|
||||||
size="25"></up-icon> -->
|
size="25"></up-icon> -->
|
||||||
<up-icon name="plus-circle-fill" color="#E9AB7A" size="25"></up-icon>
|
<up-icon name="plus-circle-fill" color="#E9AB7A"
|
||||||
|
size="25"></up-icon>
|
||||||
<view class="btnClick" @click="cartListadd(item,'+')"></view>
|
<view class="btnClick" @click="cartListadd(item,'+')"></view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -73,14 +82,15 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
<!-- 历史订单 -->
|
<!-- 历史订单 -->
|
||||||
<view class="card" v-if="orderinfo.detailMap">
|
<view class="card" v-if="orderinfo.detailMap">
|
||||||
<!-- 订单头部 -->
|
<!-- 订单头部 -->
|
||||||
<view class="cardcalorders">
|
<view class="cardcalorders flex-between">
|
||||||
<!-- ··· 历史订单 ··· -->
|
<!-- ··· 历史订单 ··· -->
|
||||||
历史订单
|
<text>待支付订单</text>
|
||||||
<view class="absolute flex-start">
|
<view class="flex-start">
|
||||||
<up-icon name="trash" color="#999"></up-icon>
|
<up-icon name="trash" color="#999" size="20"></up-icon>
|
||||||
<text style="color:' #999;'" @click="clickcancelOrder('all')">清空历史订单</text>
|
<text style="color:' #999;'" @click="clickcancelOrder('all')">清空历史订单</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -90,7 +100,7 @@
|
||||||
<text class="placeNum">第{{key}}次下单</text>
|
<text class="placeNum">第{{key}}次下单</text>
|
||||||
<view class="placeTime flex-start">
|
<view class="placeTime flex-start">
|
||||||
<up-icon name="trash" color="#999"></up-icon>
|
<up-icon name="trash" color="#999"></up-icon>
|
||||||
<text class="t" @click="clickcancelOrder('',key)">清空</text>
|
<text class="t" @click="clickcancelOrder('Single',key)">清空</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -107,7 +117,7 @@
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<text class="productName">{{item.productName}}</text>
|
<text class="productName">{{item.productName}}</text>
|
||||||
<text class="productSkuName"
|
<text class="productSkuName"
|
||||||
v-if="item.productSkuName">{{item.productSkuName}}</text>
|
v-if="item.skuName">{{item.skuName}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="price">
|
<view class="price">
|
||||||
|
|
@ -232,6 +242,12 @@
|
||||||
i,
|
i,
|
||||||
key
|
key
|
||||||
})
|
})
|
||||||
|
emits('customevent', {
|
||||||
|
type: 'shopping',
|
||||||
|
table_code: uni.cache.get('tableCode'),
|
||||||
|
shop_id: uni.cache.get('shopId'),
|
||||||
|
operate_type: 'clearOrder',
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const calculateValue = (cartNumber, i, step = 1) => {
|
const calculateValue = (cartNumber, i, step = 1) => {
|
||||||
|
|
@ -302,25 +318,31 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.scroll-view {
|
.scroll-view {
|
||||||
max-height: 50vh;
|
max-height: 60vh;
|
||||||
margin-bottom: 190rpx;
|
margin-bottom: 190rpx;
|
||||||
}
|
|
||||||
|
|
||||||
.list-wrap {
|
.list-wrap {
|
||||||
padding: 28rpx 0 0 28rpx;
|
padding: 0 28rpx;
|
||||||
}
|
|
||||||
|
|
||||||
.ShoppingCart {
|
.ShoppingCart {
|
||||||
margin: 10rpx 0 20rpx 0;
|
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
text-align: center;
|
text-align: left;
|
||||||
color: #969494;
|
padding: 20rpx 0;
|
||||||
|
font-weight: 700;
|
||||||
|
border-bottom: 1rpx solid #cecece;
|
||||||
|
color: #000;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.shop-item:last-child {
|
||||||
|
border-bottom: 1rpx solid #cecece;
|
||||||
|
padding-bottom: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.shop-item {
|
.shop-item {
|
||||||
|
margin-top: 15rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding-bottom: 28rpx;
|
|
||||||
|
|
||||||
.shop-item-content {
|
.shop-item-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -363,8 +385,7 @@
|
||||||
|
|
||||||
.info {
|
.info {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding-left: 20upx;
|
padding-left: 20rpx;
|
||||||
padding-right: 28rpx;
|
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
font-size: 28upx;
|
font-size: 28upx;
|
||||||
|
|
@ -497,24 +518,23 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
// background-color: #fff;
|
|
||||||
border-radius: 20upx;
|
|
||||||
margin-bottom: 28upx;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.cardcalorders {
|
.cardcalorders {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 40rpx 0 20rpx;
|
padding: 20rpx 0;
|
||||||
font-size: 35rpx;
|
font-size: 35rpx;
|
||||||
text-align: left;
|
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #000000;
|
border-bottom: 1rpx solid #cecece;
|
||||||
|
color: #000;
|
||||||
|
|
||||||
.absolute {
|
.absolute {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 28rpx;
|
right: 0;
|
||||||
top: 2rpx;
|
top: 2rpx;
|
||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
}
|
}
|
||||||
|
|
@ -524,23 +544,22 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-right: 20rpx;
|
|
||||||
|
|
||||||
.head {
|
.head {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
// padding: 32rpx 0;
|
|
||||||
.head_left {
|
.head_left {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
padding: 20rpx 0;
|
padding: 20rpx 0;
|
||||||
|
border-bottom: 1rpx solid #cecece;
|
||||||
|
|
||||||
.placeNum {
|
.placeNum {
|
||||||
font-weight: bold;
|
font-weight: 700;
|
||||||
font-size: 32rpx;
|
font-size: 27rpx;
|
||||||
color: #333333;
|
color: #3e3d3d;
|
||||||
}
|
}
|
||||||
|
|
||||||
.placeTime {
|
.placeTime {
|
||||||
|
|
@ -599,7 +618,6 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
padding: 0 28rpx;
|
|
||||||
|
|
||||||
.priceAmount {
|
.priceAmount {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@
|
||||||
<view class="list-box">
|
<view class="list-box">
|
||||||
<view class="left" :style="{top: `${store.height}px`}">
|
<view class="left" :style="{top: `${store.height}px`}">
|
||||||
<scroll-view :scroll-into-view="leftIntoView" :scroll-with-animation="false" :scroll-y="true"
|
<scroll-view :scroll-into-view="leftIntoView" :scroll-with-animation="false" :scroll-y="true"
|
||||||
:style="{height:`${store.screenHeight - store.height}px`}">
|
:style="{height:`${store.screenHeight - store.height}px`}" style="padding-bottom: 200rpx;">
|
||||||
<view class="item" v-for="(item,index) in shopProductList.productInfo" :key="index"
|
<view class="item" v-for="(item,index) in shopProductList.productInfo" :key="index"
|
||||||
:class="{ 'active':index==leftIndex }" :id="'left-'+index" :data-index="index"
|
:class="{ 'active':index==leftIndex }" :id="'left-'+index" :data-index="index"
|
||||||
@click="leftTap(index)"><text>{{item.name}}</text></view>
|
@click="leftTap(index)"><text>{{item.name}}</text></view>
|
||||||
|
|
@ -243,9 +243,9 @@
|
||||||
<!-- 店铺详情 -->
|
<!-- 店铺详情 -->
|
||||||
<shopindex ref="showShopInfoRef"></shopindex>
|
<shopindex ref="showShopInfoRef"></shopindex>
|
||||||
<!-- 购物车 -->
|
<!-- 购物车 -->
|
||||||
<shoppingCartes :cartLists_count="cartLists_count" v-if="matchedProducts.length>0" :cartList="matchedProducts"
|
<shoppingCartes :cartLists_count="cartLists_count" :cartList="matchedProducts" :showCart="showCart"
|
||||||
:showCart="showCart" @customevent='websocketsendMessage' @close="showCart = !showCart"
|
@customevent='websocketsendMessage' @close="showCart = !showCart" :orderinfo="orderinfo"
|
||||||
:orderinfo="orderinfo" @clickcancelOrder='clickcancelOrder'>
|
@clickcancelOrder='clickcancelOrder' v-if="cartLists_count > 0">
|
||||||
</shoppingCartes>
|
</shoppingCartes>
|
||||||
|
|
||||||
<!-- 显示购物车栏 -->
|
<!-- 显示购物车栏 -->
|
||||||
|
|
@ -353,7 +353,6 @@
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="operation-wrap">
|
<view class="operation-wrap">
|
||||||
<view class="btn">
|
<view class="btn">
|
||||||
<up-icon name="minus-circle-fill" color="#E9AB7A" size="25"
|
<up-icon name="minus-circle-fill" color="#E9AB7A" size="25"
|
||||||
|
|
@ -677,13 +676,11 @@
|
||||||
specInfo: selectedSpecsStr.value,
|
specInfo: selectedSpecsStr.value,
|
||||||
id: specifications.item.id
|
id: specifications.item.id
|
||||||
});
|
});
|
||||||
// console.log(result)
|
|
||||||
if (result != true) {
|
if (result != true) {
|
||||||
specifications.sku_id = result.id
|
specifications.sku_id = result.id
|
||||||
specifications.product_id = result.productId
|
specifications.product_id = result.productId
|
||||||
// 添加多规格分组
|
// 添加多规格分组
|
||||||
specifications.item.result = result
|
specifications.item.result = result
|
||||||
// console.log(specifications.item)
|
|
||||||
if (result.isPauseSale == 0) {
|
if (result.isPauseSale == 0) {
|
||||||
canSubmit.value = true;
|
canSubmit.value = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -778,11 +775,15 @@
|
||||||
|
|
||||||
// 多规格 套餐添加数量
|
// 多规格 套餐添加数量
|
||||||
const shopCart = async (i) => {
|
const shopCart = async (i) => {
|
||||||
|
if (i == '-' && shopCartNumber.value >= 0) {
|
||||||
|
shopCartNumber.value = 0
|
||||||
|
return false;
|
||||||
|
}
|
||||||
let res = await shoppingcart()
|
let res = await shoppingcart()
|
||||||
if (i == '-') {
|
if (i == '-') {
|
||||||
if (!res && shopCartNumber.value == specifications.item.suitNum) {
|
if (!res && shopCartNumber.value == specifications.item.suitNum) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: `起点${specifications.item.suitNum}`,
|
title: `起点${specifications.item.suitNum}个`,
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -859,7 +860,6 @@
|
||||||
// 直接返回布尔值
|
// 直接返回布尔值
|
||||||
return result;
|
return result;
|
||||||
} else if (specifications.item.type == 'sku') {
|
} else if (specifications.item.type == 'sku') {
|
||||||
// console.log(product,data, 'product,data')
|
|
||||||
// 多规格
|
// 多规格
|
||||||
return product.cartListinfo.sku_id == data.id && product.cartListinfo.product_id == data
|
return product.cartListinfo.sku_id == data.id && product.cartListinfo.product_id == data
|
||||||
.productId
|
.productId
|
||||||
|
|
@ -897,11 +897,13 @@
|
||||||
|
|
||||||
// 提交选择并执行下一步操作的方法
|
// 提交选择并执行下一步操作的方法
|
||||||
const submitSelection = async () => {
|
const submitSelection = async () => {
|
||||||
|
// 数量不能少于0
|
||||||
if (shopCartNumber.value <= 0) {
|
if (shopCartNumber.value <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ((specifications.item.type == 'package' && allConditionsSatisfied.value) || (specifications.item.type ==
|
||||||
|
'sku' && canSubmit.value)) {
|
||||||
let res = await shoppingcart()
|
let res = await shoppingcart()
|
||||||
console.log(res)
|
|
||||||
|
|
||||||
// 是否是套餐 有就传
|
// 是否是套餐 有就传
|
||||||
if (specifications.item.type != "package") {
|
if (specifications.item.type != "package") {
|
||||||
|
|
@ -916,7 +918,8 @@
|
||||||
operate_type: res ? 'edit' : 'add',
|
operate_type: res ? 'edit' : 'add',
|
||||||
product_id: specifications.product_id,
|
product_id: specifications.product_id,
|
||||||
sku_id: specifications.sku_id,
|
sku_id: specifications.sku_id,
|
||||||
number: res ? await calculateValue(res.cartNumber, '+', shopCartNumber.value) : shopCartNumber
|
number: res ? await calculateValue(res.cartNumber, '+', shopCartNumber.value) :
|
||||||
|
shopCartNumber
|
||||||
.value,
|
.value,
|
||||||
pro_group_info: selectedGroupSnap.value,
|
pro_group_info: selectedGroupSnap.value,
|
||||||
goods_type: specifications.item.type == "package" ? 'package' : '',
|
goods_type: specifications.item.type == "package" ? 'package' : '',
|
||||||
|
|
@ -926,12 +929,18 @@
|
||||||
// 清空套餐选中
|
// 清空套餐选中
|
||||||
selectedGroupSnap.value = []
|
selectedGroupSnap.value = []
|
||||||
showShopsku.value = false
|
showShopsku.value = false
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//获取多规格数据
|
//获取多规格数据
|
||||||
const clickspecifications = async (item, index, indexs, type) => {
|
const clickspecifications = async (item, index, indexs, type) => {
|
||||||
if (item.isSoldStock == 1 || item.isSaleTime == 0) {
|
// 商品类型 single-单规格商品 sku-多规格商品 package-套餐商品 weight-称重商品 coupon-团购券
|
||||||
|
if (item.isSoldStock == 1 || item.isSaleTime == 0 || item.type == 'single' || item.type == 'weight' || (item.type == 'package' && item.groupType == '0')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// 数量清零
|
// 数量清零
|
||||||
|
|
@ -1033,7 +1042,6 @@
|
||||||
initNetworkListener
|
initNetworkListener
|
||||||
} = useWebSocket(options);
|
} = useWebSocket(options);
|
||||||
|
|
||||||
|
|
||||||
//购物车显示
|
//购物车显示
|
||||||
const showCart = ref(false)
|
const showCart = ref(false)
|
||||||
|
|
||||||
|
|
@ -1116,6 +1124,9 @@
|
||||||
// 清空购物车
|
// 清空购物车
|
||||||
if (Message.operate_type == 'cleanup') {
|
if (Message.operate_type == 'cleanup') {
|
||||||
cartList.value = []
|
cartList.value = []
|
||||||
|
setTimeout(() => {
|
||||||
|
Historicalorders()
|
||||||
|
}, 400)
|
||||||
showCart.value = false
|
showCart.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1138,6 +1149,11 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 历史订单
|
||||||
|
if (Message.operate_type == 'clearOrder') {
|
||||||
|
Historicalorders()
|
||||||
|
}
|
||||||
|
|
||||||
// 购物车数据更新从新请求
|
// 购物车数据更新从新请求
|
||||||
if (Message.type == 'product' && Message.data_type == 'product_update' && Message
|
if (Message.type == 'product' && Message.data_type == 'product_update' && Message
|
||||||
.operate_type == 'product_update') {
|
.operate_type == 'product_update') {
|
||||||
|
|
@ -1207,26 +1223,95 @@
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// 计算购物车商品总数量
|
//删除某一个待支付订单
|
||||||
const cartLists_count = computed(() => {
|
const clickcancelOrder = async (data) => {
|
||||||
if (matchedProducts.value.length > 0) {
|
if (data.i == 'all') {
|
||||||
return matchedProducts.value.reduce((sum, item) => {
|
await APIcancelOrder({
|
||||||
// 将 cartNumberToAdd 转换为数字
|
shopId: uni.cache.get('shopId'),
|
||||||
// const num = typeof item.cartNumberToAdd === 'string' ? parseFloat(item.cartNumberToAdd) : item.cartNumberToAdd;
|
orderId: orderinfo.value.id,
|
||||||
const num = typeof item.cartNumber === 'string' ? parseFloat(item.cartNumber) : item
|
})
|
||||||
.cartNumber;
|
|
||||||
return sum + num;
|
|
||||||
}, 0);
|
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
await APIrmPlaceOrder({
|
||||||
|
shopId: uni.cache.get('shopId'),
|
||||||
|
orderId: orderinfo.value.id,
|
||||||
|
placeNum: data.key
|
||||||
|
})
|
||||||
|
}
|
||||||
|
Historicalorders()
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
// 计算购物车商品总价格
|
// 储存是否存在多次下单
|
||||||
|
const orderinfo = ref({})
|
||||||
|
const confirmorderref = ref(null)
|
||||||
|
|
||||||
|
// 结账
|
||||||
|
const orderdetail = async () => {
|
||||||
|
try {
|
||||||
|
await Historicalorders()
|
||||||
|
} catch (error) {}
|
||||||
|
confirmordershow.value = true
|
||||||
|
showCart.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 历史订单
|
||||||
|
const Historicalorders = async (W) => {
|
||||||
|
let res = await APIhistoryOrder({
|
||||||
|
tableCode: uni.cache.get('tableCode'),
|
||||||
|
})
|
||||||
|
orderinfo.value = {
|
||||||
|
id: res.id,
|
||||||
|
detailMap: res.detailMap,
|
||||||
|
placeNum: res.placeNum
|
||||||
|
}
|
||||||
|
if (W) {
|
||||||
|
showCart.value = !showCart.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提取合并 orderinfo.detailMap 数组的逻辑
|
||||||
|
function combineOrderInfoDetailMap(orderinfo) {
|
||||||
|
if (!orderinfo) return [];
|
||||||
|
let combinedArray = [];
|
||||||
|
for (const key in orderinfo.detailMap) {
|
||||||
|
if (orderinfo.detailMap.hasOwnProperty(key)) {
|
||||||
|
let subArray = orderinfo.detailMap[key];
|
||||||
|
combinedArray = [...combinedArray, ...subArray];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return combinedArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算购物车商品费用
|
||||||
const totalPrices = computed(() => {
|
const totalPrices = computed(() => {
|
||||||
|
// 待支付订单
|
||||||
|
let cartone = 0
|
||||||
|
if (orderinfo.value) {
|
||||||
|
let combinedArray = [];
|
||||||
|
for (const key in orderinfo.value.detailMap) {
|
||||||
|
if (orderinfo.value.detailMap.hasOwnProperty(key)) {
|
||||||
|
let subArray = orderinfo.value.detailMap[key];
|
||||||
|
combinedArray = [...combinedArray, ...subArray]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 购物车总数价格
|
||||||
|
cartone = combinedArray.reduce((total, item) => {
|
||||||
|
// 是否启用会员价 0否1是
|
||||||
|
if (shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1) {
|
||||||
|
// memberPrice会员价
|
||||||
|
return total + (parseFloat(item.memberPrice || item.price) * parseFloat(item.num - item
|
||||||
|
.returnNum));
|
||||||
|
} else {
|
||||||
|
// salePrice销售价
|
||||||
|
return total + (parseFloat(item.price || 0) * parseFloat(item.num - item.returnNum));
|
||||||
|
}
|
||||||
|
}, 0);
|
||||||
|
}
|
||||||
|
console.log(cartone, 'orderinfo.value')
|
||||||
|
// 购物车总数价格
|
||||||
|
let cart = 0
|
||||||
if (matchedProducts.value.length > 0) {
|
if (matchedProducts.value.length > 0) {
|
||||||
// 购物车总数价格
|
// 购物车总数价格
|
||||||
let cart = matchedProducts.value.reduce((total, item) => {
|
cart = matchedProducts.value.reduce((total, item) => {
|
||||||
if (item.type == 'sku') {
|
if (item.type == 'sku') {
|
||||||
item.skuList.forEach((i, t) => {
|
item.skuList.forEach((i, t) => {
|
||||||
if (item.cartListinfo.sku_id == i.id) {
|
if (item.cartListinfo.sku_id == i.id) {
|
||||||
|
|
@ -1245,56 +1330,29 @@
|
||||||
return total + parseFloat(item.salePrice || 0) * parseFloat(item.cartNumber);
|
return total + parseFloat(item.salePrice || 0) * parseFloat(item.cartNumber);
|
||||||
}
|
}
|
||||||
}, 0);
|
}, 0);
|
||||||
return parseFloat(cart.toFixed(2));
|
|
||||||
} else {
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
cart = parseFloat(cartone) + parseFloat(cart)
|
||||||
|
console.log(cart, 'orderinfo.value')
|
||||||
|
// 向上取整并保留两位小数
|
||||||
|
return parseFloat(cart.toFixed(2));
|
||||||
});
|
});
|
||||||
|
|
||||||
//删除某一个待支付订单
|
// 计算购物车商品总数量
|
||||||
const clickcancelOrder = async (i, key) => {
|
const cartLists_count = computed(() => {
|
||||||
if (i == 'all') {
|
const combinedOrderInfo = combineOrderInfoDetailMap(orderinfo.value);
|
||||||
await APIcancelOrder({
|
const orderInfoCount = combinedOrderInfo.reduce((sum, item) => {
|
||||||
shopId: uni.cache.get('shopId'),
|
return sum + parseFloat(item.num);
|
||||||
orderId: orderinfo.id,
|
}, 0);
|
||||||
})
|
|
||||||
} else {
|
|
||||||
await APIrmPlaceOrder({
|
|
||||||
shopId: uni.cache.get('shopId'),
|
|
||||||
orderId: orderinfo.id,
|
|
||||||
placeNum: key
|
|
||||||
})
|
|
||||||
}
|
|
||||||
Historicalorders()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 储存是否存在多次下单
|
const matchedProductsCount = matchedProducts.value.reduce((sum, item) => {
|
||||||
const orderinfo = ref({})
|
const num = typeof item.cartNumber === 'string' ? parseFloat(item.cartNumber) : item
|
||||||
const confirmorderref = ref(null)
|
.cartNumber;
|
||||||
|
return sum + num;
|
||||||
|
}, 0);
|
||||||
|
|
||||||
// 结账
|
const totalCount = orderInfoCount + matchedProductsCount;
|
||||||
const orderdetail = async () => {
|
return parseFloat(totalCount.toFixed(2));
|
||||||
try {
|
});
|
||||||
await Historicalorders()
|
|
||||||
} catch (error) {}
|
|
||||||
confirmordershow.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
// 历史订单
|
|
||||||
const Historicalorders = async (W) => {
|
|
||||||
let res = await APIhistoryOrder({
|
|
||||||
tableCode: uni.cache.get('tableCode'),
|
|
||||||
})
|
|
||||||
orderinfo.value = {
|
|
||||||
id: res.id,
|
|
||||||
detailMap: res.detailMap,
|
|
||||||
placeNum: res.placeNum
|
|
||||||
}
|
|
||||||
if (W) {
|
|
||||||
showCart.value = !showCart.value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 定义 ifcartNumber 计算属性方法 展示数量
|
// 定义 ifcartNumber 计算属性方法 展示数量
|
||||||
const ifcartNumber = computed(() => {
|
const ifcartNumber = computed(() => {
|
||||||
|
|
@ -1407,7 +1465,8 @@
|
||||||
// userStore.actionsAPIuser()
|
// userStore.actionsAPIuser()
|
||||||
// 数据可以更新
|
// 数据可以更新
|
||||||
isDataLoaded.value = true;
|
isDataLoaded.value = true;
|
||||||
|
// 历史订单
|
||||||
|
Historicalorders()
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '暂无列表数据,请重新扫码',
|
title: '暂无列表数据,请重新扫码',
|
||||||
|
|
|
||||||
|
|
@ -1,44 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<block v-if="!dataform.queueInfo">
|
<block v-if="dataform.queueInfo">
|
||||||
<image class="top_bg" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/queueUp/queueUp_bg.png"
|
|
||||||
mode="aspectFill"></image>
|
|
||||||
<view class="content">
|
|
||||||
<image class="top_img" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/queueUp/queueUp_img.png"
|
|
||||||
mode="aspectFill"></image>
|
|
||||||
<view class="head">
|
|
||||||
<image class="avatar" :src="dataform.shopInfo.logo" mode="aspectFill"></image>
|
|
||||||
<view class="head_text">
|
|
||||||
<text class="shopName">{{shopInfo.shopName}}</text>
|
|
||||||
<text class="tip">{{dataform.shopInfo.status == 1 ? '营业中' : '休息中'}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="center">
|
|
||||||
<view class="center_head">
|
|
||||||
<text>餐桌类型</text>
|
|
||||||
<text>等待桌数</text>
|
|
||||||
<text>预计等待</text>
|
|
||||||
</view>
|
|
||||||
<view class="center_list" v-for="(item,index) in tableList" :key="index">
|
|
||||||
<view class="w center_list_item">
|
|
||||||
<text>{{item.name||''}}</text>
|
|
||||||
<text>{{item.note||''}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="w center_list_item">
|
|
||||||
<text>{{item.waitingCount}}</text>
|
|
||||||
<text>桌</text>
|
|
||||||
</view>
|
|
||||||
<view class="w time">约{{item.waitTime}}分钟</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="addBtn" @click="dataform.show = true" v-if="dataform.shopInfo.status == 1">
|
|
||||||
立即排队
|
|
||||||
</view>
|
|
||||||
</block>
|
|
||||||
|
|
||||||
<block v-else>
|
|
||||||
<view class="result"
|
<view class="result"
|
||||||
style="background: url('https://czg-qr-order.oss-cn-beijing.aliyuncs.com/queueUp/queueUp_su_bg.png') no-repeat center 26rpx / 96%;">
|
style="background: url('https://czg-qr-order.oss-cn-beijing.aliyuncs.com/queueUp/queueUp_su_bg.png') no-repeat center 26rpx / 96%;">
|
||||||
<view class="head">
|
<view class="head">
|
||||||
|
|
@ -60,7 +22,7 @@
|
||||||
<view class="footer_item_bom">前方等待桌数</view>
|
<view class="footer_item_bom">前方等待桌数</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="footer_item">
|
<view class="footer_item">
|
||||||
<view class="footer_item_top"><text>≥{{dataform.queueInfo.waitTime||''}}</text><text>分钟</text>
|
<view class="footer_item_top"><text>≥{{dataform.queueInfo.waitTime || 0}}</text><text>分钟</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="footer_item_bom">预计等待时长</view>
|
<view class="footer_item_bom">预计等待时长</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -73,8 +35,43 @@
|
||||||
取消排队
|
取消排队
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
</view>
|
||||||
|
</block>
|
||||||
|
<block v-else>
|
||||||
|
<image class="top_bg" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/queueUp/queueUp_bg.png"
|
||||||
|
mode="aspectFill"></image>
|
||||||
|
<view class="content">
|
||||||
|
<image class="top_img" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/queueUp/queueUp_img.png"
|
||||||
|
mode="aspectFill"></image>
|
||||||
|
<view class="head">
|
||||||
|
<image class="avatar" :src="dataform.shopInfo.logo" mode="aspectFill"></image>
|
||||||
|
<view class="head_text">
|
||||||
|
<text class="shopName">{{dataform.shopInfo.shopName}}</text>
|
||||||
|
<text class="tip">{{dataform.shopInfo.status == 1 ? '营业中' : '休息中'}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="center">
|
||||||
|
<view class="center_head">
|
||||||
|
<text>餐桌类型</text>
|
||||||
|
<text>等待桌数</text>
|
||||||
|
<text>预计等待</text>
|
||||||
|
</view>
|
||||||
|
<view class="center_list" v-for="(item,index) in tableList" :key="index">
|
||||||
|
<view class="w center_list_item">
|
||||||
|
<text>{{item.name||''}}</text>
|
||||||
|
<text>{{item.note||''}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="w center_list_item">
|
||||||
|
<text>{{item.nearNum}}</text>
|
||||||
|
<text>桌</text>
|
||||||
|
</view>
|
||||||
|
<view class="w time">约{{item.waitTime}}分钟</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="addBtn" @click="dataform.show = true" v-if="dataform.shopInfo.status == 1">
|
||||||
|
立即排队
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
|
|
@ -120,7 +117,8 @@
|
||||||
ref,
|
ref,
|
||||||
onMounted,
|
onMounted,
|
||||||
getCurrentInstance,
|
getCurrentInstance,
|
||||||
nextTick
|
nextTick,
|
||||||
|
onShow
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
|
|
||||||
//接口引入
|
//接口引入
|
||||||
|
|
@ -129,7 +127,8 @@
|
||||||
APIusercallTable,
|
APIusercallTable,
|
||||||
APIqueuecallTable,
|
APIqueuecallTable,
|
||||||
APIqueuedetail,
|
APIqueuedetail,
|
||||||
APIcallTablesubMsg
|
APIcallTablesubMsg,
|
||||||
|
APIqueuecancel
|
||||||
} from "@/common/api/subscribeto.js";
|
} from "@/common/api/subscribeto.js";
|
||||||
|
|
||||||
// 获取全局属性
|
// 获取全局属性
|
||||||
|
|
@ -146,11 +145,10 @@
|
||||||
phone: "",
|
phone: "",
|
||||||
callTableId: "",
|
callTableId: "",
|
||||||
shopInfo: {
|
shopInfo: {
|
||||||
logo: '',
|
|
||||||
shopName: ''
|
shopName: ''
|
||||||
},
|
},
|
||||||
queueInfo: null,
|
queueInfo: null,
|
||||||
shopId: "",
|
shopId: 29,
|
||||||
queueId: "",
|
queueId: "",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -164,31 +162,15 @@
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取排号状态
|
|
||||||
const getQueueUpState = async () => {
|
|
||||||
let params = {
|
|
||||||
shopId: dataform.shopId,
|
|
||||||
}
|
|
||||||
if (dataform.queueId) {
|
|
||||||
params.queueId = dataform.queueId;
|
|
||||||
}
|
|
||||||
let res = await APIusercallTable(params)
|
|
||||||
|
|
||||||
if (res) {
|
|
||||||
dataform.shopInfo = res.data.shopInfo;
|
|
||||||
dataform.queueInfo = res.data.queueInfo;
|
|
||||||
dataform.queueId = dataform.queueInfo.id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取排号数据
|
// 获取排号列表
|
||||||
const getQueueUpList = async () => {
|
const userorderList = async () => {
|
||||||
let res = await APIqueuecallTable({
|
let res = await APIusercallTable({
|
||||||
shopId: dataform.shopId,
|
shopId: dataform.shopId,
|
||||||
|
queueId: dataform.queueId
|
||||||
})
|
})
|
||||||
if (res) {
|
tableList.value = res.records
|
||||||
queueUpList.value = res.data;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 叫号队列详情
|
// 叫号队列详情
|
||||||
|
|
@ -198,11 +180,11 @@
|
||||||
openId: uni.cache.get('userInfo').wechatOpenId,
|
openId: uni.cache.get('userInfo').wechatOpenId,
|
||||||
})
|
})
|
||||||
if (res.queueInfo) {
|
if (res.queueInfo) {
|
||||||
tableList.value = res.data;
|
dataform.queueInfo = res.queueInfo;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
getQueueUpState()
|
userorderList()
|
||||||
}
|
}
|
||||||
|
dataform.shopInfo = res.shopInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 订阅通知
|
// 订阅通知
|
||||||
|
|
@ -210,7 +192,7 @@
|
||||||
let res = await APIcallTablesubMsg({
|
let res = await APIcallTablesubMsg({
|
||||||
openId: uni.cache.get('userInfo').wechatOpenId,
|
openId: uni.cache.get('userInfo').wechatOpenId,
|
||||||
shopId: dataform.shopId,
|
shopId: dataform.shopId,
|
||||||
queueId: dataform.queueId,
|
queueId: dataform.queueInfo.id,
|
||||||
})
|
})
|
||||||
if (res) {
|
if (res) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
|
|
@ -238,17 +220,17 @@
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let res = await this.api.getTakeNumber({
|
let res = await APIcallTabletakeNumber({
|
||||||
openId: uni.cache.get('miniAppOpenId'),
|
openId: uni.cache.get('userInfo').wechatOpenId,
|
||||||
shopId: dataform.shopId,
|
shopId: dataform.shopId,
|
||||||
phone: dataform.phone,
|
phone: dataform.phone,
|
||||||
callTableId: dataform.callTableId,
|
callTableId: dataform.callTableId,
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
if (res) {
|
||||||
dataform.phone = "";
|
dataform.phone = "";
|
||||||
dataform.queueId = res.data.id;
|
dataform.queueId = res.id;
|
||||||
getQueueUpState();
|
|
||||||
dataform.show = false;
|
dataform.show = false;
|
||||||
|
getQueueUpTablList()
|
||||||
uni.requestSubscribeMessage({
|
uni.requestSubscribeMessage({
|
||||||
tmplIds: ["qUhvEfvCtIcBA3DOn3QMqsGOolrEpyr0YBh99i-AUqw",
|
tmplIds: ["qUhvEfvCtIcBA3DOn3QMqsGOolrEpyr0YBh99i-AUqw",
|
||||||
"yxOjWK-KjMEZ_BaHWqDJJpHiUPXN6JWqr7u9y65RIWM",
|
"yxOjWK-KjMEZ_BaHWqDJJpHiUPXN6JWqr7u9y65RIWM",
|
||||||
|
|
@ -264,14 +246,11 @@
|
||||||
|
|
||||||
// 取消排队
|
// 取消排队
|
||||||
const cancelTakeNumber = async () => {
|
const cancelTakeNumber = async () => {
|
||||||
let res = await this.api.cancelTakeNumber({
|
let res = await APIqueuecancel({
|
||||||
queueId: dataform.queueInfo.id,
|
queueId: dataform.queueInfo.id,
|
||||||
shopId: dataform.shopId,
|
shopId: dataform.shopId,
|
||||||
})
|
})
|
||||||
if (res) {
|
|
||||||
getQueueUpTablList();
|
getQueueUpTablList();
|
||||||
getQueueUpState();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 切换桌型
|
// 切换桌型
|
||||||
|
|
@ -281,7 +260,7 @@
|
||||||
|
|
||||||
// 弹窗关闭监听
|
// 弹窗关闭监听
|
||||||
const close = async () => {
|
const close = async () => {
|
||||||
this.phone = "";
|
dataform.phone = "";
|
||||||
if (tableList.value.length > 0) {
|
if (tableList.value.length > 0) {
|
||||||
dataform.callTableId = tableList.value[0].id;
|
dataform.callTableId = tableList.value[0].id;
|
||||||
}
|
}
|
||||||
|
|
@ -291,28 +270,28 @@
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await proxy.$onLaunched;
|
await proxy.$onLaunched;
|
||||||
// 获取当前页面栈
|
// 获取当前页面栈
|
||||||
const pages = getCurrentPages();
|
// const pages = getCurrentPages();
|
||||||
// 获取当前页面实例
|
// // 获取当前页面实例
|
||||||
const currentPage = pages[pages.length - 1];
|
// const currentPage = pages[pages.length - 1];
|
||||||
// 获取页面参数
|
// // 获取页面参数
|
||||||
const options = currentPage.options;
|
// const options = currentPage.options;
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
// // #ifdef MP-WEIXIN
|
||||||
if (options.q) {
|
// if (options.q) {
|
||||||
dataform.shopId = getQueryString(decodeURIComponent(options.q), 'shopId')
|
// dataform.shopId = getQueryString(decodeURIComponent(options.q), 'shopId')
|
||||||
dataform.queueId = getQueryString(decodeURIComponent(options.q), 'queueId')
|
// dataform.queueId = getQueryString(decodeURIComponent(options.q), 'queueId')
|
||||||
}
|
// }
|
||||||
// #endif
|
// // #endif
|
||||||
console.log(dataform.shopId, 11)
|
// // #ifdef MP-ALIPAY
|
||||||
// #ifdef MP-ALIPAY
|
// if (getApp().globalData.shopId) {
|
||||||
if (getApp().globalData.shopId) {
|
// dataform.shopId = getApp().globalData.shopId
|
||||||
dataform.shopId = getApp().globalData.shopId
|
// }
|
||||||
}
|
// if (getApp().globalData.queueId) {
|
||||||
if (getApp().globalData.queueId) {
|
// dataform.queueId = getApp().globalData.queueId
|
||||||
dataform.queueId = getApp().globalData.queueId
|
// }
|
||||||
}
|
//// #endif
|
||||||
// #endif
|
|
||||||
await nextTick()
|
await nextTick()
|
||||||
|
uni.cache.set('shopId', 29, 30)
|
||||||
getQueueUpTablList();
|
getQueueUpTablList();
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue