import { Text, View } from '@tarojs/components'
import styles from './index.module.scss'
import IconFont from '@/components/iconfont/iconfont'
import { goLink } from '@/common/common'
import NameLabel from '@/components/nameLabel'

export interface CompanyItem { title: string; purchaser_name: string; id: number; phone: string }
export interface CompanyParam {
  value: CompanyItem
  onClick?: (val: CompanyItem) => void
}
export default (props: CompanyParam) => {
  const { value, onClick } = props
  return <View className={styles.company_item} onClick={() => onClick?.(value)}>
    <NameLabel name={value.title} />
    <View className={styles.desc}>
      <Text>{value?.title }</Text>
      <Text>{`${value?.purchaser_name} ${value?.phone}`}</Text>
    </View>
    <View className={styles.company_icon}><IconFont name="icon-xiala" size={43} /></View>
  </View>
}
