海南旅游项目 前端仓库
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.

276 lines
6.7 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <template>
  2. <view>
  3. <swiper class="head" :current="banner_current" >
  4. <swiper-item>
  5. <image src="https://picsum.photos/375/360" class="swipe-img"></image>
  6. </swiper-item>
  7. <swiper-item>
  8. <image src="https://picsum.photos/375/360" class="swipe-img"></image>
  9. </swiper-item>
  10. </swiper>
  11. <view class="content">
  12. <!-- 消息模块 -->
  13. <view class="lf-row-between lf-m-b-34 message-box">
  14. <view class="lf-flex">
  15. <u-icon name="lock-fill lf-text-vertical"></u-icon>
  16. <view class="lf-m-l-12 lf-line-1" style="max-width: 510rpx;">国庆优惠大促快来看看吧</view>
  17. </view>
  18. <view class="message-btn" hover-class="lf-opacity">详情</view>
  19. </view>
  20. <!-- 频道 -->
  21. <view class="lf-row-between lf-m-b-10">
  22. <view class="lf-font-36 lf-font-bold lf-color-333">添加频道</view>
  23. <view class="lf-flex lf-color-555">
  24. <view class="lf-m-r-10">编辑</view>
  25. <u-icon name="lock-fill lf-text-vertical"></u-icon>
  26. </view>
  27. </view>
  28. <view class="lf-flex-wrap">
  29. <view class="channel-item" v-for="(item, index) in 8">
  30. <image src="../../static/logo.png" class="channel-mask" mode="aspectFill"></image>
  31. <view>
  32. <u-icon name="lock-fill lf-text-vertical"></u-icon>
  33. </view>
  34. </view>
  35. </view>
  36. <!-- 中间广告模块 -->
  37. <swiper class="lf-m-t-40 ad" :current="banner_current" >
  38. <swiper-item>
  39. <image src="https://picsum.photos/375/230" class="lf-w-100 lf-h-100"></image>
  40. </swiper-item>
  41. </swiper>
  42. <!-- 精品推荐 -->
  43. <view class="lf-row-between lf-m-t-40">
  44. <view class="lf-font-36 lf-font-bold lf-color-333">精品推荐</view>
  45. <view class="lf-flex lf-color-555">
  46. <view class="lf-m-r-10">更多</view>
  47. <u-icon name="lock-fill lf-text-vertical"></u-icon>
  48. </view>
  49. </view>
  50. <view class="recomm lf-m-t-20">
  51. <view class="lf-row-between">
  52. <view class="max-recomm-img">
  53. <image src="../../static/logo.png" class="lf-w-100 lf-h-100"></image>
  54. <view class="recomm-title">
  55. <view class="lf-line-2">土耳其双人游飞机往返酒店五星级各大热门景点豪华双人游纯江湖救急</view>
  56. <view class="lf-font-42 lf-font-bold lf-m-t-10" style="color: #FF0000;">3999.00</view>
  57. </view>
  58. </view>
  59. <view>
  60. <view class="recomm-img">
  61. <image src="../../static/logo.png" class="lf-w-100 lf-h-100"></image>
  62. </view>
  63. <view class="recomm-img lf-m-t-10">
  64. <image src="../../static/logo.png" class="lf-w-100 lf-h-100"></image>
  65. </view>
  66. </view>
  67. </view>
  68. <view class="lf-row-between lf-m-t-10">
  69. <view class="recomm-img">
  70. <image src="../../static/logo.png" class="lf-w-100 lf-h-100"></image>
  71. </view>
  72. <view class="recomm-img">
  73. <image src="../../static/logo.png" class="lf-w-100 lf-h-100"></image>
  74. </view>
  75. <view class="recomm-img">
  76. <image src="../../static/logo.png" class="lf-w-100 lf-h-100"></image>
  77. </view>
  78. </view>
  79. </view>
  80. <!-- tab标签 -->
  81. <view class="lf-m-t-40">
  82. <u-tabs :list="tab_list" :is-scroll="true" :current="current" @change="tabChange"></u-tabs>
  83. </view>
  84. </view>
  85. <!-- 商品列表-瀑布流 -->
  86. <view v-for="(tabItem, tabIndex) in tab_list" :key="tabIndex" v-if="current == tabIndex" style="padding: 0 20rpx;">
  87. <lf-waterfall :list="tabItem.list"></lf-waterfall>
  88. <u-loadmore v-if="tabItem.list.length" :status="tabItem.loading_text" @loadmore="addRandomData"></u-loadmore>
  89. <lf-nocontent v-else></lf-nocontent>
  90. </view>
  91. <!-- 回到顶部 -->
  92. <u-back-top :scroll-top="pageScrollTop" :custom-style="{background: 'rgba(51, 51 51, 0.3)'}"></u-back-top>
  93. </view>
  94. </template>
  95. <script>
  96. import lfWaterfall from '../../components/lf-waterfall/lf-waterfall.vue';
  97. export default {
  98. components: {
  99. lfWaterfall
  100. },
  101. data() {
  102. return {
  103. banner_current: 0,
  104. tab_list: [{
  105. name: '推荐',
  106. list: []
  107. },{
  108. name: '酒店',
  109. list: []
  110. },{
  111. name: '推荐',
  112. list: []
  113. },{
  114. name: '酒店',
  115. list: []
  116. },{
  117. name: '推荐',
  118. list: []
  119. },{
  120. name: '酒店',
  121. list: []
  122. }],
  123. current: 0
  124. }
  125. },
  126. onLoad() {
  127. // this.addRandomData();
  128. },
  129. methods: {
  130. addRandomData() {
  131. for(let i = 0; i < 10; i++) {
  132. let index = this.$u.random(0, this.list.length - 1);
  133. // 先转成字符串再转成对象,避免数组对象引用导致数据混乱
  134. let item = JSON.parse(JSON.stringify(this.list[index]))
  135. item.id = this.$u.guid();
  136. this.flowList.push(item);
  137. }
  138. },
  139. tabChange(current){
  140. this.current = current;
  141. },
  142. pageChange(event){
  143. console.log(event)
  144. this.current = event.detail.current;
  145. }
  146. },
  147. onReachBottom() {
  148. },
  149. onPullDownRefresh(){
  150. uni.stopPullDownRefresh();
  151. }
  152. }
  153. </script>
  154. <style>
  155. page{
  156. background-color: #F6F6F6;
  157. }
  158. </style>
  159. <style lang="scss" scoped>
  160. .head{
  161. width: 750rpx;
  162. height: 360rpx;
  163. .swipe-img{
  164. width: 100%;
  165. height: 100%;
  166. }
  167. }
  168. .content{
  169. width: 750rpx;
  170. // height: 600rpx;
  171. height: max-content;
  172. border-radius: 30rpx 30rpx 0rpx 0rpx;
  173. position: relative;
  174. top: -30rpx;
  175. background-color: #FFFFFF;
  176. box-sizing: border-box;
  177. padding: 40rpx 32rpx 10rpx;
  178. .message-box{
  179. width: 686rpx;
  180. height: 53rpx;
  181. background: #CFE7FD;
  182. border-radius: 27rpx;
  183. color: #1998FE;
  184. box-sizing: border-box;
  185. padding: 0 20rpx;
  186. font-size: 24rpx;
  187. .message-btn{
  188. width: 80rpx;
  189. height: 33rpx;
  190. border-radius: 10rpx;
  191. border: 1rpx solid #1998FE;
  192. text-align: center;
  193. line-height: 31rpx;
  194. }
  195. }
  196. }
  197. .channel-item{
  198. width: 160rpx;
  199. height: 160rpx;
  200. border-radius: 15rpx;
  201. margin-top: 15rpx;
  202. margin-right: 15rpx;
  203. position: relative;
  204. overflow: hidden;
  205. &:nth-child(4n){
  206. margin-right: 0;
  207. }
  208. image{
  209. width: 160rpx;
  210. height: 160rpx;
  211. position: absolute;
  212. z-index: 0;
  213. }
  214. view{
  215. position: absolute;
  216. right: 0;
  217. bottom: 0;
  218. background-color: rgba(255,255,255,0.5);
  219. width: 42rpx;
  220. height: 42rpx;
  221. color: #FFFFFF;
  222. display: flex;
  223. justify-content: center;
  224. align-items: center;
  225. border-radius: 10rpx 0rpx 15rpx 0rpx;
  226. z-index: 2;
  227. }
  228. .channel-mask::after{
  229. width: 100%;
  230. height: 100%;
  231. content: '';
  232. position: absolute;
  233. z-index: 1;
  234. background: rgba(0, 0, 0, 0.5);
  235. top: 0;
  236. left: 0;
  237. }
  238. }
  239. .ad{
  240. height: 230rpx;
  241. width: 100%;
  242. }
  243. .recomm{
  244. width: 100%;
  245. height: max-content;
  246. .recomm-img{
  247. width: 222rpx;
  248. height: 222rpx;
  249. border-radius: 10rpx;
  250. }
  251. .max-recomm-img{
  252. width: 455rpx;
  253. height: 455rpx;
  254. position: relative;
  255. .recomm-title{
  256. // height: 142rpx;
  257. height: max-content;
  258. width: 100%;
  259. background-color: rgba(0,0,0,0.65);
  260. box-sizing: border-box;
  261. padding: 15rpx;
  262. position: absolute;
  263. bottom: 0;
  264. color: #FFFFFF;
  265. }
  266. }
  267. }
  268. </style>