Commit d6331720b93d3390f7582fd9361ad1a3255d9b19

Authored by 刘淇
1 parent 016d3690

停车记录详情

common/common.js
@@ -115,27 +115,43 @@ var moneyFormat = function (val) { @@ -115,27 +115,43 @@ var moneyFormat = function (val) {
115 return (val / 100).toFixed(2) 115 return (val / 100).toFixed(2)
116 } 116 }
117 var dateFormat = function (msd) { // 时间转换 117 var dateFormat = function (msd) { // 时间转换
118 - var time = msd 118 + var time =msd
  119 +
119 if (null != time && "" != time) { 120 if (null != time && "" != time) {
120 if (time > 60 && time < 60 * 60) { 121 if (time > 60 && time < 60 * 60) {
121 time = parseInt(time / 60.0) + "分钟" + parseInt((parseFloat(time / 60.0) - 122 time = parseInt(time / 60.0) + "分钟" + parseInt((parseFloat(time / 60.0) -
  123 +
122 parseInt(time / 60.0)) * 60) + "秒"; 124 parseInt(time / 60.0)) * 60) + "秒";
  125 +
123 } 126 }
  127 +
124 else if (time >= 60 * 60 && time < 60 * 60 * 24) { 128 else if (time >= 60 * 60 && time < 60 * 60 * 24) {
125 time = parseInt(time / 3600.0) + "小时" + parseInt((parseFloat(time / 3600.0) - 129 time = parseInt(time / 3600.0) + "小时" + parseInt((parseFloat(time / 3600.0) -
  130 +
126 parseInt(time / 3600.0)) * 60) + "分钟" + 131 parseInt(time / 3600.0)) * 60) + "分钟" +
  132 +
127 parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - 133 parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) -
  134 +
128 parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒"; 135 parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒";
  136 +
129 } else if (time >= 60 * 60 * 24) { 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 parseInt(time / 3600.0)) * 60) + "分钟" + 142 parseInt(time / 3600.0)) * 60) + "分钟" +
  143 +
133 parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) - 144 parseInt((parseFloat((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60) -
  145 +
134 parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒"; 146 parseInt((parseFloat(time / 3600.0) - parseInt(time / 3600.0)) * 60)) * 60) + "秒";
  147 +
135 } 148 }
  149 +
136 else { 150 else {
137 time = parseInt(time) + "秒"; 151 time = parseInt(time) + "秒";
  152 +
138 } 153 }
  154 +
139 } 155 }
140 return time; 156 return time;
141 } 157 }
@@ -150,6 +166,7 @@ export default { @@ -150,6 +166,7 @@ export default {
150 SetToken, 166 SetToken,
151 requestSign, 167 requestSign,
152 moneyFormat, 168 moneyFormat,
  169 + dateFormat,
153 // 接口 170 // 接口
154 userLogin, 171 userLogin,
155 indexInfo, 172 indexInfo,
pages/parkRecordList/recordDetail.vue
@@ -41,90 +41,40 @@ @@ -41,90 +41,40 @@
41 </view> 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 <view class="recordCon listPadding"> 47 <view class="recordCon listPadding">
102 <text>优惠券:</text> 48 <text>优惠券:</text>
103 - <text>5元金额券</text> 49 + <text>{{$common.moneyFormat(i.orderDicountFee)}}元金额券</text>
104 </view> 50 </view>
105 <view class="recordCon listPadding"> 51 <view class="recordCon listPadding">
106 <text>优惠:</text> 52 <text>优惠:</text>
107 - <text class="colorGreen">¥5.00</text> 53 + <text class="colorGreen">¥{{$common.moneyFormat(i.orderDicountFee)}}</text>
108 </view> 54 </view>
109 <view class="recordCon listPadding"> 55 <view class="recordCon listPadding">
110 <text>应收:</text> 56 <text>应收:</text>
111 - <text>¥10.00</text> 57 + <text>¥{{$common.moneyFormat(i.orderTotalFee)}}</text>
112 </view> 58 </view>
113 <view class="recordCon listPadding"> 59 <view class="recordCon listPadding">
114 <text>实收:</text> 60 <text>实收:</text>
115 - <text class="colorBlue">¥10.00</text> 61 + <text class="colorBlue">¥{{$common.moneyFormat(i.orderActFee)}}</text>
116 </view> 62 </view>
117 <view class="recordCon listPadding"> 63 <view class="recordCon listPadding">
118 <text>支付金额:</text> 64 <text>支付金额:</text>
119 - <text>¥10.00</text> 65 + <text>¥{{$common.moneyFormat(i.orderActFee)}}</text>
120 </view> 66 </view>
121 <view class="recordCon listPadding"> 67 <view class="recordCon listPadding">
122 <text>支付方式:</text> 68 <text>支付方式:</text>
123 <text class="colorBlue">商户余额</text> 69 <text class="colorBlue">商户余额</text>
124 </view> 70 </view>
125 <view class="recordCon listPadding"> 71 <view class="recordCon listPadding">
  72 + <text>支付时间:</text>
  73 + <text class="colorBlue">{{i.payFinishTime}}</text>
  74 + </view>
  75 + <view class="recordCon listPadding">
126 <text>订单编号:</text> 76 <text>订单编号:</text>
127 - <text>1012321839678731</text> 77 + <text>{{i.rltOrderId}}</text>
128 </view> 78 </view>
129 </uni-list> 79 </uni-list>
130 80
@@ -147,22 +97,23 @@ export default { @@ -147,22 +97,23 @@ export default {
147 plName: '',// 停车场名称 97 plName: '',// 停车场名称
148 parkOutTime: '',// 出场时间 98 parkOutTime: '',// 出场时间
149 parkInTime: '',// 入场时间 99 parkInTime: '',// 入场时间
150 - parkingDuration: '',// 停车时长 100 + parkingDuration: 3600,// 停车时长
151 carNumber: '',// 车牌号 101 carNumber: '',// 车牌号
  102 + listData:[],
152 } 103 }
153 }, 104 },
154 onLoad(params) { 105 onLoad(params) {
155 wx.showShareMenu({ 106 wx.showShareMenu({
156 withShareTicket: true 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 console.log(this.orderId) 117 console.log(this.orderId)
167 this.getPayOrderByOrderId(); 118 this.getPayOrderByOrderId();
168 }, 119 },
@@ -191,7 +142,7 @@ export default { @@ -191,7 +142,7 @@ export default {
191 getPayOrderByOrderId() { 142 getPayOrderByOrderId() {
192 let that = this 143 let that = this
193 let paramsData = { 144 let paramsData = {
194 - orderId: '101962015377023516672' 145 + orderId: this.orderId
195 } 146 }
196 // 首页信息获取 接口 147 // 首页信息获取 接口
197 that.$myRequest({ 148 that.$myRequest({
@@ -200,6 +151,7 @@ export default { @@ -200,6 +151,7 @@ export default {
200 data: that.$common.requestSign(paramsData) 151 data: that.$common.requestSign(paramsData)
201 }).then(res => { 152 }).then(res => {
202 console.log(res) 153 console.log(res)
  154 + that.listData = res.data
203 }) 155 })
204 }, 156 },
205 bindDateChange: function (e) { 157 bindDateChange: function (e) {