|
|
@@ -20,18 +20,19 @@ import {
|
|
|
Card,
|
|
|
} from "@ui-kitten/components";
|
|
|
import FormInput from "../components/FormInput";
|
|
|
-import { useFocusEffect } from "@react-navigation/native";
|
|
|
+import { useFocusEffect, useRoute } from "@react-navigation/native";
|
|
|
import ScrollPage from "../components/ScrollPage";
|
|
|
import ConnectButton from "../components/ConnectButton";
|
|
|
import GuideHeaderBar from "../components/GuideHeaderBar";
|
|
|
import OpenTime from "../components/OpenTime";
|
|
|
+import * as RootNavigation from "../navigation/RootNavigation.js";
|
|
|
|
|
|
-export default function RegisterScreen({ navigation, route }) {
|
|
|
+export default function RegisterScreen({ navigation }) {
|
|
|
const theme = useTheme();
|
|
|
const { changeBackground } = useModel("barModel");
|
|
|
const { httpGet } = useModel("httpModel", true);
|
|
|
- const { registerSecend } = useModel("userModel", true);
|
|
|
-
|
|
|
+ const { registerSecend, registerInfo } = useModel("userModel");
|
|
|
+ const route = useRoute();
|
|
|
const {
|
|
|
guideHome_title1,
|
|
|
guideHome_title2,
|
|
|
@@ -49,6 +50,7 @@ export default function RegisterScreen({ navigation, route }) {
|
|
|
} = useModel("wordsModel");
|
|
|
const [categoryList, changeCategoryList] = React.useState([]);
|
|
|
const [merchantNatureList, changeMerchantNatureList] = React.useState([]);
|
|
|
+ const [qualification, changeQualification] = React.useState("");
|
|
|
useFocusEffect(
|
|
|
React.useCallback(() => {
|
|
|
changeBackground(theme["color-primary-500"]);
|
|
|
@@ -62,12 +64,18 @@ export default function RegisterScreen({ navigation, route }) {
|
|
|
}, [])
|
|
|
);
|
|
|
|
|
|
+ React.useEffect(() => {
|
|
|
+ console.log(registerInfo);
|
|
|
+ if (registerInfo.qualification) {
|
|
|
+ changeQualification(registerInfo.qualification);
|
|
|
+ }
|
|
|
+ }, [registerInfo]);
|
|
|
+
|
|
|
const [category, changeCategory] = React.useState("");
|
|
|
const [address, changeAddress] = React.useState("");
|
|
|
const [week, changeWeek] = React.useState("");
|
|
|
const [startTime, changeStartTime] = React.useState("08:00");
|
|
|
const [endTime, changeEndTime] = React.useState("22:00");
|
|
|
- const [qualification, changeQualification] = React.useState("");
|
|
|
const [merchantNatureId, changeMerchantNatureId] = React.useState("");
|
|
|
const [logo, changeLogo] = React.useState();
|
|
|
const timeValue = React.useMemo(() => {
|
|
|
@@ -79,7 +87,11 @@ export default function RegisterScreen({ navigation, route }) {
|
|
|
}, [week, startTime, endTime]);
|
|
|
|
|
|
const canNext = React.useMemo(() => {
|
|
|
- return true;
|
|
|
+ if ((category, address, merchantNatureId, logo)) {
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}, [logo]);
|
|
|
|
|
|
const { registerFirst } = useModel("userModel", true);
|
|
|
@@ -135,7 +147,9 @@ export default function RegisterScreen({ navigation, route }) {
|
|
|
textAlign='right'
|
|
|
style={{ paddingVertical: 5 }}
|
|
|
changePath={() => {
|
|
|
- pushRouter("Qualification");
|
|
|
+ RootNavigation.navigate("EditBanner", {
|
|
|
+ type: "qualification",
|
|
|
+ });
|
|
|
}}
|
|
|
/>
|
|
|
|