index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view class="activity">
  3. <view class="head">
  4. <view class="head-top">
  5. <image src="/static/img/common/bg_head.png" mode="" />
  6. </view>
  7. <view class="title">
  8. <image class="img-title" src="/static/img/activity/head_title.png" mode="aspectFill" />
  9. </view>
  10. </view>
  11. <view class="content">
  12. <view class="item flex"
  13. v-for="(item, index) in omoList" :key="index"
  14. :style="{backgroundImage: `url(${item.bgUrl})`,backgroundRepeat: 'no-repeat', backgroundSize: 'cover'}">
  15. <view class="left">
  16. <image :src="item.imgUrl" mode="aspectFill" />
  17. </view>
  18. <view class="right">
  19. <view class="info-title">{{ item.title }}</view>
  20. <view class="info-btn">
  21. <button class="detail cu-btn block" @tap="navTo(item)">
  22. 查看详情 <zd-arrow class="btn-arrow"></zd-arrow>
  23. </button>
  24. </view>
  25. </view>
  26. </view>
  27. <image class="book" src="/static/img/activity/drum.png" mode="aspectFill" />
  28. <image class="teach" src="/static/img/common/teach.png" mode="aspectFill" />
  29. <image class="path" src="/static/img/common/path1.png" mode="aspectFill" />
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import ZdArrow from '@/components/zd-arrow/index';
  35. export default {
  36. data() {
  37. return {
  38. omoList: [
  39. {
  40. title: '思维能力挑战赛',
  41. imgUrl: require('@/static/img/activity/activity_01.png'),
  42. bgUrl: require('@/static/img/common/card_bg01.png'),
  43. path: '/pages/activity/detail?type=1'
  44. },
  45. {
  46. title: '培训交流',
  47. imgUrl: require('@/static/img/activity/activity_02.png'),
  48. bgUrl: require('@/static/img/common/card_bg02.png'),
  49. path: '/pages/activity/detail?type=2'
  50. },
  51. {
  52. title: '逻辑狗伴我成长',
  53. imgUrl: require('@/static/img/activity/activity_03.png'),
  54. bgUrl: require('@/static/img/common/card_bg03.png'),
  55. path: '/pages/activity/detail?type=3'
  56. }
  57. ]
  58. }
  59. },
  60. components: {
  61. ZdArrow
  62. },
  63. onLoad() {
  64. },
  65. created() {
  66. },
  67. mounted() {
  68. },
  69. methods: {
  70. navTo(item) {
  71. this.$mRouter.push({
  72. route: item.path
  73. })
  74. }
  75. }
  76. }
  77. </script>
  78. <style lang="scss">
  79. .activity {
  80. background: url('@/static/img/common/bg.png') no-repeat #01A2E8;
  81. background-size: cover;
  82. height: 100vh;
  83. overflow: hidden;
  84. .head-top {
  85. image {
  86. width: 100%;
  87. height: 100upx;
  88. }
  89. }
  90. .title {
  91. text-align: center;
  92. .img-title {
  93. width: 374upx;
  94. height: 124upx;
  95. vertical-align: middle;
  96. }
  97. }
  98. .content {
  99. position: relative;
  100. margin: 118upx auto 0;
  101. .item {
  102. margin: 0 auto 28upx;
  103. width: 714upx;
  104. height: 262upx;
  105. padding: 52upx 0 0 44upx;
  106. .left {
  107. margin-right: 56upx;
  108. image {
  109. width: 166upx;
  110. height: 150upx;
  111. vertical-align: middle;
  112. }
  113. }
  114. .right {
  115. padding-top: 8upx;
  116. .info-title {
  117. font-size: 40upx;
  118. font-family: PingFangSC-Semibold, PingFang SC;
  119. font-weight: 600;
  120. color: #050505;
  121. line-height: 56upx;
  122. letter-spacing: 1upx;
  123. }
  124. .info-btn {
  125. margin-top: 22upx;
  126. .detail {
  127. height: 56upx;
  128. width: 228upx;
  129. border-radius: 34upx;
  130. border: 2upx solid #333333;
  131. background: #FFFFFF;
  132. font-size: 26upx;
  133. font-family: PingFangSC-Medium, PingFang SC;
  134. font-weight: 500;
  135. color: #04040A;
  136. line-height: 36upx;
  137. }
  138. .btn-arrow {
  139. margin-left: 8upx;
  140. }
  141. }
  142. }
  143. }
  144. .book {
  145. position: absolute;
  146. width: 154upx;
  147. height: 172upx;
  148. vertical-align: middle;
  149. left: 0px;
  150. top: 4upx;
  151. transform: translateY(-100%);
  152. }
  153. .path {
  154. position: absolute;
  155. bottom: -48upx;
  156. right: 138upx;
  157. width: 30upx;
  158. height: 26upx;
  159. vertical-align: middle;
  160. }
  161. .teach {
  162. position: absolute;
  163. width: 140upx;
  164. height: 98upx;
  165. vertical-align: middle;
  166. right: 0upx;
  167. top: 0upx;
  168. transform: translateY(-100%);
  169. }
  170. }
  171. }
  172. </style>