details.vue 8.1 KB

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