index.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <template>
  2. <page-layout>
  3. <nav-bar title="福利嘉年华" @init="onInitNavbar"></nav-bar>
  4. <u-scroll-view :tabbar-conflict="false">
  5. <view class="outter">
  6. <view class="body">
  7. <view class="main-title">
  8. <image mode="aspectFill" class="image"
  9. src="https://www.productronicachina.com.cn/resources/files/0221/67b7db116d845/主画面.png"></image>
  10. </view>
  11. <view class="theme-title">
  12. <text class="title">{{ activityInfo.name }}</text>
  13. <image mode="aspectFit" class="title-bg"
  14. src="https://www.productronicachina.com.cn/resources/files/0221/67b7dd27b30b7/标题星星.png"></image>
  15. </view>
  16. <view class="theme-box">
  17. <view class="track-list">
  18. <view class="track">
  19. <view class="num">1</view>
  20. <view class="text">{{ activityInfo.content.step1 }}</view>
  21. </view>
  22. <view class="iconfont icon-Left-1"></view>
  23. <view class="track">
  24. <view class="num">2</view>
  25. <view class="text">{{ activityInfo.content.step2 }}</view>
  26. </view>
  27. <view class="iconfont icon-Left-1"></view>
  28. <view class="track">
  29. <view class="num">3</view>
  30. <view class="text">{{ activityInfo.content.step3 }}</view>
  31. </view>
  32. </view>
  33. <view class="way-grid">
  34. <view @click="gotoRoute()" class="way-item" v-for="item in activityInfo.content.card_image_text">
  35. <image mode="aspectFill" :src="item.img_url"></image>
  36. <view class="text">
  37. <view class="way">
  38. <!--挑战<text class="num">6</text>条路线-->
  39. {{ item.title }}
  40. </view>
  41. <view class="button">{{ item.btn_text }}</view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="side-button">
  48. <view @click="gotoPrizes()" class="button">
  49. <text style="font-size: 50rpx;" class="iconfont icon-jiangpin"></text>
  50. <text class="title">我的奖品</text>
  51. </view>
  52. <view @click="gotoRule()" class="button">
  53. <text class="iconfont icon-xiaochengxu-canguandengjiicon"></text>
  54. <text class="title">活动规则</text>
  55. </view>
  56. <view class="button">
  57. <button open-type="share"></button>
  58. <text style="font-size: 56rpx;" class="iconfont icon-zhuanfa"></text>
  59. <text class="title">分享</text>
  60. </view>
  61. </view>
  62. </view>
  63. </u-scroll-view>
  64. </page-layout>
  65. </template>
  66. <script>
  67. import {getActivityInfo} from '@/api/checkIn';
  68. import PageLayout from "@/components/layout/page-layout";
  69. import NavBar from "@/components/layout/nav-bar";
  70. import UScrollView from "@/components/common/u-scroll-view";
  71. export default {
  72. components: {
  73. PageLayout,
  74. NavBar,
  75. UScrollView
  76. },
  77. data() {
  78. return {
  79. routeInfo: {},
  80. activityInfo: {}
  81. };
  82. },
  83. mounted() {
  84. this.getActivityInfoEvent()
  85. },
  86. methods: {
  87. getActivityInfoEvent() {
  88. this.showLoading()
  89. getActivityInfo().then(res => {
  90. this.activityInfo = res.data
  91. this.hideLoading()
  92. })
  93. },
  94. gotoRoute(id) {
  95. uni.navigateTo({url: '/pages/checkIn/checkInRoute?id=' + id})
  96. },
  97. onShareAppMessage() {
  98. return {
  99. title: '逛展会,领福利!',
  100. path: '/pages/checkIn/index',
  101. imageUrl: 'https://www.productronicachina.com.cn/resources/files/0221/67b7e5190bd22/share.png'
  102. }
  103. },
  104. gotoRule() {
  105. uni.navigateTo({
  106. // 此页面带参rule落地展示活动规则
  107. url: '/pages/checkIn/checkInRoute?rule=true',
  108. })
  109. },
  110. gotoPrizes() {
  111. uni.navigateTo({
  112. url: '/pages/user/award'
  113. })
  114. }
  115. },
  116. onLoad() {
  117. }
  118. }
  119. </script>
  120. <style lang="scss">
  121. .outter {
  122. height: 100%;
  123. position: relative;
  124. .head_title {
  125. width: 100%;
  126. background: linear-gradient(270deg, #332968 9%, #435797 44%, #382E73 92%), rgba(0, 0, 0, 0.2);
  127. padding-bottom: 15px;
  128. display: flex;
  129. align-items: flex-end;
  130. padding-left: 28rpx;
  131. transition: .3s ease-in-out;
  132. .title {
  133. display: flex;
  134. align-items: center;
  135. color: white;
  136. font-size: 32rpx;
  137. .iconfont {
  138. font-size: 36rpx;
  139. margin-right: 8rpx;
  140. }
  141. }
  142. }
  143. .body {
  144. height: 100%;
  145. overflow: hidden;
  146. overflow-y: auto;
  147. background: linear-gradient(180deg, #015A92 0%, #56A3E9 24%, #106591 98%);
  148. padding-bottom: 0;
  149. padding-bottom: constant(safe-area-inset-bottom);
  150. padding-bottom: env(safe-area-inset-bottom);
  151. .theme-box {
  152. margin: 32rpx;
  153. background-color: white;
  154. border-radius: 30rpx;
  155. padding: 40rpx 28rpx;
  156. .way-grid {
  157. display: grid;
  158. grid-gap: 25rpx 34rpx;
  159. grid-template-columns: 1fr 1fr;
  160. .way-item {
  161. aspect-ratio: 8/5;
  162. position: relative;
  163. border-radius: 10rpx;
  164. overflow: hidden;
  165. .text {
  166. display: flex;
  167. flex-direction: column;
  168. justify-content: space-between;
  169. padding: 18rpx 26rpx;
  170. background: linear-gradient(131deg, #3788D4 46%, rgba(145, 196, 244, 0) 97%);
  171. position: absolute;
  172. width: 100%;
  173. height: 100%;
  174. left: 0;
  175. top: 0;
  176. .way {
  177. text-shadow: 0 4rpx 4rpx rgba(0, 0, 0, 0.42);
  178. color: white;
  179. font-size: 32rpx;
  180. font-weight: bold;
  181. .num {
  182. margin: 0 4rpx;
  183. font-size: 45rpx;
  184. }
  185. }
  186. .button {
  187. width: fit-content;
  188. font-weight: bold;
  189. font-size: 18rpx;
  190. background-color: white;
  191. color: #4085C7;
  192. padding: 10rpx 17rpx;
  193. border-radius: 40rpx;
  194. }
  195. }
  196. }
  197. }
  198. .track-list {
  199. margin-bottom: 40rpx;
  200. display: flex;
  201. grid-gap: 10rpx;
  202. align-items: center;
  203. .iconfont {
  204. color: #015A92;
  205. font-size: 40rpx;
  206. }
  207. .track {
  208. flex: 1;
  209. display: flex;
  210. .text {
  211. font-weight: bold;
  212. font-size: 24rpx;
  213. color: #015A92;
  214. flex: 1;
  215. }
  216. .num {
  217. margin-right: 14rpx;
  218. width: 60rpx;
  219. height: 60rpx;
  220. background: linear-gradient(132deg, #B0E8FF 21%, #F5F5F5 100%);
  221. color: #015A92;
  222. font-size: 40rpx;
  223. align-items: center;
  224. justify-content: center;
  225. display: flex;
  226. border-radius: 50%;
  227. font-weight: bold;
  228. }
  229. }
  230. }
  231. }
  232. .theme-title {
  233. margin-top: -60rpx;
  234. position: relative;
  235. height: 130rpx;
  236. display: flex;
  237. justify-content: center;
  238. align-items: center;
  239. .title {
  240. color: white;
  241. font-size: 55rpx;
  242. font-weight: bold;
  243. }
  244. .title-bg {
  245. position: absolute;
  246. left: 0;
  247. top: 0;
  248. height: 100%;
  249. }
  250. }
  251. .main-title {
  252. width: 100%;
  253. .image {
  254. width: 100%;
  255. aspect-ratio: 3/2;
  256. }
  257. }
  258. }
  259. .side-button {
  260. position: absolute;
  261. right: 32rpx;
  262. bottom: 32rpx;
  263. display: flex;
  264. flex-direction: column;
  265. grid-gap: 17rpx;
  266. .button {
  267. background-color: white;
  268. width: 125rpx;
  269. height: 125rpx;
  270. border-radius: 50%;
  271. box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.25);
  272. display: flex;
  273. flex-direction: column;
  274. justify-content: center;
  275. align-items: center;
  276. grid-gap: 6rpx;
  277. padding-bottom: 6rpx;
  278. position: relative;
  279. button {
  280. width: 100%;
  281. height: 100%;
  282. opacity: 0;
  283. left: 0;
  284. top: 0;
  285. position: absolute;
  286. }
  287. .title {
  288. color: #94A3B8;
  289. font-size: 24rpx;
  290. }
  291. .iconfont {
  292. font-size: 60rpx;
  293. color: #016BF3;
  294. }
  295. }
  296. }
  297. }
  298. </style>