details.vue 5.9 KB

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