优化切换店铺没有清除代客下单历史订单干的问题
This commit is contained in:
@@ -44,22 +44,11 @@
|
||||
<span class="u-font-14">部分抵扣</span>
|
||||
</el-radio> -->
|
||||
</el-radio-group>
|
||||
<el-input-number
|
||||
class="u-m-l-10"
|
||||
v-if="score.sel != -1"
|
||||
v-model="usePointsNumber"
|
||||
step-strictly
|
||||
:step="pointsRes.equivalentPoints"
|
||||
placeholder="请输入积分抵扣数量"
|
||||
:min="pointsRes.minDeductionPoints"
|
||||
:max="pointsRes.maxUsablePoints"
|
||||
@change="pointsToMoney"
|
||||
></el-input-number>
|
||||
<el-input-number class="u-m-l-10" v-if="score.sel != -1" v-model="usePointsNumber" step-strictly
|
||||
:step="pointsRes.equivalentPoints" placeholder="请输入积分抵扣数量" :min="pointsRes.minDeductionPoints"
|
||||
:max="pointsRes.maxUsablePoints" @change="pointsToMoney"></el-input-number>
|
||||
</div>
|
||||
<p
|
||||
class="u-font-14 color-666 u-m-t-10"
|
||||
v-if="pointsRes.unusableReason && !pointsRes.usable"
|
||||
>
|
||||
<p class="u-font-14 color-666 u-m-t-10" v-if="pointsRes.unusableReason && !pointsRes.usable">
|
||||
<span class="color-red">*</span>
|
||||
<span>{{ pointsRes.unusableReason }}</span>
|
||||
</p>
|
||||
@@ -80,13 +69,10 @@
|
||||
</div>
|
||||
<div class="u-flex u-col-center u-m-t-20 no-wrap">
|
||||
<span class="u-font-14 font-bold u-m-r-20">优惠券</span>
|
||||
<div
|
||||
v-if="
|
||||
carts.orderCostSummary.fullReduction !== undefined &&
|
||||
carts.orderCostSummary.fullReduction.actualAmount > 0
|
||||
"
|
||||
style="font-size: 14px; color: #555"
|
||||
>
|
||||
<div v-if="
|
||||
carts.orderCostSummary.fullReduction !== undefined &&
|
||||
carts.orderCostSummary.fullReduction.actualAmount > 0
|
||||
" style="font-size: 14px; color: #555">
|
||||
参与满减活动不可用优惠券!
|
||||
</div>
|
||||
<div class="u-flex my-select" @click="openCoupon" v-else>
|
||||
@@ -137,14 +123,9 @@
|
||||
<p class="u-font-16 font-bold u-m-r-20 font-bold u-flex">选择支付方式</p>
|
||||
<div class="u-m-t-20">
|
||||
<div>
|
||||
<el-button
|
||||
v-for="(item, index) in payTypes.list"
|
||||
:key="index"
|
||||
size="large"
|
||||
:type="index == payTypes.sel ? 'primary' : ''"
|
||||
:disabled="canUsePayType(item)"
|
||||
@click="changePayType(index)"
|
||||
>
|
||||
<el-button v-for="(item, index) in payTypes.list" :key="index" size="large"
|
||||
:type="index == payTypes.sel ? 'primary' : ''" :disabled="canUsePayType(item)"
|
||||
@click="changePayType(index)">
|
||||
{{ item.payName }}
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -231,22 +212,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- 扫码 -->
|
||||
<scanPay
|
||||
ref="refScanPay"
|
||||
:order="orderInfo"
|
||||
@confirm="refScanPayConfirm"
|
||||
@paysuccess="paysuccess"
|
||||
></scanPay>
|
||||
<scanPay ref="refScanPay" :order="orderInfo" @confirm="refScanPayConfirm" @paysuccess="paysuccess"></scanPay>
|
||||
<!-- 打折 -->
|
||||
<discount ref="refDiscount" @confirm="discountConfirm"></discount>
|
||||
<!-- 优惠券 -->
|
||||
<popup-coupon ref="refCoupon" :user="carts.vipUser" @confirm="refCouponConfirm"></popup-coupon>
|
||||
<!-- 挂账 -->
|
||||
<chooseGuaZahng
|
||||
ref="refGuaZhang"
|
||||
:payMoney="currentpayMoney"
|
||||
@confirm="refGuaZhangConfirm"
|
||||
></chooseGuaZahng>
|
||||
<chooseGuaZahng ref="refGuaZhang" :payMoney="currentpayMoney" @confirm="refGuaZhangConfirm"></chooseGuaZahng>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -384,7 +356,7 @@ function discountShow(e) {
|
||||
const props = defineProps({
|
||||
table: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
default: () => { },
|
||||
},
|
||||
user: {
|
||||
type: Object,
|
||||
@@ -398,7 +370,7 @@ const props = defineProps({
|
||||
},
|
||||
orderInfo: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
default: () => { },
|
||||
},
|
||||
});
|
||||
|
||||
@@ -515,26 +487,6 @@ function changePayType(i) {
|
||||
refScanPayOpen(payType);
|
||||
}
|
||||
|
||||
// 根据用户id获取新客立减金额,返回null代表不可用
|
||||
const newCustomerDiscount = ref(null);
|
||||
async function getConsumeDiscountAjax() {
|
||||
try {
|
||||
if (carts.vipUser.id) {
|
||||
newCustomerDiscount.value = await limitTimeDiscountApi.getConsumeDiscount({
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
shopUserId: carts.vipUser.id,
|
||||
orderId: props.orderInfo.id,
|
||||
});
|
||||
console.log("根据用户id获取新客立减金额,返回null代表不可用", newCustomerDiscount.value);
|
||||
if (newCustomerDiscount.value !== null) {
|
||||
carts.newUserDiscount = newCustomerDiscount.value.amount;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
function returnPayParams() {
|
||||
console.log("carts.orderCostSummary", carts.orderCostSummary);
|
||||
return {
|
||||
@@ -564,9 +516,9 @@ function returnPayParams() {
|
||||
userId: carts.vipUser.userId || "",
|
||||
allPack: carts.dinnerType == "take-out" ? 1 : 0,
|
||||
limitRate: carts.limitDiscountRes,
|
||||
newCustomerDiscountId: newCustomerDiscount.value !== null ? newCustomerDiscount.value.id : "", // 新客立减Id
|
||||
newCustomerDiscountId: carts.newUserDiscount !== null ? carts.newUserDiscount.id : "", // 新客立减Id
|
||||
newCustomerDiscountAmount:
|
||||
newCustomerDiscount.value !== null ? newCustomerDiscount.value.amount : 0, // 新客立减金额
|
||||
carts.newUserDiscount !== null ? carts.newUserDiscount.amount : 0, // 新客立减金额
|
||||
vipDiscountAmount: carts.orderCostSummary.vipDiscountAmount, // 超级会员折扣
|
||||
},
|
||||
};
|
||||
@@ -607,7 +559,7 @@ function nowPayClick(payType) {
|
||||
.then(() => {
|
||||
payOrder("cash");
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => { });
|
||||
return;
|
||||
}
|
||||
if (payType == "member-account") {
|
||||
@@ -738,24 +690,9 @@ watch(
|
||||
}
|
||||
);
|
||||
|
||||
// 获取当前店铺可用的限时折扣
|
||||
async function getlimitTimeDiscount() {
|
||||
try {
|
||||
const res = await limitTimeDiscountApi.getLimitTimeDiscount({
|
||||
shopId: localStorage.getItem("shopId"),
|
||||
});
|
||||
|
||||
console.log("获取当前店铺可用的限时折扣===", res);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
carts.payParamsInit();
|
||||
getPaytype();
|
||||
getlimitTimeDiscount();
|
||||
getConsumeDiscountAjax();
|
||||
});
|
||||
defineExpose({
|
||||
nowPayClick,
|
||||
@@ -801,11 +738,9 @@ defineExpose({
|
||||
.order-info {
|
||||
font-size: 14px;
|
||||
|
||||
.title {
|
||||
}
|
||||
.title {}
|
||||
|
||||
.value {
|
||||
}
|
||||
.value {}
|
||||
|
||||
.price {
|
||||
color: #fa5555;
|
||||
|
||||
Reference in New Issue
Block a user