From 9884cb388aa617e78285050259da3fe33461107b Mon Sep 17 00:00:00 2001 From: java110 <928255095@qq.com> Date: Sat, 16 Oct 2021 18:28:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parkingAreaControlFee.html | 5 +++ .../parkingAreaControlFee.js | 42 +++++++++++++++++-- .../parkingAreaControlVideo.js | 5 ++- 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/public/components/property/parkingAreaControlFee/parkingAreaControlFee.html b/public/components/property/parkingAreaControlFee/parkingAreaControlFee.html index a987453ef..18444df55 100644 --- a/public/components/property/parkingAreaControlFee/parkingAreaControlFee.html +++ b/public/components/property/parkingAreaControlFee/parkingAreaControlFee.html @@ -57,5 +57,10 @@ + +
+
+
收费二维码
+
\ No newline at end of file diff --git a/public/components/property/parkingAreaControlFee/parkingAreaControlFee.js b/public/components/property/parkingAreaControlFee/parkingAreaControlFee.js index b503c1c85..5a9210e4f 100644 --- a/public/components/property/parkingAreaControlFee/parkingAreaControlFee.js +++ b/public/components/property/parkingAreaControlFee/parkingAreaControlFee.js @@ -12,11 +12,14 @@ remark: "", open: "", openMsg: "", - machineId: '' + machineId: '-1', + showRefresh:'', + paId:'' } }, _initMethod: function () { - + $that.parkingAreaControlFeeInfo.paId = vc.getParam('paId'); + $that._loadQrCodeUrl(); }, _initEvent: function () { vc.on('parkingAreaControlFee', 'notify', function (_data) { @@ -33,13 +36,32 @@ vc.on('parkingAreaControlFee', 'changeMachine', function (_data) { $that.parkingAreaControlFeeInfo.machineId = _data.machineId; }) - vc.on('parkingAreaControlFee', 'clear', function () { $that.clearParkingAreaControlFeeInfo(); }); }, methods: { + _loadQrCodeUrl:function(){ + //判断是否支付 + var param = { + params: { + communityId: vc.getCurrentCommunity().communityId, + paId: $that.parkingAreaControlFeeInfo.paId, + machineId: $that.parkingAreaControlFeeInfo.machineId, + } + }; + //发送get请求 + vc.http.apiGet('/machine.getCarMachineQrCodeUrl', + param, + function (json, res) { + let _info = JSON.parse(json); + $that._viewQr(_info.data) + }, function (errInfo, error) { + console.log('请求失败处理'); + } + ); + }, saveTempFeeInfo: function () { vc.emit('parkingAreaControlCustomCarInout', 'open', { type: "1102", //1101 手动入场 1102 手动出场 @@ -62,7 +84,19 @@ openMsg: "", machineId: _machineId } - } + }, + _viewQr: function (_data) { + document.getElementById("qrcode").innerHTML = ""; + let qrcode = new QRCode(document.getElementById("qrcode"), { + text: "临时车收费二维码", //你想要填写的文本 + width: 200, //生成的二维码的宽度 + height: 200, //生成的二维码的高度 + colorDark: "#000000", // 生成的二维码的深色部分 + colorLight: "#ffffff", //生成二维码的浅色部分 + correctLevel: QRCode.CorrectLevel.H + }); + qrcode.makeCode(_data.url); + }, } }); })(window.vc); \ No newline at end of file diff --git a/public/components/property/parkingAreaControlVideo/parkingAreaControlVideo.js b/public/components/property/parkingAreaControlVideo/parkingAreaControlVideo.js index 1e89b7c23..9fc1c6bf8 100644 --- a/public/components/property/parkingAreaControlVideo/parkingAreaControlVideo.js +++ b/public/components/property/parkingAreaControlVideo/parkingAreaControlVideo.js @@ -116,9 +116,10 @@ outMachineId: _outMachineId }); vc.emit('parkingAreaControlFee', 'changeMachine', { - machineId: _outMachineId + machineId: _outMachineId, + paId: $that.parkingAreaControlVideoInfo.paId }); - + let paId = ""; $that.parkingAreaControlVideoInfo.outMachines.forEach((item) => { if (item.machineId == _outMachineId) {