<wxs module="wxs">
|
var touchStartObj = {}
|
module.exports.touchStart =function (e) {
|
touchStartObj = e.touches[0];
|
}
|
module.exports.touchMove = function(e,instance){
|
var moveObj = e.touches[0];
|
var dataset = e.instance.getDataset()
|
var current = dataset.current
|
var vertical = dataset.vertical
|
var dataLength = dataset.dataLength
|
var preDir = vertical ? moveObj.clientY - touchStartObj.clientY > 0 : moveObj.clientX - touchStartObj.clientX > 0
|
var nextDir = vertical ? moveObj.clientY - touchStartObj.clientY < 0 : moveObj.clientX - touchStartObj.clientX < 0
|
if(current==0&&preDir){
|
|
|
|
|
return false
|
|
}else if(current==dataLength-1&&nextDir){
|
|
|
|
|
return false
|
|
}
|
}
|
</wxs>
|
<swiper class="swiper data-v-48fec020 vue-ref" current="{{swiperCurrent}}" disable-touch="{{disableTouch}}" indicator-dots="{{false}}" vertical="{{vertical}}" duration="{{duration}}" circular="{{true}}" autoplay="{{autoplay}}" interval="{{interval}}" easingFunction="{{easingFunction}}" data-ref="swiper" data-event-opts="{{[['change',[['change',['$event']]]],['transition',[['transition',['$event']]]],['animationfinish',[['animationfinish',['$event']]]]]}}" bindchange="__e" bindtransition="__e" bindanimationfinish="__e"><block wx:for="{{$root.l0}}" wx:for-item="item" wx:for-index="index" wx:key="index"><swiper-item data-vertical="{{vertical}}" data-current="{{current}}" data-data-length="{{dataLength}}" bindtouchstart="{{wxs.touchStart}}" bindtouchmove="{{wxs.touchMove}}" class="data-v-48fec020"><block wx:if="{{list[swiperList[index]]}}"><slot></slot><scoped-slots-default item="{{list[swiperList[index]]}}" index="{{swiperList[index]}}" class="scoped-ref" bind:__l="__l"></scoped-slots-default></block></swiper-item></block></swiper>
|