details.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view>
  3. <u-navbar title="收益详情"></u-navbar>
  4. <view class="details">
  5. <view class="details-head">
  6. <u-icon name="charging-pile-fill" custom-prefix="custom-icon" color="#27B148" size="48"></u-icon>
  7. <h4>{{chargeDetail.stationName}}</h4>
  8. </view>
  9. <view class="details-main">
  10. <view class="details-price">
  11. <span>¥</span><h3>{{chargeDetail.actualFee != null ? chargeDetail.actualFee : '0.00'}}</h3><span>元</span>
  12. </view>
  13. <p>订单总额</p>
  14. </view>
  15. <view class="details-row"><p>电费(元)</p><span>¥{{chargeDetail.totalElecMoney != null ? chargeDetail.totalElecMoney : '0.00'}}</span></view>
  16. <view class="details-row"><p>服务费(元)</p><span>¥{{chargeDetail.totalServiceMoney != null ? chargeDetail.totalServiceMoney : '0.00'}}</span></view>
  17. <view class="details-row"><p>优惠券抵扣(元)</p><span style="color:red">{{userCouponObj? userCouponObj.text : '未使用'}}</span></view>
  18. </view>
  19. <view class="details">
  20. <view class="details-title">
  21. <h4>充电详情</h4>
  22. </view>
  23. <view class="details-row"><p>消费电量(度)</p><span>{{chargeDetail.electricQuantity != null ? chargeDetail.electricQuantity/10000 : '0.000'}}</span></view>
  24. <view class="details-row"><p>开始时间</p><span>{{chargeDetail.startTime}}</span></view>
  25. <view class="details-row"><p>结束时间</p><span>{{chargeDetail.endTime}}</span></view>
  26. <view class="details-row"><p>充电时长</p><span>{{chargeDetail.chargingMinute != null ? chargeDetail.chargingMinute+'分' : '00分00秒'}}</span></view>
  27. </view>
  28. <view class="details">
  29. <view class="details-title">
  30. <h4>更多信息</h4>
  31. </view>
  32. <view class="details-row"><p>结束原因</p><span>{{chargeDetail.remark}}</span></view>
  33. <view class="details-row"><p>订单状态</p><span>{{chargeDetail.statusText}}</span></view>
  34. <view class="details-row"><p>充电桩编号</p><span>{{chargeDetail.deviceNo}}</span></view>
  35. <view class="details-row"><p>更新时间</p><span>{{chargeDetail.updateTime}}</span></view>
  36. <view class="details-row"><p>充电车辆</p><span>{{chargeDetail.carNumber}}</span></view>
  37. </view>
  38. <view class="detailsBtn">
  39. <u-button class="detailsBtn-btn" type="primary" shape="circle" plain @click="toHome">返回主页</u-button>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import * as API from '@/apis/index.js'
  45. export default {
  46. data() {
  47. return {
  48. id: '',
  49. chargeDetail: {},
  50. userCouponObj:{},
  51. }
  52. },
  53. onLoad(op) {
  54. if(op.id) {
  55. this.id = op.id;
  56. this.getchargingDetail();
  57. }
  58. },
  59. methods: {
  60. toHome() {
  61. uni.navigateTo({
  62. url: '/pages/index/index'
  63. })
  64. },
  65. getchargingDetail() {
  66. uni.showLoading({
  67. title: "加载中",
  68. mask: true,
  69. })
  70. API.chargingDetail(this.id).then((res) => {
  71. uni.hideLoading();
  72. this.chargeDetail = res.data.chargingRecord;
  73. this.userCouponObj = res.data.userCoupon;
  74. }).catch(error => {
  75. uni.showToast({
  76. title: error,
  77. icon: "none"
  78. })
  79. })
  80. }
  81. }
  82. }
  83. </script>
  84. <style>
  85. page{
  86. background-color: #F7F7F7;
  87. }
  88. </style>
  89. <style lang="scss" scoped>
  90. .detailsBtn{
  91. margin: 16px;
  92. .detailsBtn-btn{
  93. border-color:#00B962!important;
  94. border-radius: 8px!important;
  95. background: none!important;
  96. color:#00B962!important;
  97. }
  98. }
  99. .details-title{
  100. margin-bottom: 16px;
  101. h4{
  102. font-weight: normal;
  103. font-size: 16px;
  104. position: relative;
  105. padding-left:10px;
  106. &::after{
  107. content: '';
  108. position: absolute;
  109. height: 12px;
  110. width: 4px;
  111. background-color: #27B148;
  112. left: 0;
  113. top:5px;
  114. }
  115. }
  116. }
  117. .details-row{
  118. display: flex;
  119. justify-content: space-between;
  120. align-items: center;
  121. margin-top: 15px;
  122. p{color:#888}
  123. }
  124. .details{
  125. margin: 16px;
  126. padding: 20px;
  127. background-color: #fff;
  128. border-radius: 8px;
  129. .details-head{
  130. display: flex;
  131. align-items: center;
  132. justify-content: center;
  133. h4{
  134. font-size: 18px;
  135. font-weight: normal;
  136. margin-left: 4px;
  137. }
  138. }
  139. .details-price{
  140. margin-top: 28px;
  141. display: flex;
  142. align-items: flex-end;
  143. justify-content: center;
  144. h3{
  145. font-size: 36px;
  146. color:#FF6200;
  147. line-height: 36px;
  148. margin: 0 4px;
  149. font-weight: normal;
  150. }
  151. span{
  152. font-size: 20px;
  153. color:#FF6200;
  154. }
  155. }
  156. .details-main{
  157. text-align: center;
  158. margin-bottom: 20px;
  159. p{
  160. color:#777;
  161. margin-top: 4px;
  162. }
  163. }
  164. }
  165. </style>