Commit 3e8809f2a2bcce5560e39c3e27f27a15d50db88d
1 parent
255542b3
补缴-二维码
Showing
2 changed files
with
43 additions
and
9 deletions
package.json
src/views/payback/index.vue
... | ... | @@ -113,12 +113,15 @@ |
113 | 113 | :visible.sync="dialogVisible" |
114 | 114 | width="30%" |
115 | 115 | :close-on-click-modal="false"> |
116 | + <!--<div>--> | |
117 | + <!--<img style="display: block;width: 100%" :src="url" >--> | |
118 | + | |
119 | + <!--</div>--> | |
116 | 120 | <div> |
117 | - <el-image style="display: block;width: 100%" :src="url" > | |
118 | - </el-image> | |
121 | + <div id="qrcode"></div> | |
119 | 122 | </div> |
120 | 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 | 125 | </span> |
123 | 126 | </el-dialog> |
124 | 127 | |
... | ... | @@ -128,6 +131,7 @@ |
128 | 131 | <script> |
129 | 132 | import {pageQueryArrearRecordByCondition,selectAllAppOrg,personOrderBackWxPay } from '@/api/index'; |
130 | 133 | import {fen2Yuan,string2Date,inOutStateFormatter,parkingDurationFormatter} from '@/filters/index'; |
134 | + import QRCode from 'qrcodejs2' // 引入qrcode | |
131 | 135 | export default { |
132 | 136 | data() { |
133 | 137 | return { |
... | ... | @@ -145,7 +149,7 @@ |
145 | 149 | ], |
146 | 150 | multipleSelection:[], |
147 | 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 | 155 | mounted: function() { |
... | ... | @@ -153,6 +157,25 @@ |
153 | 157 | |
154 | 158 | }, |
155 | 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 | 249 | |
227 | 250 | }, |
228 | 251 | toBackSubmit:function(){ |
252 | + this.clearCode(); | |
229 | 253 | let selects = this.multipleSelection; |
230 | 254 | if(selects == null || selects.length < 1){ |
231 | 255 | this.$message({ |
... | ... | @@ -237,7 +261,7 @@ |
237 | 261 | let orders = []; |
238 | 262 | let orgIds = []; |
239 | 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 | 265 | orgIds.push(item.orgId); |
242 | 266 | }); |
243 | 267 | if(orders == null || orders.length < 1){ |
... | ... | @@ -253,18 +277,22 @@ |
253 | 277 | payType:2, |
254 | 278 | paySrcType:103, |
255 | 279 | terminalSource:9, |
280 | + carNumber:'京A11111', | |
256 | 281 | recordArreaInfos:JSON.stringify(orders) |
257 | 282 | }; |
258 | 283 | // req = JSON.stringify(req); |
259 | 284 | //调用后台接口获取二维码信息 |
260 | 285 | personOrderBackWxPay(req).then(response =>{ |
261 | 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 | 293 | }else{ |
266 | 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 | 302 | onSubmit:function() { |
275 | 303 | this.pageQueryArrearRecordByCondition(); |
276 | 304 | }, |
305 | + onBack:function() { | |
306 | + this.dialogVisible = false; | |
307 | + this.pageQueryArrearRecordByCondition(); | |
308 | + this.clearCode(); | |
309 | + }, | |
277 | 310 | onCancel:function() { |
278 | 311 | this.$message({ |
279 | 312 | message: 'cancel!', | ... | ... |