Goods.jsx 1.27 KB
Newer Older
熊成伟's avatar
熊成伟 committed
1 2 3 4
import React from 'react';
import './index.less'

const Index = (props) => {
熊成伟's avatar
熊成伟 committed
5
    const {data, list, onClick} = props;
熊成伟's avatar
熊成伟 committed
6 7 8
    return (
        <div className="address-box">
            {data && data.length > 0 && data.map((item, index) => (
熊成伟's avatar
熊成伟 committed
9 10
                <div key={index} className="good-item">
                    <div className="address-item address-title" onClick={() => onClick(item.BGYPMC)}>
熊成伟's avatar
熊成伟 committed
11 12
                        {list.length > 0 && list[0].showName}{list.length > 0 && item[list[0].colName]}
                        {/*{list[0] && list[0].showName}:{item[list[0].showName] || ''}*/}
熊成伟's avatar
熊成伟 committed
13 14 15
                        <img src="/img/rarrow.png" alt="" className={`icon18 ${item.checked ? 'icon-checked' : 'icon-unchecked'}`}/>
                    </div>
                    { item.checked && (
熊成伟's avatar
熊成伟 committed
16
                        <div>
熊成伟's avatar
熊成伟 committed
17 18 19 20 21
                            {list.length > 1 && list.map((child, index2) => index2 > 0 && (
                                <div key={index2} className="address-item address-title">
                                    {child.showName}{item[child.colName] || ''}
                                </div>
                            ))}
熊成伟's avatar
熊成伟 committed
22 23 24 25 26 27 28 29 30 31
                        </div>
                    )}

                </div>
            ))}
        </div>
    );
};

export default Index;