问题修复,下单修复

This commit is contained in:
2025-09-29 16:54:35 +08:00
parent 719a513371
commit afa769579a
16 changed files with 417 additions and 167 deletions

View File

@@ -28,7 +28,7 @@ import {
export const useCartsStore = defineStore('cart',
() => {
// 商品订单会员
// 店铺信息
const shopInfo = ref(uni.cache.get('shopInfo') || {
isMemberPrice: 0,
isTableFee: 1
@@ -97,10 +97,10 @@ export const useCartsStore = defineStore('cart',
}
//餐位费配置
const dinersNum = uni.cache.set('dinersNum') || 1
const dinersNum = uni.cache.get('dinersNum') || 0
const seatFeeConfig = ref({
pricePerPerson: shopInfo.value.tableFee || 1,
personCount: dinersNum,
pricePerPerson: shopInfo.value.tableFee || 0,
personCount: dinersNum||0,
isEnabled: !shopInfo.value.isTableFee
})
watch(() => shopInfo.value.isTableFee, (newval) => {
@@ -555,7 +555,14 @@ export const useCartsStore = defineStore('cart',
return result;
});
function clearOrderConfig(){
backendCoupons.value=[];
seatFeeConfig.value.personCount=uni.cache.get('dinersNum') || 0;
dinnerType.value='dine-in';
userPoints.value=0
}
return {
getTotalPackFee,
@@ -582,6 +589,8 @@ export const useCartsStore = defineStore('cart',
//优惠券列表
backendCoupons,
allGoods,
//就餐类型
dinnerType,
setDinnerType,
setSeatFeeConfig,
seatFeeConfig,
@@ -591,6 +600,8 @@ export const useCartsStore = defineStore('cart',
//新客立减金额
newUserDiscount,
getAllGoodsList,
//清空配置
clearOrderConfig
};
}

View File

@@ -132,6 +132,10 @@ export const Memberpay = defineStore('memberpay', {
buyerRemark: data.buyerRemark,
userId: uni.cache.get('userInfo').id || ''
})
if(!res){
console.log('支付失败');
reject(false)
}
if (res) {
uni.showLoading({
title: '加载中...',
@@ -235,7 +239,7 @@ export const Memberpay = defineStore('memberpay', {
seatNum: data.seatNum, //用餐人数
packFee: data.packFee, //打包费
originAmount: data.originAmount, //订单原金额(包含打包费) 不含折扣价格 不含餐位费
tableCode: uni.cache.get('tableCode'), //台桌编码
tableCode:data.tableCode|| uni.cache.get('tableCode'), //台桌编码
dineMode: 'dine-in', //堂食 dine-in 外带 take-out 外卖 take-away
remark: data.remark, //备注
placeNum: data.placeNum, //当前订单下单次数