import Popup from "@/components/popup"; import { ScrollView, Text, View } from "@tarojs/components"; import { memo, useMemo } from "react"; import classnames from "classnames"; import styles from './index.module.scss' //原因选择 type ReasonInfoParam = { show?: boolean, //显示 onClose?: () => void, //关闭 title?: string, //标题 list?: {id:number, name:string, typle?:number}[], //数据列表 onSelect?: (val: object) => void, //选择 defaultValue?: number, //默认选中 } export default memo(({show = false, onClose, title = '', list= [], onSelect, defaultValue}: ReasonInfoParam) => { return ( {title} {list.map(item => onSelect?.(item)} key={item.id} className={classnames(styles.reason_item, item.id == defaultValue&&styles.select_item)}>{item.name} )} ) })