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

323 lines
8.2 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
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" @click="$url('/pages/channel/index')">
  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. <!-- 推荐 -->
  85. <view class="lf-row-between lf-m-t-40 lf-m-b-10">
  86. <view class="lf-font-36 lf-font-bold lf-color-333">推荐</view>
  87. <view class="lf-flex lf-color-555">
  88. <view class="lf-m-r-10">更多</view>
  89. <u-icon name="lock-fill lf-text-vertical"></u-icon>
  90. </view>
  91. </view>
  92. </view>
  93. <!-- 商品列表-瀑布流 -->
  94. <view style="padding: 0 20rpx;">
  95. <lf-waterfall :list="recomm_list"></lf-waterfall>
  96. <u-loadmore v-if="recomm_list.length" status="已加载全部数据~" @loadmore="addRandomData"></u-loadmore>
  97. <lf-nocontent v-else></lf-nocontent>
  98. </view>
  99. <!-- 回到顶部 -->
  100. <u-back-top :scroll-top="pageScrollTop" :custom-style="{background: 'rgba(51, 51 51, 0.3)'}"></u-back-top>
  101. </view>
  102. </template>
  103. <script>
  104. import lfWaterfall from '../../components/lf-waterfall/lf-waterfall.vue';
  105. export default {
  106. components: {
  107. lfWaterfall
  108. },
  109. data() {
  110. return {
  111. banner_current: 0,
  112. recomm_list: [],
  113. tab_list: [{
  114. name: '推荐',
  115. list: []
  116. },{
  117. name: '酒店',
  118. list: []
  119. },{
  120. name: '推荐',
  121. list: []
  122. },{
  123. name: '酒店',
  124. list: []
  125. },{
  126. name: '推荐',
  127. list: []
  128. },{
  129. name: '酒店',
  130. list: []
  131. }],
  132. current: 0,
  133. list: [
  134. {
  135. price: 35,
  136. title: '北国风光,千里冰封,万里雪飘',
  137. shop: '李白杜甫白居易旗舰店',
  138. image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23327_s.jpg',
  139. },
  140. {
  141. price: 75,
  142. title: '望长城内外,惟余莽莽',
  143. shop: '李白杜甫白居易旗舰店',
  144. image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23325_s.jpg',
  145. },
  146. {
  147. price: 385,
  148. title: '大河上下,顿失滔滔',
  149. shop: '李白杜甫白居易旗舰店',
  150. image: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
  151. },
  152. {
  153. price: 784,
  154. title: '欲与天公试比高',
  155. shop: '李白杜甫白居易旗舰店',
  156. image: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/zzpic23369_s.jpg',
  157. },
  158. {
  159. price: 7891,
  160. title: '须晴日,看红装素裹,分外妖娆',
  161. shop: '李白杜甫白居易旗舰店',
  162. image: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2130_s.jpg',
  163. },
  164. {
  165. price: 2341,
  166. shop: '李白杜甫白居易旗舰店',
  167. title: '江山如此多娇,引无数英雄竞折腰',
  168. image: 'http://pic1.sc.chinaz.com/Files/pic/pic9/202002/zzpic23346_s.jpg',
  169. }
  170. ]
  171. }
  172. },
  173. onLoad() {
  174. this.addRandomData();
  175. },
  176. methods: {
  177. addRandomData() {
  178. for(let i = 0; i < 10; i++) {
  179. let index = this.$u.random(0, this.list.length - 1);
  180. // 先转成字符串再转成对象,避免数组对象引用导致数据混乱
  181. let item = JSON.parse(JSON.stringify(this.list[index]))
  182. item.id = this.$u.guid();
  183. this.recomm_list.push(item);
  184. }
  185. },
  186. tabChange(current){
  187. this.current = current;
  188. },
  189. pageChange(event){
  190. console.log(event)
  191. this.current = event.detail.current;
  192. }
  193. },
  194. onReachBottom() {
  195. },
  196. onPullDownRefresh(){
  197. uni.stopPullDownRefresh();
  198. }
  199. }
  200. </script>
  201. <style>
  202. page{
  203. background-color: #F6F6F6;
  204. }
  205. </style>
  206. <style lang="scss" scoped>
  207. .head{
  208. width: 750rpx;
  209. height: 360rpx;
  210. .swipe-img{
  211. width: 100%;
  212. height: 100%;
  213. }
  214. }
  215. .content{
  216. width: 750rpx;
  217. // height: 600rpx;
  218. height: max-content;
  219. border-radius: 30rpx 30rpx 0rpx 0rpx;
  220. position: relative;
  221. top: -30rpx;
  222. background-color: #FFFFFF;
  223. box-sizing: border-box;
  224. padding: 40rpx 32rpx 10rpx;
  225. .message-box{
  226. width: 686rpx;
  227. height: 53rpx;
  228. background: #CFE7FD;
  229. border-radius: 27rpx;
  230. color: #1998FE;
  231. box-sizing: border-box;
  232. padding: 0 20rpx;
  233. font-size: 24rpx;
  234. .message-btn{
  235. width: 80rpx;
  236. height: 33rpx;
  237. border-radius: 10rpx;
  238. border: 1rpx solid #1998FE;
  239. text-align: center;
  240. line-height: 31rpx;
  241. }
  242. }
  243. }
  244. .channel-item{
  245. width: 160rpx;
  246. height: 160rpx;
  247. border-radius: 15rpx;
  248. margin-top: 15rpx;
  249. margin-right: 15rpx;
  250. position: relative;
  251. overflow: hidden;
  252. &:nth-child(4n){
  253. margin-right: 0;
  254. }
  255. image{
  256. width: 160rpx;
  257. height: 160rpx;
  258. position: absolute;
  259. z-index: 0;
  260. }
  261. view{
  262. position: absolute;
  263. right: 0;
  264. bottom: 0;
  265. background-color: rgba(255,255,255,0.5);
  266. width: 42rpx;
  267. height: 42rpx;
  268. color: #FFFFFF;
  269. display: flex;
  270. justify-content: center;
  271. align-items: center;
  272. border-radius: 10rpx 0rpx 15rpx 0rpx;
  273. z-index: 2;
  274. }
  275. .channel-mask::after{
  276. width: 100%;
  277. height: 100%;
  278. content: '';
  279. position: absolute;
  280. z-index: 1;
  281. background: rgba(0, 0, 0, 0.5);
  282. top: 0;
  283. left: 0;
  284. }
  285. }
  286. .ad{
  287. height: 230rpx;
  288. width: 100%;
  289. }
  290. .recomm{
  291. width: 100%;
  292. height: max-content;
  293. .recomm-img{
  294. width: 222rpx;
  295. height: 222rpx;
  296. border-radius: 10rpx;
  297. }
  298. .max-recomm-img{
  299. width: 455rpx;
  300. height: 455rpx;
  301. position: relative;
  302. .recomm-title{
  303. // height: 142rpx;
  304. height: max-content;
  305. width: 100%;
  306. background-color: rgba(0,0,0,0.65);
  307. box-sizing: border-box;
  308. padding: 15rpx;
  309. position: absolute;
  310. bottom: 0;
  311. color: #FFFFFF;
  312. }
  313. }
  314. }
  315. </style>