index.js 1.14 KB
import Taro, {Component} from '@tarojs/taro';
import {Swiper, SwiperItem, Navigator, Image} from '@tarojs/components';
import {getImgUrl} from '../../utils';
import './index.scss';

export default class Focus extends Component {
    constructor(props) {
        super(props);

        this.state = {};
    }

    static defaultProps = {
        floor: []
    }

    componentWillMount() {}

    componentDidMount() {}

    componentWillUnmount() {}

    componentDidShow() {}

    componentDidHide() {}

    render() {
        let {floor} = this.props;

        return (
            <Swiper
                className='index-swiper'
            >
                {
                    floor.map((item, index) => {
                        return (
                            <SwiperItem key={index}>
                                <Navigator url={item.url} hover-class="none">
                                    <Image src={getImgUrl(item.src, 670, 280)} mode="aspectFill" />
                                </Navigator>
                            </SwiperItem>
                        )
                    })
                }
            </Swiper>
        )
    }
}