jialh
2025-09-01 4b5c937801abf12193ab7e8f68a307ecd4560980
更新
1个文件已修改
45 ■■■■■ 已修改文件
public/components/property/payFeeOrderConfirm/payFeeOrderConfirm.js 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/components/property/payFeeOrderConfirm/payFeeOrderConfirm.js
@@ -23,7 +23,7 @@
                if ($that.payFeeOrderConfirmInfo.payType === 'qrCode') {
                    $that._payOweFee()
                }else{
                } else {
                    $("#doPayFeeModal").modal('show');
                }
                // if ($that.payFeeOrderConfirmInfo.payType === 'qrCode') {
@@ -95,13 +95,55 @@
                            $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秒调用
            },
            /**
             * 生成二维码
             */
@@ -147,6 +189,7 @@
                if (container) {
                    container.innerHTML = ''; // 清空内容
                }
                clearInterval($that.rollBackInterval); // 在 modal 关闭时清除定时器
            },
            _qrCodePayFee: function () {
                let _printFees = [];