cshenfu
2024-06-27 58aa6e282bb343503be3cb198948328ea3ed7b79
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<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>