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

349 lines
9.3 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <template>
  2. <view>
  3. <swiper class="head" :current="banner_current" >
  4. <swiper-item @click="clickBanner">
  5. <image src="https://picsum.photos/375/360" class="swipe-img"></image>
  6. </swiper-item>
  7. <swiper-item @click="clickBanner">
  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" @click="$url('/pages/notice/article')">详情</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 7" @click="$url('/pages/goodsList/index')">
  30. <image src="../../static/logo.png" class="channel-mask" mode="aspectFill"></image>
  31. <view class="lf-row-center channe-text">冲浪</view>
  32. <!-- <view>
  33. <u-icon name="lock-fill lf-text-vertical"></u-icon>
  34. </view> -->
  35. </view>
  36. </view>
  37. <!-- 中间广告模块 -->
  38. <swiper class="lf-m-t-40 ad" :current="banner_current" >
  39. <swiper-item @click="clickAD">
  40. <image src="https://picsum.photos/375/230" class="lf-w-100 lf-h-100"></image>
  41. </swiper-item>
  42. </swiper>
  43. <!-- 人气爆款 -->
  44. <view class="lf-row-between lf-m-t-40">
  45. <view class="lf-font-36 lf-font-bold lf-color-333">人气爆款</view>
  46. <view class="lf-flex lf-color-555" @click="$url('/pages/activityList/index')">
  47. <view class="lf-m-r-10">更多</view>
  48. <u-icon name="lock-fill lf-text-vertical"></u-icon>
  49. </view>
  50. </view>
  51. <view class="recomm lf-m-t-20 lf-m-b-30">
  52. <view class="lf-row-between">
  53. <view class="max-recomm-img" @click="$url('/pages/activityList/index')">
  54. <image src="../../static/logo.png" class="lf-w-100 lf-h-100"></image>
  55. <view class="recomm-title">
  56. <view class="lf-line-2">土耳其双人游飞机往返酒店五星级各大热门景点豪华双人游纯江湖救急</view>
  57. <view class="lf-font-42 lf-font-bold lf-m-t-10" style="color: #FF0000;">3999.00</view>
  58. </view>
  59. </view>
  60. <view>
  61. <view class="recomm-img" @click="$url('/pages/activityList/index')">
  62. <image src="../../static/logo.png" class="lf-w-100 lf-h-100"></image>
  63. </view>
  64. <view class="recomm-img lf-m-t-10" @click="$url('/pages/activityList/index')">
  65. <image src="../../static/logo.png" class="lf-w-100 lf-h-100"></image>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="lf-row-between lf-m-t-10">
  70. <view class="recomm-img" @click="$url('/pages/activityList/index')">
  71. <image src="../../static/logo.png" class="lf-w-100 lf-h-100"></image>
  72. </view>
  73. <view class="recomm-img" @click="$url('/pages/activityList/index')">
  74. <image src="../../static/logo.png" class="lf-w-100 lf-h-100"></image>
  75. </view>
  76. <view class="recomm-img" @click="$url('/pages/activityList/index')">
  77. <image src="../../static/logo.png" class="lf-w-100 lf-h-100"></image>
  78. </view>
  79. </view>
  80. </view>
  81. <!-- tab标签 -->
  82. <!-- <view class="lf-m-t-40">
  83. <u-tabs :list="tab_list" :is-scroll="true" :current="current" @change="tabChange"></u-tabs>
  84. </view> -->
  85. <!-- 推荐 -->
  86. <!-- <view class="lf-row-between lf-m-t-40 lf-m-b-10">
  87. <view class="lf-font-36 lf-font-bold lf-color-333">推荐</view>
  88. <view class="lf-flex lf-color-555">
  89. <view class="lf-m-r-10">更多</view>
  90. <u-icon name="lock-fill lf-text-vertical"></u-icon>
  91. </view>
  92. </view> -->
  93. </view>
  94. <!-- 猜你喜欢 -->
  95. <lf-title-line></lf-title-line>
  96. <!-- 商品列表-瀑布流 -->
  97. <view style="padding: 0 20rpx;">
  98. <lf-waterfall :list="recomm_list"></lf-waterfall>
  99. <u-loadmore v-if="recomm_list.length" status="已加载全部数据~" @loadmore="addRandomData"></u-loadmore>
  100. <lf-nocontent v-else></lf-nocontent>
  101. </view>
  102. <!-- 回到顶部 -->
  103. <u-back-top :scroll-top="pageScrollTop" :custom-style="{background: 'rgba(51, 51 51, 0.3)'}"></u-back-top>
  104. </view>
  105. </template>
  106. <script>
  107. import lfWaterfall from '@/components/lf-waterfall/lf-waterfall.vue';
  108. import lfTitleLine from '@/components/lf-title-line/lf-title-line.vue';
  109. export default {
  110. components: {
  111. lfWaterfall,
  112. lfTitleLine
  113. },
  114. data() {
  115. return {
  116. banner_current: 0,
  117. recomm_list: [],
  118. tab_list: [{
  119. name: '推荐',
  120. list: []
  121. },{
  122. name: '酒店',
  123. list: []
  124. },{
  125. name: '推荐',
  126. list: []
  127. },{
  128. name: '酒店',
  129. list: []
  130. },{
  131. name: '推荐',
  132. list: []
  133. },{
  134. name: '酒店',
  135. list: []
  136. }],
  137. current: 0,
  138. list: [
  139. {
  140. price: 35,
  141. title: '北国风光,千里冰封,万里雪飘',
  142. shop: '李白杜甫白居易旗舰店',
  143. image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23327_s.jpg',
  144. },
  145. {
  146. price: 75,
  147. title: '望长城内外,惟余莽莽',
  148. shop: '李白杜甫白居易旗舰店',
  149. image: 'http://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23325_s.jpg',
  150. },
  151. {
  152. price: 385,
  153. title: '大河上下,顿失滔滔',
  154. shop: '李白杜甫白居易旗舰店',
  155. image: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
  156. },
  157. {
  158. price: 784,
  159. title: '欲与天公试比高',
  160. shop: '李白杜甫白居易旗舰店',
  161. image: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/zzpic23369_s.jpg',
  162. },
  163. {
  164. price: 7891,
  165. title: '须晴日,看红装素裹,分外妖娆',
  166. shop: '李白杜甫白居易旗舰店',
  167. image: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2130_s.jpg',
  168. },
  169. {
  170. price: 2341,
  171. shop: '李白杜甫白居易旗舰店',
  172. title: '江山如此多娇,引无数英雄竞折腰',
  173. image: 'http://pic1.sc.chinaz.com/Files/pic/pic9/202002/zzpic23346_s.jpg',
  174. }
  175. ]
  176. }
  177. },
  178. onLoad() {
  179. this.addRandomData();
  180. },
  181. methods: {
  182. // 瀑布流随机模拟数据
  183. addRandomData() {
  184. for(let i = 0; i < 10; i++) {
  185. let index = this.$u.random(0, this.list.length - 1);
  186. // 先转成字符串再转成对象,避免数组对象引用导致数据混乱
  187. let item = JSON.parse(JSON.stringify(this.list[index]))
  188. item.id = this.$u.guid();
  189. this.recomm_list.push(item);
  190. }
  191. },
  192. // tabs标签切换时件,现已费弃
  193. tabChange(current){
  194. this.current = current;
  195. },
  196. // swiper页面被滑动切换
  197. pageChange(event){
  198. console.log(event)
  199. this.current = event.detail.current;
  200. },
  201. // banner图被点击
  202. clickBanner(){
  203. this.$msg('您点击了banner图')
  204. },
  205. // ad被点击
  206. clickAD(){
  207. this.$msg('您点击了ad广告')
  208. }
  209. },
  210. onReachBottom() {
  211. },
  212. onPullDownRefresh(){
  213. uni.stopPullDownRefresh();
  214. }
  215. }
  216. </script>
  217. <style>
  218. page{
  219. background-color: #F6F6F6;
  220. }
  221. </style>
  222. <style lang="scss" scoped>
  223. .head{
  224. width: 750rpx;
  225. height: 360rpx;
  226. .swipe-img{
  227. width: 100%;
  228. height: 100%;
  229. }
  230. }
  231. .content{
  232. width: 750rpx;
  233. // height: 600rpx;
  234. height: max-content;
  235. border-radius: 30rpx 30rpx 0rpx 0rpx;
  236. position: relative;
  237. top: -30rpx;
  238. background-color: #FFFFFF;
  239. box-sizing: border-box;
  240. padding: 40rpx 32rpx 10rpx;
  241. .message-box{
  242. width: 686rpx;
  243. height: 53rpx;
  244. background: #CFE7FD;
  245. border-radius: 27rpx;
  246. color: #1998FE;
  247. box-sizing: border-box;
  248. padding: 0 20rpx;
  249. font-size: 24rpx;
  250. .message-btn{
  251. width: 80rpx;
  252. height: 33rpx;
  253. border-radius: 10rpx;
  254. border: 1rpx solid #1998FE;
  255. text-align: center;
  256. line-height: 31rpx;
  257. }
  258. }
  259. }
  260. .channel-item{
  261. width: 160rpx;
  262. height: 160rpx;
  263. border-radius: 15rpx;
  264. margin-top: 15rpx;
  265. margin-right: 15rpx;
  266. position: relative;
  267. overflow: hidden;
  268. &:nth-child(4n){
  269. margin-right: 0;
  270. }
  271. image{
  272. width: 160rpx;
  273. height: 160rpx;
  274. position: absolute;
  275. z-index: 0;
  276. }
  277. // view{
  278. // position: absolute;
  279. // right: 0;
  280. // bottom: 0;
  281. // background-color: rgba(255,255,255,0.5);
  282. // width: 42rpx;
  283. // height: 42rpx;
  284. // color: #FFFFFF;
  285. // display: flex;
  286. // justify-content: center;
  287. // align-items: center;
  288. // border-radius: 10rpx 0rpx 15rpx 0rpx;
  289. // z-index: 2;
  290. // }
  291. .channel-mask::after{
  292. width: 100%;
  293. height: 100%;
  294. content: '';
  295. position: absolute;
  296. z-index: 1;
  297. background: rgba(0, 0, 0, 0.5);
  298. top: 0;
  299. left: 0;
  300. }
  301. .channe-text{
  302. position: absolute;
  303. top: 0;
  304. left: 0;
  305. width: 100%;
  306. height: 100%;
  307. z-index: 2;
  308. color: #FFFFFF;
  309. font-size: 28rpx;
  310. }
  311. }
  312. .ad{
  313. height: 230rpx;
  314. width: 100%;
  315. }
  316. .recomm{
  317. width: 100%;
  318. height: max-content;
  319. .recomm-img{
  320. width: 222rpx;
  321. height: 222rpx;
  322. border-radius: 10rpx;
  323. }
  324. .max-recomm-img{
  325. width: 455rpx;
  326. height: 455rpx;
  327. position: relative;
  328. .recomm-title{
  329. // height: 142rpx;
  330. height: max-content;
  331. width: 100%;
  332. background-color: rgba(0,0,0,0.65);
  333. box-sizing: border-box;
  334. padding: 15rpx;
  335. position: absolute;
  336. bottom: 0;
  337. color: #FFFFFF;
  338. }
  339. }
  340. }
  341. </style>