Commit 16d971dd2bb73fb98eeda2edc330f7243685d32a

Authored by 王富生
2 parents 2f924783 c482cd01

Merge remote-tracking branch 'origin/branch_dev' into branch_dev

# Conflicts:
#	src/views/payback/index.vue
.env.production
... ... @@ -3,5 +3,5 @@ ENV = 'production'
3 3  
4 4 # base api
5 5 #VUE_APP_BASE_API = '/prod-api'
6   -VUE_APP_BASE_API = '/prov-api'
  6 +VUE_APP_BASE_API = 'http://test.renniting.cn/bcp/'
7 7  
... ...
package.json
... ... @@ -21,6 +21,7 @@
21 21 "normalize.css": "7.0.0",
22 22 "nprogress": "^0.2.0",
23 23 "path-to-regexp": "2.4.0",
  24 + "qrcodejs2": "^0.0.2",
24 25 "vue": "2.6.10",
25 26 "vue-router": "3.0.6",
26 27 "vuex": "3.1.0"
... ...
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,22 +249,21 @@
226 249  
227 250 },
228 251 toBackSubmit:function(){
  252 + this.clearCode();
229 253 let selects = this.multipleSelection;
230   - /*if(selects == null || selects.length < 1){
  254 + if(selects == null || selects.length < 1){
231 255 this.$message({
232 256 message: '请至少选择一行数据!',
233 257 type: 'warning'
234 258 });
235 259 return;
236   - }*/
  260 + }
237 261 let orders = [];
238 262 let orgIds = [];
239   - /*selects.forEach(item=>{
240   - orders.push({orderId:item.orderId,parkId:item.plNo,orderNotPayFee:item.arrearageFee});
  263 + selects.forEach(item=>{
  264 + orders.push({orderId:item.orderId,parkId:item.plNo,orderNotPayFee:item.arrearageFee,sourceType:1});
241 265 orgIds.push(item.orgId);
242   - });*/
243   - orders.push({orderId:'101519114989403303936',parkId:'P320211005',orderNotPayFee:'72275'});
244   - orgIds.push('10005');
  266 + });
245 267 if(orders == null || orders.length < 1){
246 268 this.$message({
247 269 message: '请至少选择一行数据!',
... ... @@ -254,20 +276,23 @@
254 276 sysCode:'10003',
255 277 payType:2,
256 278 paySrcType:103,
257   - carNumber:'京A12333',
258 279 terminalSource:9,
  280 + carNumber:'京A11111',
259 281 recordArreaInfos:JSON.stringify(orders)
260 282 };
261 283 // req = JSON.stringify(req);
262 284 //调用后台接口获取二维码信息
263 285 personOrderBackWxPay(req).then(response =>{
264 286 if(response.code=='8888'){
265   - console.log(response.data);
266   - this.url = response.data;
267   -
  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);
268 293 }else{
269 294 console.log(response);
270   - this.url = "http://106.15.186.134:9090/group1/M00/20/F3/rBMAsV0exOmAH91dAAZpQUTBbps512.jpg";
  295 +
271 296 }
272 297  
273 298 });
... ... @@ -277,6 +302,11 @@
277 302 onSubmit:function() {
278 303 this.pageQueryArrearRecordByCondition();
279 304 },
  305 + onBack:function() {
  306 + this.dialogVisible = false;
  307 + this.pageQueryArrearRecordByCondition();
  308 + this.clearCode();
  309 + },
280 310 onCancel:function() {
281 311 this.$message({
282 312 message: 'cancel!',
... ...
vue.config.js
... ... @@ -21,7 +21,7 @@ module.exports = {
21 21 * In most cases please use '/' !!!
22 22 * Detail: https://cli.vuejs.org/config/#publicpath
23 23 */
24   - publicPath: '/',
  24 + publicPath: './',
25 25 outputDir: 'dist',
26 26 assetsDir: 'static',
27 27 lintOnSave: process.env.NODE_ENV === 'development',
... ...