index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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. {{vuex_page_interface_show.indexTitle}}
  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. <rich-text class="desc text-cut-2" :nodes="decodeURIComponent(item.content)"></rich-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. console.log(2);
  64. await this.initWorksList();
  65. },
  66. methods :{
  67. async initWorksList(){
  68. const { defaultActiveId:activeId }= this.$store.state['vuex_active_setting'];
  69. this.$api.activity.getWorksList({ activeId }).then(res => {
  70. this.worksList = res.data.data;
  71. });
  72. },
  73. searchWorks(value){
  74. this.$api.activity.searchWork(value).then(res => {
  75. this.worksList = res.data.data;
  76. })
  77. }
  78. },
  79. onLoad() {
  80. console.log(this.$util.getCurrentRoute());
  81. },
  82. data() {
  83. return {
  84. worksList: [],
  85. swiperList: ['https://guosen-bucket-ldt.obs.cn-south-1.myhuaweicloud.com:443/70c8b355db774f85ab9f8d4f6289df69-banner.jpg'],
  86. gridList: [{
  87. icon: '/static/grid/jieshao.png',
  88. name: "活动介绍",
  89. path:"/pages/introduce/introduce"
  90. }, {
  91. icon: '/static/grid/baoming.png',
  92. name: "我要代言",
  93. },
  94. {
  95. icon: '/static/grid/rank.png',
  96. name: "排行榜",
  97. path:"/pages/rank/rank"
  98. },
  99. {
  100. icon: '/static/grid/more.png',
  101. name: "更多活动",
  102. }
  103. ]
  104. };
  105. }
  106. };
  107. </script>
  108. <style>
  109. page {
  110. background-color: #FFFFFF;
  111. }
  112. </style>
  113. <style lang="scss" scoped>
  114. .shadow {
  115. box-shadow: #f8f8f8 0px 0px 10rpx 10rpx
  116. }
  117. .rank-tag {
  118. color: #FFFFFF;
  119. width: 40rpx;
  120. height: 46rpx;
  121. position: absolute;
  122. left: 10rpx;
  123. top: 0rpx;
  124. z-index: 999;
  125. }
  126. .card {
  127. position: relative;
  128. margin-top: 30rpx;
  129. border-radius: 10rpx;
  130. padding: 15rpx;
  131. display: flex;
  132. .left {
  133. display: flex;
  134. justify-content: center;
  135. align-items: center;
  136. image {
  137. width: 210rpx;
  138. height: 210rpx;
  139. border-radius: 10rpx;
  140. }
  141. }
  142. .right {
  143. margin-left: 20rpx;
  144. display: flex;
  145. flex-direction: column;
  146. justify-content: space-between;
  147. .title {
  148. font-weight: 800;
  149. color: #353535;
  150. font-size: 32rpx;
  151. }
  152. .desc {
  153. color: #888888;
  154. line-height: 40rpx;
  155. padding-top: 20rpx;
  156. font-size: 26rpx;
  157. }
  158. .bottom {
  159. display: flex;
  160. justify-content: space-between;
  161. }
  162. }
  163. }
  164. </style>