支付金额为0时的处理修改
This commit is contained in:
@@ -115,6 +115,7 @@
|
||||
<ChargeVue
|
||||
@updateChargeSel="(e) => updateChargeSel(e)"
|
||||
@updateRechargeId="updateRechargeId"
|
||||
@updateIsShow="updateIsShow"
|
||||
v-if="listinfo.status == 'unpaid' || !listinfo.id"
|
||||
></ChargeVue>
|
||||
</view>
|
||||
@@ -275,7 +276,12 @@ const customStyle = {
|
||||
|
||||
const cartStore = useCartsStore();
|
||||
|
||||
//充值相关
|
||||
//充值相关start
|
||||
//充值和余额支付是否可用
|
||||
const isCanUseCharge = ref(false);
|
||||
function updateIsShow(e){
|
||||
isCanUseCharge.value = e;
|
||||
}
|
||||
const rechargeItem = ref({
|
||||
id: "",
|
||||
});
|
||||
@@ -289,6 +295,7 @@ function updateChargeSel(newval) {
|
||||
rechargeItem.value = newval;
|
||||
console.log("updateChargeSel", newval);
|
||||
}
|
||||
//充值相关end
|
||||
|
||||
async function onMessage(Message) {
|
||||
cartStore.onMessage(Message, cartsSocket);
|
||||
@@ -435,14 +442,15 @@ const orderorderInfo = async () => {
|
||||
orderId: listinfo.id,
|
||||
})
|
||||
: await APIhistoryOrder({
|
||||
tableCode: options.tableCode,
|
||||
tableCode: options.tableCode||"",
|
||||
});
|
||||
orderRemarker.value = res.remark;
|
||||
Object.assign(listinfo, res);
|
||||
if (res && res.tableCode) {
|
||||
socketInitPar.table_code = res.tableCode;
|
||||
let tableRes = await getTableInfo({
|
||||
tableCode: options.tableCode,
|
||||
tableCode: options.tableCode||"",
|
||||
|
||||
});
|
||||
console.log(tableRes);
|
||||
listinfo.tableName = tableRes.name;
|
||||
@@ -450,7 +458,7 @@ const orderorderInfo = async () => {
|
||||
if (options.tableCode) {
|
||||
socketInitPar.table_code = options.tableCode;
|
||||
let tableRes = await getTableInfo({
|
||||
tableCode: options.tableCode,
|
||||
tableCode: options.tableCode||"",
|
||||
});
|
||||
console.log(tableRes);
|
||||
listinfo.tableName = tableRes.name;
|
||||
@@ -626,7 +634,7 @@ const createOrder = async () => {
|
||||
placeNum: listinfo.id ? listinfo.placeNum * 1 + 1 : 1, //当前订单下单次数
|
||||
waitCall: "", //是否等叫 0 否 1 等叫
|
||||
orderId: listinfo.id || "",
|
||||
tableCode: options.tableCode,
|
||||
tableCode: options.tableCode||'',
|
||||
userId: uni.cache.get("userInfo").id || "", //
|
||||
});
|
||||
// 清空购物车
|
||||
@@ -1055,7 +1063,7 @@ async function init(opt) {
|
||||
if (res) {
|
||||
uni.cache.set("tableCode", res.tableCode);
|
||||
uni.cache.set("tableCode", res.seatNum);
|
||||
options.tableCode = res.tableCode;
|
||||
options.tableCode = res.tableCode||'';
|
||||
cartStore.setSeatFeeConfig("personCount", res.seatNum);
|
||||
cartStore.setDinnerType(res.dineMode || "dine-in");
|
||||
orderRemarker.value = res.remark;
|
||||
@@ -1151,8 +1159,11 @@ const disablePayType = computed(() => {
|
||||
) {
|
||||
arr.add("余额支付");
|
||||
}
|
||||
if (cartStore.orderCostSummary.orderOriginFinalPayAmount <= 0) {
|
||||
arr.add("微信支付");
|
||||
// if (cartStore.orderCostSummary.orderOriginFinalPayAmount <= 0) {
|
||||
// arr.add("微信支付");
|
||||
// }
|
||||
if(!isCanUseCharge.value){
|
||||
arr.add("余额支付");
|
||||
}
|
||||
|
||||
return Array.from(arr);
|
||||
|
||||
Reference in New Issue
Block a user