🌈 style(销售详情): 解决eslint的报错❌

This commit is contained in:
xuan
2022-12-08 20:06:35 +08:00
parent 5d0dc586d2
commit 9cebc040b6
3 changed files with 50 additions and 44 deletions
+11 -12
View File
@@ -19,14 +19,9 @@ interface Props {
popupClose: () => void
}
const codeList = (props: Props) => {
const CodeList = (props: Props) => {
const { fetchData: payFetch } = GetPayCode()
const [PicUrl, setPicUrl] = useState<string>('')
useEffect(() => {
// 判断进来的是否是空对象,减少性能问题
const length = Object.keys(props.obj)
if (length.length > 0) { getPic() }
}, [props.obj])
const getPic = async() => {
Taro.showLoading({
@@ -131,10 +126,6 @@ const codeList = (props: Props) => {
// 检查是否开启保存图片权限
const { check } = useCheckAuthorize({ scope: 'scope.writePhotosAlbum', msg: '您没授权,无法保存图片' })
const saveImageCheck = async() => {
const res = await check()
res && saveImage()
}
// 保存图片
const saveImage = () => {
@@ -160,7 +151,15 @@ const codeList = (props: Props) => {
},
})
}
const saveImageCheck = async() => {
const res = await check()
res && saveImage()
}
useEffect(() => {
// 判断进来的是否是空对象,减少性能问题
const length = Object.keys(props.obj)
if (length.length > 0) { getPic() }
}, [props.obj])
return (
<Popup show={props.showPopup} title="销售码单" onClose={() => props.popupClose?.()}>
<View className={styles.popupBox}>
@@ -175,4 +174,4 @@ const codeList = (props: Props) => {
)
}
export default memo(codeList)
export default memo(CodeList)