|
@@ -67,7 +67,7 @@
|
|
|
*/
|
|
*/
|
|
|
import { mapGetters } from "vuex";
|
|
import { mapGetters } from "vuex";
|
|
|
import { IMGHOST } from '@/config'
|
|
import { IMGHOST } from '@/config'
|
|
|
-import { cancel,debtPay,getDetail,codePay,codePayCheck} from "@/api/order";
|
|
|
|
|
|
|
+import { cancel,debtPay,getDetail,codePay,codePayCheck,codePayVerify} from "@/api/order";
|
|
|
export default {
|
|
export default {
|
|
|
name: "toPay",
|
|
name: "toPay",
|
|
|
components: {
|
|
components: {
|
|
@@ -89,6 +89,7 @@ export default {
|
|
|
typescan: 'scan-listener',
|
|
typescan: 'scan-listener',
|
|
|
remindText:'',
|
|
remindText:'',
|
|
|
returnCode:'',
|
|
returnCode:'',
|
|
|
|
|
+ authCode:'', // 存储付款码数字
|
|
|
pollingTimer:null, // 后台自动复查定时器
|
|
pollingTimer:null, // 后台自动复查定时器
|
|
|
pollingCount:0, // 自动复查次数
|
|
pollingCount:0, // 自动复查次数
|
|
|
isPaymentProcessing:false // 防重复扫码标志
|
|
isPaymentProcessing:false // 防重复扫码标志
|
|
@@ -232,6 +233,7 @@ export default {
|
|
|
this.isPaymentProcessing = true
|
|
this.isPaymentProcessing = true
|
|
|
this.remindText = ''
|
|
this.remindText = ''
|
|
|
this.returnCode = ''
|
|
this.returnCode = ''
|
|
|
|
|
+ this.authCode = authCode // 记录当前支付码
|
|
|
this.clearPolling()
|
|
this.clearPolling()
|
|
|
|
|
|
|
|
codePay({id:this.orderId,authCode:authCode}).then(res=>{
|
|
codePay({id:this.orderId,authCode:authCode}).then(res=>{
|
|
@@ -246,7 +248,7 @@ export default {
|
|
|
that.returnCode = res.data.returnCode ? res.data.returnCode : ''
|
|
that.returnCode = res.data.returnCode ? res.data.returnCode : ''
|
|
|
that.goPay = 2
|
|
that.goPay = 2
|
|
|
|
|
|
|
|
- // 11105(用户输入密码中) 或 10000(其它密码状态),启动4秒一次、最多5次(20秒)的自动复查定时器
|
|
|
|
|
|
|
+ // 11105(用户输入密码中) 或 10000(其它密码状态),启动4秒一次、最多4次(16秒)的自动复查定时器
|
|
|
if (that.returnCode == 'BBS11105' || that.returnCode == 'BBS10000') {
|
|
if (that.returnCode == 'BBS11105' || that.returnCode == 'BBS10000') {
|
|
|
that.startPolling()
|
|
that.startPolling()
|
|
|
} else {
|
|
} else {
|
|
@@ -268,7 +270,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 启动低频后台付款复查定时器
|
|
* 启动低频后台付款复查定时器
|
|
|
- * 4秒轮询一次,限查5次,极大地减轻服务器压力的同时保证业务流闭环
|
|
|
|
|
|
|
+ * 4秒轮询一次,限查4次,极大地减轻服务器压力的同时保证业务流闭环
|
|
|
*/
|
|
*/
|
|
|
startPolling(){
|
|
startPolling(){
|
|
|
this.clearPolling()
|
|
this.clearPolling()
|
|
@@ -279,7 +281,7 @@ export default {
|
|
|
let that = this;
|
|
let that = this;
|
|
|
this.pollingTimer = setInterval(() => {
|
|
this.pollingTimer = setInterval(() => {
|
|
|
that.pollingCount++
|
|
that.pollingCount++
|
|
|
- if (that.pollingCount > 5) {
|
|
|
|
|
|
|
+ if (that.pollingCount > 4) {
|
|
|
that.clearPolling()
|
|
that.clearPolling()
|
|
|
that.isPaymentProcessing = false
|
|
that.isPaymentProcessing = false
|
|
|
that.goPay = 2
|
|
that.goPay = 2
|
|
@@ -287,9 +289,9 @@ export default {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- that.remindText = `正在自动复查支付结果 (${that.pollingCount}/5)...`
|
|
|
|
|
|
|
+ that.remindText = `正在自动复查支付结果 (${that.pollingCount}/4)...`
|
|
|
|
|
|
|
|
- codePayCheck({id:that.orderId}).then(res=>{
|
|
|
|
|
|
|
+ codePayVerify({id:that.orderId,authCode:that.authCode}).then(res=>{
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
if(res.data && res.data.returnStatus == 'SUCCESS'){
|
|
if(res.data && res.data.returnStatus == 'SUCCESS'){
|
|
|
that.clearPolling()
|
|
that.clearPolling()
|