diff --git a/src/pages/certification/index.tsx b/src/pages/certification/index.tsx index da5912b..bc53251 100644 --- a/src/pages/certification/index.tsx +++ b/src/pages/certification/index.tsx @@ -36,7 +36,7 @@ export default () => { business_license_url: "", legal_person: "", legal_person_identity: "", - businessLicense: '', + business_license: '', legal_person_identity_url: [], name: "" }); @@ -47,6 +47,9 @@ export default () => { name: [{ message: "请输入企业名称" }], + business_license: [{ + message: "请输入企业营业执照" + }], business_license_url: [{ message: "请上传营业执照" }], @@ -132,7 +135,7 @@ export default () => { setFormData({ ...formData, name: ev.detail.value })} value={formData["name"]} label="企业名称" placeholder="请输入营业执照上的企业名称" required /> {/* */} - setFormData({ ...formData, businessLicense: ev.detail.value })} value={formData["businessLicense"]} style={{ border: "0" }} label="企业营业执照" placeholder="注册号、统一社会信用代码、组织机构代码" required /> + setFormData({ ...formData, business_license: ev.detail.value })} value={formData["business_license"]} style={{ border: "0" }} label="企业营业执照" placeholder="注册号、统一社会信用代码、组织机构代码" required /> handleUploadImage("business_license_url")} className="certification-upload"> {(formData as any)?.business_license_url ? <> diff --git a/src/pages/sampleComparison/index.tsx b/src/pages/sampleComparison/index.tsx index 6639e3a..6dc80ff 100644 --- a/src/pages/sampleComparison/index.tsx +++ b/src/pages/sampleComparison/index.tsx @@ -18,11 +18,11 @@ export default () => { a2: '', b2: '', }) - - const [colorList, setColorList] = useState({ - one: null, - two: null - }) + type ColorList = { + one?: any, + two?: any + } + const [colorList, setColorList] = useState() const { state: colorState, measureAndGetLab } = useBluetooth() const getLab = async (val) => { @@ -57,25 +57,28 @@ export default () => { useEffect(() => { if (colorState.deviceLab) { - if (colorList.one?.constructor === Object) { - const rgb = toRgb([colorList.one.L, colorList.one.a, colorList.one.b]) + if ((colorList as any).one?.constructor === Object) { + const rgb = toRgb([(colorList as any).one.L, (colorList as any).one.a, (colorList as any).one.b]) setBlueToothColor(`rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`) setTime(getNowTime()) setSearchField({ ...searchField, l1: rgb[0], a1: rgb[1], b1: rgb[2] }) } - if (colorList.two?.constructor === Object) { - const rgb = toRgb([colorList.two.L, colorList.two.a, colorList.two.b]) + if ((colorList as any).two?.constructor === Object) { + + const rgb = toRgb([(colorList as any).two.L, (colorList as any).two.a, (colorList as any).two.b]) setBlueToothColorTwo(`rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`) setTimeTwo(getNowTime()) setSearchField({ ...searchField, l2: rgb[0], a2: rgb[1], b2: rgb[2] }) + } } }, [colorList]) const reset = () => { + setColorList({}) setBlueToothColor('') setBlueToothColorTwo('') setTime('') - setTime('') + setTimeTwo('') setData('') setResult('') }