details.vue 6.5 KB

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