yearmoney.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <div class="yearmoney">
  3. <div class="boxmoney">
  4. <div class="slider">
  5. <div class="before" style="width:50%;left:0%;"></div>
  6. <div class="last" style="width:30%;left:50%;"></div>
  7. <div class="current" style="width:20%;left:80%;"></div>
  8. <div class="beforetitle" style="width:50%;left:0%;">
  9. <div class="money"><label class="ledfont">{{ beforeNextMonthPay }}</label><label>元</label></div>
  10. <div class="title">上月之前收费</div>
  11. </div>
  12. <div class="lasttitle" style="width:30%;left:50%;">
  13. <div class="money"><label class="ledfont">{{ nextMonthPay }}</label><label>元</label></div>
  14. <div class="title">上月收费</div>
  15. </div>
  16. </div>
  17. <div class="yeartitle">
  18. <div class="money"><label class="ledfont">{{ curYearPay }}</label><label>元</label></div>
  19. <div class="title">本年度收费</div>
  20. </div>
  21. </div>
  22. </div>
  23. </template>
  24. <script>
  25. import {getThisYearPay} from '@/api/comprehensive'
  26. import config from '@/views/config/requestConfig'
  27. export default {
  28. name: 'yearmoney',
  29. data() {
  30. return {
  31. beforeNextMonthPay:0,
  32. nextMonthPay:0,
  33. curYearPay:0,
  34. curMonthPay:0
  35. }
  36. },
  37. components: {
  38. },
  39. created(){
  40. getThisYearPay({token:config.token}).then(res=>{
  41. if(res.Code == 200){
  42. this.curYearPay = parseFloat(res.Result.ThisYearPay)
  43. this.curMonthPay = parseFloat(res.Result.ThismonthPay === '' ? 0 : res.Result.ThismonthPay)
  44. this.nextMonthPay = parseFloat(res.Result.lastmonthPay)
  45. this.beforeNextMonthPay = (this.curYearPay - this.curMonthPay - this.nextMonthPay).toFixed(2)
  46. }
  47. })
  48. },
  49. mounted() {
  50. this.drawChart()
  51. },
  52. methods: {
  53. drawChart() {
  54. },
  55. }
  56. }
  57. </script>
  58. <style lang="scss">
  59. .yearmoney{
  60. width: calc(100% - 16px);
  61. height: calc(100% - 16px);
  62. padding: 8px;
  63. // border: 1px red solid;
  64. .boxmoney{
  65. width: 100%;
  66. height: 100%;
  67. background: #062F50;
  68. border-radius: 4px;
  69. display: flex;
  70. flex-direction: row;
  71. justify-content: center ;
  72. align-items: center ;
  73. // border: 1px red solid;
  74. .slider{
  75. width: 76%;
  76. height: 10px;
  77. background: #0880EE;
  78. // border: 1px red solid;
  79. position: relative;
  80. display: flex;
  81. flex-direction: row;
  82. justify-content:flex-start;
  83. // z-index: 100;
  84. .before{
  85. height: 100%;
  86. background: #BEB56A;
  87. position: absolute;
  88. // border: 1px red solid;
  89. // z-index: 101;
  90. }
  91. .last{
  92. height: 100%;
  93. background: #D7CB69;
  94. position: absolute;
  95. // z-index: 102;
  96. // border: 1px red solid;
  97. }
  98. .current{
  99. height: 100%;
  100. background: #02B1C5;
  101. position: absolute;
  102. // z-index: 103;
  103. // border: 1px red solid;
  104. }
  105. .beforetitle{
  106. height: 40px;
  107. top:-46px;
  108. text-align: left;
  109. position: absolute;
  110. // border: 1px red solid;
  111. // z-index: 101;
  112. .money{
  113. color: #BEB56A;
  114. }
  115. }
  116. .lasttitle{
  117. height: 40px;
  118. top:10px;
  119. text-align: left;
  120. position: absolute;
  121. // border: 1px red solid;
  122. // z-index: 101;
  123. .money{
  124. color: #D7CB69;
  125. }
  126. }
  127. }
  128. .yeartitle{
  129. width: 20%;
  130. height: 40px;
  131. margin-left: 6px;
  132. text-align: left;
  133. overflow: hidden;
  134. // border: 1px red solid;
  135. .money{
  136. color: #0880EE;
  137. }
  138. }
  139. .ledfont{
  140. font-size: 20px;
  141. font-family: "myFont";
  142. }
  143. .money{
  144. width: 100%;
  145. font-size: 16px;
  146. font-weight: bold;
  147. }
  148. .title{
  149. width: 100%;
  150. font-size: 14px;
  151. font-weight: 400;
  152. color: #A4D9F9;
  153. }
  154. }
  155. }
  156. </style>