@@ -15,7 +15,6 @@ Component({ | |||||
* 组件的初始数据 | * 组件的初始数据 | ||||
*/ | */ | ||||
data: { | data: { | ||||
swiperCurrent: 0, | |||||
bannerUrl: imgurl.banner.url | bannerUrl: imgurl.banner.url | ||||
}, | }, | ||||
@@ -24,11 +23,6 @@ Component({ | |||||
*/ | */ | ||||
ready() {}, | ready() {}, | ||||
methods: { | methods: { | ||||
swiperChange: function(e) { | |||||
this.setData({ | |||||
swiperCurrent: e.detail.current | |||||
}); | |||||
}, | |||||
gotobannerdetail: function(e) { | gotobannerdetail: function(e) { | ||||
console.log(e) | console.log(e) | ||||
if(e.currentTarget.dataset.data.type==2){ | if(e.currentTarget.dataset.data.type==2){ | ||||
@@ -1,14 +1,9 @@ | |||||
<view wx:if="{{list.length>0}}" class="index-slide-view"> | <view wx:if="{{list.length>0}}" class="index-slide-view"> | ||||
<swiper class="index-slide" bindchange="swiperChange" autoplay="true" circular="false" current="{{swiperCurrent}}"> | |||||
<swiper class="index-slide" autoplay="true" circular="false"> | |||||
<block wx:for="{{list}}" wx:key="unique"> | <block wx:for="{{list}}" wx:key="unique"> | ||||
<swiper-item> | <swiper-item> | ||||
<image data-id="{{item.id}}" data-data="{{item}}" mode='widthFix' bindtap='gotobannerdetail' src="{{item.coverImg}}" class="index-slide-image" /> | <image data-id="{{item.id}}" data-data="{{item}}" mode='widthFix' bindtap='gotobannerdetail' src="{{item.coverImg}}" class="index-slide-image" /> | ||||
</swiper-item> | </swiper-item> | ||||
</block> | </block> | ||||
</swiper> | </swiper> | ||||
<view class="dots"> | |||||
<block wx:for="{{list}}" wx:key="unique"> | |||||
<view class="dot{{index == swiperCurrent ? ' active' : ''}}"></view> | |||||
</block> | |||||
</view> | |||||
</view> | </view> |
@@ -384,11 +384,5 @@ Page({ | |||||
} | } | ||||
}, | }, | ||||
}) | }) | ||||
}, | |||||
/** | |||||
* 用户点击右上角分享 | |||||
*/ | |||||
onShareAppMessage: function () { | |||||
} | } | ||||
}) | }) |
@@ -28,7 +28,6 @@ button::after { | |||||
.banner image { | .banner image { | ||||
width: 100%; | width: 100%; | ||||
height: 100%; | |||||
} | } | ||||
.dots { | .dots { | ||||
@@ -35,7 +35,11 @@ Page({ | |||||
showpost: false | showpost: false | ||||
}) | }) | ||||
}, | }, | ||||
goback: function () { | |||||
wx.switchTab({ | |||||
url: '/pages/main/index', | |||||
}) | |||||
}, | |||||
/** | /** | ||||
* 生命周期函数--监听页面加载 | * 生命周期函数--监听页面加载 | ||||
*/ | */ | ||||