index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. <template>
  2. <view class="content">
  3. <view class="loading" v-if="loading">
  4. <cu-custom bgColor="bg-bluev-head">
  5. <block slot="content">达人任务平台</block>
  6. </cu-custom>
  7. <view class="home-search-loading">
  8. <view class="skeleton-line animate"></view>
  9. </view>
  10. <view class="home-content">
  11. <view class="banner-loading"><view class="skeleton-line animate"></view></view>
  12. <view class="quick-nav">
  13. <view class="nav-item" v-for="(item,index) in 3" :key="index">
  14. <view class="icon-loading"><view class="skeleton-line animate"></view></view>
  15. <view class="name margin-top-xs"><view class="skeleton-line animate"></view></view>
  16. </view>
  17. </view>
  18. <view class="new-star">
  19. <view class="title">
  20. <view class="name-loading"><view class="skeleton-line animate"></view></view>
  21. <view class="more-loading"><view class="skeleton-line animate"></view></view>
  22. </view>
  23. <view class="star-list">
  24. <view class="star-item" v-for="(item,index) in 4" :key="index">
  25. <view class="icon"><view class="skeleton-line animate"></view></view>
  26. <view class="name margin-top-xs"><view class="skeleton-line animate"></view></view>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="quick-nav">
  31. <view class="nav-item w50" v-for="(item,index) in 2" :key="index">
  32. <view class="icon-loading"><view class="skeleton-line animate"></view></view>
  33. </view>
  34. </view>
  35. <view class="quick-nav">
  36. <view class="nav-item" v-for="(item,index) in 3" :key="index">
  37. <view class="icon-loading"><view class="skeleton-line animate"></view></view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <block v-else>
  43. <scroll-view scroll-y="true" class="scroll-content" :enhanced="true" :bounces="false" :show-scrollbar="false" @scroll="pageScroll">
  44. <view class="home-header bg-bluev-head">
  45. <cu-custom :bgColor="scrollHeight>20?'bg-bluev-head':'none'">
  46. <block slot="content">达人任务平台</block>
  47. </cu-custom>
  48. <view class="home-search">
  49. <image src="https://blue-data.oss-cn-guangzhou.aliyuncs.com/star/search-icon.png" mode="widthFix"></image>
  50. <input type="text" class="search-input" placeholder="请输入" />
  51. </view>
  52. </view>
  53. <view class="home-content">
  54. <view class="banner">
  55. <image src="https://blue-data.oss-cn-guangzhou.aliyuncs.com/star/home-top-banner.png" mode="widthFix"></image>
  56. </view>
  57. <view class="quick-nav">
  58. <view class="nav-item">
  59. <view class="icon"><image src="/static/quick-nav/star-rank.png" mode="widthFix"></image></view>
  60. <view class="name">星耀榜</view>
  61. </view>
  62. <view class="nav-item">
  63. <view class="icon"><image src="/static/quick-nav/business-school.png" mode="widthFix"></image></view>
  64. <view class="name">商学院</view>
  65. </view>
  66. <view class="nav-item">
  67. <view class="icon"><image src="/static/quick-nav/influencer-home.png" mode="widthFix"></image></view>
  68. <view class="name">达人之家</view>
  69. </view>
  70. </view>
  71. <view class="new-star">
  72. <view class="title">
  73. <view class="name">最新入驻达人</view>
  74. <view class="more">查看全部 <text class="cuIcon-right"></text></view>
  75. </view>
  76. <view class="star-swiper">
  77. <swiper class="swiper" circular :autoplay="false" :interval="2000" :duration="200">
  78. <swiper-item class="swiper-item" v-for="(item,idex) in starData" :key="idex">
  79. <view class="first-body" hover-class="none">
  80. <view class="avatar"><image :src="item.avatar" mode="widthFix"></image></view>
  81. <view class="name">{{item.name}}</view>
  82. <view class="platform"><image :src="'/static/image/'+item.platform+'.svg'"></image></view>
  83. </view>
  84. </swiper-item>
  85. </swiper>
  86. </view>
  87. </view>
  88. <view class="quick-nav">
  89. <view class="nav-item w50">
  90. <image class="w100" src="/static/entry/join-now.png" mode="widthFix"></image>
  91. </view>
  92. <view class="nav-item w50">
  93. <image class="w100" src="/static/entry/task-square.png" mode="widthFix"></image>
  94. </view>
  95. </view>
  96. <view class="rank-data">
  97. <view class="title">
  98. <view class="name">收益排行榜</view>
  99. <view class="more">查看全部 <text class="cuIcon-right"></text></view>
  100. </view>
  101. </view>
  102. <view class="home-task">
  103. <view class="title">
  104. <view class="name">精选任务</view>
  105. <view class="more">查看全部 <text class="cuIcon-right"></text></view>
  106. </view>
  107. <view class="star-task-list">
  108. <view class="task-item" v-for="(item,indx) in 10" :key="indx">
  109. <view class="item-body">
  110. <view class="item-img">
  111. <image src="https://p9-dy.byteimg.com/obj/ecom-shop-material/jpeg_m_e3fa80e91300b16e0df15e2bcbd8c003_sx_426270_www800-800" mode="aspectFill"></image>
  112. </view>
  113. <view class="item-info">
  114. <view class="title">【官方正品】金纺柔顺剂宝宝衣物适用0漂白剂抗静电蓬松不僵硬CW-星川任务-202</view>
  115. <view class="item-tags">
  116. <view class="tag-item">抖音</view>
  117. <view class="tag-item">手拍</view>
  118. <view class="tag-item">真人出境</view>
  119. </view>
  120. <view class="item-price">
  121. <view class="item-platform">抖音L1</view>
  122. <view class="price-txt"><text>¥</text>20.0w</view>
  123. </view>
  124. </view>
  125. </view>
  126. <view class="item-foot">
  127. <view class="item-join">
  128. <view class="cu-avatar-group">
  129. <view class="cu-avatar round sm" v-for="(item,index) in avatar" :key="index" :style="[{ backgroundImage:'url(' + avatar[index] + ')' }]"></view>
  130. </view>
  131. <view class="join-text"><text>180</text>/200人已参加</view>
  132. </view>
  133. <view class="foot-btn">
  134. <button class="btn disabled" :disabled="true">立即参加</button>
  135. </view>
  136. </view>
  137. </view>
  138. </view>
  139. <view class="star-task-more"></view>
  140. </view>
  141. </view>
  142. </scroll-view>
  143. </block>
  144. </view>
  145. </template>
  146. <script>
  147. var app;
  148. export default {
  149. data() {
  150. return {
  151. loading:false,
  152. scrollHeight:0,
  153. starData:[
  154. {
  155. "avatar":"/static/rank/avatar.jpeg",
  156. "name":"我是庄小周",
  157. "platform":"douyin"
  158. },
  159. {
  160. "avatar":"/static/rank/avatar.jpeg",
  161. "name":"我是庄小周2",
  162. "platform":"kuaishou"
  163. },
  164. {
  165. "avatar":"/static/rank/avatar.jpeg",
  166. "name":"我是庄小周3",
  167. "platform":"txvideo"
  168. },
  169. {
  170. "avatar":"/static/rank/avatar.jpeg",
  171. "name":"我是庄小周4",
  172. "platform":"xiaohongshu"
  173. },
  174. {
  175. "avatar":"/static/rank/avatar.jpeg",
  176. "name":"我是庄小周5",
  177. "platform":"douyin"
  178. }
  179. ],
  180. avatar: [
  181. 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg',
  182. 'https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg',
  183. 'https://ossweb-img.qq.com/images/lol/web201310/skin/big25002.jpg',
  184. 'https://ossweb-img.qq.com/images/lol/web201310/skin/big91012.jpg'
  185. ],
  186. }
  187. },
  188. onLoad() {
  189. app = this;
  190. },
  191. methods: {
  192. pageScroll(event) {
  193. var scrollHeight = event.detail.scrollTop;
  194. app.scrollHeight = scrollHeight;
  195. }
  196. }
  197. }
  198. </script>
  199. <style lang="scss">
  200. page{background-color: #f8f8f8;}
  201. .banner-loading{height: 220rpx;}
  202. .home-search-loading{margin: 20rpx;height: 68rpx;}
  203. .home-search{display: flex;align-items: center;background-color: #fff;border-radius: 66rpx;margin: 20rpx;height: 68rpx;padding: 0 20rpx;gap: 20rpx;}
  204. .home-search image{width: 32rpx;height: 32rpx;}
  205. .home-search .search-input{font-size: 24rpx;width: 100%;border: 0;height: 100%;box-sizing: none;box-shadow: none;}
  206. .home-content {margin: 20rpx;}
  207. .home-content .banner{}
  208. .home-content .banner image{width: 100%;}
  209. .quick-nav{display: flex;align-items: center;margin: 20rpx 0;gap: 20rpx;}
  210. .quick-nav .nav-item{width: 33%;text-align: center;font-family: "bluevBold";font-size: 24rpx;}
  211. .quick-nav .nav-item .icon image{width: 60%;}
  212. .quick-nav .nav-item.w50{width: 50%;}
  213. .quick-nav .nav-item .icon-loading{height: 180rpx;}
  214. .new-star .title{display: flex;align-items: center;justify-content: space-between;line-height: 60rpx;}
  215. .new-star .title .name{font-family: "bluevBold";font-size: 32rpx;}
  216. .new-star .title .more{font-size: 24rpx;color: #666;}
  217. .new-star .title .more-loading{width: 15%;}
  218. .new-star .title .name-loading{width: 30%;}
  219. .star-list{display: flex;align-items: center;gap: 20rpx;}
  220. .star-list .star-item{width: 25%;margin: 20rpx 0;}
  221. .star-list .star-item .icon{height: 120rpx;}
  222. .rank-data{background-color: #fff;border-radius: 20rpx;padding: 20rpx;margin: 20rpx 0;}
  223. .rank-data .title{display: flex;align-items: center;justify-content: space-between;line-height: 60rpx;}
  224. .rank-data .title .name{font-family: "bluevBold";font-size: 32rpx;}
  225. .rank-data .title .more{font-size: 24rpx;color: #666;}
  226. .home-task .title{display: flex;align-items: center;justify-content: space-between;line-height: 60rpx;}
  227. .home-task .title .name{font-family: "bluevBold";font-size: 32rpx;}
  228. .home-task .title .more{font-size: 24rpx;color: #666;}
  229. .star-swiper{
  230. margin-top: 20upx;
  231. display: flex;
  232. overflow-x: auto;
  233. gap: 20upx;
  234. flex-shrink:0;
  235. flex-direction: row;
  236. flex-wrap: nowrap;
  237. }
  238. .star-swiper .swiper{
  239. width: 100%;
  240. display: flex;
  241. gap: 20rpx;
  242. height: 180rpx;
  243. }
  244. .star-swiper .swiper .swiper-item{
  245. width: calc(100vw / 5) !important;
  246. position: relative;
  247. }
  248. .star-swiper .first-body .platform{position: absolute;top: 0;right: 20rpx;background-color: #fff;width: 40rpx;height: 40rpx;border-radius: 100%;}
  249. .star-swiper .first-body .platform image{width: 40rpx;height: 40rpx;}
  250. .star-swiper .first-body{
  251. width: 90%;
  252. border-radius: 10rpx;
  253. text-align: center;
  254. }
  255. .star-swiper .first-body .name{
  256. font-size: 24rpx;
  257. color: #333;
  258. margin-top: 10rpx;
  259. font-weight: 800;
  260. }
  261. .star-swiper .first-body .avatar{
  262. display: flex;
  263. align-items: center;
  264. justify-content: center;
  265. }
  266. .star-swiper .first-body .avatar image{
  267. width: 100%;
  268. max-height: 200rpx;
  269. border-radius: 100%;
  270. }
  271. .scroll-content{
  272. width: 100%;
  273. height: 100vh;
  274. }
  275. </style>