details.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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. -->
  8. <h4>{{detail.record&&detail.record.flowNo?detail.record.flowNo:'无充电单号'}}</h4>
  9. </view>
  10. <view class="details-main">
  11. <view class="details-price">
  12. <h3>{{detail.income?detail.income:0}}</h3><span>元</span>
  13. </view>
  14. <p>本单收益</p>
  15. </view>
  16. <view class="details-row" v-if="detail.deviceType" ><p>订单类型 </p><span>{{options0[detail.deviceType].label}}
  17. </span></view>
  18. <view class="details-row" v-if="detail.deviceType!='0'" ><p>电费 </p><span>{{detail.electricityAmount?detail.electricityAmount:0}}元</span></view>
  19. <view class="details-row" v-if="detail.deviceType!='0'" >
  20. <p>服务费</p>
  21. <span v-if="detail.record">{{detail.surplusAmount}}元
  22. <!-- <span v-if="couponObj&&couponObj.status=='1'">({{detail.surplusAmount}}-{{detail.record.discountAmount}})</span>
  23. -->
  24. </span>
  25. </view>
  26. <view class="details-row" v-if="couponObj&&couponObj.status=='1'" >
  27. <p>优惠券 </p>
  28. <span>
  29. {{couponObj.useText}}
  30. </span>
  31. </view>
  32. <view class="details-row" v-if="couponObj&&couponObj.status=='1'&&detail.record" >
  33. <p>实际减免 </p>
  34. <span>
  35. {{detail.record.discountAmount}}元
  36. </span>
  37. </view>
  38. </view>
  39. <view class="details">
  40. <view class="details-title">
  41. <h4>用电明细</h4>
  42. </view>
  43. <view class="details-row" >
  44. <p>总充电量</p>
  45. <span>{{detail.electricQuantity/10000}}度</span>
  46. </view>
  47. <view class="details-row"><p>开始时间</p><span>{{detail.startTime?detail.startTime:detail.endTime}}</span></view>
  48. <view class="details-row"><p>结束时间</p><span>{{detail.endTime}}</span></view>
  49. <view class="details-row"><p>充电时长</p><span>{{getPercent(detail.chargingMinute)}}</span></view>
  50. <view class="details-row" v-if="detail.deviceType=='0'" >
  51. <p>电费单价</p>
  52. <span>{{detail.unitPrice}}元/小时</span>
  53. </view>
  54. <view v-for="(item,i) in chargeDetails" :key="i">
  55. <view class="details-row" style=" margin-top: 18px;" >
  56. <p>区间充电量({{item.startTime}}-{{item.endTime}})</p>
  57. <span >{{item.kwh }}度</span>
  58. </view>
  59. <view class="details-row" style="display: block;" >
  60. <p>
  61. <span style=" color: #37393c;">区间定价</span>
  62. <span style="float: right; color: #333;font-weight: normal;">{{(item.electricityPrice*100+item.servicePrice*100)/100}}元/度</span>
  63. </p>
  64. <span class="details-row-sum">{{item.electricityPrice}}元/度(电费)+{{item.servicePrice}}元/度(服务费) </span>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="details" v-if="sprList&&sprList.length">
  69. <view class="details-title">
  70. <h4>分润明细</h4>
  71. </view>
  72. <view class="details-row" v-for="(item,i) in sprList" :key="i" v-if="item.disProportion">
  73. <p>{{item.merchantAccountName}}({{(item.disProportion*100).toFixed(2)}}%)</p>
  74. <span>{{item.shareProfitAmount}}元</span>
  75. </view>
  76. </view>
  77. <view class="details">
  78. <view class="details-title">
  79. <h4>更多信息</h4>
  80. </view>
  81. <view class="details-row"><p>来源站点</p><span>{{detail.stationName}}</span></view>
  82. <view class="details-row"><p>来源充电桩</p><span>{{detail.deviceName}}</span></view>
  83. <view class="details-row" ><p>桩号</p><span>{{detail.deviceNo}}</span></view>
  84. <view class="details-row" ><p>枪号</p><span>{{detail.gunNo}}号充电枪</span></view>
  85. </view>
  86. <view class="details">
  87. <view class="details-title">
  88. <h4>充电用户</h4>
  89. </view>
  90. <view class="details-row"><p>用户昵称</p><span>{{detail.chargeUserName?detail.chargeUserName:'未命名'}}</span></view>
  91. <view class="details-row"><p>手机号码</p><span>{{detail.chargeUserPhone}}</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. chargeDetails:[],
  104. id:'',
  105. sprList:[
  106. ],
  107. detail:{
  108. },
  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. title:"",
  124. couponObj:null,
  125. }
  126. },
  127. onLoad(op){
  128. this.id=op.id;
  129. this.getInfo()
  130. },
  131. methods: {
  132. getPercent(estimateMinute) {
  133. var value="";
  134. var ms =estimateMinute
  135. if (ms > 0) {
  136. var Hour = parseInt(Math.floor(ms / 60 ));
  137. var Fen = parseInt(Math.floor(ms % 60 ));
  138. if(Hour){
  139. value += Hour + "小时"
  140. }
  141. if(Fen){
  142. value += Fen+"分钟"
  143. }
  144. }else{
  145. value="0分钟"
  146. }
  147. return value;
  148. },
  149. back(){
  150. uni.navigateBack({
  151. })
  152. },
  153. getInfo(){
  154. uni.showLoading({
  155. title:"加载中",mask:true,
  156. })
  157. API.incomeDetails({
  158. recordId:this.id
  159. }).then((res) => {
  160. this.detail=res.data
  161. //this.sprList=res.data.cdmList
  162. this.couponObj=res.data.userCoupon;
  163. this.chargeDetails=JSON.parse(res.data.ChargeDetails)
  164. this.sprList=res.data.detailList
  165. uni.hideLoading()
  166. }).catch(error => {
  167. uni.showToast({
  168. title:error
  169. })
  170. })
  171. }
  172. }
  173. }
  174. </script>
  175. <style>
  176. page{
  177. background-color: #F7F7F7;
  178. }
  179. </style>
  180. <style lang="scss" scoped>
  181. .detailsBtn{
  182. margin: 16px;
  183. .detailsBtn-btn{
  184. border-color:#185AC6!important;
  185. border-radius: 8px!important;
  186. background: none!important;
  187. color:#185AC6!important;
  188. }
  189. }
  190. .details-title{
  191. margin-bottom: 16px;
  192. h4{
  193. font-weight: normal;
  194. font-size: 16px;
  195. position: relative;
  196. padding-left:10px;
  197. &::after{
  198. content: '';
  199. position: absolute;
  200. height: 12px;
  201. width: 4px;
  202. background-color: #27B148;
  203. left: 0;
  204. top:5px;
  205. }
  206. }
  207. }
  208. .details-row{
  209. display: flex;
  210. justify-content: space-between;
  211. align-items: center;
  212. margin-top: 15px;
  213. p{
  214. color: #37393c;
  215. font-weight: bold;
  216. }
  217. }
  218. .details{
  219. margin: 16px;
  220. padding: 20px;
  221. background-color: #fff;
  222. border-radius: 8px;
  223. .details-head{
  224. text-align: center;
  225. display: flex;
  226. align-items: center;
  227. justify-content: center;
  228. h4{
  229. font-size: 18px;
  230. font-weight: normal;
  231. margin-left: 4px;
  232. }
  233. }
  234. .details-price{
  235. margin-top: 28px;
  236. display: flex;
  237. align-items: flex-end;
  238. justify-content: center;
  239. h3{
  240. font-size: 36px;
  241. color:#27B148;
  242. line-height: 36px;
  243. margin: 0 4px;
  244. font-weight: normal;
  245. }
  246. span{
  247. font-size: 20px;
  248. color:#27B148;
  249. }
  250. }
  251. .details-main{
  252. text-align: center;
  253. margin-bottom: 20px;
  254. p{
  255. color:#777;
  256. margin-top: 4px;
  257. }
  258. }
  259. }
  260. .details-row-sum{
  261. float: right;
  262. color: #888;
  263. font-size: 12px;
  264. }
  265. </style>