🐳 chore(eslint): 修正所有文件的eslint 错误❌

This commit is contained in:
xuan
2022-11-28 11:06:15 +08:00
parent 99a920975f
commit cc99111b4f
149 changed files with 3270 additions and 3252 deletions
+13 -13
View File
@@ -13,11 +13,13 @@ interface ImageParam {
defaultList?: string[]
onlyRead?: boolean
}
const PictureItem = memo<ImageParam>(({ onChange, defaultList, onlyRead = false }) => {
const PictureItem = ({ onChange, defaultList, onlyRead = false }: ImageParam) => {
const { getWxPhoto, getChatPhoto } = useUploadCDNImg()
const [imageList, setImageLise] = useState<string[]>([])
// 筛选内容展示
const [showPopup, setshowPopup] = useState(false)
const [List, setList] = useState<any[]>([{ id: 1, name: '手机相册', check: false }, { id: 2, name: '从微信对话选择', check: false }])
useEffect(() => {
setImageLise(defaultList || [])
}, [defaultList])
@@ -29,17 +31,18 @@ const PictureItem = memo<ImageParam>(({ onChange, defaultList, onlyRead = false
// 上传图片逻辑
const handPic = async(id) => {
let list: any
// let resArr = List.filter(item => {
// return item.check
// })
if (id == 1) {
var list: any = await getWxPhoto('after-sale', 5)
}
list = await getWxPhoto('after-sale', 5)
}
else {
var list: any = await getChatPhoto('after-sale', 5)
list = await getChatPhoto('after-sale', 5)
}
const images: any[] = []
list?.map((item) => {
list?.forEach((item) => {
images.push(item.url)
})
setImageLise([...imageList, ...images])
@@ -67,15 +70,12 @@ const PictureItem = memo<ImageParam>(({ onChange, defaultList, onlyRead = false
})
}
// 筛选内容展示
const [showPopup, setshowPopup] = useState(false)
const [List, setList] = useState<any[]>([{ id: 1, name: '手机相册', check: false }, { id: 2, name: '从微信对话选择', check: false }])
// 点击选择的方式
const handItem = (item) => {
List.map((it) => {
if (item.id == it.id) {
it.check = true
}
}
else {
it.check = false
}
@@ -89,7 +89,7 @@ const PictureItem = memo<ImageParam>(({ onChange, defaultList, onlyRead = false
<>
<View className={styles.image_main}>
{imageList?.map((item, index) => (
<View className={styles.ImgItem}>
<View className={styles.ImgItem} key={index}>
<Image mode="aspectFill" src={formatImgUrl(item)} onClick={showImage}></Image>
{!onlyRead && <View onClick={() => delImage(index)}>
<IconFont name="icon-guanbi" size={30} customClassName={styles.miconfont_close} color="#ffffff"></IconFont>
@@ -119,6 +119,6 @@ const PictureItem = memo<ImageParam>(({ onChange, defaultList, onlyRead = false
</Popup>
</>
)
})
}
export default PictureItem
export default memo<ImageParam>(PictureItem)