@lynx-example/lynx-ui-swiper 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Basic/index.tsx +3 -3
- package/Basic/styles.css +1 -1
- package/BasicDynamic/index.tsx +66 -74
- package/BasicUpdateSize/index.tsx +65 -75
- package/Bounces/index.tsx +71 -55
- package/Bounces/styles.css +36 -27
- package/CHANGELOG.md +18 -0
- package/Common/Demo/styles.css +113 -0
- package/Custom/index.tsx +43 -41
- package/CustomScale/index.tsx +44 -42
- package/CustomTinder/index.tsx +2 -2
- package/CustomTinder/styles.css +1 -1
- package/DifferentHeight/Button.tsx +1 -29
- package/DifferentHeight/index.tsx +4 -4
- package/DifferentHeight/styles.css +1 -1
- package/Direction/index.tsx +97 -105
- package/EmptyDataBug/index.tsx +14 -13
- package/EmptyDataBug/styles.css +19 -12
- package/Indicator/index.tsx +56 -50
- package/Lazy/index.tsx +69 -65
- package/Loop/index.tsx +45 -42
- package/RTL/Button.tsx +1 -29
- package/RTL/index.tsx +74 -83
- package/RTLCustom/index.tsx +45 -43
- package/RTLLoop/Button.tsx +1 -29
- package/RTLLoop/index.tsx +57 -66
- package/RTLLoopLynxRTL/Button.tsx +1 -29
- package/RTLLoopLynxRTL/index.tsx +57 -66
- package/WithGap/Button.tsx +1 -29
- package/WithGap/index.tsx +57 -68
- package/dist/SwiperBasic.lynx.bundle +0 -0
- package/dist/SwiperBasic.web.bundle +1 -1
- package/dist/SwiperBasicDynamic.lynx.bundle +0 -0
- package/dist/SwiperBasicDynamic.web.bundle +1 -1
- package/dist/SwiperBasicUpdateSize.lynx.bundle +0 -0
- package/dist/SwiperBasicUpdateSize.web.bundle +1 -1
- package/dist/SwiperBounces.lynx.bundle +0 -0
- package/dist/SwiperBounces.web.bundle +1 -1
- package/dist/SwiperCustom.lynx.bundle +0 -0
- package/dist/SwiperCustom.web.bundle +1 -1
- package/dist/SwiperCustomScale.lynx.bundle +0 -0
- package/dist/SwiperCustomScale.web.bundle +1 -1
- package/dist/SwiperCustomTinder.lynx.bundle +0 -0
- package/dist/SwiperCustomTinder.web.bundle +1 -1
- package/dist/SwiperDifferentHeight.lynx.bundle +0 -0
- package/dist/SwiperDifferentHeight.web.bundle +1 -1
- package/dist/SwiperEmptyDataBug.lynx.bundle +0 -0
- package/dist/SwiperEmptyDataBug.web.bundle +1 -1
- package/dist/SwiperIndicator.lynx.bundle +0 -0
- package/dist/SwiperIndicator.web.bundle +1 -1
- package/dist/SwiperLazy.lynx.bundle +0 -0
- package/dist/SwiperLazy.web.bundle +1 -1
- package/dist/SwiperLoop.lynx.bundle +0 -0
- package/dist/SwiperLoop.web.bundle +1 -1
- package/dist/SwiperRTL.lynx.bundle +0 -0
- package/dist/SwiperRTL.web.bundle +1 -1
- package/dist/SwiperRTLCustom.lynx.bundle +0 -0
- package/dist/SwiperRTLCustom.web.bundle +1 -1
- package/dist/SwiperRTLLoop.lynx.bundle +0 -0
- package/dist/SwiperRTLLoop.web.bundle +1 -1
- package/dist/SwiperRTLLynxRTL.lynx.bundle +0 -0
- package/dist/SwiperRTLLynxRTL.web.bundle +1 -1
- package/dist/SwiperWithGap.lynx.bundle +0 -0
- package/dist/SwiperWithGap.web.bundle +1 -1
- package/package.json +6 -6
- package/BasicDynamic/styles.css +0 -47
- package/BasicUpdateSize/styles.css +0 -47
- package/Custom/styles.css +0 -47
- package/CustomScale/styles.css +0 -41
- package/Direction/styles.css +0 -41
- package/Indicator/styles.css +0 -41
- package/Lazy/styles.css +0 -41
- package/Loop/styles.css +0 -41
- package/RTL/styles.css +0 -41
- package/RTLCustom/styles.css +0 -41
- package/RTLLoop/styles.css +0 -41
- package/RTLLoopLynxRTL/styles.css +0 -41
- package/WithGap/styles.css +0 -47
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
@import "@lynx-js/luna-styles/index.css";
|
|
2
|
+
|
|
3
|
+
.demo-container {
|
|
4
|
+
background-color: var(--canvas);
|
|
5
|
+
display: flex;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.demo-scroll-container {
|
|
13
|
+
background-color: var(--canvas);
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.expand {
|
|
19
|
+
flex: 1;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.top-area {
|
|
23
|
+
height: 54px;
|
|
24
|
+
width: 100%;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.content-area {
|
|
28
|
+
display: flex;
|
|
29
|
+
background: linear-gradient(
|
|
30
|
+
0deg,
|
|
31
|
+
var(--gradient-a),
|
|
32
|
+
var(--gradient-b)
|
|
33
|
+
);
|
|
34
|
+
padding-top: 96px;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
align-items: center;
|
|
38
|
+
row-gap: 24px;
|
|
39
|
+
padding-bottom: 12px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.content-area--compact {
|
|
43
|
+
padding-top: 48px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.operation {
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: row;
|
|
49
|
+
gap: 16px;
|
|
50
|
+
padding: 32px 16px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.sub-operation {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex: 1;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
gap: 8px;
|
|
58
|
+
padding: 0 16px 72px 16px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.demo-status {
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
gap: 4px;
|
|
65
|
+
padding: 12px 16px;
|
|
66
|
+
margin: 0 16px;
|
|
67
|
+
border-radius: 8px;
|
|
68
|
+
background-color: var(--neutral-ambient);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.demo-status-text {
|
|
72
|
+
color: var(--content-muted);
|
|
73
|
+
font-size: 12px;
|
|
74
|
+
line-height: 16px;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.demo-section {
|
|
78
|
+
padding: 0 16px 32px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.demo-section-title {
|
|
82
|
+
color: var(--content);
|
|
83
|
+
font-size: 16px;
|
|
84
|
+
font-weight: 600;
|
|
85
|
+
line-height: 20px;
|
|
86
|
+
margin-bottom: 8px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.demo-section-description {
|
|
90
|
+
color: var(--content-muted);
|
|
91
|
+
font-size: 12px;
|
|
92
|
+
line-height: 16px;
|
|
93
|
+
margin-bottom: 16px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.bounce-item {
|
|
97
|
+
display: flex;
|
|
98
|
+
height: 100%;
|
|
99
|
+
width: 72px;
|
|
100
|
+
align-items: center;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
border-width: 1px;
|
|
103
|
+
border-color: var(--line);
|
|
104
|
+
border-radius: 8px;
|
|
105
|
+
background-color: var(--neutral-ambient);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.bounce-item-text {
|
|
109
|
+
color: var(--content-muted);
|
|
110
|
+
font-size: 12px;
|
|
111
|
+
line-height: 16px;
|
|
112
|
+
text-align: center;
|
|
113
|
+
}
|
package/Custom/index.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
|
|
5
|
-
import { root, useRef } from '@lynx-js/react'
|
|
5
|
+
import { root, useRef, useState } from '@lynx-js/react'
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
Swiper,
|
|
@@ -12,9 +12,12 @@ import {
|
|
|
12
12
|
} from '@lynx-js/lynx-ui'
|
|
13
13
|
import type { SwiperRef } from '@lynx-js/lynx-ui'
|
|
14
14
|
|
|
15
|
-
import '
|
|
15
|
+
import { Card } from '../Common/Card'
|
|
16
|
+
import { Indicator } from '../Common/Indicator'
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
import '../Common/Demo/styles.css'
|
|
19
|
+
|
|
20
|
+
const itemArr: number[] = [1, 2, 3, 4, 5]
|
|
18
21
|
|
|
19
22
|
function customAnimation(value: number, _index: number) {
|
|
20
23
|
'main thread'
|
|
@@ -36,48 +39,47 @@ function customAnimationFirstScreen(value: number, _index: number) {
|
|
|
36
39
|
|
|
37
40
|
function SwiperEntry(): JSX.Element {
|
|
38
41
|
const swiperRef = useRef<SwiperRef>(null)
|
|
42
|
+
const [currentIndex, setCurrentIndex] = useState(0)
|
|
39
43
|
|
|
40
44
|
return (
|
|
41
|
-
<view
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
alignItems: 'center',
|
|
66
|
-
}}
|
|
67
|
-
>
|
|
68
|
-
<view
|
|
45
|
+
<view className='demo-container lunaris-dark'>
|
|
46
|
+
<view className='top-area' />
|
|
47
|
+
<view className='content-area'>
|
|
48
|
+
<Swiper
|
|
49
|
+
ref={swiperRef}
|
|
50
|
+
data={itemArr}
|
|
51
|
+
itemWidth={250}
|
|
52
|
+
duration={500}
|
|
53
|
+
initialIndex={0}
|
|
54
|
+
mode='normal'
|
|
55
|
+
modeConfig={{
|
|
56
|
+
align: 'center',
|
|
57
|
+
}}
|
|
58
|
+
onChange={setCurrentIndex}
|
|
59
|
+
main-thread:customAnimation={customAnimation}
|
|
60
|
+
customAnimationFirstScreen={customAnimationFirstScreen}
|
|
61
|
+
style={{
|
|
62
|
+
overflow: 'visible',
|
|
63
|
+
}}
|
|
64
|
+
>
|
|
65
|
+
{({ index }) => (
|
|
66
|
+
<SwiperItem>
|
|
67
|
+
<Card
|
|
68
|
+
index={index}
|
|
69
69
|
style={{
|
|
70
|
-
|
|
71
|
-
width: '4px',
|
|
72
|
-
height: '4px',
|
|
70
|
+
height: '250px',
|
|
73
71
|
}}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
/>
|
|
73
|
+
</SwiperItem>
|
|
74
|
+
)}
|
|
75
|
+
</Swiper>
|
|
76
|
+
<Indicator current={currentIndex} count={itemArr.length} />
|
|
77
|
+
</view>
|
|
78
|
+
<view className='demo-status'>
|
|
79
|
+
<text className='demo-status-text'>
|
|
80
|
+
Custom animation scales each slide around the active item.
|
|
81
|
+
</text>
|
|
82
|
+
</view>
|
|
81
83
|
</view>
|
|
82
84
|
)
|
|
83
85
|
}
|
package/CustomScale/index.tsx
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
|
|
5
|
-
import { root, useRef } from '@lynx-js/react'
|
|
5
|
+
import { root, useRef, useState } from '@lynx-js/react'
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
Swiper,
|
|
@@ -12,9 +12,12 @@ import {
|
|
|
12
12
|
} from '@lynx-js/lynx-ui'
|
|
13
13
|
import type { SwiperRef } from '@lynx-js/lynx-ui'
|
|
14
14
|
|
|
15
|
-
import '
|
|
15
|
+
import { Card } from '../Common/Card'
|
|
16
|
+
import { Indicator } from '../Common/Indicator'
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
import '../Common/Demo/styles.css'
|
|
19
|
+
|
|
20
|
+
const itemArr: number[] = [1, 2, 3, 4, 5]
|
|
18
21
|
|
|
19
22
|
const ITEM_WIDTH = 250
|
|
20
23
|
|
|
@@ -64,49 +67,48 @@ function customAnimationFirstScreen(value: number, _index: number) {
|
|
|
64
67
|
|
|
65
68
|
function SwiperEntry(): JSX.Element {
|
|
66
69
|
const swiperRef = useRef<SwiperRef>(null)
|
|
70
|
+
const [currentIndex, setCurrentIndex] = useState(0)
|
|
67
71
|
|
|
68
72
|
return (
|
|
69
|
-
<view
|
|
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
|
-
alignItems: 'center',
|
|
95
|
-
}}
|
|
96
|
-
>
|
|
97
|
-
<view
|
|
73
|
+
<view className='demo-container lunaris-dark'>
|
|
74
|
+
<view className='top-area' />
|
|
75
|
+
<view className='content-area'>
|
|
76
|
+
<Swiper
|
|
77
|
+
ref={swiperRef}
|
|
78
|
+
data={itemArr}
|
|
79
|
+
itemWidth={ITEM_WIDTH}
|
|
80
|
+
itemHeight={250}
|
|
81
|
+
duration={500}
|
|
82
|
+
initialIndex={0}
|
|
83
|
+
mode='custom'
|
|
84
|
+
modeConfig={{
|
|
85
|
+
align: 'center',
|
|
86
|
+
}}
|
|
87
|
+
onChange={setCurrentIndex}
|
|
88
|
+
main-thread:customAnimation={customAnimation}
|
|
89
|
+
customAnimationFirstScreen={customAnimationFirstScreen}
|
|
90
|
+
style={{
|
|
91
|
+
overflow: 'visible',
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
{({ index }) => (
|
|
95
|
+
<SwiperItem>
|
|
96
|
+
<Card
|
|
97
|
+
index={index}
|
|
98
98
|
style={{
|
|
99
|
-
|
|
100
|
-
width: '4px',
|
|
101
|
-
height: '4px',
|
|
99
|
+
height: '250px',
|
|
102
100
|
}}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
101
|
+
/>
|
|
102
|
+
</SwiperItem>
|
|
103
|
+
)}
|
|
104
|
+
</Swiper>
|
|
105
|
+
<Indicator current={currentIndex} count={itemArr.length} />
|
|
106
|
+
</view>
|
|
107
|
+
<view className='demo-status'>
|
|
108
|
+
<text className='demo-status-text'>
|
|
109
|
+
Custom mode keeps the active slide centered while scaling neighbors.
|
|
110
|
+
</text>
|
|
111
|
+
</view>
|
|
110
112
|
</view>
|
|
111
113
|
)
|
|
112
114
|
}
|
package/CustomTinder/index.tsx
CHANGED
package/CustomTinder/styles.css
CHANGED
|
@@ -2,32 +2,4 @@
|
|
|
2
2
|
// Licensed under the Apache License Version 2.0 that can be found in the
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
import { Button as ButtonInner } from '@lynx-js/lynx-ui'
|
|
7
|
-
|
|
8
|
-
const ButtonStyle = {
|
|
9
|
-
border: '1px solid',
|
|
10
|
-
'border-radius': '4px',
|
|
11
|
-
width: '150px',
|
|
12
|
-
'background-color': 'red',
|
|
13
|
-
margin: '4px 8px',
|
|
14
|
-
padding: '4px 8px',
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const ButtonTextStyle = {
|
|
18
|
-
color: 'white',
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function Button(props: {
|
|
22
|
-
onClick: () => void
|
|
23
|
-
text: string
|
|
24
|
-
}) {
|
|
25
|
-
return (
|
|
26
|
-
<ButtonInner
|
|
27
|
-
style={ButtonStyle}
|
|
28
|
-
onClick={props.onClick}
|
|
29
|
-
>
|
|
30
|
-
<text style={ButtonTextStyle}>{props.text}</text>
|
|
31
|
-
</ButtonInner>
|
|
32
|
-
)
|
|
33
|
-
}
|
|
5
|
+
export { Button } from '../Common/Button'
|
|
@@ -53,12 +53,12 @@ function SwiperEntry(): JSX.Element {
|
|
|
53
53
|
alignItems: 'end',
|
|
54
54
|
}}
|
|
55
55
|
>
|
|
56
|
-
{({ index
|
|
57
|
-
<SwiperItem
|
|
56
|
+
{({ index }) => (
|
|
57
|
+
<SwiperItem>
|
|
58
58
|
<Card
|
|
59
|
-
index={
|
|
59
|
+
index={index}
|
|
60
60
|
style={{
|
|
61
|
-
height: `${itemHeights[
|
|
61
|
+
height: `${itemHeights[index % itemHeights.length]}px`,
|
|
62
62
|
}}
|
|
63
63
|
/>
|
|
64
64
|
</SwiperItem>
|
package/Direction/index.tsx
CHANGED
|
@@ -6,118 +6,110 @@ import { root } from '@lynx-js/react'
|
|
|
6
6
|
|
|
7
7
|
import { Swiper, SwiperItem } from '@lynx-js/lynx-ui'
|
|
8
8
|
|
|
9
|
-
import '
|
|
9
|
+
import { Card } from '../Common/Card'
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
import '../Common/Demo/styles.css'
|
|
12
|
+
|
|
13
|
+
const itemArr: number[] = [1, 2, 3, 4]
|
|
14
|
+
|
|
15
|
+
function renderCard({
|
|
16
|
+
index,
|
|
17
|
+
}: {
|
|
18
|
+
index: number
|
|
19
|
+
}) {
|
|
20
|
+
return (
|
|
21
|
+
<SwiperItem>
|
|
22
|
+
<Card
|
|
23
|
+
index={index}
|
|
24
|
+
style={{
|
|
25
|
+
height: '200px',
|
|
26
|
+
}}
|
|
27
|
+
/>
|
|
28
|
+
</SwiperItem>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
12
31
|
|
|
13
32
|
function SwiperEntry() {
|
|
14
33
|
return (
|
|
15
|
-
<scroll-view
|
|
16
|
-
|
|
17
|
-
|
|
34
|
+
<scroll-view
|
|
35
|
+
className='demo-scroll-container lunaris-dark'
|
|
36
|
+
scroll-orientation='vertical'
|
|
37
|
+
>
|
|
38
|
+
<view className='top-area' />
|
|
39
|
+
<view className='demo-section'>
|
|
40
|
+
<text className='demo-section-title'>Horizontal Swipe Only</text>
|
|
41
|
+
<text className='demo-section-description'>
|
|
42
|
+
Swiper stays horizontal while the parent scroll-view moves vertically.
|
|
43
|
+
</text>
|
|
18
44
|
</view>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
}}
|
|
42
|
-
experimentalHorizontalSwipeOnly={true}
|
|
43
|
-
>
|
|
44
|
-
{({ item, index, realIndex }) => (
|
|
45
|
-
<SwiperItem index={index} key={realIndex} realIndex={realIndex}>
|
|
46
|
-
<view
|
|
47
|
-
class='block-view'
|
|
48
|
-
style={{
|
|
49
|
-
width: '100%',
|
|
50
|
-
height: '100%',
|
|
51
|
-
backgroundColor: item,
|
|
52
|
-
display: 'flex',
|
|
53
|
-
justifyContent: 'center',
|
|
54
|
-
alignItems: 'center',
|
|
55
|
-
}}
|
|
56
|
-
>
|
|
57
|
-
<view
|
|
58
|
-
style={{
|
|
59
|
-
backgroundColor: 'white',
|
|
60
|
-
width: '4px',
|
|
61
|
-
height: '4px',
|
|
62
|
-
}}
|
|
63
|
-
>
|
|
45
|
+
<view className='content-area content-area--compact'>
|
|
46
|
+
<Swiper
|
|
47
|
+
data={itemArr}
|
|
48
|
+
itemWidth={250}
|
|
49
|
+
itemHeight={200}
|
|
50
|
+
containerWidth={lynx.__globalProps.screenWidth - 32
|
|
51
|
+
|| SystemInfo.pixelWidth / SystemInfo.pixelRatio - 32}
|
|
52
|
+
loop={false}
|
|
53
|
+
duration={500}
|
|
54
|
+
initialIndex={0}
|
|
55
|
+
mode='normal'
|
|
56
|
+
modeConfig={{
|
|
57
|
+
align: 'start',
|
|
58
|
+
spaceBetween: 16,
|
|
59
|
+
}}
|
|
60
|
+
bounceConfig={{
|
|
61
|
+
enable: true,
|
|
62
|
+
startBounceItemWidth: 0,
|
|
63
|
+
endBounceItem: (
|
|
64
|
+
<view className='bounce-item'>
|
|
65
|
+
<text className='bounce-item-text'>End</text>
|
|
64
66
|
</view>
|
|
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
|
-
|
|
97
|
-
<view
|
|
98
|
-
class='block-view'
|
|
99
|
-
style={{
|
|
100
|
-
width: '100%',
|
|
101
|
-
height: '100%',
|
|
102
|
-
backgroundColor: item,
|
|
103
|
-
display: 'flex',
|
|
104
|
-
justifyContent: 'center',
|
|
105
|
-
alignItems: 'center',
|
|
106
|
-
}}
|
|
107
|
-
>
|
|
108
|
-
<view
|
|
109
|
-
style={{
|
|
110
|
-
backgroundColor: 'white',
|
|
111
|
-
width: '4px',
|
|
112
|
-
height: '4px',
|
|
113
|
-
}}
|
|
114
|
-
>
|
|
67
|
+
),
|
|
68
|
+
onEndBounceItemBounce: ({ type }) => {
|
|
69
|
+
console.log('onBounce result', type)
|
|
70
|
+
},
|
|
71
|
+
}}
|
|
72
|
+
experimentalHorizontalSwipeOnly={true}
|
|
73
|
+
style={{
|
|
74
|
+
overflow: 'visible',
|
|
75
|
+
}}
|
|
76
|
+
>
|
|
77
|
+
{renderCard}
|
|
78
|
+
</Swiper>
|
|
79
|
+
<Swiper
|
|
80
|
+
data={itemArr}
|
|
81
|
+
itemWidth={250}
|
|
82
|
+
itemHeight={200}
|
|
83
|
+
containerWidth={lynx.__globalProps.screenWidth - 32
|
|
84
|
+
|| SystemInfo.pixelWidth / SystemInfo.pixelRatio - 32}
|
|
85
|
+
loop={false}
|
|
86
|
+
duration={500}
|
|
87
|
+
initialIndex={0}
|
|
88
|
+
mode='normal'
|
|
89
|
+
modeConfig={{
|
|
90
|
+
align: 'start',
|
|
91
|
+
spaceBetween: 16,
|
|
92
|
+
}}
|
|
93
|
+
bounceConfig={{
|
|
94
|
+
enable: true,
|
|
95
|
+
startBounceItemWidth: 0,
|
|
96
|
+
endBounceItem: (
|
|
97
|
+
<view className='bounce-item'>
|
|
98
|
+
<text className='bounce-item-text'>End</text>
|
|
115
99
|
</view>
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
100
|
+
),
|
|
101
|
+
onEndBounceItemBounce: ({ type }) => {
|
|
102
|
+
console.log('onBounce result', type)
|
|
103
|
+
},
|
|
104
|
+
}}
|
|
105
|
+
experimentalHorizontalSwipeOnly={true}
|
|
106
|
+
style={{
|
|
107
|
+
overflow: 'visible',
|
|
108
|
+
}}
|
|
109
|
+
>
|
|
110
|
+
{renderCard}
|
|
111
|
+
</Swiper>
|
|
112
|
+
</view>
|
|
121
113
|
</scroll-view>
|
|
122
114
|
)
|
|
123
115
|
}
|