| | |
| | | |
| | | if ($that.payFeeOrderConfirmInfo.payType === 'qrCode') { |
| | | $that._payOweFee() |
| | | }else{ |
| | | } else { |
| | | $("#doPayFeeModal").modal('show'); |
| | | } |
| | | // if ($that.payFeeOrderConfirmInfo.payType === 'qrCode') { |
| | |
| | | $that.$nextTick(function () { |
| | | $that.generateQRCode($that.qrcodeUrl); |
| | | }); |
| | | }; |
| | | if (_data.orderId) { |
| | | // 如果返回的 API 包含 orderId,启动定时器请求 |
| | | $that.startRollBackCheck(_data.orderId); |
| | | } |
| | | |
| | | }, |
| | | function (errInfo, error) { |
| | | console.log('请求失败处理'); |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | startRollBackCheck: function (orderId) { |
| | | // 每3秒调用/payment.rollBack接口 |
| | | $that.rollBackInterval = setInterval(function () { |
| | | vc.http.apiPost( |
| | | '/fee.rollBack', |
| | | JSON.stringify({ |
| | | orderId: orderId, |
| | | communityId: $that.payFeeOrderConfirmInfo.communityId |
| | | }), |
| | | function (json, res) { |
| | | let _data = JSON.parse(json); |
| | | if (_data.res && _data.res.data && _data.res.data.msg == "1") { |
| | | // 根据业务逻辑,1表示成功 |
| | | clearInterval($that.rollBackInterval); // 清除定时器 |
| | | vc.toast("成功回滚。"); |
| | | $that._closeDoPayFeeModal(); |
| | | vc.emit('payFeeOrderResult', '_loadReceipt', _data); |
| | | return; |
| | | } |
| | | }, |
| | | function (errInfo, error) { |
| | | console.log('请求失败处理'); |
| | | let _data = JSON.parse(errInfo); |
| | | if (_data && _data.msg == "1") { |
| | | // 根据业务逻辑,1表示成功 |
| | | clearInterval($that.rollBackInterval); // 清除定时器 |
| | | vc.toast("成功回滚。"); |
| | | $that._closeDoPayFeeModal(); |
| | | vc.emit('payFeeOrderResult', '_loadReceipt', _data); |
| | | return; |
| | | } |
| | | } |
| | | ); |
| | | }, 3000); // 每3秒调用 |
| | | }, |
| | | |
| | | /** |
| | | * 生成二维码 |
| | | */ |
| | |
| | | if (container) { |
| | | container.innerHTML = ''; // 清空内容 |
| | | } |
| | | clearInterval($that.rollBackInterval); // 在 modal 关闭时清除定时器 |
| | | }, |
| | | _qrCodePayFee: function () { |
| | | let _printFees = []; |