From bf89c360ffcdd9f46a495be31e7f2671fb69dcf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=A3=8A?= <468619417@qq.com> Date: Thu, 8 Jun 2023 15:55:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E6=83=A0=E5=88=B8=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E9=A1=B5=E7=A1=AE=E8=AE=A4=E6=8C=89=E9=92=AE=E5=B1=82=E7=BA=A7?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/detailedList/index.vue | 7 +++--- pages/index/index.vue | 36 +++++++++++++++-------------- pages/verification/selectCoupon.vue | 2 +- pages/verification/stepOne.vue | 6 +++++ request/ticketReq.js | 9 ++++++++ 5 files changed, 39 insertions(+), 21 deletions(-) diff --git a/pages/detailedList/index.vue b/pages/detailedList/index.vue index ff151a7..7f0f675 100644 --- a/pages/detailedList/index.vue +++ b/pages/detailedList/index.vue @@ -162,9 +162,10 @@ export default { }; }, onLoad: function () { - this.machineId = "861741042996303"; - this.getDataList(); - return; + // 写死 + // this.machineId = "861741042996303"; + // this.getDataList(); + // return; plus.device.getInfo({ success: (e) => { diff --git a/pages/index/index.vue b/pages/index/index.vue index db17c2e..b04eac6 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -130,9 +130,10 @@ export default { onLoad() { uni.showLoading(); - this.machineId = "861741042996303"; - this.getShopInfoApi(); - return; + // 写死 + // this.machineId = "861299032410223"; + // this.getShopInfoApi(); + // return; plus.device.getInfo({ success: (e) => { @@ -193,20 +194,21 @@ export default { }); }, scanCodeHandle() { - uni.setStorageSync("customer_info", ["56356", "zh-CN"]); - this.$i18n.locale = "en"; - this.gotoWhere( - `/pages/verification/stepOne?money=${this.form_data.money.value}&num_dine=${this.form_data.num_dine}` - ); - uni.setStorageSync("heXiaoData", { - totalMoney: +this.form_data.money.value, - userNum: this.form_data.num_dine, - dTicket: 0, // 优惠券抵扣 - dIntegral: 0, // 积分抵扣 - dMoney: 0, // 抵扣后金额 - coupon: [], // 选中的优惠券 - }); - return; + // 写死 + // uni.setStorageSync("customer_info", ["39207", "zh-CN"]); + // this.$i18n.locale = "en"; + // uni.setStorageSync("heXiaoData", { + // totalMoney: +this.form_data.money.value, + // userNum: this.form_data.num_dine, + // dTicket: 0, // 优惠券抵扣 + // dIntegral: 0, // 积分抵扣 + // dMoney: 0, // 抵扣后金额 + // coupon: [], // 选中的优惠券 + // }); + // this.gotoWhere( + // `/pages/verification/stepOne?money=${this.form_data.money.value}&num_dine=${this.form_data.num_dine}` + // ); + // return; // 允许从相机和相册扫码 if (parseInt(this.form_data.money.value) < 0) return; if (parseInt(this.form_data.num_dine) < 0) return; diff --git a/pages/verification/selectCoupon.vue b/pages/verification/selectCoupon.vue index 84c23fe..2c480e2 100644 --- a/pages/verification/selectCoupon.vue +++ b/pages/verification/selectCoupon.vue @@ -39,7 +39,7 @@ - + 確認/{{ $t("确认") }} diff --git a/pages/verification/stepOne.vue b/pages/verification/stepOne.vue index da271e5..f0ce5e2 100644 --- a/pages/verification/stepOne.vue +++ b/pages/verification/stepOne.vue @@ -313,6 +313,12 @@ export default { uni.redirectTo({ url, }); + } else { + uni.showToast({ + title: res.data.msg, + duration: 1500, + icon: "none", + }); } }, // 通用方法 diff --git a/request/ticketReq.js b/request/ticketReq.js index d2e588e..198be8b 100644 --- a/request/ticketReq.js +++ b/request/ticketReq.js @@ -26,3 +26,12 @@ export function getWriteOffInfo(data) { data, }); } + +// 提交核销 +export const verification = (params) => { + return myRequest({ + method: "post", + url: `/write-off/machine-submit`, + data: params, + }); +};