panhui %!s(int64=5) %!d(string=hai) anos
pai
achega
9bbd3e2a22

+ 32 - 6
App.js

@@ -15,7 +15,7 @@ import { default as customMapping } from "./mapping.json"; // <-- Import app the
 import { SplashScreen } from "expo";
 import * as Font from "expo-font";
 import { Ionicons } from "@expo/vector-icons";
-import { NavigationContainer, useNavigation } from "@react-navigation/native";
+import { NavigationContainer } from "@react-navigation/native";
 import { createStackNavigator } from "@react-navigation/stack";
 import Dialog from "./components/Dialog";
 
@@ -25,12 +25,30 @@ import * as models from "./models";
 import BottomTabNavigator from "./navigation/BottomTabNavigator";
 import LoginStackNavigator from "./navigation/LoginStackNavigator";
 import GuideStackNavigator from "./navigation/GuideStackNavigator";
-import HomeStackNavigator from "./navigation/HomeStackNavigator";
+import RootStackNavigator from "./navigation/RootStackNavigator";
+import { navigationRef } from "./navigation/RootNavigation";
 
 import * as ApplyStatus from "./config/ApplyStatus";
 
+import {
+    createStackNavigator,
+    CardStyleInterpolators,
+} from "@react-navigation/stack";
+
 const Stack = createStackNavigator();
 
