details.vue 4.9 KB

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