支持 岗亭出口处二维码 功能

This commit is contained in:
java110 2022-08-25 09:50:05 +08:00
parent 6474377020
commit 9f66b17fb5
4 changed files with 90 additions and 0 deletions

View File

@ -0,0 +1,29 @@
<div id="barrierGateMachineQrCodeModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-body">
<h3 class="m-t-none m-b "><span><vc:i18n name="出口收费二维码" namespace="barrierGateMachineQrCode"></vc:i18n></span></h3>
<div class="ibox-content">
<div>
<div>
<div class="form-group row">
<div class="col-sm-12" style="position: relative;">
<div id="qrcode" style="width:200px; height:200px; "></div>
</div>
<div class="col-sm-12 text-center margin-top ">
<span>{{barrierGateMachineQrCodeInfo.inspectionName}}</span>
</div>
<div class="col-sm-12 text-center margin-top ">
<span><span><vc:i18n name="请截图贴在岗亭门口" namespace="barrierGateMachineQrCode"></vc:i18n></span></span>
</div>
</div>
<div class="ibox-content">
<button type="button" class="btn btn-white float-right" style="margin-right:20px;" data-dismiss="modal"><span><vc:i18n name="关闭" namespace="barrierGateMachineQrCode"></vc:i18n></span></button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,55 @@
(function(vc) {
vc.extends({
data: {
barrierGateMachineQrCodeInfo: {
url: '',
inspectionName: '',
}
},
_initMethod: function() {},
_initEvent: function() {
vc.on('barrierGateMachineQrCode', 'openQrCodeModal', function(_param) {
$('#barrierGateMachineQrCodeModel').modal('show');
$that._loadQrCodeUrl(_param);
});
},
methods: {
_loadQrCodeUrl: function(_machine) {
//判断是否支付
var param = {
params: {
communityId: vc.getCurrentCommunity().communityId,
boxId: _machine.locationObjId,
machineId: _machine.machineId,
}
};
//发送get请求
vc.http.apiGet('/machine.getCarMachineQrCodeUrl',
param,
function(json, res) {
let _info = JSON.parse(json);
$that._viewQr(_info.data.url)
},
function(errInfo, error) {
console.log('请求失败处理');
}
);
},
// 两分钟后显示遮罩层
_viewQr: function(_url) {
document.getElementById("qrcode").innerHTML = "";
let qrcode = new QRCode(document.getElementById("qrcode"), {
text: "213", //你想要填写的文本
width: 200, //生成的二维码的宽度
height: 200, //生成的二维码的高度
colorDark: "#000000", // 生成的二维码的深色部分
colorLight: "#ffffff", //生成二维码的浅色部分
correctLevel: QRCode.CorrectLevel.L
});
qrcode.makeCode(_url);
}
}
});
})(window.vc);

View File

@ -95,6 +95,8 @@
</td>
<td class="text-center">{{machine.createTime}}</td>
<td class="text-center">
<button class="btn-white btn btn-xs" v-if="machine.direction == '3307'" v-on:click="_openQrCode(machine)"><span><vc:i18n name="出场二维码" namespace="barrierGateMachineManage"></vc:i18n></span>
</button>
<button class="btn-white btn btn-xs" v-on:click="_openEditMachineModel(machine)"><span><vc:i18n name="修改" namespace="barrierGateMachineManage"></vc:i18n></span>
</button>
<button class="btn-white btn btn-xs" v-on:click="_openDeleteMachineModel(machine)"><span><vc:i18n name="删除" namespace="barrierGateMachineManage"></vc:i18n></span>
@ -120,4 +122,5 @@
<vc:create path="property/editBarrierGateMachine"></vc:create>
<vc:create path="property/deleteMachine"></vc:create>
<vc:create path="property/machineState"></vc:create>
<vc:create path="property/barrierGateMachineQrCode"></vc:create>
</div>

View File

@ -82,6 +82,9 @@
_openDeleteMachineModel: function(_machine) {
vc.emit('deleteMachine', 'openDeleteMachineModal', _machine);
},
_openQrCode: function(_machine) {
vc.emit('barrierGateMachineQrCode', 'openQrCodeModal', _machine);
},
_queryMachineMethod: function() {
vc.component._listMachines(DEFAULT_PAGE, DEFAULT_ROWS);