details.vue 6.0 KB

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