|
|
@ -1,19 +1,16 @@ |
|
|
<template> |
|
|
<template> |
|
|
<view> |
|
|
<view> |
|
|
<swiper class="head" :current="banner_current" > |
|
|
<swiper class="head" :current="banner_current" > |
|
|
<swiper-item @click="clickBanner"> |
|
|
|
|
|
<image src="https://picsum.photos/375/360" class="swipe-img"></image> |
|
|
|
|
|
</swiper-item> |
|
|
|
|
|
<swiper-item @click="clickBanner"> |
|
|
|
|
|
<image src="https://picsum.photos/375/360" class="swipe-img"></image> |
|
|
|
|
|
|
|
|
<swiper-item @click="clickBanner" v-for="(item,index) of banner"> |
|
|
|
|
|
<image :src="item.url" class="swipe-img" mode="aspectFill"></image> |
|
|
</swiper-item> |
|
|
</swiper-item> |
|
|
</swiper> |
|
|
</swiper> |
|
|
<view class="content"> |
|
|
<view class="content"> |
|
|
<!-- 消息模块 --> |
|
|
<!-- 消息模块 --> |
|
|
<view class="lf-row-between lf-m-b-34 message-box"> |
|
|
|
|
|
|
|
|
<view class="lf-row-between lf-m-b-34 message-box" v-for="(item,index) of notice"> |
|
|
<view class="lf-flex"> |
|
|
<view class="lf-flex"> |
|
|
<text class="lf-iconfont lf-icon-tongzhi lf-text-vertical"></text> |
|
|
<text class="lf-iconfont lf-icon-tongzhi lf-text-vertical"></text> |
|
|
<view class="lf-m-l-12 lf-line-1" style="max-width: 510rpx;">国庆优惠大促,快来看看吧!</view> |
|
|
|
|
|
|
|
|
<view class="lf-m-l-12 lf-line-1" style="max-width: 510rpx;">{{item.title}}</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="message-btn" hover-class="lf-opacity" @click="$url('/pages/notice/article')">详情</view> |
|
|
<view class="message-btn" hover-class="lf-opacity" @click="$url('/pages/notice/article')">详情</view> |
|
|
</view> |
|
|
</view> |
|
|
@ -26,9 +23,9 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="lf-flex-wrap"> |
|
|
<view class="lf-flex-wrap"> |
|
|
<view class="channel-item" v-for="(item, index) in 7" @click="$url('/pages/goodsList/index')"> |
|
|
|
|
|
<image src="../../static/logo.png" class="channel-mask" mode="aspectFill"></image> |
|
|
|
|
|
<view class="lf-row-center channe-text lf-font-bold">冲浪</view> |
|
|
|
|
|
|
|
|
<view class="channel-item" v-for="(item, index) in channel_list" @click="$url('/pages/goodsList/index')"> |
|
|
|
|
|
<image :src="item.icon" class="channel-mask" mode="aspectFill"></image> |
|
|
|
|
|
<view class="lf-row-center channe-text lf-font-bold">{{item.name}}</view> |
|
|
<!-- <view> |
|
|
<!-- <view> |
|
|
<u-icon name="lock-fill lf-text-vertical"></u-icon> |
|
|
<u-icon name="lock-fill lf-text-vertical"></u-icon> |
|
|
</view> --> |
|
|
</view> --> |
|
|
@ -119,11 +116,14 @@ |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
|
|
|
banner: [], |
|
|
banner_current: 0, |
|
|
banner_current: 0, |
|
|
recomm_list: [], |
|
|
recomm_list: [], |
|
|
|
|
|
channel_list: [], |
|
|
current: 0, |
|
|
current: 0, |
|
|
loading_class: false, |
|
|
loading_class: false, |
|
|
loading_text: '已加载全部数据~', |
|
|
loading_text: '已加载全部数据~', |
|
|
|
|
|
home_ad1: '', |
|
|
list: [ |
|
|
list: [ |
|
|
{ |
|
|
{ |
|
|
price: 35, |
|
|
price: 35, |
|
|
@ -161,11 +161,13 @@ |
|
|
title: '江山如此多娇,引无数英雄竞折腰', |
|
|
title: '江山如此多娇,引无数英雄竞折腰', |
|
|
image: 'http://pic1.sc.chinaz.com/Files/pic/pic9/202002/zzpic23346_s.jpg', |
|
|
image: 'http://pic1.sc.chinaz.com/Files/pic/pic9/202002/zzpic23346_s.jpg', |
|
|
} |
|
|
} |
|
|
] |
|
|
|
|
|
|
|
|
], |
|
|
|
|
|
notice: [] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onLoad() { |
|
|
onLoad() { |
|
|
this.addRandomData(); |
|
|
|
|
|
|
|
|
// this.addRandomData(); |
|
|
|
|
|
this.getIndexData() |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
// 瀑布流随机模拟数据 |
|
|
// 瀑布流随机模拟数据 |
|
|
@ -178,7 +180,19 @@ |
|
|
this.recomm_list.push(item); |
|
|
this.recomm_list.push(item); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
// tabs标签切换时件,现已费弃 |
|
|
|
|
|
|
|
|
getIndexData() { |
|
|
|
|
|
this.$http(this.API.API_INDEX).then(res => { |
|
|
|
|
|
this.notice = res.data?.notice |
|
|
|
|
|
this.recomm_list = res.data?.hots |
|
|
|
|
|
this.banner = res.data?.slide |
|
|
|
|
|
this.channel_list = res.data?.my_channels |
|
|
|
|
|
this.home_ad1 = res.data?.home_ad1 |
|
|
|
|
|
console.log(res) |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
// tabs标签切换时件,现已费弃 |
|
|
tabChange(current){ |
|
|
tabChange(current){ |
|
|
this.current = current; |
|
|
this.current = current; |
|
|
}, |
|
|
}, |
|
|
|