E企盈营销工具技术服务商 热线:4006-838-530

小程序swiper,小程序swiper左右滑动

E企盈直播平台营销卖货系统

!–选项卡–viewviewdata-current=”0″bindtap=”clickTab”待确认/viewviewdata-current=”1″bindtap=”clickTab”运输中/viewviewdata-current=”2″bindtap=”clickTab”待结算/viewviewdata-current=”3″bindtap=”clickTab”已完成/viewviewdata-current=”4″bindtap=”clickTab”已取消/view/viewswipercurrent='{{currentTab}}’style=’height:{{scrollHeight}}px’duration=”300″bindchange=”swiperTab”swiper-itemscroll-viewscroll-ystyle=’height:{{scrollHeight}}px’bindscrolltolower=”loadMore”templateis=”listReceive”data=”{{myReceive}}”/template/scroll-view/swiper-itemswiper-itemscroll-viewscroll-ystyle=’height:{{scrollHeight}}px’bindscrolltolower=”loadMore”templateis=”listReceive”data=”{{myReceive}}”/template/scroll-view/swiper-itemswiper-itemscroll-viewscroll-ystyle=’height:{{scrollHeight}}px’bindscrolltolower=”loadMore”templateis=”listReceive”data=”{{myReceive}}”/template/scroll-view/swiper-itemswiper-itemscroll-viewscroll-ystyle=’height:{{scrollHeight}}px’bindscrolltolower=”loadMore”templateis=”listReceive”data=”{{myReceive}}”/template/scroll-view/swiper-itemswiper-itemscroll-viewscroll-ystyle=’height:{{scrollHeight}}px’bindscrolltolower=”loadMore”templateis=”listReceive”data=”{{myReceive}}”/template/scroll-view/swiper-item/swiper/viewdata:{currentTab:0,isactive:true,scrollHeight:0,myReceive:[],size:10,pageEnd:false,state:’待确认’},//滑动切换swiperTab:function(e){varthat=this;that.setData({currentTab:e.detail.current});if(that.data.currentTab==0){that.data.state=’待确认’}elseif(that.data.currentTab==1){that.data.state=’运输中’}elseif(that.data.currentTab==2){that.data.state=’待结算’}elseif(that.data.currentTab==3){that.data.state=’已完成’}elseif(that.data.currentTab==4){that.data.state=’已取消’}varmyReceive={state:that.data.state,page:’1′,size:’10’}api.getRequest(api.apiUrl.ORDERS_ACCEPTED_GET,myReceive,function(res){vardatas=res.data.data.items;console.log(datas)for(leti=0;idatas.length;i++){datas[i][“limitedAt”]=tool.toDate(datas[i][“limitedAt”])}that.setData({myReceive:datas})})console.log(“9ui”,that.data.state)},//点击切换clickTab:function(e){varthat=this;if(this.data.currentTab===e.target.dataset.current){returnfalse;}else{that.setData({currentTab:e.target.dataset.current})}if(that.data.currentTab==0){that.data.state=’待确认’}elseif(that.data.currentTab==1){that.data.state=’运输中’}elseif(that.data.currentTab==2){that.data.state=’待结算’}elseif(that.data.currentTab==3){that.data.state=’已完成’}elseif(that.data.currentTab==4){that.data.state=’已取消’}console.log(“ffffffffffffffff”+this.data.currentTab)varthat=this;varmyReceive={state:that.data.state,page:’1′,size:’10’}api.getRequest(api.apiUrl.ORDERS_ACCEPTED_GET,myReceive,function(res){vardatas=res.data.data.items;for(leti=0;idatas.length;i++){datas[i][“limitedAt”]=tool.toDate(datas[i][“limitedAt”])}that.setData({myReceive:datas})console.log(“asfffff”,that.data.myReceive)})},之前是直接赋值了禁止左右滑动view待确认”?’active’:”}}”data-current=”待确认”bindtap=”clickTab”待确认/view.但后来要求可以滑动,我以为把禁止滑动(catchtouchmove=’stopTouchMove’)就可以了,但发现api里swipercurrent属性默认值是0,所以一直滑动不了,后来我就设置为数字了,然后通过js赋值,之前直接赋值,也没用滚动,所以只写一条数据判断不同的状态,然后显示就行了,但左右滚动数据必须在scroll-view里,有几个滚动就要写几个scroll-view,所以数据重复太多,然后我就写在模板里面引用过来了

赞(0) 打赏
未经允许不得转载:E企盈小程序开发-热线:4006-838-530 » 小程序swiper,小程序swiper左右滑动
分享到: 更多 (0)
E企盈小程序直播营销卖货系统
E企盈直播平台营销卖货系统

评论 抢沙发

E企盈小程序开发

联系我们联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