details.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  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 class="details-row" >
  16. <p>订单金额</p>
  17. <span>{{detail.actualFee }}元</span>
  18. </view>
  19. <view class="details-row" v-if="chargeDetails" >
  20. <p>电费金额</p>
  21. <span>{{detail.electricityAmount }}元</span>
  22. </view>
  23. <view class="details-row" v-if="chargeDetails" >
  24. <p>服务费</p>
  25. <span>{{detail.surplusAmount-detail.discountAmount}}元
  26. <span v-if="couponObj&&couponObj.status=='1'">({{detail.surplusAmount}}-{{detail.discountAmount}})</span>
  27. </span>
  28. </view>
  29. <view class="details-row" v-if="couponObj&&couponObj.status=='1'" >
  30. <p>优惠券 </p>
  31. <span>
  32. {{couponObj.useText}}
  33. </span>
  34. </view>
  35. </view>
  36. <view class="details">
  37. <view class="details-title">
  38. <h4>用电明细</h4>
  39. </view>
  40. <view class="details-row" >
  41. <p>总充电量</p>
  42. <span>{{detail.electricQuantity/10000}}度</span>
  43. </view>
  44. <view class="details-row" v-if="!chargeDetails" >
  45. <p>电费单价</p>
  46. <span>{{detail.unitPrice}}元/小时</span>
  47. </view>
  48. <view class="details-row"><p>充电时长</p><span>{{getPercent(detail.chargingMinute)}}</span></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: #37393c;">区间定价</span>
  57. <span style="float: right; color: #333;font-weight: normal;">{{(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" v-if="item.disProportion" >
  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. getPercent(estimateMinute) {
  107. var value="";
  108. var ms =estimateMinute
  109. if (ms > 0) {
  110. var Hour = parseInt(Math.floor(ms / 60 ));
  111. var Fen = parseInt(Math.floor(ms % 60 ));
  112. // value = Hour + "小时" + Fen+"分钟"
  113. if(Hour){
  114. value += Hour + "小时"
  115. }
  116. if(Fen){
  117. value += Fen+"分钟"
  118. }
  119. }
  120. return value;
  121. },
  122. showDateMoth(date){
  123. var back=date;
  124. if(date){
  125. var k= date.slice(5,6)
  126. console.log(k)
  127. if(k=='0'){
  128. back= date.slice(6,7)
  129. }else{
  130. back= date.slice(5,7)
  131. }
  132. }
  133. return back;
  134. },
  135. back(){
  136. uni.navigateBack({
  137. })
  138. },
  139. getInfo(){
  140. uni.showLoading({
  141. title:"加载中",mask:true,
  142. })
  143. API.recordDetailData(this.data).then((res) => {
  144. this.detail=res.data
  145. this.couponObj=res.data.userCoupon;
  146. this.chargeDetails=JSON.parse(res.data.ChargeDetails)
  147. console.log( this.chargeDetails)
  148. this.frmxList=res.data.detailList
  149. uni.hideLoading()
  150. }).catch(error => {
  151. uni.showToast({
  152. title:error
  153. })
  154. })
  155. }
  156. }
  157. }
  158. </script>
  159. <style>
  160. page{
  161. background-color: #F7F7F7;
  162. }
  163. </style>
  164. <style lang="scss" scoped>
  165. .detailsBtn{
  166. margin: 16px;
  167. .detailsBtn-btn{
  168. border-color:#185AC6!important;
  169. border-radius: 8px!important;
  170. background: none!important;
  171. color:#185AC6!important;
  172. }
  173. }
  174. .details-title{
  175. margin-bottom: 16px;
  176. h4{
  177. font-weight: normal;
  178. font-size: 16px;
  179. position: relative;
  180. padding-left:10px;
  181. &::after{
  182. content: '';
  183. position: absolute;
  184. height: 12px;
  185. width: 4px;
  186. background-color: #27B148;
  187. left: 0;
  188. top:5px;
  189. }
  190. }
  191. }
  192. .details-row{
  193. display: flex;
  194. justify-content: space-between;
  195. align-items: center;
  196. margin-top: 15px;
  197. p{
  198. color: #37393c;
  199. font-weight: bold;
  200. }
  201. }
  202. .details-row-sum{
  203. float: right;
  204. color: #888;
  205. font-size: 12px;
  206. }
  207. .details{
  208. margin: 16px;
  209. padding: 20px;
  210. background-color: #fff;
  211. border-radius: 8px;
  212. .details-head{
  213. text-align: center;
  214. display: flex;
  215. align-items: center;
  216. justify-content: center;
  217. h4{
  218. font-size: 18px;
  219. font-weight: normal;
  220. margin-left: 4px;
  221. }
  222. }
  223. .details-price{
  224. margin-top: 28px;
  225. display: flex;
  226. align-items: flex-end;
  227. justify-content: center;
  228. h3{
  229. font-size: 36px;
  230. color:#27B148;
  231. line-height: 36px;
  232. margin: 0 4px;
  233. font-weight: normal;
  234. }
  235. span{
  236. font-size: 20px;
  237. color:#27B148;
  238. }
  239. }
  240. .details-main{
  241. text-align: center;
  242. margin-bottom: 20px;
  243. p{
  244. color:#777;
  245. margin-top: 4px;
  246. }
  247. }
  248. }
  249. </style>