details.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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" >
  36. <p>总充电量</p>
  37. <span>{{detail.electricQuantity/10000}}度</span>
  38. </view>
  39. <view v-for="(item,i) in chargeDetails" :key="i">
  40. <view class="details-row" style=" margin-top: 18px;" >
  41. <p>区间充电量({{item.startTime}}-{{item.endTime}})</p>
  42. <span >{{item.kwh }}度</span>
  43. </view>
  44. <view class="details-row" style="display: block;" >
  45. <p>
  46. <span style=" color: #37393c;">区间定价</span>
  47. <span style="float: right; color: #333;font-weight: normal;">{{(item.electricityPrice*100+item.servicePrice*100)/100}}元/度</span>
  48. </p>
  49. <span class="details-row-sum">{{item.electricityPrice}}元/度(电费)+{{item.servicePrice}}元/度(服务费) </span>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="details">
  54. <view class="details-title">
  55. <h4>分润明细</h4>
  56. </view>
  57. <view class="details-row" v-for="(item,i) in sprList" :key="i" v-if="item.disProportion">
  58. <p>{{item.merchantAccountName}}({{(item.disProportion*100).toFixed(2)}}%)</p>
  59. <span>{{item.shareProfitAmount}}元</span>
  60. </view>
  61. </view>
  62. <view class="details">
  63. <view class="details-title">
  64. <h4>更多信息</h4>
  65. </view>
  66. <view class="details-row"><p>来源站点</p><span>{{detail.stationName}}</span></view>
  67. <view class="details-row"><p>来源充电桩</p><span>{{detail.deviceName}}</span></view>
  68. <view class="details-row"><p>开始时间</p><span>{{detail.startTime}}</span></view>
  69. <view class="details-row"><p>结束时间</p><span>{{detail.endTime}}</span></view>
  70. <view class="details-row"><p>充电时长</p><span>{{getPercent(detail.chargingMinute)}}</span></view>
  71. </view>
  72. <view class="detailsBtn">
  73. <u-button class="detailsBtn-btn" @click="back" type="primary" plain>返回</u-button>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. import * as API from '@/apis/finance.js'
  79. export default {
  80. data() {
  81. return {
  82. chargeDetails:[],
  83. id:'',
  84. sprList:[
  85. ],
  86. detail:{
  87. },
  88. title:"",
  89. couponObj:null,
  90. }
  91. },
  92. onLoad(op){
  93. this.id=op.id;
  94. this.getInfo()
  95. },
  96. methods: {
  97. getPercent(estimateMinute) {
  98. var value="";
  99. var ms =estimateMinute
  100. if (ms > 0) {
  101. var Hour = parseInt(Math.floor(ms / 60 ));
  102. var Fen = parseInt(Math.floor(ms % 60 ));
  103. value = Hour + "小时" + Fen+"分钟"
  104. }
  105. return value;
  106. },
  107. back(){
  108. uni.navigateBack({
  109. })
  110. },
  111. getInfo(){
  112. uni.showLoading({
  113. title:"加载中",mask:true,
  114. })
  115. API.incomeDetails({
  116. recordId:this.id
  117. }).then((res) => {
  118. this.detail=res.data
  119. //this.sprList=res.data.cdmList
  120. this.couponObj=res.data.userCoupon;
  121. this.chargeDetails=JSON.parse(res.data.ChargeDetails)
  122. this.sprList=res.data.detailList
  123. uni.hideLoading()
  124. }).catch(error => {
  125. uni.showToast({
  126. title:error
  127. })
  128. })
  129. }
  130. }
  131. }
  132. </script>
  133. <style>
  134. page{
  135. background-color: #F7F7F7;
  136. }
  137. </style>
  138. <style lang="scss" scoped>
  139. .detailsBtn{
  140. margin: 16px;
  141. .detailsBtn-btn{
  142. border-color:#185AC6!important;
  143. border-radius: 8px!important;
  144. background: none!important;
  145. color:#185AC6!important;
  146. }
  147. }
  148. .details-title{
  149. margin-bottom: 16px;
  150. h4{
  151. font-weight: normal;
  152. font-size: 16px;
  153. position: relative;
  154. padding-left:10px;
  155. &::after{
  156. content: '';
  157. position: absolute;
  158. height: 12px;
  159. width: 4px;
  160. background-color: #27B148;
  161. left: 0;
  162. top:5px;
  163. }
  164. }
  165. }
  166. .details-row{
  167. display: flex;
  168. justify-content: space-between;
  169. align-items: center;
  170. margin-top: 15px;
  171. p{
  172. color: #37393c;
  173. font-weight: bold;
  174. }
  175. }
  176. .details{
  177. margin: 16px;
  178. padding: 20px;
  179. background-color: #fff;
  180. border-radius: 8px;
  181. .details-head{
  182. text-align: center;
  183. display: flex;
  184. align-items: center;
  185. justify-content: center;
  186. h4{
  187. font-size: 18px;
  188. font-weight: normal;
  189. margin-left: 4px;
  190. }
  191. }
  192. .details-price{
  193. margin-top: 28px;
  194. display: flex;
  195. align-items: flex-end;
  196. justify-content: center;
  197. h3{
  198. font-size: 36px;
  199. color:#27B148;
  200. line-height: 36px;
  201. margin: 0 4px;
  202. font-weight: normal;
  203. }
  204. span{
  205. font-size: 20px;
  206. color:#27B148;
  207. }
  208. }
  209. .details-main{
  210. text-align: center;
  211. margin-bottom: 20px;
  212. p{
  213. color:#777;
  214. margin-top: 4px;
  215. }
  216. }
  217. }
  218. .details-row-sum{
  219. float: right;
  220. color: #888;
  221. font-size: 12px;
  222. }
  223. </style>