Explorar el Código

支付成功逻辑

Your Name hace 2 años
padre
commit
9fd1f382f8

+ 1
- 0
src/views/caseManagement/caseList.vue Ver fichero

347
       :payTitle="payTitle"
347
       :payTitle="payTitle"
348
       :form="form"
348
       :form="form"
349
       :payForm="payForm"
349
       :payForm="payForm"
350
+      @getcaseApply="getcaseApply"
350
       @paycancelRow="paycancelRow"
351
       @paycancelRow="paycancelRow"
351
     ></payDialog>
352
     ></payDialog>
352
   </div>
353
   </div>

+ 28
- 10
src/views/caseManagement/components/payDialog.vue Ver fichero

1
 <template>
1
 <template>
2
   <div>
2
   <div>
3
-    <el-dialog
4
-      :title="payTitle"
5
-      :visible.sync="openPay"
6
-      v-if="openPay"
7
-      width="800px"
8
-      append-to-body
9
-      :destroy-on-close="true"
10
-      center
11
-    >
3
+    <el-dialog :title="payTitle" :visible.sync="openPay" v-if="openPay" width="800px" append-to-body
4
+      :destroy-on-close="true" center>
12
       <el-descriptions title="订单信息">
5
       <el-descriptions title="订单信息">
13
         <el-descriptions-item label="案件编号">{{
6
         <el-descriptions-item label="案件编号">{{
14
           form.caseNum
7
           form.caseNum
49
 </template>
42
 </template>
50
 
43
 
51
 <script>
44
 <script>
52
-import { casePay } from "@/api/pay/pay";
45
+import { casePay, selectCaseApplicationConfirm } from "@/api/pay/pay";
53
 import QRCode from "qrcodejs2";
46
 import QRCode from "qrcodejs2";
54
 export default {
47
 export default {
55
   props: ["openPay", "payTitle", "form", "payForm"],
48
   props: ["openPay", "payTitle", "form", "payForm"],
58
       // key: value
51
       // key: value
59
       // 支付文字
52
       // 支付文字
60
       payMain: "",
53
       payMain: "",
54
+      timer:null
61
     };
55
     };
62
   },
56
   },
63
   methods: {
57
   methods: {
73
         colorLight: "#fff",
67
         colorLight: "#fff",
74
       });
68
       });
75
     },
69
     },
70
+    // 查询缴费状态
71
+    selectCaseApplicationConfirmFn(parms) {
72
+      selectCaseApplicationConfirm(parms).then(res => {
73
+        console.log(res, this.form, "KKKKKKKKKKKKKKKKKKKK");
74
+        if(res.data.paymentStatus == 1){
75
+          clearInterval(this.timer);
76
+          this.openPay = false;
77
+          this.$message({
78
+          message: "缴费成功",
79
+          type: "success",
80
+        });
81
+        this.$emit("getcaseApply",this.queryParams);
82
+        }
83
+      })
84
+    },
76
     // 支付
85
     // 支付
77
     pay(val) {
86
     pay(val) {
78
       if (this.payForm.feePayable == 0 || !this.payForm.feePayable) {
87
       if (this.payForm.feePayable == 0 || !this.payForm.feePayable) {
98
       }).then((res) => {
107
       }).then((res) => {
99
         this.paySrc = res.data.code_url;
108
         this.paySrc = res.data.code_url;
100
         this.qrcode(this.paySrc);
109
         this.qrcode(this.paySrc);
110
+        this.timer = setInterval(() => {
111
+          this.selectCaseApplicationConfirmFn({ id: this.form.id })
112
+        }, 3000);
113
+        setTimeout(() => {
114
+          clearInterval(this.timer);
115
+        }, 1000*60);
101
       });
116
       });
102
     },
117
     },
103
     payCancel() {
118
     payCancel() {
136
   width: 100%;
151
   width: 100%;
137
   text-align: center;
152
   text-align: center;
138
 }
153
 }
154
+
139
 ::v-deep .el-dialog {
155
 ::v-deep .el-dialog {
140
   width: 800px;
156
   width: 800px;
141
   background: #ffffff;
157
   background: #ffffff;
142
   border-radius: 20px;
158
   border-radius: 20px;
143
 }
159
 }
160
+
144
 .endbutton {
161
 .endbutton {
145
   width: 154px;
162
   width: 154px;
146
   height: 37px;
163
   height: 37px;
147
   background: #ffffff;
164
   background: #ffffff;
148
   border: 1px solid #d0d0d0;
165
   border: 1px solid #d0d0d0;
149
   border-radius: 19px;
166
   border-radius: 19px;
167
+
150
   span {
168
   span {
151
     width: 31px;
169
     width: 31px;
152
     height: 13px;
170
     height: 13px;