activity.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <div class="activity">
  3. <div v-for="(item,index) in activityList" :key="index+100" class="activityItem">
  4. <img :src="item.img" class="itemBg">
  5. <div class="activityItemRight">
  6. <div class="activityItemRightTop">
  7. <span class="activityItemRightName">{{item.name}}</span>
  8. <span class="activityItemRightType">{{item.type}}</span>
  9. </div>
  10. <div class="canyu">36人参与</div>
  11. <div class="activityItemRightBottom">
  12. <div class="shoucang" @click="clickColl(item)"><image :src="item.isColl?heartSel:heart" class="scImg"> 收藏</div>
  13. <div :class="item.isSign?'baoming':'baoming2'">{{ item.isSign ? '去报名' : '报名结束' }}</div>
  14. </div>
  15. </div>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. export default {
  21. name: "activity",
  22. data(){
  23. return{
  24. heartSel:require('../image/heartSel.png'),
  25. heart:require('../image/heart.png'),
  26. activityList:[
  27. {name:'互联网私募如何入门?',type:'培训活动',img:require('../image/img1.png'),isColl:true ,isSign:true},
  28. {name:'公募基金中的大数据啊啊啊?',type:'活动',img:require('../image/img2.png'),isColl:false,isSign:true},
  29. {name:'年度小艾杯篮球赛开...?',type:'体育',img:require('../image/img3.png'),isColl:false,isSign:false},
  30. ]
  31. }
  32. },
  33. methods:{
  34. clickColl(item){
  35. console.log(item)
  36. // item.isColl = !item.isColl
  37. }
  38. }
  39. }
  40. </script>
  41. <style lang="scss">
  42. .activity{
  43. .activityItem{
  44. width: 702rpx;
  45. height: 216rpx;
  46. background: #F5F7FA;
  47. padding: 0 24rpx;
  48. display: flex;
  49. align-items: center;
  50. box-sizing: border-box;
  51. border-radius: 16rpx;
  52. .itemBg{
  53. width: 220rpx;
  54. height: 160rpx;
  55. }
  56. .activityItemRight{
  57. display: flex;
  58. flex-direction: column;
  59. margin-left: 24rpx;
  60. .activityItemRightTop{
  61. width: 420rpx;
  62. display: flex;
  63. justify-content: space-between;
  64. .activityItemRightName{
  65. width: 280rpx;
  66. white-space: nowrap;
  67. overflow: hidden;
  68. text-overflow: ellipsis;
  69. color: #18172A;
  70. font-size: 28rpx;
  71. }
  72. .activityItemRightType{
  73. padding: 2rpx 12rpx;
  74. background: rgba(3, 101, 249, 0.20);
  75. color: rgba(3, 101, 249, 1);
  76. border-radius: 4rpx;
  77. font-size: 24rpx;
  78. }
  79. }
  80. .canyu{
  81. font-size: 28rpx;
  82. color: rgba(102, 102, 102, 1);
  83. margin: 14rpx 0;
  84. }
  85. .activityItemRightBottom{
  86. display: flex;
  87. justify-content: space-between;
  88. align-items: center;
  89. .shoucang{
  90. display: flex;
  91. align-items: center;
  92. font-size: 28rpx;
  93. color: rgba(141, 146, 155, 1);
  94. .scImg{
  95. width: 32rpx;
  96. height: 28rpx;
  97. margin-right: 8rpx;
  98. }
  99. }
  100. .baoming{
  101. width: 160rpx;
  102. height: 60rpx;
  103. display: flex;
  104. align-items: center;
  105. justify-content: center;
  106. font-size: 28rpx;
  107. background: linear-gradient( 316deg, #84AAFF 0%, #0365F9 100%);
  108. border-radius: 32rpx;
  109. font-size: 28rpx;
  110. color: white;
  111. }
  112. .baoming2{
  113. width: 160rpx;
  114. height: 60rpx;
  115. display: flex;
  116. align-items: center;
  117. justify-content: center;
  118. font-size: 28rpx;
  119. background: rgba(226, 232, 239, 1);
  120. border-radius: 32rpx;
  121. font-size: 28rpx;
  122. color: rgba(141, 146, 155, 1);
  123. }
  124. }
  125. }
  126. }
  127. }
  128. </style>