From 558dcc7a2a0f739ee178436728161d54c1fd365d Mon Sep 17 00:00:00 2001 From: kongdeqiang <123456> Date: 星期四, 22 十二月 2022 13:46:33 +0800 Subject: [PATCH] 修改前端页面 --- src/components/page/Index2.vue | 30 +++++++++++++++++++++++++++--- 1 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/components/page/Index2.vue b/src/components/page/Index2.vue index fa4cf23..953f13f 100644 --- a/src/components/page/Index2.vue +++ b/src/components/page/Index2.vue @@ -81,7 +81,9 @@ //this.outParkId = cs.code; this.code2 = cs.code; this.$byutil.postData(this, this.$systemconfig.basePath + '/outPark/findByBarrierCode', {code:cs.code}, res => { - this.statisticData = res.obj; + this.statisticData = res.data; + this.statisticData.enterTime = this.dateFormat('yyyy-MM-dd HH:mm:ss',this.statisticData.enterTime) + this.statisticData.createTime = this.dateFormat('yyyy-MM-dd HH:mm:ss',this.statisticData.createTime) this.outParkId = this.statisticData.id; this.status3 = this.statisticData.status3; if(this.status3==1){ @@ -109,7 +111,7 @@ type: 'success', duration:10000, }); - setTimeout(function(){window.location.href = res.obj;},10000); + setTimeout(function(){window.location.href = res.data.obj;},10000); this.showFlag = false; }) }, @@ -117,7 +119,7 @@ if(this.carNo){ this.$byutil.postData(this, this.$systemconfig.basePath + '/outPark/outPark2', {code2:this.code2,carNo:this.carNo}, res => { if(res.success){ - this.outParkId = res.obj.id; + this.outParkId = res.data.id; this.pay(); this.showFlag = false; }else{ @@ -135,7 +137,29 @@ }); } + }, + dateFormat(fmt, date) { + let ret + const opt = { + 'y+': date.getFullYear().toString(), // 骞� + 'M+': (date.getMonth() + 1).toString(), // 鏈� + 'd+': date.getDate().toString(), // 鏃� + 'H+': date.getHours().toString(), // 鏃� + 'm+': date.getMinutes().toString(), // 鍒� + 's+': date.getSeconds().toString(), // 绉� + // 鏈夊叾浠栨牸寮忓寲瀛楃闇�姹傚彲浠ョ户缁坊鍔狅紝蹇呴』杞寲鎴愬瓧绗︿覆 } + for (let k in opt) { + ret = new RegExp('(' + k + ')').exec(fmt) + if (ret) { + fmt = fmt.replace( + ret[1], + ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0') + ) + } + } + return fmt + }, } } -- Gitblit v1.9.1