panhui 5 years ago
parent
commit
69ac29f175

+ 5 - 2
App.js

@@ -132,7 +132,7 @@ export default function App(props) {
               setInit("StoreAudit");
               break;
             default:
-              setInit("Guide1");
+              setInit("");
               break;
           }
         })
@@ -166,7 +166,10 @@ export default function App(props) {
     }
   }, [initRouteName]);
 
-  if (!isLoadingComplete && !props.skipLoadingScreen && initRouteName !== "") {
+  if (
+    (!isLoadingComplete && !props.skipLoadingScreen) ||
+    initRouteName === ""
+  ) {
     return null;
   }
   return (

+ 54 - 15
Utils/ListUtil.js

@@ -1,23 +1,62 @@
+/* eslint-disable prefer-destructuring */
 /* eslint-disable no-underscore-dangle */
 export default class ListUtil {
-    constructor(list) {
-        if (list && list.constructor === String) {
-            this.list = list.split(",");
-        } else {
-            this.list = list || [];
-        }
+  constructor(list) {
+    if (list && list.constructor === String) {
+      this.list = list.split(",");
+    } else {
+      this.list = list || [];
     }
+  }
 
-    getLength() {
-        return this.list.length;
+  getLength() {
+    return this.list.length;
+  }
+
+  // 获取正反面照片
+  getOneTow(one, tow) {
+    const _list = [...this.list];
+    let oneVal = "";
+    let towVal = "";
+    if (_list.length > 0) {
+      oneVal = _list[0];
+    }
+    if (_list.length > 1) {
+      towVal = _list[1];
+    }
+
+    if (one) {
+      one(oneVal);
+    }
+    if (tow) {
+      tow(towVal);
+    }
+  }
+
+  setImgVal(list) {
+    const _list = [...this.list];
+    _list.forEach((item, index) => {
+      if (list[index]) {
+        list[index](item);
+      }
+    });
+  }
+
+  getKey(key) {
+    const _list = [...this.list];
+    if (_list.length > 0) {
+      return _list.pop()[key];
     }
+    return "";
+  }
 
-    getKey(key) {
-        const _list = [...this.list];
-        if (_list.length > 0) {
-            return _list.pop()[key];
-        } 
-            return "";
-        
+  getListValue(key) {
+    let _list = [...this.list];
+    if (key) {
+      _list = _list.map(item => {
+        return item[key];
+      });
     }
+    return _list.join(",");
+  }
 }

+ 3 - 0
components/FormInput.js

@@ -324,6 +324,9 @@ const FormInput = React.memo(props => {
         />
       );
     }
+    if (type === "label") {
+      return null;
+    }
     return <Input {...inputProps} size="small" style={styles.input} />;
   }
 

+ 63 - 67
components/UpLoadImage.js

@@ -3,81 +3,78 @@
 /* eslint-disable prefer-promise-reject-errors */
 /* eslint-disable no-underscore-dangle */
 import React from "react";
-import { Button,  Icon } from "@ui-kitten/components";
+import { Button, Icon } from "@ui-kitten/components";
 import { useModel } from "flooks";
 import * as ImagePicker from "expo-image-picker";
 import { Image, Platform } from "react-native";
 
-
-
 const _pickImage = () => {
-    return new Promise(async (resolve, reject) => {
-        try {
-            const permissionResult = await ImagePicker.requestCameraRollPermissionsAsync();
+  return new Promise(async (resolve, reject) => {
+    try {
+      const permissionResult = await ImagePicker.requestCameraRollPermissionsAsync();
 
-            if (permissionResult.granted === false) {
-                reject("notAllod");
-            } else {
-                const result = await ImagePicker.launchImageLibraryAsync({
-                    mediaTypes: ImagePicker.MediaTypeOptions.Images,
-                    allowsEditing: true,
-                    aspect: [1, 1],
-                    quality: 1,
-                    base64: true,
-                });
-                if (!result.cancelled) {
-                    if (Platform.OS === "web") {
-                        resolve(result.uri);
-                    } else {
-                        resolve(result.base64);
-                    }
-                }
-            }
-        } catch (e) {
-            reject(e);
+      if (permissionResult.granted === false) {
+        reject("notAllod");
+      } else {
+        const result = await ImagePicker.launchImageLibraryAsync({
+          mediaTypes: ImagePicker.MediaTypeOptions.Images,
+          allowsEditing: true,
+          aspect: [1, 1],
+          quality: 1,
+          base64: true,
+        });
+        if (!result.cancelled) {
+          if (Platform.OS === "web") {
+            resolve(result.uri);
+          } else {
+            resolve(result.base64);
+          }
         }
-    });
+      }
+    } catch (e) {
+      reject(e);
+    }
+  });
 };
 
-export default function UpLoadImage(props) {    
-	const { httpPost } = useModel("httpModel", true);
-    // eslint-disable-next-line no-shadow
-    const renderPulseIcon = (props) => <Icon {...props} name='plus-outline' />;
+export default function UpLoadImage(props) {
+  const { httpPost } = useModel("httpModel", true);
+  // eslint-disable-next-line no-shadow
+  const renderPulseIcon = props => <Icon {...props} name="plus-outline" />;
 
-    return (
-      <>
-        <Button
-          style={[
-                    props.style,
-                    props.size ? { width: props.size, height: props.size } : {},
-                ]}
-          appearance='imageButton'
-          onPress={() => {
-                    _pickImage().then((img) => {
-                        httpPost("/upload/base64", {
-                            base64: img,
-                        }).then((res) => {
-                            props.changeIcon(res);
-                        });
-                    });
+  return (
+    <>
+      <Button
+        style={[
+          props.style,
+          props.size ? { width: props.size, height: props.size } : {},
+        ]}
+        appearance="imageButton"
+        onPress={() => {
+          _pickImage().then(img => {
+            httpPost("/upload/base64", {
+              base64: img,
+            }).then(res => {
+              props.changeIcon(res);
+            });
+          });
+        }}
+        accessoryLeft={imgprops => {
+          if (props.value && props.value !== " ") {
+            return (
+              <Image
+                style={{
+                  width: "100%",
+                  height: "100%",
                 }}
-          accessoryLeft={(imgprops) => {
-                    if (props.value && props.value !== " ") {
-                        return (
-                          <Image
-                            style={{
-                                    width: "100%",
-                                    height: "100%",
-                                }}
-                            source={{ uri: props.value }}
-                          />
-                        );
-                    } 
-                        return renderPulseIcon(imgprops);
-                    
-                }}
-        />
-        {/* {props.hasCancel == true && props.value && (
+                source={{ uri: props.value }}
+              />
+            );
+          }
+          return renderPulseIcon(imgprops);
+        }}
+      />
+      {/* {props.hasCancel == true && props.value && (
                 <Button
                     size='tiny'
                     status='danger'
@@ -101,7 +98,6 @@ export default function UpLoadImage(props) {
                     }}
                 />
             )} */}
-      </>
-    );
+    </>
+  );
 }
-

+ 30 - 10
models/userModel.js

@@ -11,14 +11,16 @@ export default {
     phone: "",
     isLogin: false,
     guideStep: 0,
-    registerInfo: null,
+    registerInfo: {},
     initApp: true,
     refreashReason: "login",
     initRoute: "Login",
+    userInfo: {},
   },
   actions: ({ model, setState }) => ({
     updateUser(userInfo) {
       setState({ ...userInfo });
+      setState({ userInfo });
     },
     getUserInfo() {
       setState({ initApp: false });
@@ -57,6 +59,15 @@ export default {
           });
       });
     },
+    changeRegisterInfo({ ...info }) {
+      const { registerInfo } = model();
+      setState({
+        registerInfo: {
+          ...registerInfo,
+          ...info,
+        },
+      });
+    },
     loginByPassword(phone, password) {
       const { httpPost, addAsyncStorage } = model("httpModel");
       const { success, warnning } = model("loadingModel");
@@ -96,18 +107,27 @@ export default {
       RootNavigation.navigate("RegisterSe");
     },
     registerUser({ ...data }) {
+      const { getUserInfo } = model();
       const { success } = model("loadingModel");
       const { httpPost, addAsyncStorage } = model("httpModel");
-      httpPost("/auth/merchantRegister", data, {}, true).then(res => {
-        addAsyncStorage("token", res).then(() => {
-          if (res) {
-            success("注册成功");
-            addAsyncStorage("guideStep", "1").then(() => {
-              setState({ initApp: true });
-            });
-          }
+      const { saveVeriFied, registerVerifiedInfo } = model("verifiedModel");
+      httpPost("/auth/merchantRegister", data, {}, true)
+        .then(res => {
+          return addAsyncStorage("token", res);
+        })
+        .then(() => {
+          return getUserInfo();
+        })
+        .then(() => {
+          return saveVeriFied(registerVerifiedInfo);
+        })
+        .then(() => {
+          success("注册成功");
+          return addAsyncStorage("guideStep", "1");
+        })
+        .then(() => {
+          setState({ initApp: true });
         });
-      });
       // setTimeout(() => {
       //     success("注册成功");
       // }, 1000);

+ 47 - 0
models/verifiedModel.js

@@ -0,0 +1,47 @@
+/* eslint-disable no-else-return */
+/* eslint-disable no-unused-vars */
+export default {
+  state: {
+    verifiedInfo: {},
+    registerVerifiedInfo: {},
+  },
+  actions: ({ model, setState }) => ({
+    getVerfied() {
+      const { httpGet } = model("httpModel");
+      const { userId } = model("userModel");
+      if (userId) {
+        return httpGet(
+          "/verified/my",
+          {
+            userId,
+          }.true
+        ).then(res => {
+          setState({
+            verifiedInfo: res,
+          });
+        });
+      } else {
+        return Promise.resolve();
+      }
+    },
+    saveVeriFied({ ...info }) {
+      const { httpPost } = model("httpModel");
+      const { userId } = model("userModel");
+      if (userId) {
+        return httpPost("/verified/save", {
+          ...info,
+          userId,
+        }).then(res => {
+          setState({
+            verifiedInfo: res,
+          });
+        });
+      } else {
+        setState({
+          registerVerifiedInfo: info,
+        });
+        return Promise.resolve();
+      }
+    },
+  }),
+};

+ 25 - 24
navigation/BasicNavigator.js

@@ -12,30 +12,31 @@ import SetEvent from "../screens/Set";
 import Coupon from "../screens/Coupon";
 import Appraisal from "../screens/Appraisal";
 import Goods from "../screens/Goods";
+import Attestation from "../screens/Attestation";
 
 export default function BasicScreens(Screen) {
-    return (
-      <>
-        <Screen name='AddGoods' component={Guide1Screen} />
-        <Screen name='EditBanner' component={EditBanner} />
-        <Screen name='EditGoods' component={EditGoods} />
-        <Screen
-          name='AddClassification'
-          component={AddGoodsClassification}
-        />
-        <Screen name='FullReduction' component={FullReduction} />
-        <Screen name='AddNewClass' component={Guide2Screen} />
-        <Screen name='Money' component={MoneyListScreen} />
-
-        {Bank(Screen)}
-
-        {SetEvent(Screen)}
-
-        {Coupon(Screen)}
-
-        {Appraisal(Screen)}
-
-        {Goods(Screen)}
-      </>
-    );
+  return (
+    <>
+      <Screen name="AddGoods" component={Guide1Screen} />
+      <Screen name="EditBanner" component={EditBanner} />
+      <Screen name="EditGoods" component={EditGoods} />
+      <Screen name="AddClassification" component={AddGoodsClassification} />
+      <Screen name="FullReduction" component={FullReduction} />
+      <Screen name="AddNewClass" component={Guide2Screen} />
+      <Screen name="Money" component={MoneyListScreen} />
+
+      {Bank(Screen)}
+
+      {SetEvent(Screen)}
+
+      {Coupon(Screen)}
+
+      {Appraisal(Screen)}
+
+      {Goods(Screen)}
+
+      {Attestation(Screen)}
+      {/* 资质认证 */}
+    </>
+  );
 }

+ 203 - 0
screens/Attestation/LegalPersonScreen.js

@@ -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>
+    </>
+  );
+}

+ 118 - 0
screens/Attestation/QualificationScreen.js

@@ -0,0 +1,118 @@
+/* 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 } from "flooks";
+import { useTheme, Text, Button } from "@ui-kitten/components";
+import { useFocusEffect } from "@react-navigation/native";
+import NavHeaderBar from "../../components/NavHeaderBar";
+import UpLoadImage from "../../components/UpLoadImage";
+import ListUtil from "../../Utils/ListUtil";
+
+const styles = StyleSheet.create({
+  imgList: {
+    flexDirection: "row",
+    justifyContent: "space-around",
+  },
+  imgItem: {
+    paddingVertical: 30,
+  },
+  text: {
+    paddingVertical: 15,
+  },
+  btn: {
+    marginVertical: 30,
+    alignItems: "center",
+  },
+});
+
+export default function QualificationScreen({ navigation }) {
+  const theme = useTheme();
+  const { changeBackground } = useModel("barModel", true);
+  const {
+    mid,
+    registerInfo,
+    userInfo,
+    updateMerchant,
+    changeRegisterInfo,
+  } = useModel("userModel");
+  const { success } = useModel("loadingModel", true);
+
+  const [beforeImg, changeBeforeImg] = React.useState("");
+  const [afterImg, changeAfterImg] = React.useState("");
+
+  useFocusEffect(
+    React.useCallback(() => {
+      changeBackground(theme["color-primary-500"]);
+      if (mid) {
+        const imgList = new ListUtil(userInfo.qualification || "");
+        imgList.getOneTow(changeBeforeImg, changeAfterImg);
+      } else {
+        const imgList = new ListUtil(registerInfo.qualification || "");
+        imgList.getOneTow(changeBeforeImg, changeAfterImg);
+      }
+    }, [])
+  );
+
+  const canSubmit = React.useMemo(() => {
+    if (beforeImg && afterImg) {
+      return true;
+    }
+    return false;
+  }, [beforeImg, afterImg]);
+
+  function submit() {
+    if (mid) {
+      const _qualification = new ListUtil([beforeImg, afterImg]);
+      updateMerchant({
+        qualification: _qualification.getListValue(),
+      }).then(() => {
+        success("设置成功");
+        navigation.goBack();
+      });
+    } else {
+      const _qualification = new ListUtil([beforeImg, afterImg]);
+      changeRegisterInfo({
+        qualification: _qualification.getListValue(),
+      });
+      success("设置成功");
+      navigation.goBack();
+    }
+  }
+
+  return (
+    <>
+      <NavHeaderBar title="营业资质" />
+      <View style={styles.imgList}>
+        <View style={styles.imgItem}>
+          <UpLoadImage
+            key="before"
+            value={beforeImg}
+            changeIcon={changeBeforeImg}
+            size={67}
+          />
+          <Text category="c1" style={styles.text}>
+            营业资质正面
+          </Text>
+        </View>
+        <View style={styles.imgItem}>
+          <UpLoadImage
+            key="after"
+            value={afterImg}
+            changeIcon={changeAfterImg}
+            size={67}
+          />
+          <Text category="c1" style={styles.text}>
+            营业资质反面
+          </Text>
+        </View>
+      </View>
+
+      <View style={styles.btn}>
+        <Button onPress={submit} disabled={!canSubmit}>
+          确定
+        </Button>
+      </View>
+    </>
+  );
+}

+ 211 - 0
screens/Attestation/StoreScreen.js

@@ -0,0 +1,211 @@
+/* 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",
+  },
+  imgList2: {
+    flexDirection: "row",
+    flexWrap: "wrap",
+  },
+  imgItem: {
+    paddingVertical: 10,
+    alignItems: "center",
+  },
+  imgItem2: {
+    paddingVertical: 10,
+    alignItems: "center",
+    marginRight: 20,
+  },
+  text: {
+    paddingVertical: 15,
+  },
+  btn: {
+    marginVertical: 30,
+    alignItems: "center",
+  },
+  tips: {
+    paddingVertical: 20,
+    paddingHorizontal: 40,
+  },
+});
+
+export default function StoreScreen({ navigation }) {
+  const theme = useTheme();
+  const { changeBackground } = useModel("barModel", true);
+  const {
+    mid,
+    registerInfo,
+    userInfo,
+    updateMerchant,
+    changeRegisterInfo,
+  } = useModel("userModel");
+  const { success } = useModel("loadingModel", true);
+
+  const [doorHeadImg, setDoorHeadImg] = React.useState("");
+  const [img1, setImg1] = React.useState("");
+  const [img2, setImg2] = React.useState("");
+  const [img3, setImg3] = React.useState("");
+  const [img4, setImg4] = React.useState("");
+  const [img5, setImg5] = React.useState("");
+  useFocusEffect(
+    React.useCallback(() => {
+      changeBackground(theme["color-primary-500"]);
+      if (mid) {
+        setDoorHeadImg(userInfo.doorHeadImg || "");
+        const imgList = new ListUtil(userInfo.img || "");
+        imgList.setImgVal([setImg1, setImg2, setImg3, setImg4, setImg5]);
+      } else {
+        setDoorHeadImg(registerInfo.doorHeadImg || "");
+        const imgList = new ListUtil(registerInfo.img || "");
+        imgList.setImgVal([setImg1, setImg2, setImg3, setImg4, setImg5]);
+      }
+    }, [])
+  );
+
+  const canSubmit = React.useMemo(() => {
+    if (doorHeadImg && (img1 || img2 || img3 || img4 || img5)) {
+      return true;
+    }
+    return false;
+  }, [doorHeadImg, img1, img2, img3, img4, img5]);
+
+  function submit() {
+    const imgList = new ListUtil([img1, img2, img3, img4, img5]);
+
+    if (mid) {
+      updateMerchant({
+        doorHeadImg,
+        img: imgList.getListValue(),
+      }).then(() => {
+        success("设置成功");
+        navigation.goBack();
+      });
+    } else {
+      changeRegisterInfo({
+        doorHeadImg,
+        img: imgList.getListValue(),
+      });
+      success("设置成功");
+      navigation.goBack();
+    }
+  }
+
+  return (
+    <>
+      <NavHeaderBar title="编辑法人信息" />
+      <ScrollPage>
+        <Layout style={styles.container}>
+          <FormInput
+            key="doorHeadImg"
+            label="店面门头:"
+            type="label"
+            textAlign="right"
+            style={{ paddingVertical: 5 }}
+            labelStyle={{ width: 100 }}
+          />
+          <View style={styles.imgList}>
+            <View style={styles.imgItem}>
+              <UpLoadImage
+                key="handheldIdNo"
+                value={doorHeadImg}
+                changeIcon={setDoorHeadImg}
+                size={67}
+              />
+            </View>
+          </View>
+
+          <FormInput
+            key="img"
+            label="店面内部环境拍照:(最多五张)"
+            type="label"
+            textAlign="right"
+            style={{ paddingVertical: 5 }}
+            labelStyle={{ width: 200 }}
+          />
+          <View style={styles.imgList2}>
+            <View style={styles.imgItem2}>
+              <UpLoadImage
+                key="img1"
+                value={img1}
+                changeIcon={setImg1}
+                size={67}
+              />
+            </View>
+            <View style={styles.imgItem2}>
+              <UpLoadImage
+                key="img2"
+                value={img2}
+                changeIcon={setImg2}
+                size={67}
+              />
+            </View>
+
+            <View style={styles.imgItem2}>
+              <UpLoadImage
+                key="img3"
+                value={img3}
+                changeIcon={setImg3}
+                size={67}
+              />
+            </View>
+            <View style={styles.imgItem2}>
+              <UpLoadImage
+                key="img4"
+                value={img4}
+                changeIcon={setImg4}
+                size={67}
+              />
+            </View>
+            <View style={styles.imgItem2}>
+              <UpLoadImage
+                key="img5"
+                value={img5}
+                changeIcon={setImg5}
+                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>
+        </View>
+      </ScrollPage>
+    </>
+  );
+}

+ 18 - 0
screens/Attestation/index.js

@@ -0,0 +1,18 @@
+import * as WebBrowser from "expo-web-browser";
+import * as React from "react";
+import QualificationScreen from "./QualificationScreen";
+import LegalPersonScreen from "./LegalPersonScreen";
+import StoreScreen from "./StoreScreen";
+
+export default function Set(Screen) {
+  return (
+    <>
+      {/* 营业资质 */}
+      <Screen name="Qualification" component={QualificationScreen} />
+      {/* 法人信息 */}
+      <Screen name="LegalPerson" component={LegalPersonScreen} />
+      {/* 门店信息 */}
+      <Screen name="Store" component={StoreScreen} />
+    </>
+  );
+}

+ 156 - 169
screens/EditBannerScreen.js

@@ -1,15 +1,7 @@
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
-import {
-    Image,
-    StyleSheet,
-} from "react-native";
-import {
-    Layout,
-    Text,
-    useTheme,
-    Button,
-} from "@ui-kitten/components";
+import { Image, StyleSheet } from "react-native";
+import { Layout, Text, useTheme, Button } from "@ui-kitten/components";
 import { useFocusEffect } from "@react-navigation/native";
 import { useModel } from "flooks";
 import ScrollPage from "../components/ScrollPage";
@@ -17,168 +9,163 @@ import NavHeaderBar from "../components/NavHeaderBar";
 import UpLoadImage from "../components/UpLoadImage";
 
 const styles = StyleSheet.create({
-    container: {
-        flex: 1,
-        paddingBottom: 33,
-    },
-    icon: {
-        width: 90,
-        height: 80,
-        marginBottom: 26,
-    },
-    text: {
-        fontWeight: "500",
-        marginBottom: 7,
-    },
-    top: {
-        paddingVertical: 7,
-        height: 114,
-        backgroundColor: "#eee",
-        alignSelf: "stretch",
-        alignItems: "center",
-        justifyContent: "center",
-    },
-    banner: {
-        flex: 1,
-        alignSelf: "stretch",
-    },
-    logo: {
-        width: 50,
-        height: 50,
-        borderRadius: 3,
-    },
-    remove: {
-        position: "absolute",
-        bottom: 10,
-        right: 10,
-    },
-    upload: {
-        marginTop: 21,
-        width: 133,
-        height: 133,
-        alignSelf: "center",
-    },
-    main: {
-        paddingHorizontal: 24,
-        paddingVertical: 14,
-    },
-    button: {
-        alignSelf: "center",
-        marginTop: 19,
-    },
+  container: {
+    flex: 1,
+    paddingBottom: 33,
+  },
+  icon: {
+    width: 90,
+    height: 80,
+    marginBottom: 26,
+  },
+  text: {
+    fontWeight: "500",
+    marginBottom: 7,
+  },
+  top: {
+    paddingVertical: 7,
+    height: 114,
+    backgroundColor: "#eee",
+    alignSelf: "stretch",
+    alignItems: "center",
+    justifyContent: "center",
+  },
+  banner: {
+    flex: 1,
+    alignSelf: "stretch",
+  },
+  logo: {
+    width: 50,
+    height: 50,
+    borderRadius: 3,
+  },
+  remove: {
+    position: "absolute",
+    bottom: 10,
+    right: 10,
+  },
+  upload: {
+    marginTop: 21,
+    width: 133,
+    height: 133,
+    alignSelf: "center",
+  },
+  main: {
+    paddingHorizontal: 24,
+    paddingVertical: 14,
+  },
+  button: {
+    alignSelf: "center",
+    marginTop: 19,
+  },
 });
 
+export default function EditBannerScreen({ route }) {
+  const theme = useTheme();
+  const { changeBackground } = useModel("barModel");
+  const {
+    banner,
+    logo,
+    qualification,
+    uploadStoreImg,
+    registerInfo,
+  } = useModel("userModel");
+  const [img, changeImg] = React.useState("");
+  const [type, setType] = React.useState("banner");
+  const { showDialog } = useModel("dialogModel");
+  const {
+    bannerTitle,
+    logoTitle,
+    qualificationTitle,
+    remove,
+    editText,
+    uplaodText,
+    uplaodImg,
+    removeTips,
+  } = useModel("wordsModel");
+  useFocusEffect(
+    React.useCallback(() => {
+      changeBackground(theme["color-primary-500"]);
+      if (route.params.type) {
+        setType(route.params.type);
+      }
+    }, [])
+  );
 
-export default function EditBannerScreen({  route }) {
-    const theme = useTheme();
-    const { changeBackground } = useModel("barModel");
-    const {
-        banner,
-        logo,
-        qualification,
-        uploadStoreImg,
-        registerInfo,
-    } = useModel("userModel");
-    const [img, changeImg] = React.useState("");
-    const [type, setType] = React.useState("banner");
-    const { showDialog } = useModel("dialogModel");
-    const {
-        bannerTitle,
-        logoTitle,
-        qualificationTitle,
-        remove,
-        editText,
-        uplaodText,
-        uplaodImg,
-        removeTips,
-    } = useModel("wordsModel");
-    useFocusEffect(
-        React.useCallback(() => {
-            changeBackground(theme["color-primary-500"]);
-            if (route.params.type) {
-                setType(route.params.type);
-            }
-        }, [])
-    );
-
-    return (
-      <>
-        <NavHeaderBar
-          title={
-                    editText +
-                    (type === "banner"
-                        ? bannerTitle
-                        : type === "qualification"
-                        ? qualificationTitle
-                        : logoTitle)
-                }
-        />
-        <ScrollPage>
-          <Layout style={styles.container}>
-            <Layout style={styles.top}>
-              <Image
-                source={{
-                                uri:
-                                    type === "banner"
-                                        ? banner
-                                        : type === "qualification"
-                                        ? qualification ||
-                                          registerInfo.qualification
-                                        : logo,
-                            }}
-                style={[
-                                type === "logo" ? styles.logo : styles.banner,
-                            ]}
-              />
-              <Button
-                style={styles.remove}
-                size='tiny'
-                status='danger'
-                onPress={() => {
-                                showDialog({
-                                    bodyText: removeTips,
-                                    status: "danger",
-                                    cancelable: true,
-                                    confirmCallback: () => {
-                                        uploadStoreImg("", type);
-                                    },
-                                });
-                            }}
-              >
-                {remove}
-              </Button>
-            </Layout>
-            <Layout style={styles.main}>
-              <Text category='c1'>
-                {uplaodText +
-                                (type === "banner"
-                                    ? bannerTitle
-                                    : type === "qualification"
-                                    ? qualificationTitle
-                                    : logoTitle)}
-              </Text>
-              <UpLoadImage
-                style={styles.upload}
-                value={img}
-                changeIcon={changeImg}
-                size={133}
-              />
+  return (
+    <>
+      <NavHeaderBar
+        title={
+          editText +
+          (type === "banner"
+            ? bannerTitle
+            : type === "qualification"
+            ? qualificationTitle
+            : logoTitle)
+        }
+      />
+      <ScrollPage>
+        <Layout style={styles.container}>
+          <Layout style={styles.top}>
+            <Image
+              source={{
+                uri:
+                  type === "banner"
+                    ? banner
+                    : type === "qualification"
+                    ? qualification || registerInfo.qualification
+                    : logo,
+              }}
+              style={[type === "logo" ? styles.logo : styles.banner]}
+            />
+            <Button
+              style={styles.remove}
+              size="tiny"
+              status="danger"
+              onPress={() => {
+                showDialog({
+                  bodyText: removeTips,
+                  status: "danger",
+                  cancelable: true,
+                  confirmCallback: () => {
+                    uploadStoreImg("", type);
+                  },
+                });
+              }}
+            >
+              {remove}
+            </Button>
+          </Layout>
+          <Layout style={styles.main}>
+            <Text category="c1">
+              {uplaodText +
+                (type === "banner"
+                  ? bannerTitle
+                  : type === "qualification"
+                  ? qualificationTitle
+                  : logoTitle)}
+            </Text>
+            <UpLoadImage
+              style={styles.upload}
+              value={img}
+              changeIcon={changeImg}
+              size={133}
+            />
 
-              <Button
-                disabled={!img}
-                style={styles.button}
-                onPress={() => {
-                                uploadStoreImg(img, type).then(() => {
-                                    changeImg("");
-                                });
-                            }}
-              >
-                {uplaodImg}
-              </Button>
-            </Layout>
+            <Button
+              disabled={!img}
+              style={styles.button}
+              onPress={() => {
+                uploadStoreImg(img, type).then(() => {
+                  changeImg("");
+                });
+              }}
+            >
+              {uplaodImg}
+            </Button>
           </Layout>
-        </ScrollPage>
-      </>
-    );
+        </Layout>
+      </ScrollPage>
+    </>
+  );
 }
-

+ 18 - 12
screens/HomeScreen.js

@@ -21,7 +21,6 @@ import {
   TopNavigation,
   TopNavigationAction,
 } from "@ui-kitten/components";
-import { NoticeBar, Accordion } from "@ant-design/react-native";
 import { createMaterialTopTabNavigator } from "@react-navigation/material-top-tabs";
 import { useFocusEffect } from "@react-navigation/native";
 import Badge from "../components/Badge";
@@ -117,6 +116,7 @@ const styles = StyleSheet.create({
     fontSize: 13,
     paddingHorizontal: 10,
     minWidth: 120,
+    maxWidth: "100%",
   },
   homeCard: {
     zIndex: 2,
@@ -136,6 +136,11 @@ const styles = StyleSheet.create({
   tabIndicator: {
     backgroundColor: "#FFC21C",
   },
+  btn: {
+    maxWidth: "100%",
+    overflow: "hidden",
+    paddingLeft: 30,
+  },
 });
 
 const Tab = createMaterialTopTabNavigator();
@@ -194,16 +199,16 @@ export default function HomeScreen({ navigation, route }) {
   const [showMore, changeShow] = React.useState(false);
 
   const [couponList, setCouponList] = React.useState([]);
-  const couponTips = React.useMemo(() => {
-    if (couponList.length > 0) {
-      return couponList
-        .map(item => {
-          return item.name;
-        })
-        .join(",");
-    }
-    return "";
-  }, [couponList]);
+  //   const couponTips = React.useMemo(() => {
+  //     if (couponList.length > 0) {
+  //       return couponList
+  //         .map(item => {
+  //           return item.name;
+  //         })
+  //         .join(",");
+  //     }
+  //     return "";
+  //   }, [couponList]);
 
   useFocusEffect(
     React.useCallback(() => {
@@ -255,7 +260,7 @@ export default function HomeScreen({ navigation, route }) {
             userLogout();
           }}
         />
-        <MenuItem title="05.29.0.3版本" />
+        <MenuItem title="05.31.0.1版本" />
       </OverflowMenu>
     </>
   );
@@ -387,6 +392,7 @@ export default function HomeScreen({ navigation, route }) {
               </TouchableOpacity>
             </Layout>
             <Button
+              style={styles.btn}
               key="boad"
               appearance="ghost"
               status="info"

+ 119 - 13
screens/RegisterSeScreen.js

@@ -68,7 +68,7 @@ export default function RegisterScreen() {
     guideHome_form_5,
     guideHome_form_6,
     guideHome_form_7,
-    guideHome_pla_2,
+    // guideHome_pla_2,
     guideHome_pla_3,
     next,
   } = useModel("wordsModel");
@@ -88,12 +88,6 @@ export default function RegisterScreen() {
     }, [])
   );
 
-  React.useEffect(() => {
-    if (registerInfo && registerInfo.qualification) {
-      changeQualification(registerInfo.qualification);
-    }
-  }, [registerInfo]);
-
   const [category, changeCategory] = React.useState("");
   const [address, changeAddress] = React.useState("");
   const [week, changeWeek] = React.useState("");
@@ -101,7 +95,62 @@ export default function RegisterScreen() {
   const [endTime, changeEndTime] = React.useState("22:00:00");
   const [merchantNatureId, changeMerchantNatureId] = React.useState("");
   const [logo, changeLogo] = React.useState();
+  const [doorHeadImg, changeDoorHeadeImg] = React.useState("");
+  const [img, changeImg] = React.useState("");
+
+  const {
+    getVerfied,
+    verifiedInfo,
+    registerVerifiedInfo,
+      } = useModel("verifiedModel");
+
+  // 法人信息
+  const [realName, setRealName] = React.useState("");
+  const [idNo, setIdNo] = React.useState("");
+  const [idNoImg, setIdNoImg] = React.useState("");
+  const [handheldIdNo, setHandheldIdNo] = React.useState("");
 
+  React.useEffect(() => {
+    if (registerVerifiedInfo && registerVerifiedInfo.realName) {
+      setRealName(registerVerifiedInfo.realName);
+    }
+    if (registerVerifiedInfo && registerVerifiedInfo.idNo) {
+      setIdNo(registerVerifiedInfo.idNo);
+    }
+    if (registerVerifiedInfo && registerVerifiedInfo.idNoImg) {
+      setIdNoImg(registerVerifiedInfo.idNoImg);
+    }
+    if (registerVerifiedInfo && registerVerifiedInfo.handheldIdNo) {
+      setHandheldIdNo(registerVerifiedInfo.handheldIdNo);
+    }
+  }, [registerVerifiedInfo]);
+
+  React.useEffect(() => {
+    if (verifiedInfo && verifiedInfo.realName) {
+      setRealName(verifiedInfo.realName);
+    }
+    if (verifiedInfo && verifiedInfo.idNo) {
+      setIdNo(verifiedInfo.idNo);
+    }
+    if (verifiedInfo && verifiedInfo.idNoImg) {
+      setIdNoImg(verifiedInfo.idNoImg);
+    }
+    if (verifiedInfo && verifiedInfo.handheldIdNo) {
+      setHandheldIdNo(verifiedInfo.handheldIdNo);
+    }
+  }, [verifiedInfo]);
+
+  React.useEffect(() => {
+    if (registerInfo && registerInfo.qualification) {
+      changeQualification(registerInfo.qualification);
+    }
+    if (registerInfo && registerInfo.doorHeadImg) {
+      changeDoorHeadeImg(registerInfo.doorHeadImg);
+    }
+    if (registerInfo && registerInfo.img) {
+      changeImg(registerInfo.img);
+    }
+  }, [registerInfo]);
   React.useEffect(() => {
     if (mid) {
       let userInfo = getNowUser();
@@ -115,6 +164,10 @@ export default function RegisterScreen() {
       changeStartTime(userInfo.startTime);
       changeEndTime(userInfo.endTime);
       changeQualification(userInfo.qualification);
+      changeDoorHeadeImg(userInfo.doorHeadImg);
+      changeImg(userInfo.img);
+
+      getVerfied();
     }
   }, [mid]);
 
@@ -126,11 +179,41 @@ export default function RegisterScreen() {
   }, [week, startTime, endTime]);
 
   const canNext = React.useMemo(() => {
-    if ((category, address, merchantNatureId, logo)) {
+    if (
+      category &&
+      address &&
+      merchantNatureId &&
+      logo &&
+      week &&
+      startTime &&
+      endTime &&
+      doorHeadImg &&
+      img &&
+      realName &&
+      idNo &&
+      idNoImg &&
+      handheldIdNo &&
+      qualification
+    ) {
       return true;
     }
     return false;
-  }, [logo]);
+  }, [
+    category,
+    address,
+    merchantNatureId,
+    logo,
+    week,
+    startTime,
+    endTime,
+    doorHeadImg,
+    img,
+    realName,
+    idNo,
+    idNoImg,
+    handheldIdNo,
+    qualification,
+  ]);
 
   return (
     <>
@@ -183,15 +266,36 @@ export default function RegisterScreen() {
 
             <FormInput
               label={guideHome_form_5}
-              sub={guideHome_pla_2}
               type="url"
               value={qualification ? "已上传" : " "}
               textAlign="right"
               style={{ paddingVertical: 5 }}
               changePath={() => {
-                RootNavigation.navigate("EditBanner", {
-                  type: "qualification",
-                });
+                RootNavigation.navigate("Qualification");
+              }}
+            />
+
+            <FormInput
+              label="门店信息"
+              type="url"
+              value={doorHeadImg && img ? "已上传" : " "}
+              textAlign="right"
+              style={{ paddingVertical: 5 }}
+              changePath={() => {
+                RootNavigation.navigate("Store");
+              }}
+            />
+
+            <FormInput
+              label="法人信息"
+              type="url"
+              value={
+                realName && idNo && idNoImg && handheldIdNo ? "已上传" : " "
+              }
+              textAlign="right"
+              style={{ paddingVertical: 5 }}
+              changePath={() => {
+                RootNavigation.navigate("LegalPerson");
               }}
             />
 
@@ -251,6 +355,8 @@ export default function RegisterScreen() {
                       qualification,
                       merchantNatureId,
                       logo,
+                      img,
+                      doorHeadImg,
                     })
                   }
                 >