details.vue 5.2 KB

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