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

381 lines
9.0 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
  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. <u-waterfall v-model="tabItem.list" :ref="'uWaterfall-'+ tabIndex">
  88. <template v-slot:left="{leftList}">
  89. <view class="list-warter" v-for="(item, index) in leftList" :key="index">
  90. <u-lazy-load threshold="-450" :image="item.image" :index="index">
  91. <view class="list-label">已售8777</view>
  92. </u-lazy-load>
  93. <view class="lf-p-20">
  94. <view class="list-title">
  95. {{item.title}}
  96. </view>
  97. <view class="list-price">
  98. <text>{{item.price}}</text>
  99. <text class="lf-m-l-20 lf-font-24 lf-color-666 lf-line-through">¥399.00</text>
  100. </view>
  101. </view>
  102. </view>
  103. </template>
  104. <template v-slot:right="{rightList}">
  105. <view class="list-warter" v-for="(item, index) in rightList" :key="index">
  106. <u-lazy-load threshold="-450" :image="item.image" :index="index">
  107. <view class="list-label">已售8777</view>
  108. </u-lazy-load>
  109. <view class="lf-p-20">
  110. <view class="list-title">
  111. {{item.title}}
  112. </view>
  113. <view class="list-price">
  114. <text>{{item.price}}</text>
  115. <text class="lf-m-l-20 lf-font-24 lf-color-666 lf-line-through">¥399.00</text>
  116. </view>
  117. </view>
  118. </view>
  119. </template>
  120. </u-waterfall>
  121. <u-loadmore v-if="tabItem.list.length" :status="tabItem.loading_text" @loadmore="addRandomData"></u-loadmore>
  122. <lf-nocontent v-else></lf-nocontent>
  123. </view>
  124. <!-- 回到顶部 -->
  125. <u-back-top :scroll-top="pageScrollTop" :custom-style="{background: 'rgba(51, 51 51, 0.3)'}"></u-back-top>
  126. </view>
  127. </template>
  128. <script>
  129. export default {
  130. data() {
  131. return {
  132. banner_current: 0,
  133. tab_list: [{
  134. name: '推荐',
  135. list: []
  136. },{
  137. name: '酒店',
  138. list: []
  139. },{
  140. name: '推荐',
  141. list: []
  142. },{
  143. name: '酒店',
  144. list: []
  145. },{
  146. name: '推荐',
  147. list: []
  148. },{
  149. name: '酒店',
  150. list: []
  151. }],
  152. current: 0
  153. }
  154. },
  155. onLoad() {
  156. // this.addRandomData();
  157. },
  158. methods: {
  159. addRandomData() {
  160. for(let i = 0; i < 10; i++) {
  161. let index = this.$u.random(0, this.list.length - 1);
  162. // 先转成字符串再转成对象,避免数组对象引用导致数据混乱
  163. let item = JSON.parse(JSON.stringify(this.list[index]))
  164. item.id = this.$u.guid();
  165. this.flowList.push(item);
  166. }
  167. },
  168. tabChange(current){
  169. this.current = current;
  170. },
  171. pageChange(event){
  172. console.log(event)
  173. this.current = event.detail.current;
  174. }
  175. },
  176. onReachBottom() {
  177. },
  178. onPullDownRefresh(){
  179. uni.stopPullDownRefresh();
  180. }
  181. }
  182. </script>
  183. <style>
  184. page{
  185. background-color: #F6F6F6;
  186. }
  187. </style>
  188. <style lang="scss" scoped>
  189. .head{
  190. width: 750rpx;
  191. height: 360rpx;
  192. .swipe-img{
  193. width: 100%;
  194. height: 100%;
  195. }
  196. }
  197. .content{
  198. width: 750rpx;
  199. // height: 600rpx;
  200. height: max-content;
  201. border-radius: 30rpx 30rpx 0rpx 0rpx;
  202. position: relative;
  203. top: -30rpx;
  204. background-color: #FFFFFF;
  205. box-sizing: border-box;
  206. padding: 40rpx 32rpx 10rpx;
  207. .message-box{
  208. width: 686rpx;
  209. height: 53rpx;
  210. background: #CFE7FD;
  211. border-radius: 27rpx;
  212. color: #1998FE;
  213. box-sizing: border-box;
  214. padding: 0 20rpx;
  215. font-size: 24rpx;
  216. .message-btn{
  217. width: 80rpx;
  218. height: 33rpx;
  219. border-radius: 10rpx;
  220. border: 1rpx solid #1998FE;
  221. text-align: center;
  222. line-height: 31rpx;
  223. }
  224. }
  225. }
  226. .channel-item{
  227. width: 160rpx;
  228. height: 160rpx;
  229. border-radius: 15rpx;
  230. margin-top: 15rpx;
  231. margin-right: 15rpx;
  232. position: relative;
  233. overflow: hidden;
  234. &:nth-child(4n){
  235. margin-right: 0;
  236. }
  237. image{
  238. width: 160rpx;
  239. height: 160rpx;
  240. position: absolute;
  241. z-index: 0;
  242. }
  243. view{
  244. position: absolute;
  245. right: 0;
  246. bottom: 0;
  247. background-color: rgba(255,255,255,0.5);
  248. width: 42rpx;
  249. height: 42rpx;
  250. color: #FFFFFF;
  251. display: flex;
  252. justify-content: center;
  253. align-items: center;
  254. border-radius: 10rpx 0rpx 15rpx 0rpx;
  255. z-index: 2;
  256. }
  257. .channel-mask::after{
  258. width: 100%;
  259. height: 100%;
  260. content: '';
  261. position: absolute;
  262. z-index: 1;
  263. background: rgba(0, 0, 0, 0.5);
  264. top: 0;
  265. left: 0;
  266. }
  267. }
  268. .ad{
  269. height: 230rpx;
  270. width: 100%;
  271. }
  272. .recomm{
  273. width: 100%;
  274. height: max-content;
  275. .recomm-img{
  276. width: 222rpx;
  277. height: 222rpx;
  278. border-radius: 10rpx;
  279. }
  280. .max-recomm-img{
  281. width: 455rpx;
  282. height: 455rpx;
  283. position: relative;
  284. .recomm-title{
  285. // height: 142rpx;
  286. height: max-content;
  287. width: 100%;
  288. background-color: rgba(0,0,0,0.65);
  289. box-sizing: border-box;
  290. padding: 15rpx;
  291. position: absolute;
  292. bottom: 0;
  293. color: #FFFFFF;
  294. }
  295. }
  296. }
  297. // ====
  298. .list-warter {
  299. border-radius: 8px;
  300. margin: 10px 5px;
  301. margin-top: 0px;
  302. background-color: #ffffff;
  303. // padding: 8px;
  304. position: relative;
  305. overflow: hidden;
  306. }
  307. .u-close {
  308. position: absolute;
  309. top: 32rpx;
  310. right: 32rpx;
  311. }
  312. .list-image {
  313. width: 100%;
  314. border-radius: 4px;
  315. }
  316. .list-title {
  317. font-size: 28rpx;
  318. font-weight: bold;
  319. color: $u-main-color;
  320. }
  321. .list-label{
  322. position: absolute;
  323. bottom: 0;
  324. right: 0;
  325. background-color: rgba(0,0,0,0.5);
  326. width: 140rpx;
  327. height: 48rpx;
  328. border-radius: 20rpx 0rpx 0rpx 0rpx;
  329. font-size: 22rpx;
  330. color: #FFFFFF;
  331. line-height: 48rpx;
  332. text-align: center;
  333. }
  334. .list-tag {
  335. display: flex;
  336. margin-top: 5px;
  337. }
  338. .list-tag-owner {
  339. background-color: $u-type-error;
  340. color: #FFFFFF;
  341. display: flex;
  342. align-items: center;
  343. padding: 4rpx 14rpx;
  344. border-radius: 50rpx;
  345. font-size: 20rpx;
  346. line-height: 1;
  347. }
  348. .list-tag-text {
  349. border: 1px solid $u-type-primary;
  350. color: $u-type-primary;
  351. margin-left: 10px;
  352. border-radius: 50rpx;
  353. line-height: 1;
  354. padding: 4rpx 14rpx;
  355. display: flex;
  356. align-items: center;
  357. border-radius: 50rpx;
  358. font-size: 20rpx;
  359. }
  360. .list-price {
  361. font-size: 30rpx;
  362. color: $u-type-error;
  363. margin-top: 5px;
  364. }
  365. // ====
  366. </style>