index.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333
  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. if (!this.activityInfo || this.activityInfo.length === 0) {
  92. this.navigateTo('/pages/checkIn/activity-end')
  93. return false
  94. }
  95. this.hideLoading()
  96. })
  97. },
  98. gotoRoute(id) {
  99. uni.navigateTo({url: '/pages/checkIn/checkInRoute?id=' + id})
  100. },
  101. onShareAppMessage() {
  102. return {
  103. title: '逛展会,领福利!',
  104. path: '/pages/checkIn/index',
  105. imageUrl: 'https://www.productronicachina.com.cn/resources/files/0221/67b7e5190bd22/share.png'
  106. }
  107. },
  108. gotoRule() {
  109. uni.navigateTo({
  110. // 此页面带参rule落地展示活动规则
  111. url: '/pages/checkIn/checkInRoute?rule=true',
  112. })
  113. },
  114. gotoPrizes() {
  115. uni.navigateTo({
  116. url: '/pages/user/award'
  117. })
  118. }
  119. },
  120. onLoad() {
  121. }
  122. }
  123. </script>
  124. <style lang="scss">
  125. .outter {
  126. height: 100%;
  127. position: relative;
  128. .head_title {
  129. width: 100%;
  130. background: linear-gradient(270deg, #332968 9%, #435797 44%, #382E73 92%), rgba(0, 0, 0, 0.2);
  131. padding-bottom: 15px;
  132. display: flex;
  133. align-items: flex-end;
  134. padding-left: 28rpx;
  135. transition: .3s ease-in-out;
  136. .title {
  137. display: flex;
  138. align-items: center;
  139. color: white;
  140. font-size: 32rpx;
  141. .iconfont {
  142. font-size: 36rpx;
  143. margin-right: 8rpx;
  144. }
  145. }
  146. }
  147. .body {
  148. height: 100%;
  149. overflow: hidden;
  150. overflow-y: auto;
  151. background: linear-gradient(180deg, #015A92 0%, #56A3E9 24%, #106591 98%);
  152. padding-bottom: 0;
  153. padding-bottom: constant(safe-area-inset-bottom);
  154. padding-bottom: env(safe-area-inset-bottom);
  155. .theme-box {
  156. margin: 32rpx;
  157. background-color: white;
  158. border-radius: 30rpx;
  159. padding: 40rpx 28rpx;
  160. .way-grid {
  161. display: grid;
  162. grid-gap: 25rpx 34rpx;
  163. grid-template-columns: 1fr 1fr;
  164. .way-item {
  165. aspect-ratio: 8/5;
  166. position: relative;
  167. border-radius: 10rpx;
  168. overflow: hidden;
  169. .text {
  170. display: flex;
  171. flex-direction: column;
  172. justify-content: space-between;
  173. padding: 18rpx 26rpx;
  174. background: linear-gradient(131deg, #3788D4 46%, rgba(145, 196, 244, 0) 97%);
  175. position: absolute;
  176. width: 100%;
  177. height: 100%;
  178. left: 0;
  179. top: 0;
  180. .way {
  181. text-shadow: 0 4rpx 4rpx rgba(0, 0, 0, 0.42);
  182. color: white;
  183. font-size: 32rpx;
  184. font-weight: bold;
  185. .num {
  186. margin: 0 4rpx;
  187. font-size: 45rpx;
  188. }
  189. }
  190. .button {
  191. width: fit-content;
  192. font-weight: bold;
  193. font-size: 18rpx;
  194. background-color: white;
  195. color: #4085C7;
  196. padding: 10rpx 17rpx;
  197. border-radius: 40rpx;
  198. }
  199. }
  200. }
  201. }
  202. .track-list {
  203. margin-bottom: 40rpx;
  204. display: flex;
  205. grid-gap: 10rpx;
  206. align-items: center;
  207. .iconfont {
  208. color: #015A92;
  209. font-size: 40rpx;
  210. }
  211. .track {
  212. flex: 1;
  213. display: flex;
  214. .text {
  215. font-weight: bold;
  216. font-size: 24rpx;
  217. color: #015A92;
  218. flex: 1;
  219. }
  220. .num {
  221. margin-right: 14rpx;
  222. width: 60rpx;
  223. height: 60rpx;
  224. background: linear-gradient(132deg, #B0E8FF 21%, #F5F5F5 100%);
  225. color: #015A92;
  226. font-size: 40rpx;
  227. align-items: center;
  228. justify-content: center;
  229. display: flex;
  230. border-radius: 50%;
  231. font-weight: bold;
  232. }
  233. }
  234. }
  235. }
  236. .theme-title {
  237. margin-top: -60rpx;
  238. position: relative;
  239. height: 130rpx;
  240. display: flex;
  241. justify-content: center;
  242. align-items: center;
  243. .title {
  244. color: white;
  245. font-size: 55rpx;
  246. font-weight: bold;
  247. }
  248. .title-bg {
  249. position: absolute;
  250. left: 0;
  251. top: 0;
  252. height: 100%;
  253. }
  254. }
  255. .main-title {
  256. width: 100%;
  257. .image {
  258. width: 100%;
  259. aspect-ratio: 3/2;
  260. }
  261. }
  262. }
  263. .side-button {
  264. position: absolute;
  265. right: 32rpx;
  266. bottom: 32rpx;
  267. display: flex;
  268. flex-direction: column;
  269. grid-gap: 17rpx;
  270. .button {
  271. background-color: white;
  272. width: 125rpx;
  273. height: 125rpx;
  274. border-radius: 50%;
  275. box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.25);
  276. display: flex;
  277. flex-direction: column;
  278. justify-content: center;
  279. align-items: center;
  280. grid-gap: 6rpx;
  281. padding-bottom: 6rpx;
  282. position: relative;
  283. button {
  284. width: 100%;
  285. height: 100%;
  286. opacity: 0;
  287. left: 0;
  288. top: 0;
  289. position: absolute;
  290. }
  291. .title {
  292. color: #94A3B8;
  293. font-size: 24rpx;
  294. }
  295. .iconfont {
  296. font-size: 60rpx;
  297. color: #016BF3;
  298. }
  299. }
  300. }
  301. }
  302. </style>