details.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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)}}元</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">
  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;">{{((item.electricityPrice*100+item.servicePrice*100)/100).toFixed(2)}}元/度</span>
  74. </p>
  75. <span class="details-row-sum">{{item.electricityPrice.toFixed(2)}}元/度(电费)+{{item.servicePrice.toFixed(2)}}元/度(服务费) </span>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="details">
  80. <view class="details-title">
  81. <h4>分润明细</h4>
  82. </view>
  83. <view class="details-row" v-for="(item,i) in frmxList" :key="i" v-if="item.disProportion" >
  84. <p>{{item.merchantAccountName}}({{(item.disProportion*100).toFixed(2)}}%)</p>
  85. <span>{{item.shareProfitAmount.toFixed(2)}}元</span>
  86. </view>
  87. </view>
  88. <view class="details" v-if="detail">
  89. <view class="details-title">
  90. <h4>更多信息</h4>
  91. </view>
  92. <view class="details-row"><p>来源站点</p><span>{{detail.stationName}}</span></view>
  93. <view class="details-row"><p>来源充电桩</p><span>{{detail.deviceName}}</span></view>
  94. <view class="details-row" ><p>桩号</p><span>{{detail.deviceNo}}</span></view>
  95. <view class="details-row" v-if="detail.deviceType!='0'" ><p>枪号</p><span>{{detail.gunNo}}号充电枪</span></view>
  96. <view class="details-row" v-if="detail.deviceType=='0'" ><p>通道号</p><span>{{detail.gunNo}}号</span></view>
  97. <view class="details-row"><p>发放时间</p><span>{{detail.createTime}}</span></view>
  98. </view>
  99. <view class="detailsBtn">
  100. <u-button class="detailsBtn-btn" @click="back" type="primary" plain>返回</u-button>
  101. </view>
  102. </view>
  103. </template>
  104. <script>
  105. import * as API from '@/apis/finance.js'
  106. export default {
  107. data() {
  108. return {
  109. options0: [
  110. {
  111. label: '自行车充电',
  112. value: 0,
  113. },
  114. {
  115. label: '直流快充',
  116. value: 1,
  117. },
  118. {
  119. label: '交流慢充',
  120. value: 2,
  121. }
  122. ],
  123. chargeDetails:[],
  124. data:{},
  125. id:'',
  126. frmxList:[
  127. ],
  128. couponObj:null,
  129. detail:null,
  130. title:"",
  131. }
  132. },
  133. onLoad(op){
  134. this.data.detailId=op.id;
  135. this.getInfo()
  136. },
  137. methods: {
  138. getPercent(estimateMinute) {
  139. var value="";
  140. var ms =estimateMinute
  141. if (ms > 0) {
  142. var Hour = parseInt(Math.floor(ms / 60 ));
  143. var Fen = parseInt(Math.floor(ms % 60 ));
  144. // value = Hour + "小时" + Fen+"分钟"
  145. if(Hour){
  146. value += Hour + "小时"
  147. }
  148. if(Fen){
  149. value += Fen+"分钟"
  150. }
  151. }
  152. return value;
  153. },
  154. showDateMoth(date){
  155. var back=date;
  156. if(date){
  157. var k= date.slice(5,6)
  158. console.log(k)
  159. if(k=='0'){
  160. back= date.slice(6,7)
  161. }else{
  162. back= date.slice(5,7)
  163. }
  164. }
  165. return back;
  166. },
  167. back(){
  168. uni.navigateBack({
  169. })
  170. },
  171. getInfo(){
  172. uni.showLoading({
  173. title:"加载中",mask:true,
  174. })
  175. API.recordDetailData(this.data).then((res) => {
  176. this.detail=res.data
  177. this.couponObj=res.data.userCoupon;
  178. this.chargeDetails=JSON.parse(res.data.ChargeDetails)
  179. console.log( this.chargeDetails)
  180. this.frmxList=res.data.detailList
  181. uni.hideLoading()
  182. }).catch(error => {
  183. uni.showToast({
  184. title:error
  185. })
  186. })
  187. }
  188. }
  189. }
  190. </script>
  191. <style>
  192. page{
  193. background-color: #F7F7F7;
  194. }
  195. </style>
  196. <style lang="scss" scoped>
  197. .detailsBtn{
  198. margin: 16px;
  199. .detailsBtn-btn{
  200. border-color:#185AC6!important;
  201. border-radius: 8px!important;
  202. background: none!important;
  203. color:#185AC6!important;
  204. }
  205. }
  206. .details-title{
  207. margin-bottom: 16px;
  208. h4{
  209. font-weight: normal;
  210. font-size: 16px;
  211. position: relative;
  212. padding-left:10px;
  213. &::after{
  214. content: '';
  215. position: absolute;
  216. height: 12px;
  217. width: 4px;
  218. background-color: #27B148;
  219. left: 0;
  220. top:5px;
  221. }
  222. }
  223. }
  224. .details-row{
  225. display: flex;
  226. justify-content: space-between;
  227. align-items: center;
  228. margin-top: 15px;
  229. p{
  230. color: #37393c;
  231. font-weight: bold;
  232. }
  233. }
  234. .details-row-sum{
  235. float: right;
  236. color: #888;
  237. font-size: 12px;
  238. }
  239. .details{
  240. margin: 16px;
  241. padding: 20px;
  242. background-color: #fff;
  243. border-radius: 8px;
  244. .details-head{
  245. text-align: center;
  246. display: flex;
  247. align-items: center;
  248. justify-content: center;
  249. h4{
  250. font-size: 18px;
  251. font-weight: normal;
  252. margin-left: 4px;
  253. }
  254. }
  255. .details-price{
  256. margin-top: 28px;
  257. display: flex;
  258. align-items: flex-end;
  259. justify-content: center;
  260. h3{
  261. font-size: 36px;
  262. color:#27B148;
  263. line-height: 36px;
  264. margin: 0 4px;
  265. font-weight: normal;
  266. }
  267. span{
  268. font-size: 20px;
  269. color:#27B148;
  270. }
  271. }
  272. .details-main{
  273. text-align: center;
  274. margin-bottom: 20px;
  275. p{
  276. color:#777;
  277. margin-top: 4px;
  278. }
  279. }
  280. }
  281. </style>