details.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <view>
  3. <u-navbar > 充电详情</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>{{detail.stationName}}/{{detail.deviceName}}</h4>
  8. </view>
  9. <view class="details-main">
  10. <view class="details-price">
  11. <span>¥</span><h3>{{detail.income}}</h3><span>元</span>
  12. </view>
  13. <p>本单收益</p>
  14. </view>
  15. <view class="details-row" ><p>电费(元)</p><span>¥{{detail.electricityAmount}}</span></view>
  16. <view class="details-row" ><p>服务费(元)</p><span>¥{{detail.surplusAmount}}</span></view>
  17. <view class="details-row" ><p>桩号</p><span>{{detail.deviceNo}}</span></view>
  18. </view>
  19. <view class="details">
  20. <view class="details-title">
  21. <h4>分润比例</h4>
  22. </view>
  23. <view class="details-row" v-for="(item,i) in sprList" :key="i">
  24. <p>{{item.name}}</p>
  25. <span>{{item.describe}}</span>
  26. </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>{{detail.electricQuantity/10000}}</span></view>
  33. <view class="details-row"><p>开始时间</p><span>{{detail.startTime}}</span></view>
  34. <view class="details-row"><p>结束时间</p><span>{{detail.endTime}}</span></view>
  35. <view class="details-row"><p>充电时长</p><span>{{getPercent(detail.chargingMinute)}}</span></view>
  36. </view>
  37. <view class="detailsBtn">
  38. <u-button class="detailsBtn-btn" @click="back" type="primary" plain>返回</u-button>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import * as API from '@/apis/finance.js'
  44. export default {
  45. data() {
  46. return {
  47. id:'',
  48. sprList:[
  49. ],
  50. detail:{
  51. },
  52. title:"",
  53. }
  54. },
  55. onLoad(op){
  56. this.id=op.id;
  57. this.getInfo()
  58. },
  59. methods: {
  60. getPercent(estimateMinute) {
  61. var value="";
  62. var ms =estimateMinute
  63. if (ms > 0) {
  64. var Hour = parseInt(Math.floor(ms / 60 ));
  65. var Fen = parseInt(Math.floor(ms % 60 ));
  66. value = Hour + "小时" + Fen+"分钟"
  67. }
  68. return value;
  69. },
  70. back(){
  71. uni.navigateBack({
  72. })
  73. },
  74. getInfo(){
  75. uni.showLoading({
  76. title:"加载中",mask:true,
  77. })
  78. API.incomeDetails({
  79. detailId:this.id
  80. }).then((res) => {
  81. this.detail=res.data
  82. this.sprList=res.data.sprList
  83. uni.hideLoading()
  84. }).catch(error => {
  85. uni.showToast({
  86. title:error
  87. })
  88. })
  89. }
  90. }
  91. }
  92. </script>
  93. <style>
  94. page{
  95. background-color: #F7F7F7;
  96. }
  97. </style>
  98. <style lang="scss" scoped>
  99. .detailsBtn{
  100. margin: 16px;
  101. .detailsBtn-btn{
  102. border-color:#185AC6!important;
  103. border-radius: 8px!important;
  104. background: none!important;
  105. color:#185AC6!important;
  106. }
  107. }
  108. .details-title{
  109. margin-bottom: 16px;
  110. h4{
  111. font-weight: normal;
  112. font-size: 16px;
  113. position: relative;
  114. padding-left:10px;
  115. &::after{
  116. content: '';
  117. position: absolute;
  118. height: 12px;
  119. width: 4px;
  120. background-color: #27B148;
  121. left: 0;
  122. top:5px;
  123. }
  124. }
  125. }
  126. .details-row{
  127. display: flex;
  128. justify-content: space-between;
  129. align-items: center;
  130. margin-top: 15px;
  131. p{color:#888}
  132. }
  133. .details{
  134. margin: 16px;
  135. padding: 20px;
  136. background-color: #fff;
  137. border-radius: 8px;
  138. .details-head{
  139. display: flex;
  140. align-items: center;
  141. justify-content: center;
  142. h4{
  143. font-size: 18px;
  144. font-weight: normal;
  145. margin-left: 4px;
  146. }
  147. }
  148. .details-price{
  149. margin-top: 28px;
  150. display: flex;
  151. align-items: flex-end;
  152. justify-content: center;
  153. h3{
  154. font-size: 36px;
  155. color:#27B148;
  156. line-height: 36px;
  157. margin: 0 4px;
  158. font-weight: normal;
  159. }
  160. span{
  161. font-size: 20px;
  162. color:#27B148;
  163. }
  164. }
  165. .details-main{
  166. text-align: center;
  167. margin-bottom: 20px;
  168. p{
  169. color:#777;
  170. margin-top: 4px;
  171. }
  172. }
  173. }
  174. </style>