Commit d6331720b93d3390f7582fd9361ad1a3255d9b19
1 parent
016d3690
停车记录详情
Showing
2 changed files
with
44 additions
and
75 deletions
common/common.js
| ... | ... | @@ -115,27 +115,43 @@ var moneyFormat = function (val) { |
| 115 | 115 | return (val / 100).toFixed(2) |
| 116 | 116 | } |
| 117 | 117 | var dateFormat = function (msd) { // 时间转换 |
| 118 | - var time = msd | |
| 118 | + var time =msd | |
| 119 | + | |
| 119 | 120 | if (null != time && "" != time) { |
| 120 | 121 | if (time > 60 && time < 60 * 60) { |
| 121 | 122 | time = parseInt(time / 60.0) + "分钟" + parseInt((parseFloat(time / 60.0) - |
| 123 | + | |
| 122 | 124 | parseInt(time / 60.0)) * 60) + "秒"; |
| 125 | + | |
| 123 | 126 | } |
| 127 | + | |
| 124 | 128 | else if (time >= 60 * 60 && time < 60 * 60 * 24) { |
| 125 | 129 | time = parseInt(time / 3600.0) + "小时" + parseInt((parseFloat(time / 3600.0) - |
| 130 | + | |
| 126 | 131 | parseInt(time / 3600.0)) * 60) + "分钟" + |
| 132 | + | |
| 127 | 133 | parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - |
| 134 | + | |
| 128 | 135 | parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒"; |
| 136 | + | |
| 129 | 137 | } else if (time >= 60 * 60 * 24) { |
| 130 | - time = parseInt(time / 3600.0 / 24) + "天" + parseInt((parseFloat(time / 3600.0 / 24) - | |
| 131 | - parseInt(time / 3600.0 / 24)) * 24) + "小时" + parseInt((parseFloat(time / 3600.0) - | |
| 138 | + time = parseInt(time / 3600.0/24) + "天" +parseInt((parseFloat(time / 3600.0/24)- | |
| 139 | + | |
| 140 | + parseInt(time / 3600.0/24))*24) + "小时" + parseInt((parseFloat(time / 3600.0) - | |
| 141 | + | |
| 132 | 142 | parseInt(time / 3600.0)) * 60) + "分钟" + |
| 143 | + | |
| 133 | 144 | parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - |
| 145 | + | |
| 134 | 146 | parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒"; |
| 147 | + | |
| 135 | 148 | } |
| 149 | + | |
| 136 | 150 | else { |
| 137 | 151 | time = parseInt(time) + "秒"; |
| 152 | + | |
| 138 | 153 | } |
| 154 | + | |
| 139 | 155 | } |
| 140 | 156 | return time; |
| 141 | 157 | } |
| ... | ... | @@ -150,6 +166,7 @@ export default { |
| 150 | 166 | SetToken, |
| 151 | 167 | requestSign, |
| 152 | 168 | moneyFormat, |
| 169 | + dateFormat, | |
| 153 | 170 | // 接口 |
| 154 | 171 | userLogin, |
| 155 | 172 | indexInfo, | ... | ... |
pages/parkRecordList/recordDetail.vue
| ... | ... | @@ -41,90 +41,40 @@ |
| 41 | 41 | </view> |
| 42 | 42 | |
| 43 | 43 | |
| 44 | - <uni-list class=""> | |
| 45 | - <view class="uni-title uni-common-pl recordCarNum">一次支付订单</view> | |
| 46 | - <view class="recordCon listPadding"> | |
| 47 | - <text>实收:</text> | |
| 48 | - <text>¥10.00</text> | |
| 49 | - </view> | |
| 50 | - <view class="recordCon listPadding"> | |
| 51 | - <text>应收:</text> | |
| 52 | - <text>¥10.00</text> | |
| 53 | - </view> | |
| 54 | - <view class="recordCon listPadding"> | |
| 55 | - <text>支付金额:</text> | |
| 56 | - <text>¥10.00</text> | |
| 57 | - </view> | |
| 58 | - <view class="recordCon listPadding"> | |
| 59 | - <text>支付方式:</text> | |
| 60 | - <text class="colorBlue">商户余额</text> | |
| 61 | - </view> | |
| 62 | - <view class="recordCon listPadding"> | |
| 63 | - <text>支付时间:</text> | |
| 64 | - <text>2022-04-05 20:20:20</text> | |
| 65 | - </view> | |
| 66 | - <view class="recordCon listPadding"> | |
| 67 | - <text>订单编号:</text> | |
| 68 | - <text>1012321839678731</text> | |
| 69 | - </view> | |
| 70 | - </uni-list> | |
| 71 | - <uni-list class=""> | |
| 72 | - <view class="uni-title uni-common-pl recordCarNum">二次支付订单</view> | |
| 73 | - <view class="recordCon listPadding"> | |
| 74 | - <text>实收:</text> | |
| 75 | - <text>¥10.00</text> | |
| 76 | - </view> | |
| 77 | - <view class="recordCon listPadding"> | |
| 78 | - <text>应收:</text> | |
| 79 | - <text>¥10.00</text> | |
| 80 | - </view> | |
| 81 | - <view class="recordCon listPadding"> | |
| 82 | - <text>支付金额:</text> | |
| 83 | - <text>¥10.00</text> | |
| 84 | - </view> | |
| 85 | - <view class="recordCon listPadding"> | |
| 86 | - <text>支付方式:</text> | |
| 87 | - <text class="colorBlue">商户余额</text> | |
| 88 | - </view> | |
| 89 | - <view class="recordCon listPadding"> | |
| 90 | - <text>支付时间:</text> | |
| 91 | - <text>2022-04-05 20:20:20</text> | |
| 92 | - </view> | |
| 93 | - <view class="recordCon listPadding"> | |
| 94 | - <text>订单编号:</text> | |
| 95 | - <text>1012321839678731</text> | |
| 96 | - </view> | |
| 97 | - </uni-list> | |
| 98 | - | |
| 44 | + <uni-list class="" v-for="(i, index) in listData" :key="i.id"> | |
| 45 | + <view class="uni-title uni-common-pl recordCarNum" v-if="listData.length>1">{{index+1}}次支付订单</view> | |
| 99 | 46 | |
| 100 | - <uni-list class=""> | |
| 101 | 47 | <view class="recordCon listPadding"> |
| 102 | 48 | <text>优惠券:</text> |
| 103 | - <text>5元金额券</text> | |
| 49 | + <text>{{$common.moneyFormat(i.orderDicountFee)}}元金额券</text> | |
| 104 | 50 | </view> |
| 105 | 51 | <view class="recordCon listPadding"> |
| 106 | 52 | <text>优惠:</text> |
| 107 | - <text class="colorGreen">¥5.00</text> | |
| 53 | + <text class="colorGreen">¥{{$common.moneyFormat(i.orderDicountFee)}}</text> | |
| 108 | 54 | </view> |
| 109 | 55 | <view class="recordCon listPadding"> |
| 110 | 56 | <text>应收:</text> |
| 111 | - <text>¥10.00</text> | |
| 57 | + <text>¥{{$common.moneyFormat(i.orderTotalFee)}}</text> | |
| 112 | 58 | </view> |
| 113 | 59 | <view class="recordCon listPadding"> |
| 114 | 60 | <text>实收:</text> |
| 115 | - <text class="colorBlue">¥10.00</text> | |
| 61 | + <text class="colorBlue">¥{{$common.moneyFormat(i.orderActFee)}}</text> | |
| 116 | 62 | </view> |
| 117 | 63 | <view class="recordCon listPadding"> |
| 118 | 64 | <text>支付金额:</text> |
| 119 | - <text>¥10.00</text> | |
| 65 | + <text>¥{{$common.moneyFormat(i.orderActFee)}}</text> | |
| 120 | 66 | </view> |
| 121 | 67 | <view class="recordCon listPadding"> |
| 122 | 68 | <text>支付方式:</text> |
| 123 | 69 | <text class="colorBlue">商户余额</text> |
| 124 | 70 | </view> |
| 125 | 71 | <view class="recordCon listPadding"> |
| 72 | + <text>支付时间:</text> | |
| 73 | + <text class="colorBlue">{{i.payFinishTime}}</text> | |
| 74 | + </view> | |
| 75 | + <view class="recordCon listPadding"> | |
| 126 | 76 | <text>订单编号:</text> |
| 127 | - <text>1012321839678731</text> | |
| 77 | + <text>{{i.rltOrderId}}</text> | |
| 128 | 78 | </view> |
| 129 | 79 | </uni-list> |
| 130 | 80 | |
| ... | ... | @@ -147,22 +97,23 @@ export default { |
| 147 | 97 | plName: '',// 停车场名称 |
| 148 | 98 | parkOutTime: '',// 出场时间 |
| 149 | 99 | parkInTime: '',// 入场时间 |
| 150 | - parkingDuration: '',// 停车时长 | |
| 100 | + parkingDuration: 3600,// 停车时长 | |
| 151 | 101 | carNumber: '',// 车牌号 |
| 102 | + listData:[], | |
| 152 | 103 | } |
| 153 | 104 | }, |
| 154 | 105 | onLoad(params) { |
| 155 | 106 | wx.showShareMenu({ |
| 156 | 107 | withShareTicket: true |
| 157 | 108 | }) |
| 158 | - // console.log(params.optionData) | |
| 159 | - // let option = JSON.parse(params.optionData) | |
| 160 | - // this.orderId = option.orderId | |
| 161 | - // this.plName = option.plName | |
| 162 | - // this.parkOutTime = option.parkOutTime | |
| 163 | - // this.parkInTime = option.parkInTime | |
| 164 | - // this.parkingDuration = 3600 | |
| 165 | - // this.carNumber = option.carNumber | |
| 109 | + console.log(params.optionData) | |
| 110 | + let option = JSON.parse(params.optionData) | |
| 111 | + this.orderId = option.orderId | |
| 112 | + this.plName = option.plName | |
| 113 | + this.parkOutTime = option.parkOutTime | |
| 114 | + this.parkInTime = option.parkInTime | |
| 115 | + this.parkingDuration = 3600 | |
| 116 | + this.carNumber = option.carNumber | |
| 166 | 117 | console.log(this.orderId) |
| 167 | 118 | this.getPayOrderByOrderId(); |
| 168 | 119 | }, |
| ... | ... | @@ -191,7 +142,7 @@ export default { |
| 191 | 142 | getPayOrderByOrderId() { |
| 192 | 143 | let that = this |
| 193 | 144 | let paramsData = { |
| 194 | - orderId: '101962015377023516672' | |
| 145 | + orderId: this.orderId | |
| 195 | 146 | } |
| 196 | 147 | // 首页信息获取 接口 |
| 197 | 148 | that.$myRequest({ |
| ... | ... | @@ -200,6 +151,7 @@ export default { |
| 200 | 151 | data: that.$common.requestSign(paramsData) |
| 201 | 152 | }).then(res => { |
| 202 | 153 | console.log(res) |
| 154 | + that.listData = res.data | |
| 203 | 155 | }) |
| 204 | 156 | }, |
| 205 | 157 | bindDateChange: function (e) { | ... | ... |