home.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. data() {
  80. return {
  81. worksList: [],
  82. swiperList: ['https://guosen-bucket-ldt.obs.cn-south-1.myhuaweicloud.com:443/70c8b355db774f85ab9f8d4f6289df69-banner.jpg'],
  83. gridList: [{
  84. icon: '/static/grid/jieshao.png',
  85. name: "活动介绍",
  86. path:"/pages/introduce/introduce"
  87. }, {
  88. icon: '/static/grid/baoming.png',
  89. name: "我要代言",
  90. },
  91. {
  92. icon: '/static/grid/rank.png',
  93. name: "排行榜",
  94. path:"/pages/rank/rank"
  95. },
  96. {
  97. icon: '/static/grid/more.png',
  98. name: "更多活动",
  99. }
  100. ]
  101. };
  102. }
  103. };
  104. </script>
  105. <style>
  106. page {
  107. background-color: #FFFFFF;
  108. }
  109. </style>
  110. <style lang="scss" scoped>
  111. .shadow {
  112. box-shadow: #f8f8f8 0px 0px 10rpx 10rpx
  113. }
  114. .rank-tag {
  115. color: #FFFFFF;
  116. width: 40rpx;
  117. height: 46rpx;
  118. position: absolute;
  119. left: 10rpx;
  120. top: 0rpx;
  121. z-index: 999;
  122. }
  123. .card {
  124. position: relative;
  125. margin-top: 30rpx;
  126. border-radius: 10rpx;
  127. padding: 15rpx;
  128. display: flex;
  129. .left {
  130. display: flex;
  131. justify-content: center;
  132. align-items: center;
  133. image {
  134. width: 210rpx;
  135. height: 210rpx;
  136. border-radius: 10rpx;
  137. }
  138. }
  139. .right {
  140. margin-left: 20rpx;
  141. display: flex;
  142. flex-direction: column;
  143. justify-content: space-between;
  144. .title {
  145. font-weight: 800;
  146. color: #353535;
  147. font-size: 32rpx;
  148. }
  149. .desc {
  150. color: #888888;
  151. line-height: 40rpx;
  152. padding-top: 20rpx;
  153. font-size: 26rpx;
  154. }
  155. .bottom {
  156. display: flex;
  157. justify-content: space-between;
  158. }
  159. }
  160. }
  161. </style>