shunt-places.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <view class="page-container">
  3. <u-nav-bar title="专业分流名额" />
  4. <view class="u-bg" />
  5. <view class="main-content">
  6. <view class="statistics-container u-flex">
  7. <view v-for="(item,index) in statisticsList" :key="index" class="statistics-item u-flex-column">
  8. <view class="icon-container">
  9. <image :src="item.icon" mode="widthFix" class="icon"></image>
  10. </view>
  11. <view class="value">{{item.value}}</view>
  12. <view class="label">{{item.label}}</view>
  13. </view>
  14. </view>
  15. <view class="rank-container">
  16. <view v-for="(item,index) in rankList" :key="index" class="rank-item u-flex">
  17. <view class="rank">{{index+1}}</view>
  18. <view class="label">{{item.majorName}}</view>
  19. <view class="value">{{item.sinUpStudentsNum}}/{{item.totalStudentsNum}}</view>
  20. </view>
  21. </view>
  22. <view class="tip">
  23. 注:各专业报名人数为第一志愿已报人数,正式报名阶段每小时 更新一次~
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. statisticsList: [{
  33. prop: 'totalStudents',
  34. value: 0,
  35. label: '学生总人数',
  36. icon: '/static/num_icon.png'
  37. },
  38. {
  39. prop: 'sinUpStudents',
  40. value: 0,
  41. label: '已报人数',
  42. icon: '/static/choose_icon.png'
  43. },
  44. {
  45. prop: 'unSinUpStudents',
  46. value: 0,
  47. label: '未报名人数',
  48. icon: '/static/no_choose_icon.png'
  49. },
  50. ],
  51. rankList: []
  52. }
  53. },
  54. mounted() {
  55. this.init()
  56. },
  57. methods: {
  58. async init() {
  59. uni.showLoading({
  60. title: '加载中'
  61. });
  62. this.$ajax.post('/shunt/quota').then(res => {
  63. const data = res.data || {}
  64. this.statisticsList.forEach(element => {
  65. element.value = data[element.prop]
  66. })
  67. this.rankList = data.majorShuntCountVOList || []
  68. }).catch(error => {
  69. this.statisticsList.forEach(element => {
  70. element.value = 0
  71. })
  72. this.rankList = []
  73. }).finally(() => {
  74. console.log(this.statisticsList)
  75. uni.hideLoading();
  76. })
  77. },
  78. }
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. $bg-height: 317rpx;
  83. .page-container {
  84. .u-bg {
  85. height: $bg-height;
  86. background: $uni-color-primary;
  87. }
  88. .main-content {
  89. padding: 0 32rpx;
  90. }
  91. .statistics-container {
  92. margin: $bg-height - $u-nav-bar-height 0 0 0;
  93. transform: translateY(-50%);
  94. .statistics-item {
  95. height: 170rpx;
  96. flex: 1;
  97. background: #FFFFFF;
  98. box-shadow: 0px 4px 22px 0px rgba(232, 237, 251, 0.8);
  99. border-radius: 16px;
  100. padding: 16rpx 20rpx;
  101. &:nth-child(2) {
  102. margin: 0 24rpx;
  103. }
  104. .value {
  105. font-size: 43rpx;
  106. font-weight: bold;
  107. color: #333333;
  108. width: 100%;
  109. }
  110. .label {
  111. font-size: 24rpx;
  112. font-weight: 400;
  113. color: #333333;
  114. width: 100%;
  115. }
  116. .icon {
  117. width: 44rpx;
  118. height: 44rpx;
  119. }
  120. .icon-container {
  121. width: 100%;
  122. text-align: right;
  123. }
  124. }
  125. }
  126. .rank-container {
  127. .rank-item {
  128. margin-bottom: 60rpx;
  129. .rank {
  130. font-size: 41rpx;
  131. font-weight: bold;
  132. color: #A3ABBF;
  133. margin-right: 30rpx;
  134. }
  135. &:nth-child(1) {
  136. .rank {
  137. color: #FFB300;
  138. }
  139. }
  140. &:nth-child(2) {
  141. .rank {
  142. color: #ED6E4E;
  143. }
  144. }
  145. &:nth-child(3) {
  146. .rank {
  147. color: #078EF7;
  148. }
  149. }
  150. .label {
  151. font-size: 32rpx;
  152. font-weight: bold;
  153. color: #333333;
  154. flex: 1;
  155. }
  156. .value {
  157. font-size: 24rpx;
  158. font-weight: 400;
  159. color: #333333;
  160. }
  161. }
  162. }
  163. .tip {
  164. font-size: 24rpx;
  165. font-weight: 400;
  166. color: #FFB300;
  167. line-height: 1.5;
  168. }
  169. }
  170. </style>