details.vue 5.7 KB

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