details.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view>
  3. <u-navbar :title="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>{{detail.stationName}}/{{detail.deviceNo}}</h4>
  8. </view>
  9. <view class="details-main">
  10. <view class="details-price">
  11. <span>¥</span><h3>{{iswuye?detail.costAmount:detail.shareProfitAmount}}</h3><span>元</span>
  12. </view>
  13. <p>本单收益</p>
  14. </view>
  15. <view class="details-row" v-if="!iswuye" ><p>电费(元)</p><span>¥{{detail.costAmount}}</span></view>
  16. <view class="details-row" v-if="!iswuye"><p>服务费(元)</p><span>¥{{detail.surplusAmount}}</span></view>
  17. <view class="details-row" v-if="!iswuye"><p>桩号</p><span>{{detail.deviceNo}}</span></view>
  18. <view class="details-row" v-if="!iswuye"><p>分润标准</p><span>{{detail.disProportion}}%</span></view>
  19. </view>
  20. <view class="details">
  21. <view class="details-title">
  22. <h4>充电详情</h4>
  23. </view>
  24. <view class="details-row"><p>消费电量(kW-h)</p><span>{{detail.electricQuantity/10000}}</span></view>
  25. <view class="details-row"><p>开始时间</p><span>{{detail.startTime}}</span></view>
  26. <view class="details-row"><p>结束时间</p><span>{{detail.endTime}}</span></view>
  27. <view class="details-row"><p>充电时长</p><span>{{getPercent(detail.chargingMinute)}}</span></view>
  28. </view>
  29. <view class="detailsBtn">
  30. <u-button class="detailsBtn-btn" @click="back" type="primary" plain>返回</u-button>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. import * as API from '@/apis/finance.js'
  36. export default {
  37. data() {
  38. return {
  39. id:'',
  40. detail:{
  41. },
  42. title:"",
  43. iswuye:false
  44. }
  45. },
  46. onLoad(op){
  47. this.title="收益详情"
  48. var obj=this.carhelp.getPersonInfoPlus("merchantUser");
  49. if(obj&&obj.role){
  50. var role=obj.role;
  51. if(role.id=="4"){
  52. this.title="电费详情"
  53. this.iswuye=true;
  54. }
  55. }
  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.detail
  82. uni.hideLoading()
  83. }).catch(error => {
  84. uni.showToast({
  85. title:error
  86. })
  87. })
  88. }
  89. }
  90. }
  91. </script>
  92. <style>
  93. page{
  94. background-color: #F7F7F7;
  95. }
  96. </style>
  97. <style lang="scss" scoped>
  98. .detailsBtn{
  99. margin: 16px;
  100. .detailsBtn-btn{
  101. border-color:#185AC6!important;
  102. border-radius: 8px!important;
  103. background: none!important;
  104. color:#185AC6!important;
  105. }
  106. }
  107. .details-title{
  108. margin-bottom: 16px;
  109. h4{
  110. font-weight: normal;
  111. font-size: 16px;
  112. position: relative;
  113. padding-left:10px;
  114. &::after{
  115. content: '';
  116. position: absolute;
  117. height: 12px;
  118. width: 4px;
  119. background-color: #27B148;
  120. left: 0;
  121. top:5px;
  122. }
  123. }
  124. }
  125. .details-row{
  126. display: flex;
  127. justify-content: space-between;
  128. align-items: center;
  129. margin-top: 15px;
  130. p{color:#888}
  131. }
  132. .details{
  133. margin: 16px;
  134. padding: 20px;
  135. background-color: #fff;
  136. border-radius: 8px;
  137. .details-head{
  138. display: flex;
  139. align-items: center;
  140. justify-content: center;
  141. h4{
  142. font-size: 18px;
  143. font-weight: normal;
  144. margin-left: 4px;
  145. }
  146. }
  147. .details-price{
  148. margin-top: 28px;
  149. display: flex;
  150. align-items: flex-end;
  151. justify-content: center;
  152. h3{
  153. font-size: 36px;
  154. color:#27B148;
  155. line-height: 36px;
  156. margin: 0 4px;
  157. font-weight: normal;
  158. }
  159. span{
  160. font-size: 20px;
  161. color:#27B148;
  162. }
  163. }
  164. .details-main{
  165. text-align: center;
  166. margin-bottom: 20px;
  167. p{
  168. color:#777;
  169. margin-top: 4px;
  170. }
  171. }
  172. }
  173. </style>