<view class="swiperContainer">
<swiper bindchange="swiperChange" autoplay="{{autoplay}}" duration="{{duration}}" style='height: 380rpx;'>
<block wx:for="{{imgUrls}}" wx:key="*this">
<swiper-item wx:key="*this">
<image src="{{item}}" class="slide-image" class='img' />
</swiper-item>
</block>
</swiper>
<view class="imageCount">{{current+}}/{{imgUrls.length}}</view>
</view>
.swiperContainer {
position: relative;
}
.img {
width: %;
 height:100%;
}
.imageCount {
width:120rpx;
height:50rpx;
background-color: rgba(, , , 0.3);
border-radius:40rpx;
line-height:50rpx;
color:#fff;
text-align:center;
font-size:26rpx;
position:absolute;
left:13px;
bottom:20rpx;
}
Page({
data: {
duration:"",
imgUrls: [
'https://cdn.cnbj0.fds.api.mi-img.com/b2c-mimall-media/b51889744910df7979a2f672434da84e.jpg?thumb=1&w=720&h=360',
'https://cdn.cnbj0.fds.api.mi-img.com/b2c-mimall-media/37dfdc929ee9a4313facb0b23ebcd721.jpg?thumb=1&w=720&h=360',
'https://cdn.cnbj0.fds.api.mi-img.com/b2c-mimall-media/a0ff3dc30027f3b615bfe03f1d306ee5.jpg?thumb=1&w=720&h=360',
'https://cdn.cnbj0.fds.api.mi-img.com/b2c-mimall-media/2320573b3be643e29f5270a97e1a9c1d.jpg?thumb=1&w=720&h=360'
],
current:
},
swiperChange: function (e) {
var that = this;
if (e.detail.source == 'touch') {
that.setData({
current: e.detail.current
})
}
},
onLoad: function (options) {
var that = this;
},
onReady: function () { },
onShow: function () { }, /**
* 用户点击右上角分享
*/
onShareAppMessage: function () { }
})

最新文章

  1. Android获取位置信息的方法总结
  2. Linux安装JDK1.8
  3. SDRAM操作原理分析
  4. 前端模块化:RequireJS
  5. jnlp jws
  6. Vue.js常见问题
  7. selenium--下拉列表选择
  8. ASCII 码表对照 2
  9. (转)poj1182食物链
  10. Java数据库连接错误集
  11. firebug离线安装方法-拖入法
  12. spring mvc报错,数据库查询无限死循环
  13. 介绍Dynamics 365的OrgDBOrgSettings工具
  14. oracle nvl2函数
  15. Centos7上安装mariadb
  16. SpringBoot单元测试示例2
  17. SQL Server在本地计算机上用SSMS(SQL Server Management Studio)登录不上,错误消息:(Microsoft SQL Server, Error: 18456)
  18. [Functional Programming] Using JS, FP approach with Arrow or State Monad
  19. R语言学习笔记—决策树分类
  20. [NOIP2017]时间复杂度(模拟)

热门文章

  1. Vim 插键及配置
  2. php中的正则函数:正则匹配,正则替换,正则分割 所有的操作都不会影响原来的字符串.
  3. try finally 执行顺序问题
  4. 【模板】关于c++的代码模板
  5. ElasticSearch——日志工具
  6. Vim-编辑器之神
  7. ES6中Promise的入门(结合例子)
  8. springboot 启动报错 java.lang.IllegalStateException: Failed to introspect annotated methods on class org
  9. sublime3 mac : Package Control There are no packages available for installation
  10. Java Object类及其equals方法