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

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