details.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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-detail.discountAmount}}元
  28. <span v-if="couponObj&&couponObj.status=='1'">({{detail.surplusAmount}}-{{detail.discountAmount}})</span>
  29. </span>
  30. </view>
  31. <view class="details-row" v-if="couponObj&&couponObj.status=='1'" >
  32. <p>优惠券 </p>
  33. <span>
  34. {{couponObj.useText}}
  35. </span>
  36. </view>
  37. </view>
  38. <view class="details">
  39. <view class="details-title">
  40. <h4>用电明细</h4>
  41. </view>
  42. <view class="details-row" >
  43. <p>总充电量</p>
  44. <span>{{detail.electricQuantity/10000}}度</span>
  45. </view>
  46. <view class="details-row" v-if="detail.deviceType=='0'" >
  47. <p>电费单价</p>
  48. <span>{{detail.unitPrice}}元/小时</span>
  49. </view>
  50. <view class="details-row"><p>充电时长</p><span>{{getPercent(detail.chargingMinute)}}</span></view>
  51. <view v-for="(item,i) in chargeDetails" :key="i">
  52. <view class="details-row" style=" margin-top: 18px;" >
  53. <p>区间充电量({{item.startTime}}-{{item.endTime}})</p>
  54. <span >{{item.kwh }}度</span>
  55. </view>
  56. <view class="details-row" style="display: block;" >
  57. <p>
  58. <span style=" color: #37393c;">区间定价</span>
  59. <span style="float: right; color: #333;font-weight: normal;">{{(item.electricityPrice*100+item.servicePrice*100)/100}}元/度</span>
  60. </p>
  61. <span class="details-row-sum">{{item.electricityPrice}}元/度(电费)+{{item.servicePrice}}元/度(服务费) </span>
  62. </view>
  63. </view>
  64. </view>
  65. <view class="details">
  66. <view class="details-title">
  67. <h4>分润明细</h4>
  68. </view>
  69. <view class="details-row" v-for="(item,i) in frmxList" :key="i" v-if="item.disProportion" >
  70. <p>{{item.merchantAccountName}}({{(item.disProportion*100).toFixed(2)}}%)</p>
  71. <span>{{item.shareProfitAmount}}元</span>
  72. </view>
  73. </view>
  74. <view class="details">
  75. <view class="details-title">
  76. <h4>更多信息</h4>
  77. </view>
  78. <view class="details-row"><p>来源站点</p><span>{{detail.stationName}}</span></view>
  79. <view class="details-row"><p>来源充电桩</p><span>{{detail.deviceName}}</span></view>
  80. <view class="details-row"><p>发放时间</p><span>{{detail.createTime}}</span></view>
  81. </view>
  82. <view class="detailsBtn">
  83. <u-button class="detailsBtn-btn" @click="back" type="primary" plain>返回</u-button>
  84. </view>
  85. </view>
  86. </template>
  87. <script>
  88. import * as API from '@/apis/finance.js'
  89. export default {
  90. data() {
  91. return {
  92. options0: [
  93. {
  94. label: '自行车充电',
  95. value: 0,
  96. },
  97. {
  98. label: '直流快充',
  99. value: 1,
  100. },
  101. {
  102. label: '交流慢充',
  103. value: 2,
  104. }
  105. ],
  106. chargeDetails:[],
  107. data:{},
  108. id:'',
  109. frmxList:[
  110. ],
  111. couponObj:null,
  112. detail:{
  113. },
  114. title:"",
  115. }
  116. },
  117. onLoad(op){
  118. this.data.detailId=op.id;
  119. this.getInfo()
  120. },
  121. methods: {
  122. getPercent(estimateMinute) {
  123. var value="";
  124. var ms =estimateMinute
  125. if (ms > 0) {
  126. var Hour = parseInt(Math.floor(ms / 60 ));
  127. var Fen = parseInt(Math.floor(ms % 60 ));
  128. // value = Hour + "小时" + Fen+"分钟"
  129. if(Hour){
  130. value += Hour + "小时"
  131. }
  132. if(Fen){
  133. value += Fen+"分钟"
  134. }
  135. }
  136. return value;
  137. },
  138. showDateMoth(date){
  139. var back=date;
  140. if(date){
  141. var k= date.slice(5,6)
  142. console.log(k)
  143. if(k=='0'){
  144. back= date.slice(6,7)
  145. }else{
  146. back= date.slice(5,7)
  147. }
  148. }
  149. return back;
  150. },
  151. back(){
  152. uni.navigateBack({
  153. })
  154. },
  155. getInfo(){
  156. uni.showLoading({
  157. title:"加载中",mask:true,
  158. })
  159. API.recordDetailData(this.data).then((res) => {
  160. this.detail=res.data
  161. this.couponObj=res.data.userCoupon;
  162. this.chargeDetails=JSON.parse(res.data.ChargeDetails)
  163. console.log( this.chargeDetails)
  164. this.frmxList=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-row-sum{
  219. float: right;
  220. color: #888;
  221. font-size: 12px;
  222. }
  223. .details{
  224. margin: 16px;
  225. padding: 20px;
  226. background-color: #fff;
  227. border-radius: 8px;
  228. .details-head{
  229. text-align: center;
  230. display: flex;
  231. align-items: center;
  232. justify-content: center;
  233. h4{
  234. font-size: 18px;
  235. font-weight: normal;
  236. margin-left: 4px;
  237. }
  238. }
  239. .details-price{
  240. margin-top: 28px;
  241. display: flex;
  242. align-items: flex-end;
  243. justify-content: center;
  244. h3{
  245. font-size: 36px;
  246. color:#27B148;
  247. line-height: 36px;
  248. margin: 0 4px;
  249. font-weight: normal;
  250. }
  251. span{
  252. font-size: 20px;
  253. color:#27B148;
  254. }
  255. }
  256. .details-main{
  257. text-align: center;
  258. margin-bottom: 20px;
  259. p{
  260. color:#777;
  261. margin-top: 4px;
  262. }
  263. }
  264. }
  265. </style>