推广小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

339 lines
8.4 KiB

6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
  1. <template>
  2. <view class="page">
  3. <view class="head-box"></view>
  4. <uv-navbar :title="navTitle" leftIcon=" " :titleStyle="{color:'#fff'}" :bgColor="bgColor" height="100rpx"></uv-navbar>
  5. <view class="content">
  6. <view class="search-box">
  7. <view class="search-box-l">
  8. <image class="address-img" src="@/static/image/home/address-icon.png" mode="widthFix"></image>
  9. <view>成都</view>
  10. <image class="sjx-img" src="@/static/image/home/sjx-icon.png" mode="widthFix"></image>
  11. </view>
  12. <view class="search-box-r">
  13. <uv-search placeholder="搜索相关内容" v-model="keyword" shape="square" :showAction="false" color="#fff" placeholderColor="#BDABAC" :clearabled="false" searchIconColor="#fff" searchIconSize="50rpx" bgColor="#4A2A2B" height="63rpx"></uv-search>
  14. </view>
  15. </view>
  16. <view class="swipe-box">
  17. <uv-swiper :list="list" height="336rpx" radius="30rpx" bgColor="transparent" indicator indicatorMode="dot"></uv-swiper>
  18. </view>
  19. <view class="ydsk-box">
  20. <view class="ydsk-box-title">悦动时刻</view>
  21. <view class="ydsk-box-gird">
  22. <view class="gird-l">
  23. <view class="left-box">
  24. <view class="title-box">
  25. <view>活动签到</view>
  26. <view>签到有好礼</view>
  27. </view>
  28. <view class="btn-box">立即查看</view>
  29. </view>
  30. <image class="hdqd-img" src="@/static/image/home/hdqd-img.png" mode="widthFix"></image>
  31. </view>
  32. <view class="gird-r">
  33. <view class="hd-box">
  34. <view class="left-box">
  35. <view class="title-box">
  36. 活动
  37. </view>
  38. <view class="btn-box">立即查看</view>
  39. </view>
  40. <image class="hdqd-img" src="@/static/image/home/hd-img.png" mode="widthFix"></image>
  41. </view>
  42. <view class="hd-box lx-box">
  43. <view class="left-box">
  44. <view class="title-box">
  45. 旅行
  46. </view>
  47. <view class="btn-box">立即查看</view>
  48. </view>
  49. <image class="hdqd-img" src="@/static/image/home/lx-img.png" mode="widthFix"></image>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="hd-list">
  55. <uv-tabs
  56. @click= "tabs"
  57. :list="hdList"
  58. lineWidth="50rpx"
  59. :lineColor="`url(${lineBg}) 100% 100%`"
  60. :activeStyle="{
  61. color: '#fff',
  62. fontWeight: 'bold',
  63. transform: 'scale(1.05)'
  64. }"
  65. :inactiveStyle="{
  66. color: '#999',
  67. transform: 'scale(1)'
  68. }"
  69. itemStyle="padding-left: 15px; padding-right: 15px; height: 44px;"
  70. ></uv-tabs>
  71. <active-item :cardListData="cardListData"/>
  72. </view>
  73. </view>
  74. <tabber select="home" />
  75. </view>
  76. </template>
  77. <script>
  78. import tabber from '@/components/base/tabbar.vue'
  79. import activeItem from '@/components/active/active-item.vue'
  80. export default {
  81. components:{
  82. tabber,
  83. activeItem
  84. },
  85. data() {
  86. return {
  87. bgColor:'transparent',
  88. navTitle:'',
  89. keyword:'',
  90. list: [
  91. 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
  92. 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
  93. 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
  94. ],
  95. hdList: [
  96. { id: 0, name: '近期活动' },
  97. { id: 1, name: '往期活动' },
  98. ],
  99. lineBg: require('@/static/image/cart/tabIcon.png'),
  100. cardListData: [
  101. {
  102. imgUrl: 'https://up.zhuoku.org/22/a4/60/50/fc3bd0b4e656911fccdde4383637c1cd.jpg',
  103. orderTime: '2024.08.23 12:00',
  104. state: 'U',
  105. stateText: '待参加',
  106. title: '夏日去撒野旅游计划~',
  107. time: '2024.10.28 10:00',
  108. address: '成都市东丽湖露营地32号',
  109. },
  110. {
  111. imgUrl: 'https://up.zhuoku.org/22/a4/60/50/fc3bd0b4e656911fccdde4383637c1cd.jpg',
  112. orderTime: '2024.08.23 12:00',
  113. state: 'S',
  114. stateText: '已完成',
  115. title: '夏日去撒野旅游计划~',
  116. time: '2024.10.28 10:00',
  117. address: '成都市东丽湖露营地32号',
  118. },
  119. ]
  120. }
  121. },
  122. onPageScroll(e) {
  123. if(e.scrollTop > 50) {
  124. this.bgColor = '#49070c'
  125. this.navTitle = '首页'
  126. }else{
  127. this.bgColor = 'transparent'
  128. this.navTitle = ''
  129. }
  130. },
  131. methods:{
  132. tabs(val) {
  133. console.log(val);
  134. }
  135. }
  136. }
  137. </script>
  138. <style lang="scss">
  139. page {
  140. background-color: #060504;
  141. }
  142. </style>
  143. <style scoped lang="scss">
  144. .page {
  145. .head-box {
  146. background: url('@/static/image/nav-bg.png') no-repeat;
  147. background-size: 100% 100%;
  148. width: 100%;
  149. height: 534rpx;
  150. position: absolute;
  151. }
  152. .content {
  153. color: #fff;
  154. padding: 0 30rpx;
  155. padding-top: calc(var(--status-bar-height) + 110rpx);
  156. .search-box {
  157. display: flex;
  158. align-items: center;
  159. margin-bottom: 32rpx;
  160. &-l {
  161. display: flex;
  162. align-items: center;
  163. margin-right: 30rpx;
  164. view {
  165. font-weight: 400;
  166. font-size: 27rpx;
  167. color: #FFFFFF;
  168. margin: 0 18rpx 0 15rpx;
  169. }
  170. .address-img {
  171. width: 26rpx;
  172. }
  173. .sjx-img {
  174. width: 13rpx;
  175. }
  176. }
  177. &-r {
  178. flex:1;
  179. }
  180. }
  181. .swipe-box {
  182. margin-bottom: 41rpx;
  183. }
  184. .ydsk-box {
  185. margin-bottom: 10rpx;
  186. &-title {
  187. width: 250rpx;
  188. background: url('@/static/image/home/title-bg.png') no-repeat;
  189. background-size: 100% 100%;
  190. text-align: center;
  191. height: 31rpx;
  192. line-height: 31rpx;
  193. font-weight: bold;
  194. font-size: 35rpx;
  195. color: #FFFFFF;
  196. margin: 0 auto 33rpx;
  197. }
  198. &-gird {
  199. display: flex;
  200. justify-content: space-between;
  201. .gird-l {
  202. box-sizing: border-box;
  203. width: 378rpx;
  204. height: 278rpx;
  205. padding: 36rpx 0 24rpx 26rpx;
  206. background: url('@/static/image/home/hdqd-bg.png') no-repeat;
  207. background-size: 100% 100%;
  208. position: relative;
  209. .hdqd-img {
  210. position: absolute;
  211. right: 34rpx;
  212. top: 48rpx;
  213. width: 200rpx;
  214. }
  215. .left-box {
  216. height: 100%;
  217. display: flex;
  218. flex-direction: column;
  219. justify-content: space-between;
  220. .title-box {
  221. view {
  222. font-weight: bold;
  223. font-size: 29rpx;
  224. color: #060504;
  225. &:nth-child(2) {
  226. font-weight: 400;
  227. font-size: 21rpx;
  228. color: #4C4C4C;
  229. margin-top: 20rpx;
  230. }
  231. }
  232. }
  233. .btn-box {
  234. width: 108rpx;
  235. height: 41rpx;
  236. background: url('@/static/image/home/hdqd-btn.png') no-repeat;
  237. background-size: 100% 100%;
  238. font-weight: 500;
  239. font-size: 17rpx;
  240. color: #FFFFFF;
  241. text-align: center;
  242. line-height: 41rpx;
  243. }
  244. }
  245. }
  246. .gird-r {
  247. .hd-box {
  248. width: 288rpx;
  249. height: 130rpx;
  250. padding: 25rpx 0 24rpx 26rpx;
  251. box-sizing: border-box;
  252. background: url('@/static/image/home/hd-bg.png') no-repeat;
  253. background-size: 100% 100%;
  254. position: relative;
  255. .left-box {
  256. height: 100%;
  257. display: flex;
  258. flex-direction: column;
  259. justify-content: space-between;
  260. .title-box {
  261. font-weight: bold;
  262. font-size: 28rpx;
  263. color: #57270F;
  264. }
  265. .btn-box {
  266. width: 98rpx;
  267. height: 35rpx;
  268. background: url('@/static/image/home/hd-btn.png') no-repeat;
  269. background-size: 100% 100%;
  270. font-weight: 500;
  271. font-size: 16rpx;
  272. color: #FFFFFF;
  273. text-align: center;
  274. line-height: 35rpx;
  275. }
  276. }
  277. .hdqd-img {
  278. position: absolute;
  279. right: 22rpx;
  280. top: 25rpx;
  281. width: 123rpx;
  282. }
  283. }
  284. .lx-box {
  285. width: 288rpx;
  286. height: 130rpx;
  287. padding: 25rpx 0 24rpx 26rpx;
  288. box-sizing: border-box;
  289. background: url('@/static/image/home/lx-bg.png') no-repeat;
  290. background-size: 100% 100%;
  291. position: relative;
  292. margin-top: 18rpx;
  293. .left-box {
  294. height: 100%;
  295. display: flex;
  296. flex-direction: column;
  297. justify-content: space-between;
  298. .title-box {
  299. font-weight: bold;
  300. font-size: 28rpx;
  301. color: #57270F;
  302. }
  303. .btn-box {
  304. width: 98rpx;
  305. height: 35rpx;
  306. background: url('@/static/image/home/lx-btn.png') no-repeat;
  307. background-size: 100% 100%;
  308. font-weight: 500;
  309. font-size: 16rpx;
  310. color: #FFFFFF;
  311. text-align: center;
  312. line-height: 35rpx;
  313. }
  314. }
  315. .hdqd-img {
  316. position: absolute;
  317. right: 22rpx;
  318. top: 25rpx;
  319. width: 123rpx;
  320. }
  321. }
  322. }
  323. }
  324. }
  325. }
  326. }
  327. </style>