import { Image, View } from "@tarojs/components"
import Taro from "@tarojs/taro"
import { goLink } from "@/common/common"
import styles  from './index.module.scss'

type Params = {
    desStatus?: true|false,
    productList?: any[]
}
export default ({desStatus = true, productList = []}:Params) => {
    return (
        <View className={styles.products_list}>
            {productList?.map(item => {
                return <View className={styles.products_item} onClick={() => goLink(`/pages/details/index?id=${item.id}`)}>
                    <View className={styles.item_img}>
                        <Image src={item.texture_url}/>
                        <View className={styles.num}>{item.product_color_count}色</View>
                    </View>
                    <View className={styles.item_con}>
                    <View className={styles.title}><text>{item.code}#</text>{item.name}</View>
                    <View className={styles.tag_list}>
                        <View className={styles.tag}>{item.width}</View>
                        <View className={styles.tag}>{item.weight_density}</View>
                    </View>
                    <View className={styles.introduce}>{item.component}</View>
                    {desStatus&&<View className={styles.des}>{item.describe}</View>}
                    </View>
                </View>
            })}
        </View>
    )
}
