index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <view :style="vuex_skin">
  3. <view style="padding: 30rpx 30rpx 10rpx;">
  4. <u-swiper :list="swiperList" border-radius="12" height="300"></u-swiper>
  5. </view>
  6. <view class="">
  7. <view class="cu-list grid col-4 no-border" style="border-radius:20rpx ;">
  8. <view class="cu-item" @click.stop="$jump(item.path)" v-for="(item,index) in gridList"
  9. :key="index">
  10. <view class="grid-icon">
  11. <image style="width: 88rpx;height: 88rpx;" :src="item.icon" />
  12. </view>
  13. <text style="color: #222222;font-size: 26rpx;">{{item.name}}</text>
  14. <view class="cu-tag bg-red badge" v-if="item.count>0">{{item.count}}</view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="" style="height: 20rpx;background-color: #f8f8f8"></view>
  19. <view style="padding: 30rpx 30rpx 0">
  20. <u-search placeholder="搜索关键词或编号" height="70" @search="searchWorks" v-model="keyword" :show-action="false"></u-search>
  21. </view>
  22. <view class="padding-30">
  23. <view class="text-bold" style="font-size: 34rpx;">
  24. 法护未来 童心同行
  25. </view>
  26. <view @click="$jump('/pages/activity/activityDetail?id='+item.id)" class="card shadow" v-for="(item,index) in worksList" :key="item.id">
  27. <view v-if="index==0" class="center bg-img rank-tag" style="background-image: url(../../static/icon/ph1.png)">
  28. <text>1</text>
  29. </view>
  30. <view v-if="index==1" class="center bg-img rank-tag" style="background-image: url(../../static/icon/ph2.png)">
  31. <text>2</text>
  32. </view>
  33. <view v-if="index==2" class="center bg-img rank-tag" style="background-image: url(../../static/icon/ph3.png)">
  34. <text>3</text>
  35. </view>
  36. <view class="left">
  37. <image :src="item.imgUrl" mode=""></image>
  38. </view>
  39. <view class="right">
  40. <view class="flex-direction flex">
  41. <text class="title">{{item.title}}</text>
  42. <text class="desc text-cut-2">{{item.content}}</text>
  43. </view>
  44. <view class="bottom">
  45. <view class="flex margin-top-10">
  46. <image class="center" style="width: 30rpx;height: 30rpx;" src="../../static/icon/remen.png">
  47. </image>
  48. <text style="color: #353535;margin-left: 6rpx;font-size:28rpx;">{{item.voteCount}}</text>
  49. </view>
  50. <view class="cu-btn round sm line-base">
  51. 去助力
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. name: '',
  62. async mounted() {
  63. await this.initWorksList();
  64. },
  65. methods :{
  66. async initWorksList(){
  67. const { defaultActiveId:activeId }= this.$store.state['vuex_active_setting'];
  68. this.$api.activity.getWorksList({ activeId }).then(res => {
  69. this.worksList = res.data.data;
  70. });
  71. },
  72. searchWorks(value){
  73. this.$api.activity.searchWork(value).then(res => {
  74. this.worksList = res.data.data;
  75. })
  76. }
  77. },
  78. data() {
  79. return {
  80. worksList: [],
  81. swiperList: ['https://guosen-bucket-ldt.obs.cn-south-1.myhuaweicloud.com:443/70c8b355db774f85ab9f8d4f6289df69-banner.jpg'],
  82. gridList: [{
  83. icon: '/static/grid/jieshao.png',
  84. name: "活动介绍",
  85. path:"/pages/introduce/introduce"
  86. }, {
  87. icon: '/static/grid/baoming.png',
  88. name: "我要代言",
  89. },
  90. {
  91. icon: '/static/grid/rank.png',
  92. name: "排行榜",
  93. path:"/pages/rank/rank"
  94. },
  95. {
  96. icon: '/static/grid/more.png',
  97. name: "更多活动",
  98. }
  99. ]
  100. };
  101. }
  102. };
  103. </script>
  104. <style>
  105. page {
  106. background-color: #FFFFFF;
  107. }
  108. </style>
  109. <style lang="scss" scoped>
  110. .shadow {
  111. box-shadow: #f8f8f8 0px 0px 10rpx 10rpx
  112. }
  113. .rank-tag {
  114. color: #FFFFFF;
  115. width: 40rpx;
  116. height: 46rpx;
  117. position: absolute;
  118. left: 10rpx;
  119. top: 0rpx;
  120. z-index: 999;
  121. }
  122. .card {
  123. position: relative;
  124. margin-top: 30rpx;
  125. border-radius: 10rpx;
  126. padding: 15rpx;
  127. display: flex;
  128. .left {
  129. display: flex;
  130. justify-content: center;
  131. align-items: center;
  132. image {
  133. width: 210rpx;
  134. height: 210rpx;
  135. border-radius: 10rpx;
  136. }
  137. }
  138. .right {
  139. margin-left: 20rpx;
  140. display: flex;
  141. flex-direction: column;
  142. justify-content: space-between;
  143. .title {
  144. font-weight: 800;
  145. color: #353535;
  146. font-size: 32rpx;
  147. }
  148. .desc {
  149. color: #888888;
  150. line-height: 40rpx;
  151. padding-top: 20rpx;
  152. font-size: 26rpx;
  153. }
  154. .bottom {
  155. display: flex;
  156. justify-content: space-between;
  157. }
  158. }
  159. }
  160. </style>