PastReview.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. <template>
  2. <div class="container">
  3. <div class="review-page">
  4. <div class="reviews-header">
  5. <p class="title">
  6. 往届回顾
  7. <span class="sub">
  8. <span>{{activities.length}}</span>
  9. 个活动已结束
  10. </span>
  11. </p>
  12. <div class="selections">
  13. <span class="name">年份:</span>
  14. <ul>
  15. <li :class="activeIndex == 0 ? 'active':''" @click="handleMenuClick(0,0)"><span class="item">不限</span></li>
  16. <li :class="activeIndex == 1 ? 'active':''" @click="handleMenuClick(1,2015)"><span class="item">2015</span></li>
  17. <li :class="activeIndex == 2 ? 'active':''" @click="handleMenuClick(2,2016)"><span class="item">2016</span></li>
  18. <li :class="activeIndex == 3 ? 'active':''" @click="handleMenuClick(3,2017)"><span class="item">2017</span></li>
  19. <li :class="activeIndex == 4 ? 'active':''" @click="handleMenuClick(4,2018)"><span class="item">2018</span></li>
  20. <li :class="activeIndex == 5 ? 'active':''" @click="handleMenuClick(5,2019)"><span class="item">2019</span></li>
  21. </ul>
  22. </div>
  23. <div class="selections">
  24. <span class="name">排序:</span>
  25. <ul>
  26. <li :class="activeOrder == 0 ? 'active':''" @click="handleOrderClick(0)"><span class="item">最新</span></li>
  27. <li :class="activeOrder == 1 ? 'active':''" @click="handleOrderClick(1)"><span class="item">最热</span></li>
  28. </ul>
  29. </div>
  30. <div style="clear:both;"></div>
  31. <Input search v-model="searchVal" placeholder="输入活动名称或者关键词" style="width:300px;margin-top:10px" @on-search="handleSearch" @on-change="handleSearch" />
  32. <div class="activities">
  33. <div class="activity" v-for="(item,index) in activities" @click="activityClick">
  34. <div class="img-box">
  35. <span class="state" style="background: rgb(149, 155, 155); visibility: visible;">{{item.statusTip}}</span>
  36. <span class="time">{{item.text}}</span>
  37. </div>
  38. <div class="infos">
  39. <p class="actName">{{item.name}}</p>
  40. <p class="actOrganizer">
  41. <span class="organizer">
  42. {{item.submitTimeTip}}
  43. </span>
  44. <span style="display:none;">主办</span>
  45. </p>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <Page show-total
  51. :current="1"
  52. :total="activities.length"
  53. :page-size="pageSize"
  54. class="page-box"
  55. style="margin:20px 0" />
  56. </div>
  57. </div>
  58. </div>
  59. </template>
  60. <script>
  61. import acList from '@/static/pastAcList.json'
  62. export default {
  63. components: {
  64. },
  65. data() {
  66. return {
  67. activeIndex: 0,
  68. activeOrder: 0,
  69. pageSize: 9,
  70. searchVal:"",
  71. activities: acList.data.list
  72. }
  73. },
  74. methods: {
  75. activityClick() {
  76. this.$router.push('rewardDetails');
  77. },
  78. handleMenuClick(index,val) {
  79. this.activeIndex = index;
  80. this.activities = index == 0 ? acList.data.list : acList.data.list.filter(item => item.submitTimeTip.substring(0,4) == val);
  81. },
  82. handleOrderClick(index) {
  83. this.activeOrder = index;
  84. let list = acList.data.list;
  85. this.activities = list.sort(this.compare('applyCount'));
  86. },
  87. compare(property){
  88. return function(a,b){
  89. var value1 = a[property];
  90. var value2 = b[property];
  91. return value1 - value2;
  92. }
  93. },
  94. handleSearch() {
  95. console.log(acList.data.list.filter(item => item.name.indexOf(this.searchVal) != -1));
  96. this.activities = acList.data.list.filter(item => item.name.indexOf(this.searchVal) != -1);
  97. }
  98. },
  99. mounted() {
  100. }
  101. }
  102. </script>
  103. <style scoped>
  104. .container {
  105. width: 1200px;
  106. margin: 100px auto;
  107. display: flex;
  108. flex-direction: row;
  109. justify-content: space-between;
  110. }
  111. .review-page {
  112. background-color: #fff;
  113. width: 1120px;
  114. padding: 30px;
  115. margin: 0 auto;
  116. margin-bottom: 30px;
  117. }
  118. .reviews-header .title {
  119. height: 20px;
  120. line-height: 20px;
  121. color: #444;
  122. font-size: 16px;
  123. padding-left: 10px;
  124. border-left: 3px solid #20a1f8;
  125. margin-bottom: 30px;
  126. }
  127. .sub {
  128. color: #cbb;
  129. font-size: 16px;
  130. margin-left: 10px;
  131. }
  132. .selections .name {
  133. color: #999;
  134. font-size: 14px;
  135. float: left;
  136. clear: left;
  137. }
  138. .selections ul {
  139. height:30px;
  140. margin-top:10px;
  141. }
  142. .selections ul li {
  143. float: left;
  144. font-size: 14px;
  145. cursor: pointer;
  146. list-style: none;
  147. padding: 0 0 0 40px;
  148. }
  149. .selections ul li.active {
  150. color: #33aeff;
  151. font-weight:bold;
  152. }
  153. .activities {
  154. min-height: 300px;
  155. overflow: hidden;
  156. margin-top: 30px;
  157. }
  158. .activities .activity {
  159. margin-right: 25px;
  160. margin-bottom: 40px;
  161. width: 335px;
  162. height:292px;
  163. float: left;
  164. cursor: pointer;
  165. border: 1px solid #ddd;
  166. box-sizing: border-box
  167. }
  168. .activities .activity:hover {
  169. box-shadow: 0 26px 40px -24px rgba(0,36,100,.3);
  170. transform: translateY(-6px);
  171. transition: all .3s ease 0s
  172. }
  173. .activities .activity:nth-child(3n) {
  174. margin-right: 0
  175. }
  176. .img-box {
  177. height:185px;
  178. position:relative;
  179. background:url(../../assets/image/cover.png);
  180. background-size:cover;
  181. display:flex;
  182. flex-direction:row;
  183. justify-content:center;
  184. align-items:center;
  185. }
  186. .img-box .state {
  187. padding: 5px 8px;
  188. position: absolute;
  189. left: 0;
  190. top: 0px;
  191. z-index: 1;
  192. background-color: #13ce66;
  193. color: #fff
  194. }
  195. .img-box .time {
  196. margin-top:130px;
  197. z-index: 1;
  198. color: #dbd8d8;
  199. font-size:18px;
  200. font-weight:bold;
  201. }
  202. .img-box img {
  203. width: 333px;
  204. height: 210px;
  205. position: relative;
  206. left: 0;
  207. top:-21px;
  208. padding-top: 1px
  209. }
  210. .infos {
  211. background-color: #fff
  212. }
  213. .infos .actName {
  214. color: #444;
  215. font-size: 16px;
  216. padding: 20px 10px 10px 20px;
  217. overflow: hidden;
  218. text-overflow: ellipsis;
  219. white-space: nowrap;
  220. width: 280px
  221. }
  222. .infos .actOrganizer {
  223. color: #999;
  224. font-size: 14px;
  225. padding-left: 20px;
  226. padding-bottom: 20px
  227. }
  228. .infos .actTime {
  229. color: #aaa;
  230. font-size: 14px;
  231. padding-left: 20px;
  232. padding-bottom: 10px
  233. }
  234. .view-more {
  235. text-decoration: none;
  236. float: right
  237. }
  238. .page-box {
  239. float:right;
  240. }
  241. </style>