Commit 51f091d64891e9915f30720c75aa15db72fe73d3
1 parent
5b4291f2
停车记录详情
Showing
3 changed files
with
74 additions
and
43 deletions
common/common.js
| ... | ... | @@ -124,6 +124,54 @@ var moneyFormat = function (val) { |
| 124 | 124 | return (val/100).toFixed(2) |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | +var dateFormat = function (msd) { // 时间转换 | |
| 128 | + var time = msd | |
| 129 | + | |
| 130 | + if (null != time && "" != time) { | |
| 131 | + | |
| 132 | + if (time > 60 && time < 60 * 60) { | |
| 133 | + | |
| 134 | + time = parseInt(time / 60.0) + "分钟" + parseInt((parseFloat(time / 60.0) - | |
| 135 | + | |
| 136 | + parseInt(time / 60.0)) * 60) + "秒"; | |
| 137 | + | |
| 138 | + } | |
| 139 | + | |
| 140 | + else if (time >= 60 * 60 && time < 60 * 60 * 24) { | |
| 141 | + | |
| 142 | + time = parseInt(time / 3600.0) + "小时" + parseInt((parseFloat(time / 3600.0) - | |
| 143 | + | |
| 144 | + parseInt(time / 3600.0)) * 60) + "分钟" + | |
| 145 | + | |
| 146 | + parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - | |
| 147 | + | |
| 148 | + parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒"; | |
| 149 | + | |
| 150 | + } else if (time >= 60 * 60 * 24) { | |
| 151 | + | |
| 152 | + time = parseInt(time / 3600.0 / 24) + "天" + parseInt((parseFloat(time / 3600.0 / 24) - | |
| 153 | + | |
| 154 | + parseInt(time / 3600.0 / 24)) * 24) + "小时" + parseInt((parseFloat(time / 3600.0) - | |
| 155 | + | |
| 156 | + parseInt(time / 3600.0)) * 60) + "分钟" + | |
| 157 | + | |
| 158 | + parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - | |
| 159 | + | |
| 160 | + parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒"; | |
| 161 | + | |
| 162 | + } | |
| 163 | + | |
| 164 | + else { | |
| 165 | + | |
| 166 | + time = parseInt(time) + "秒"; | |
| 167 | + | |
| 168 | + } | |
| 169 | + | |
| 170 | + } | |
| 171 | + | |
| 172 | + return time; | |
| 173 | +} | |
| 174 | + | |
| 127 | 175 | export default { |
| 128 | 176 | |
| 129 | 177 | // deviceInfo, |
| ... | ... | @@ -136,7 +184,7 @@ export default { |
| 136 | 184 | SetToken, |
| 137 | 185 | requestSign, |
| 138 | 186 | moneyFormat, |
| 139 | - | |
| 187 | + dateFormat, | |
| 140 | 188 | // 接口 |
| 141 | 189 | userLogin, |
| 142 | 190 | indexInfo, | ... | ... |
pages/parkRecordList/parkRecordList.vue
| ... | ... | @@ -28,7 +28,7 @@ |
| 28 | 28 | </view> |
| 29 | 29 | |
| 30 | 30 | <view v-if="recordList.length>0"> |
| 31 | - <view class="parkRecordWrap" v-for="(i, index) in recordList" @click="toRecordDetail(i.orderId)"> | |
| 31 | + <view class="parkRecordWrap" v-for="(i, index) in recordList" @click="toRecordDetail(i)"> | |
| 32 | 32 | <view> |
| 33 | 33 | {{i.plName}} |
| 34 | 34 | </view> |
| ... | ... | @@ -59,8 +59,6 @@ |
| 59 | 59 | </template> |
| 60 | 60 | |
| 61 | 61 | <script> |
| 62 | - | |
| 63 | -import common from "../../common/common"; | |
| 64 | 62 | export default { |
| 65 | 63 | data() { |
| 66 | 64 | const currentDate = this.getDate({ |
| ... | ... | @@ -120,10 +118,10 @@ export default { |
| 120 | 118 | this.recordList = res.data.dataList |
| 121 | 119 | }) |
| 122 | 120 | }, |
| 123 | - toRecordDetail: function(orderId){ | |
| 124 | - console.log(orderId) | |
| 121 | + toRecordDetail: function(i){ | |
| 122 | + // console.log(orderId) | |
| 125 | 123 | uni.navigateTo({ |
| 126 | - url: '../parkRecordList/recordDetail?orderId='+orderId | |
| 124 | + url: '../parkRecordList/recordDetail?optionData='+JSON.stringify(i) | |
| 127 | 125 | }); |
| 128 | 126 | |
| 129 | 127 | }, | ... | ... |
pages/parkRecordList/recordDetail.vue
| 1 | 1 | <template> |
| 2 | 2 | <view class="container"> |
| 3 | 3 | |
| 4 | - <view class="uni-title uni-common-pl recordCarNum">车牌号码:蒙D12312</view> | |
| 4 | + <view class="uni-title uni-common-pl recordCarNum">车牌号码:{{carNumber}}</view> | |
| 5 | 5 | <view class="uni-list" style="margin-bottom: 4px"> |
| 6 | 6 | <view class="uni-list-cell recordPadding"> |
| 7 | 7 | <view class="uni-list-cell-left"> |
| 8 | 8 | 停车场地 |
| 9 | 9 | </view> |
| 10 | 10 | <view class="uni-list-cell-db"> |
| 11 | - 金融物流港(原蒙东云计算) | |
| 11 | + {{plName}} | |
| 12 | 12 | </view> |
| 13 | 13 | </view> |
| 14 | 14 | |
| ... | ... | @@ -17,7 +17,7 @@ |
| 17 | 17 | 入场时间 |
| 18 | 18 | </view> |
| 19 | 19 | <view class="uni-list-cell-db"> |
| 20 | - 2022-04-01 20:20:20 | |
| 20 | + <uni-dateformat :date="parkInTime" format="yyyy-MM-dd hh:mm:ss"></uni-dateformat> | |
| 21 | 21 | </view> |
| 22 | 22 | </view> |
| 23 | 23 | |
| ... | ... | @@ -26,7 +26,7 @@ |
| 26 | 26 | 离场时间 |
| 27 | 27 | </view> |
| 28 | 28 | <view class="uni-list-cell-db"> |
| 29 | - 2022-04-01 20:20:20 | |
| 29 | + <uni-dateformat :date="parkOutTime" format="yyyy-MM-dd hh:mm:ss"></uni-dateformat> | |
| 30 | 30 | </view> |
| 31 | 31 | </view> |
| 32 | 32 | |
| ... | ... | @@ -35,40 +35,12 @@ |
| 35 | 35 | 停车时间 |
| 36 | 36 | </view> |
| 37 | 37 | <view class="uni-list-cell-db"> |
| 38 | - 1天3小时20分钟 | |
| 38 | + {{$common.dateFormat(parkingDuration)}} | |
| 39 | 39 | </view> |
| 40 | 40 | </view> |
| 41 | 41 | </view> |
| 42 | 42 | |
| 43 | 43 | |
| 44 | - <!--<view class="parkRecordWrap">--> | |
| 45 | - <!--<view>--> | |
| 46 | - <!--金融物流港(原蒙东云计算)--> | |
| 47 | - <!--</view>--> | |
| 48 | - <!--<view class="recordCon">--> | |
| 49 | - <!--<text>蒙DL232112</text>--> | |
| 50 | - <!--<text>2022-03-20 20:20:20</text>--> | |
| 51 | - <!--</view>--> | |
| 52 | - <!--<view class="recordCon">--> | |
| 53 | - <!--<text>实收:10.00</text>--> | |
| 54 | - <!--<text>应收:10.00</text>--> | |
| 55 | - <!--</view>--> | |
| 56 | - <!--</view>--> | |
| 57 | - | |
| 58 | - | |
| 59 | - <!--<view class="parkRecordWrap">--> | |
| 60 | - <!--<view>--> | |
| 61 | - <!--金融物流港(原蒙东云计算)--> | |
| 62 | - <!--</view>--> | |
| 63 | - <!--<view class="recordCon">--> | |
| 64 | - <!--<text>蒙DL232112</text>--> | |
| 65 | - <!--<text>2022-03-20 20:20:20</text>--> | |
| 66 | - <!--</view>--> | |
| 67 | - <!--<view class="recordCon">--> | |
| 68 | - <!--<text>实收:10.00</text>--> | |
| 69 | - <!--<text>应收:10.00</text>--> | |
| 70 | - <!--</view>--> | |
| 71 | - <!--</view>--> | |
| 72 | 44 | <uni-list class=""> |
| 73 | 45 | <view class="uni-title uni-common-pl recordCarNum">一次支付订单</view> |
| 74 | 46 | <view class="recordCon listPadding"> |
| ... | ... | @@ -161,8 +133,6 @@ |
| 161 | 133 | </template> |
| 162 | 134 | |
| 163 | 135 | <script> |
| 164 | -import common from "../../common/common.js"; | |
| 165 | -import requestServer from "../../common/requestServer.js"; | |
| 166 | 136 | export default { |
| 167 | 137 | |
| 168 | 138 | data() { |
| ... | ... | @@ -175,13 +145,28 @@ export default { |
| 175 | 145 | userIsLogin: false, |
| 176 | 146 | shownoFlag: 0, |
| 177 | 147 | orderId:'',// 订单号 |
| 148 | + plName:'',// 停车场名称 | |
| 149 | + parkOutTime:'',// 出场时间 | |
| 150 | + parkInTime:'',// 入场时间 | |
| 151 | + parkingDuration:'',// 停车时长 | |
| 152 | + carNumber:'',// 车牌号 | |
| 178 | 153 | } |
| 179 | 154 | }, |
| 180 | 155 | onLoad(params) { |
| 181 | 156 | wx.showShareMenu({ |
| 182 | 157 | withShareTicket: true |
| 183 | 158 | }) |
| 184 | - this.orderId = params.orderId | |
| 159 | + console.log(params.optionData) | |
| 160 | + let option = JSON.parse(params.optionData) | |
| 161 | + this.orderId = option.orderId | |
| 162 | + this.plName = option.plName | |
| 163 | + this.parkOutTime = option.parkOutTime | |
| 164 | + this.parkInTime = option.parkInTime | |
| 165 | + this.parkingDuration = option.parkingDuration | |
| 166 | + this.carNumber = option.carNumber | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 185 | 170 | console.log(this.orderId) |
| 186 | 171 | this.getPayOrderByOrderId(); |
| 187 | 172 | }, | ... | ... |