扫码排队

This commit is contained in:
wwz
2025-04-02 14:12:57 +08:00
parent e352acbdd0
commit a95315f42a
8 changed files with 547 additions and 516 deletions

View File

@@ -37,7 +37,7 @@
<view class="info">
<text class="productName">{{item.productName}}</text>
<text class="productSkuName"
v-if="item.productSkuName">{{item.productSkuName}}</text>
v-if="item.skuName">{{item.skuName}}</text>
</view>
<view class="price">
@@ -69,7 +69,7 @@
{{item.cartListinfo.sku_id == i.id ? i.name :""}}
</text>
</text>
<text class="type" v-if="item.type == 'package'">
<text v-for="(a,b) in dataprocessing(item.cartListinfo)" :key="b">
<text v-for="i in a.goods" :key="i.proId" style="margin-left: 4rpx;">
@@ -135,7 +135,8 @@
const props = defineProps({
cartList: {
type: Array
type: Array,
default: []
},
cartLists_count: {
type: Number,
@@ -263,71 +264,36 @@
// 提交订单
const orderdetail = async () => {
let res = await storeMemberpay.actionscreateOrder({
dineMode: 'dine-in', //堂食 dine-in 外带 take-out 外卖 take-away
seatNum: uni.cache.get('dinersNum') ? uni.cache.get('dinersNum') : '', //用餐人数
// packFee: packFee.value, //打包费
packFee: 0, //打包费
originAmount: totalPrices.value, //订单原金额(包含打包费) 不含折扣价格 不含餐位
remark: remark.value, //备注
placeNum: props.orderinfo.placeNum + 1, //当前订单下单次数
waitCall: '', //是否等叫 0 否 1 等叫
orderId: props.orderinfo.id,
userId: uni.cache.get('userInfo').id || '' //
})
// 清空购物车
emits('customevent', {
type: 'shopping',
table_code: uni.cache.get('tableCode'),
shop_id: uni.cache.get('shopId'),
operate_type: 'cleanup',
})
// uni.pro.redirectTo('order/detail', {
// orderId: res.id,
// shopId: uni.cache.get('shopId')
// })
uni.reLaunch({
url: '/pages/order/detail?orderId=' + res.id + '&shopId=' + uni.cache.get('shopId')
})
// uni.pro.navigateTo('order/detail', {
// orderId: res.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
// });
// }
// }
if (props.cartList.length > 0) {
let res = await storeMemberpay.actionscreateOrder({
dineMode: 'dine-in', //堂食 dine-in 外带 take-out 外卖 take-away
seatNum: uni.cache.get('dinersNum') ? uni.cache.get('dinersNum') : '', //用餐人数
// packFee: packFee.value, //打包费
packFee: 0, //打包
originAmount: totalPrices.value, //订单原金额(包含打包费) 不含折扣价格 不含餐位费
remark: remark.value, //备注
placeNum: props.orderinfo.placeNum + 1, //当前订单下单次数
waitCall: '', //是否等叫 0 否 1 等叫
orderId: props.orderinfo.id,
userId: uni.cache.get('userInfo').id || '' //
})
// 清空购物车
emits('customevent', {
type: 'shopping',
table_code: uni.cache.get('tableCode'),
shop_id: uni.cache.get('shopId'),
operate_type: 'cleanup',
})
uni.reLaunch({
url: '/pages/order/detail?orderId=' + res.id + '&shopId=' + uni.cache.get('shopId')
})
} else {
uni.reLaunch({
url: '/pages/order/detail?orderId=' + props.orderinfo.id + '&shopId=' + uni.cache.get(
'shopId')
})
}
}
const dataprocessing = computed(() => {

View File

@@ -3,70 +3,80 @@
<up-popup :show="showCart" :round="20" :safeAreaInsetBottom="false" :zIndex="98" :overlayStyle="{ zIndex: 98 }"
@close="close">
<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="clear" @click="cartclear">
<up-icon name="trash" color="#999"></up-icon>
<text class="t">清空</text>
</view>
</view>
</view> -->
<scroll-view scroll-y class="scroll-view">
<view class="list-wrap">
<view class="ShoppingCart">
购物车
</view>
<view class="shop-item" v-for="(item,index) in cartList" :key="item.id">
<view class="shop-item-content">
<view class="cover" v-if="item.productId!=-999">
<up-image :src="item.coverImg" width="80" radius="10" height="80"></up-image>
<view v-if="cartList.length>0">
<view class="ShoppingCart flex-between">
<view>
购物车
</view>
<view class="info">
<view class="name"> {{item.cartListinfo.is_temporary == 1?'临时菜' :item.name }}
<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-content">
<view class="cover" v-if="item.productId!=-999">
<up-image :src="item.coverImg" width="80" radius="10" height="80"></up-image>
</view>
<view class="select-sku-wrap" v-if="item.type == 'sku'">
<text v-for="i in item.skuList" :key="i.id">
{{item.cartListinfo.sku_id == i.id? i.name:"" }}
</text>
</view>
<view class="select-sku-wrap" v-if="item.type == 'package'">
<view v-for="(a,b) in dataprocessing(item.cartListinfo)" :key="b">
<!-- <view>{{a.title}}</view> -->
<text v-for="i in a.goods" :key="i.proId" style="margin-left: 4rpx;">
{{i.proName }}
<view class="info">
<view class="name"> {{item.cartListinfo.is_temporary == 1?'临时菜' :item.name }}
</view>
<view class="select-sku-wrap" v-if="item.type == 'sku'">
<text v-for="i in item.skuList" :key="i.id">
{{item.cartListinfo.sku_id == i.id? i.name:"" }}
</text>
</view>
</view>
<view class="price-wrap" style="padding-top: 0;">
<view class="price">
<text class="i"></text>
<!-- 会员价与价格 -->
<text class="price" v-if="item.type == 'sku'">
<text v-for="i in item.skuList" :key="i.id">
<!-- -->
{{item.cartListinfo.sku_id == i.id?(shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?(i.memberPrice || i.salePrice):i.salePrice):''}}
<view class="select-sku-wrap" v-if="item.type == 'package'">
<view v-for="(a,b) in dataprocessing(item.cartListinfo)" :key="b">
<!-- <view>{{a.title}}</view> -->
<text v-for="i in a.goods" :key="i.proId" style="margin-left: 4rpx;">
{{i.proName }}
</text>
</text>
<text class="price" v-else>
{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?(item.memberPrice || item.salePrice):item.salePrice}}
</text>
<!-- <text class="originalprice"
v-if="item.originPrice">¥{{item.originPrice}}</text>
<text class="unit" v-if="item.unitName">/{{item.unitName}}</text> -->
</view>
<view class="operation-wrap">
<view class="btn">
<up-icon name="minus-circle-fill" size="25"></up-icon>
<view class="btnClick" @click="cartListadd(item,'-')"></view>
</view>
<text class="num">{{ ifcartNumber(item) }}</text>
<view class="btn">
<!-- <up-icon name="plus-circle-fill"
:color="{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1? '#CECECE' : '#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>
<view class="price-wrap" style="padding-top: 0;">
<view class="price">
<text class="i"></text>
<!-- 会员价与价格 -->
<text class="price" v-if="item.type == 'sku'">
<text v-for="i in item.skuList" :key="i.id">
<!-- -->
{{item.cartListinfo.sku_id == i.id?(shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?(i.memberPrice || i.salePrice):i.salePrice):''}}
</text>
</text>
<text class="price" v-else>
{{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1?(item.memberPrice || item.salePrice):item.salePrice}}
</text>
<!-- <text class="originalprice"
v-if="item.originPrice">¥{{item.originPrice}}</text>
<text class="unit" v-if="item.unitName">/{{item.unitName}}</text> -->
</view>
<view class="operation-wrap">
<view class="btn">
<up-icon name="minus-circle-fill" size="25"></up-icon>
<view class="btnClick" @click="cartListadd(item,'-')"></view>
</view>
<text class="num">{{ ifcartNumber(item) }}</text>
<view class="btn">
<!-- <up-icon name="plus-circle-fill"
:color="{shopInfo.isVip ==1 && shopInfo.isMemberPrice==1? '#CECECE' : '#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>
</view>
</view>
</view>
@@ -76,11 +86,11 @@
<!-- 历史订单 -->
<view class="card" v-if="orderinfo.detailMap">
<!-- 订单头部 -->
<view class="cardcalorders">
<view class="cardcalorders flex-between">
<!-- ··· 历史订单 ··· -->
历史订单
<view class="absolute flex-start">
<up-icon name="trash" color="#999"></up-icon>
<text>待支付订单</text>
<view class="flex-start">
<up-icon name="trash" color="#999" size="20"></up-icon>
<text style="color:' #999;'" @click="clickcancelOrder('all')">清空历史订单</text>
</view>
</view>
@@ -90,7 +100,7 @@
<text class="placeNum">{{key}}次下单</text>
<view class="placeTime flex-start">
<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>
@@ -107,7 +117,7 @@
<view class="info">
<text class="productName">{{item.productName}}</text>
<text class="productSkuName"
v-if="item.productSkuName">{{item.productSkuName}}</text>
v-if="item.skuName">{{item.skuName}}</text>
</view>
<view class="price">
@@ -232,6 +242,12 @@
i,
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) => {
@@ -302,195 +318,202 @@
}
.scroll-view {
max-height: 50vh;
max-height: 60vh;
margin-bottom: 190rpx;
}
.list-wrap {
padding: 28rpx 0 0 28rpx;
}
.list-wrap {
padding: 0 28rpx;
.ShoppingCart {
margin: 10rpx 0 20rpx 0;
font-size: 30rpx;
text-align: center;
color: #969494;
}
.ShoppingCart {
font-size: 30rpx;
text-align: left;
padding: 20rpx 0;
font-weight: 700;
border-bottom: 1rpx solid #cecece;
color: #000;
.shop-item {
display: flex;
flex-direction: column;
padding-bottom: 28rpx;
.shop-item-content {
display: flex;
justify-content: center;
align-items: center;
}
.shop-item-remark {
display: flex;
align-items: center;
padding-right: 180rpx;
margin-top: 10rpx;
.label {
font-size: 28rpx;
color: #666;
margin-right: 20rpx;
}
}
.langcover {
position: relative;
}
.langcover::after {
content: '加载中..';
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-color: #e8e8e8;
color: #6b6b6b;
border-radius: 10rpx;
text-align: center;
line-height: 180rpx;
z-index: 1;
}
.info {
flex: 1;
padding-left: 20upx;
padding-right: 28rpx;
.name {
font-size: 28upx;
font-weight: bold;
color: #333;
margin-bottom: 5rpx;
.shop-item:last-child {
border-bottom: 1rpx solid #cecece;
padding-bottom: 20rpx;
}
.select-sku-wrap {
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.price-wrap {
margin-top: 16rpx;
.shop-item {
margin-top: 15rpx;
display: flex;
align-items: center;
justify-content: space-between;
flex-direction: column;
.price {
.shop-item-content {
display: flex;
align-items: flex-end;
.i,
.num {
font-weight: bold;
font-size: 32rpx;
color: #333333;
}
.i {
position: relative;
bottom: 4upx;
}
.price {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 36rpx;
color: #333333;
}
.originalprice {
margin-left: 10rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 20rpx;
text-decoration: line-through;
}
.unit {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 36rpx;
color: #333333;
}
.lineThrough {
font-weight: normal;
text-decoration: line-through;
color: #999 !important;
font-size: 24rpx !important;
}
}
.sku-wrap {
padding: 6upx 16upx;
background-color: #ffd100;
border-radius: 12upx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
align-items: center;
}
.t {
font-size: 24upx;
font-weight: bold;
}
.shop-item-remark {
display: flex;
align-items: center;
padding-right: 180rpx;
margin-top: 10rpx;
.dot {
display: flex;
align-items: center;
justify-content: center;
font-size: 20upx;
position: absolute;
padding: 2upx 12upx;
border-radius: 8upx;
background-color: #eb5232;
color: #fff;
position: absolute;
top: -14upx;
right: -8upx;
.label {
font-size: 28rpx;
color: #666;
margin-right: 20rpx;
}
}
.operation-wrap {
display: flex;
align-items: center;
.langcover {
position: relative;
}
.num {
font-size: 32upx;
padding: 0 16upx;
.langcover::after {
content: '加载中..';
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-color: #e8e8e8;
color: #6b6b6b;
border-radius: 10rpx;
text-align: center;
line-height: 180rpx;
z-index: 1;
}
.info {
flex: 1;
padding-left: 20rpx;
.name {
font-size: 28upx;
font-weight: bold;
color: #333;
margin-bottom: 5rpx;
}
.btn {
position: relative;
.select-sku-wrap {
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
.price-wrap {
margin-top: 16rpx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
justify-content: space-between;
.btnClick {
width: 100rpx;
height: 100rpx;
position: absolute;
// bottom: 0;
.price {
display: flex;
align-items: flex-end;
.i,
.num {
font-weight: bold;
font-size: 32rpx;
color: #333333;
}
.i {
position: relative;
bottom: 4upx;
}
.price {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: bold;
font-size: 36rpx;
color: #333333;
}
.originalprice {
margin-left: 10rpx;
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 20rpx;
text-decoration: line-through;
}
.unit {
font-family: Source Han Sans CN, Source Han Sans CN;
font-weight: 400;
font-size: 36rpx;
color: #333333;
}
.lineThrough {
font-weight: normal;
text-decoration: line-through;
color: #999 !important;
font-size: 24rpx !important;
}
}
.btnClick.l {
right: 0;
.sku-wrap {
padding: 6upx 16upx;
background-color: #ffd100;
border-radius: 12upx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.t {
font-size: 24upx;
font-weight: bold;
}
.dot {
display: flex;
align-items: center;
justify-content: center;
font-size: 20upx;
position: absolute;
padding: 2upx 12upx;
border-radius: 8upx;
background-color: #eb5232;
color: #fff;
position: absolute;
top: -14upx;
right: -8upx;
}
}
.btnClick.r {
left: 0;
.operation-wrap {
display: flex;
align-items: center;
.num {
font-size: 32upx;
padding: 0 16upx;
}
.btn {
position: relative;
display: flex;
align-items: center;
justify-content: center;
position: relative;
.btnClick {
width: 100rpx;
height: 100rpx;
position: absolute;
// bottom: 0;
}
.btnClick.l {
right: 0;
}
.btnClick.r {
left: 0;
}
}
}
}
}
@@ -499,22 +522,19 @@
}
.card {
// background-color: #fff;
border-radius: 20upx;
margin-bottom: 28upx;
position: relative;
.cardcalorders {
position: relative;
margin: 40rpx 0 20rpx;
padding: 20rpx 0;
font-size: 35rpx;
text-align: left;
font-weight: bold;
color: #000000;
border-bottom: 1rpx solid #cecece;
color: #000;
.absolute {
position: absolute;
right: 28rpx;
right: 0;
top: 2rpx;
font-size: 24rpx;
}
@@ -524,23 +544,22 @@
display: flex;
flex-direction: column;
position: relative;
padding-right: 20rpx;
.head {
display: flex;
justify-content: space-between;
// padding: 32rpx 0;
.head_left {
width: 100%;
display: flex;
justify-content: space-between;
padding: 20rpx 0;
border-bottom: 1rpx solid #cecece;
.placeNum {
font-weight: bold;
font-size: 32rpx;
color: #333333;
font-weight: 700;
font-size: 27rpx;
color: #3e3d3d;
}
.placeTime {
@@ -599,7 +618,6 @@
display: flex;
flex-direction: column;
align-items: flex-end;
padding: 0 28rpx;
.priceAmount {
font-weight: 500;