Commit 3e8809f2a2bcce5560e39c3e27f27a15d50db88d
1 parent
255542b3
补缴-二维码
Showing
2 changed files
with
43 additions
and
9 deletions
package.json
@@ -21,6 +21,7 @@ | @@ -21,6 +21,7 @@ | ||
21 | "normalize.css": "7.0.0", | 21 | "normalize.css": "7.0.0", |
22 | "nprogress": "^0.2.0", | 22 | "nprogress": "^0.2.0", |
23 | "path-to-regexp": "2.4.0", | 23 | "path-to-regexp": "2.4.0", |
24 | + "qrcodejs2": "^0.0.2", | ||
24 | "vue": "2.6.10", | 25 | "vue": "2.6.10", |
25 | "vue-router": "3.0.6", | 26 | "vue-router": "3.0.6", |
26 | "vuex": "3.1.0" | 27 | "vuex": "3.1.0" |
src/views/payback/index.vue
@@ -113,12 +113,15 @@ | @@ -113,12 +113,15 @@ | ||
113 | :visible.sync="dialogVisible" | 113 | :visible.sync="dialogVisible" |
114 | width="30%" | 114 | width="30%" |
115 | :close-on-click-modal="false"> | 115 | :close-on-click-modal="false"> |
116 | + <!--<div>--> | ||
117 | + <!--<img style="display: block;width: 100%" :src="url" >--> | ||
118 | + | ||
119 | + <!--</div>--> | ||
116 | <div> | 120 | <div> |
117 | - <el-image style="display: block;width: 100%" :src="url" > | ||
118 | - </el-image> | 121 | + <div id="qrcode"></div> |
119 | </div> | 122 | </div> |
120 | <span slot="footer" class="dialog-footer"> | 123 | <span slot="footer" class="dialog-footer"> |
121 | - <el-button type="primary" @click="dialogVisible = false">确 定</el-button> | 124 | + <el-button type="primary" @click="onBack">确 定</el-button> |
122 | </span> | 125 | </span> |
123 | </el-dialog> | 126 | </el-dialog> |
124 | 127 | ||
@@ -128,6 +131,7 @@ | @@ -128,6 +131,7 @@ | ||
128 | <script> | 131 | <script> |
129 | import {pageQueryArrearRecordByCondition,selectAllAppOrg,personOrderBackWxPay } from '@/api/index'; | 132 | import {pageQueryArrearRecordByCondition,selectAllAppOrg,personOrderBackWxPay } from '@/api/index'; |
130 | import {fen2Yuan,string2Date,inOutStateFormatter,parkingDurationFormatter} from '@/filters/index'; | 133 | import {fen2Yuan,string2Date,inOutStateFormatter,parkingDurationFormatter} from '@/filters/index'; |
134 | + import QRCode from 'qrcodejs2' // 引入qrcode | ||
131 | export default { | 135 | export default { |
132 | data() { | 136 | data() { |
133 | return { | 137 | return { |
@@ -145,7 +149,7 @@ | @@ -145,7 +149,7 @@ | ||
145 | ], | 149 | ], |
146 | multipleSelection:[], | 150 | multipleSelection:[], |
147 | dialogVisible:false, | 151 | dialogVisible:false, |
148 | - url:'http://106.15.186.134:9090/group1/M00/20/F3/rBMAsV0exOmAH91dAAZpQUTBbps512.jpg', | 152 | + url:'http://img.renniting.cn/group1/M00/35/07/rBABHF0fHpOAGw2BAAF_F0CXpIA340.png', |
149 | } | 153 | } |
150 | }, | 154 | }, |
151 | mounted: function() { | 155 | mounted: function() { |
@@ -153,6 +157,25 @@ | @@ -153,6 +157,25 @@ | ||
153 | 157 | ||
154 | }, | 158 | }, |
155 | methods: { | 159 | methods: { |
160 | + qrcode :function(url) { | ||
161 | + let qrcode = new QRCode('qrcode', { | ||
162 | + width: 100, | ||
163 | + height: 100, // 高度 | ||
164 | + text: url,// 二维码内容 | ||
165 | + // render: 'canvas' // 设置渲染方式(有两种方式 table和canvas,默认是canvas) | ||
166 | + // background: '#f0f' | ||
167 | + // foreground: '#ff0' | ||
168 | + }) | ||
169 | + console.log(qrcode) | ||
170 | + }, | ||
171 | + clearCode:function(){ | ||
172 | + | ||
173 | + var qrcodes=document.getElementById('qrcode'); | ||
174 | + if(qrcodes != null && qrcodes.innerHTML != '' && qrcodes.innerHTML!= null){ | ||
175 | + qrcodes.innerHTML = ''; | ||
176 | + } | ||
177 | + | ||
178 | + }, | ||
156 | /** | 179 | /** |
157 | *获取所有组织下拉框 | 180 | *获取所有组织下拉框 |
158 | */ | 181 | */ |
@@ -226,6 +249,7 @@ | @@ -226,6 +249,7 @@ | ||
226 | 249 | ||
227 | }, | 250 | }, |
228 | toBackSubmit:function(){ | 251 | toBackSubmit:function(){ |
252 | + this.clearCode(); | ||
229 | let selects = this.multipleSelection; | 253 | let selects = this.multipleSelection; |
230 | if(selects == null || selects.length < 1){ | 254 | if(selects == null || selects.length < 1){ |
231 | this.$message({ | 255 | this.$message({ |
@@ -237,7 +261,7 @@ | @@ -237,7 +261,7 @@ | ||
237 | let orders = []; | 261 | let orders = []; |
238 | let orgIds = []; | 262 | let orgIds = []; |
239 | selects.forEach(item=>{ | 263 | selects.forEach(item=>{ |
240 | - orders.push({orderId:item.orderId,parkId:item.plNo,orderNotPayFee:item.arrearageFee}); | 264 | + orders.push({orderId:item.orderId,parkId:item.plNo,orderNotPayFee:item.arrearageFee,sourceType:1}); |
241 | orgIds.push(item.orgId); | 265 | orgIds.push(item.orgId); |
242 | }); | 266 | }); |
243 | if(orders == null || orders.length < 1){ | 267 | if(orders == null || orders.length < 1){ |
@@ -253,18 +277,22 @@ | @@ -253,18 +277,22 @@ | ||
253 | payType:2, | 277 | payType:2, |
254 | paySrcType:103, | 278 | paySrcType:103, |
255 | terminalSource:9, | 279 | terminalSource:9, |
280 | + carNumber:'京A11111', | ||
256 | recordArreaInfos:JSON.stringify(orders) | 281 | recordArreaInfos:JSON.stringify(orders) |
257 | }; | 282 | }; |
258 | // req = JSON.stringify(req); | 283 | // req = JSON.stringify(req); |
259 | //调用后台接口获取二维码信息 | 284 | //调用后台接口获取二维码信息 |
260 | personOrderBackWxPay(req).then(response =>{ | 285 | personOrderBackWxPay(req).then(response =>{ |
261 | if(response.code=='8888'){ | 286 | if(response.code=='8888'){ |
262 | - console.log(response.data); | ||
263 | - this.url = response.data; | ||
264 | - | 287 | + let data = response.data; |
288 | + data = JSON.parse(data); | ||
289 | + let url = data.data.code_url; | ||
290 | + console.log(url); | ||
291 | + //this.url = url; | ||
292 | + this.qrcode(url); | ||
265 | }else{ | 293 | }else{ |
266 | console.log(response); | 294 | console.log(response); |
267 | - this.url = "http://106.15.186.134:9090/group1/M00/20/F3/rBMAsV0exOmAH91dAAZpQUTBbps512.jpg"; | 295 | + |
268 | } | 296 | } |
269 | 297 | ||
270 | }); | 298 | }); |
@@ -274,6 +302,11 @@ | @@ -274,6 +302,11 @@ | ||
274 | onSubmit:function() { | 302 | onSubmit:function() { |
275 | this.pageQueryArrearRecordByCondition(); | 303 | this.pageQueryArrearRecordByCondition(); |
276 | }, | 304 | }, |
305 | + onBack:function() { | ||
306 | + this.dialogVisible = false; | ||
307 | + this.pageQueryArrearRecordByCondition(); | ||
308 | + this.clearCode(); | ||
309 | + }, | ||
277 | onCancel:function() { | 310 | onCancel:function() { |
278 | this.$message({ | 311 | this.$message({ |
279 | message: 'cancel!', | 312 | message: 'cancel!', |