样品对比100%

This commit is contained in:
Haiyi 2022-06-29 13:46:44 +08:00
parent d734720dd1
commit 598fc7a81f

View File

@ -76,8 +76,11 @@ export default () => {
setBlueToothColorTwo('')
setTime('')
setTime('')
setData('')
setResult('')
}
const [data, setData] = useState('')
const [result, setResult] = useState('')
const { fetchData } = productabsorbcontrast()
const handTake = async () => {
if (searchField.l1 === '') {
@ -99,7 +102,17 @@ export default () => {
}
const res = await fetchData(query)
if (res.data) {
setData(res.data)
let diffarray = [
res.data.reddish && "偏红",
res.data.yellowish && "偏黄",
res.data.greenish && "偏绿",
res.data.bluish && "偏蓝",
res.data.whitish && "偏亮",
res.data.darker && "偏暗",
];
let resCont = diffarray.filter(item => item).join(",");
setResult(resCont)
}
}
return (
@ -155,8 +168,15 @@ export default () => {
<View className={styles.reslutBox}>
<View className={styles.reslutTitle}>
<View className={styles.titleLeft}></View>
{/* <View className={styles.titleRiht}>不合格</View> */}
<View className={styles.titleRiht1}></View>
{
(data as any).ciede_2000 >= 1 &&
<View className={styles.titleRiht}></View>
}
{
(data as any).ciede_2000 <= 1 &&
<View className={styles.titleRiht1}></View>
}
</View>
{
data === '' &&
@ -166,7 +186,14 @@ export default () => {
data &&
<View className={styles.notBox}>
<View className={styles.notLeft}>: {(data as any).ciede_2000}</View>
<View className={styles.notright}></View>
{
!(data as any).reddish && !(data as any).yellowish && !(data as any).greenish && !(data as any).bluish && !(data as any).whitish && !(data as any).darker &&
<View className={styles.notright}></View>
}
{
result &&
<View className={styles.notright}>{result}</View>
}
</View>
}
</View>