问题模块 |
---|
API和组件 |
小程序swiper整屏闪动,几个页面轮流显示又不像是来回滚动,但内容一直在变化(没有设置自动播放),不知道是什么问题,出现问题又不是很频繁
测试机型:iPhone SE 版本不限
网友回复
Magic:
搞定了,谢谢QAQ
LastLeaf:
你可以通过判断是否是由setData导致的change,来决定是否在change事件中再次setData。
Magic:
这个好像只是说明触发的事件,对解决上面的问题好像作用不大
LastLeaf:
现在swiper的change事件会返回source字段,表示导致change的原因,请参见
https://mp.weixin.qq.com/debug/wxadoc/dev/component/swiper.html
LastLeaf:
请不要这么做。
.锦浩:
有的
swiperChange: function (e) { this .setData({ tabIndex: e.detail.current }) }, |
LastLeaf:
swiperChange中有setData改变current的调用吗?
.锦浩:
我也遇到这样的问题。在测试机荣耀5A,微信版本6.5.8。代码如下
< swiper current = "{{tabIndex}}" bindchange = "swiperChange" class = "cont-box" style = "height:{{scrHeight}}px;" > < swiper-item > <!--待支付订单列表--> < scroll-view scroll-y = "true" style = "height:{{scrHeight}}px;left:{{-tabIndex*100}}%;" class = "order-cont" > <!--内容省略--> </ scroll-view > </ swiper-item > < swiper-item > <!--待收货订单列表--> < scroll-view scroll-y = "true" style = "height:{{scrHeight}}px;left:{{-(tabIndex-1)*100}}%;" class = "order-cont" > <!--内容省略--> </ scroll-view > </ swiper-item > < swiper-item > <!--已完成订单列表--> < scroll-view scroll-y = "true" style = "height:{{scrHeight}}px;left:{{-(tabIndex-2)*100}}%;" class = "order-cont" bindscrolltolower = "moreClose" > <!--内容省略--> </ scroll-view > </ swiper-item > </ swiper > |
LastLeaf:
感谢反馈,麻烦提供一下相关代码和iOS版本。