|
@@ -13,21 +13,21 @@ export default class SwiperBanner extends Component {
|
13
|
13
|
height: '200px'
|
14
|
14
|
},
|
15
|
15
|
onClick: function () { },
|
16
|
|
-
|
|
16
|
+
|
17
|
17
|
}
|
18
|
18
|
|
19
|
19
|
changeCurrent (event) {
|
20
|
|
- const { isChange } = this.props
|
|
20
|
+ // const { isChange } = this.props
|
21
|
21
|
const current = event.detail.current
|
22
|
|
- console.log(isChange,'4444444')
|
23
|
|
- if(isChange){
|
24
|
22
|
|
25
|
|
- this.props.onChange(current)
|
26
|
|
- }
|
27
|
|
-
|
28
|
|
- // this.props.onChange||C
|
29
|
|
-
|
30
|
|
-
|
|
23
|
+ // if(isChange){
|
|
24
|
+
|
|
25
|
+ // this.props.onChange(current)
|
|
26
|
+ // }
|
|
27
|
+
|
|
28
|
+ this.props.onChange && this.props.onChange(current)
|
|
29
|
+
|
|
30
|
+
|
31
|
31
|
}
|
32
|
32
|
|
33
|
33
|
onBannerClick (item) {
|
|
@@ -36,7 +36,7 @@ export default class SwiperBanner extends Component {
|
36
|
36
|
render () {
|
37
|
37
|
const { list, style, indicatorDots, current } = this.props
|
38
|
38
|
|
39
|
|
- console.log('banner',list)
|
|
39
|
+ console.log('banner', list)
|
40
|
40
|
return (
|
41
|
41
|
<View className='home-banner' style={style}>
|
42
|
42
|
<Swiper
|
|
@@ -49,7 +49,7 @@ export default class SwiperBanner extends Component {
|
49
|
49
|
>
|
50
|
50
|
{list.map((item, index) => (
|
51
|
51
|
<SwiperItem
|
52
|
|
- key={index+'swiper'}
|
|
52
|
+ key={index + 'swiper'}
|
53
|
53
|
onClick={this.onBannerClick.bind(this, item)}
|
54
|
54
|
className='home-banner__swiper-item'
|
55
|
55
|
>
|