扫码排队

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(() => {