|
|
|
|
@@ -442,6 +442,9 @@ const orderorderInfo = async () => {
|
|
|
|
|
if (!listinfo.id && !options.tableCode) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (isPayBefor() && !listinfo.id) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let res = listinfo.id
|
|
|
|
|
? await APIgetOrderById({
|
|
|
|
|
orderId: listinfo.id,
|
|
|
|
|
@@ -640,15 +643,16 @@ const createOrder = async () => {
|
|
|
|
|
orderId: listinfo.id || "",
|
|
|
|
|
tableCode: options.tableCode || "",
|
|
|
|
|
userId: uni.cache.get("userInfo").id || "", //
|
|
|
|
|
limitRate: (cartStore.limitTimeDiscount&&cartStore.limitTimeDiscount.id)
|
|
|
|
|
? {
|
|
|
|
|
id: cartStore.limitTimeDiscount.id,
|
|
|
|
|
discountRate: cartStore.limitTimeDiscount.discountRate,
|
|
|
|
|
discountPriority: cartStore.limitTimeDiscount.discountPriority,
|
|
|
|
|
foodType: cartStore.limitTimeDiscount.foodType,
|
|
|
|
|
foods: cartStore.limitTimeDiscount.foods,
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
limitRate:
|
|
|
|
|
cartStore.limitTimeDiscount && cartStore.limitTimeDiscount.id
|
|
|
|
|
? {
|
|
|
|
|
id: cartStore.limitTimeDiscount.id,
|
|
|
|
|
discountRate: cartStore.limitTimeDiscount.discountRate,
|
|
|
|
|
discountPriority: cartStore.limitTimeDiscount.discountPriority,
|
|
|
|
|
foodType: cartStore.limitTimeDiscount.foodType,
|
|
|
|
|
foods: cartStore.limitTimeDiscount.foods,
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
});
|
|
|
|
|
// 清空购物车
|
|
|
|
|
if (res) {
|
|
|
|
|
@@ -709,7 +713,7 @@ function returnPayParams() {
|
|
|
|
|
vipPrice: cartStore.useVipPrice ? 1 : 0, //是否使用会员价0否1是
|
|
|
|
|
userAllPack: is_type.value == 0 ? 0 : 1, //是否整单打包
|
|
|
|
|
seatNum: is_type.value == 0 ? cartStore.seatFeeConfig.personCount : 0, //用餐人数
|
|
|
|
|
originAmount: cartStore.orderCostSummary.goodsRealAmount, //订单原金额(包含打包费+餐位费) 不含折扣价格
|
|
|
|
|
originAmount: cartStore.orderCostSummary.goodsRealAmount, //订单原金额(不包含打包费+餐位费)
|
|
|
|
|
discountRatio: 1, //折扣比例(计算时 向上取整保留 两位小数) 写死1
|
|
|
|
|
discountAmount: 0, //手动优惠金额 写死0
|
|
|
|
|
productCouponDiscountAmount:
|
|
|
|
|
@@ -729,18 +733,21 @@ function returnPayParams() {
|
|
|
|
|
: "",
|
|
|
|
|
remark: orderRemarker.value, //用户备注
|
|
|
|
|
discountActAmount: cartStore.orderCostSummary.fullReduction.actualAmount, //满减抵扣金额
|
|
|
|
|
discountActId:cartStore.orderCostSummary.fullReduction.usedActivity?cartStore.orderCostSummary.fullReduction.usedActivity.id:null,
|
|
|
|
|
userId: uni.cache.get("userInfo").id || "", //
|
|
|
|
|
limitRate: (cartStore.limitTimeDiscount&&cartStore.limitTimeDiscount.id)
|
|
|
|
|
? {
|
|
|
|
|
id: cartStore.limitTimeDiscount.id,
|
|
|
|
|
discountRate: cartStore.limitTimeDiscount.discountRate,
|
|
|
|
|
discountPriority: cartStore.limitTimeDiscount.discountPriority,
|
|
|
|
|
foodType: cartStore.limitTimeDiscount.foodType,
|
|
|
|
|
foods: cartStore.limitTimeDiscount.foods,
|
|
|
|
|
}
|
|
|
|
|
discountActId: cartStore.orderCostSummary.fullReduction.usedActivity
|
|
|
|
|
? cartStore.orderCostSummary.fullReduction.usedActivity.id
|
|
|
|
|
: null,
|
|
|
|
|
vipDiscountAmount: cartStore.orderCostSummary.vipDiscountAmount, //会员折扣减免金额
|
|
|
|
|
userId: uni.cache.get("userInfo").id || "", //
|
|
|
|
|
limitRate:
|
|
|
|
|
cartStore.limitTimeDiscount && cartStore.limitTimeDiscount.id
|
|
|
|
|
? {
|
|
|
|
|
id: cartStore.limitTimeDiscount.id,
|
|
|
|
|
discountRate: cartStore.limitTimeDiscount.discountRate,
|
|
|
|
|
discountPriority: cartStore.limitTimeDiscount.discountPriority,
|
|
|
|
|
foodType: cartStore.limitTimeDiscount.foodType,
|
|
|
|
|
foods: cartStore.limitTimeDiscount.foods,
|
|
|
|
|
}
|
|
|
|
|
: null,
|
|
|
|
|
vipDiscountAmount: cartStore.orderCostSummary.vipDiscountAmount, //会员折扣减免金额
|
|
|
|
|
};
|
|
|
|
|
return {
|
|
|
|
|
isBwc: isBwc.value,
|
|
|
|
|
@@ -899,6 +906,7 @@ const goToPay = async (payParams) => {
|
|
|
|
|
amount: cartStore.orderCostSummary.finalPayAmount, // 最终订单金额
|
|
|
|
|
orderAmount: cartStore.orderCostSummary.orderOriginFinalPayAmount, // 最终订单原金额
|
|
|
|
|
originAmount: cartStore.orderCostSummary.goodsRealAmount, //订单原金额(不包含打包费+餐位费)
|
|
|
|
|
|
|
|
|
|
returnUrl: "", //跳转地址
|
|
|
|
|
buyerRemark: "",
|
|
|
|
|
seatNum: is_type.value == 0 ? cartStore.seatFeeConfig.personCount : 0, //用餐人数
|
|
|
|
|
@@ -1090,8 +1098,8 @@ async function init(opt) {
|
|
|
|
|
cartStore.setSeatFeeConfig("personCount", res.seatNum);
|
|
|
|
|
cartStore.setDinnerType(res.dineMode || "dine-in");
|
|
|
|
|
cartStore.setOldOrder(res);
|
|
|
|
|
if(res.limitRate){
|
|
|
|
|
cartStore.limitTimeDiscount=res.limitRate
|
|
|
|
|
if (res.limitRate) {
|
|
|
|
|
cartStore.limitTimeDiscount = res.limitRate;
|
|
|
|
|
}
|
|
|
|
|
orderRemarker.value = res.remark;
|
|
|
|
|
Object.assign(listinfo, res);
|
|
|
|
|
@@ -1110,6 +1118,8 @@ async function init(opt) {
|
|
|
|
|
|
|
|
|
|
orderVIP.value = uni.cache.get("orderVIP");
|
|
|
|
|
cartStore.freeDineConfig = orderVIP.value.freeDineConfig;
|
|
|
|
|
const shopUserInfo = uni.cache.get("shopUserInfo");
|
|
|
|
|
cartStore.shopUserInfo = shopUserInfo;
|
|
|
|
|
if (options.tableCode) {
|
|
|
|
|
socketInitPar.table_code = options.tableCode;
|
|
|
|
|
socketInit();
|
|
|
|
|
@@ -1124,6 +1134,16 @@ onLoad((opt) => {
|
|
|
|
|
watch(
|
|
|
|
|
() => cartStore.orderCostSummary.orderOriginFinalPayAmount,
|
|
|
|
|
(newval) => {
|
|
|
|
|
console.log(
|
|
|
|
|
"cartStore.orderCostSummary.orderOriginFinalPayAmount",
|
|
|
|
|
orderVIP.value
|
|
|
|
|
);
|
|
|
|
|
if (JSON.stringify(orderVIP.value) == "{}") {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!orderVIP.value) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (
|
|
|
|
|
!orderVIP.value.freeDineConfig ||
|
|
|
|
|
!orderVIP.value.freeDineConfig.enable
|
|
|
|
|
@@ -1178,14 +1198,18 @@ const disablePayType = computed(() => {
|
|
|
|
|
if (rechargeItem.value.id) {
|
|
|
|
|
arr.add("余额支付");
|
|
|
|
|
}
|
|
|
|
|
if (!orderVIP.value.amount) {
|
|
|
|
|
if (!orderVIP.value || !orderVIP.value.amount) {
|
|
|
|
|
arr.add("余额支付");
|
|
|
|
|
}
|
|
|
|
|
if (
|
|
|
|
|
orderVIP.value.amount < cartStore.orderCostSummary.orderOriginFinalPayAmount
|
|
|
|
|
) {
|
|
|
|
|
arr.add("余额支付");
|
|
|
|
|
if (orderVIP.value) {
|
|
|
|
|
if (
|
|
|
|
|
orderVIP.value.amount <
|
|
|
|
|
cartStore.orderCostSummary.orderOriginFinalPayAmount
|
|
|
|
|
) {
|
|
|
|
|
arr.add("余额支付");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if (cartStore.orderCostSummary.orderOriginFinalPayAmount <= 0) {
|
|
|
|
|
// arr.add("微信支付");
|
|
|
|
|
// }
|
|
|
|
|
|