panhui 5 anos atrás
pai
commit
232edbc0bd

+ 8 - 26
App.js

@@ -25,10 +25,11 @@ import Dialog from "./components/Dialog";
 import { useModel } from "flooks";
 import { useModel } from "flooks";
 import * as models from "./models";
 import * as models from "./models";
 
 
+import LoadingModel from "./navigation/LoadingModel";
 import BottomTabNavigator from "./navigation/BottomTabNavigator";
 import BottomTabNavigator from "./navigation/BottomTabNavigator";
 import LoginStackNavigator from "./navigation/LoginStackNavigator";
 import LoginStackNavigator from "./navigation/LoginStackNavigator";
 import GuideStackNavigator from "./navigation/GuideStackNavigator";
 import GuideStackNavigator from "./navigation/GuideStackNavigator";
-import RootStackNavigator from "./navigation/RootStackNavigator";
+import BasicScreens from "./navigation/BasicNavigator";
 import { navigationRef } from "./navigation/RootNavigation";
 import { navigationRef } from "./navigation/RootNavigation";
 
 
 import * as ApplyStatus from "./config/ApplyStatus";
 import * as ApplyStatus from "./config/ApplyStatus";
@@ -49,9 +50,6 @@ const config = {
 
 
 export default function App(props) {
 export default function App(props) {
     const [isLoadingComplete, setLoadingComplete] = React.useState(false);
     const [isLoadingComplete, setLoadingComplete] = React.useState(false);
-    const { checkLogin, isLogin, status, guideStep } = useModel("userModel");
-    const { getWords } = useModel("wordsModel", true);
-    const { getToken } = useModel("httpModel", true);
     // Load any resources or data that we need prior to rendering the app
     // Load any resources or data that we need prior to rendering the app
     React.useEffect(() => {
     React.useEffect(() => {
         async function loadResourcesAndDataAsync() {
         async function loadResourcesAndDataAsync() {
@@ -62,8 +60,6 @@ export default function App(props) {
                     ...Ionicons.font,
                     ...Ionicons.font,
                     "space-mono": require("./assets/fonts/SpaceMono-Regular.ttf"),
                     "space-mono": require("./assets/fonts/SpaceMono-Regular.ttf"),
                 });
                 });
-                getWords();
-                await checkLogin();
             } catch (e) {
             } catch (e) {
                 // We might want to provide this error information to an error reporting service
                 // We might want to provide this error information to an error reporting service
                 console.warn(e);
                 console.warn(e);
@@ -74,22 +70,7 @@ export default function App(props) {
         }
         }
 
 
         loadResourcesAndDataAsync();
         loadResourcesAndDataAsync();
-    }, [props.skipLoadingScreen]);
-
-    const [initialRouteName, setInitialRouteName] = React.useState("Guide");
-    // React.useEffect(() => {
-    //     if (isLogin) {
-    //         if (status !== "PASS") {
-    //             setInitialRouteName("Guide");
-    //         } else {
-    //             setInitialRouteName("Root");
-    //         }
-    //     } else {
-    //         setInitialRouteName("Login");
-    //     }
-    // }, [isLogin, guideStep]);
-
-   
+    }, []);
 
 
     if (!isLoadingComplete && !props.skipLoadingScreen) {
     if (!isLoadingComplete && !props.skipLoadingScreen) {
         return null;
         return null;
@@ -107,17 +88,16 @@ export default function App(props) {
                         <NavigationContainer ref={navigationRef}>
                         <NavigationContainer ref={navigationRef}>
                             <Stack.Navigator
                             <Stack.Navigator
                                 headerMode='none'
                                 headerMode='none'
-                                initialRouteName={initialRouteName}
+                                initialRouteName='LoadingModel'
                                 screenOptions={{
                                 screenOptions={{
                                     gestureEnabled: true,
                                     gestureEnabled: true,
                                     cardStyleInterpolator:
                                     cardStyleInterpolator:
                                         CardStyleInterpolators.forHorizontalIOS,
                                         CardStyleInterpolators.forHorizontalIOS,
                                 }}
                                 }}
                             >
                             >
-                                {/* 基础功能页面 */}
                                 <Stack.Screen
                                 <Stack.Screen
-                                    name='Basic'
-                                    component={RootStackNavigator}
+                                    name='LoadingModel'
+                                    component={LoadingModel}
                                 />
                                 />
                                 {/* 首页tab组件页面 */}
                                 {/* 首页tab组件页面 */}
                                 <Stack.Screen
                                 <Stack.Screen
@@ -134,6 +114,8 @@ export default function App(props) {
                                     name='Login'
                                     name='Login'
                                     component={LoginStackNavigator}
                                     component={LoginStackNavigator}
                                 />
                                 />
+                                {/* 基础功能页面 */}
+                                {BasicScreens(Stack.Screen)}
                             </Stack.Navigator>
                             </Stack.Navigator>
                         </NavigationContainer>
                         </NavigationContainer>
                     </Layout>
                     </Layout>

+ 45 - 40
app.json

@@ -1,41 +1,46 @@
 {
 {
-    "expo": {
-        "name": "Dingdong",
-        "slug": "Dingdong",
-        "platforms": ["android"],
-        "version": "1.0.0",
-        "orientation": "portrait",
-        "icon": "./assets/images/icon.png",
-        "scheme": "myapp",
-        "splash": {
-            "image": "./assets/images/splash.png",
-            "resizeMode": "contain",
-            "backgroundColor": "#FFC21C"
-        },
-        "backgroundColor": "#fff",
-        "primaryColor": "#FFC21C",
-        "updates": {
-            "fallbackToCacheTimeout": 0
-        },
-        "assetBundlePatterns": ["**/*"],
-        "ios": {
-            "supportsTablet": true
-        },
-        "android": {
-            "package": "com.izouma.izouma",
-            "versionCode": 1,
-            "permissions": [
-                "CAMERA",
-                "READ_INTERNAL_STORAGE",
-                "WRITE_INTERNAL_STORAGE",
-                "READ_EXTERNAL_STORAGE",
-                "WRITE_EXTERNAL_STORAGE"
-            ]
-        },
-        "androidStatusBar": {
-            "backgroundColor": "#FFC21C",
-            "translucent": false
-        },
-        "description": "叮咚外卖测试版"
-    }
-}
+  "expo": {
+    "name": "Dingdong",
+    "slug": "Dingdong",
+    "platforms": [
+      "android"
+    ],
+    "version": "1.0.0",
+    "orientation": "portrait",
+    "icon": "./assets/images/icon.png",
+    "scheme": "myapp",
+    "splash": {
+      "image": "./assets/images/splash.png",
+      "resizeMode": "contain",
+      "backgroundColor": "#FFC21C"
+    },
+    "backgroundColor": "#fff",
+    "primaryColor": "#FFC21C",
+    "updates": {
+      "fallbackToCacheTimeout": 0
+    },
+    "assetBundlePatterns": [
+      "**/*"
+    ],
+    "ios": {
+      "supportsTablet": true
+    },
+    "android": {
+      "package": "com.izouma.izouma",
+      "versionCode": 1,
+      "permissions": [
+        "CAMERA",
+        "READ_INTERNAL_STORAGE",
+        "WRITE_INTERNAL_STORAGE",
+        "READ_EXTERNAL_STORAGE",
+        "WRITE_EXTERNAL_STORAGE"
+      ]
+    },
+    "androidStatusBar": {
+      "backgroundColor": "#FFC21C",
+      "translucent": false
+    },
+    "description": "叮咚外卖测试版",
+    "sdkVersion": "37.0.0"
+  }
+}

+ 16 - 0
components/EmptyComponent.js

@@ -0,0 +1,16 @@
+import * as React from "react";
+import { Icon, useTheme, Text, Button } from "@ui-kitten/components";
+import { useModel } from "flooks";
+
+export default function EmptyComponent(props) {
+    const { nothingTips } = useModel("wordsModel");
+    return (
+        <Text
+            appearance='label'
+            status='info'
+            style={{ textAlign: "center", backgroundColor: "transparent" }}
+        >
+            {nothingTips}
+        </Text>
+    );
+}

+ 9 - 3
components/FormInput.js

@@ -64,9 +64,13 @@ const FormInput = React.memo((props) => {
         } else if (props.type == "code") {
         } else if (props.type == "code") {
             _props = {
             _props = {
                 ..._props,
                 ..._props,
-                dataDetectorTypes: "phoneNumber",
                 maxLength: 6,
                 maxLength: 6,
-                keyboardType: "phone-pad",
+                keyboardType: "numeric",
+            };
+        } else if (props.type == "amount" && props.type == "money") {
+            _props = {
+                ..._props,
+                keyboardType: "numeric",
             };
             };
         }
         }
         if (props.onChange) {
         if (props.onChange) {
@@ -205,7 +209,7 @@ const FormInput = React.memo((props) => {
                     appearance='form'
                     appearance='form'
                     style={{ flex: 1 }}
                     style={{ flex: 1 }}
                     accessoryRight={ForwardIcon}
                     accessoryRight={ForwardIcon}
-                    title=' '
+                    title={props.value || " "}
                     onPress={props.changePath}
                     onPress={props.changePath}
                 />
                 />
             );
             );
@@ -314,6 +318,8 @@ const styles = StyleSheet.create({
     },
     },
     upload: {
     upload: {
         marginTop: 20,
         marginTop: 20,
+        width: 67,
+        height: 67,
     },
     },
 });
 });
 
 

+ 82 - 45
components/GoodsCard.js

@@ -12,58 +12,94 @@ import {
 import { useModel } from "flooks";
 import { useModel } from "flooks";
 export default function GoodsCard(props) {
 export default function GoodsCard(props) {
     const { add, remove } = useModel("wordsModel");
     const { add, remove } = useModel("wordsModel");
+    const { info } = props;
+    const { id, img, name, introduction, totalSales, discountAmount, amount } =
+        info || {};
     return (
     return (
         <Card
         <Card
-            style={[!props.appearance && styles.card]}
+            style={[!props.appearance && styles.card, props.style]}
             appearance={props.appearance || "goodsCard"}
             appearance={props.appearance || "goodsCard"}
+            disabled={!props.canEdit}
+            onPress={props.onPress}
         >
         >
-            <Layout style={styles.layout}>
-                <Avatar
-                    style={styles.avatar}
-                    shape='rounded'
-                    source={{
-                        uri:
-                            "https://t7.baidu.com/it/u=3616242789,1098670747&fm=79&app=86&size=h300&n=0&g=4n&f=jpeg",
-                    }}
-                />
-
-                <Layout style={styles.main}>
-                    <Text category='s1' ellipsizeMode='tail' numberOfLines={1}>
-                        原味板烧鸡腿堡麦满分套餐原味板烧鸡腿堡麦满分套餐
-                    </Text>
-                    <Text
-                        category='c1'
-                        status='info'
-                        ellipsizeMode='tail'
-                        numberOfLines={1}
-                    >
-                        原味板烧鸡腿堡麦满分套餐
-                    </Text>
-                    <Text category='c1' status='info'>
-                        月售 9999+
-                    </Text>
-                    <Layout style={styles.flex1} />
-                    <Text category='h6' status='danger'>
-                        ¥70
-                    </Text>
-                </Layout>
+            {!!id ? (
+                <Layout style={styles.layout}>
+                    <Avatar
+                        style={styles.avatar}
+                        shape='rounded'
+                        source={{
+                            uri: img,
+                        }}
+                    />
 
 
-                {!props.appearance && (
-                    <Layout style={styles.butContent}>
-                        <Button status='primary' size='tiny'>
-                            {add}
-                        </Button>
+                    <Layout style={styles.main}>
+                        <Text
+                            category='s1'
+                            ellipsizeMode='tail'
+                            numberOfLines={1}
+                        >
+                            {name || ""}
+                        </Text>
+                        <Text
+                            category='c1'
+                            status='info'
+                            ellipsizeMode='tail'
+                            numberOfLines={1}
+                        >
+                            {introduction || ""}
+                        </Text>
+                        <Text category='c1' status='info'>
+                            月售 {totalSales || 0}
+                        </Text>
+                        <Layout style={styles.flex1} />
+                        <Text category='h6' status='danger'>
+                            ¥{discountAmount}{" "}
+                            <Text
+                                category='label'
+                                status='info'
+                                style={{ textDecorationLine: "line-through" }}
+                            >
+                                ¥{amount}
+                            </Text>
+                        </Text>
                     </Layout>
                     </Layout>
-                )}
 
 
-                {props.appearance == "classification" && (
-                    <Button
-                        style={styles.miniButton}
-                        status='danger'
-                        accessoryLeft={StarIcon}
-                    />
-                )}
-            </Layout>
+                    {!props.appearance && !props.isAdd && (
+                        <Layout style={styles.butContent}>
+                            <Button
+                                status='primary'
+                                size='tiny'
+                                onPress={props.addEvent}
+                            >
+                                {add}
+                            </Button>
+                        </Layout>
+                    )}
+
+                    {!props.appearance && props.isAdd && (
+                        <Layout style={styles.butContent}>
+                            <Button
+                                status='danger'
+                                onPress={props.removeEvent}
+                                size='tiny'
+                            >
+                                {remove}
+                            </Button>
+                        </Layout>
+                    )}
+
+                    {props.appearance == "classification" &&
+                        props.type != "goodsList" && (
+                            <Button
+                                style={styles.miniButton}
+                                status='danger'
+                                accessoryLeft={StarIcon}
+                            />
+                        )}
+                </Layout>
+            ) : (
+                <Layout style={styles.layout} />
+            )}
         </Card>
         </Card>
     );
     );
 }
 }
@@ -73,6 +109,7 @@ const styles = StyleSheet.create({
     card: { marginTop: 10 },
     card: { marginTop: 10 },
     layout: {
     layout: {
         flexDirection: "row",
         flexDirection: "row",
+        height: 80,
     },
     },
     avatar: {
     avatar: {
         width: 80,
         width: 80,

+ 51 - 25
components/GoodsCardVertical.js

@@ -13,34 +13,60 @@ import { useModel } from "flooks";
 const width = Dimensions.get("window").width;
 const width = Dimensions.get("window").width;
 export default function GoodsCard(props) {
 export default function GoodsCard(props) {
     const { add, remove } = useModel("wordsModel");
     const { add, remove } = useModel("wordsModel");
+    const { info } = props;
+    const { id, img, name, introduction, totalSales, discountAmount, amount } =
+        info || {};
     return (
     return (
-        <Card style={styles.card} appearance='goodsCard' direction='vertical'>
-            <Layout style={styles.layout}>
-                <Avatar
-                    style={styles.avatar}
-                    shape='square'
-                    source={{
-                        uri:
-                            "https://t7.baidu.com/it/u=3616242789,1098670747&fm=79&app=86&size=h300&n=0&g=4n&f=jpeg",
-                    }}
-                />
+        <Card
+            style={styles.card}
+            disabled={true}
+            appearance='goodsCard'
+            direction='vertical'
+        >
+            {!!id ? (
+                <Layout style={styles.layout}>
+                    <Avatar
+                        style={styles.avatar}
+                        shape='square'
+                        source={{
+                            uri: img,
+                        }}
+                    />
 
 
-                <Layout style={styles.main}>
-                    <Text category='s1' ellipsizeMode='tail' numberOfLines={1}>
-                        原味板烧鸡腿堡麦满分套餐原味板烧鸡腿堡麦满分套餐
-                    </Text>
-                    <Text category='c1' status='info' style={styles.sub}>
-                        月售 9999+
-                    </Text>
-                    <Text category='h6' status='danger' style={styles.price}>
-                        ¥70
-                    </Text>
-                </Layout>
+                    <Layout style={styles.main}>
+                        <Text
+                            category='s1'
+                            ellipsizeMode='tail'
+                            numberOfLines={1}
+                        >
+                            {name}
+                        </Text>
+                        <Text category='c1' status='info' style={styles.sub}>
+                            月售 {totalSales}
+                        </Text>
+                        <Text category='h6' status='danger'>
+                            ¥{discountAmount}{" "}
+                            <Text
+                                category='label'
+                                status='info'
+                                style={{ textDecorationLine: "line-through" }}
+                            >
+                                ¥{amount}
+                            </Text>
+                        </Text>
+                    </Layout>
 
 
-                <Button status='danger' style={styles.remove}>
-                    {remove}
-                </Button>
-            </Layout>
+                    <Button
+                        status='danger'
+                        onPress={props.removeEvent}
+                        style={styles.remove}
+                    >
+                        {remove}
+                    </Button>
+                </Layout>
+            ) : (
+                <Layout style={styles.layout} />
+            )}
         </Card>
         </Card>
     );
     );
 }
 }

+ 13 - 0
components/LoadingNode.js

@@ -0,0 +1,13 @@
+import React from "react";
+import { Spinner, Layout } from "@ui-kitten/components";
+import { useModel } from "flooks";
+
+export default function LoadingNode(props) {
+    return (
+        <Layout
+            style={{ flex: 1, backgroundColor: "rgab(0,0,0,0.8)",alignItems: 'center',justifyContent: 'center', }}
+        >
+            <Spinner size='giant'/>
+        </Layout>
+    );
+}

+ 1 - 1
components/NavHeaderBar.js

@@ -19,7 +19,7 @@ export default function NavHeaderBar(props) {
     const renderBackAction = () => (
     const renderBackAction = () => (
         <TopNavigationAction
         <TopNavigationAction
             icon={BackIcon}
             icon={BackIcon}
-            onPress={()=>RootNavigation.goBack()}
+            onPress={() => RootNavigation.goBack()}
         />
         />
     );
     );
     return (
     return (

+ 5 - 11
components/OpenTime.js

@@ -32,18 +32,12 @@ if (Platform.OS === "android") {
 const ForwardIcon = (props) => <Icon {...props} name='arrow-ios-forward' />;
 const ForwardIcon = (props) => <Icon {...props} name='arrow-ios-forward' />;
 
 
 const titleText = (props, title, value) => (
 const titleText = (props, title, value) => (
-    <>
-        <Text
-            {...props}
-            category='s1'
-            style={{ whiteSpace: "nowrap", flex: 1, marginRight: 10 }}
-        >
-            {title}
-        </Text>
-        <Text category='c1' numberOfLines={1} ellipsizeMode='tail'>
+    <Text {...props} category='s1' numberOfLines={1} ellipsizeMode='tail'>
+        {title}
+        <Text category='c1' style={{ paddingLeft: 10 }}>
             {value}
             {value}
         </Text>
         </Text>
-    </>
+    </Text>
 );
 );
 
 
 export default function OpenTime({
 export default function OpenTime({
@@ -228,7 +222,7 @@ export default function OpenTime({
         <>
         <>
             <SelectItem
             <SelectItem
                 appearance='form'
                 appearance='form'
-                style={{ flex: 1 }}
+                style={{ flex: 1, height: 32 }}
                 accessoryRight={ForwardIcon}
                 accessoryRight={ForwardIcon}
                 title={(props) => titleText(props, showName[0], showName[1])}
                 title={(props) => titleText(props, showName[0], showName[1])}
                 onPress={openModal}
                 onPress={openModal}

+ 6 - 3
components/ScrollPage.js

@@ -3,8 +3,11 @@ import { ScrollView } from "react-native";
 
 
 export default function scrollPage(props) {
 export default function scrollPage(props) {
     return (
     return (
-        <ScrollView contentContainerStyle={{ flexGrow: 1 }}>
+        <ScrollView
+            style={[props.style]}
+            contentContainerStyle={{ flexGrow: 1 }}
+        >
             {props.children}
             {props.children}
         </ScrollView>
         </ScrollView>
-    )
-}
+    );
+}

+ 39 - 6
language/zh.js

@@ -75,6 +75,7 @@ export default {
     storeAudioText3: "恭喜!!!",
     storeAudioText3: "恭喜!!!",
     storeAudioText4: "您的店铺审核成功!",
     storeAudioText4: "您的店铺审核成功!",
     addGoods: "编辑(新增)商品",
     addGoods: "编辑(新增)商品",
+    addGoods2: "新增商品",
 
 
     homeBar: "我的店面",
     homeBar: "我的店面",
     homeTip1: "添加banner",
     homeTip1: "添加banner",
@@ -89,6 +90,26 @@ export default {
 
 
     bannerTitle: "banner",
     bannerTitle: "banner",
     logoTitle: "商家头像",
     logoTitle: "商家头像",
+
+    userTitle1: "基本信息",
+    userTitle2: "我的优惠",
+    userTitle3: "我的商品",
+    userTitle4: "订单",
+    userTitle5: "评价",
+    userTitle6: "我的叮咚币",
+    userTitle21: "满减",
+    userTitle22: "折扣商品",
+    userTitle23: "首单",
+    userTitle24: "优惠券管理",
+    userTitle31: "编辑商品",
+    userTitle32: "商品分类",
+    userTitle33: "招牌商品",
+    userTitle34: "我的推荐位",
+    userTitle41: "自动接单、订单语音设置",
+    userTitle42: "我的对账单",
+    userTitle61: "余额查询",
+    userTitle62: "账单查询",
+
     //公共的文字
     //公共的文字
 
 
     changeToEnglish: "切换到泰文",
     changeToEnglish: "切换到泰文",
@@ -120,10 +141,22 @@ export default {
     tab1: "店面",
     tab1: "店面",
     tab2: "订单",
     tab2: "订单",
     tab3: "我的",
     tab3: "我的",
-    editText:'编辑',
-    uplaodText:'上传',
-    uplaodImg:'上传图片',
-    removeTips:'确定要移除吗?移除后不可恢复',
-    autoBackText:'自动回复',
-    storeBackInfo:"商家回复"
+    editText: "编辑",
+    uplaodText: "上传",
+    uplaodImg: "上传图片",
+    removeTips: "确定要移除吗?移除后不可恢复",
+    autoBackText: "自动回复",
+    storeBackInfo: "商家回复",
+    delText: "删除",
+    successText: "成功",
+    addClassTips: "当前已经有两个推荐商品,请先移除后添加。",
+    nothingTips: "暂无数据",
+    fullReduction1: "满",
+    fullReduction2: "减",
+
+    NOTRECEIVED:'未接单',
+    RECEIVED:'已接单',
+    REJECTED:'退单',
+    COMPLETED:'已完成'
+
 };
 };

+ 6 - 6
mapping.json

@@ -182,15 +182,15 @@
                                 "iconMarginHorizontal": 6
                                 "iconMarginHorizontal": 6
                             },
                             },
                             "small": {
                             "small": {
-                                "minWidth": "size-small",
-                                "minHeight": "size-small",
+                                "minWidth": 49,
+                                "minHeight": 22,
                                 "borderRadius": "border-radius",
                                 "borderRadius": "border-radius",
                                 "borderWidth": "border-width",
                                 "borderWidth": "border-width",
-                                "paddingHorizontal": 8,
-                                "paddingVertical": 8,
-                                "textMarginHorizontal": 8,
+                                "paddingHorizontal": 7,
+                                "paddingVertical": 3,
+                                "textMarginHorizontal": 7,
                                 "textFontSize": 12,
                                 "textFontSize": 12,
-                                "textFontWeight": "bold",
+                                "textFontWeight": "normal",
                                 "iconWidth": 16,
                                 "iconWidth": 16,
                                 "iconHeight": 16,
                                 "iconHeight": 16,
                                 "iconMarginHorizontal": 8
                                 "iconMarginHorizontal": 8

+ 5 - 3
models/httpModel.js

@@ -6,6 +6,7 @@ export default {
         baseUrl: "http://dingdong.izouma.com",
         baseUrl: "http://dingdong.izouma.com",
         token: "",
         token: "",
         config: {},
         config: {},
+        httpLoading: false,
     },
     },
     actions: ({ model, setState }) => ({
     actions: ({ model, setState }) => ({
         getAxiosInstance() {
         getAxiosInstance() {
@@ -31,23 +32,24 @@ export default {
             return axiosInstance;
             return axiosInstance;
         },
         },
         async setConfig(config) {
         async setConfig(config) {
+            setState({ httpLoading: true });
             config.headers = config.headers || {};
             config.headers = config.headers || {};
             let token = await AsyncStorage.getItem("token");
             let token = await AsyncStorage.getItem("token");
-            console.log(token);
             if (token) {
             if (token) {
                 config.headers["Authorization"] = "Bearer " + token;
                 config.headers["Authorization"] = "Bearer " + token;
             }
             }
             return config;
             return config;
         },
         },
         setConfigError(error) {
         setConfigError(error) {
+            setState({ httpLoading: true });
             return Promise.reject(error);
             return Promise.reject(error);
         },
         },
         successEvent(response) {
         successEvent(response) {
-            console.log(response);
+            setState({ httpLoading: false });
             return response;
             return response;
         },
         },
         errorEvent(error) {
         errorEvent(error) {
-            console.log(error.response);
+            setState({ httpLoading: false });
             if (error.response.status) {
             if (error.response.status) {
                 error.response.data.status = error.response.status;
                 error.response.data.status = error.response.status;
             }
             }

+ 109 - 41
models/routersModel.js

@@ -1,42 +1,110 @@
-import { CommonActions } from "@react-navigation/native";
-export default {
-    state: {
-        routerState: "",
-        nowName: "",
-        navigation: "",
-        topNavigation: "",
+const router = {
+    type: 'tab',
+  
+    getInitialState({ routeNames, routeParamList }) {
+      const index =
+        options.initialRouteName === undefined
+          ? 0
+          : routeNames.indexOf(options.initialRouteName);
+  
+      return {
+        stale: false,
+        type: 'tab',
+        key: shortid(),
+        index,
+        routeNames,
+        routes: routeNames.map(name => ({
+          name,
+          key: name,
+          params: routeParamList[name],
+        })),
+      };
     },
     },
-    actions: ({ model, setState }) => ({
-        setTopNavigation(navigation) {
-            console.log(navigation);
-            setState({ topNavigation: navigation });
-        },
-        setNavigation(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, screen, params) {
-            const { navigation } = model();
-            navigation.replace(to, { screen: screen, params: params });
-        },
-        backRouter() {
-            const { navigation } = model();
-            navigation.goBack();
-        },
-        resetRouter(to) {
-            const { navigation } = model();
-            navigation.reset(to);
-        },
-    }),
-};
+  
+    getRehydratedState(partialState, { routeNames, routeParamList }) {
+      const state = partialState;
+  
+      if (state.stale === false) {
+        return state as NavigationState;
+      }
+  
+      const routes = state.routes
+        .filter(route => routeNames.includes(route.name))
+        .map(
+          route =>
+            ({
+              ...route,
+              key: route.key || `${route.name}-${shortid()}`,
+              params:
+                routeParamList[route.name] !== undefined
+                  ? {
+                      ...routeParamList[route.name],
+                      ...route.params,
+                    }
+                  : route.params,
+            } as Route<string>)
+        );
+  
+      return {
+        stale: false,
+        type: 'tab',
+        key: shortid(),
+        index:
+          typeof state.index === 'number' && state.index < routes.length
+            ? state.index
+            : 0,
+        routeNames,
+        routes,
+      };
+    },
+  
+    getStateForRouteNamesChange(state, { routeNames }) {
+      const routes = state.routes.filter(route =>
+        routeNames.includes(route.name)
+      );
+  
+      return {
+        ...state,
+        routeNames,
+        routes,
+        index: Math.min(state.index, routes.length - 1),
+      };
+    },
+  
+    getStateForRouteFocus(state, key) {
+      const index = state.routes.findIndex(r => r.key === key);
+  
+      if (index === -1 || index === state.index) {
+        return state;
+      }
+  
+      return { ...state, index };
+    },
+  
+    getStateForAction(state, action) {
+      switch (action.type) {
+        case 'NAVIGATE': {
+          const index = state.routes.findIndex(
+            route => route.name === action.payload.name
+          );
+  
+          if (index === -1) {
+            return null;
+          }
+  
+          return { ...state, index };
+        }
+  
+        default:
+          return BaseRouter.getStateForAction(state, action);
+      }
+    },
+  
+    shouldActionChangeFocus() {
+      return false;
+    },
+  };
+  
+  const SimpleRouter = () => router;
+  
+  export default SimpleRouter;

+ 3 - 1
models/userModel.js

@@ -26,7 +26,7 @@ export default {
             });
             });
         },
         },
         checkLogin() {
         checkLogin() {
-            const { getUserInfo, id, aliAccount } = model();
+            const { getUserInfo, status } = model();
             const { getAsyncStorage } = model("httpModel");
             const { getAsyncStorage } = model("httpModel");
             return new Promise((resolve) => {
             return new Promise((resolve) => {
                 getUserInfo()
                 getUserInfo()
@@ -40,6 +40,8 @@ export default {
                         } else {
                         } else {
                             setState({ isLogin: true });
                             setState({ isLogin: true });
                         }
                         }
+                        const { isLogin } = model();
+                        console.log(isLogin);
                         resolve();
                         resolve();
                     })
                     })
                     .catch((_) => {
                     .catch((_) => {

+ 26 - 0
navigation/BasicNavigator.js

@@ -0,0 +1,26 @@
+import * as React from "react";
+import { useModel } from "flooks";
+
+import Guide1Screen from "../screens/Guide1Screen";
+import EditBanner from "../screens/EditBannerScreen";
+import EditGoods from "../screens/EditGoods";
+import AddGoodsClassification from "../screens/AddGoodsClassification";
+import FullReduction from "../screens/FullReduction";
+import Guide2Screen from "../screens/Guide2Screen";
+
+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}
+                initialParams={{ type: "signboard" }}
+            />
+            <Screen name='FullReduction' component={FullReduction} />
+            <Screen name='AddNewClass' component={Guide2Screen} />
+        </>
+    );
+}

+ 5 - 5
navigation/BottomTabNavigator.js

@@ -2,7 +2,7 @@ import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
 import * as React from "react";
 import * as React from "react";
 import { useTheme, Text } from "@ui-kitten/components";
 import { useTheme, Text } from "@ui-kitten/components";
 import TabBarIcon from "../components/TabBarIcon";
 import TabBarIcon from "../components/TabBarIcon";
-import LinksScreen from "../screens/LinksScreen";
+import OrderScreen from "../screens/OrderScreen";
 import HomeScreen from "../screens/HomeScreen";
 import HomeScreen from "../screens/HomeScreen";
 import UserScreen from "../screens/UserScreen";
 import UserScreen from "../screens/UserScreen";
 import { useModel } from "flooks";
 import { useModel } from "flooks";
@@ -14,7 +14,7 @@ export default function BottomTabNavigator({ navigation, route }) {
     const theme = useTheme();
     const theme = useTheme();
     const { tab1, tab2, tab3 } = useModel("wordsModel");
     const { tab1, tab2, tab3 } = useModel("wordsModel");
     return (
     return (
-        <BottomTab.Navigator headerMode='none' initialRouteName='User'>
+        <BottomTab.Navigator headerMode='none' initialRouteName='Order'>
             <BottomTab.Screen
             <BottomTab.Screen
                 name='Home'
                 name='Home'
                 component={HomeScreen}
                 component={HomeScreen}
@@ -33,8 +33,8 @@ export default function BottomTabNavigator({ navigation, route }) {
                 }}
                 }}
             />
             />
             <BottomTab.Screen
             <BottomTab.Screen
-                name='Links'
-                component={LinksScreen}
+                name='Order'
+                component={OrderScreen}
                 options={{
                 options={{
                     tabBarLabel: ({ focused }) => (
                     tabBarLabel: ({ focused }) => (
                         <Text
                         <Text
@@ -63,7 +63,7 @@ export default function BottomTabNavigator({ navigation, route }) {
                         </Text>
                         </Text>
                     ),
                     ),
                     tabBarIcon: ({ focused }) => (
                     tabBarIcon: ({ focused }) => (
-                        <TabBarIcon focused={focused} name='file-text' />
+                        <TabBarIcon focused={focused} name='person' />
                     ),
                     ),
                 }}
                 }}
             />
             />

+ 13 - 20
navigation/GuideStackNavigator.js

@@ -10,7 +10,6 @@ import Guide2Screen from "../screens/Guide2Screen";
 import Guide3Screen from "../screens/Guide3Screen";
 import Guide3Screen from "../screens/Guide3Screen";
 import Guide4Screen from "../screens/Guide4Screen";
 import Guide4Screen from "../screens/Guide4Screen";
 import StoreAudit from "../screens/StoreAudit";
 import StoreAudit from "../screens/StoreAudit";
-import AddGoodsClassification from "../screens/AddGoodsClassification";
 
 
 const GuideStack = createStackNavigator();
 const GuideStack = createStackNavigator();
 
 
@@ -29,21 +28,19 @@ const config = {
 export default function GuideStackNavigator() {
 export default function GuideStackNavigator() {
     const { guideStep } = useModel("userModel");
     const { guideStep } = useModel("userModel");
     const initial = React.useMemo(() => {
     const initial = React.useMemo(() => {
-        console.log(guideStep);
-        return "Guide1";
-        // if (guideStep == 0) {
-        //     return "Guide1";
-        // } else if (guideStep == 1) {
-        //     return "Guide2";
-        // } else if (guideStep == 2) {
-        //     return "Guide3";
-        // } else if (guideStep == 3) {
-        //     return "Guide4";
-        // } else if (guideStep == 4) {
-        //     return "StoreAudit";
-        // } else {
-        //     return "Guide1";
-        // }
+        if (guideStep == 0) {
+            return "Guide1";
+        } else if (guideStep == 1) {
+            return "Guide2";
+        } else if (guideStep == 2) {
+            return "Guide3";
+        } else if (guideStep == 3) {
+            return "Guide4";
+        } else if (guideStep == 4) {
+            return "StoreAudit";
+        } else {
+            return "Guide1";
+        }
     }, [guideStep]);
     }, [guideStep]);
 
 
     return (
     return (
@@ -60,10 +57,6 @@ export default function GuideStackNavigator() {
             <GuideStack.Screen name='Guide3' component={Guide3Screen} />
             <GuideStack.Screen name='Guide3' component={Guide3Screen} />
             <GuideStack.Screen name='Guide4' component={Guide4Screen} />
             <GuideStack.Screen name='Guide4' component={Guide4Screen} />
             <GuideStack.Screen name='StoreAudit' component={StoreAudit} />
             <GuideStack.Screen name='StoreAudit' component={StoreAudit} />
-            <GuideStack.Screen
-                name='AddGoods'
-                component={AddGoodsClassification}
-            />
         </GuideStack.Navigator>
         </GuideStack.Navigator>
     );
     );
 }
 }

+ 56 - 0
navigation/LoadingModel.js

@@ -0,0 +1,56 @@
+import * as React from "react";
+import { useModel } from "flooks";
+import {
+    Image,
+    Platform,
+    StyleSheet,
+    TouchableOpacity,
+    View,
+    ImageBackground,
+} from "react-native";
+import {
+    Layout,
+    Tab,
+    TabView,
+    Text,
+    useTheme,
+    Button,
+    Card,
+} from "@ui-kitten/components";
+import { useFocusEffect } from "@react-navigation/native";
+export default function ModalScreen({ navigation }) {
+    const theme = useTheme();
+    const { getWords } = useModel("wordsModel", true);
+    const { changeBackground } = useModel("barModel", true);
+    const { checkLogin, isLogin, status, guideStep } = useModel("userModel");
+
+    const [loading, changeLoading] = React.useState(true);
+    useFocusEffect(
+        React.useCallback(() => {
+            changeBackground(theme["color-primary-500"]);
+            getWords();
+            checkLogin().then((_) => {
+                changeLoading(false);
+            });
+        }, [])
+    );
+
+    React.useEffect(() => {
+        if (!loading) {
+            // navigation.replace("AddNewClass");
+            if (isLogin) {
+                if (status !== "PASS") {
+                    navigation.replace("Guide");
+                } else {
+                    navigation.replace("Root");
+                }
+            } else {
+                navigation.replace("Login");
+            }
+        }
+    });
+
+    // getWords();
+    // await checkLogin();
+    return <Layout style={{ flex: 1 }}></Layout>;
+}

+ 5 - 1
navigation/RootNavigation.js

@@ -1,5 +1,5 @@
 // RootNavigation.js
 // RootNavigation.js
-
+import { StackActions } from "@react-navigation/native";
 import * as React from "react";
 import * as React from "react";
 
 
 export const navigationRef = React.createRef();
 export const navigationRef = React.createRef();
@@ -8,6 +8,10 @@ export function navigate(name, params) {
     navigationRef.current?.navigate(name, params);
     navigationRef.current?.navigate(name, params);
 }
 }
 
 
+export function replace(name, params) {
+    navigationRef.current?.dispatch(StackActions.replace(name, params));
+}
+
 export function goBack() {
 export function goBack() {
     navigationRef.current?.goBack();
     navigationRef.current?.goBack();
 }
 }

+ 0 - 41
navigation/RootStackNavigator.js

@@ -1,41 +0,0 @@
-import {
-    createStackNavigator,
-    CardStyleInterpolators,
-} from "@react-navigation/stack";
-import * as React from "react";
-import { useModel } from "flooks";
-
-import Guide1Screen from "../screens/Guide1Screen";
-import EditBanner from "../screens/EditBannerScreen";
-const RootStack = createStackNavigator();
-
-const config = {
-    animation: "spring",
-    config: {
-        stiffness: 1000,
-        damping: 500,
-        mass: 3,
-        overshootClamping: true,
-        restDisplacementThreshold: 0.01,
-        restSpeedThreshold: 0.01,
-    },
-};
-
-export default function LoginStackNavigator() {
-    return (
-        <RootStack.Navigator
-            headerMode='none'
-            screenOptions={{
-                gestureEnabled: true,
-                cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS,
-            }}
-            initialRouteName='AddGoods'
-        >
-            <RootStack.Screen name='AddGoods' component={Guide1Screen} />
-            <RootStack.Screen
-                name='EditBanner'
-                component={EditBanner}
-            />
-        </RootStack.Navigator>
-    );
-}

+ 72 - 0
navigation/TopTabNavigator.js

@@ -0,0 +1,72 @@
+import { createTopTabNavigator } from "@react-navigation/top-tabs";
+import * as React from "react";
+import { useTheme, Text } from "@ui-kitten/components";
+import TabBarIcon from "../components/TabBarIcon";
+import OrderScreen from "../screens/OrderScreen";
+import HomeScreen from "../screens/HomeScreen";
+import UserScreen from "../screens/UserScreen";
+import { useModel } from "flooks";
+import { useFocusEffect } from "@react-navigation/native";
+
+const TopTab = createTopTabNavigator();
+
+export default function TopTabNavigator({ navigation, route }) {
+    const theme = useTheme();
+    const { tab1, tab2, tab3 } = useModel("wordsModel");
+    return (
+        <TopTab.Navigator headerMode='none' initialRouteName='Order'>
+            <TopTab.Screen
+                name='Home'
+                component={HomeScreen}
+                options={{
+                    tabBarLabel: ({ focused }) => (
+                        <Text
+                            category='c1'
+                            status={focused ? "primary" : "info"}
+                        >
+                            {tab1}
+                        </Text>
+                    ),
+                    tabBarIcon: ({ focused }) => (
+                        <TabBarIcon focused={focused} name='home' />
+                    ),
+                }}
+            />
+            <TopTab.Screen
+                name='Order'
+                component={OrderScreen}
+                options={{
+                    tabBarLabel: ({ focused }) => (
+                        <Text
+                            category='c1'
+                            status={focused ? "primary" : "info"}
+                        >
+                            {tab2}
+                        </Text>
+                    ),
+                    tabBarIcon: ({ focused }) => (
+                        <TabBarIcon focused={focused} name='file-text' />
+                    ),
+                }}
+            />
+
+            <TopTab.Screen
+                name='User'
+                component={UserScreen}
+                options={{
+                    tabBarLabel: ({ focused }) => (
+                        <Text
+                            category='c1'
+                            status={focused ? "primary" : "info"}
+                        >
+                            {tab3}
+                        </Text>
+                    ),
+                    tabBarIcon: ({ focused }) => (
+                        <TabBarIcon focused={focused} name='person' />
+                    ),
+                }}
+            />
+        </TopTab.Navigator>
+    );
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 52 - 1037
package-lock.json


+ 7 - 2
package.json

@@ -17,7 +17,8 @@
     "@expo/vector-icons": "^10.0.0",
     "@expo/vector-icons": "^10.0.0",
     "@react-native-community/masked-view": "0.1.6",
     "@react-native-community/masked-view": "0.1.6",
     "@react-navigation/bottom-tabs": "^5.0.0",
     "@react-navigation/bottom-tabs": "^5.0.0",
-    "@react-navigation/native": "^5.0.0",
+    "@react-navigation/material-top-tabs": "^5.2.5",
+    "@react-navigation/native": "^5.4.0",
     "@react-navigation/stack": "^5.0.0",
     "@react-navigation/stack": "^5.0.0",
     "@react-navigation/web": "~1.0.0-alpha.9",
     "@react-navigation/web": "~1.0.0-alpha.9",
     "@ui-kitten/components": "^5.0.0-alpha.1",
     "@ui-kitten/components": "^5.0.0-alpha.1",
@@ -32,6 +33,7 @@
     "expo-image-picker": "~8.1.0",
     "expo-image-picker": "~8.1.0",
     "expo-linking": "^1.0.1",
     "expo-linking": "^1.0.1",
     "expo-localization": "~8.1.0",
     "expo-localization": "~8.1.0",
+    "expo-splash-screen": "~0.1.1",
     "expo-web-browser": "~8.2.0",
     "expo-web-browser": "~8.2.0",
     "flooks": "^1.2.0",
     "flooks": "^1.2.0",
     "i18n-js": "^3.5.1",
     "i18n-js": "^3.5.1",
@@ -39,19 +41,22 @@
     "react": "16.9.0",
     "react": "16.9.0",
     "react-dom": "16.9.0",
     "react-dom": "16.9.0",
     "react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
     "react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
+    "react-native-action-button": "^2.8.5",
     "react-native-gesture-handler": "~1.6.0",
     "react-native-gesture-handler": "~1.6.0",
     "react-native-maps": "0.26.1",
     "react-native-maps": "0.26.1",
     "react-native-modal": "^11.5.6",
     "react-native-modal": "^11.5.6",
     "react-native-number-please": "^1.0.5",
     "react-native-number-please": "^1.0.5",
+    "react-native-reanimated": "~1.7.0",
     "react-native-safe-area-context": "0.7.3",
     "react-native-safe-area-context": "0.7.3",
     "react-native-screens": "~2.2.0",
     "react-native-screens": "~2.2.0",
     "react-native-svg": "11.0.1",
     "react-native-svg": "11.0.1",
+    "react-native-tab-view": "^2.14.0",
     "react-native-textarea": "^1.0.4",
     "react-native-textarea": "^1.0.4",
     "react-native-web": "^0.11.7"
     "react-native-web": "^0.11.7"
   },
   },
   "devDependencies": {
   "devDependencies": {
     "@babel/core": "^7.8.6",
     "@babel/core": "^7.8.6",
-    "@expo/webpack-config": "^0.12.4-alpha.0",
+    "@expo/webpack-config": "^0.11.25",
     "babel-loader": "^8.1.0",
     "babel-loader": "^8.1.0",
     "babel-preset-expo": "^8.1.0",
     "babel-preset-expo": "^8.1.0",
     "jest-expo": "^37.0.0"
     "jest-expo": "^37.0.0"

+ 209 - 9
screens/AddGoodsClassification.js

@@ -18,12 +18,16 @@ import {
     useTheme,
     useTheme,
     Button,
     Button,
     Card,
     Card,
+    List,
 } from "@ui-kitten/components";
 } from "@ui-kitten/components";
 import FormInput from "../components/FormInput";
 import FormInput from "../components/FormInput";
 import { useFocusEffect } from "@react-navigation/native";
 import { useFocusEffect } from "@react-navigation/native";
 import ScrollPage from "../components/ScrollPage";
 import ScrollPage from "../components/ScrollPage";
 import NavHeaderBar from "../components/NavHeaderBar";
 import NavHeaderBar from "../components/NavHeaderBar";
 import GoodsCard from "../components/GoodsCard";
 import GoodsCard from "../components/GoodsCard";
+import EmptyComponent from "../components/EmptyComponent";
+import ActionButton from "react-native-action-button";
+import TabBarIcon from "../components/TabBarIcon";
 
 
 const Header = (props, title) => (
 const Header = (props, title) => (
     <Text {...props} category='s1'>
     <Text {...props} category='s1'>
@@ -34,23 +38,87 @@ const Header = (props, title) => (
 export default function AddGoodsClassification({ navigation, route }) {
 export default function AddGoodsClassification({ navigation, route }) {
     const theme = useTheme();
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
     const { changeBackground } = useModel("barModel");
-    const { httpGet } = useModel("httpModel", true);
+    const { httpGet, httpPost } = useModel("httpModel", true);
     const { registerSecend, guideStep } = useModel("userModel", true);
     const { registerSecend, guideStep } = useModel("userModel", true);
+    const { success } = useModel("loadingModel", true);
 
 
     const {
     const {
         goodsClassificationTitle1,
         goodsClassificationTitle1,
         goodsClassificationTitle2,
         goodsClassificationTitle2,
         goodsClassificationTitle3,
         goodsClassificationTitle3,
+        add,
+        remove,
+        successText,
+        removeTips,
+        addClassTips,
     } = useModel("wordsModel");
     } = useModel("wordsModel");
-    const { showDialog } = useModel("dialogModel");
+    const { showDialog } = useModel("dialogModel", true);
     const [categoryList, changeCategoryList] = React.useState([]);
     const [categoryList, changeCategoryList] = React.useState([]);
     const [merchantNatureList, changeMerchantNatureList] = React.useState([]);
     const [merchantNatureList, changeMerchantNatureList] = React.useState([]);
+    const [goods, changeGoods] = React.useState([]);
+    const [selectId, changeSelectId] = React.useState(0);
+    const [goodsClass, setGoodsClass] = React.useState([]);
+    const [pageType, changeType] = React.useState("signboard");
     useFocusEffect(
     useFocusEffect(
         React.useCallback(() => {
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
             changeBackground(theme["color-primary-500"]);
+            console.log(route);
+            if (route.params.type == "classification") {
+                changeSelectId(route.params.classificationId);
+            }
+            if (route.params.type) {
+                changeType(route.params.type);
+            } else {
+                changeType("signboard");
+            }
+
+            getAllGoods();
         }, [])
         }, [])
     );
     );
 
 
+    React.useEffect(() => {
+        if (selectId && selectId != "new") {
+            getSelectGoods();
+        }
+    }, [selectId]);
+    function getSelectGoods() {
+        httpGet("/classification/allGoods", {
+            classificationId: selectId,
+        }).then((res) => {
+            setGoodsClass(res);
+        });
+    }
+    function getAllGoods() {
+        httpGet("/goods/my").then((res) => {
+            changeGoods(res);
+        });
+    }
+
+    const topGoods = React.useMemo(() => {
+        if (pageType == "signboard") {
+            return goods.filter((item) => {
+                return item.signboard;
+            });
+        } else {
+            return [...goodsClass];
+        }
+    }, [goods, goodsClass]);
+
+    const elseGoods = React.useMemo(() => {
+        if (pageType === "signboard") {
+            return goods.filter((item) => {
+                return !item.signboard;
+            });
+        } else {
+            let _topIds = topGoods.map((item) => {
+                return item.id;
+            });
+            return goods.filter((item) => {
+                return _topIds.indexOf(item.id) === -1;
+            });
+        }
+    }, [goods, goodsClass]);
+
     const [name, changeName] = React.useState("");
     const [name, changeName] = React.useState("");
     const [sort, changeSort] = React.useState("");
     const [sort, changeSort] = React.useState("");
     const [goodsIds, changeGoodsIds] = React.useState("");
     const [goodsIds, changeGoodsIds] = React.useState("");
@@ -59,6 +127,107 @@ export default function AddGoodsClassification({ navigation, route }) {
         return true;
         return true;
     }, [name]);
     }, [name]);
 
 
+    const chooseGoodsItem = ({ item, index }) => (
+        <GoodsCard
+            info={item}
+            key={item.id}
+            isAdd={true}
+            removeEvent={() => {
+                showDialog({
+                    bodyText: removeTips,
+                    status: "danger",
+                    cancelable: true,
+                    confirmCallback: () => {
+                        changeSignboard(item.id, false, remove, item);
+                    },
+                });
+            }}
+        />
+    );
+    const goodsItem = ({ item, index }) => (
+        <GoodsCard
+            info={item}
+            key={item.id}
+            isAdd={false}
+            addEvent={() => {
+                if (topGoods.length < 2 || pageType != "signboard") {
+                    changeSignboard(item.id, true, add, item);
+                } else {
+                    showDialog({
+                        bodyText: addClassTips,
+                    });
+                }
+            }}
+        />
+    );
+
+    function changeSignboard(id, signboard, tips, info) {
+        if (pageType == "signboard") {
+            httpPost(
+                "/goods/save",
+                {
+                    id,
+                    signboard,
+                },
+                { body: "json" }
+            ).then((res) => {
+                success(tips + successText);
+                let _goods = goods.map((item) => {
+                    if (item.id != id) {
+                        return item;
+                    } else {
+                        return res;
+                    }
+                });
+                changeGoods(_goods);
+            });
+        } else if (pageType == "classification" && selectId == "new") {
+            let _goodsClass = [...goodsClass];
+            if (signboard) {
+                _goodsClass.push(info);
+            } else {
+                _goodsClass.splice(
+                    _goodsClass.findIndex((item) => {
+                        return item.id == id;
+                    }),
+                    1
+                );
+            }
+            success(tips + successText);
+            setGoodsClass(_goodsClass);
+        } else {
+            if (signboard) {
+                let ids = topGoods.map((item) => {
+                    return item.id;
+                });
+                ids.push(id);
+                httpGet(
+                    "/classification/saveGoods",
+                    {
+                        classificationId: selectId,
+                        string: ids.join(","),
+                    },
+                    { body: "json" }
+                ).then((res) => {
+                    success(tips + successText);
+                    getSelectGoods();
+                });
+            } else {
+                httpGet(
+                    "/classification/delGoods",
+                    {
+                        classificationId: selectId,
+                        goodId: id,
+                    },
+                    { body: "json" }
+                ).then((res) => {
+                    success(tips + successText);
+                    getSelectGoods();
+                });
+            }
+        }
+    }
+
     return (
     return (
         <>
         <>
             <NavHeaderBar title={goodsClassificationTitle1} />
             <NavHeaderBar title={goodsClassificationTitle1} />
@@ -69,9 +238,14 @@ export default function AddGoodsClassification({ navigation, route }) {
                         header={(props) => {
                         header={(props) => {
                             return Header(props, goodsClassificationTitle2);
                             return Header(props, goodsClassificationTitle2);
                         }}
                         }}
+                        disabled={true}
                     >
                     >
-                        <GoodsCard />
-                        <GoodsCard />
+                        <List
+                            data={topGoods}
+                            style={styles.list}
+                            renderItem={chooseGoodsItem}
+                            ListEmptyComponent={EmptyComponent}
+                        />
                     </Card>
                     </Card>
 
 
                     <Card
                     <Card
@@ -79,22 +253,48 @@ export default function AddGoodsClassification({ navigation, route }) {
                         header={(props) => {
                         header={(props) => {
                             return Header(props, goodsClassificationTitle3);
                             return Header(props, goodsClassificationTitle3);
                         }}
                         }}
+                        disabled={true}
                     >
                     >
-                        <GoodsCard />
-                        <GoodsCard />
+                        <List
+                            data={elseGoods}
+                            style={styles.list}
+                            renderItem={goodsItem}
+                            ListEmptyComponent={EmptyComponent}
+                        />
                     </Card>
                     </Card>
                 </Layout>
                 </Layout>
+                <ActionButton
+                    style={{ zIndex: 2 }}
+                    buttonColor={theme["color-primary-500"]}
+                    onPress={() => {
+                        let ids = topGoods.map((item) => {
+                            return item.id;
+                        });
+                        ids = ids.join(",");
+                        console.log(ids);
+                        navigation.navigate(route.params.preKey, {
+                            choosIds: ids,
+                        });
+                    }}
+                    position='center'
+                />
             </ScrollPage>
             </ScrollPage>
         </>
         </>
     );
     );
 }
 }
 
 
 const styles = StyleSheet.create({
 const styles = StyleSheet.create({
+    flex1: {
+        backgroundColor: "rgba(0,0,0,0)",
+        paddingHorizontal: 15,
+        paddingBottom: 20,
+    },
+    list: {
+        backgroundColor: "rgba(0,0,0,0)",
+    },
     container: {
     container: {
-        flex: 1,
-        paddingBottom: 33,
         backgroundColor: "#EEEEEE",
         backgroundColor: "#EEEEEE",
-        paddingVertical: 20,
+        paddingTop: 20,
     },
     },
     tabContent: {
     tabContent: {
         backgroundColor: "#fff",
         backgroundColor: "#fff",

+ 120 - 0
screens/EditGoods.js

@@ -0,0 +1,120 @@
+import * as WebBrowser from "expo-web-browser";
+import * as React from "react";
+import {
+    Image,
+    Platform,
+    StyleSheet,
+    TouchableOpacity,
+    View,
+    ImageBackground,
+} from "react-native";
+import scrollPage from "../decorator/scrollPage";
+import { useModel } from "flooks";
+import {
+    Layout,
+    Tab,
+    TabView,
+    Text,
+    useTheme,
+    Button,
+    Card,
+    List,
+} from "@ui-kitten/components";
+import FormInput from "../components/FormInput";
+import { useFocusEffect } from "@react-navigation/native";
+import ScrollPage from "../components/ScrollPage";
+import NavHeaderBar from "../components/NavHeaderBar";
+import GoodsCard from "../components/GoodsCard";
+import UpLoadImage from "../components/UpLoadImage";
+import GoodsCardLarge from "../components/GoodsCard";
+import EmptyComponent from "../components/EmptyComponent";
+
+export default function EditGoods({ navigation, route }) {
+    const theme = useTheme();
+    const { changeBackground } = useModel("barModel");
+    const { banner, logo, uploadStoreImg } = useModel("userModel");
+    const { httpGet } = useModel("httpModel");
+    const [goods, changeGoods] = React.useState("");
+    const [type, setType] = React.useState("banner");
+    const { showDialog } = useModel("dialogModel");
+    const {
+        userTitle3,
+        addGoods2,
+        remove,
+        editText,
+        uplaodText,
+        uplaodImg,
+        removeTips,
+    } = useModel("wordsModel");
+    useFocusEffect(
+        React.useCallback(() => {
+            changeBackground(theme["color-primary-500"]);
+            getAllGoods();
+        }, [])
+    );
+
+    function getAllGoods() {
+        httpGet("/goods/my").then((res) => {
+            changeGoods(res);
+        });
+    }
+
+    const goodsItem = ({ item, index }) => (
+        <GoodsCardLarge
+            appearance='classification'
+            type='goodsList'
+            key={item.id}
+            info={item}
+            canEdit={true}
+            style={{ marginBottom: 7 }}
+            onPress={() => {
+                navigation.navigate("AddGoods", {
+                    id: item.id,
+                });
+            }}
+        />
+    );
+
+    return (
+        <>
+            <NavHeaderBar title={userTitle3} />
+            <Layout style={styles.container}>
+                <Layout style={styles.bntLay}>
+                    <Button
+                        onPress={() => {
+                            navigation.navigate("AddGoods");
+                        }}
+                    >
+                        {addGoods2}
+                    </Button>
+                </Layout>
+                <List
+                    style={styles.list}
+                    data={goods}
+                    renderItem={goodsItem}
+                    ListEmptyComponent={nothingTips}
+                />
+            </Layout>
+        </>
+    );
+}
+
+const styles = StyleSheet.create({
+    container: {
+        flex: 1,
+    },
+    bntLay: {
+        paddingVertical: 5,
+        flexDirection: "row",
+        alignItems: "center",
+        justifyContent: "center",
+        backgroundColor: "#EEEEEE",
+        flexShrink: 0,
+    },
+    list: {
+        flex: 1,
+        backgroundColor: "#EEEEEE",
+        paddingTop: 10,
+        paddingHorizontal: 15,
+    },
+});

+ 287 - 0
screens/FullReduction.js

@@ -0,0 +1,287 @@
+import * as WebBrowser from "expo-web-browser";
+import * as React from "react";
+import {
+    Image,
+    Platform,
+    StyleSheet,
+    TouchableOpacity,
+    View,
+    ImageBackground,
+} from "react-native";
+import scrollPage from "../decorator/scrollPage";
+import { useModel } from "flooks";
+import {
+    Layout,
+    Tab,
+    TabView,
+    Text,
+    useTheme,
+    Button,
+    Card,
+    List,
+    Input,
+    Icon,
+} from "@ui-kitten/components";
+import EmptyComponent from "../components/EmptyComponent";
+import FormInput from "../components/FormInput";
+import { useFocusEffect } from "@react-navigation/native";
+import ScrollPage from "../components/ScrollPage";
+import NavHeaderBar from "../components/NavHeaderBar";
+import GoodsCard from "../components/GoodsCard";
+import ActionButton from "react-native-action-button";
+
+export default function FullReduction({ navigation, route }) {
+    const theme = useTheme();
+    const { changeBackground } = useModel("barModel", true);
+    const { mid } = useModel("userModel");
+    const { httpGet, httpPost } = useModel("httpModel", true);
+    const { success, warnning } = useModel("loadingModel", true);
+    const { showDialog } = useModel("dialogModel");
+
+    const {
+        userTitle21,
+        fullReduction2,
+        fullReduction1,
+        delText,
+        editText,
+        confirm,
+        cancel,
+        complete,
+        successText,
+        removeTips,
+    } = useModel("wordsModel");
+    const [fullReductions, changeFllReduction] = React.useState([
+        { fullAmount: "", minusAmount: "" },
+    ]);
+    useFocusEffect(
+        React.useCallback(() => {
+            changeBackground(theme["color-primary-500"]);
+
+            httpGet("/fullReduction/my").then((res) => {
+                changeFllReduction(
+                    res.map((item) => {
+                        return { ...item, edit: false };
+                    })
+                );
+            });
+        }, [])
+    );
+
+    const renderItem = ({ item, index }) => {
+        if (!item.id || item.edit) {
+            return editItem(item, index);
+        } else {
+            return saveItem(item);
+        }
+    };
+
+    const saveItem = (info, index) => (
+        <Layout style={styles.item}>
+            <Text style={styles.text}>
+                {fullReduction1}
+                {info.fullAmount}
+                {fullReduction2}
+                {info.minusAmount}
+            </Text>
+
+            <Button
+                size='small'
+                appearance='outline'
+                onPress={() => editInfo(info, index)}
+            >
+                {editText}
+            </Button>
+            <Button
+                size='small'
+                status='danger'
+                style={styles.buttonlast}
+                onPress={() => delInfo(info, index)}
+            >
+                {delText}
+            </Button>
+        </Layout>
+    );
+
+    const editItem = (info, index) => (
+        <Layout style={styles.item}>
+            <Layout style={[styles.text, styles.flexRow]}>
+                <Text>{fullReduction1}</Text>
+                <Input
+                    size='small'
+                    value={info.fullAmount}
+                    style={styles.input}
+                    keyboardType='numeric'
+                    onChangeText={(value) => changeText(value, index, "full")}
+                />
+                <Text>{fullReduction2}</Text>
+                <Input
+                    size='small'
+                    value={info.minusAmount}
+                    style={styles.input}
+                    keyboardType='numeric'
+                    onChangeText={(value) => changeText(value, index, "minus")}
+                />
+            </Layout>
+
+            <Button size='small' onPress={() => saveInfo(info, index)}>
+                {confirm}
+            </Button>
+            <Button
+                size='small'
+                appearance='outline'
+                style={styles.buttonlast}
+                onPress={() => cancelInfo(info, index)}
+            >
+                {cancel}
+            </Button>
+        </Layout>
+    );
+    const editInfo = (info, index) => {
+        let _fullReductions = [...fullReductions];
+        info.edit = true;
+        _fullReductions[index] = info;
+        changeFllReduction(_fullReductions);
+    };
+    const delInfo = (info, index) => {
+        showDialog({
+            bodyText: removeTips,
+            status: "danger",
+            cancelable: true,
+            confirmCallback: () => {
+                httpPost("/fullReduction/del/" + info.id)
+                    .then((res) => {
+                        success(successText);
+                        let _fullReductions = [...fullReductions];
+                        _fullReductions.splice(index, 1);
+                        changeFllReduction(_fullReductions);
+                    })
+                    .catch((e) => {
+                        warnning(e.error);
+                    });
+            },
+        });
+    };
+    const cancelInfo = (info, index) => {
+        let _fullReductions = [...fullReductions];
+        if (info.id) {
+            info.edit = false;
+            _fullReductions[index] = info;
+        } else {
+            _fullReductions.pop();
+        }
+
+        changeFllReduction(_fullReductions);
+    };
+    const saveInfo = (info, index) => {
+        httpPost(
+            "/fullReduction/save",
+            {
+                ...info,
+                merchantId: mid,
+            },
+            {
+                body: "json",
+            }
+        )
+            .then((res) => {
+                success(successText);
+                let _fullReductions = [...fullReductions];
+                _fullReductions.splice(index, 1, {
+                    ...res,
+                    edit: false,
+                });
+                changeFllReduction(_fullReductions);
+            })
+            .catch((e) => {
+                warnning(e.error);
+            });
+    };
+    function changeText(value, index, type) {
+        let _fullReductions = [...fullReductions];
+        let info = _fullReductions[index];
+        if (type == "full") {
+            info.fullAmount = value;
+        } else {
+            info.minusAmount = value;
+        }
+        _fullReductions.splice(index, 1, info);
+        changeFllReduction(_fullReductions);
+    }
+    const addFullReduction = () => {
+        console.log("aaa");
+        let _fullReductions = [...fullReductions];
+        let last = _fullReductions[_fullReductions.length - 1];
+        if (last.id) {
+            _fullReductions.push({
+                fullAmount: "",
+                minusAmount: "",
+            });
+            changeFllReduction(_fullReductions);
+        }
+    };
+
+    return (
+        <>
+            <NavHeaderBar title={userTitle21} />
+            <ScrollPage style={styles.lay}>
+                <Layout style={[styles.lay]}>
+                    <List
+                        style={styles.list}
+                        data={fullReductions}
+                        renderItem={renderItem}
+                        ListEmptyComponent={EmptyComponent}
+                    />
+                </Layout>
+                <ActionButton
+                    buttonColor={theme["color-primary-500"]}
+                    onPress={addFullReduction}
+                    position='left'
+                />
+            </ScrollPage>
+        </>
+    );
+}
+
+const PulsIcon = (props) => (
+    <Icon
+        {...props}
+        style={[props.style, { width: 33, height: 33 }]}
+        name='plus-circle'
+    />
+);
+const styles = StyleSheet.create({
+    lay: {
+        backgroundColor: "#fff",
+    },
+    padBot: {
+        paddingBottom: 100,
+    },
+    list: {
+        paddingVertical: 10,
+        paddingHorizontal: 15,
+        backgroundColor: "transparent",
+        flex: 0,
+    },
+    item: {
+        flexDirection: "row",
+        alignItems: "center",
+        paddingVertical: 10,
+    },
+    input: {
+        marginHorizontal: 5,
+        minWidth: 49,
+    },
+    text: {
+        flex: 1,
+    },
+    flexRow: {
+        flexDirection: "row",
+        alignItems: "center",
+    },
+    buttonlast: {
+        marginLeft: 10,
+    },
+    button: {
+        alignSelf: "flex-start",
+    },
+});

+ 49 - 8
screens/Guide1Screen.js

@@ -26,6 +26,8 @@ import ConnectButton from "../components/ConnectButton";
 import GuideHeaderBar from "../components/GuideHeaderBar";
 import GuideHeaderBar from "../components/GuideHeaderBar";
 import Textarea from "react-native-textarea";
 import Textarea from "react-native-textarea";
 import NavHeaderBar from "../components/NavHeaderBar";
 import NavHeaderBar from "../components/NavHeaderBar";
+import moment from "moment";
+import { CommonActions } from "@react-navigation/native";
 
 
 export default function Guide1Screen({ navigation, route }) {
 export default function Guide1Screen({ navigation, route }) {
     const theme = useTheme();
     const theme = useTheme();
@@ -52,6 +54,8 @@ export default function Guide1Screen({ navigation, route }) {
         passTips,
         passTips,
         confirm,
         confirm,
         addGoods,
         addGoods,
+        delText,
+        removeTips,
     } = useModel("wordsModel");
     } = useModel("wordsModel");
     const { showDialog } = useModel("dialogModel");
     const { showDialog } = useModel("dialogModel");
     const routeName = route.name;
     const routeName = route.name;
@@ -103,17 +107,32 @@ export default function Guide1Screen({ navigation, route }) {
     }, [id]);
     }, [id]);
 
 
     function getInfo(res) {
     function getInfo(res) {
-        changeAmount(res.amount || "");
         changeName(res.name || "");
         changeName(res.name || "");
-        changeDiscountAmount(res.discountAmount || "");
-        changeInventory(res.inventory || "");
+        if (res.discountAmount) {
+            changeDiscountAmount(res.discountAmount.toString());
+        }
+        if (res.amount) {
+            changeAmount(res.amount.toString());
+        }
+        if (res.inventory) {
+            changeInventory(res.inventory.toString());
+        }
         changeWeek(res.week || "");
         changeWeek(res.week || "");
         changeStartTime(res.startTime || "");
         changeStartTime(res.startTime || "");
         changeEndTime(res.endTime || "");
         changeEndTime(res.endTime || "");
         changeIntroduction(res.introduction || "");
         changeIntroduction(res.introduction || "");
-        changeImg(res.img || "");
+        console.log(res);
+        // if (res.img && res.img.length) {
+        changeImg(res.img);
+        // }
+
         if (res.week) {
         if (res.week) {
-            ChangeDefaultValue([res.startTime + "~" + res.endTime, res.week]);
+            ChangeDefaultValue([
+                moment(res.startTime, "HH:mm:ss").format("HH:mm") +
+                    "~" +
+                    moment(res.endTime, "HH:mm:ss").format("HH:mm"),
+                res.week,
+            ]);
         }
         }
     }
     }
 
 
@@ -258,15 +277,37 @@ export default function Guide1Screen({ navigation, route }) {
                                         if (id) {
                                         if (id) {
                                             getInfo(res);
                                             getInfo(res);
                                         } else {
                                         } else {
-                                            navigation.navigate({
-                                                id: res.id,
-                                            });
+                                            changeId(res.id);
+                                            navigation.dispatch(
+                                                CommonActions.setParams({
+                                                    id: res.id,
+                                                })
+                                            );
                                         }
                                         }
                                     });
                                     });
                                 }}
                                 }}
                             >
                             >
                                 {routeName != "AddGoods" ? next : confirm}
                                 {routeName != "AddGoods" ? next : confirm}
                             </Button>
                             </Button>
+                            {routeName == "AddGoods" && id != 0 && (
+                                <Button
+                                    appearance='ghost'
+                                    status='info'
+                                    style={{ marginTop: 10 }}
+                                    onPress={() => {
+                                        showDialog({
+                                            bodyText: removeTips,
+                                            cancelable: true,
+                                            confirmCallback: () => {
+                                                success("删除成功");
+                                                navigation.goBack();
+                                            },
+                                        });
+                                    }}
+                                >
+                                    {delText}
+                                </Button>
+                            )}
                             {routeName != "AddGoods" && (
                             {routeName != "AddGoods" && (
                                 <Button
                                 <Button
                                     style={{ marginTop: 10 }}
                                     style={{ marginTop: 10 }}

+ 98 - 33
screens/Guide2Screen.js

@@ -10,6 +10,7 @@ import {
 } from "react-native";
 } from "react-native";
 import scrollPage from "../decorator/scrollPage";
 import scrollPage from "../decorator/scrollPage";
 import { useModel } from "flooks";
 import { useModel } from "flooks";
+import NavHeaderBar from "../components/NavHeaderBar";
 import {
 import {
     Layout,
     Layout,
     Tab,
     Tab,
@@ -20,17 +21,23 @@ import {
     Card,
     Card,
 } from "@ui-kitten/components";
 } from "@ui-kitten/components";
 import FormInput from "../components/FormInput";
 import FormInput from "../components/FormInput";
-import { useFocusEffect } from "@react-navigation/native";
+import { useFocusEffect, useRoute } from "@react-navigation/native";
 import ScrollPage from "../components/ScrollPage";
 import ScrollPage from "../components/ScrollPage";
 import ConnectButton from "../components/ConnectButton";
 import ConnectButton from "../components/ConnectButton";
 import GuideHeaderBar from "../components/GuideHeaderBar";
 import GuideHeaderBar from "../components/GuideHeaderBar";
 import Textarea from "react-native-textarea";
 import Textarea from "react-native-textarea";
+import * as RootNavigation from "../navigation/RootNavigation.js";
 
 
-export default function Guide1Screen({ navigation, route }) {
+export default function Guide1Screen({ navigation }) {
+    const route = useRoute();
     const theme = useTheme();
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
     const { changeBackground } = useModel("barModel");
-    const { httpGet } = useModel("httpModel", true);
-    const { registerSecend, changeGuideStep } = useModel("userModel", true);
+    const { httpGet, httpPost } = useModel("httpModel", true);
+    const { registerSecend, changeGuideStep, mid } = useModel(
+        "userModel",
+        true
+    );
+    const { success } = useModel("loadingModel", true);
 
 
     const {
     const {
         guide2_title1,
         guide2_title1,
@@ -50,29 +57,60 @@ export default function Guide1Screen({ navigation, route }) {
         passTips,
         passTips,
     } = useModel("wordsModel");
     } = useModel("wordsModel");
     const { showDialog } = useModel("dialogModel");
     const { showDialog } = useModel("dialogModel");
+    const [pageName, changePageName] = React.useState("");
+    const [name, changeName] = React.useState("");
+    const [sort, changeSort] = React.useState("");
+    const [goodsIds, changeGoodsIds] = React.useState("");
+
     useFocusEffect(
     useFocusEffect(
         React.useCallback(() => {
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
             changeBackground(theme["color-primary-500"]);
+            if (route.name) {
+                changePageName(route.name);
+            }
         }, [])
         }, [])
     );
     );
-
-    const [name, changeName] = React.useState("");
-    const [sort, changeSort] = React.useState("");
-    const [goodsIds, changeGoodsIds] = React.useState("");
+    React.useEffect(() => {
+        if (route.params) {
+            if (route.params.choosIds) {
+                changeGoodsIds(route.params.choosIds);
+            }
+        }
+    }, [route]);
 
 
     const canNext = React.useMemo(() => {
     const canNext = React.useMemo(() => {
-        return true;
+        if (name) {
+            return true;
+        } else {
+            return false;
+        }
     }, [name]);
     }, [name]);
 
 
+    const addClass = () => {
+        return httpPost(
+            "/classification/save",
+            {
+                name,
+                sort,
+                goodsIds,
+                merchantId: mid,
+            },
+            { body: "json" }
+        ).then((res) => {});
+    };
+
     return (
     return (
         <>
         <>
-            <GuideHeaderBar />
+            {pageName != "AddNewClass" && <GuideHeaderBar />}
+            {pageName === "AddNewClass" && <NavHeaderBar title='添加分类' />}
             <ScrollPage>
             <ScrollPage>
                 <Layout style={styles.container}>
                 <Layout style={styles.container}>
-                    <Card appearance='headFilled'>
-                        <Text category='s1'>{guide2_title1}</Text>
-                        <Text category='s1'>{guide2_title2}</Text>
-                    </Card>
+                    {pageName != "AddNewClass" && (
+                        <Card appearance='headFilled'>
+                            <Text category='s1'>{guide2_title1}</Text>
+                            <Text category='s1'>{guide2_title2}</Text>
+                        </Card>
+                    )}
                     <Card appearance='formFilled'>
                     <Card appearance='formFilled'>
                         {/* 类别名称 */}
                         {/* 类别名称 */}
                         <FormInput
                         <FormInput
@@ -98,38 +136,65 @@ export default function Guide1Screen({ navigation, route }) {
                             value={goodsIds}
                             value={goodsIds}
                             type='url'
                             type='url'
                             changePath={() => {
                             changePath={() => {
-                                pushRouter("AddGoods");
+                                RootNavigation.navigate("AddClassification", {
+                                    type: "classification",
+                                    classificationId: "new",
+                                    preKey: route.name,
+                                });
                             }}
                             }}
                             textAlign='right'
                             textAlign='right'
                         />
                         />
-                    </Card>
-                    <ConnectButton>
                         <Layout style={styles.layoutLeft} level='1'>
                         <Layout style={styles.layoutLeft} level='1'>
                             <Button
                             <Button
                                 status='primary'
                                 status='primary'
                                 disabled={!canNext}
                                 disabled={!canNext}
-                                onPress={() => registerSecend({})}
-                            >
-                                {next}
-                            </Button>
-                            <Button
-                                style={{ marginTop: 10 }}
-                                appearance='ghost'
-                                status='primary'
                                 onPress={() => {
                                 onPress={() => {
-                                    showDialog({
-                                        bodyText: passTips,
-                                        cancelable: true,
-                                        confirmCallback: () => {
-                                            changeGuideStep(2, "Guide3");
-                                        },
+                                    addClass().then((_) => {
+                                        success("添加成功");
+                                        RootNavigation.goBack();
                                     });
                                     });
                                 }}
                                 }}
                             >
                             >
-                                {pass}
+                                确定
                             </Button>
                             </Button>
                         </Layout>
                         </Layout>
-                    </ConnectButton>
+                    </Card>
+                    {pageName != "AddNewClass" && (
+                        <ConnectButton>
+                            <Layout style={styles.layoutLeft} level='1'>
+                                <Button
+                                    status='primary'
+                                    disabled={!canNext}
+                                    onPress={() => {
+                                        addClass()
+                                            .then((_) => {
+                                                success("添加成功");
+                                                RootNavigation.goBack();
+                                            })
+                                            .then((e) => {});
+                                    }}
+                                >
+                                    {next}
+                                </Button>
+                                <Button
+                                    style={{ marginTop: 10 }}
+                                    appearance='ghost'
+                                    status='primary'
+                                    onPress={() => {
+                                        showDialog({
+                                            bodyText: passTips,
+                                            cancelable: true,
+                                            confirmCallback: () => {
+                                                changeGuideStep(2, "Guide3");
+                                            },
+                                        });
+                                    }}
+                                >
+                                    {pass}
+                                </Button>
+                            </Layout>
+                        </ConnectButton>
+                    )}
                 </Layout>
                 </Layout>
             </ScrollPage>
             </ScrollPage>
         </>
         </>

+ 35 - 16
screens/HomeScreen.js

@@ -25,6 +25,7 @@ import {
     TopNavigation,
     TopNavigation,
     TopNavigationAction,
     TopNavigationAction,
     Modal,
     Modal,
+    List,
 } from "@ui-kitten/components";
 } from "@ui-kitten/components";
 import FormInput from "../components/FormInput";
 import FormInput from "../components/FormInput";
 import { useFocusEffect, useNavigation } from "@react-navigation/native";
 import { useFocusEffect, useNavigation } from "@react-navigation/native";
@@ -49,7 +50,7 @@ const InfoIcon = (props) => <Icon {...props} name='info' />;
 
 
 const LogoutIcon = (props) => <Icon {...props} name='log-out' />;
 const LogoutIcon = (props) => <Icon {...props} name='log-out' />;
 
 
-export default function HomeScreen() {
+export default function HomeScreen({ navigation, route }) {
     const theme = useTheme();
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
     const { changeBackground } = useModel("barModel");
     const {
     const {
@@ -72,18 +73,28 @@ export default function HomeScreen() {
         homeTab1,
         homeTab1,
         homeTab2,
         homeTab2,
         homeTab3,
         homeTab3,
+        fullReduction2,
+        fullReduction1,
     } = useModel("wordsModel");
     } = useModel("wordsModel");
     const [bannerImg, changeBannerImg] = React.useState([]);
     const [bannerImg, changeBannerImg] = React.useState([]);
     const [merchantNatureList, changeMerchantNatureList] = React.useState([]);
     const [merchantNatureList, changeMerchantNatureList] = React.useState([]);
-
+    const [fullReductions, changeFllReduction] = React.useState([]);
     const { showDialog } = useModel("dialogModel", true);
     const { showDialog } = useModel("dialogModel", true);
-    const { httpPost } = useModel("httpModel", true);
-    const [selectedIndex, setSelectedIndex] = React.useState(2);
-    const navigation = useNavigation();
+    const { httpPost, httpGet } = useModel("httpModel", true);
+    const [selectedIndex, setSelectedIndex] = React.useState();
 
 
     useFocusEffect(
     useFocusEffect(
         React.useCallback(() => {
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
             changeBackground(theme["color-primary-500"]);
+            if (route.params) {
+                setSelectedIndex(parseInt(route.params.index));
+            } else {
+                setSelectedIndex(0);
+            }
+
+            httpGet("/fullReduction/my").then((res) => {
+                changeFllReduction(res);
+            });
         }, [])
         }, [])
     );
     );
 
 
@@ -115,6 +126,19 @@ export default function HomeScreen() {
 
 
     const renderBackAction = () => <Text category='h6'>{homeBar}</Text>;
     const renderBackAction = () => <Text category='h6'>{homeBar}</Text>;
 
 
+    const badgeList = (list) => {
+        return list.map((item) => {
+            return (
+                <Badge style={styles.badge} key={item.id}>
+                    {fullReduction1}
+                    {item.fullAmount}
+                    {fullReduction2}
+                    {item.minusAmount}
+                </Badge>
+            );
+        });
+    };
+
     return (
     return (
         <>
         <>
             <TopNavigation
             <TopNavigation
@@ -132,9 +156,8 @@ export default function HomeScreen() {
                         <Button
                         <Button
                             appearance='bannerButton'
                             appearance='bannerButton'
                             onPress={() =>
                             onPress={() =>
-                                RootNavigation.navigate("Basic", {
-                                    screen: "EditBanner",
-                                    params: { type: "banner" },
+                                RootNavigation.navigate("EditBanner", {
+                                    type: "banner",
                                 })
                                 })
                             }
                             }
                         >
                         >
@@ -150,9 +173,8 @@ export default function HomeScreen() {
                         <TouchableOpacity
                         <TouchableOpacity
                             style={styles.touch}
                             style={styles.touch}
                             onPress={() =>
                             onPress={() =>
-                                RootNavigation.navigate("Basic", {
-                                    screen: "EditBanner",
-                                    params: { type: "logo" },
+                                RootNavigation.navigate("EditBanner", {
+                                    type: "logo",
                                 })
                                 })
                             }
                             }
                         >
                         >
@@ -192,11 +214,8 @@ export default function HomeScreen() {
                                     </Layout>
                                     </Layout>
                                 </Layout>
                                 </Layout>
                             </Layout>
                             </Layout>
-
                             <Layout style={styles.badges}>
                             <Layout style={styles.badges}>
-                                <Badge style={styles.badge}>40减20</Badge>
-                                <Badge style={styles.badge}>69减38</Badge>
-                                <Badge>100减50</Badge>
+                                {badgeList(fullReductions)}
                             </Layout>
                             </Layout>
                         </Layout>
                         </Layout>
 
 
@@ -336,7 +355,7 @@ const styles = StyleSheet.create({
         zIndex: 2,
         zIndex: 2,
     },
     },
     mainContent: {
     mainContent: {
-        paddingTop: 100,
+        marginTop: 100,
         backgroundColor: "transparent",
         backgroundColor: "transparent",
     },
     },
     tab: {
     tab: {

+ 202 - 63
screens/HomeScreenPage1.js

@@ -22,6 +22,9 @@ import { useFocusEffect } from "@react-navigation/native";
 import { useModel } from "flooks";
 import { useModel } from "flooks";
 import GoodsCard from "../components/GoodsCardVertical";
 import GoodsCard from "../components/GoodsCardVertical";
 import GoodsCardLarge from "../components/GoodsCard";
 import GoodsCardLarge from "../components/GoodsCard";
+import * as RootNavigation from "../navigation/RootNavigation.js";
+import ActionButton from "react-native-action-button";
+import EmptyComponent from "../components/EmptyComponent";
 
 
 const width = Dimensions.get("window").width;
 const width = Dimensions.get("window").width;
 const height = Dimensions.get("window").height;
 const height = Dimensions.get("window").height;
@@ -30,7 +33,11 @@ export default function HomePage1(props) {
     const { httpPost, httpGet } = useModel("httpModel", true);
     const { httpPost, httpGet } = useModel("httpModel", true);
     const [classifications, setClassifications] = React.useState([]);
     const [classifications, setClassifications] = React.useState([]);
     const [selectId, changeSelectId] = React.useState(0);
     const [selectId, changeSelectId] = React.useState(0);
-
+    const [goods, setGoods] = React.useState([]);
+    const [goodsClass, setGoodsClass] = React.useState([]);
+    const { showDialog } = useModel("dialogModel", true);
+    const { removeTips, remove, successText } = useModel("userModel");
+    const { success } = useModel("loadingModel", true);
     useFocusEffect(
     useFocusEffect(
         React.useCallback(() => {
         React.useCallback(() => {
             httpGet("/classification/my").then((res) => {
             httpGet("/classification/my").then((res) => {
@@ -39,89 +46,213 @@ export default function HomePage1(props) {
                     changeSelectId(res[0].id);
                     changeSelectId(res[0].id);
                 }
                 }
             });
             });
+            httpGet("/goods/my").then((res) => {
+                setGoods(res);
+            });
         }, [])
         }, [])
     );
     );
 
 
+    const topGoods = React.useMemo(() => {
+        return goods.filter((item) => {
+            return item.signboard;
+        });
+    }, [goods]);
+
+    const elseGoods = React.useMemo(() => {
+        return goods.filter((item) => {
+            return !item.signboard;
+        });
+    }, [goods]);
+
     React.useEffect(() => {
     React.useEffect(() => {
         function getAllGoods() {
         function getAllGoods() {
             httpGet("/classification/allGoods", {
             httpGet("/classification/allGoods", {
                 classificationId: selectId,
                 classificationId: selectId,
-            }).then((res) => {});
+            }).then((res) => {
+                setGoodsClass(res);
+            });
         }
         }
-
         if (selectId) {
         if (selectId) {
             getAllGoods();
             getAllGoods();
         }
         }
     }, [selectId]);
     }, [selectId]);
 
 
-    return (
-        <Layout style={styles.tabContainer}>
-            <Card
-                appearance='homePage1Card'
-                disabled={true}
-                style={styles.card}
-                header={(props) => (
-                    <Text {...props} style={[styles.title, props.style]}>
-                        店主推荐
-                    </Text>
-                )}
-            >
-                <Layout style={styles.goodsList}>
-                    <GoodsCard />
-                    <GoodsCard />
-                </Layout>
-            </Card>
+    const classificationItem = ({ item, index }) => (
+        <ListItem
+            appearance='classification'
+            title={(textprops) => (
+                <Text
+                    {...textprops}
+                    style={[
+                        textprops.style,
+                        { textAlign: "center" },
+                        item.id === selectId && styles.selectItem,
+                    ]}
+                >
+                    {item.name}
+                </Text>
+            )}
+            onPress={() => {
+                changeSelectId(item.id);
+            }}
+        />
+    );
 
 
-            <Layout style={styles.content}>
-                <List
-                    style={styles.container}
-                    data={classifications}
-                    renderItem={classificationItem}
+    const topGoodsItem = ({ item, index }) => <GoodsCard info={item} />;
+    const PulsIcon = (props) => (
+        <Icon
+            {...props}
+            style={[props.style, { width: 50, height: 50 }]}
+            name='plus'
+        />
+    );
+    const topGoodsMap = (list) => {
+        var _list = list.map((item, index) => {
+            return (
+                <GoodsCard
+                    info={item}
+                    key={index}
+                    removeEvent={() => {
+                        showDialog({
+                            bodyText: removeTips,
+                            status: "danger",
+                            cancelable: true,
+                            confirmCallback: () => {
+                                changeSignboard(item.id, false, remove);
+                            },
+                        });
+                    }}
                 />
                 />
-                <List
-                    style={styles.goodsContainer}
-                    data={classifications}
-                    renderItem={goodsItem}
+            );
+        });
+        if (_list.length == 0) {
+            _list.push(
+                <Button
+                    style={styles.add}
+                    accessoryLeft={PulsIcon}
+                    key={1}
+                    onPress={() => {
+                        RootNavigation.navigate("AddClassification", {
+                            type: "signboard",
+                        });
+                    }}
                 />
                 />
+            );
+        }
+        if (_list.length == 1) {
+            _list.push(
                 <Button
                 <Button
-                    style={styles.addClassificat}
-                    appearance='classification'
+                    style={styles.add}
+                    accessoryLeft={PulsIcon}
+                    key={2}
+                    onPress={() => {
+                        RootNavigation.navigate("AddClassification");
+                    }}
+                />
+            );
+        }
+        return _list;
+    };
+
+    function changeSignboard(id, signboard, tips) {
+        httpPost(
+            "/goods/save",
+            {
+                id,
+                signboard,
+            },
+            { body: "json" }
+        ).then((res) => {
+            success(tips + successText);
+            let _goods = goods.map((item) => {
+                if (item.id != id) {
+                    return item;
+                } else {
+                    return res;
+                }
+            });
+            changeGoods(_goods);
+        });
+    }
+
+    return (
+        <>
+            <Layout style={styles.tabContainer}>
+                <Card
+                    appearance='homePage1Card'
+                    disabled={true}
+                    style={styles.card}
+                    header={(props) => (
+                        <Text {...props} style={[styles.title, props.style]}>
+                            店主推荐
+                        </Text>
+                    )}
                 >
                 >
-                    编辑分类
-                </Button>
+                    {/* <List
+                    style={styles.goodsList}
+                    data={topGoods}
+                    renderItem={topGoodsItem}
+                /> */}
+                    <Layout style={styles.goodsList}>
+                        {topGoodsMap(topGoods)}
+                    </Layout>
+                </Card>
 
 
-                <Button
-                    style={styles.addGoods}
-                    appearance='classification'
-                    status='danger'
-                    accessoryLeft={StarIcon}
-                />
+                <Layout style={styles.content}>
+                    <List
+                        style={styles.container}
+                        data={classifications}
+                        renderItem={classificationItem}
+                        ListFooterComponent={() => (
+                            <Button
+                                style={styles.addClassificat}
+                                appearance='classification'
+                                onPress={() => {
+                                    RootNavigation.navigate("AddNewClass");
+                                }}
+                            >
+                                编辑分类
+                            </Button>
+                        )}
+                    />
+                    <List
+                        style={styles.goodsContainer}
+                        data={goodsClass}
+                        renderItem={goodsItem}
+                        ListEmptyComponent={EmptyComponent}
+                        ListFooterComponent={() => (
+                            <Button
+                                style={styles.addGoods}
+                                appearance='classification'
+                                status='danger'
+                                accessoryLeft={StarIcon}
+                                onPress={() => {
+                                    RootNavigation.navigate(
+                                        "AddClassification",
+                                        {
+                                            type: "classification",
+                                            classificationId: selectId,
+                                        }
+                                    );
+                                }}
+                            />
+                        )}
+                    />
+                </Layout>
             </Layout>
             </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 StarIcon = (props) => <Icon {...props} name='plus' />;
 
 
 const goodsItem = ({ item, index }) => (
 const goodsItem = ({ item, index }) => (
-    <GoodsCardLarge appearance='classification' />
+    <GoodsCardLarge appearance='classification' info={item} />
 );
 );
 
 
 const styles = StyleSheet.create({
 const styles = StyleSheet.create({
     tabContainer: {
     tabContainer: {
         backgroundColor: "transparent",
         backgroundColor: "transparent",
+        flex: 1,
     },
     },
     goodsList: {
     goodsList: {
         flexDirection: "row",
         flexDirection: "row",
@@ -143,30 +274,38 @@ const styles = StyleSheet.create({
     content: {
     content: {
         flexDirection: "row",
         flexDirection: "row",
         minHeight: 200,
         minHeight: 200,
+        flex: 1,
     },
     },
     goodsContainer: {
     goodsContainer: {
         flex: 1,
         flex: 1,
         backgroundColor: "#FFFFFF",
         backgroundColor: "#FFFFFF",
         paddingBottom: 100,
         paddingBottom: 100,
+        paddingTop: 10,
     },
     },
     classificat: {
     classificat: {
         backgroundColor: "#F0F0F0",
         backgroundColor: "#F0F0F0",
     },
     },
     addClassificat: {
     addClassificat: {
-        width: 44,
+        width: 36,
         alignSelf: "center",
         alignSelf: "center",
         marginTop: 20,
         marginTop: 20,
-        position: "absolute",
-        bottom: 30,
-        left: 30,
     },
     },
     addGoods: {
     addGoods: {
         width: 40,
         width: 40,
         height: 40,
         height: 40,
-        alignSelf: "center",
+        alignSelf: "flex-end",
         marginTop: 20,
         marginTop: 20,
-        position: "absolute",
-        bottom: 30,
-        right: 30,
+        marginRight: 15,
+    },
+    add: {
+        flex: 1,
+        backgroundColor: "#FFF5D8",
+        borderColor: "#FFF5D8",
+        minHeight: 232,
+        marginHorizontal: 2,
+    },
+    selectItem: {
+        color: "#FFC21C",
+        fontWeight: "bold",
     },
     },
 });
 });

+ 0 - 10
screens/HomeScreenPage2.js

@@ -33,16 +33,6 @@ export default function HomePage2(props) {
     const { showDialog } = useModel("dialogModel", true);
     const { showDialog } = useModel("dialogModel", true);
 
 
     const { editText, autoBackText } = useModel("wordsModel");
     const { editText, autoBackText } = useModel("wordsModel");
-    useFocusEffect(
-        React.useCallback(() => {
-            // httpGet("/classification/my").then((res) => {
-            //     setClassifications(res);
-            //     if (res.length > 0) {
-            //         changeSelectId(res[0].id);
-            //     }
-            // });
-        }, [])
-    );
 
 
     return (
     return (
         <Layout style={styles.tabContainer}>
         <Layout style={styles.tabContainer}>

+ 1 - 10
screens/HomeScreenPage3.js

@@ -33,16 +33,7 @@ export default function HomePage3(props) {
     const { showDialog } = useModel("dialogModel", true);
     const { showDialog } = useModel("dialogModel", true);
 
 
     const { editText, autoBackText } = useModel("wordsModel");
     const { editText, autoBackText } = useModel("wordsModel");
-    useFocusEffect(
-        React.useCallback(() => {
-            // httpGet("/classification/my").then((res) => {
-            //     setClassifications(res);
-            //     if (res.length > 0) {
-            //         changeSelectId(res[0].id);
-            //     }
-            // });
-        }, [])
-    );
+
 
 
     return (
     return (
         <Layout style={styles.tabContainer}>
         <Layout style={styles.tabContainer}>

+ 0 - 74
screens/LinksScreen.js

@@ -1,74 +0,0 @@
-import { Ionicons } from '@expo/vector-icons';
-import * as WebBrowser from 'expo-web-browser';
-import * as React from 'react';
-import { StyleSheet, Text, View } from 'react-native';
-import { RectButton, ScrollView } from 'react-native-gesture-handler';
-
-export default function LinksScreen() {
-  return (
-    <ScrollView style={styles.container} contentContainerStyle={styles.contentContainer}>
-      <OptionButton
-        icon="md-school"
-        label="Read the Expo documentation"
-        onPress={() => WebBrowser.openBrowserAsync('https://docs.expo.io')}
-      />
-
-      <OptionButton
-        icon="md-compass"
-        label="Read the React Navigation documentation"
-        onPress={() => WebBrowser.openBrowserAsync('https://reactnavigation.org')}
-      />
-
-      <OptionButton
-        icon="ios-chatboxes"
-        label="Ask a question on the forums"
-        onPress={() => WebBrowser.openBrowserAsync('https://forums.expo.io')}
-        isLastOption
-      />
-    </ScrollView>
-  );
-}
-
-function OptionButton({ icon, label, onPress, isLastOption }) {
-  return (
-    <RectButton style={[styles.option, isLastOption && styles.lastOption]} onPress={onPress}>
-      <View style={{ flexDirection: 'row' }}>
-        <View style={styles.optionIconContainer}>
-          <Ionicons name={icon} size={22} color="rgba(0,0,0,0.35)" />
-        </View>
-        <View style={styles.optionTextContainer}>
-          <Text style={styles.optionText}>{label}</Text>
-        </View>
-      </View>
-    </RectButton>
-  );
-}
-
-const styles = StyleSheet.create({
-  container: {
-    flex: 1,
-    backgroundColor: '#fafafa',
-  },
-  contentContainer: {
-    paddingTop: 15,
-  },
-  optionIconContainer: {
-    marginRight: 12,
-  },
-  option: {
-    backgroundColor: '#fdfdfd',
-    paddingHorizontal: 15,
-    paddingVertical: 15,
-    borderWidth: StyleSheet.hairlineWidth,
-    borderBottomWidth: 0,
-    borderColor: '#ededed',
-  },
-  lastOption: {
-    borderBottomWidth: StyleSheet.hairlineWidth,
-  },
-  optionText: {
-    fontSize: 15,
-    alignSelf: 'flex-start',
-    marginTop: 1,
-  },
-});

+ 4 - 2
screens/LoginScreen.js

@@ -179,12 +179,14 @@ export default function LoginScreen({ navigation, route }) {
                                 if (selectedIndex === 0) {
                                 if (selectedIndex === 0) {
                                     loginByPassword(phone, password).then(
                                     loginByPassword(phone, password).then(
                                         (_) => {
                                         (_) => {
-                                            RootNavigation.navigate("Root");
+                                            RootNavigation.replace(
+                                                "LoadingModel"
+                                            );
                                         }
                                         }
                                     );
                                     );
                                 } else {
                                 } else {
                                     loginByCode(phone, code).then((_) => {
                                     loginByCode(phone, code).then((_) => {
-                                        RootNavigation.navigate("Root");
+                                        RootNavigation.replace("LoadingModel");
                                     });
                                     });
                                 }
                                 }
                             }}
                             }}

+ 38 - 0
screens/OrderListScreen.js

@@ -0,0 +1,38 @@
+import { Ionicons } from "@expo/vector-icons";
+import * as WebBrowser from "expo-web-browser";
+import * as React from "react";
+import { StyleSheet } from "react-native";
+import {
+    Layout,
+    Text,
+    useTheme,
+    Button,
+    Card,
+    Icon,
+    MenuItem,
+    OverflowMenu,
+    TopNavigation,
+    TopNavigationAction,
+    Modal,
+    List,
+} from "@ui-kitten/components";
+import { useModel } from "flooks";
+import NavHeaderBar from "../components/NavHeaderBar";
+
+export default function OrderListScreen() {
+    const {
+        tab2,
+        fullReduction2,
+        fullReduction1,
+        delText,
+        editText,
+        confirm,
+        cancel,
+        complete,
+        successText,
+        removeTips,
+    } = useModel("wordsModel");
+    return <List></List>;
+}
+
+const styles = StyleSheet.create({});

+ 84 - 0
screens/OrderScreen.js

@@ -0,0 +1,84 @@
+import { Ionicons } from "@expo/vector-icons";
+import * as WebBrowser from "expo-web-browser";
+import * as React from "react";
+import { Dimensions } from "react-native";
+import { StyleSheet } from "react-native";
+import { useModel } from "flooks";
+import NavHeaderBar from "../components/NavHeaderBar";
+import OrderListScreen from "./OrderListScreen";
+import { Layout, Text } from "@ui-kitten/components";
+import LoadingNode from "../components/LoadingNode";
+import { createMaterialTopTabNavigator } from "@react-navigation/material-top-tabs";
+const Tab = createMaterialTopTabNavigator();
+
+const labelText = (focused, title) => (
+    <Text category='s1' status={focused ? "primary" : ""}>
+        {title}
+    </Text>
+);
+export default function OrderScreen() {
+    const { NOTRECEIVED, RECEIVED, REJECTED, COMPLETED, tab2 } = useModel(
+        "wordsModel"
+    );
+    return (
+        <>
+            <NavHeaderBar title={tab2} />
+            <Tab.Navigator
+                initialRouteName='NOTRECEIVED'
+                lazy={true}
+                tabBarOptions={{
+                    activeTintColor: "#FFC21C",
+                    inactiveTintColor: "#000",
+                    style: styles.tabBack,
+                    indicatorStyle: styles.indicatorStyle,
+                    labelStyle: {
+                        zIndex: 2,
+                    },
+                }}
+                lazyPlaceholder={LoadingNode}
+            >
+                <Tab.Screen
+                    name='NOTRECEIVED'
+                    component={OrderListScreen}
+                    options={{
+                        tabBarLabel: ({ focused }) =>
+                            labelText(focused, NOTRECEIVED),
+                    }}
+                />
+                <Tab.Screen
+                    name='RECEIVED'
+                    component={OrderListScreen}
+                    options={{
+                        tabBarLabel: ({ focused }) =>
+                            labelText(focused, RECEIVED),
+                    }}
+                />
+                <Tab.Screen
+                    name='COMPLETED'
+                    component={OrderListScreen}
+                    options={{
+                        tabBarLabel: ({ focused }) =>
+                            labelText(focused, COMPLETED),
+                    }}
+                />
+                <Tab.Screen
+                    name='REJECTED'
+                    component={OrderListScreen}
+                    options={{
+                        tabBarLabel: ({ focused }) =>
+                            labelText(focused, REJECTED),
+                    }}
+                />
+            </Tab.Navigator>
+        </>
+    );
+}
+
+const styles = StyleSheet.create({
+    tabBack: {
+        backgroundColor: "#eee",
+    },
+    indicatorStyle: {
+        backgroundColor: "#FFC21C",
+    },
+});

+ 0 - 3
screens/StoreAudit.js

@@ -46,9 +46,6 @@ export default function StoreAudit({ navigation, route }) {
         }, [])
         }, [])
     );
     );
 
 
-    const canNext = React.useMemo(() => {
-        return true;
-    }, [name]);
 
 
     return (
     return (
         <>
         <>

+ 121 - 22
screens/UserScreen.js

@@ -26,16 +26,15 @@ import {
     TopNavigation,
     TopNavigation,
     TopNavigationAction,
     TopNavigationAction,
     Modal,
     Modal,
-    MenuGroup
+    MenuGroup,
 } from "@ui-kitten/components";
 } from "@ui-kitten/components";
 import FormInput from "../components/FormInput";
 import FormInput from "../components/FormInput";
 import { useFocusEffect, useNavigation } from "@react-navigation/native";
 import { useFocusEffect, useNavigation } from "@react-navigation/native";
 import ScrollPage from "../components/ScrollPage";
 import ScrollPage from "../components/ScrollPage";
 import * as RootNavigation from "../navigation/RootNavigation.js";
 import * as RootNavigation from "../navigation/RootNavigation.js";
+import NavHeaderBar from "../components/NavHeaderBar";
 
 
-const NextIcon = (props) => <Icon {...props} name='arrow-ios-downward' />;
-
-export default function UserScreen() {
+export default function UserScreen({ navigation }) {
     const theme = useTheme();
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
     const { changeBackground } = useModel("barModel");
     const {
     const {
@@ -48,16 +47,25 @@ export default function UserScreen() {
     } = useModel("userModel");
     } = useModel("userModel");
 
 
     const {
     const {
-        homeBar,
-        homeTip1,
-        homeTitle1,
-        homeTitle2,
-        homeTitle3,
-        homeTip2,
-        homeTip3,
-        homeTab1,
-        homeTab2,
-        homeTab3,
+        tab3,
+        userTitle1,
+        userTitle2,
+        userTitle3,
+        userTitle4,
+        userTitle5,
+        userTitle6,
+        userTitle31,
+        userTitle32,
+        userTitle33,
+        userTitle34,
+        userTitle41,
+        userTitle42,
+        userTitle61,
+        userTitle62,
+        userTitle21,
+        userTitle22,
+        userTitle23,
+        userTitle24,
     } = useModel("wordsModel");
     } = useModel("wordsModel");
     const [bannerImg, changeBannerImg] = React.useState("");
     const [bannerImg, changeBannerImg] = React.useState("");
 
 
@@ -71,20 +79,99 @@ export default function UserScreen() {
 
 
     return (
     return (
         <>
         <>
+            <NavHeaderBar title={tab3} back={false} />
             <ScrollPage>
             <ScrollPage>
                 <Layout style={styles.container} level='1'>
                 <Layout style={styles.container} level='1'>
                     <Menu style={styles.menu}>
                     <Menu style={styles.menu}>
-                        <MenuItem title='Users' accessoryRight={NextIcon} />
-                        <MenuItem title='Orders' accessoryRight={NextIcon} />
                         <MenuItem
                         <MenuItem
-                            title='Transactions'
-                            accessoryRight={NextIcon}
+                            title={userTitle1}
+                            accessoryRight={ForwardIcon}
+                            style={styles.menuItem}
+                            onPress={() => {
+                                navigation.navigate("Home", { index: 2 });
+                            }}
+                        />
+
+                        <MenuGroup title={userTitle2} style={styles.menuGroup}>
+                            <MenuItem
+                                title={userTitle21}
+                                accessoryRight={ForwardIcon}
+                                onPress={() => {
+                                    navigation.navigate("FullReduction");
+                                }}
+                            />
+                            <MenuItem
+                                title={userTitle22}
+                                accessoryRight={ForwardIcon}
+                            />
+                            <MenuItem
+                                title={userTitle23}
+                                accessoryRight={ForwardIcon}
+                            />
+                            <MenuItem
+                                title={userTitle24}
+                                accessoryRight={ForwardIcon}
+                            />
+                        </MenuGroup>
+
+                        <MenuGroup title={userTitle3} style={styles.menuGroup}>
+                            <MenuItem
+                                title={userTitle31}
+                                accessoryRight={ForwardIcon}
+                                onPress={() => {
+                                    navigation.navigate("EditGoods");
+                                }}
+                            />
+                            <MenuItem
+                                title={userTitle32}
+                                accessoryRight={ForwardIcon}
+                            />
+                            <MenuItem
+                                title={userTitle33}
+                                accessoryRight={ForwardIcon}
+                            />
+                            <MenuItem
+                                title={userTitle34}
+                                accessoryRight={ForwardIcon}
+                                onPress={() => {
+                                    navigation.navigate("AddClassification");
+                                }}
+                            />
+                        </MenuGroup>
+                        <MenuGroup title={userTitle4} style={styles.menuGroup}>
+                            <MenuItem
+                                title={userTitle41}
+                                accessoryRight={ForwardIcon}
+                            />
+                            <MenuItem
+                                title={userTitle42}
+                                accessoryRight={ForwardIcon}
+                            />
+                        </MenuGroup>
+
+                        <MenuItem
+                            title={userTitle5}
+                            accessoryRight={ForwardIcon}
+                            style={styles.menuItem}
+                            onPress={() => {
+                                navigation.navigate("Home", { index: 1 });
+                            }}
                         />
                         />
+                        <MenuGroup title={userTitle6} style={styles.menuGroup}>
+                            <MenuItem
+                                title={userTitle61}
+                                accessoryRight={ForwardIcon}
+                            />
+                            <MenuItem
+                                title={userTitle62}
+                                accessoryRight={ForwardIcon}
+                            />
+                        </MenuGroup>
 
 
-                        <MenuGroup title='Akveo React Native'>
+                        {/* <MenuGroup title='Akveo React Native'>
                             <MenuItem title='UI Kitten' />
                             <MenuItem title='UI Kitten' />
                             <MenuItem title='Kitten Tricks' />
                             <MenuItem title='Kitten Tricks' />
-                        </MenuGroup>
+                        </MenuGroup> */}
                     </Menu>
                     </Menu>
                 </Layout>
                 </Layout>
             </ScrollPage>
             </ScrollPage>
@@ -94,7 +181,14 @@ export default function UserScreen() {
 
 
 const StarIcon = (props) => <Icon {...props} name='star' />;
 const StarIcon = (props) => <Icon {...props} name='star' />;
 
 
-const ForwardIcon = (props) => <Icon {...props} name='arrow-ios-forward' />;
+const ForwardIcon = (props) => (
+    <Icon
+        {...props}
+        name='arrow-ios-forward'
+        fill='#B4B4B4'
+        style={{ width: 15, height: 15, fontWeight: 500 }}
+    />
+);
 
 
 const styles = StyleSheet.create({
 const styles = StyleSheet.create({
     container: {
     container: {
@@ -103,6 +197,11 @@ const styles = StyleSheet.create({
     },
     },
     menu: {
     menu: {
         flex: 1,
         flex: 1,
-        margin: 8,
+        backgroundColor: "#EEEEEE",
+        paddingVertical: 3,
+    },
+    menuItem: { marginVertical: 3 },
+    menuGroup: {
+        marginTop: 3,
     },
     },
 });
 });

Diferenças do arquivo suprimidas por serem muito extensas
+ 552 - 103
yarn.lock


Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff