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,6 +124,54 @@ var moneyFormat = function (val) { | ||
124 | return (val/100).toFixed(2) | 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 | export default { | 175 | export default { |
128 | 176 | ||
129 | // deviceInfo, | 177 | // deviceInfo, |
@@ -136,7 +184,7 @@ export default { | @@ -136,7 +184,7 @@ export default { | ||
136 | SetToken, | 184 | SetToken, |
137 | requestSign, | 185 | requestSign, |
138 | moneyFormat, | 186 | moneyFormat, |
139 | - | 187 | + dateFormat, |
140 | // 接口 | 188 | // 接口 |
141 | userLogin, | 189 | userLogin, |
142 | indexInfo, | 190 | indexInfo, |
pages/parkRecordList/parkRecordList.vue
@@ -28,7 +28,7 @@ | @@ -28,7 +28,7 @@ | ||
28 | </view> | 28 | </view> |
29 | 29 | ||
30 | <view v-if="recordList.length>0"> | 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 | <view> | 32 | <view> |
33 | {{i.plName}} | 33 | {{i.plName}} |
34 | </view> | 34 | </view> |
@@ -59,8 +59,6 @@ | @@ -59,8 +59,6 @@ | ||
59 | </template> | 59 | </template> |
60 | 60 | ||
61 | <script> | 61 | <script> |
62 | - | ||
63 | -import common from "../../common/common"; | ||
64 | export default { | 62 | export default { |
65 | data() { | 63 | data() { |
66 | const currentDate = this.getDate({ | 64 | const currentDate = this.getDate({ |
@@ -120,10 +118,10 @@ export default { | @@ -120,10 +118,10 @@ export default { | ||
120 | this.recordList = res.data.dataList | 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 | uni.navigateTo({ | 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 | <template> | 1 | <template> |
2 | <view class="container"> | 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 | <view class="uni-list" style="margin-bottom: 4px"> | 5 | <view class="uni-list" style="margin-bottom: 4px"> |
6 | <view class="uni-list-cell recordPadding"> | 6 | <view class="uni-list-cell recordPadding"> |
7 | <view class="uni-list-cell-left"> | 7 | <view class="uni-list-cell-left"> |
8 | 停车场地 | 8 | 停车场地 |
9 | </view> | 9 | </view> |
10 | <view class="uni-list-cell-db"> | 10 | <view class="uni-list-cell-db"> |
11 | - 金融物流港(原蒙东云计算) | 11 | + {{plName}} |
12 | </view> | 12 | </view> |
13 | </view> | 13 | </view> |
14 | 14 | ||
@@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
17 | 入场时间 | 17 | 入场时间 |
18 | </view> | 18 | </view> |
19 | <view class="uni-list-cell-db"> | 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 | </view> | 21 | </view> |
22 | </view> | 22 | </view> |
23 | 23 | ||
@@ -26,7 +26,7 @@ | @@ -26,7 +26,7 @@ | ||
26 | 离场时间 | 26 | 离场时间 |
27 | </view> | 27 | </view> |
28 | <view class="uni-list-cell-db"> | 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 | </view> | 30 | </view> |
31 | </view> | 31 | </view> |
32 | 32 | ||
@@ -35,40 +35,12 @@ | @@ -35,40 +35,12 @@ | ||
35 | 停车时间 | 35 | 停车时间 |
36 | </view> | 36 | </view> |
37 | <view class="uni-list-cell-db"> | 37 | <view class="uni-list-cell-db"> |
38 | - 1天3小时20分钟 | 38 | + {{$common.dateFormat(parkingDuration)}} |
39 | </view> | 39 | </view> |
40 | </view> | 40 | </view> |
41 | </view> | 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 | <uni-list class=""> | 44 | <uni-list class=""> |
73 | <view class="uni-title uni-common-pl recordCarNum">一次支付订单</view> | 45 | <view class="uni-title uni-common-pl recordCarNum">一次支付订单</view> |
74 | <view class="recordCon listPadding"> | 46 | <view class="recordCon listPadding"> |
@@ -161,8 +133,6 @@ | @@ -161,8 +133,6 @@ | ||
161 | </template> | 133 | </template> |
162 | 134 | ||
163 | <script> | 135 | <script> |
164 | -import common from "../../common/common.js"; | ||
165 | -import requestServer from "../../common/requestServer.js"; | ||
166 | export default { | 136 | export default { |
167 | 137 | ||
168 | data() { | 138 | data() { |
@@ -175,13 +145,28 @@ export default { | @@ -175,13 +145,28 @@ export default { | ||
175 | userIsLogin: false, | 145 | userIsLogin: false, |
176 | shownoFlag: 0, | 146 | shownoFlag: 0, |
177 | orderId:'',// 订单号 | 147 | orderId:'',// 订单号 |
148 | + plName:'',// 停车场名称 | ||
149 | + parkOutTime:'',// 出场时间 | ||
150 | + parkInTime:'',// 入场时间 | ||
151 | + parkingDuration:'',// 停车时长 | ||
152 | + carNumber:'',// 车牌号 | ||
178 | } | 153 | } |
179 | }, | 154 | }, |
180 | onLoad(params) { | 155 | onLoad(params) { |
181 | wx.showShareMenu({ | 156 | wx.showShareMenu({ |
182 | withShareTicket: true | 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 | console.log(this.orderId) | 170 | console.log(this.orderId) |
186 | this.getPayOrderByOrderId(); | 171 | this.getPayOrderByOrderId(); |
187 | }, | 172 | }, |