From 1d6fa2c0145be2d685c66170f747202bb0ee63d8 Mon Sep 17 00:00:00 2001 From: 13405411873 <1994398261@qq.com> Date: Tue, 24 Sep 2024 11:26:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=94=B6=E9=93=B6=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/cashier/NewComponents/homeindex.vue | 3 +- .../views/cashier/NewComponents/newHome.vue | 219 +++++++++++++++++- 2 files changed, 215 insertions(+), 7 deletions(-) diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue index e22b138a7..882aae8a7 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue @@ -3624,11 +3624,10 @@ this.dialogVisiblej = true this.getCode(((+this.oilActualPay) + (+this.goodsActualPay)).toFixed(2),2); - // this.getStaff() + }, // 网络下发之后获取条码 getCode(amount,flag) { - console.log("this.payType",this.payType) // 现金不参与 if (this.payType == "CASH" && flag == 1) { return } diff --git a/fuintCashierWeb/src/views/cashier/NewComponents/newHome.vue b/fuintCashierWeb/src/views/cashier/NewComponents/newHome.vue index 22013beda..2bbd6ce30 100644 --- a/fuintCashierWeb/src/views/cashier/NewComponents/newHome.vue +++ b/fuintCashierWeb/src/views/cashier/NewComponents/newHome.vue @@ -433,7 +433,7 @@ ¥{{ payForm.realyPayBills }} -
+
{ + if (response.data != null) { + this.loading = true; + id = response.data.id + } + }); + let this_ = this + // + let timer = setInterval(async () => { + await getCheckTheStatusOfYourPaymentApi(id).then(async response => { + if (response.data != null) { + const payStatus = response.data.payStatus + if (payStatus === "unpaid") { + this_.isQuery = true; + } else if (payStatus === "paid") { + // 当支付成功时 + this_.isPaySuccess = true; + this_.isQuery = false; + this_.rechargeBalCard = true + // await this_.printLocally1() + await this_.cardValueReport() + await this_.getMemberAfter(); + clearInterval(timer); + } else if (payStatus === "payFail") { + this_.isPaySuccess = false; + this_.isQuery = false; + clearInterval(timer); + } + } + await this_.getMemberAfter(); + }) + }, 1000); + + let timer2 = setInterval(function () { + if (!this_.isQuery || !this_.openConfirm) { + this_.loading = false; + this_.isPay = false; + clearInterval(timer); + clearTimeout(timer3); + + } + }, 500) + + var timer3 = setTimeout(function () { + clearInterval(timer2); + clearInterval(timer); + this_.loading = false; + this_.isPay = false; + this_.isPaySuccess = false; + this_.isAwait = true; + }, 15000) + + } else if (this.flag === 2) { + if (!this.payForm.authCode && this.cardFuelDieselForm.paymentType !== "CASH") { + this.$message.error('请先扫码'); + return + }else { + if (this.payForm.authCode { + if (response.data != null) { + this.loading = true; + id = response.data.id + } + }); + + + let timer = setInterval(async () => { + getCheckTheStatusOfYourPaymentByFuelApi(id).then(async response => { + if (response.data != null) { + if (response.data.payStatus == "unpaid") { + this_.isQuery = true; + } + if (response.data.payStatus == "paid") { + this_.isPaySuccess = true; + this_.isQuery = false; + this_.rechargeOilCard = true + // await this.printLocally2() + await this.fuelDieselReport() + await this.getMemberAfter(); + clearInterval(timer); + } + if (response.data.payStatus == "payFail") { + this_.isPaySuccess = false; + this_.isQuery = false; + clearInterval(timer); + } + } + }) + }, 500); + + let timer2 = setInterval(function () { + if (this_.isQuery == false || !this_.openConfirm) { + this_.loading = false; + this_.isPay = false; + clearInterval(timer); + clearInterval(timer2); + } + }, 500) + + setTimeout(function () { + clearInterval(timer2); + clearInterval(timer); + this_.loading = false; + this_.isPay = false; + this_.isPaySuccess = false; + this_.isAwait = true; + + }, 15000) + + let this_ = this + } + this.$forceUpdate(); + + }, + cancelCollection(){ + this.openConfirm = false + }, // 获取支付方式 getPayList(){ getDicts("payment_type").then( response => { @@ -741,14 +923,41 @@ export default { } this.payForm.realyPayBills = selectCard.rechargeBalance this.payForm.paymentType = selectCard.paymentType - + if (selectCard.cardType == 0){ + this.flag = 1 + }else if(selectCard.cardType == 1){ + this.flag = 2 + } // // 发送扫码机请求(易联云网络下发) // await this.getSendPrintIndex(this.realyPayBills); + this.memberRecharge = false this.openConfirm = true; this.isPay = true - this.getCode(this.realyPayBills,1) + //this.getCode(this.realyPayBills, this.flag) + }, + // 网络下发之后获取条码 + getCode(amount,flag) { + console.log("payType",this.payForm.payType) // 现金不参与 + if (this.payForm.payType == "CASH" && flag == 1) { + return + } + // if (this.cardValueForm.paymentType == "CASH" && flag == 1) + // this.jishuqi++; + if (this.jishuqi == 30) { + this.jishuqi = 0 + return + } + this.continuePolling = true; + getReturnCode ({payAmount:amount}).then(res=>{ + if (res.data === "300" && this.continuePolling) { + setTimeout(() => { + this.getCode(amount); // 重新发起请求 + }, 1000); // 停顿一秒 + }else { + this.payForm.authCode = res.data + } + }) }, - /** * @description 油枪金额和商品金额发生变化,请求后端查询可用优惠活动 * 传入后台的参数,会员的用户id、加油油号、加油订单金额(不包括商品金额)、加油订单总金额(包括商品金额)、加油总升数 From 9550524c4140c9d9a6f8c6ad94484d48f7d40a63 Mon Sep 17 00:00:00 2001 From: 13405411873 <1994398261@qq.com> Date: Tue, 24 Sep 2024 11:28:46 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=94=B6=E9=93=B6=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fuintCashierWeb/.env.development | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 fuintCashierWeb/.env.development diff --git a/fuintCashierWeb/.env.development b/fuintCashierWeb/.env.development new file mode 100644 index 000000000..41a54452d --- /dev/null +++ b/fuintCashierWeb/.env.development @@ -0,0 +1,17 @@ +# 页面标题 +VUE_APP_TITLE = 百业兴智慧油站系统 + +# 开发环境配置 +ENV = 'development' + +# fuint会员营销系统/开发环境 +VUE_APP_BASE_API = '/dev-api' + +# 发布目录 +VUE_APP_PUBLIC_PATH = '/' + +# 后端接口地址 +VUE_APP_SERVER_URL = 'http://127.0.0.1:8080/' + + +# http://192.168.0.121:8080/