diff --git a/src/api/table.js b/src/api/table.js index 57bf688..1a691c3 100644 --- a/src/api/table.js +++ b/src/api/table.js @@ -450,3 +450,14 @@ export function $returnOrder(data) { } }); } +//获取台桌详情状态 +export function $returnTableDetail(data) { + return request({ + url: '/api/tbShopTable/state', + method: "get", + params:{ + shopId: localStorage.getItem("shopId"), + ...data + } + }); +} diff --git a/src/views/tool/Instead/components/scan-pay.vue b/src/views/tool/Instead/components/scan-pay.vue index fd68e0e..a4c7099 100644 --- a/src/views/tool/Instead/components/scan-pay.vue +++ b/src/views/tool/Instead/components/scan-pay.vue @@ -118,6 +118,7 @@ export default { number: "0", show: false, timer: null, + payPar:{} }; }, watch: { @@ -136,18 +137,10 @@ export default { this.$refs.refInputCode.focus(); }); } else { + this.getPayUrl() this.tips = "请用户使用微信/支付宝扫描付款码"; this.startGetOrderInfo(); - this.$nextTick(() => { - QRCode.toCanvas( - this.$refs.canvas, - this.paymentQrcode,{width: 160, - height: 160,}, - function (error) { - console.log(error); - } - ); - }); + } }, number(newval) { @@ -193,14 +186,28 @@ export default { this.close(); this.$emit("confirm", this.form.code); }, + getPayUrl(){ + $getOrderPayUrl(this.payPar).then((res) => { + console.log(res); + this.paymentQrcode = res; + this.$nextTick(() => { + QRCode.toCanvas( + this.$refs.canvas, + this.paymentQrcode,{width: 160, + height: 160,}, + function (error) { + console.log(error); + } + ); + }); + }); + }, open(data) { this.show = true; this.form.money = Number(this.price).toFixed(2); + this.payPar=data if (this.openSwitch) { - $getOrderPayUrl({ orderId: this.order.id||data.id,payAmount:this.form.money||data.settlementAmount }).then((res) => { - console.log(res); - this.paymentQrcode = res; - }); + // this.getPayUrl(); } this.$nextTick(() => { this.$refs.refInputCode.focus(); diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index 0ad93a2..38864c5 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -54,7 +54,7 @@ @click="changeTable(item, index)" > {{ item.name }} - + {{ status[item.status] ? status[item.status].label : "" }} -
{{ - goods.status=='end'?'没有更多了':'加载中' - }}
+
+ {{ goods.status == "end" ? "没有更多了" : "加载中" }} +
0) { + try { + res1 = await this.$confirm( + "该台桌购物车里有商品,是否清除该台桌里的商品?", + "提示", + { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + } + ); + } catch (e) { + console.log(e); + } + await $choseTable({ + masterId: this.masterId, + tableId: item.tableId, + isClear: res1 == "confirm" ? true : false, + }); + } + this.table = item; this.tableShow = false; }, @@ -2100,9 +2144,10 @@ export default { } this.pays(); }, - payTypeItemClick(item) { - console.log(item); - console.log(this.vipUser.id); + payTypeItemClick(item,order) { + order=order?order:this.createOrder.data; + console.log('--------order------') + console.log(order) if (item.payType == "vipPay") { return this.refChooseUserOpen(); } @@ -2112,7 +2157,7 @@ export default { } if (item.payType == "scanCode") { //扫码支付 - return this.refToggle("refWxScanCode", true, this.createOrder.data); + return this.refToggle("refWxScanCode", true, {orderId:order.id,payAmount: (this.createOrder.data.amount * order.discount).toFixed(2)}); } }, ChangeDiscount(discount) { @@ -2246,7 +2291,7 @@ export default { return this.refChooseUserOpen(); } if (this.order.payType == "scanCode") { - return this.refToggle("refWxScanCode", true, this.createOrder.data); + return this.refToggle("refWxScanCode", true, {orderId:this.createOrder.data.id,payAmount: (this.createOrder.data.amount * this.createOrder.discount).toFixed(2)}); } if (this.order.payType == "deposit") { return this.refToggle("refScanCode", true); @@ -3168,10 +3213,10 @@ export default { } }, async getGoods() { - if(this.goods.status=='end'){ - return + if (this.goods.status == "end") { + return; } - this.goods.status='loadmore' + this.goods.status = "loadmore"; const res = await getGoodsLists(this.goods.query); let $goodsMap = {}; const goods = res.records.filter((v) => { @@ -3190,7 +3235,8 @@ export default { for (let i in goods) { this.goods.list.push(goods[i]); } - this.goods.status= this.goods.list.length>=res.total ? 'end' : 'loadmore' + this.goods.status = + this.goods.list.length >= res.total ? "end" : "loadmore"; this.goods.total = res.total; this.$goodsData = goods; }, @@ -3246,7 +3292,7 @@ export default { }, close() { if (this.table.tableId) { - this.$router.replace({ path: "/table/table_list" }); + this.$router.replace({ path: "/tool/table_list" }); } else { this.$router.go(0); // this.reset();