Swiper轮播显示Demo

Swiper轮播显示Demo_第1张图片
“`
index.wxml







index.wxss
/index.wxss/
.userinfo {
display: flex;
flex-direction: column;
align-items: center;
}

.userinfo-avatar {
width: 128rpx;
height: 128rpx;
margin: 20rpx;
border-radius: 50%;
}

.userinfo-nickname {
color: #aaa;
}

.usermotto {
margin-top: 100px;
}

.slide-image{
width:100%;
height: 100%

}
.swiper {
height: 400rpx;
width: 100%;
}

//index.js
//获取应用实例
var app = getApp()
Page({
data: {
motto: ‘欢迎登陆’,
movies:[
{url:’http://img04.tooopen.com/images/20130712/tooopen_17270713.jpg‘} ,
{url:’http://img04.tooopen.com/images/20130617/tooopen_21241404.jpg‘} ,
{url:’http://img04.tooopen.com/images/20130701/tooopen_20083555.jpg‘} ,
{url:’http://img02.tooopen.com/images/20141231/sy_78327074576.jpg‘}
]

},
//事件处理函数
bindViewTap: function() {
wx.navigateTo({
url: ‘../logs/logs’
})
},
onLoad: function () {
console.log(‘onLoad’)
var that = this
//调用应用实例的方法获取全局数据
app.getUserInfo(function(userInfo){
//更新数据
that.setData({
userInfo:userInfo
})
})
},
listenSwiper:function(){
console.log(“启动”)
}
})

“`

你可能感兴趣的:(微信小程序)