forked from wzs28150/coolui-scroller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.wxml
97 lines (93 loc) · 4.36 KB
/
index.wxml
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<block wx:if="{{scrollOption.refresh.type == 'default'}}">
<scroll-view
scroll-y
class="scroll"
enhanced="{{true}}"
fast-deceleration="{{true}}"
refresher-enabled="{{true}}"
refresher-threshold="{{100}}"
refresher-default-style="{{scrollOption.refresh.style}}"
refresher-background="#f2f2f2"
refresher-triggered="{{triggered}}"
bindrefresherpulling="onPulling"
bindrefresherrefresh="onRefresh"
bindrefresherrestore="onRestore"
bindscrolltolower="lower"
bindscroll="scroll"
style="height:100%"
>
<view class="inner-empty" wx:if="{{scrollOption.pagination.length==0 && !isRefreshLoading}}">
<image src="{{scrollOption.empty.img}}" class="empty-img" mode="aspectFill" />
</view>
<view class="inner" wx:else>
<slot name="inner" />
</view>
<block wx:if="{{isLoading}}">
<view wx:if="{{isNoneLoading}}" class="isLoadMoreLoading">
没有更多了
</view>
<block wx:elif="{{scrollOption.pagination.page == scrollOption.pagination.totalPage && scrollOption.pagination.totalPage == 1}}" />
<view wx:else>
<slot name="inner" wx:if="{{scrollOption.loadmore.type == 'diy' }}" />
<view wx:else class="isLoadMoreLoading" style="color:{{scrollOption.loadmore.title.color}};{{scrollOption.loadmore.title.shadow?'text-shadow:0 0 '+scrollOption.loadmore.title.shadow+'rpx '+scrollOption.loadmore.title.color+';':''}}{{scrollOption.loadmore.background?'background-color:'+scrollOption.loadmore.background+';':''}}{{scrollOption.loadmore.backgroundImage?'background-image:url('+scrollOption.loadmore.backgroundImage+');background-size:cover;':''}}">
<image class="ico" mode="aspectFill" src="{{scrollOption.loadmore.icon}}" />
<block wx:if="{{scrollOption.loadmore.title.show}}">
{{scrollOption.loadmore.title.text}}
</block>
</view>
</view>
</block>
</scroll-view>
</block>
<block wx:elif="{{scrollOption.refresh.type == 'diy'}}">
<scroll-view
scroll-y
class="scroll"
style="height:100%"
enhanced="{{true}}"
fast-deceleration="{{true}}"
refresher-enabled="{{true}}"
refresher-threshold="{{scrollOption.refresh.refreshthreshold}}"
refresher-background="{{background}}"
refresher-default-style="none"
refresher-triggered="{{triggered}}"
bindrefresherpulling="onPullingDiy"
bindrefresherrefresh="onRefresh"
bindrefresherrestore="onRestore"
bindscrolltolower="lower"
bindscroll="scroll"
>
<view slot="refresher" class="refresh-container" style="height: {{scrollOption.refresh.refreshthreshold}}px; {{scrollOption.refresh.backgroundImage?'background-image:url('+scrollOption.refresh.backgroundImage+');':''}}">
<slot wx:if="{{scrollOption.refresh.diyLevel > 1}}" name="refresh" />
<block wx:else>
<view class="refresh-inner" wx:if="{{scrollOption.refresh.title.show}}" style="color:{{scrollOption.refresh.title.color}};{{scrollOption.refresh.title.shadow?'text-shadow:0 0 '+scrollOption.refresh.title.shadow+'rpx '+scrollOption.refresh.title.color+';':''}}">
<view class="down" style="transform: rotate({{threshold*180}}deg)" />
{{scrollOption.refresh.title.text}}
</view>
</block>
</view>
<view class="inner-empty" wx:if="{{scrollOption.pagination.length==0 && !isRefreshLoading}}">
<image src="{{scrollOption.empty.img}}" class="empty-img" mode="aspectFill" />
</view>
<view class="inner" wx:else>
<slot name="inner" />
</view>
<block wx:if="{{isLoading}}">
<view wx:if="{{isNoneLoading}}" class="isLoadMoreLoading">
没有更多了
</view>
<block wx:elif="{{scrollOption.pagination.page == totalPage && scrollOption.pagination.totalPage == 1}}" />
<view wx:else>
<view wx:if="{{scrollOption.loadmore.type == 'diy' }}">
<slot name="loadmore" />
</view>
<view wx:else class="isLoadMoreLoading" style="color:{{scrollOption.loadmore.title.color}};{{scrollOption.loadmore.title.shadow?'text-shadow:0 0 '+scrollOption.loadmore.title.shadow+'rpx '+scrollOption.loadmore.title.color+';':''}}{{scrollOption.loadmore.background?'background-color:'+scrollOption.loadmore.background+';':''}}{{scrollOption.loadmore.backgroundImage?'background-image:url('+scrollOption.loadmore.backgroundImage+');background-size:cover;':''}}">
<image class="ico" mode="aspectFill" src="{{scrollOption.loadmore.icon}}" />
<block wx:if="{{scrollOption.loadmore.title.show}}">
{{scrollOption.loadmore.title.text}}
</block>
</view>
</view>
</block>
</scroll-view>
</block>