details.vue 7.0 KB

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