|
|
@@ -0,0 +1,203 @@
|
|
|
+/* eslint-disable no-underscore-dangle */
|
|
|
+import * as WebBrowser from "expo-web-browser";
|
|
|
+import * as React from "react";
|
|
|
+import { StyleSheet, View } from "react-native";
|
|
|
+import { useModel, setModel } from "flooks";
|
|
|
+import { useTheme, Text, Button, Layout } from "@ui-kitten/components";
|
|
|
+import { useFocusEffect } from "@react-navigation/native";
|
|
|
+import verifiedModel from "../../models/verifiedModel";
|
|
|
+import NavHeaderBar from "../../components/NavHeaderBar";
|
|
|
+import UpLoadImage from "../../components/UpLoadImage";
|
|
|
+import FormInput from "../../components/FormInput";
|
|
|
+import ListUtil from "../../Utils/ListUtil";
|
|
|
+import ScrollPage from "../../components/ScrollPage";
|
|
|
+
|
|
|
+setModel("verifiedModel", verifiedModel);
|
|
|
+
|
|
|
+const styles = StyleSheet.create({
|
|
|
+ container: {
|
|
|
+ flex: 1,
|
|
|
+ paddingTop: 10,
|
|
|
+ paddingBottom: 33,
|
|
|
+ paddingHorizontal: 20,
|
|
|
+ },
|
|
|
+ imgList: {
|
|
|
+ flexDirection: "row",
|
|
|
+ justifyContent: "space-around",
|
|
|
+ },
|
|
|
+ imgItem: {
|
|
|
+ paddingVertical: 10,
|
|
|
+ alignItems: "center",
|
|
|
+ },
|
|
|
+ text: {
|
|
|
+ paddingVertical: 15,
|
|
|
+ },
|
|
|
+ btn: {
|
|
|
+ marginVertical: 30,
|
|
|
+ alignItems: "center",
|
|
|
+ },
|
|
|
+ tips: {
|
|
|
+ paddingVertical: 20,
|
|
|
+ paddingHorizontal: 40,
|
|
|
+ },
|
|
|
+});
|
|
|
+
|
|
|
+export default function LegalPersonScreen({ navigation }) {
|
|
|
+ const theme = useTheme();
|
|
|
+ const { changeBackground } = useModel("barModel", true);
|
|
|
+ const { mid } = useModel("userModel");
|
|
|
+ const { success } = useModel("loadingModel", true);
|
|
|
+
|
|
|
+ const {
|
|
|
+ getVerfied,
|
|
|
+ verifiedInfo,
|
|
|
+ registerVerifiedInfo,
|
|
|
+ saveVeriFied,
|
|
|
+ } = useModel("verifiedModel");
|
|
|
+
|
|
|
+ const [realName, setRealName] = React.useState("");
|
|
|
+ const [idNo, setIdNo] = React.useState("");
|
|
|
+ const [idNoImgBefore, setIdNoImgBefore] = React.useState("");
|
|
|
+ const [idNoImgAfter, setIdNoImgAfter] = React.useState("");
|
|
|
+ const [handheldIdNo, setHandheldIdNo] = React.useState("");
|
|
|
+ useFocusEffect(
|
|
|
+ React.useCallback(() => {
|
|
|
+ changeBackground(theme["color-primary-500"]);
|
|
|
+ getVerfied().then(() => {
|
|
|
+ if (mid) {
|
|
|
+ setRealName(verifiedInfo.realName || "");
|
|
|
+ setIdNo(verifiedInfo.idNo || "");
|
|
|
+ const _imgList = new ListUtil(verifiedInfo.idNoImg || "");
|
|
|
+ _imgList.getOneTow(setIdNoImgBefore, setIdNoImgAfter);
|
|
|
+ setHandheldIdNo(verifiedInfo.handheldIdNo || "");
|
|
|
+ } else {
|
|
|
+ setRealName(registerVerifiedInfo.realName || "");
|
|
|
+ setIdNo(registerVerifiedInfo.idNo || "");
|
|
|
+ const _imgList = new ListUtil(registerVerifiedInfo.idNoImg || "");
|
|
|
+ _imgList.getOneTow(setIdNoImgBefore, setIdNoImgAfter);
|
|
|
+ setHandheldIdNo(registerVerifiedInfo.handheldIdNo || "");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }, [])
|
|
|
+ );
|
|
|
+
|
|
|
+ const canSubmit = React.useMemo(() => {
|
|
|
+ if (realName && idNo && idNoImgBefore && idNoImgAfter && handheldIdNo) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }, [realName, idNo, idNoImgBefore, idNoImgAfter, handheldIdNo]);
|
|
|
+
|
|
|
+ function submit() {
|
|
|
+ const _imgList = new ListUtil([idNoImgBefore, idNoImgAfter]);
|
|
|
+ const idNoImg = _imgList.getListValue();
|
|
|
+ saveVeriFied({ realName, idNo, idNoImg, handheldIdNo }).then(() => {
|
|
|
+ success("设置成功");
|
|
|
+ navigation.goBack();
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ return (
|
|
|
+ <>
|
|
|
+ <NavHeaderBar title="编辑法人信息" />
|
|
|
+ <ScrollPage>
|
|
|
+ <Layout style={styles.container}>
|
|
|
+ <FormInput
|
|
|
+ key="realName"
|
|
|
+ label="法人姓名:"
|
|
|
+ placeholder="输入姓名"
|
|
|
+ value={realName}
|
|
|
+ onChange={setRealName}
|
|
|
+ textAlign="right"
|
|
|
+ style={{ paddingVertical: 5 }}
|
|
|
+ labelStyle={{ width: 100 }}
|
|
|
+ />
|
|
|
+ <FormInput
|
|
|
+ key="idNo"
|
|
|
+ label="法人证件号码:"
|
|
|
+ placeholder="输入证件号码"
|
|
|
+ value={idNo}
|
|
|
+ onChange={setIdNo}
|
|
|
+ textAlign="right"
|
|
|
+ style={{ paddingVertical: 5 }}
|
|
|
+ labelStyle={{ width: 100 }}
|
|
|
+ />
|
|
|
+ <FormInput
|
|
|
+ key="idNoImg"
|
|
|
+ label="证件原件照片:"
|
|
|
+ type="label"
|
|
|
+ textAlign="right"
|
|
|
+ style={{ paddingVertical: 5 }}
|
|
|
+ labelStyle={{ width: 100 }}
|
|
|
+ />
|
|
|
+
|
|
|
+ <View style={styles.imgList}>
|
|
|
+ <View style={styles.imgItem}>
|
|
|
+ <UpLoadImage
|
|
|
+ key="before"
|
|
|
+ value={idNoImgBefore}
|
|
|
+ changeIcon={setIdNoImgBefore}
|
|
|
+ size={67}
|
|
|
+ />
|
|
|
+ <Text category="c1" status="info" style={styles.text}>
|
|
|
+ 证件正面
|
|
|
+ </Text>
|
|
|
+ </View>
|
|
|
+ <View style={styles.imgItem}>
|
|
|
+ <UpLoadImage
|
|
|
+ key="after"
|
|
|
+ value={idNoImgAfter}
|
|
|
+ changeIcon={setIdNoImgAfter}
|
|
|
+ size={67}
|
|
|
+ />
|
|
|
+ <Text category="c1" status="info" style={styles.text}>
|
|
|
+ 证件反面
|
|
|
+ </Text>
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ <FormInput
|
|
|
+ key="handheldIdNo"
|
|
|
+ label="手持证件照片:"
|
|
|
+ type="label"
|
|
|
+ textAlign="right"
|
|
|
+ style={{ paddingVertical: 5 }}
|
|
|
+ labelStyle={{ width: 100 }}
|
|
|
+ />
|
|
|
+ <View style={styles.imgList}>
|
|
|
+ <View style={styles.imgItem}>
|
|
|
+ <UpLoadImage
|
|
|
+ key="handheldIdNo"
|
|
|
+ value={handheldIdNo}
|
|
|
+ changeIcon={setHandheldIdNo}
|
|
|
+ size={67}
|
|
|
+ />
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ <View style={styles.btn}>
|
|
|
+ <Button onPress={submit} disabled={!canSubmit}>
|
|
|
+ 上传
|
|
|
+ </Button>
|
|
|
+ </View>
|
|
|
+ </Layout>
|
|
|
+ <View style={styles.tips}>
|
|
|
+ <Text category="c1" status="info">
|
|
|
+ 提示:
|
|
|
+ </Text>
|
|
|
+ <Text category="c1" status="info">
|
|
|
+ 1、需上传法人证件原件正反面图片。
|
|
|
+ </Text>
|
|
|
+ <Text category="c1" status="info">
|
|
|
+ 2、需保证证件内容清晰。
|
|
|
+ </Text>
|
|
|
+ <Text category="c1" status="info">
|
|
|
+ 3、证件需在有效使用期内。
|
|
|
+ </Text>
|
|
|
+ <Text category="c1" status="info">
|
|
|
+ 4、法人本人手持证件照需保证证件信息清晰,手持证件人的五官清晰可见,照片内容真实有效,不
|
|
|
+ 得做任何修改。
|
|
|
+ </Text>
|
|
|
+ </View>
|
|
|
+ </ScrollPage>
|
|
|
+ </>
|
|
|
+ );
|
|
|
+}
|