details.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  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="detail.discountAmount" >
  40. <p>实际减免</p>
  41. <span>
  42. {{detail.discountAmount}}元
  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">
  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}}元/小时</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}}元/度</span>
  74. </p>
  75. <span class="details-row-sum">{{item.electricityPrice}}元/度(电费)+{{item.servicePrice}}元/度(服务费) </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}}元</span>
  86. </view>
  87. </view>
  88. <view class="details">
  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:{
  130. },
  131. title:"",
  132. }
  133. },
  134. onLoad(op){
  135. this.data.detailId=op.id;
  136. this.getInfo()
  137. },
  138. methods: {
  139. getPercent(estimateMinute) {
  140. var value="";
  141. var ms =estimateMinute
  142. if (ms > 0) {
  143. var Hour = parseInt(Math.floor(ms / 60 ));
  144. var Fen = parseInt(Math.floor(ms % 60 ));
  145. // value = Hour + "小时" + Fen+"分钟"
  146. if(Hour){
  147. value += Hour + "小时"
  148. }
  149. if(Fen){
  150. value += Fen+"分钟"
  151. }
  152. }
  153. return value;
  154. },
  155. showDateMoth(date){
  156. var back=date;
  157. if(date){
  158. var k= date.slice(5,6)
  159. console.log(k)
  160. if(k=='0'){
  161. back= date.slice(6,7)
  162. }else{
  163. back= date.slice(5,7)
  164. }
  165. }
  166. return back;
  167. },
  168. back(){
  169. uni.navigateBack({
  170. })
  171. },
  172. getInfo(){
  173. uni.showLoading({
  174. title:"加载中",mask:true,
  175. })
  176. API.recordDetailData(this.data).then((res) => {
  177. this.detail=res.data
  178. this.couponObj=res.data.userCoupon;
  179. this.chargeDetails=JSON.parse(res.data.ChargeDetails)
  180. console.log( this.chargeDetails)
  181. this.frmxList=res.data.detailList
  182. uni.hideLoading()
  183. }).catch(error => {
  184. uni.showToast({
  185. title:error
  186. })
  187. })
  188. }
  189. }
  190. }
  191. </script>
  192. <style>
  193. page{
  194. background-color: #F7F7F7;
  195. }
  196. </style>
  197. <style lang="scss" scoped>
  198. .detailsBtn{
  199. margin: 16px;
  200. .detailsBtn-btn{
  201. border-color:#185AC6!important;
  202. border-radius: 8px!important;
  203. background: none!important;
  204. color:#185AC6!important;
  205. }
  206. }
  207. .details-title{
  208. margin-bottom: 16px;
  209. h4{
  210. font-weight: normal;
  211. font-size: 16px;
  212. position: relative;
  213. padding-left:10px;
  214. &::after{
  215. content: '';
  216. position: absolute;
  217. height: 12px;
  218. width: 4px;
  219. background-color: #27B148;
  220. left: 0;
  221. top:5px;
  222. }
  223. }
  224. }
  225. .details-row{
  226. display: flex;
  227. justify-content: space-between;
  228. align-items: center;
  229. margin-top: 15px;
  230. p{
  231. color: #37393c;
  232. font-weight: bold;
  233. }
  234. }
  235. .details-row-sum{
  236. float: right;
  237. color: #888;
  238. font-size: 12px;
  239. }
  240. .details{
  241. margin: 16px;
  242. padding: 20px;
  243. background-color: #fff;
  244. border-radius: 8px;
  245. .details-head{
  246. text-align: center;
  247. display: flex;
  248. align-items: center;
  249. justify-content: center;
  250. h4{
  251. font-size: 18px;
  252. font-weight: normal;
  253. margin-left: 4px;
  254. }
  255. }
  256. .details-price{
  257. margin-top: 28px;
  258. display: flex;
  259. align-items: flex-end;
  260. justify-content: center;
  261. h3{
  262. font-size: 36px;
  263. color:#27B148;
  264. line-height: 36px;
  265. margin: 0 4px;
  266. font-weight: normal;
  267. }
  268. span{
  269. font-size: 20px;
  270. color:#27B148;
  271. }
  272. }
  273. .details-main{
  274. text-align: center;
  275. margin-bottom: 20px;
  276. p{
  277. color:#777;
  278. margin-top: 4px;
  279. }
  280. }
  281. }
  282. </style>