+const config = {
+    animation: "spring",
+    config: {
+        stiffness: 1000,
+        damping: 500,
+        mass: 3,
+        overshootClamping: true,
+        restDisplacementThreshold: 0.01,
+        restSpeedThreshold: 0.01,
+    },
+};
+
 export default function App(props) {
     const [isLoadingComplete, setLoadingComplete] = React.useState(false);
     const { checkLogin, isLogin, status, guideStep } = useModel("userModel");
@@ -41,7 +59,6 @@ export default function App(props) {
         async function loadResourcesAndDataAsync() {
             try {
                 SplashScreen.preventAutoHide();
-
                 // Load fonts
                 await Font.loadAsync({
                     ...Ionicons.font,
@@ -87,23 +104,32 @@ export default function App(props) {
                 >
                     <Dialog />
                     <Layout style={{ flex: 1 }}>
-                        <NavigationContainer>
+                        <NavigationContainer ref={navigationRef}>
                             <Stack.Navigator
                                 headerMode='none'
                                 initialRouteName={initialRouteName}
+                                screenOptions={{
+                                    gestureEnabled: true,
+                                    cardStyleInterpolator:
+                                        CardStyleInterpolators.forHorizontalIOS,
+                                }}
                             >
+                                {/* 基础功能页面 */}
                                 <Stack.Screen
-                                    name='Home'
-                                    component={HomeStackNavigator}
+                                    name='Basic'
+                                    component={RootStackNavigator}
                                 />
+                                {/* 首页tab组件页面 */}
                                 <Stack.Screen
                                     name='Root'
                                     component={BottomTabNavigator}
                                 />
+                                {/* 注册后指南页面 */}
                                 <Stack.Screen
                                     name='Guide'
                                     component={GuideStackNavigator}
                                 />
+                                {/* 登录部分页面 */}
                                 <Stack.Screen
                                     name='Login'
                                     component={LoginStackNavigator}

+ 34 - 18
components/Badge.js

@@ -1,5 +1,5 @@
 import * as React from "react";
-import { Icon, useTheme, Text } from "@ui-kitten/components";
+import { Icon, useTheme, Text, Button } from "@ui-kitten/components";
 
 export default function Badge(props) {
     const theme = useTheme();
@@ -12,21 +12,37 @@ export default function Badge(props) {
         }
     }, [props.status]);
 
-    return (
-        <Text
-            category='label'
-            status={props.status || "danger"}
-            style={[
-                {
-                    borderWidth: 1,
-                    borderRadius: 20,
-                    paddingHorizontal: 3,
-                    borderColor: useColor,
-                },
-                props.style,
-            ]}
-        >
-            {props.children}
-        </Text>
-    );
+    if (props.appearance == "fill") {
+        return (
+            <Button
+                appearance='badge'
+                status={props.status || "primary"}
+                style={{
+                    marginRight: props.right || 0,
+                    marginBottom: props.bottom || 0,
+                    flexShrink: 0,
+                }}
+            >
+                {props.children}
+            </Button>
+        );
+    } else {
+        return (
+            <Text
+                category='label'
+                status={props.status || "danger"}
+                style={[
+                    {
+                        borderWidth: 1,
+                        borderRadius: 20,
+                        paddingHorizontal: 3,
+                        borderColor: useColor,
+                    },
+                    props.style,
+                ]}
+            >
+                {props.children}
+            </Text>
+        );
+    }
 }

+ 5 - 4
components/NavHeaderBar.js

@@ -10,16 +10,17 @@ import {
 } from "@ui-kitten/components";
 import { useModel } from "flooks";
 import { Image, StyleSheet } from "react-native";
+import * as RootNavigation from "../navigation/RootNavigation.js";
 
 const BackIcon = (props) => <Icon {...props} fill='#fff' name='arrow-back' />;
 
 export default function NavHeaderBar(props) {
     const theme = useTheme();
-    const { registerInfo } = useModel("userModel", true);
-    const { backRouter } = useModel("routersModel", true);
-
     const renderBackAction = () => (
-        <TopNavigationAction icon={BackIcon} onPress={backRouter} />
+        <TopNavigationAction
+            icon={BackIcon}
+            onPress={RootNavigation.goBack()}
+        />
     );
     return (
         <TopNavigation

+ 0 - 2
components/UpLoadImage.js

@@ -26,8 +26,6 @@ export default function UpLoadImage(props) {
                     });
                 }}
                 accessoryLeft={(imgprops) => {
-                    console.log(imgprops);
-                    console.log(props);
                     if (props.value && props.value != " ") {
                         return (
                             <Image

+ 25 - 2
decorator/scrollPage.js

@@ -1,11 +1,34 @@
 import React from "react";
-import { ScrollView } from "react-native";
+import { ScrollView, RefreshControl } from "react-native";
 
 function scrollPage(Component) {
     class NewPage extends React.Component {
+        constructor(props) {
+            super(props);
+            this.state = {
+                refreshing: false,
+            };
+        }
+
+        _onRefresh = () => {
+            this.setState({ refreshing: true });
+            fetchData().then(() => {
+                this.setState({ refreshing: false });
+            });
+        };
+
         render(props) {
             return (
-                <ScrollView contentContainerStyle={{ flexGrow: 1 }}>
+                <ScrollView
+                    contentContainerStyle={{ flexGrow: 1 }}
+                    refreshControl={
+                        <RefreshControl
+                            refreshing={this.state.refreshing}
+                            onRefresh={this._onRefresh}
+                            enabled={true}
+                        />
+                    }
+                >
                     <Component {...props} />
                 </ScrollView>
             );

+ 2 - 1
language/zh.js

@@ -123,5 +123,6 @@ export default {
     editText:'编辑',
     uplaodText:'上传',
     uplaodImg:'上传图片',
-    removeTips:'确定要移除吗?移除后不可恢复'
+    removeTips:'确定要移除吗?移除后不可恢复',
+    autoBackText:'自动回复'
 };

+ 204 - 0
mapping.json

@@ -826,6 +826,210 @@
                             }
                         }
                     }
+                },
+                "badge": {
+                    "variantGroups": {
+                        "status": {
+                            "basic": {
+                                "borderColor": "color-basic-default-border",
+                                "backgroundColor": "color-basic-default",
+                                "textColor": "color-basic-800",
+                                "iconTintColor": "color-basic-800",
+                                "state": {
+                                    "focused": {
+                                        "borderColor": "color-basic-focus-border",
+                                        "backgroundColor": "color-basic-focus"
+                                    },
+                                    "hover": {
+                                        "borderColor": "color-basic-hover-border",
+                                        "backgroundColor": "color-basic-hover"
+                                    },
+                                    "active": {
+                                        "borderColor": "color-basic-active-border",
+                                        "backgroundColor": "color-basic-active"
+                                    },
+                                    "disabled": {
+                                        "borderColor": "color-basic-disabled-border",
+                                        "backgroundColor": "color-basic-disabled",
+                                        "textColor": "text-disabled-color",
+                                        "iconTintColor": "text-disabled-color"
+                                    }
+                                }
+                            },
+                            "primary": {
+                                "borderColor": "#F8ECD6",
+                                "backgroundColor": "#F8ECD6",
+                                "textColor": "#FFC21C",
+                                "iconTintColor": "#FFC21C",
+                                "state": {
+                                    "focused": {
+                                        "borderColor": "rgba(248,236,214,0.8)",
+                                        "backgroundColor": "rgba(248,236,214,0.8)"
+                                    },
+                                    "hover": {
+                                        "borderColor": "rgba(248,236,214,0.8)",
+                                        "backgroundColor": "rgba(248,236,214,0.8)"
+                                    },
+                                    "active": {
+                                        "borderColor": "rgba(248,236,214,0.8)",
+                                        "backgroundColor": "rgba(248,236,214,0.8)"
+                                    },
+                                    "disabled": {
+                                        "borderColor": "color-primary-disabled-border",
+                                        "backgroundColor": "color-primary-disabled",
+                                        "textColor": "text-disabled-color",
+                                        "iconTintColor": "text-disabled-color"
+                                    }
+                                }
+                            },
+                            "success": {
+                                "borderColor": "color-success-default-border",
+                                "backgroundColor": "color-success-default",
+                                "textColor": "text-control-color",
+                                "iconTintColor": "text-control-color",
+                                "state": {
+                                    "focused": {
+                                        "borderColor": "color-success-focus-border",
+                                        "backgroundColor": "color-success-focus"
+                                    },
+                                    "hover": {
+                                        "borderColor": "color-success-hover-border",
+                                        "backgroundColor": "color-success-hover"
+                                    },
+                                    "active": {
+                                        "borderColor": "color-success-active-border",
+                                        "backgroundColor": "color-success-active"
+                                    },
+                                    "disabled": {
+                                        "borderColor": "color-success-disabled-border",
+                                        "backgroundColor": "color-success-disabled",
+                                        "textColor": "text-disabled-color",
+                                        "iconTintColor": "text-disabled-color"
+                                    }
+                                }
+                            },
+                            "info": {
+                                "borderColor": "color-info-transparent-300",
+                                "backgroundColor": "color-info-transparent-300",
+                                "textColor": "#B5B5B5",
+                                "iconTintColor": "#B5B5B5",
+                                "state": {
+                                    "focused": {
+                                        "borderColor": "color-info-transparent-200",
+                                        "backgroundColor": "color-info-transparent-200"
+                                    },
+                                    "hover": {
+                                        "borderColor": "color-info-transparent-200",
+                                        "backgroundColor": "color-info-transparent-200"
+                                    },
+                                    "active": {
+                                        "borderColor": "color-info-transparent-200",
+                                        "backgroundColor": "color-info-transparent-200"
+                                    },
+                                    "disabled": {
+                                        "borderColor": "color-info-disabled-border",
+                                        "backgroundColor": "color-info-disabled",
+                                        "textColor": "text-disabled-color",
+                                        "iconTintColor": "text-disabled-color"
+                                    }
+                                }
+                            },
+                            "warning": {
+                                "borderColor": "color-primary-default-border",
+                                "backgroundColor": "color-primary-default",
+                                "textColor": "text-control-color",
+                                "iconTintColor": "text-control-color",
+                                "state": {
+                                    "focused": {
+                                        "borderColor": "color-primary-focus-border",
+                                        "backgroundColor": "color-primary-focus"
+                                    },
+                                    "hover": {
+                                        "borderColor": "color-primary-hover-border",
+                                        "backgroundColor": "color-primary-hover"
+                                    },
+                                    "active": {
+                                        "borderColor": "color-primary-active-border",
+                                        "backgroundColor": "color-primary-active"
+                                    },
+                                    "disabled": {
+                                        "borderColor": "color-primary-disabled-border",
+                                        "backgroundColor": "color-primary-disabled",
+                                        "textColor": "text-disabled-color",
+                                        "iconTintColor": "text-disabled-color"
+                                    }
+                                }
+                            },
+                            "danger": {
+                                "borderColor": "color-danger-default-border",
+                                "backgroundColor": "color-danger-default",
+                                "textColor": "text-control-color",
+                                "iconTintColor": "text-control-color",
+                                "state": {
+                                    "focused": {
+                                        "borderColor": "color-danger-focus-border",
+                                        "backgroundColor": "color-danger-focus"
+                                    },
+                                    "hover": {
+                                        "borderColor": "color-danger-hover-border",
+                                        "backgroundColor": "color-danger-hover"
+                                    },
+                                    "active": {
+                                        "borderColor": "color-danger-active-border",
+                                        "backgroundColor": "color-danger-active"
+                                    },
+                                    "disabled": {
+                                        "borderColor": "color-danger-disabled-border",
+                                        "backgroundColor": "color-danger-disabled",
+                                        "textColor": "text-disabled-color",
+                                        "iconTintColor": "text-disabled-color"
+                                    }
+                                }
+                            },
+                            "control": {
+                                "borderColor": "color-control-default-border",
+                                "backgroundColor": "color-control-default",
+                                "textColor": "color-basic-800",
+                                "iconTintColor": "color-basic-800",
+                                "state": {
+                                    "focused": {
+                                        "borderColor": "color-control-focus-border",
+                                        "backgroundColor": "color-control-focus"
+                                    },
+                                    "hover": {
+                                        "borderColor": "color-control-hover-border",
+                                        "backgroundColor": "color-control-hover"
+                                    },
+                                    "active": {
+                                        "borderColor": "color-control-active-border",
+                                        "backgroundColor": "color-control-active"
+                                    },
+                                    "disabled": {
+                                        "borderColor": "color-control-disabled-border",
+                                        "backgroundColor": "color-control-disabled",
+                                        "textColor": "text-disabled-color",
+                                        "iconTintColor": "text-disabled-color"
+                                    }
+                                }
+                            }
+                        },
+                        "size": {
+                            "medium": {
+                                "minWidth": 50,
+                                "minHeight": 25,
+                                "borderRadius": "border-radius",
+                                "borderWidth": "border-width",
+                                "paddingHorizontal": 10,
+                                "paddingVertical": 7,
+                                "textMarginHorizontal": 0,
+                                "textFontSize": 12,
+                                "textFontWeight": "normal",
+                                "iconWidth": 20,
+                                "iconHeight": 20,
+                                "iconMarginHorizontal": 0
+                            }
+                        }
+                    }
                 }
             }
         },

+ 12 - 4
models/httpModel.js

@@ -3,7 +3,7 @@ import qs from "qs";
 import { AsyncStorage } from "react-native";
 export default {
     state: {
-        baseUrl: "http://localhost:8080",
+        baseUrl: "http://192.168.50.91:8080",
         token: "",
         config: {},
     },
@@ -19,9 +19,15 @@ export default {
             const axiosInstance = axios.create({
                 baseURL: baseUrl,
             });
-            axiosInstance.interceptors.request.use(setConfig, setConfigError);
+            axiosInstance.interceptors.request.use(
+                (config) => setConfig(config),
+                (error) => setConfigError(error)
+            );
 
-            axiosInstance.interceptors.response.use(successEvent, errorEvent);
+            axiosInstance.interceptors.response.use(
+                (response) => successEvent(response),
+                (error) => errorEvent(error)
+            );
             return axiosInstance;
         },
         async setConfig(config) {
@@ -39,7 +45,7 @@ export default {
             return response;
         },
         errorEvent(error) {
-            console.log(error);
+            console.log(error.response);
             if (error.response.status) {
                 error.response.data.status = error.response.status;
             }
@@ -47,6 +53,7 @@ export default {
         },
         httpGet(url, params) {
             const { getAxiosInstance } = model();
+            const { warnning } = model("loadingModel");
             params = params || {};
             return new Promise((resolve, reject) => {
                 getAxiosInstance()
@@ -82,6 +89,7 @@ export default {
             });
         },
         addAsyncStorage(key, value) {
+            console.log(value);
             return AsyncStorage.setItem(key, value);
         },
         removeAsyncStorage(key) {

+ 0 - 2
models/index.js

@@ -4,11 +4,9 @@ import userModel from "./userModel";
 import wordsModel from "./wordsModel";
 import loadingModel from "./loadingModel";
 import barModel from "./barModel";
-import routersModel from "./routersModel";
 
 setModel("barModel", barModel);
 setModel("userModel", userModel);
 setModel("loadingModel", loadingModel);
 setModel("wordsModel", wordsModel);
 setModel("httpModel", httpModel);
-setModel("routersModel", routersModel);

+ 14 - 6
models/routersModel.js

@@ -4,23 +4,31 @@ export default {
         routerState: "",
         nowName: "",
         navigation: "",
+        topNavigation: "",
     },
     actions: ({ model, setState }) => ({
-        changeRouter(state) {
-            console.log(state);
-            setState({ routerState: state });
+        setTopNavigation(navigation) {
+            console.log(navigation);
+            setState({ topNavigation: navigation });
         },
         setNavigation(navigation) {
-            console.log(navigation);
             setState({ navigation: navigation });
         },
+        pushTopRouter(to, screen, params) {
+            const { topNavigation } = model();
+            topNavigation.navigate(to, { screen: screen, params: params });
+        },
+        replaceTopRouter(to) {
+            const { topNavigation } = model();
+            topNavigation.replace(to);
+        },
         pushRouter(to) {
             const { navigation } = model();
             navigation.navigate(to);
         },
-        replaceRouter(to) {
+        replaceRouter(to, screen, params) {
             const { navigation } = model();
-            navigation.replace(to);
+            navigation.replace(to, { screen: screen, params: params });
         },
         backRouter() {
             const { navigation } = model();

+ 7 - 9
models/userModel.js

@@ -52,20 +52,21 @@ export default {
         loginByPassword(phone, password) {
             const { httpPost, addAsyncStorage } = model("httpModel");
             const { checkLogin } = model();
-            const { loading, success } = model("loadingModel");
-            httpPost("/auth/loginByRegister", {
-                phone: phone,
+            const { loading, success, warnning } = model("loadingModel");
+
+            return httpPost("/auth/login", {
+                username: phone,
                 password: password,
             })
                 .then((res) => {
-                    addAsyncStorage("token", res);
                     if (res) {
+                        addAsyncStorage("token", res);
                         success("登录成功");
                         checkLogin();
                     }
                 })
                 .catch((e) => {
-                    console.log(e);
+                    warnning(e.error);
                 });
         },
         loginByCode(phone, code) {
@@ -85,7 +86,6 @@ export default {
         },
         registerFirst({ ...data }) {
             setState({ registerInfo: data });
-            const { pushRouter } = model("routersModel");
             pushRouter("RegisterSe");
         },
         registerUser({ ...data }) {
@@ -121,7 +121,6 @@ export default {
                     guideStep: "finish",
                 });
             } else {
-                const { replaceRouter, resetRouter } = model("routersModel");
                 replaceRouter(next);
             }
         },
@@ -147,7 +146,6 @@ export default {
         },
         updateMerchant({ ...data }) {
             const { mid, getUserInfo } = model();
-            const { loading, success } = model("loadingModel");
             const { httpPost, addAsyncStorage } = model("httpModel");
             return httpPost(
                 "/merchant/saveDTO",
@@ -157,7 +155,7 @@ export default {
                 },
                 { body: "json" }
             ).then((res) => {
-                success("修改成功");
+                // success("修改成功");
                 if (res) {
                     getUserInfo(res);
                 }

+ 2 - 2
navigation/BottomTabNavigator.js

@@ -5,15 +5,15 @@ import TabBarIcon from "../components/TabBarIcon";
 import LinksScreen from "../screens/LinksScreen";
 import HomeScreen from "../screens/HomeScreen";
 import { useModel } from "flooks";
+import { useFocusEffect } from "@react-navigation/native";
 
 const BottomTab = createBottomTabNavigator();
 
 export default function BottomTabNavigator({ navigation, route }) {
     const theme = useTheme();
     const { tab1, tab2, tab3 } = useModel("wordsModel");
-
     return (
-        <BottomTab.Navigator headerMode='none'>
+        <BottomTab.Navigator headerMode='none' initialRouteName='Home'>
             <BottomTab.Screen
                 name='Home'
                 component={HomeScreen}

+ 3 - 2
navigation/LoginStackNavigator.js

@@ -8,6 +8,7 @@ import { useModel } from "flooks";
 import LoginScreen from "../screens/LoginScreen";
 import RegisterScreen from "../screens/RegisterScreen";
 import RegisterSeScreen from "../screens/RegisterSeScreen";
+import { useFocusEffect } from "@react-navigation/native";
 const LoginStack = createStackNavigator();
 
 const config = {
@@ -22,7 +23,7 @@ const config = {
     },
 };
 
-export default function LoginStackNavigator() {
+export default function LoginStackNavigator({ navigation, route }) {
     return (
         <LoginStack.Navigator
             headerMode='none'
@@ -30,7 +31,7 @@ export default function LoginStackNavigator() {
                 gestureEnabled: true,
                 cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS,
             }}
-            initialRouteName='RegisterSe'
+            initialRouteName='Login'
         >
             <LoginStack.Screen name='Login' component={LoginScreen} />
             <LoginStack.Screen name='Register' component={RegisterScreen} />

+ 11 - 0
navigation/RootNavigation.js

@@ -0,0 +1,11 @@
+// RootNavigation.js
+
+import * as React from 'react';
+
+export const navigationRef = React.createRef();
+
+export function navigate(name, params) {
+  navigationRef.current?.navigate(name, params);
+}
+
+// add other navigation functions that you need and export them

+ 5 - 7
navigation/HomeStackNavigator.js → navigation/RootStackNavigator.js

@@ -5,10 +5,9 @@ import {
 import * as React from "react";
 import { useModel } from "flooks";
 
-import HomeScreen from "../screens/HomeScreen";
 import Guide1Screen from "../screens/Guide1Screen";
 import EditBanner from "../screens/EditBannerScreen";
-const HomeStack = createStackNavigator();
+const RootStack = createStackNavigator();
 
 const config = {
     animation: "spring",
@@ -24,7 +23,7 @@ const config = {
 
 export default function LoginStackNavigator() {
     return (
-        <HomeStack.Navigator
+        <RootStack.Navigator
             headerMode='none'
             screenOptions={{
                 gestureEnabled: true,
@@ -32,12 +31,11 @@ export default function LoginStackNavigator() {
             }}
             initialRouteName='AddGoods'
         >
-            <HomeStack.Screen name='AddGoods' component={Guide1Screen} />
-            <HomeStack.Screen
+            <RootStack.Screen name='AddGoods' component={Guide1Screen} />
+            <RootStack.Screen
                 name='EditBanner'
                 component={EditBanner}
-                initialParams={{ type: "banner" }}
             />
-        </HomeStack.Navigator>
+        </RootStack.Navigator>
     );
 }

+ 1 - 0
package.json

@@ -30,6 +30,7 @@
     "expo-file-system": "~8.1.0",
     "expo-font": "~8.1.0",
     "expo-image-picker": "~8.1.0",
+    "expo-linking": "^1.0.1",
     "expo-localization": "~8.1.0",
     "expo-web-browser": "~8.2.0",
     "flooks": "^1.2.0",

+ 0 - 2
screens/AddGoodsClassification.js

@@ -34,7 +34,6 @@ const Header = (props, title) => (
 export default function AddGoodsClassification({ navigation, route }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-    const { setNavigation, pushRouter } = useModel("routersModel", true);
     const { httpGet } = useModel("httpModel", true);
     const { registerSecend, guideStep } = useModel("userModel", true);
 
@@ -49,7 +48,6 @@ export default function AddGoodsClassification({ navigation, route }) {
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
-            setNavigation(navigation);
         }, [])
     );
 

+ 14 - 4
screens/EditBannerScreen.js

@@ -29,7 +29,6 @@ import UpLoadImage from "../components/UpLoadImage";
 export default function EditBannerScreen({ navigation, route }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-    const { setNavigation, pushRouter } = useModel("routersModel", true);
     const { banner, logo, uploadStoreImg } = useModel("userModel");
 
     const [img, changeImg] = React.useState("");
@@ -47,7 +46,6 @@ export default function EditBannerScreen({ navigation, route }) {
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
-            setNavigation(navigation);
             if (route.params.type) {
                 setType(route.params.type);
             }
@@ -62,8 +60,12 @@ export default function EditBannerScreen({ navigation, route }) {
             <ScrollPage>
                 <Layout style={styles.container}>
                     <Layout style={styles.top}>
-                        <Image source={banner} style={styles.banner} />
-
+                        <Image
+                            source={type == "banner" ? banner : logo}
+                            style={[
+                                type == "banner" ? styles.banner : styles.logo,
+                            ]}
+                        />
                         <Button
                             style={styles.remove}
                             size='tiny'
@@ -134,9 +136,17 @@ const styles = StyleSheet.create({
         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",

+ 0 - 2
screens/Guide1Screen.js

@@ -30,7 +30,6 @@ import NavHeaderBar from "../components/NavHeaderBar";
 export default function Guide1Screen({ navigation, route }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-    const { setNavigation, pushRouter } = useModel("routersModel", true);
     const { httpGet, httpPost } = useModel("httpModel", true);
     const { success } = useModel("loadingModel", true);
     const { mid, changeGuideStep } = useModel("userModel", true);
@@ -81,7 +80,6 @@ export default function Guide1Screen({ navigation, route }) {
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
-            setNavigation(navigation);
             console.log(route.params);
             if (route.params) {
                 if (route.params.id) {

+ 0 - 2
screens/Guide2Screen.js

@@ -29,7 +29,6 @@ import Textarea from "react-native-textarea";
 export default function Guide1Screen({ navigation, route }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-    const { setNavigation, pushRouter } = useModel("routersModel", true);
     const { httpGet } = useModel("httpModel", true);
     const { registerSecend, changeGuideStep } = useModel("userModel", true);
 
@@ -54,7 +53,6 @@ export default function Guide1Screen({ navigation, route }) {
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
-            setNavigation(navigation);
         }, [])
     );
 

+ 0 - 2
screens/Guide3Screen.js

@@ -29,7 +29,6 @@ import Textarea from "react-native-textarea";
 export default function Guide1Screen({ navigation, route }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-    const { setNavigation, pushRouter } = useModel("routersModel", true);
     const { httpGet } = useModel("httpModel", true);
     const { saveMerchant, guideStep, checkInfo } = useModel("userModel", true);
 
@@ -47,7 +46,6 @@ export default function Guide1Screen({ navigation, route }) {
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
-            setNavigation(navigation);
             checkInfo({
                 aliAccountEvent: changeAliAccount,
                 aliNameEvent: changeAliName,

+ 0 - 2
screens/Guide4Screen.js

@@ -29,7 +29,6 @@ import Textarea from "react-native-textarea";
 export default function Guide1Screen({ navigation, route }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-    const { setNavigation, pushRouter } = useModel("routersModel", true);
     const { httpGet } = useModel("httpModel", true);
     const { saveMerchant, changeGuideStep } = useModel("userModel", true);
 
@@ -37,7 +36,6 @@ export default function Guide1Screen({ navigation, route }) {
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
-            setNavigation(navigation);
         }, [])
     );
 

+ 31 - 27
screens/HomeScreen.js

@@ -8,7 +8,6 @@ import {
     View,
     ImageBackground,
 } from "react-native";
-import * as ImagePicker from "expo-image-picker";
 import scrollPage from "../decorator/scrollPage";
 import { useModel } from "flooks";
 import Badge from "../components/Badge";
@@ -28,12 +27,14 @@ import {
     Modal,
 } from "@ui-kitten/components";
 import FormInput from "../components/FormInput";
-import { useFocusEffect } from "@react-navigation/native";
+import { useFocusEffect, useNavigation } from "@react-navigation/native";
 import ScrollPage from "../components/ScrollPage";
 import NavHeaderBar from "../components/NavHeaderBar";
 import GoodsCard from "../components/GoodsCard";
 import Textarea from "react-native-textarea";
 import HomePage1 from "./HomeScreenPage1";
+import HomePage2 from "./HomeScreenPage2";
+import * as RootNavigation from "../navigation/RootNavigation.js";
 
 const NextIcon = (props) => <Icon {...props} name='arrow-ios-downward' />;
 
@@ -47,10 +48,9 @@ const InfoIcon = (props) => <Icon {...props} name='info' />;
 
 const LogoutIcon = (props) => <Icon {...props} name='log-out' />;
 
-export default function HomeScreen({ navigation, route }) {
+export default function HomeScreen() {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-    const { setNavigation, pushRouter } = useModel("routersModel", true);
     const {
         showName,
         logo,
@@ -77,19 +77,15 @@ export default function HomeScreen({ navigation, route }) {
 
     const { showDialog } = useModel("dialogModel", true);
     const { httpPost } = useModel("httpModel", true);
-    const [selectedIndex, setSelectedIndex] = React.useState(0);
+    const [selectedIndex, setSelectedIndex] = React.useState(1);
+    const navigation = useNavigation();
 
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
-            setNavigation(navigation);
         }, [])
     );
 
-    const canNext = React.useMemo(() => {
-        return true;
-    }, [name]);
-
     const [menuVisible, setMenuVisible] = React.useState(false);
 
     const toggleMenu = () => {
@@ -131,16 +127,12 @@ export default function HomeScreen({ navigation, route }) {
                     <ImageBackground source={banner} style={styles.banner}>
                         <Button
                             appearance='bannerButton'
-                            onPress={() => {
-                                pushRouter("EditBanner");
-                                // _pickImage().then((img) => {
-                                //     httpPost("/upload/base64", {
-                                //         base64: img,
-                                //     }).then((res) => {
-                                //         updateMerchant({ banner: res });
-                                //     });
-                                // });
-                            }}
+                            onPress={() =>
+                                RootNavigation.navigate("Basic", {
+                                    screen: "EditBanner",
+                                    params: { type: "banner" },
+                                })
+                            }
                         >
                             {homeTip1}
                         </Button>
@@ -151,7 +143,17 @@ export default function HomeScreen({ navigation, route }) {
                         appearance='homeCard'
                         style={styles.homeCard}
                     >
-                        <Image source={logo} style={styles.icon} />
+                        <TouchableOpacity
+                            style={styles.touch}
+                            onPress={() =>
+                                RootNavigation.navigate("Basic", {
+                                    screen: "EditBanner",
+                                    params: { type: "logo" },
+                                })
+                            }
+                        >
+                            <Image source={logo} style={styles.icon} />
+                        </TouchableOpacity>
 
                         <Layout style={styles.cardMain}>
                             <Layout style={styles.cardTop}>
@@ -242,9 +244,7 @@ export default function HomeScreen({ navigation, route }) {
                                 appearance='homeTab'
                                 style={styles.tab}
                             >
-                                <Layout style={styles.tabContainer}>
-                                    <Text category='h5'>ORDERS</Text>
-                                </Layout>
+                                <HomePage2 />
                             </Tab>
                             <Tab
                                 title={homeTab3}
@@ -268,16 +268,20 @@ const styles = StyleSheet.create({
         flex: 1,
         backgroundColor: "#F0F0F0",
     },
-    icon: {
+    touch: {
         width: 53,
         height: 53,
-        backgroundColor: "#E5E5E5",
-        borderRadius: 3,
         position: "absolute",
         left: 10,
         top: 10,
         zIndex: 2,
     },
+    icon: {
+        width: 53,
+        height: 53,
+        backgroundColor: "#E5E5E5",
+        borderRadius: 3,
+    },
     text: {
         fontWeight: "500",
         marginBottom: 7,

+ 167 - 0
screens/HomeScreenPage2.js

@@ -0,0 +1,167 @@
+import * as React from "react";
+import {
+    Icon,
+    useTheme,
+    Text,
+    Card,
+    Layout,
+    List,
+    ListItem,
+    Button,
+} from "@ui-kitten/components";
+import {
+    Image,
+    Platform,
+    StyleSheet,
+    TouchableOpacity,
+    View,
+    ImageBackground,
+    Dimensions,
+} from "react-native";
+import { useFocusEffect } from "@react-navigation/native";
+import { useModel } from "flooks";
+import GoodsCard from "../components/GoodsCardVertical";
+import GoodsCardLarge from "../components/GoodsCard";
+import Badge from "../components/Badge";
+
+const width = Dimensions.get("window").width;
+const height = Dimensions.get("window").height;
+export default function HomePage1(props) {
+    const theme = useTheme();
+    const { httpPost, httpGet } = useModel("httpModel", true);
+    const [commentList, setCommentList] = React.useState([]);
+    const [selectId, changeSelectId] = React.useState(0);
+    const { showDialog } = useModel("dialogModel", true);
+
+    const { editText, autoBackText } = useModel("wordsModel");
+    useFocusEffect(
+        React.useCallback(() => {
+            // httpGet("/classification/my").then((res) => {
+            //     setClassifications(res);
+            //     if (res.length > 0) {
+            //         changeSelectId(res[0].id);
+            //     }
+            // });
+        }, [])
+    );
+
+
+    return (
+        <Layout style={styles.tabContainer}>
+            <Layout style={styles.bageList}>
+                <Badge appearance='fill' status='warning' right={5} bottom={4}>
+                    全部7345
+                </Badge>
+                <Badge appearance='fill' right={5} bottom={4}>
+                    最新
+                </Badge>
+                <Badge appearance='fill' right={5} bottom={4}>
+                    好评1213
+                </Badge>
+                <Badge appearance='fill' status='info' right={5} bottom={4}>
+                    差评12
+                </Badge>
+                <Badge appearance='fill' right={5} bottom={4}>
+                    最新
+                </Badge>
+                <Badge appearance='fill' right={5} bottom={4}>
+                    好评1213
+                </Badge>
+                <Badge appearance='fill' status='info' right={5} bottom={4}>
+                    差评12
+                </Badge>
+            </Layout>
+            <Layout style={styles.back}>
+                <Text
+                    style={styles.backText}
+                    category='label'
+                    status='info'
+                    ellipsizeMode='tail'
+                    numberOfLines={1}
+                >
+                    暂无自动回复暂无自动回复暂无自动回复暂无自动回复
+                </Text>
+
+                <Button
+                    style={styles.backButtn}
+                    size='tiny'
+                    appearance='ghost'
+                    onPress={() => {
+                        showDialog({
+                            pla: "",
+                            maxLength: 50,
+                            defaultValue: "",
+                            isEdit: true,
+                            title: editText + autoBackText,
+                            cancelable: true,
+                            confirmCallback: (info) => {
+                                // updateMerchant({ proclamation: info });
+                            },
+                        });
+                    }}
+                >
+                    {editText}
+                </Button>
+            </Layout>
+
+            <Layout>
+                <List
+                    style={styles.container}
+                    data={commentList}
+                    renderItem={classificationItem}
+                />
+            </Layout>
+        </Layout>
+    );
+}
+const classificationItem = ({ item, index }) => (
+    <ListItem
+        appearance='classification'
+        title={(textprops) => (
+            <Text
+                {...textprops}
+                style={[textprops.style, { textAlign: "center" }]}
+            >
+                {item.name}
+            </Text>
+        )}
+    />
+);
+const StarIcon = (props) => <Icon {...props} name='plus-outline' />;
+
+const goodsItem = ({ item, index }) => (
+    <GoodsCardLarge appearance='classification' />
+);
+
+const styles = StyleSheet.create({
+    tabContainer: {
+        backgroundColor: "#fff",
+        paddingTop: 20,
+        paddingBottom: 80,
+    },
+    bageList: {
+        flexDirection: "row",
+        flexWrap: "wrap",
+        paddingHorizontal: 15,
+        paddingBottom: 9,
+    },
+    back: {
+        paddingLeft: 15,
+        paddingBottom: 5,
+        flexDirection: "row",
+    },
+    backText: {
+        width: 200,
+        borderRadius: 3,
+        backgroundColor: "#EEEEEE",
+        height: 23,
+        lineHeight: 23,
+        paddingLeft: 5,
+    },
+    backButtn: {
+        marginLeft: 10,
+    },
+    container: {
+        height: 300,
+    },
+});

+ 14 - 9
screens/LoginScreen.js

@@ -20,12 +20,12 @@ import {
 } from "@ui-kitten/components";
 import FormInput from "../components/FormInput";
 import { useFocusEffect } from "@react-navigation/native";
+import * as RootNavigation from "../navigation/RootNavigation.js";
 // import { useAndroidBackHandler } from "react-navigation-backhandler";
 
 export default function LoginScreen({ navigation, route }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel", true);
-    const { setNavigation, pushRouter } = useModel("routersModel", true);
     const {
         welcom,
         login_tab_1,
@@ -77,7 +77,6 @@ export default function LoginScreen({ navigation, route }) {
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["color-primary-100"]);
-            setNavigation(navigation);
         }, [])
     );
     return (
@@ -114,7 +113,7 @@ export default function LoginScreen({ navigation, route }) {
                                     placeholder={login_pla_1}
                                     onChange={changePhone}
                                     textAlign='right'
-                                    labelStyle={{width:50}}
+                                    labelStyle={{ width: 50 }}
                                 />
 
                                 {/* 密码 */}
@@ -125,7 +124,7 @@ export default function LoginScreen({ navigation, route }) {
                                     placeholder={login_pla_2}
                                     onChange={changePassword}
                                     textAlign='right'
-                                    labelStyle={{width:50}}
+                                    labelStyle={{ width: 50 }}
                                 />
                             </Layout>
                         </Tab>
@@ -139,7 +138,7 @@ export default function LoginScreen({ navigation, route }) {
                                     placeholder={login_pla_1}
                                     onChange={changePhone}
                                     textAlign='right'
-                                    labelStyle={{width:50}}
+                                    labelStyle={{ width: 50 }}
                                 />
 
                                 {/* 验证码 */}
@@ -151,7 +150,7 @@ export default function LoginScreen({ navigation, route }) {
                                     onChange={changeCode}
                                     textAlign='right'
                                     btnText={login_btn_code_1}
-                                    labelStyle={{width:50}}
+                                    labelStyle={{ width: 50 }}
                                 />
                             </Layout>
                         </Tab>
@@ -166,7 +165,7 @@ export default function LoginScreen({ navigation, route }) {
                             appearance='ghost'
                             status='basic'
                             size='tiny'
-                            onPress={() => pushRouter("Register")}
+                            onPress={() => RootNavigation.navigate("Register")}
                         >
                             {login_btn_rej}
                         </Button>
@@ -178,9 +177,15 @@ export default function LoginScreen({ navigation, route }) {
                             disabled={!canLogin}
                             onPress={() => {
                                 if (selectedIndex === 0) {
-                                    loginByPassword(phone, password);
+                                    loginByPassword(phone, password).then(
+                                        (_) => {
+                                            RootNavigation.navigate("Root");
+                                        }
+                                    );
                                 } else {
-                                    loginByCode(phone, code);
+                                    loginByCode(phone, code).then((_) => {
+                                        RootNavigation.navigate("Root");
+                                    });
                                 }
                             }}
                         >

+ 0 - 2
screens/RegisterScreen.js

@@ -26,7 +26,6 @@ import ConnectButton from "../components/ConnectButton";
 export default function RegisterScreen({ navigation, route }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-    const { setNavigation, pushRouter } = useModel("routersModel", true);
 
     const {
         welcom,
@@ -49,7 +48,6 @@ export default function RegisterScreen({ navigation, route }) {
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["background-basic-color-1"]);
-            setNavigation(navigation);
         }, [])
     );
 

+ 0 - 2
screens/RegisterSeScreen.js

@@ -29,7 +29,6 @@ import OpenTime from "../components/OpenTime";
 export default function RegisterScreen({ navigation, route }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-    const { setNavigation, pushRouter } = useModel("routersModel", true);
     const { httpGet } = useModel("httpModel", true);
     const { registerSecend } = useModel("userModel", true);
 
@@ -53,7 +52,6 @@ export default function RegisterScreen({ navigation, route }) {
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
-            setNavigation(navigation);
             httpGet("/category/tree", { id: 1 }).then((res) => {
                 changeCategoryList(res);
             });

+ 0 - 2
screens/StoreAudit.js

@@ -28,7 +28,6 @@ import GoodsCard from "../components/GoodsCard";
 export default function StoreAudit({ navigation, route }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-    const { setNavigation, pushRouter } = useModel("routersModel", true);
     const { status, changeGuideStep } = useModel("userModel");
 
     const {
@@ -44,7 +43,6 @@ export default function StoreAudit({ navigation, route }) {
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
-            setNavigation(navigation);
         }, [])
     );
 

+ 9 - 0
yarn.lock

@@ -4633,6 +4633,15 @@ expo-linear-gradient@~8.1.0:
   resolved "https://registry.yarnpkg.com/expo-linear-gradient/-/expo-linear-gradient-8.1.0.tgz#6933765cf1e76ef2928fd8495e779929699ac4c6"
   integrity sha512-AIy2pOXQRcgk2XE5IgAzd1S2jTFLutiDfveNm6m3fPAk00Rw4qFe98qzte1ayNrGYLJvQ2xq/Y7C0BmBP051mg==
 
+expo-linking@^1.0.1:
+  version "1.0.1"
+  resolved "https://registry.yarnpkg.com/expo-linking/-/expo-linking-1.0.1.tgz#2c1b6e68f8d5f4e54add5670290a4eacb263199d"
+  integrity sha512-PZNT/1dJv7ZBAXxUFzcvQ5MN74E/yOPrk4UwnxvLoNOmo5fyXcP3BJJPQSIKFGLvVtzl71KJJxYtb+KsR4JvNQ==
+  dependencies:
+    expo-constants "~9.0.0"
+    qs "^6.5.0"
+    url-parse "^1.4.4"
+
 expo-localization@~8.1.0:
   version "8.1.0"
   resolved "https://registry.yarnpkg.com/expo-localization/-/expo-localization-8.1.0.tgz#6003133e75849022918ae5638af6d553a04cde37"