details.vue 4.6 KB

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