🌈 style(typos): 修复eslint的报错❌
This commit is contained in:
@@ -4,7 +4,7 @@ import classnames from 'classnames'
|
||||
import { memo, useEffect, useRef, useState } from 'react'
|
||||
import styles from './index.module.scss'
|
||||
import Popup from '@/components/popup'
|
||||
import type { Params as PopuParams } from '@/components/popup'
|
||||
import type { Params as PopuParams } from '@/components/popup'
|
||||
import { GetProductKindListApi } from '@/api/material'
|
||||
|
||||
type params = {
|
||||
@@ -83,7 +83,7 @@ export default memo(({ onClose, onFiltr, show = false, onRest }: params) => {
|
||||
<View
|
||||
key={item.id}
|
||||
onClick={() => changeKind(item)}
|
||||
className={classnames(styles.btn_item, filterObj.seriesId == item.id && styles.select_btn_item)}
|
||||
className={classnames(styles.btn_item, filterObj.seriesId == item.id && styles.select_btn_item)}
|
||||
>
|
||||
{item.name}
|
||||
</View>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Taro from '@tarojs/taro'
|
||||
import { Image, Text, View } from '@tarojs/components'
|
||||
import { FC, memo, useEffect, useState } from 'react'
|
||||
import type { FC } from 'react'
|
||||
import { memo, useEffect, useState } from 'react'
|
||||
import classnames from 'classnames'
|
||||
import styles from './index.module.scss'
|
||||
import useUploadCDNImg from '@/use/useUploadImage'
|
||||
@@ -12,7 +13,7 @@ interface ImageParam {
|
||||
defaultList?: string[]
|
||||
onlyRead?: false | true
|
||||
}
|
||||
const PictureItem: FC<ImageParam> = memo(({ onChange, defaultList, onlyRead = false }) => {
|
||||
const PictureItem = ({ onChange, defaultList, onlyRead = false }: ImageParam) => {
|
||||
const { getWxPhoto } = useUploadCDNImg()
|
||||
const [imageList, setImageLise] = useState<string[]>([])
|
||||
|
||||
@@ -24,7 +25,7 @@ const PictureItem: FC<ImageParam> = memo(({ onChange, defaultList, onlyRead = fa
|
||||
const uploadImage = async() => {
|
||||
const list: any = await getWxPhoto('after-sale', 5)
|
||||
const images: any[] = []
|
||||
list?.map((item) => {
|
||||
list?.forEach((item) => {
|
||||
images.push(item.url)
|
||||
})
|
||||
setImageLise([...imageList, ...images])
|
||||
@@ -53,7 +54,7 @@ const PictureItem: FC<ImageParam> = memo(({ onChange, defaultList, onlyRead = fa
|
||||
return (
|
||||
<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)} className={classnames(styles.miconfont_close, 'iconfont icon-qingkong')}></View>}
|
||||
</View>
|
||||
@@ -66,6 +67,6 @@ const PictureItem: FC<ImageParam> = memo(({ onChange, defaultList, onlyRead = fa
|
||||
)}
|
||||
</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
export default PictureItem
|
||||
export default memo(PictureItem)
|
||||
|
||||
Reference in New Issue
Block a user