浏览代码

文件格式化

panhui 5 年之前
父节点
当前提交
50616a53b1
共有 100 个文件被更改,包括 7362 次插入7269 次删除
  1. 24 0
      .eslintrc.json
  2. 80 110
      App.js
  3. 4 3
      Utils/ListUtil.js
  4. 12 8
      Utils/OpenTimeUtil.js
  5. 15 13
      Utils/SystemRuleUtil.js
  6. 43 64
      components/Actionsheet.js
  7. 28 26
      components/Badge.js
  8. 36 46
      components/BankCard.js
  9. 0 17
      components/Button.js
  10. 135 131
      components/Comment.js
  11. 27 40
      components/Datepicker.js
  12. 100 107
      components/Dialog.js
  13. 39 40
      components/Email.js
  14. 9 9
      components/EmptyComponent.js
  15. 189 202
      components/FormInput.js
  16. 146 142
      components/GoodsCard.js
  17. 66 62
      components/GoodsCardVertical.js
  18. 32 30
      components/GuideHeaderBar.js
  19. 48 48
      components/ListComponent.js
  20. 35 35
      components/Loading.js
  21. 7 7
      components/LoadingNode.js
  22. 44 51
      components/MoneyRecord.js
  23. 13 24
      components/NavHeaderBar.js
  24. 179 183
      components/OpenTime.js
  25. 205 194
      components/OrderCard.js
  26. 36 35
      components/ScrollPage.js
  27. 0 6
      components/StyledText.js
  28. 6 6
      components/TabBarIcon.js
  29. 0 26
      components/Text.js
  30. 17 16
      components/TipNavHeader.js
  31. 55 63
      components/UpLoadImage.js
  32. 2 2
      constants/Layout.js
  33. 2 2
      language/index.js
  34. 2 2
      language/th.js
  35. 9 9
      language/zh.js
  36. 8 3
      models/barModel.js
  37. 11 8
      models/complaintModel.js
  38. 11 8
      models/couponModel.js
  39. 3 3
      models/dialogModel.js
  40. 10 8
      models/emailModel.js
  41. 40 39
      models/goodsModel.js
  42. 6 7
      models/httpModel.js
  43. 4 6
      models/loadingModel.js
  44. 1 0
      models/moenyRecordModel.js
  45. 5 6
      models/orderInfoModel.js
  46. 46 48
      models/userModel.js
  47. 10 9
      models/wordsModel.js
  48. 18 19
      navigation/BasicNavigator.js
  49. 53 54
      navigation/BottomTabNavigator.js
  50. 38 53
      navigation/GuideStackNavigator.js
  51. 0 54
      navigation/LoadingModel.js
  52. 11 23
      navigation/LoginStackNavigator.js
  53. 5 4
      navigation/RootNavigation.js
  54. 41 43
      navigation/TopTabNavigator.js
  55. 784 0
      package-lock.json
  56. 14 0
      package.json
  57. 201 209
      screens/AddGoodsClassification.js
  58. 32 66
      screens/Appraisal/ComplaintlistScreen.js
  59. 52 75
      screens/Appraisal/EmailDetail.js
  60. 36 68
      screens/Appraisal/SystemEmail.js
  61. 8 8
      screens/Appraisal/index.js
  62. 99 102
      screens/Bank/AddScreen.js
  63. 83 80
      screens/Bank/MainScreen.js
  64. 99 134
      screens/Bank/MoneyListScreen.js
  65. 135 125
      screens/Bank/RechargeDetailScreen.js
  66. 75 91
      screens/Bank/RechargeScreen.js
  67. 8 8
      screens/Bank/index.js
  68. 35 35
      screens/BankScreen.js
  69. 107 113
      screens/Coupon/AddScreen.js
  70. 6 6
      screens/Coupon/index.js
  71. 37 66
      screens/Coupon/listScreen.js
  72. 105 114
      screens/EditBannerScreen.js
  73. 63 79
      screens/EditGoods.js
  74. 160 172
      screens/FullReduction.js
  75. 276 278
      screens/Goods/GoodsDetailScreen.js
  76. 188 199
      screens/Goods/GoodsSpecificationScreen.js
  77. 57 75
      screens/Goods/SearchScreen.js
  78. 10 10
      screens/Goods/index.js
  79. 228 237
      screens/Guide1Screen.js
  80. 136 136
      screens/Guide2Screen.js
  81. 87 92
      screens/Guide3Screen.js
  82. 41 49
      screens/Guide4Screen.js
  83. 255 278
      screens/HomeScreen.js
  84. 209 210
      screens/HomeScreenPage1.js
  85. 56 74
      screens/HomeScreenPage2.js
  86. 183 212
      screens/HomeScreenPage3.js
  87. 185 177
      screens/LoginScreen.js
  88. 98 115
      screens/MoneyListScreen.js
  89. 0 88
      screens/OrderListScreen.js
  90. 77 80
      screens/OrderScreen.js
  91. 204 205
      screens/RegisterScreen.js
  92. 131 138
      screens/RegisterSeScreen.js
  93. 115 126
      screens/Set/AutomaticScreen.js
  94. 117 126
      screens/Set/ClassificationEditScreen.js
  95. 102 91
      screens/Set/DistributionScreen.js
  96. 164 193
      screens/Set/FirstOrderScreen.js
  97. 95 118
      screens/Set/OrderSetting.js
  98. 135 144
      screens/Set/SystemClassificationEditScreen.js
  99. 25 25
      screens/Set/index.js
  100. 83 88
      screens/StoreAudit.js

+ 24 - 0
.eslintrc.json

@@ -0,0 +1,24 @@
+{
+    "extends": ["airbnb", "prettier"],
+    "plugins": ["prettier"],
+    "parser": "babel-eslint",
+    "env": {
+        "browser": true,
+        "es6": true
+    },
+    "rules": {
+        "import/no-unresolved": 0,
+        "prettier/prettier": 0,
+        "no-unused-vars": ["error", { "vars": "local" ,"varsIgnorePattern": "WebBrowser" }],
+        "no-nested-ternary": 0,
+        "react/no-array-index-key": 0,
+        "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }],
+        "no-unused-expressions": [
+            "error",
+            { "allowShortCircuit": true, "allowTernary": true }
+        ],
+        "no-param-reassign": 0,
+        "react/prop-types": [0, { "ignore": ["navigation"]}],
+        "react/jsx-props-no-spreading":[1,{"html": "ignore", "exceptions": ["Icon", "props","Avatar","Text"] }]
+    }
+}

+ 80 - 110
App.js

@@ -1,18 +1,14 @@
+/* eslint-disable import/no-named-default */
+/* eslint-disable react/destructuring-assignment */
+/* eslint-disable react/jsx-props-no-spreading */
 import * as React from "react";
 import * as eva from "@eva-design/eva";
 import {
     ApplicationProvider,
     Layout,
-    Button,
-    IconRegistry,
-    Text,
-    Modal,
-    Icon,
+    IconRegistry
 } from "@ui-kitten/components";
 import { EvaIconsPack } from "@ui-kitten/eva-icons";
-import { default as theme } from "./theme.json"; // <-- Import app theme
-import { default as customMapping } from "./mapping.json"; // <-- Import app theme
-import { SafeAreaView } from "react-native";
 import { SplashScreen } from "expo";
 import * as Font from "expo-font";
 import { Ionicons } from "@expo/vector-icons";
@@ -21,37 +17,26 @@ import {
     createStackNavigator,
     CardStyleInterpolators,
 } from "@react-navigation/stack";
+import { useModel } from "flooks";
+import { enableScreens } from "react-native-screens";
+// eslint-disable-next-line no-unused-vars
+import * as model from './models'
+import { default as theme } from "./theme.json"; // <-- Import app theme
+import { default as customMapping } from "./mapping.json"; // <-- Import app theme
 import Dialog from "./components/Dialog";
 import Loading from "./components/Loading";
 
-import { useModel } from "flooks";
-import * as models from "./models";
-
-import LoadingModel from "./navigation/LoadingModel";
 import BottomTabNavigator from "./navigation/BottomTabNavigator";
 import LoginStackNavigator from "./navigation/LoginStackNavigator";
 import GuideScreens from "./navigation/GuideStackNavigator";
 import BasicScreens from "./navigation/BasicNavigator";
 import { navigationRef } from "./navigation/RootNavigation";
 
-import * as ApplyStatus from "./config/ApplyStatus";
-import ActionButton from "react-native-action-button";
-import { enableScreens } from "react-native-screens";
 enableScreens();
 
 const Stack = createStackNavigator();
 
-const config = {
-    animation: "spring",
-    config: {
-        stiffness: 1000,
-        damping: 500,
-        mass: 3,
-        overshootClamping: true,
-        restDisplacementThreshold: 0.01,
-        restSpeedThreshold: 0.01,
-    },
-};
+const fontFile= require("./assets/fonts/SpaceMono-Regular.ttf")
 
 export default function App(props) {
     const [isLoadingComplete, setLoadingComplete] = React.useState(false);
@@ -65,13 +50,14 @@ export default function App(props) {
                 // Load fonts
                 await Font.loadAsync({
                     ...Ionicons.font,
-                    "space-mono": require("./assets/fonts/SpaceMono-Regular.ttf"),
+                    "space-mono": fontFile,
                 });
 
                 getWords();
             } catch (e) {
                 // We might want to provide this error information to an error reporting service
-                console.warn(e);
+                // eslint-disable-next-line no-console
+                console.log(e);
             } finally {
                 setLoadingComplete(true);
                 SplashScreen.hide();
@@ -91,14 +77,12 @@ export default function App(props) {
     } = useModel("userModel");
 
     React.useEffect(() => {
-        console.log("刷新");
-        console.log(initApp);
-        if (initApp && refreashReason != "guideStep") {
+        if (initApp && refreashReason !== "guideStep") {
             setLogin("loading");
             getUserInfo()
                 .then(() => {
                     getGuideStep().then(res => {
-                        if (res == "finish") {
+                        if (res === "finish") {
                             setLogin("login");
                         } else {
                             setLogin(res);
@@ -111,11 +95,11 @@ export default function App(props) {
                 .finally(() => {
                     changeInIt();
                 });
-        } else if (initApp && refreashReason == "guideStep") {
+        } else if (initApp && refreashReason === "guideStep") {
             setLogin("loading");
             getGuideStep()
                 .then(res => {
-                    if (res == "finish") {
+                    if (res === "finish") {
                         setLogin("login");
                     } else {
                         setLogin(res);
@@ -129,92 +113,78 @@ export default function App(props) {
 
     if (!isLoadingComplete && !props.skipLoadingScreen) {
         return null;
-    } else {
-        return (
-            <>
-                <IconRegistry icons={EvaIconsPack} />
-                <ApplicationProvider
-                    {...eva}
-                    theme={{ ...eva.light, ...theme }}
-                    customMapping={customMapping}
-                >
-                    <Loading />
-                    <Dialog />
-                    <Layout style={{ flex: 1 }}>
-                        {loginState != "loading" && (
-                            <NavigationContainer ref={navigationRef}>
-                                <Stack.Navigator
-                                    headerMode='none'
-                                    screenOptions={{
-                                        gestureEnabled: true,
-                                        cardStyleInterpolator:
-                                            CardStyleInterpolators.forHorizontalIOS,
-                                    }}
-                                    // initialRouteName='GoodsSpecification'
-                                >
-                                    {/* <Stack.Screen
+    }
+    return (
+      <>
+        <IconRegistry icons={EvaIconsPack} />
+        <ApplicationProvider
+          {...eva}
+          theme={{ ...eva.light, ...theme }}
+          customMapping={customMapping}
+        >
+          <Loading />
+          <Dialog />
+          <Layout style={{ flex: 1 }}>
+            {loginState !== "loading" && (
+            <NavigationContainer ref={navigationRef}>
+              <Stack.Navigator
+                headerMode='none'
+                screenOptions={{
+                                    gestureEnabled: true,
+                                    cardStyleInterpolator:
+                                        CardStyleInterpolators.forHorizontalIOS,
+                                }}
+              >
+                {/* <Stack.Screen
                                     name='LoadingModel'
                                     component={LoadingModel}
                                 /> */}
 
-                                    {GuideScreens(Stack.Screen, loginState)}
-
-                                    {loginState === "login" && (
-                                        <Stack.Screen
-                                            name='Root'
-                                            component={BottomTabNavigator}
-                                            options={{
-                                                animationTypeForReplace:
-                                                    loginState === "login"
-                                                        ? "pop"
-                                                        : "push",
-                                            }}
-                                        />
-                                    )}
-                                    {loginState === "loginOut" && (
-                                        <Stack.Screen
-                                            name='Login'
-                                            component={LoginStackNavigator}
-                                            options={{
-                                                animationTypeForReplace:
-                                                    loginState === "loginOut"
-                                                        ? "pop"
-                                                        : "push",
-                                            }}
-                                        />
-                                    )}
-
-                                    {/* 基础功能页面 */}
-                                    {BasicScreens(Stack.Screen)}
-                                </Stack.Navigator>
-                            </NavigationContainer>
-                        )}
-                    </Layout>
-                    {/* <ActionButton
+                {GuideScreens(Stack.Screen, loginState)}
+
+                {loginState === "login" && (
+                <Stack.Screen
+                  name='Root'
+                  component={BottomTabNavigator}
+                  options={{
+                                            animationTypeForReplace:
+                                                loginState === "login"
+                                                    ? "pop"
+                                                    : "push",
+                                        }}
+                />
+                                )}
+                {loginState === "loginOut" && (
+                <Stack.Screen
+                  name='Login'
+                  component={LoginStackNavigator}
+                  options={{
+                                            animationTypeForReplace:
+                                                loginState === "loginOut"
+                                                    ? "pop"
+                                                    : "push",
+                                        }}
+                />
+                                )}
+
+                {/* 基础功能页面 */}
+                {BasicScreens(Stack.Screen)}
+              </Stack.Navigator>
+            </NavigationContainer>
+                    )}
+          </Layout>
+          {/* <ActionButton
                         buttonColor='#FFC21C'
                         offsetY={60}
                         position='left'
                         renderIcon={StarIcon}
                         onPress={()=>{
-                            
+
                         }}
                     /> */}
-                </ApplicationProvider>
-            </>
-        );
-    }
+        </ApplicationProvider>
+      </>
+    );
 }
 
-const StarIcon = props => (
-    <Icon
-        {...props}
-        style={{ width: 30, height: 30 }}
-        fill='#fff'
-        name='refresh'
-    />
-);
-
-const container = {
-    flex: 1,
-    backgroundColor: "#fff",
-};
+

+ 4 - 3
Utils/ListUtil.js

@@ -1,3 +1,4 @@
+/* eslint-disable no-underscore-dangle */
 export default class ListUtil {
     constructor(list) {
         if (list && list.constructor === String) {
@@ -12,11 +13,11 @@ export default class ListUtil {
     }
 
     getKey(key) {
-        let _list = [...this.list];
+        const _list = [...this.list];
         if (_list.length > 0) {
             return _list.pop()[key];
-        } else {
+        } 
             return "";
-        }
+        
     }
 }

+ 12 - 8
Utils/OpenTimeUtil.js

@@ -1,4 +1,6 @@
+/* eslint-disable no-underscore-dangle */
 import moment from "moment";
+
 export default class OpenTimeUtil {
     constructor(startTime, endTime, week, weekWords) {
         this.startTime = startTime || "08:00:00";
@@ -17,32 +19,34 @@ export default class OpenTimeUtil {
 
     getWeekStr() {
         let _weeks = this.week.split(",");
-        if (_weeks.length == 7) {
+        if (_weeks.length === 7) {
             return this.weekWords.all;
-        } else {
+        } 
             _weeks = _weeks.map(item => {
                 return this.weekWords[item];
             });
             return _weeks.join(",");
-        }
+        
     }
 
     getShowStr() {
         return (
-            this.getStartTimeStr() +
-            "~" +
-            this.getEndTimeStr() +
-            " " +
-            this.getWeekStr()
+            `${this.getStartTimeStr() 
+            }~${ 
+            this.getEndTimeStr() 
+            } ${ 
+            this.getWeekStr()}`
         );
     }
 
     setStartTime(startTime) {
         this.startTime = moment(startTime, "HH:mm").format("HH:mm:ss");
     }
+
     setEndTime(endTime) {
         this.endTime = moment(endTime, "HH:mm").format("HH:mm:ss");
     }
+
     setWeek(week) {
         this.week = week || [];
     }

+ 15 - 13
Utils/SystemRuleUtil.js

@@ -1,29 +1,31 @@
-//系统检查方法
+// 系统检查方法
 
-//商品分类
+// 商品分类
 
-const systemMenus = [1, 2, 3]; //好评,折扣,点单必读
+const systemMenus = [1, 2, 3]; // 好评,折扣,点单必读
 const menuTips = {
     1: ["systemClassification1", "systemClassification2"],
     2: ["systemClassification3", "systemClassification4"],
     3: ["systemClassification5", "systemClassification6"],
 };
 
-//好评,折扣,点单必读
+// 好评,折扣,点单必读
 export function getClassificationByName(name) {
-    if (name == "好评") {
+    if (name === "好评") {
         return 1;
-    } else if (name == "折扣") {
+    } if (name === "折扣") {
         return 2;
-    } else if (name == "点单必读") {
+    } if (name === "点单必读") {
         return 3;
-    }
+	}
+		return 0
+	
 }
 
-//商品分类
+// 商品分类
 export class ClassificationUtil {
     constructor(classification) {
-        let { name, id, goodsIds, isOpen, type } = classification || {};
+        const { name, id, goodsIds, isOpen, type } = classification || {};
         this.name = name || "";
         this.id = id || "";
         this.goodsIds = goodsIds || "";
@@ -33,7 +35,7 @@ export class ClassificationUtil {
     }
 
     checkSystem() {
-        return systemMenus.indexOf(this.type) != -1;
+        return systemMenus.indexOf(this.type) !== -1;
     }
 
     getMenuTipsList() {
@@ -45,8 +47,8 @@ export class ClassificationUtil {
     }
 }
 
-//账单类别
-const FinancialTypes = ["BUY", "INCOME", "REFUND", "WITHDRAW"];
+// 账单类别
+// const FinancialTypes = ["BUY", "INCOME", "REFUND", "WITHDRAW"];
 // BUY("购买"),
 // INCOME("收入"),
 // REFUND("退款"),

+ 43 - 64
components/Actionsheet.js

@@ -1,74 +1,11 @@
 import React from "react";
-import { StyleSheet, View, Text } from "react-native";
+import { StyleSheet, View, Text  } from "react-native";
 import {
-    Menu,
-    MenuItem,
-    Layout,
     SelectItem,
     Icon,
 } from "@ui-kitten/components";
-import { useModel } from "flooks";
-import { Dimensions } from "react-native";
 import { Actionsheet } from "beeshell";
 
-const selects = (list, selectAction) => {
-    return list.map((item) => {
-        return <MenuItem title={item} key={item} />;
-    });
-};
-const ForwardIcon = (props) => <Icon {...props} name='arrow-ios-forward' />;
-export default function myActionsheet({ list, onChange, value }) {
-    const { cancel } = useModel("wordsModel");
-
-    const datas = React.useMemo(() => {
-        if (list && list.length > 0) {
-            return list.map((item) => {
-                return { label: item, value: item };
-            });
-        } else {
-            return [];
-        }
-    }, [list]);
-
-    const [bottomModalX, changeBottomModalx] = React.useState("");
-    return (
-        <>
-            <SelectItem
-                appearance='form'
-                style={{ flex: 1 }}
-                accessoryRight={ForwardIcon}
-                title={value || " "}
-                onPress={() => {
-                    bottomModalX.open();
-                }}
-            />
-            <Actionsheet
-                ref={(c) => {
-                    changeBottomModalx(c);
-                }}
-                header={<View />}
-                data={list}
-                cancelable={true}
-                maxShowNum={4}
-                useSafeAreaView={true}
-                onPressConfirm={(item) => {
-                    onChange(item);
-                }}
-                onPressCancel={() => {
-                    console.log("cancel");
-                }}
-                renderItem={(item, index) => {
-                    return (
-                        <View style={styles.item}>
-                            <Text style={styles.text}>{item}</Text>
-                        </View>
-                    );
-                }}
-            ></Actionsheet>
-        </>
-    );
-}
-
 const styles = StyleSheet.create({
     backdrop: {
         backgroundColor: "rgba(0, 0, 0, 0.5)",
@@ -97,3 +34,45 @@ const styles = StyleSheet.create({
         borderColor: "rgb(228, 233, 242)",
     },
 });
+
+
+const ForwardIcon = (props) => <Icon {...props} name='arrow-ios-forward' />;
+export default function myActionsheet({ list, onChange, value }) {
+    const [bottomModalX, changeBottomModalx] = React.useState("");
+    return (
+      <>
+        <SelectItem
+          appearance='form'
+          style={{ flex: 1 }}
+          accessoryRight={ForwardIcon}
+          title={value || " "}
+          onPress={() => {
+                    bottomModalX.open();
+                }}
+        />
+        <Actionsheet
+          ref={(c) => {
+                    changeBottomModalx(c);
+                }}
+          header={<View />}
+          data={list}
+          cancelable
+          maxShowNum={4}
+          useSafeAreaView
+          onPressConfirm={(item) => {
+                    onChange(item);
+                }}
+          onPressCancel={() => {
+                }}
+          renderItem={(item) => {
+                    return (
+                      <View style={styles.item}>
+                        <Text style={styles.text}>{item}</Text>
+                      </View>
+                    );
+                }}
+        />
+      </>
+    );
+}
+

+ 28 - 26
components/Badge.js

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

+ 36 - 46
components/BankCard.js

@@ -1,60 +1,14 @@
 import React from "react";
 import { StyleSheet } from "react-native";
 import {
-    Modal,
     Card,
     Text,
-    Button,
     Layout,
     Avatar,
     Icon,
     Radio,
 } from "@ui-kitten/components";
-import { useModel } from "flooks";
 
-export default function BankCard(props) {
-    const { getWordsStr } = useModel("wordsModel");
-    const { info, disabled, pressEvent, type, selectId } = props;
-    const { id, avatar, bankName, cardNo } = info || {};
-    const checked = React.useMemo(() => {
-        return selectId === id;
-    }, [selectId]);
-    return (
-        <Card appearance='walletCard' disabled={disabled} onPress={pressEvent}>
-            <Layout style={styles.main}>
-                <Avatar
-                    style={styles.avatar}
-                    source={{
-                        uri: avatar,
-                    }}
-                />
-                <Layout style={styles.center}>
-                    <Text category='s1'>{bankName}</Text>
-                    <Text category='h1' style={styles.text2}>
-                        {cardNo}
-                    </Text>
-                </Layout>
-                {type == "choose" && <Radio checked={checked} />}
-                {type == "edit" && !disabled && (
-                    <Icon
-                        name='arrow-ios-forward'
-                        fill='#C9C9C9'
-                        style={styles.icon}
-                    />
-                )}
-            </Layout>
-        </Card>
-    );
-}
-
-const ForwardIcon = props => (
-    <Icon
-        {...props}
-        name='arrow-ios-forward'
-        fill='#B4B4B4'
-        style={{ width: 15, height: 15, fontWeight: 500 }}
-    />
-);
 
 const styles = StyleSheet.create({
     main: {
@@ -86,3 +40,39 @@ const styles = StyleSheet.create({
         marginTop: -10,
     },
 });
+
+export default function BankCard(props) {
+    const { info, disabled, pressEvent, type, selectId } = props;
+    const { id, avatar, bankName, cardNo } = info || {};
+    const checked = React.useMemo(() => {
+        return selectId === id;
+    }, [selectId]);
+    return (
+      <Card appearance='walletCard' disabled={disabled} onPress={pressEvent}>
+        <Layout style={styles.main}>
+          <Avatar
+            style={styles.avatar}
+            source={{
+                        uri: avatar,
+                    }}
+          />
+          <Layout style={styles.center}>
+            <Text category='s1'>{bankName}</Text>
+            <Text category='h1' style={styles.text2}>
+              {cardNo}
+            </Text>
+          </Layout>
+          {type === "choose" && <Radio checked={checked} />}
+          {type === "edit" && !disabled && (
+            <Icon
+              name='arrow-ios-forward'
+              fill='#C9C9C9'
+              style={styles.icon}
+            />
+                )}
+        </Layout>
+      </Card>
+    );
+}
+
+

+ 0 - 17
components/Button.js

@@ -1,17 +0,0 @@
-import React from 'react';
-import PropTypes from 'prop-types';
-import { TouchableNativeFeedback } from 'react-native';
-
-export default function Button({ onPress, children }) {
-  return <TouchableNativeFeedback onPress={onPress}>{children}</TouchableNativeFeedback>;
-}
-
-Button.defaultProps = {
-  children: null,
-  onPress: () => {},
-};
-
-Button.propTypes = {
-  children: PropTypes.node,
-  onPress: PropTypes.func,
-};

+ 135 - 131
components/Comment.js

@@ -1,153 +1,157 @@
 import React from "react";
 import { StyleSheet } from "react-native";
+import { useModel } from "flooks";
 import {
-    Modal,
     Card,
     Text,
     Button,
     Layout,
     Avatar,
-    Icon,
 } from "@ui-kitten/components";
-import Badge from "../components/Badge";
-import { useModel } from "flooks";
-export default function CommentCard(props) {
+import Badge from "./Badge";
+
+  const styles = StyleSheet.create({
+	  user: {
+		  flexDirection: "row",
+		  borderBottomWidth: 1,
+		  borderColor: "#EEEEEE",
+		  paddingVertical: 10,
+	  },
+	  userIcon: {
+		  width: 33,
+		  height: 33,
+		  marginRight: 3,
+	  },
+	  avatar: {
+		  width: 80,
+		  height: 80,
+		  marginRight: 10,
+	  },
+	  commentImg: {
+		  width: 167,
+		  height: 167,
+		  marginTop: 10,
+		  borderRadius: 0,
+	  },
+	  layout: {
+		  flexDirection: "row",
+	  },
+	  main: {
+		  flex: 1,
+	  },
+	  flex1: {
+		  flex: 1,
+	  },
+	  butContent: {
+		  marginLeft: 6,
+	  },
+	  fontColor: {
+		  color: "#B5B5B5",
+	  },
+	  miniButton: {
+		  minWidth: 18,
+		  minHeight: 18,
+		  width: 18,
+		  height: 18,
+		  position: "absolute",
+		  right: 10,
+		  bottom: 5,
+	  },
+	  button: {
+		  alignSelf: "flex-start",
+		  marginTop: 5,
+		  marginBottom: 0,
+	  },
+	  badgeList: {
+		  flexDirection: "row",
+	  },
+	  badge: {
+		  marginRight: 5,
+		  marginTop: 4,
+	  },
+	  backInfo: {
+		  backgroundColor: "rgba(248,236,214,1)",
+		  padding: 7,
+		  marginTop: 10,
+	  },
+	  backColor: {
+		  color: "#6BCDFF",
+	  },
+  });
+  
+const img1=require("../assets/images/zan.png")
+
+  const StarIcon = (props) => (
+    <Avatar source={img1} {...props} />
+  );
+  
+
+export default function CommentCard() {
     const { storeBackInfo } = useModel("wordsModel");
     return (
-        <Card appearance='CommentCard' disabled={true}>
-            <Layout style={styles.user}>
-                <Avatar
-                    style={styles.userIcon}
-                    shape='rounded'
-                    source={{
+      <Card appearance='CommentCard' disabled>
+        <Layout style={styles.user}>
+          <Avatar
+            style={styles.userIcon}
+            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}>
-                    <Layout style={styles.layout}>
-                        <Text
-                            category='s1'
-                            ellipsizeMode='tail'
-                            numberOfLines={1}
-                            style={styles.flex1}
-                        >
-                            用户名
-                        </Text>
-                        <Text category='h1' status='info'>
-                            2019-11-27
-                        </Text>
-                    </Layout>
+          <Layout style={styles.main}>
+            <Layout style={styles.layout}>
+              <Text
+                category='s1'
+                ellipsizeMode='tail'
+                numberOfLines={1}
+                style={styles.flex1}
+              >
+                用户名
+              </Text>
+              <Text category='h1' status='info'>
+                2019-11-27
+              </Text>
+            </Layout>
 
-                    <Button
-                        appearance='ghost'
-                        accessoryLeft={StarIcon}
-                        style={styles.button}
-                    >
-                        9999+
-                    </Button>
+            <Button
+              appearance='ghost'
+              accessoryLeft={StarIcon}
+              style={styles.button}
+            >
+              9999+
+            </Button>
 
-                    <Text category='h1'>
-                        金额后认为害人害己而和我入口即化吾儿可教很温和人和网入口即,
-                        化我耳机sdfsdfsd考试的分开理就是老款的加菲,是大富科技谁看
-                        得见后方可了三等奖
-                    </Text>
+            <Text category='h1'>
+              金额后认为害人害己而和我入口即化吾儿可教很温和人和网入口即,
+              化我耳机sdfsdfsd考试的分开理就是老款的加菲,是大富科技谁看
+              得见后方可了三等奖
+            </Text>
 
-                    <Layout style={styles.badgeList}>
-                        <Badge
-                            style={styles.badge}
-                            appearance='ghost'
-                            status='primary'
-                        >
-                            麦辣鸡堡
-                        </Badge>
-                    </Layout>
+            <Layout style={styles.badgeList}>
+              <Badge
+                style={styles.badge}
+                appearance='ghost'
+                status='primary'
+              >
+                麦辣鸡堡
+              </Badge>
+            </Layout>
 
-                    <Layout style={styles.backInfo}>
-                        <Text category='h1'>
-                            {storeBackInfo}:
-                            <Text category='h1' style={styles.backColor}>
-                                水电费记录删掉科技风科雷嘉是的溜缝胶SDK垃圾分
-                                类圣诞节疯狂老司机的风口浪尖当时考虑放假了圣诞节放克鲁赛
-                                德荆防颗粒的就是风口浪尖类似的减肥了可视v
-                            </Text>
-                        </Text>
-                    </Layout>
-                </Layout>
+            <Layout style={styles.backInfo}>
+              <Text category='h1'>
+                {storeBackInfo}
+                :
+                <Text category='h1' style={styles.backColor}>
+                  水电费记录删掉科技风科雷嘉是的溜缝胶SDK垃圾分
+                  类圣诞节疯狂老司机的风口浪尖当时考虑放假了圣诞节放克鲁赛
+                  德荆防颗粒的就是风口浪尖类似的减肥了可视v
+                </Text>
+              </Text>
             </Layout>
-        </Card>
+          </Layout>
+        </Layout>
+      </Card>
     );
 }
-const StarIcon = (props) => (
-    <Avatar source={require("../assets/images/zan.png")} {...props} />
-);
-
-const styles = StyleSheet.create({
-    user: {
-        flexDirection: "row",
-        borderBottomWidth: 1,
-        borderColor: "#EEEEEE",
-        paddingVertical: 10,
-    },
-    userIcon: {
-        width: 33,
-        height: 33,
-        marginRight: 3,
-    },
-    avatar: {
-        width: 80,
-        height: 80,
-        marginRight: 10,
-    },
-    commentImg: {
-        width: 167,
-        height: 167,
-        marginTop: 10,
-        borderRadius: 0,
-    },
-    layout: {
-        flexDirection: "row",
-    },
-    main: {
-        flex: 1,
-    },
-    flex1: {
-        flex: 1,
-    },
-    butContent: {
-        marginLeft: 6,
-    },
-    fontColor: {
-        color: "#B5B5B5",
-    },
-    miniButton: {
-        minWidth: 18,
-        minHeight: 18,
-        width: 18,
-        height: 18,
-        position: "absolute",
-        right: 10,
-        bottom: 5,
-    },
-    button: {
-        alignSelf: "flex-start",
-        marginTop: 5,
-        marginBottom: 0,
-    },
-    badgeList: {
-        flexDirection: "row",
-    },
-    badge: {
-        marginRight: 5,
-        marginTop: 4,
-    },
-    backInfo: {
-        backgroundColor: "rgba(248,236,214,1)",
-        padding: 7,
-        marginTop: 10,
-    },
-    backColor: {
-        color: "#6BCDFF",
-    },
-});

+ 27 - 40
components/Datepicker.js

@@ -1,25 +1,12 @@
 import React from "react";
-import PropTypes from "prop-types";
 import {
-    StyleSheet,
-    LayoutAnimation,
-    Platform,
-    UIManager,
     View,
 } from "react-native";
 import {
-    CheckBox,
-    Layout,
-    Modal,
-    Button,
-    Card,
-    Text,
-    MenuItem,
     Icon,
     SelectItem,
 } from "@ui-kitten/components";
 import { Datepicker, BottomModal } from "beeshell";
-import moment from "moment";
 import * as TimeUtil from "../Utils/TimeUtil";
 
 const ForwardIcon = props => <Icon {...props} name='arrow-ios-forward' />;
@@ -32,42 +19,42 @@ export default function MyDatepicker(props) {
     const [bottomModal, setBottomModal] = React.useState();
 
     return (
-        <>
-            <SelectItem
-                appearance='form'
-                style={{ flex: 1, height: 32 }}
-                accessoryRight={ForwardIcon}
-                title={value || " "}
-                onPress={() => {
+      <>
+        <SelectItem
+          appearance='form'
+          style={{ flex: 1, height: 32 }}
+          accessoryRight={ForwardIcon}
+          title={value || " "}
+          onPress={() => {
                     bottomModal.open();
                 }}
-            />
-            <BottomModal
-                title=''
-                cancelable={true}
-                ref={c => setBottomModal(c)}
-                rightCallback={() => {
+        />
+        <BottomModal
+          title=''
+          cancelable
+          ref={c => setBottomModal(c)}
+          rightCallback={() => {
                     chooseDate(dateValue);
                 }}
-            >
-                <View
-                    style={{
+        >
+          <View
+            style={{
                         height: 200,
                         marginBottom: 50,
                         minHeight: 200,
                     }}
-                >
-                    <Datepicker
-                        proportion={[1, 1, 1]}
-                        startYear={TimeUtil.getNowYear()}
-                        numberOfYears={10}
-                        date={TimeUtil.getDateStr()}
-                        onChange={date => {
+          >
+            <Datepicker
+              proportion={[1, 1, 1]}
+              startYear={TimeUtil.getNowYear()}
+              numberOfYears={10}
+              date={TimeUtil.getDateStr()}
+              onChange={date => {
                             chooseValue(date);
                         }}
-                    />
-                </View>
-            </BottomModal>
-        </>
+            />
+          </View>
+        </BottomModal>
+      </>
     );
 }

+ 100 - 107
components/Dialog.js

@@ -1,3 +1,6 @@
+/* eslint-disable no-shadow */
+/* eslint-disable react/destructuring-assignment */
+/* eslint-disable react/jsx-props-no-spreading */
 import React from "react";
 import { StyleSheet } from "react-native";
 import {
@@ -9,15 +12,50 @@ import {
     Input,
 } from "@ui-kitten/components";
 import { useModel, setModel } from "flooks";
-import dialogModel from "../models/dialogModel";
 import Textarea from "react-native-textarea";
+import dialogModel from "../models/dialogModel";
 
 setModel("dialogModel", dialogModel);
 
+
+const styles = StyleSheet.create({
+    backdrop: {
+        backgroundColor: "rgba(0, 0, 0, 0.5)",
+    },
+    card: {
+        alignItems: "center",
+        minWidth: 263,
+    },
+    footerContainer: {
+        flexDirection: "row",
+    },
+    footerControl: {
+        minWidth: 112,
+        marginHorizontal: 10,
+    },
+    textareaContainer: {
+        backgroundColor: "#F0F0F0",
+        height: 100,
+        alignSelf: "stretch",
+        width: 250,
+        borderRadius: 4,
+    },
+    textarea: {
+        textAlignVertical: "top", // hack android
+        fontSize: 13,
+        color: "#333",
+        paddingHorizontal: 14,
+        paddingVertical: 10,
+        height: 100,
+    },
+});
+
+
+
 const Header = (props, title) => (
-    <Text {...props} category='s1'>
-        {title}
-    </Text>
+  <Text {...props} category='s1'>
+    {title}
+  </Text>
 );
 
 const Footer = (
@@ -28,26 +66,26 @@ const Footer = (
     confirmCallback,
     cancelCallback
 ) => (
-    <Layout {...props} style={[props.style, styles.footerContainer]}>
-        {cancelable && (
-            <Button
-                style={styles.footerControl}
-                status='basic'
-                size='small'
-                appearance='outline'
-                onPress={cancelCallback}
-            >
-                {cancelLabelText}
-            </Button>
+  <Layout {...props} style={[props.style, styles.footerContainer]}>
+    {cancelable && (
+    <Button
+      style={styles.footerControl}
+      status='basic'
+      size='small'
+      appearance='outline'
+      onPress={cancelCallback}
+    >
+      {cancelLabelText}
+    </Button>
         )}
-        <Button
-            style={styles.footerControl}
-            size='small'
-            onPress={confirmCallback}
-        >
-            {confirmLabelText}
-        </Button>
-    </Layout>
+    <Button
+      style={styles.footerControl}
+      size='small'
+      onPress={confirmCallback}
+    >
+      {confirmLabelText}
+    </Button>
+  </Layout>
 );
 
 export default function Dialog(props) {
@@ -70,19 +108,6 @@ export default function Dialog(props) {
     } = useModel("dialogModel");
     const showAllInfo = React.useMemo(() => {
         if (diloadShow) {
-            console.log({
-                title,
-                cancelLabelText,
-                confirmLabelText,
-                cancelable,
-                confirmCallback,
-                cancelCallback,
-                bodyText,
-                isEdit,
-                status,
-                ...textAreaInfo,
-                ...showInfo,
-            });
             return {
                 title,
                 cancelLabelText,
@@ -96,21 +121,21 @@ export default function Dialog(props) {
                 ...textAreaInfo,
                 ...showInfo,
             };
-        } else {
+        } 
             return {};
-        }
+        
     }, [showInfo, diloadShow]);
 
     const [introduction, changeIntroduction] = React.useState();
     return (
-        <Modal visible={diloadShow} backdropStyle={styles.backdrop}>
-            <Card
-                style={styles.card}
-                appearance='diaogOutline'
-                header={props => {
+      <Modal visible={diloadShow} backdropStyle={styles.backdrop}>
+        <Card
+          style={styles.card}
+          appearance='diaogOutline'
+          header={props => {
                     return Header(props, showAllInfo.title || tip);
                 }}
-                footer={props => {
+          footer={props => {
                     return Footer(
                         props,
                         showAllInfo.cancelLabelText || cancel,
@@ -134,79 +159,47 @@ export default function Dialog(props) {
                         }
                     );
                 }}
-            >
-                {showAllInfo.isEdit ? (
+        >
+          {showAllInfo.isEdit ? (
                     showAllInfo.InputType ? (
-                        <Input
-                            dataDetectorTypes={
-                                showAllInfo.InputType == "phone"
+                      <Input
+                        dataDetectorTypes={
+                                showAllInfo.InputType === "phone"
                                     ? "phoneNumber"
                                     : "default"
                             }
-                            keyboardType={
-                                showAllInfo.InputType == "phone"
+                        keyboardType={
+                                showAllInfo.InputType === "phone"
                                     ? "phone-pad"
                                     : "default"
                             }
-                            onChangeText={changeIntroduction}
-                            defaultValue={showAllInfo.defaultValue}
-                            maxLength={showAllInfo.maxLength}
-                            placeholder={showAllInfo.pla}
-                        />
+                        onChangeText={changeIntroduction}
+                        defaultValue={showAllInfo.defaultValue}
+                        maxLength={showAllInfo.maxLength}
+                        placeholder={showAllInfo.pla}
+                      />
                     ) : (
-                        <Textarea
-                            containerStyle={styles.textareaContainer}
-                            style={styles.textarea}
-                            onChangeText={changeIntroduction}
-                            defaultValue={showAllInfo.defaultValue}
-                            maxLength={showAllInfo.maxLength}
-                            placeholder={showAllInfo.pla}
-                            placeholderTextColor={"#B4B4B4"}
-                            underlineColorAndroid={"transparent"}
-                        />
+                      <Textarea
+                        containerStyle={styles.textareaContainer}
+                        style={styles.textarea}
+                        onChangeText={changeIntroduction}
+                        defaultValue={showAllInfo.defaultValue}
+                        maxLength={showAllInfo.maxLength}
+                        placeholder={showAllInfo.pla}
+                        placeholderTextColor="#B4B4B4"
+                        underlineColorAndroid="transparent"
+                      />
                     )
                 ) : (
-                    <Text
-                        {...props}
-                        category='p1'
-                        status={showAllInfo.status || ""}
-                    >
-                        {showAllInfo.bodyText || "确认删除吗"}
-                    </Text>
+                  <Text
+                    {...props}
+                    category='p1'
+                    status={showAllInfo.status || ""}
+                  >
+                    {showAllInfo.bodyText || "确认删除吗"}
+                  </Text>
                 )}
-            </Card>
-        </Modal>
+        </Card>
+      </Modal>
     );
 }
-
-const styles = StyleSheet.create({
-    backdrop: {
-        backgroundColor: "rgba(0, 0, 0, 0.5)",
-    },
-    card: {
-        alignItems: "center",
-        minWidth: 263,
-    },
-    footerContainer: {
-        flexDirection: "row",
-    },
-    footerControl: {
-        minWidth: 112,
-        marginHorizontal: 10,
-    },
-    textareaContainer: {
-        backgroundColor: "#F0F0F0",
-        height: 100,
-        alignSelf: "stretch",
-        width: 250,
-        borderRadius: 4,
-    },
-    textarea: {
-        textAlignVertical: "top", // hack android
-        fontSize: 13,
-        color: "#333",
-        paddingHorizontal: 14,
-        paddingVertical: 10,
-        height: 100,
-    },
-});

+ 39 - 40
components/Email.js

@@ -1,53 +1,13 @@
 import React from "react";
 import { StyleSheet } from "react-native";
 import {
-    Modal,
     Card,
     Text,
     Button,
     Layout,
     Avatar,
-    Icon,
 } from "@ui-kitten/components";
-import { useModel } from "flooks";
 
-export default function Email(props) {
-    const { getWordsStr } = useModel("wordsModel");
-    const { info, pressEvent } = props;
-    const { id, avatar, name, sendTime, type, content } = info || {};
-    return (
-        <Card appearance='walletCard' onPress={pressEvent}>
-            <Layout style={styles.main}>
-                <Button size='tiny' style={styles.btn} status='primary' />
-                {/* <Button size='tiny' style={styles.btn} status='info' /> */}
-                <Avatar
-                    style={styles.avatar}
-                    shape='rounded'
-                    source={{
-                        uri: avatar,
-                    }}
-                />
-                <Layout style={styles.center}>
-                    <Layout style={styles.top}>
-                        <Text category='c1'>{name || "系统提醒"}</Text>
-                        <Text category='h1' style={styles.time}>
-                            {sendTime || "12月26日"}
-                        </Text>
-                    </Layout>
-                    <Text
-                        category='h1'
-                        status='info'
-                        numberOfLines={1}
-                        ellipsizeMode='tail'
-                    >
-                        {content ||
-                            "您的订单已经被取消收款方老司机的发链接SDK溜老司机的您的订单已经被取消收款方老司机的发链接SDK溜老司机的"}
-                    </Text>
-                </Layout>
-            </Layout>
-        </Card>
-    );
-}
 const styles = StyleSheet.create({
     main: {
         flexDirection: "row",
@@ -82,3 +42,42 @@ const styles = StyleSheet.create({
         paddingHorizontal: 0,
     },
 });
+
+
+export default function Email(props) {
+    // const {  } = useModel("wordsModel");
+    const { info, pressEvent } = props;
+    const { avatar, name, sendTime,  content } = info || {};
+    return (
+      <Card appearance='walletCard' onPress={pressEvent}>
+        <Layout style={styles.main}>
+          <Button size='tiny' style={styles.btn} status='primary' />
+          {/* <Button size='tiny' style={styles.btn} status='info' /> */}
+          <Avatar
+            style={styles.avatar}
+            shape='rounded'
+            source={{
+                        uri: avatar,
+                    }}
+          />
+          <Layout style={styles.center}>
+            <Layout style={styles.top}>
+              <Text category='c1'>{name || "系统提醒"}</Text>
+              <Text category='h1' style={styles.time}>
+                {sendTime || "12月26日"}
+              </Text>
+            </Layout>
+            <Text
+              category='h1'
+              status='info'
+              numberOfLines={1}
+              ellipsizeMode='tail'
+            >
+              {content ||
+                            "您的订单已经被取消收款方老司机的发链接SDK溜老司机的您的订单已经被取消收款方老司机的发链接SDK溜老司机的"}
+            </Text>
+          </Layout>
+        </Layout>
+      </Card>
+    );
+}

+ 9 - 9
components/EmptyComponent.js

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

+ 189 - 202
components/FormInput.js

@@ -1,3 +1,7 @@
+/* eslint-disable react/jsx-props-no-spreading */
+/* eslint-disable no-shadow */
+/* eslint-disable no-underscore-dangle */
+/* eslint-disable no-restricted-syntax */
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import { View, StyleSheet, TouchableWithoutFeedback } from "react-native";
@@ -5,25 +9,75 @@ import {
     Layout,
     Input,
     Button,
-    useTheme,
     Icon,
     Text,
     SelectItem,
 } from "@ui-kitten/components";
 import { Cascader, BottomModal } from "beeshell";
-import variables from "../constants/customTheme";
 import { useModel } from "flooks";
+import moment from "moment";
 import OpenTime from "./OpenTime";
 import Datepicker from "./Datepicker";
 import UpLoadImage from "./UpLoadImage";
-import moment from "moment";
 import Actionsheet from "./Actionsheet";
 
-const AlertIcon = props => <Icon {...props} name='alert-circle-outline' />;
+
+const styles = StyleSheet.create({
+    inputContainer: {
+        flexDirection: "row",
+        alignItems: "center",
+        paddingVertical: 10,
+        paddingHorizontal: 4,
+    },
+    input: {
+        flex: 1,
+    },
+    label: {
+        width: 80,
+        marginRight: 19,
+        flexShrink: 0,
+    },
+    labelleft: {
+        width: 73,
+        flexShrink: 0,
+    },
+    right: {
+        flexDirection: "row",
+    },
+    code: {
+        paddingHorizontal: 5,
+        marginLeft: 5,
+    },
+    selectContent: {
+        backgroundColor: "#F0F0F0",
+    },
+    titleStyle: {
+        fontSize: 15,
+    },
+    leftLabelTextStyle: {
+        fontSize: 13,
+    },
+    rightLabelTextStyle: {
+        fontSize: 13,
+    },
+    sub: {
+        color: "#787878",
+        position: "absolute",
+        left: 90,
+        zIndex: 2,
+    },
+    upload: {
+        marginTop: 20,
+        width: 67,
+        height: 67,
+    },
+});
+
+
 
 function* flattenSelect(array, key) {
     for (const item of array) {
-        let _array = key ? item[key] : item;
+        const _array = key ? item[key] : item;
         if (Array.isArray(_array) && _array.length > 0) {
             yield* flattenSelect(_array, key);
         } else {
@@ -33,43 +87,44 @@ function* flattenSelect(array, key) {
 }
 
 const FormInput = React.memo(props => {
-    const { appearance } = props;
+    const { appearance,type } = props;
     const [secureTextEntry, setSecureTextEntry] = React.useState(true);
     const { cancel, confirm } = useModel("wordsModel");
     const toggleSecureEntry = () => {
         setSecureTextEntry(!secureTextEntry);
     };
 
+    // eslint-disable-next-line no-shadow
     const renderIcon = props => (
-        <TouchableWithoutFeedback onPress={toggleSecureEntry}>
-            <Icon {...props} name={secureTextEntry ? "eye-off" : "eye"} />
-        </TouchableWithoutFeedback>
+      <TouchableWithoutFeedback onPress={toggleSecureEntry}>
+        <Icon {...props} name={secureTextEntry ? "eye-off" : "eye"} />
+      </TouchableWithoutFeedback>
     );
     function getInputProps(props) {
         let _props = {
             value: props.value || "",
             placeholder: props.placeholder,
         };
-        if (props.type === "phone") {
+        if (type === "phone") {
             _props = {
                 ..._props,
                 dataDetectorTypes: "phoneNumber",
                 maxLength: 11,
                 keyboardType: "phone-pad",
             };
-        } else if (props.type === "password") {
+        } else if (type === "password") {
             _props = {
                 ..._props,
                 accessoryRight: ImageProps => renderIcon(ImageProps),
-                secureTextEntry: secureTextEntry,
+                secureTextEntry,
             };
-        } else if (props.type == "code") {
+        } else if (type === "code") {
             _props = {
                 ..._props,
                 maxLength: 6,
                 keyboardType: "numeric",
             };
-        } else if (props.type == "amount" || props.type == "money") {
+        } else if (type === "amount" || props.type === "money") {
             _props = {
                 ..._props,
                 keyboardType: "numeric",
@@ -93,24 +148,24 @@ const FormInput = React.memo(props => {
     //     }
     // };
 
-    const Label = props => {
+    const Label = ({type,labelStyle,label}) => {
         return (
-            <View
-                style={[
+          <View
+            style={[
                     appearance === "inner" ? styles.labelleft : styles.label,
-                    props.type === "img" ? { alignSelf: "flex-start" } : {},
-                    props.labelStyle || {},
+                    type === "img" ? { alignSelf: "flex-start" } : {},
+                    labelStyle || {},
                 ]}
-            >
-                <Text
-                    category='c1'
-                    style={{
-                        textAlign: appearance != "inner" ? "right" : "left",
+          >
+            <Text
+              category='c1'
+              style={{
+                        textAlign: appearance !== "inner" ? "right" : "left",
                     }}
-                >
-                    {props.label}
-                </Text>
-            </View>
+            >
+              {label}
+            </Text>
+          </View>
         );
     };
     const ForwardIcon = props => <Icon {...props} name='arrow-ios-forward' />;
@@ -121,255 +176,187 @@ const FormInput = React.memo(props => {
     const [selectVal, setSelectVal] = React.useState("");
 
     const selectInfo = React.useMemo(() => {
-        if (props.type === "select" && props.value && selectList.length > 0) {
+        if (type === "select" && props.value && selectList.length > 0) {
             const childrens = [...flattenSelect(selectList, "children")];
             return (
                 childrens.find(item => {
-                    return item.id == props.value;
+                    return item.id === props.value;
                 }) || { name: " " }
             );
-        } else {
+        } 
             return { name: " " };
-        }
+        
     }, [props.value, props.type, selectList]);
 
     const [open, ChangeOpen] = React.useState(false);
 
-    function submitEvent(val) {
-        console.log(val);
-    }
-
+  
     const Btn = ({ btnText }) => (
-        <Button
-            appearance='ghost'
-            size='tiny'
-            style={{ paddingVertical: 8, marginLeft: 5 }}
-        >
-            {btnText}
-        </Button>
+      <Button
+        appearance='ghost'
+        size='tiny'
+        style={{ paddingVertical: 8, marginLeft: 5 }}
+      >
+        {btnText}
+      </Button>
     );
 
-    const theme = useTheme();
 
     function getMain(type, props) {
-        if (type == "select") {
+        if (type === "select") {
             return (
-                <>
-                    <SelectItem
-                        appearance='form'
-                        style={{ flex: 1 }}
-                        accessoryRight={ForwardIcon}
-                        title={selectInfo.name}
-                        onPress={() => {
+              <>
+                <SelectItem
+                  appearance='form'
+                  style={{ flex: 1 }}
+                  accessoryRight={ForwardIcon}
+                  title={selectInfo.name}
+                  onPress={() => {
                             bottomModalX.open();
                         }}
-                    />
-                    <BottomModal
-                        ref={c => {
+                />
+                <BottomModal
+                  ref={c => {
                             changeBottomModalx(c);
                         }}
-                        title={props.selectTitle}
-                        titleStyle={styles.titleStyle}
-                        cancelable={true}
-                        leftLabelText={cancel}
-                        leftLabelTextStyle={styles.leftLabelTextStyle}
-                        rightLabelText={confirm}
-                        rightLabelTextStyle={styles.rightLabelTextStyle}
-                        rightCallback={() => {
+                  title={props.selectTitle}
+                  titleStyle={styles.titleStyle}
+                  cancelable
+                  leftLabelText={cancel}
+                  leftLabelTextStyle={styles.leftLabelTextStyle}
+                  rightLabelText={confirm}
+                  rightLabelTextStyle={styles.rightLabelTextStyle}
+                  rightCallback={() => {
                             props.onChange(selectVal);
                         }}
-                    >
-                        <Cascader
-                            style={{
+                >
+                  <Cascader
+                    style={{
                                 width: "100%",
                                 height: 200,
                                 marginBottom: 50,
                                 minHeight: 200,
                             }}
-                            data={selectList}
-                            fieldKeys={{
+                    data={selectList}
+                    fieldKeys={{
                                 labelKey: "name",
                                 idKey: "id",
                                 activeKey: "choose",
                             }}
-                            onChange={(value, info) => {
+                    onChange={(value) => {
                                 setSelectVal(value[0]);
                             }}
-                        />
-                    </BottomModal>
-                </>
+                  />
+                </BottomModal>
+              </>
             );
-        } else if (type == "openTime") {
+        } if (type === "openTime") {
             return (
-                <OpenTime
-                    open={open}
-                    submit={(start, end, week) => {
+              <OpenTime
+                open={open}
+                submit={(start, end, week) => {
                         ChangeOpen(false);
                         props.onChange(
                             week.join(","),
                             moment(start, "HH:mm").format("HH:mm:ss"),
                             moment(end, "HH:mm").format("HH:mm:ss")
                         );
-                        console.log(
-                            moment(start, "HH:mm").format("HH:mm:ss"),
-                            moment(end, "HH:mm").format("HH:mm:ss"),
-                            week
-                        );
                     }}
-                    cancelEvent={() => {
+                cancelEvent={() => {
                         ChangeOpen(false);
                     }}
-                    openModal={() => {
+                openModal={() => {
                         ChangeOpen(true);
                     }}
-                    defaultValue={props.defaultValue}
-                />
+                defaultValue={props.defaultValue}
+              />
             );
-        } else if (type == "date") {
+        } if (type === "date") {
             return (
-                <Datepicker chooseDate={props.onChange} value={props.value} />
+              <Datepicker chooseDate={props.onChange} value={props.value} />
             );
-        } else if (type == "url") {
+        } if (type === "url") {
             return (
-                <SelectItem
-                    appearance='form'
-                    style={{ flex: 1 }}
-                    accessoryRight={ForwardIcon}
-                    title={props.value || " "}
-                    onPress={props.changePath}
-                />
+              <SelectItem
+                appearance='form'
+                style={{ flex: 1 }}
+                accessoryRight={ForwardIcon}
+                title={props.value || " "}
+                onPress={props.changePath}
+              />
             );
-        } else if (type == "actionSheet") {
+        } if (type === "actionSheet") {
             return (
-                <>
-                    <Actionsheet
-                        list={props.list}
-                        value={props.value}
-                        onChange={props.onChange}
-                    />
-                </>
+              <>
+                <Actionsheet
+                  list={props.list}
+                  value={props.value}
+                  onChange={props.onChange}
+                />
+              </>
             );
-        } else if (type == "img") {
+        } if (type === "img") {
             return (
-                <UpLoadImage
-                    style={styles.upload}
-                    value={props.value}
-                    changeIcon={props.onChange}
-                />
+              <UpLoadImage
+                style={styles.upload}
+                value={props.value}
+                changeIcon={props.onChange}
+              />
             );
-        } else if (appearance == "inner" && props.type == "code") {
+        } if (appearance === "inner" && type === "code") {
             return (
-                <Input
-                    {...inputProps}
-                    accessoryLeft={leftprops => (
-                        <Label {...props} {...leftprops} />
+              <Input
+                {...inputProps}
+                accessoryLeft={leftprops => (
+                  <Label {...props} {...leftprops} />
                     )}
-                    accessoryRight={() => <Btn btnText={props.btnText} />}
-                    size='small'
-                    style={styles.input}
-                    appearance='innerCode'
-                />
+                accessoryRight={() => <Btn btnText={props.btnText} />}
+                size='small'
+                style={styles.input}
+                appearance='innerCode'
+              />
             );
-        } else if (appearance == "inner") {
+        } if (appearance === "inner") {
             return (
-                <Input
-                    {...inputProps}
-                    accessoryLeft={leftprops => (
-                        <Label {...props} {...leftprops} />
+              <Input
+                {...inputProps}
+                accessoryLeft={leftprops => (
+                  <Label {...props} {...leftprops} />
                     )}
-                    size='small'
-                    style={styles.input}
-                    appearance='inner'
-                />
+                size='small'
+                style={styles.input}
+                appearance='inner'
+              />
             );
-        } else {
+        } 
             return <Input {...inputProps} size='small' style={styles.input} />;
-        }
+        
     }
 
     return (
-        <Layout
-            level='1'
-            style={[
+      <Layout
+        level='1'
+        style={[
                 styles.inputContainer,
                 { ...props.style },
                 props.type === "img" ? { flexDirection: "column" } : {},
-                { paddingVertical: appearance == "inner" ? 0 : 10 },
+                { paddingVertical: appearance === "inner" ? 0 : 10 },
             ]}
-        >
-            {appearance !== "inner" && <Label {...props} />}
+      >
+        {appearance !== "inner" && <Label {...props} />}
 
-            {(!props.value || props.value == " ") && (
-                <Text category='c1' style={styles.sub}>
-                    {props.sub}
-                </Text>
+        {(!props.value || props.value === " ") && (
+        <Text category='c1' style={styles.sub}>
+          {props.sub}
+        </Text>
             )}
 
-            {getMain(props.type, props)}
+        {getMain(props.type, props)}
 
-            {appearance !== "inner" && props.type == "code" && Btn(props)}
-        </Layout>
+        {appearance !== "inner" && props.type === "code" && Btn(props)}
+      </Layout>
     );
 });
 
-function ChnageTime(sendNum, isSend, changeSend_Num) {
-    let num = sendNum - 1;
-    console.log(num);
-    changeSend_Num(true, num);
-    setTimeout(() => {
-        ChnageTime(num, isSend, changeSend_Num);
-    }, 1000);
-}
-
-const styles = StyleSheet.create({
-    inputContainer: {
-        flexDirection: "row",
-        alignItems: "center",
-        paddingVertical: 10,
-        paddingHorizontal: 4,
-    },
-    input: {
-        flex: 1,
-    },
-    label: {
-        width: 80,
-        marginRight: 19,
-        flexShrink: 0,
-    },
-    labelleft: {
-        width: 73,
-        flexShrink: 0,
-    },
-    right: {
-        flexDirection: "row",
-    },
-    code: {
-        paddingHorizontal: 5,
-        marginLeft: 5,
-    },
-    selectContent: {
-        backgroundColor: "#F0F0F0",
-    },
-    titleStyle: {
-        fontSize: 15,
-    },
-    leftLabelTextStyle: {
-        fontSize: 13,
-    },
-    rightLabelTextStyle: {
-        fontSize: 13,
-    },
-    sub: {
-        color: "#787878",
-        position: "absolute",
-        left: 90,
-        zIndex: 2,
-    },
-    upload: {
-        marginTop: 20,
-        width: 67,
-        height: 67,
-    },
-});
 
 export default FormInput;

+ 146 - 142
components/GoodsCard.js

@@ -1,18 +1,65 @@
 import React from "react";
 import { StyleSheet } from "react-native";
 import {
-    Modal,
     Card,
     Text,
     Button,
     Layout,
     Avatar,
-    Icon,
 } from "@ui-kitten/components";
 import { useModel } from "flooks";
+
+
+const styles = StyleSheet.create({
+    card: { marginTop: 10 },
+    layout: {
+        flexDirection: "row",
+        height: 80,
+        backgroundColor: "transparent",
+    },
+    avatar: {
+        width: 80,
+        height: 80,
+        marginRight: 10,
+    },
+    main: {
+        flex: 1,
+        backgroundColor: "transparent",
+    },
+    flex1: {
+        flex: 1,
+    },
+    butContent: {
+        marginLeft: 6,
+    },
+    fontColor: {
+        color: "#B5B5B5",
+    },
+    miniButton: {
+        minWidth: 22,
+        minHeight: 22,
+        width: 22,
+        height: 22,
+        position: "absolute",
+        right: 10,
+        bottom: 5,
+        maxWidth: 22,
+    },
+    status: {
+        position: "absolute",
+        left: 0,
+        width: 80,
+        paddingVertical: 4,
+        backgroundColor: "#F0F0F0",
+        bottom: 0,
+        textAlign: "center",
+    },
+});
+
+
 export default function GoodsCard(props) {
     const { add, remove, getWordsStr } = useModel("wordsModel");
-    const { info, changeInfo } = props;
+    const { info, changeInfo,type,removeEvent,addEvent,isAdd,appearance,style,canEdit,onPress } = props;
     const {
         id,
         img,
@@ -32,73 +79,78 @@ export default function GoodsCard(props) {
 
 
     return (
-        <Card
-            style={[!props.appearance && styles.card, props.style]}
-            appearance={props.appearance || "goodsCard"}
-            disabled={!props.canEdit}
-            onPress={props.onPress}
-        >
-            {!!id ? (
-                <Layout style={styles.layout}>
-                    <Avatar
-                        style={styles.avatar}
-                        shape='rounded'
-                        source={{
+      <Card
+        style={[!appearance && styles.card, style]}
+        appearance={appearance || "goodsCard"}
+        disabled={!canEdit}
+        onPress={onPress}
+      >
+        {id ? (
+          <Layout style={styles.layout}>
+            <Avatar
+              style={styles.avatar}
+              shape='rounded'
+              source={{
                             uri: img,
                         }}
-                    ></Avatar>
-                    {status == "PENDING" && (
-                        <Text style={styles.status} category='h1'>
-                            待审核
-                        </Text>
+            />
+            {status === "PENDING" && (
+            <Text style={styles.status} category='h1'>
+              待审核
+            </Text>
                     )}
-                    {status == "DENY" && (
-                        <Text
-                            style={styles.status}
-                            category='h1'
-                            status='danger'
-                        >
-                            审核未通过
-                        </Text>
+            {status === "DENY" && (
+            <Text
+              style={styles.status}
+              category='h1'
+              status='danger'
+            >
+              审核未通过
+            </Text>
                     )}
-                    <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='h1'
-                                status='info'
-                                style={{ textDecorationLine: "line-through" }}
-                            >
-                                ¥{amount}
-                            </Text>
-                        </Text>
-                    </Layout>
-                    {props.appearance && props.type == "goodsList" && (
-                        <Layout style={styles.butContent}>
-                            <Button
-                                status='primary'
-                                size='small'
-                                appearance='outline'
-                                onPress={() => {
+            <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='h1'
+                  status='info'
+                  style={{ textDecorationLine: "line-through" }}
+                >
+                  ¥
+                  {amount}
+                </Text>
+              </Text>
+            </Layout>
+            {appearance && type === "goodsList" && (
+            <Layout style={styles.butContent}>
+              <Button
+                status='primary'
+                size='small'
+                appearance='outline'
+                onPress={() => {
                                     if (!takeOff) {
                                         takeOffInfo(() => {
                                             ChangeTakeOff(info).then(res => {
@@ -111,34 +163,34 @@ export default function GoodsCard(props) {
                                         });
                                     }
                                 }}
-                            >
-                                {getWordsStr(takeOff ? "takeUp" : "takeOff")}
-                            </Button>
-                        </Layout>
+              >
+                {getWordsStr(takeOff ? "takeUp" : "takeOff")}
+              </Button>
+            </Layout>
                     )}
-                    {!props.appearance && !props.isAdd && (
-                        <Layout style={styles.butContent}>
-                            <Button
-                                status='primary'
-                                size='tiny'
-                                onPress={props.addEvent}
-                            >
-                                {add}
-                            </Button>
-                        </Layout>
+            {!appearance && !isAdd && (
+            <Layout style={styles.butContent}>
+              <Button
+                status='primary'
+                size='tiny'
+                onPress={addEvent}
+              >
+                {add}
+              </Button>
+            </Layout>
                     )}
-                    {props.appearance && props.isAdd && (
-                        <Layout style={styles.butContent}>
-                            <Button
-                                status='danger'
-                                onPress={props.removeEvent}
-                                size='tiny'
-                            >
-                                {remove}
-                            </Button>
-                        </Layout>
+            {appearance && isAdd && (
+            <Layout style={styles.butContent}>
+              <Button
+                status='danger'
+                onPress={removeEvent}
+                size='tiny'
+              >
+                {remove}
+              </Button>
+            </Layout>
                     )}
-                    {/* {props.appearance == "classification" &&
+            {/* {props.appearance == "classification" &&
                         props.type != "goodsList" && (
                             <Button
                                 style={styles.miniButton}
@@ -147,58 +199,10 @@ export default function GoodsCard(props) {
                                 accessoryLeft={StarIcon}
                             />
                         )} */}
-                </Layout>
+          </Layout>
             ) : (
-                <Layout style={styles.layout} />
+              <Layout style={styles.layout} />
             )}
-        </Card>
+      </Card>
     );
 }
-const StarIcon = props => <Icon {...props} name='minus' />;
-
-const styles = StyleSheet.create({
-    card: { marginTop: 10 },
-    layout: {
-        flexDirection: "row",
-        height: 80,
-        backgroundColor: "transparent",
-    },
-    avatar: {
-        width: 80,
-        height: 80,
-        marginRight: 10,
-    },
-    main: {
-        flex: 1,
-        backgroundColor: "transparent",
-    },
-    flex1: {
-        flex: 1,
-    },
-    butContent: {
-        marginLeft: 6,
-    },
-    fontColor: {
-        color: "#B5B5B5",
-    },
-    miniButton: {
-        minWidth: 22,
-        minHeight: 22,
-        width: 22,
-        height: 22,
-        position: "absolute",
-        right: 10,
-        bottom: 5,
-        maxWidth: 22,
-        minHeight: 22,
-    },
-    status: {
-        position: "absolute",
-        left: 0,
-        width: 80,
-        paddingVertical: 4,
-        backgroundColor: "#F0F0F0",
-        bottom: 0,
-        textAlign: "center",
-    },
-});

+ 66 - 62
components/GoodsCardVertical.js

@@ -1,7 +1,6 @@
 import React from "react";
 import { StyleSheet, Dimensions } from "react-native";
 import {
-    Modal,
     Card,
     Text,
     Button,
@@ -10,67 +9,7 @@ import {
 } from "@ui-kitten/components";
 import { useModel } from "flooks";
 
-const width = Dimensions.get("window").width;
-export default function GoodsCard(props) {
-    const { add, remove } = useModel("wordsModel");
-    const { info } = props;
-    const { id, img, name, introduction, totalSales, discountAmount, amount } =
-        info || {};
-    return (
-        <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}
-                        >
-                            {name}
-                        </Text>
-                        <Text category='c1' status='info' style={styles.sub}>
-                            月售 {totalSales}
-                        </Text>
-                        <Text category='h6' status='danger'>
-                            ¥{discountAmount}{" "}
-                            <Text
-                                category='h1'
-                                status='info'
-                                style={{ textDecorationLine: "line-through" }}
-                            >
-                                ¥{amount}
-                            </Text>
-                        </Text>
-                    </Layout>
-
-                    <Button
-                        status='danger'
-                        onPress={props.removeEvent}
-                        style={styles.remove}
-                    >
-                        {remove}
-                    </Button>
-                </Layout>
-            ) : (
-                <Layout style={styles.layout} />
-            )}
-        </Card>
-    );
-}
-
+const {width} = Dimensions.get("window");
 const styles = StyleSheet.create({
     card: {
         width: (width - 35) / 2,
@@ -105,3 +44,68 @@ const styles = StyleSheet.create({
         bottom: 4,
     },
 });
+
+export default function GoodsCard(props) {
+    const {  remove } = useModel("wordsModel");
+    const { info,removeEvent } = props;
+    const { id, img, name, totalSales, discountAmount, amount } =
+        info || {};
+    return (
+      <Card
+        style={styles.card}
+        disabled
+        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}
+              >
+                {name}
+              </Text>
+              <Text category='c1' status='info' style={styles.sub}>
+                月售 
+                {' '}
+                {totalSales}
+              </Text>
+              <Text category='h6' status='danger'>
+                ¥
+                {discountAmount}
+                {" "}
+                <Text
+                  category='h1'
+                  status='info'
+                  style={{ textDecorationLine: "line-through" }}
+                >
+                  ¥
+                  {amount}
+                </Text>
+              </Text>
+            </Layout>
+
+            <Button
+              status='danger'
+              onPress={removeEvent}
+              style={styles.remove}
+            >
+              {remove}
+            </Button>
+          </Layout>
+            ) : (
+              <Layout style={styles.layout} />
+            )}
+      </Card>
+    );
+}

+ 32 - 30
components/GuideHeaderBar.js

@@ -1,37 +1,8 @@
 import React from "react";
-import { Button, Layout, useTheme, Text } from "@ui-kitten/components";
+import {  Layout, useTheme, Text } from "@ui-kitten/components";
 import { useModel } from "flooks";
 import { Image, StyleSheet } from "react-native";
 
-export default function GuideHeaderBar(props) {
-    const theme = useTheme();
-    const { registerInfo, showName, mid } = useModel("userModel");
-
-    const title = React.useMemo(() => {
-        if (mid) {
-            return showName;
-        } else {
-            return registerInfo.showName;
-        }
-    }, [showName, registerInfo]);
-    return (
-        <Layout
-            style={[
-                styles.container,
-                { backgroundColor: theme["color-primary-500"] },
-            ]}
-        >
-            <Image
-                source={require("../assets/images/logo_bai.png")}
-                style={styles.icon}
-            />
-            <Text style={styles.text} category='h6'>
-                {title}
-            </Text>
-        </Layout>
-    );
-}
-
 const styles = StyleSheet.create({
     container: {
         height: 70,
@@ -46,3 +17,34 @@ const styles = StyleSheet.create({
         color: "#fff",
     },
 });
+
+const img1=require("../assets/images/logo_bai.png")
+
+export default function GuideHeaderBar() {
+    const theme = useTheme();
+    const { registerInfo, showName, mid } = useModel("userModel");
+
+    const title = React.useMemo(() => {
+        if (mid) {
+            return showName;
+        } 
+            return registerInfo.showName;
+        
+    }, [showName, registerInfo]);
+    return (
+      <Layout
+        style={[
+                styles.container,
+                { backgroundColor: theme["color-primary-500"] },
+            ]}
+      >
+        <Image
+          source={img1}
+          style={styles.icon}
+        />
+        <Text style={styles.text} category='h6'>
+          {title}
+        </Text>
+      </Layout>
+    );
+}

+ 48 - 48
components/ListComponent.js

@@ -1,14 +1,14 @@
+/* eslint-disable react/jsx-props-no-spreading */
+/* eslint-disable no-underscore-dangle */
 import React from "react";
-import { StyleSheet } from "react-native";
-import { initDataState, DataListReducer } from "../Redux/DataListRedux";
 import { Divider, List, Layout } from "@ui-kitten/components";
-import { useModel } from "flooks";
 import { useFocusEffect } from "@react-navigation/native";
+import { initDataState, DataListReducer } from "../Redux/DataListRedux";
 import EmptyComponent from "./EmptyComponent";
 
 export default function ListComponent(props) {
     const [state, dispatch] = React.useReducer(DataListReducer, initDataState);
-    const { page, size, finish, loading, refreshing, dataList, error } = state;
+    const { page, size, loading, refreshing, dataList } = state;
     const {
         getInfo,
         renderItem,
@@ -21,31 +21,14 @@ export default function ListComponent(props) {
         showList,
         extraData,
         delId,
-        setChild,
-        startState, //父级调刷新
+        startState, // 父级调刷新
         initialNumToRender,
     } = props;
 
-    useFocusEffect(
-        React.useCallback(() => {
-            dispatch({
-                type: "clear",
-            });
-            if (startState != false) {
-                onRefresh();
-            }
-        }, [])
-    );
-    React.useEffect(() => {
-        if (startState) {
-            onRefresh();
-        }
-    }, [startState]);
-
+  
     function getList() {
         if (getInfo != null) {
             return getInfo(page, size).then(res => {
-                console.log(res);
                 if (emptyEvent) {
                     if (res.numberOfElements === 0) {
                         emptyEvent(true);
@@ -59,18 +42,18 @@ export default function ListComponent(props) {
                     payload: { list: res.content, finish: res.last },
                 });
             });
-        } else {
+        } 
             return Promise.reject();
-        }
+        
     }
 
     React.useEffect(() => {
         if (delId) {
-            let list = [...dataList];
-            let Index = list.findIndex(item => {
+            const list = [...dataList];
+            const Index = list.findIndex(item => {
                 return item.id === delId;
             });
-            if (Index != -1) {
+            if (Index !== -1) {
                 dispatch({
                     type: "remove",
                     payload: { index: Index },
@@ -108,12 +91,29 @@ export default function ListComponent(props) {
                     payload: { error: e.message },
                 });
             });
-    }
+	}
+	
+	  useFocusEffect(
+        React.useCallback(() => {
+            dispatch({
+                type: "clear",
+            });
+            if (startState !== false) {
+                onRefresh();
+            }
+        }, [])
+    );
+    React.useEffect(() => {
+        if (startState) {
+            onRefresh();
+        }
+    }, [startState]);
+
 
     const changePorps = React.useMemo(() => {
         let _props = { renderItem: () => <Layout /> };
-        if (showList != false) {
-            _props = { renderItem: renderItem };
+        if (showList !== false) {
+            _props = { renderItem };
 
             if (extraData) {
                 _props = {
@@ -128,26 +128,26 @@ export default function ListComponent(props) {
     const ListEmptyComponent = React.useMemo(() => {
         if (showEmpty && !refreshing && !loading) {
             return EmptyComponent;
-        } else {
+        } 
             return <></>;
-        }
+        
     }, [showEmpty, refreshing, loading]);
 
     return (
-        <List
-            refreshing={refreshing}
-            style={[style]}
-            data={dataList}
-            removeClippedSubviews={true}
-            initialNumToRender={initialNumToRender || 0}
-            ListHeaderComponent={ListHeaderComponent}
-            ListEmptyComponent={ListEmptyComponent}
-            onRefresh={onRefresh}
-            onEndReached={0.2}
-            ItemSeparatorComponent={() => <Divider style={[separatorStyle]} />}
-            onEndReachedThreshold={gotEnd}
-            ListFooterComponent={ListFooterComponent}
-            {...changePorps}
-        />
+      <List
+        refreshing={refreshing}
+        style={[style]}
+        data={dataList}
+        removeClippedSubviews
+        initialNumToRender={initialNumToRender || 0}
+        ListHeaderComponent={ListHeaderComponent}
+        ListEmptyComponent={ListEmptyComponent}
+        onRefresh={onRefresh}
+        onEndReached={0.2}
+        ItemSeparatorComponent={() => <Divider style={[separatorStyle]} />}
+        onEndReachedThreshold={gotEnd}
+        ListFooterComponent={ListFooterComponent}
+        {...changePorps}
+      />
     );
 }

+ 35 - 35
components/Loading.js

@@ -2,51 +2,16 @@ import React from "react";
 import { StyleSheet } from "react-native";
 import {
     Modal,
-    Card,
     Text,
-    Button,
     Layout,
     Spinner,
     Icon,
 } from "@ui-kitten/components";
 import { useModel, setModel } from "flooks";
 import loadingModel from "../models/loadingModel";
-import Textarea from "react-native-textarea";
 
 setModel("loadingModel", loadingModel);
 
-export default function Loading(props) {
-    const { tip, confirm, cancel, getWordsStr } = useModel("wordsModel");
-
-    const { show, title, status } = useModel("loadingModel");
-
-    return (
-        <Modal visible={show} backdropStyle={styles.backdrop}>
-            {status === "loading" && (
-                <Layout style={styles.loadingBox}>
-                    <Spinner size='giant' status='control' />
-                    <Text style={styles.text}>{getWordsStr("loading")}</Text>
-                </Layout>
-            )}
-
-            {status == "success" && (
-                <Layout style={styles.loadingBox}>
-                    <Icon style={styles.icon} name='checkmark' fill='#fff' />
-                    <Text style={styles.text}>{title}</Text>
-                </Layout>
-            )}
-
-            {status == "warn" && (
-                <Layout style={styles.warning}>
-                    <Text style={{ color: "#fff", textAlign: "center" }}>
-                        {title}
-                    </Text>
-                </Layout>
-            )}
-        </Modal>
-    );
-}
-
 const styles = StyleSheet.create({
     backdrop: {
         // backgroundColor: "rgba(0, 0, 0, 0.5)",
@@ -75,3 +40,38 @@ const styles = StyleSheet.create({
         marginHorizontal: 20,
     },
 });
+
+
+
+export default function Loading() {
+    const {  getWordsStr } = useModel("wordsModel");
+
+    const { show, title, status } = useModel("loadingModel");
+
+    return (
+      <Modal visible={show} backdropStyle={styles.backdrop}>
+        {status === "loading" && (
+        <Layout style={styles.loadingBox}>
+          <Spinner size='giant' status='control' />
+          <Text style={styles.text}>{getWordsStr("loading")}</Text>
+        </Layout>
+            )}
+
+        {status === "success" && (
+        <Layout style={styles.loadingBox}>
+          <Icon style={styles.icon} name='checkmark' fill='#fff' />
+          <Text style={styles.text}>{title}</Text>
+        </Layout>
+            )}
+
+        {status === "warn" && (
+        <Layout style={styles.warning}>
+          <Text style={{ color: "#fff", textAlign: "center" }}>
+            {title}
+          </Text>
+        </Layout>
+            )}
+      </Modal>
+    );
+}
+

+ 7 - 7
components/LoadingNode.js

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

+ 44 - 51
components/MoneyRecord.js

@@ -1,66 +1,15 @@
 import React from "react";
 import { StyleSheet } from "react-native";
 import {
-    Modal,
     Card,
     Text,
-    Button,
     Layout,
     Avatar,
     Icon,
 } from "@ui-kitten/components";
 import { useModel } from "flooks";
 
-export default function MoneyRecord(props) {
-    const { getWordsStr } = useModel("wordsModel");
-    const { info } = props;
-    const { id, avatar, name, time, type, amount } = info || {};
-    const code = React.useMemo(() => {
-        if (amount) {
-            return (amount > 0 ? "+ " : "- ") + amount.toFixed(2);
-        } else {
-            return "+ 0.00";
-        }
-    }, [amount]);
-    return (
-        <Card appearance='walletCard'>
-            <Layout style={styles.main}>
-                <Avatar
-                    style={styles.avatar}
-                    source={{
-                        uri: avatar,
-                    }}
-                />
-                <Layout style={styles.center}>
-                    <Text category='s1'>{name}</Text>
-                    <Text category='h1' status='info' style={styles.text2}>
-                        {time}
-                    </Text>
-                    <Text category='h1' status='info'>
-                        {getWordsStr(type)}
-                    </Text>
-                </Layout>
-                <Text category='s1' style={styles.code}>
-                    {code}
-                </Text>
-                <Icon
-                    name='arrow-ios-forward'
-                    fill='#C9C9C9'
-                    style={styles.icon}
-                />
-            </Layout>
-        </Card>
-    );
-}
 
-const ForwardIcon = props => (
-    <Icon
-        {...props}
-        name='arrow-ios-forward'
-        fill='#B4B4B4'
-        style={{ width: 15, height: 15, fontWeight: 500 }}
-    />
-);
 const styles = StyleSheet.create({
     main: {
         flexDirection: "row",
@@ -92,3 +41,47 @@ const styles = StyleSheet.create({
         marginTop: -10,
     },
 });
+
+
+export default function MoneyRecord(props) {
+    const { getWordsStr } = useModel("wordsModel");
+    const { info } = props;
+    const {  avatar, name, time, type, amount } = info || {};
+    const code = React.useMemo(() => {
+        if (amount) {
+            return (amount > 0 ? "+ " : "- ") + amount.toFixed(2);
+        } 
+            return "+ 0.00";
+        
+    }, [amount]);
+    return (
+      <Card appearance='walletCard'>
+        <Layout style={styles.main}>
+          <Avatar
+            style={styles.avatar}
+            source={{
+                        uri: avatar,
+                    }}
+          />
+          <Layout style={styles.center}>
+            <Text category='s1'>{name}</Text>
+            <Text category='h1' status='info' style={styles.text2}>
+              {time}
+            </Text>
+            <Text category='h1' status='info'>
+              {getWordsStr(type)}
+            </Text>
+          </Layout>
+          <Text category='s1' style={styles.code}>
+            {code}
+          </Text>
+          <Icon
+            name='arrow-ios-forward'
+            fill='#C9C9C9'
+            style={styles.icon}
+          />
+        </Layout>
+      </Card>
+    );
+}
+

+ 13 - 24
components/NavHeaderBar.js

@@ -1,40 +1,29 @@
 import React from "react";
 import {
-    Button,
-    Layout,
-    useTheme,
-    Text,
     TopNavigation,
     TopNavigationAction,
     Icon,
 } from "@ui-kitten/components";
-import { useModel } from "flooks";
-import { Image, StyleSheet } from "react-native";
-import * as RootNavigation from "../navigation/RootNavigation.js";
+import * as RootNavigation from "../navigation/RootNavigation";
 
 const BackIcon = props => <Icon {...props} fill='#fff' name='arrow-back' />;
 
 export default function NavHeaderBar(props) {
-    const theme = useTheme();
+	const {title,back}=props
+
     const renderBackAction = () => (
-        <TopNavigationAction
-            icon={BackIcon}
-            onPress={() => RootNavigation.goBack()}
-        />
+      <TopNavigationAction
+        icon={BackIcon}
+        onPress={() => RootNavigation.goBack()}
+      />
     );
     const { accessoryRight } = props;
     return (
-        <TopNavigation
-            alignment='center'
-            title={props.title}
-            accessoryLeft={props.back != false && renderBackAction}
-            accessoryRight={accessoryRight}
-        />
+      <TopNavigation
+        alignment='center'
+        title={title}
+        accessoryLeft={back !== false && renderBackAction}
+        accessoryRight={accessoryRight}
+      />
     );
 }
-
-const styles = StyleSheet.create({
-    container: {
-        height: 45,
-    },
-});

+ 179 - 183
components/OpenTime.js

@@ -1,5 +1,5 @@
+/* eslint-disable no-underscore-dangle */
 import React from "react";
-import PropTypes from "prop-types";
 import {
     StyleSheet,
     LayoutAnimation,
@@ -28,24 +28,53 @@ if (Platform.OS === "android") {
     }
 }
 
+
+const styles = StyleSheet.create({
+    checkBoxAll: {
+        paddingVertical: 10,
+    },
+    checkBoxItem: {
+        paddingVertical: 2,
+        paddingHorizontal: 10,
+    },
+    time: {
+        // width: 100,
+        // height: 300,
+    },
+    backdrop: {
+        backgroundColor: "rgba(0, 0, 0, 0.5)",
+    },
+    btnList: {
+        flexDirection: "row",
+        justifyContent: "space-between",
+        paddingTop: 15,
+    },
+    hideHeight: {
+        height: 0,
+        borderWidth: 0,
+    },
+    btn: {
+        flex: 1,
+        minWidth: 50,
+    },
+});
+
+
 const ForwardIcon = (props) => <Icon {...props} name='arrow-ios-forward' />;
 
 const titleText = (props, title, value) => (
-    <Text {...props} category='s1' numberOfLines={1} ellipsizeMode='tail'>
-        {title}
-        <Text category='c1' style={{ paddingLeft: 10 }}>
-            {value}
-        </Text>
+  <Text {...props} category='s1' numberOfLines={1} ellipsizeMode='tail'>
+    {title}
+    <Text category='c1' style={{ paddingLeft: 10 }}>
+      {value}
     </Text>
+  </Text>
 );
 
 export default function OpenTime({
     open,
     submit,
     cancelEvent,
-    startTime,
-    endTime,
-    week,
     openModal,
     defaultValue,
 }) {
@@ -98,13 +127,12 @@ export default function OpenTime({
     ];
     const [checkList, changeChecked] = React.useState([]);
     const listItems = weeks.map((item, index) => (
-        <CheckBox
-            style={styles.checkBoxItem}
-            key={index}
-            checked={checkList.includes(item.key)}
-            onChange={(checked) => {
-                console.log(checked);
-                let _checkList = [...checkList];
+      <CheckBox
+        style={styles.checkBoxItem}
+        key={index}
+        checked={checkList.includes(item.key)}
+        onChange={(checked) => {
+                const _checkList = [...checkList];
                 if (checked) {
                     _checkList.push(item.key);
                 } else {
@@ -112,22 +140,21 @@ export default function OpenTime({
                 }
                 changeChecked(_checkList);
             }}
-        >
-            {item.label}
-        </CheckBox>
+      >
+        {item.label}
+      </CheckBox>
     ));
     const list = React.useMemo(() => {
-        let hourSum = 24;
-        let minuteSum = 60;
-        let secondSum = 60;
-        let hours = range(hourSum / 1).map((item) => {
+        const hourSum = 24;
+        const minuteSum = 60;
+        const hours = range(hourSum / 1).map((item) => {
             item = convert2Digit(item * 1);
             return {
                 label: `${item} ${hour}`,
                 value: item,
             };
         });
-        let minutes = range(minuteSum / 10).map((item) => {
+        const minutes = range(minuteSum / 10).map((item) => {
             item = convert2Digit(item * 10);
             return {
                 label: `${item} ${min}`,
@@ -145,52 +172,52 @@ export default function OpenTime({
     const [showWeek, changeShowWeek] = React.useState(false);
 
     const allChecked = React.useMemo(() => {
-        if (weeks.length == checkList.length) {
+        if (weeks.length === checkList.length) {
             return true;
-        } else {
+        } 
             return false;
-        }
+        
     }, [weeks, checkList]);
 
     const indeterminate = React.useMemo(() => {
         if (!allChecked && checkList.length > 0) {
             return true;
-        } else {
+        } 
             return false;
-        }
+        
     }, [allChecked, checkList]);
 
     const canSubmit = React.useMemo(() => {
-        if (time1.length == 2 && time2.length == 2 && checkList.length > 0) {
+        if (time1.length === 2 && time2.length === 2 && checkList.length > 0) {
             return true;
-        } else {
+        } 
             return false;
-        }
+        
     }, [time1, time2, checkList]);
 
     const time1Str = React.useMemo(() => {
-        if (time1.length == 2) {
-            let str = time1[0] + ":" + time1[1] * 10;
+        if (time1.length === 2) {
+            const str = `${time1[0]  }:${  time1[1] * 10}`;
             return moment(str, "H:m").format("HH:mm");
-        } else {
+        } 
             return "";
-        }
+        
     }, [time1]);
 
     const time2Str = React.useMemo(() => {
-        if (time2.length == 2) {
-            let str = time2[0] + ":" + time2[1] * 10;
+        if (time2.length === 2) {
+            const str = `${time2[0]  }:${  time2[1] * 10}`;
             return moment(str, "H:m").format("HH:mm");
-        } else {
+        } 
             return "";
-        }
+        
     }, [time2]);
 
     const weekStr = React.useMemo(() => {
         if (allChecked) {
             return every;
-        } else {
-            let _weeks = weeks.filter((item) => {
+        } 
+            const _weeks = weeks.filter((item) => {
                 return checkList.includes(item.key);
             });
             return _weeks
@@ -198,9 +225,11 @@ export default function OpenTime({
                     return item.label;
                 })
                 .join(",");
-        }
+        
     }, []);
 
+    const [showName, setShowName] = React.useState([" ", ""]);
+
     React.useEffect(() => {
         if (defaultValue && defaultValue.length > 0) {
             setShowName(defaultValue);
@@ -215,110 +244,107 @@ export default function OpenTime({
         LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
     }
 
-    const [showName, setShowName] = React.useState([" ", ""]);
-
     return (
-        <>
-            <SelectItem
-                appearance='form'
-                style={{ flex: 1, height: 32 }}
+      <>
+        <SelectItem
+          appearance='form'
+          style={{ flex: 1, height: 32 }}
+          accessoryRight={ForwardIcon}
+          title={(props) => titleText(props, showName[0], showName[1])}
+          onPress={openModal}
+        />
+        <Modal
+          visible={open && list.length > 0}
+          backdropStyle={styles.backdrop}
+          onBackdropPress={cancelEvent}
+        >
+          <Card
+            disabled
+            appearance='modalCrad'
+            style={{ width: 242 }}
+          >
+            <Layout>
+              <MenuItem
+                appearance='cardContent'
+                title={(props) => titleText(props, start, time1Str)}
                 accessoryRight={ForwardIcon}
-                title={(props) => titleText(props, showName[0], showName[1])}
-                onPress={openModal}
-            />
-            <Modal
-                visible={open && list.length > 0}
-                backdropStyle={styles.backdrop}
-                onBackdropPress={cancelEvent}
-            >
-                <Card
-                    disabled={true}
-                    appearance='modalCrad'
-                    style={{ width: 242 }}
-                >
-                    <Layout>
-                        <MenuItem
-                            appearance='cardContent'
-                            title={(props) => titleText(props, start, time1Str)}
-                            accessoryRight={ForwardIcon}
-                            onPress={() => {
+                onPress={() => {
                                 hideElseShow(1);
                             }}
-                        />
-                    </Layout>
-                    <Card
-                        disabled={true}
-                        appearance='modalCrad'
-                        style={[
+              />
+            </Layout>
+            <Card
+              disabled
+              appearance='modalCrad'
+              style={[
                             { width: 222 },
                             showTime1 ? {} : styles.hideHeight,
                         ]}
-                    >
-                        <Scrollpicker
-                            key='time1'
-                            list={list}
-                            proportion={[1, 1]}
-                            offsetCount={1}
-                            value={time1}
-                            onChange={(index, value) => {
-                                let _time1 = [...time1];
+            >
+              <Scrollpicker
+                key='time1'
+                list={list}
+                proportion={[1, 1]}
+                offsetCount={1}
+                value={time1}
+                onChange={(index, value) => {
+                                const _time1 = [...time1];
                                 _time1[index] = value;
                                 setTime1(_time1);
                             }}
-                        />
-                    </Card>
-                    <Layout>
-                        <MenuItem
-                            appearance='cardContent'
-                            title={(props) => titleText(props, end, time2Str)}
-                            accessoryRight={ForwardIcon}
-                            onPress={() => {
+              />
+            </Card>
+            <Layout>
+              <MenuItem
+                appearance='cardContent'
+                title={(props) => titleText(props, end, time2Str)}
+                accessoryRight={ForwardIcon}
+                onPress={() => {
                                 hideElseShow(2);
                             }}
-                        />
-                    </Layout>
-                    <Card
-                        disabled={true}
-                        appearance='modalCrad'
-                        style={[
+              />
+            </Layout>
+            <Card
+              disabled
+              appearance='modalCrad'
+              style={[
                             { width: 222 },
                             showTime2 ? {} : styles.hideHeight,
                         ]}
-                    >
-                        <Scrollpicker
-                            key='time2'
-                            list={list}
-                            proportion={[1, 1]}
-                            offsetCount={1}
-                            value={time2}
-                            onChange={(index, value) => {
-                                let _time2 = [...time2];
+            >
+              <Scrollpicker
+                key='time2'
+                list={list}
+                proportion={[1, 1]}
+                offsetCount={1}
+                value={time2}
+                onChange={(index, value) => {
+                                const _time2 = [...time2];
                                 _time2[index] = value;
                                 setTime2(_time2);
                             }}
-                        />
-                    </Card>
-                    <Layout>
-                        <MenuItem
-                            appearance='cardContent'
-                            title={(props) =>
-                                titleText(props, weekName, weekStr)
-                            }
-                            accessoryRight={ForwardIcon}
-                            onPress={() => {
+              />
+            </Card>
+            <Layout>
+              <MenuItem
+                appearance='cardContent'
+                title={(props) =>
+                                titleText(props, weekName, weekStr)}
+                accessoryRight={ForwardIcon}
+                onPress={() => {
                                 hideElseShow(3);
                             }}
-                        />
-                    </Layout>
-                    <Card
-                        appearance='modalCrad'
-                        style={[showWeek ? {} : styles.hideHeight]}
-                    >
-                        <CheckBox
-                            style={styles.checkBoxAll}
-                            checked={allChecked}
-                            indeterminate={indeterminate}
-                            onChange={(checked) => {
+              />
+            </Layout>
+            <Card
+              appearance='modalCrad'
+              style={[showWeek ? {} : styles.hideHeight]}
+            >
+              <CheckBox
+                style={styles.checkBoxAll}
+                checked={allChecked}
+                indeterminate={indeterminate}
+                onChange={(checked) => {
                                 changeChecked(
                                     checked
                                         ? weeks.map((item) => {
@@ -327,67 +353,37 @@ export default function OpenTime({
                                         : []
                                 );
                             }}
-                        >
-                            {every}
-                        </CheckBox>
+              >
+                {every}
+              </CheckBox>
 
-                        {listItems}
-                    </Card>
-                    <Layout style={styles.btnList}>
-                        <Button
-                            style={styles.btn}
-                            appearance='outline'
-                            status='info'
-                            onPress={cancelEvent}
-                        >
-                            {cancel}
-                        </Button>
-                        <Button
-                            style={[styles.btn, { marginLeft: 10 }]}
-                            disabled={!canSubmit}
-                            onPress={() => {
+              {listItems}
+            </Card>
+            <Layout style={styles.btnList}>
+              <Button
+                style={styles.btn}
+                appearance='outline'
+                status='info'
+                onPress={cancelEvent}
+              >
+                {cancel}
+              </Button>
+              <Button
+                style={[styles.btn, { marginLeft: 10 }]}
+                disabled={!canSubmit}
+                onPress={() => {
                                 submit(time1Str, time2Str, checkList);
                                 setShowName([
-                                    time1Str + "~" + time2Str,
+                                    `${time1Str  }~${  time2Str}`,
                                     weekStr,
                                 ]);
                             }}
-                        >
-                            {confirm}
-                        </Button>
-                    </Layout>
-                </Card>
-            </Modal>
-        </>
+              >
+                {confirm}
+              </Button>
+            </Layout>
+          </Card>
+        </Modal>
+      </>
     );
 }
-
-const styles = StyleSheet.create({
-    checkBoxAll: {
-        paddingVertical: 10,
-    },
-    checkBoxItem: {
-        paddingVertical: 2,
-        paddingHorizontal: 10,
-    },
-    time: {
-        // width: 100,
-        // height: 300,
-    },
-    backdrop: {
-        backgroundColor: "rgba(0, 0, 0, 0.5)",
-    },
-    btnList: {
-        flexDirection: "row",
-        justifyContent: "space-between",
-        paddingTop: 15,
-    },
-    hideHeight: {
-        height: 0,
-        borderWidth: 0,
-    },
-    btn: {
-        flex: 1,
-        minWidth: 50,
-    },
-});

+ 205 - 194
components/OrderCard.js

@@ -1,18 +1,101 @@
+/* eslint-disable react/jsx-props-no-spreading */
+/* eslint-disable no-shadow */
 import React from "react";
-import { StyleSheet, Dimensions } from "react-native";
+import { StyleSheet } from "react-native";
 import {
-    Modal,
     Card,
     Text,
     Button,
     Layout,
-    Avatar,
     MenuGroup,
     MenuItem,
-    Menu,
 } from "@ui-kitten/components";
 import { Linking } from "expo";
 import { useModel } from "flooks";
+
+const styles = StyleSheet.create({
+    orderItem1: {
+        justifyContent: "space-between",
+        flexDirection: "row",
+        marginBottom: 10,
+    },
+    orderItem2: {
+        alignItems: "flex-start",
+        flexDirection: "row",
+        marginBottom: 15,
+    },
+    leftText: {
+        flexShrink: 0,
+        marginRight: 8,
+        minWidth: 60,
+    },
+    menuGroup: {
+        padding: 0,
+        margin: 0,
+    },
+    lay: {
+        flex: 1,
+    },
+    menuTitle: {
+        flexDirection: "row",
+        flex: 1,
+    },
+    footerContainer: {
+        flexDirection: "row",
+        justifyContent: "flex-end",
+    },
+    footerControl: {
+        width: 112,
+        marginLeft: 5,
+    },
+    sub: {
+        flex: 1,
+        flexShrink: 0,
+    },
+    menuItem: {
+        flex: 1,
+        // paddingHorizontal: 0,
+        // paddingVertical: 0,
+        // paddingLeft: 0,
+        // marginTop: 5,
+        // marginHorizontal: 5,
+    },
+    right: {
+        textAlign: "right",
+    },
+    center: {
+        textAlign: "center",
+    },
+});
+
+
+const MenuTitle = (title, sub, num, index) => (
+  <Layout style={styles.menuTitle} key={index || 0}>
+    <Text category='h1' style={styles.sub}>
+      {title}
+    </Text>
+    {num && (
+    <Text category='h1' style={[styles.sub, styles.center]}>
+      {num}
+    </Text>
+        )}
+    <Text category='h1' style={[styles.sub, styles.right]}>
+      {sub}
+    </Text>
+  </Layout>
+);
+
+const lsitMenu = () => {
+    return (
+      <Layout style={styles.menuItem}>
+        {[1, 2].map((item, index) => {
+                return MenuTitle(`圣诞节副科${  item}`, "¥9999.99", 2, index + 1);
+            })}
+      </Layout>
+    );
+};
+
+
 export default function OrderCard(props) {
     const {
         orderInfo2,
@@ -27,7 +110,7 @@ export default function OrderCard(props) {
     } = useModel("wordsModel");
     const { showDialog } = useModel("dialogModel");
     const { receivedOrder } = useModel("orderInfoModel");
-    const { info, updateInfo } = props;
+    const { info, updateInfo,style } = props;
     const {
         id,
         payMethod,
@@ -41,45 +124,45 @@ export default function OrderCard(props) {
     const Footer = (props) => {
         if (riderStatus) {
             return (
-                <Layout
-                    {...props}
-                    style={[props.style]}
-                >
-                    <Layout style={styles.orderItem1}>
-                        <Text category='c2'>骑手:胖齐齐</Text>
-                        <Button
-                            appearance='outline'
-                            onPress={() => {
-                                Linking.openURL("tel:+" + user.phone);
+              <Layout
+                {...props}
+                style={[props.style]}
+              >
+                <Layout style={styles.orderItem1}>
+                  <Text category='c2'>骑手:胖齐齐</Text>
+                  <Button
+                    appearance='outline'
+                    onPress={() => {
+                                Linking.openURL(`tel:+${  user.phone}`);
                             }}
-                        >
-                            联系骑手
-                        </Button>
-                    </Layout>
-                    <Layout style={styles.orderItem1}>
-                        <Text category='c2'>
-                            预计送达时间:2019-12-31 13:17
-                        </Text>
-                    </Layout>
-                    {riderStatus == "CARRY_OUT" && (
-                        <Layout style={styles.orderItem1}>
-                            <Text category='c2'>
-                                实际送达时间:2019-12-31 13:17
-                            </Text>
-                        </Layout>
-                    )}
+                  >
+                    联系骑手
+                  </Button>
+                </Layout>
+                <Layout style={styles.orderItem1}>
+                  <Text category='c2'>
+                    预计送达时间:2019-12-31 13:17
+                  </Text>
+                </Layout>
+                {riderStatus === "CARRY_OUT" && (
+                <Layout style={styles.orderItem1}>
+                  <Text category='c2'>
+                    实际送达时间:2019-12-31 13:17
+                  </Text>
                 </Layout>
+                    )}
+              </Layout>
             );
-        } else if (merchantStatus == "NOT_RECEIVED") {
+        } if (merchantStatus === "NOT_RECEIVED") {
             return (
-                <Layout
-                    {...props}
-                    style={[props.style, styles.footerContainer]}
-                >
-                    <Button
-                        style={styles.footerControl}
-                        appearance='outline'
-                        onPress={() => {
+              <Layout
+                {...props}
+                style={[props.style, styles.footerContainer]}
+              >
+                <Button
+                  style={styles.footerControl}
+                  appearance='outline'
+                  onPress={() => {
                             showDialog({
                                 bodyText: overTips,
                                 status: "danger",
@@ -91,173 +174,101 @@ export default function OrderCard(props) {
                                 },
                             });
                         }}
-                    >
-                        {orderButton1}
-                    </Button>
-                    <Button
-                        style={styles.footerControl}
-                        onPress={() => {
+                >
+                  {orderButton1}
+                </Button>
+                <Button
+                  style={styles.footerControl}
+                  onPress={() => {
                             receivedOrder(id, true).then((res) => {
                                 updateInfo(res);
                             });
                         }}
-                        appearance='outline'
-                    >
-                        {orderButton2}
-                    </Button>
-                </Layout>
+                  appearance='outline'
+                >
+                  {orderButton2}
+                </Button>
+              </Layout>
             );
-        } else {
+        } 
             return null;
-        }
+        
     };
     return (
-        <Card
-            appearance='orderCard'
-            disabled={true}
-            style={[props.style]}
-            footer={Footer}
-        >
-            {riderStatus ? (
-                <Text>骑手{getWordsStr(riderStatus)}</Text>
+      <Card
+        appearance='orderCard'
+        disabled
+        style={[style]}
+        footer={Footer}
+      >
+        {riderStatus ? (
+          <Text>
+            骑手
+            {getWordsStr(riderStatus)}
+          </Text>
             ) : (
-                <Text>商家{getWordsStr(merchantStatus)}</Text>
+              <Text>
+                商家
+                {getWordsStr(merchantStatus)}
+              </Text>
             )}
-            <Layout style={styles.orderItem1}>
-                <Text category='c2'>{id}</Text>
-                <Text category='c2'>
-                    {orderInfo2}:{orderTime}
-                </Text>
-            </Layout>
-            <Layout style={styles.orderItem1}>
-                <Text category='h6'>{user.nickname}</Text>
-                <Text category='h6'>{getWordsStr(payMethod)}</Text>
-            </Layout>
-            <Layout style={styles.orderItem1}>
-                <Text category='c2'>{user.phone}</Text>
-                <Button
-                    appearance='outline'
-                    onPress={() => {
-                        Linking.openURL("tel:+" + user.phone);
+        <Layout style={styles.orderItem1}>
+          <Text category='c2'>{id}</Text>
+          <Text category='c2'>
+            {orderInfo2}
+            :
+            {orderTime}
+          </Text>
+        </Layout>
+        <Layout style={styles.orderItem1}>
+          <Text category='h6'>{user.nickname}</Text>
+          <Text category='h6'>{getWordsStr(payMethod)}</Text>
+        </Layout>
+        <Layout style={styles.orderItem1}>
+          <Text category='c2'>{user.phone}</Text>
+          <Button
+            appearance='outline'
+            onPress={() => {
+                        Linking.openURL(`tel:+${  user.phone}`);
                     }}
-                >
-                    {orderInfo3}
-                </Button>
-            </Layout>
-
-            <Layout style={styles.orderItem2}>
-                <Text category='c2' style={styles.leftText}>
-                    {orderInfo4}
-                </Text>
-                <Text category='h1'>{userAddress}</Text>
-            </Layout>
-
-            <Layout style={styles.orderItem2}>
-                <Text category='c2' style={styles.leftText}>
-                    {orderInfo5}
-                </Text>
-                <Layout style={styles.lay}>
-                    <MenuGroup
-                        appearance='orderProduct'
-                        title={() => MenuTitle("圣诞节副科", "¥9999.99")}
-                        style={styles.menuGroup}
-                    >
-                        <MenuItem
-                            disabled={true}
-                            style={styles.menuItem}
-                            title={lsitMenu}
-                        />
-                    </MenuGroup>
-                </Layout>
-            </Layout>
+          >
+            {orderInfo3}
+          </Button>
+        </Layout>
 
-            <Layout style={styles.orderItem2}>
-                <Text category='c2' style={styles.leftText}>
-                    {orderInfo6}:
-                </Text>
-                <Text category='h1'>多放辣椒</Text>
-            </Layout>
-        </Card>
-    );
-}
+        <Layout style={styles.orderItem2}>
+          <Text category='c2' style={styles.leftText}>
+            {orderInfo4}
+          </Text>
+          <Text category='h1'>{userAddress}</Text>
+        </Layout>
 
-const MenuTitle = (title, sub, num, index) => (
-    <Layout style={styles.menuTitle} key={index || 0}>
-        <Text category='h1' style={styles.sub}>
-            {title}
-        </Text>
-        {num && (
-            <Text category='h1' style={[styles.sub, styles.center]}>
-                {num}
-            </Text>
-        )}
-        <Text category='h1' style={[styles.sub, styles.right]}>
-            {sub}
-        </Text>
-    </Layout>
-);
+        <Layout style={styles.orderItem2}>
+          <Text category='c2' style={styles.leftText}>
+            {orderInfo5}
+          </Text>
+          <Layout style={styles.lay}>
+            <MenuGroup
+              appearance='orderProduct'
+              title={() => MenuTitle("圣诞节副科", "¥9999.99")}
+              style={styles.menuGroup}
+            >
+              <MenuItem
+                disabled
+                style={styles.menuItem}
+                title={lsitMenu}
+              />
+            </MenuGroup>
+          </Layout>
+        </Layout>
 
-const lsitMenu = () => {
-    return (
-        <Layout style={styles.menuItem}>
-            {[1, 2].map((item, index) => {
-                return MenuTitle("圣诞节副科" + item, "¥9999.99", 2, index + 1);
-            })}
+        <Layout style={styles.orderItem2}>
+          <Text category='c2' style={styles.leftText}>
+            {orderInfo6}
+            :
+          </Text>
+          <Text category='h1'>多放辣椒</Text>
         </Layout>
+      </Card>
     );
-};
-
-const styles = StyleSheet.create({
-    orderItem1: {
-        justifyContent: "space-between",
-        flexDirection: "row",
-        marginBottom: 10,
-    },
-    orderItem2: {
-        alignItems: "flex-start",
-        flexDirection: "row",
-        marginBottom: 15,
-    },
-    leftText: {
-        flexShrink: 0,
-        marginRight: 8,
-        minWidth: 60,
-    },
-    menuGroup: {
-        padding: 0,
-        margin: 0,
-    },
-    lay: {
-        flex: 1,
-    },
-    menuTitle: {
-        flexDirection: "row",
-        flex: 1,
-    },
-    footerContainer: {
-        flexDirection: "row",
-        justifyContent: "flex-end",
-    },
-    footerControl: {
-        width: 112,
-        marginLeft: 5,
-    },
-    sub: {
-        flex: 1,
-        flexShrink: 0,
-    },
-    menuItem: {
-        flex: 1,
-        // paddingHorizontal: 0,
-        // paddingVertical: 0,
-        // paddingLeft: 0,
-        // marginTop: 5,
-        // marginHorizontal: 5,
-    },
-    right: {
-        textAlign: "right",
-    },
-    center: {
-        textAlign: "center",
-    },
-});
+}

+ 36 - 35
components/ScrollPage.js

@@ -1,35 +1,24 @@
 import React from "react";
 import { ScrollView, RefreshControl } from "react-native";
-import { initState, refreashReducer } from "../Redux/RefreashRedux";
 import { useFocusEffect } from "@react-navigation/native";
-import NavHeaderBar from "./NavHeaderBar";
 import { useTheme } from "@ui-kitten/components";
 import { useModel } from "flooks";
+import NavHeaderBar from "./NavHeaderBar";
+import { initState, refreashReducer } from "../Redux/RefreashRedux";
+
 export default function scrollPage(props) {
     const {
         style,
         enabledFresh,
         refreshEvent,
         statusType,
-        navHeaderBarTitle,
+		navHeaderBarTitle,
+		children,
     } = props;
     const [state, dispatch] = React.useReducer(refreashReducer, initState);
-    const { refreshing, error } = state;
+    const { refreshing } = state;
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-
-    useFocusEffect(
-        React.useCallback(() => {
-            if (enabledFresh && refreshEvent) {
-                onRefresh();
-            }
-
-            if (statusType === "primary") {
-                changeBackground(theme["color-primary-500"]);
-            }
-        }, [])
-    );
-
     function onRefresh() {
         dispatch({
             type: "startRefresh",
@@ -54,26 +43,38 @@ export default function scrollPage(props) {
             }, 1000);
         }
     }
+    useFocusEffect(
+        React.useCallback(() => {
+            if (enabledFresh && refreshEvent) {
+                onRefresh();
+            }
+
+            if (statusType === "primary") {
+                changeBackground(theme["color-primary-500"]);
+            }
+        }, [])
+    );
+
+
 
     return (
-        <>
-            {navHeaderBarTitle != null && (
-                <NavHeaderBar title={navHeaderBarTitle} />
+      <>
+        {navHeaderBarTitle != null && (
+        <NavHeaderBar title={navHeaderBarTitle} />
             )}
-            <ScrollView
-                refreshControl={
-                    <RefreshControl
-                        refreshing={refreshing}
-                        onRefresh={onRefresh}
-                        enabled={enabledFresh || false}
-                    />
-                }
-                style={style}
-                contentContainerStyle={{ flexGrow: 1 }}
-                // keyboardShouldPersistTaps={"handled"}
-            >
-                {props.children}
-            </ScrollView>
-        </>
+        <ScrollView
+          refreshControl={(
+            <RefreshControl
+              refreshing={refreshing}
+              onRefresh={onRefresh}
+              enabled={enabledFresh || false}
+            />
+                  )}
+          style={style}
+          contentContainerStyle={{ flexGrow: 1 }}
+        >
+          {children}
+        </ScrollView>
+      </>
     );
 }

+ 0 - 6
components/StyledText.js

@@ -1,6 +0,0 @@
-import * as React from 'react';
-import { Text } from 'react-native';
-
-export function MonoText(props) {
-  return <Text {...props} style={[props.style, { fontFamily: 'space-mono' }]} />;
-}

+ 6 - 6
components/TabBarIcon.js

@@ -1,19 +1,19 @@
+/* eslint-disable react/destructuring-assignment */
 import * as React from "react";
 import { Icon, useTheme } from "@ui-kitten/components";
 
-import Colors from "../constants/Colors";
 
 export default function TabBarIcon(props) {
     const theme = useTheme();
     return (
-        <Icon
-            name={props.name}
-            style={{ width: 30, height: 30 }}
-            fill={
+      <Icon
+        name={props.name}
+        style={{ width: 30, height: 30 }}
+        fill={
                 props.focused
                     ? theme["color-primary-500"]
                     : theme["color-basic-600"]
             }
-        />
+      />
     );
 }

+ 0 - 26
components/Text.js

@@ -1,26 +0,0 @@
-import * as WebBrowser from "expo-web-browser";
-import * as React from "react";
-import { Text } from "react-native";
-const FreeText = React.memo((props) => {
-    function getTextProps(props) {
-        let _props = {
-            color: "#000000",
-            fontSize: 16,
-        };
-        if (props.fontSize) {
-            _props.fontSize = props.fontSize;
-        }
-        if (props.color) {
-            _props.color = props.color;
-        }
-        if (props.textAlign) {
-            _props.align = props.textAlign;
-        }
-        return _props;
-    }
-
-    const textProps = getTextProps(props);
-    return <Text {...textProps}>{props.label || ""}</Text>;
-});
-
-export default FreeText;

+ 17 - 16
components/TipNavHeader.js

@@ -1,15 +1,22 @@
 import * as React from "react";
-import NavHeaderBar from "./NavHeaderBar";
 import { Layout } from "@ui-kitten/components";
 import { StyleSheet } from "react-native";
+import NavHeaderBar from "./NavHeaderBar";
 
-//导航条+头部提示模块
+const styles = StyleSheet.create({
+    top: {
+        marginTop: 7,
+        padding: 15,
+    },
+});
+
+// 导航条+头部提示模块
 export default function TipNavHeader({ title, children }) {
     return (
-        <>
-            <NavHeaderBar title={title} />
-            <Layout style={styles.top}>
-                {children.map(item => {
+      <>
+        <NavHeaderBar title={title} />
+        <Layout style={styles.top}>
+          {children.map(item => {
                     if (item.type.styledComponentName === "Text") {
                         return {
                             ...item,
@@ -18,17 +25,11 @@ export default function TipNavHeader({ title, children }) {
                                 ...item.props,
                             },
                         };
-                    } else {
+                    } 
                         return item;
-                    }
+                    
                 })}
-            </Layout>
-        </>
+        </Layout>
+      </>
     );
 }
-const styles = StyleSheet.create({
-    top: {
-        marginTop: 7,
-        padding: 15,
-    },
-});

+ 55 - 63
components/UpLoadImage.js

@@ -1,28 +1,59 @@
+/* eslint-disable react/destructuring-assignment */
+/* eslint-disable no-async-promise-executor */
+/* eslint-disable prefer-promise-reject-errors */
+/* eslint-disable no-underscore-dangle */
 import React from "react";
-import { Button, Layout, Icon } from "@ui-kitten/components";
+import { Button,  Icon } from "@ui-kitten/components";
 import { useModel } from "flooks";
-import { Linking } from "expo";
 import * as ImagePicker from "expo-image-picker";
 import { Image, Platform } from "react-native";
-import * as FileSystem from "expo-file-system";
 
-export default function UpLoadImage(props) {
-    const { connect, removeTips } = useModel("wordsModel");
-    const { httpPost } = useModel("httpModel", true);
-    const { showDialog } = useModel("dialogModel", true);
+
+
+const _pickImage = () => {
+    return new Promise(async (resolve, reject) => {
+        try {
+            const permissionResult = await ImagePicker.requestCameraRollPermissionsAsync();
+
+            if (permissionResult.granted === false) {
+                reject("notAllod");
+            } else {
+                const result = await ImagePicker.launchImageLibraryAsync({
+                    mediaTypes: ImagePicker.MediaTypeOptions.Images,
+                    allowsEditing: true,
+                    aspect: [1, 1],
+                    quality: 1,
+                    base64: true,
+                });
+                if (!result.cancelled) {
+                    if (Platform.OS === "web") {
+                        resolve(result.uri);
+                    } else {
+                        resolve(result.base64);
+                    }
+                }
+            }
+        } catch (e) {
+            reject(e);
+        }
+    });
+};
+
+export default function UpLoadImage(props) {    
+	const { httpPost } = useModel("httpModel", true);
+    // eslint-disable-next-line no-shadow
     const renderPulseIcon = (props) => <Icon {...props} name='plus-outline' />;
 
     return (
-        <>
-            <Button
-                style={[
+      <>
+        <Button
+          style={[
                     props.style,
                     props.size ? { width: props.size, height: props.size } : {},
                 ]}
-                appearance='imageButton'
-                onPress={() => {
+          appearance='imageButton'
+          onPress={() => {
                     _pickImage().then((img) => {
-                        console.log(img);
                         httpPost("/upload/base64", {
                             base64: img,
                         }).then((res) => {
@@ -30,23 +61,23 @@ export default function UpLoadImage(props) {
                         });
                     });
                 }}
-                accessoryLeft={(imgprops) => {
-                    if (props.value && props.value != " ") {
+          accessoryLeft={(imgprops) => {
+                    if (props.value && props.value !== " ") {
                         return (
-                            <Image
-                                style={{
+                          <Image
+                            style={{
                                     width: "100%",
                                     height: "100%",
                                 }}
-                                source={{ uri: props.value }}
-                            />
+                            source={{ uri: props.value }}
+                          />
                         );
-                    } else {
+                    } 
                         return renderPulseIcon(imgprops);
-                    }
+                    
                 }}
-            />
-            {/* {props.hasCancel == true && props.value && (
+        />
+        {/* {props.hasCancel == true && props.value && (
                 <Button
                     size='tiny'
                     status='danger'
@@ -70,46 +101,7 @@ export default function UpLoadImage(props) {
                     }}
                 />
             )} */}
-        </>
+      </>
     );
 }
-const ForwardIcon = (props) => <Icon {...props} name='minus' fill='#fff' />;
-
-const getPermissionAsync = async () => {
-    if (Constants.platform.ios) {
-        const { status } = await Permissions.askAsync(Permissions.CAMERA_ROLL);
-        if (status !== "granted") {
-            alert("Sorry, we need camera roll permissions to make this work!");
-        }
-    }
-};
-
-const _pickImage = () => {
-    console.log(Platform);
-    return new Promise(async (resolve, reject) => {
-        try {
-            let permissionResult = await ImagePicker.requestCameraRollPermissionsAsync();
 
-            if (permissionResult.granted === false) {
-                reject("notAllod");
-            } else {
-                let result = await ImagePicker.launchImageLibraryAsync({
-                    mediaTypes: ImagePicker.MediaTypeOptions.Images,
-                    allowsEditing: true,
-                    aspect: [1, 1],
-                    quality: 1,
-                    base64: true,
-                });
-                if (!result.cancelled) {
-                    if (Platform.OS == "web") {
-                        resolve(result.uri);
-                    } else {
-                        resolve(result.base64);
-                    }
-                }
-            }
-        } catch (e) {
-            reject(e);
-        }
-    });
-};

+ 2 - 2
constants/Layout.js

@@ -1,7 +1,7 @@
 import { Dimensions } from 'react-native';
 
-const width = Dimensions.get('window').width;
-const height = Dimensions.get('window').height;
+const {width} = Dimensions.get('window');
+const {height} = Dimensions.get('window');
 
 export default {
   window: {

+ 2 - 2
language/index.js

@@ -1,10 +1,10 @@
-//I18n.js
+// I18n.js
 import * as Localization from "expo-localization";
 import i18n from "i18n-js";
 import th from "./th";
 import zh from "./zh";
 
-//支持转换的语言
+// 支持转换的语言
 i18n.translations = {
     th,
     zh,

+ 2 - 2
language/th.js

@@ -1,5 +1,5 @@
 export default {
-    //页面的文字
+    // 页面的文字
 
     welcom: "欢迎使用叮咚外卖平台[泰文]",
     login_form_1: "手机号",
@@ -28,7 +28,7 @@ export default {
     guideHome_pla_2: "(可后面再填)",
     guideHome_pla_3: "(一旦选择不可更改)",
 
-    //公共的文字
+    // 公共的文字
 
     changeToEnglish: "切换到泰文",
     changeToChinese: "切换到中文",

+ 9 - 9
language/zh.js

@@ -1,5 +1,5 @@
 export default {
-    //页面的文字
+    // 页面的文字
 
     welcom: "欢迎使用叮咚外卖平台",
     login_form_1: "手机号",
@@ -140,7 +140,7 @@ export default {
     overTips: "确定要拒单吗?",
     orderSuceess: "操作成功",
 
-    //银行卡
+    // 银行卡
     bankMainTitle: "选择银行卡",
     bindBankText1: "绑定银行卡",
     bankTitle1: "银行",
@@ -153,7 +153,7 @@ export default {
     bankPla4: "输入银行名称",
     bankTitle5: "同意《叮咚外卖快捷支付服务协议》",
     rechargeBtnText: "预计两小时内到账,确认提现",
-    //设置
+    // 设置
 
     automaticText1: "自动评价回复",
     automaticText2: "好评自动评价回复",
@@ -178,7 +178,7 @@ export default {
     ClassificationManageText4: "同一种商品可以置于不同的分类下。",
     ClassificationManageText5: "当前有的分类",
     ClassificationManageText6: "该分类包含了以下商品",
-    //公共的文字
+    // 公共的文字
 
     saveSuccess: "保存成功",
     editSuccess: "修改成功",
@@ -235,7 +235,7 @@ export default {
     rechargeTitle2: "银行卡",
     rechargeTitle3: "提现金额",
 
-    //订单状态
+    // 订单状态
     NOT_RECEIVED: "未接单",
     RECEIVED: "已接单",
     REJECTED: "退单",
@@ -249,23 +249,23 @@ export default {
     ALI_PAY: "支付宝",
     CASH_DELIVERY: "货到付款",
     CREDIT_CARD: "信用卡",
-    RECEIVED: "待取餐",
+    Re_RECEIVED: "待取餐",
     TAKE_MEAL: "已到店",
     MEAL_DELIVERY: "正在配送中",
     CARRY_OUT: "送达",
 
-    //账单状态
+    // 账单状态
     BUY: "购买",
     INCOME: "收入",
     REFUND: "退款",
     WITHDRAW: "提现",
 
-    //提现状态
+    // 提现状态
     Apply_SUCCESS: "提现成功",
     Apply_PENDING: "提现处理中",
     Apply_FAIL: "提现失败",
 
-    //myRecord
+    // myRecord
     selectTiltle1: "全部账单",
     selectTiltle2: "收入账单",
     selectTiltle3: "提现账单",

+ 8 - 3
models/barModel.js

@@ -1,12 +1,17 @@
 import { StatusBar } from "react-native";
+
 export default {
     state: {
-        background: "#FFC21C",
+        nowBackground: "#FFC21C",
     },
     actions: ({ model, setState }) => ({
         changeBackground(background) {
-            if (background != background) {
-                StatusBar.setBackgroundColor(background);
+			const {nowBackground}=model()
+            if (nowBackground !== background) {
+				StatusBar.setBackgroundColor(background);
+				setState({
+					nowBackground:background
+				})
             }
         },
     }),

+ 11 - 8
models/complaintModel.js

@@ -1,13 +1,15 @@
-//优惠券操作
+/* eslint-disable no-unused-vars */
+// 优惠券操作
 
 import * as TimeUtil from "../Utils/TimeUtil";
+
 export default {
     state: {
         defaultStartTime: TimeUtil.getDateStr(),
         defaultEndTime: TimeUtil.getAddDateStr(),
     },
     actions: ({ model, setState }) => ({
-        //获取商家投诉
+        // 获取商家投诉
         getMyList(page, size) {
             return Promise.resolve({
                 content: [1, 2, 3, 4, 5, 6, 7],
@@ -28,9 +30,9 @@ export default {
             // );
         },
         saveInfo(info) {
-            let { httpPost } = model("httpModel");
-            let { mid } = model("userModel");
-            let { success } = model("loadingModel");
+            const { httpPost } = model("httpModel");
+            const { mid } = model("userModel");
+            const { success } = model("loadingModel");
             return httpPost(
                 "/coupon/save",
                 {
@@ -45,10 +47,11 @@ export default {
             });
         },
         removeInfo(id) {
-            let { removeEvent } = model("dialogModel");
-            let { success } = model("loadingModel");
+            const { removeEvent } = model("dialogModel");
+            const { success } = model("loadingModel");
+            const { httpPost } = model("httpModel");
             removeEvent(() => {
-                httpPost("/coupon/del/" + id, {}, true).then(res => {
+                httpPost(`/coupon/del/${  id}`, {}, true).then(res => {
                     success("删除成功");
                     return Promise.resolve(res);
                 });

+ 11 - 8
models/couponModel.js

@@ -1,13 +1,15 @@
-//优惠券操作
+/* eslint-disable no-unused-vars */
+// 优惠券操作
 
 import * as TimeUtil from "../Utils/TimeUtil";
+
 export default {
     state: {
         defaultStartTime: TimeUtil.getDateStr(),
         defaultEndTime: TimeUtil.getAddDateStr(),
     },
     actions: ({ model, setState }) => ({
-        //获取商家优惠券
+        // 获取商家优惠券
         getMyList(page, size) {
             const { mid } = model("userModel");
             const { httpGet } = model("httpModel");
@@ -24,9 +26,9 @@ export default {
             );
         },
         saveInfo(info) {
-            let { httpPost } = model("httpModel");
-            let { mid } = model("userModel");
-            let { success } = model("loadingModel");
+            const { httpPost } = model("httpModel");
+            const { mid } = model("userModel");
+            const { success } = model("loadingModel");
             return httpPost(
                 "/coupon/save",
                 {
@@ -41,10 +43,11 @@ export default {
             });
         },
         removeInfo(id) {
-            let { removeEvent } = model("dialogModel");
-            let { success } = model("loadingModel");
+            const { removeEvent } = model("dialogModel");
+            const { success } = model("loadingModel");
+            const { httpPost } = model("httpModel");
             removeEvent(() => {
-                httpPost("/coupon/del/" + id, {}, true).then(res => {
+                httpPost(`/coupon/del/${  id}`, {}, true).then(res => {
                     success("删除成功");
                     return Promise.resolve(res);
                 });

+ 3 - 3
models/dialogModel.js

@@ -1,4 +1,4 @@
-import { i18n, keys } from "../language";
+
 export default {
     state: {
         title: "",
@@ -30,14 +30,14 @@ export default {
         hideDialog() {
             setState({ diloadShow: false });
         },
-        removeEvent(confirmCallback, tips) {
+        removeEvent(confirmCallback) {
             const { showDialog } = model();
             const { removeTips } = model("wordsModel");
             showDialog({
                 bodyText: removeTips,
                 status: "danger",
                 cancelable: true,
-                confirmCallback: confirmCallback,
+                confirmCallback,
             });
         },
     }),

+ 10 - 8
models/emailModel.js

@@ -1,8 +1,9 @@
-//优惠券操作
+/* eslint-disable no-unused-vars */
+// 优惠券操作
 export default {
     state: {},
     actions: ({ model, setState }) => ({
-        //获取商家投诉
+        // 获取商家投诉
         getMyList(page, size) {
             return Promise.resolve({
                 content: [1, 2, 3, 4, 5, 6, 7],
@@ -23,9 +24,9 @@ export default {
             // );
         },
         saveInfo(info) {
-            let { httpPost } = model("httpModel");
-            let { mid } = model("userModel");
-            let { success } = model("loadingModel");
+            const { httpPost } = model("httpModel");
+            const { mid } = model("userModel");
+            const { success } = model("loadingModel");
             return httpPost(
                 "/coupon/save",
                 {
@@ -40,10 +41,11 @@ export default {
             });
         },
         removeInfo(id) {
-            let { removeEvent } = model("dialogModel");
-            let { success } = model("loadingModel");
+            const { removeEvent } = model("dialogModel");
+			const { success } = model("loadingModel");
+			const {httpPost} =model('httpModel')
             removeEvent(() => {
-                httpPost("/coupon/del/" + id, {}, true).then(res => {
+                httpPost(`/coupon/del/${  id}`, {}, true).then(res => {
                     success("删除成功");
                     return Promise.resolve(res);
                 });

+ 40 - 39
models/goodsModel.js

@@ -1,21 +1,22 @@
 import ListUtil from "../Utils/ListUtil";
+
 export default {
     state: {
         selectInfos: [],
-        Classifications: [], //商户分类列表
-        classificationId: 0, //当前操作的商品分类
+        Classifications: [], // 商户分类列表
+        classificationId: 0, // 当前操作的商品分类
     },
     actions: ({ model, setState }) => ({
-        //商家分类选择商品
+        // 商家分类选择商品
         changeSelect(list) {
             setState({
                 selectInfos: list,
             });
         },
-        //下架提示
+        // 下架提示
         takeOffInfo(callBack) {
-            let { showDialog } = model("dialogModel");
-            let { takeOffTips } = model("wordsModel");
+            const { showDialog } = model("dialogModel");
+            const { takeOffTips } = model("wordsModel");
             showDialog({
                 bodyText: takeOffTips,
                 status: "danger",
@@ -23,12 +24,12 @@ export default {
                 confirmCallback: () => callBack(),
             });
         },
-        //商品上下架
+        // 商品上下架
         ChangeTakeOff(info) {
-            let { id, takeOff } = info;
-            let { getWordsStr, successText } = model("wordsModel");
-            let { httpGet } = model("httpModel");
-            let { success } = model("loadingModel");
+            const { id } = info;
+            const { getWordsStr, successText } = model("wordsModel");
+            const { httpGet } = model("httpModel");
+            const { success } = model("loadingModel");
 
             return httpGet(
                 "/goods/take",
@@ -38,7 +39,7 @@ export default {
                 true
             )
                 .then(() => {
-                    return httpGet("/goods/get/" + id, {}, true);
+                    return httpGet(`/goods/get/${  id}`, {}, true);
                 })
                 .then(res => {
                     success(
@@ -48,10 +49,10 @@ export default {
                     return Promise.resolve(res);
                 });
         },
-        //关闭分类提示
+        // 关闭分类提示
         clossClassTip(callBack) {
-            let { showDialog } = model("dialogModel");
-            let { systemClassTips1 } = model("wordsModel");
+            const { showDialog } = model("dialogModel");
+            const { systemClassTips1 } = model("wordsModel");
             showDialog({
                 bodyText: systemClassTips1,
                 status: "danger",
@@ -60,9 +61,9 @@ export default {
             });
         },
         saveInfo(info, noTip) {
-            let { saveSuccess, editSuccess } = model("wordsModel");
-            let { httpPost } = model("httpModel");
-            let { success } = model("loadingModel");
+            const { saveSuccess, editSuccess } = model("wordsModel");
+            const { httpPost } = model("httpModel");
+            const { success } = model("loadingModel");
             return httpPost(
                 "/classification/save",
                 info,
@@ -75,12 +76,12 @@ export default {
                 return Promise.resolve(res);
             });
         },
-        //移除分类商品
+        // 移除分类商品
         removeClassGoods(classificationId, goodId, callBack) {
-            let { showDialog } = model("dialogModel");
-            let { removeTips, editSuccess } = model("wordsModel");
-            let { httpGet } = model("httpModel");
-            let { success } = model("loadingModel");
+            const { showDialog } = model("dialogModel");
+            const { removeTips, editSuccess } = model("wordsModel");
+            const { httpGet } = model("httpModel");
+            const { success } = model("loadingModel");
             showDialog({
                 bodyText: removeTips,
                 status: "danger",
@@ -89,8 +90,8 @@ export default {
                     httpGet(
                         "/classification/delGoods",
                         {
-                            classificationId: classificationId,
-                            goodId: goodId,
+                            classificationId,
+                            goodId,
                         },
                         true
                     ).then(res => {
@@ -102,9 +103,9 @@ export default {
         },
         // 添加分类商品
         addClassGoods(info) {
-            let { successText } = model("wordsModel");
-            let { success } = model("loadingModel");
-            let { httpPost } = model("httpModel");
+            const { successText } = model("wordsModel");
+            const { success } = model("loadingModel");
+            const { httpPost } = model("httpModel");
             return httpPost(
                 "/goodsSpecification/save",
                 info,
@@ -117,18 +118,18 @@ export default {
                 return Promise.resolve(res);
             });
         },
-        //移除商品分类
+        // 移除商品分类
         removeCLass(info, callBack) {
-            let { showDialog } = model("dialogModel");
-            let { removeTips, editSuccess } = model("wordsModel");
-            let { httpPost } = model("httpModel");
-            let { success } = model("loadingModel");
+            const { showDialog } = model("dialogModel");
+            const { removeTips, editSuccess } = model("wordsModel");
+            const { httpPost } = model("httpModel");
+            const { success } = model("loadingModel");
             showDialog({
                 bodyText: removeTips,
                 status: "danger",
                 cancelable: true,
                 confirmCallback: () => {
-                    let goods = new ListUtil(info.goodsIds);
+                    const goods = new ListUtil(info.goodsIds);
                     if (goods.length > 0) {
                         showDialog({
                             bodyText: "该分类下有商品,暂不可删除该商品分类",
@@ -136,7 +137,7 @@ export default {
                         });
                     } else {
                         httpPost(
-                            "/classification/del/" + info.id,
+                            `/classification/del/${  info.id}`,
                             {},
                             {},
                             true
@@ -151,7 +152,7 @@ export default {
 
         // 商品分类添加商品
         addClassification(selectId, goodsId) {
-            let { httpGet } = model("httpModel");
+            const { httpGet } = model("httpModel");
             return httpGet(
                 "/classification/saveGoods",
                 {
@@ -161,15 +162,15 @@ export default {
                 { body: "json" }
             );
         },
-        //将当前选中的classId存入以便更好的刷新页面3
+        // 将当前选中的classId存入以便更好的刷新页面3
         setClassificationId(id) {
             setState({
                 classificationId: id,
             });
         },
-        //获取我的全部商品分类
+        // 获取我的全部商品分类
         getMyClassification() {
-            let { httpGet } = model("httpModel");
+            const { httpGet } = model("httpModel");
             return httpGet("/classification/my", {}, true).then(res => {
                 res = res.sort((a, b) => {
                     return b.type || 0 - a.type || 0;

+ 6 - 7
models/httpModel.js

@@ -1,6 +1,8 @@
+/* eslint-disable no-async-promise-executor */
 import axios from "axios";
 import qs from "qs";
 import { AsyncStorage } from "react-native";
+
 export default {
     state: {
         baseUrl: "http://dingdong.izouma.com",
@@ -35,9 +37,9 @@ export default {
         async setConfig(config) {
             setState({ httpLoading: true });
             config.headers = config.headers || {};
-            let token = await AsyncStorage.getItem("token");
+            const token = await AsyncStorage.getItem("token");
             if (token) {
-                config.headers["Authorization"] = "Bearer " + token;
+                config.headers.Authorization = `Bearer ${token}`;
             }
             return config;
         },
@@ -63,7 +65,7 @@ export default {
             return new Promise((resolve, reject) => {
                 getAxiosInstance()
                     .get(url, {
-                        params: params,
+                        params,
                     })
                     .then(res => {
                         resolve(res.data);
@@ -101,7 +103,6 @@ export default {
             });
         },
         addAsyncStorage(key, value) {
-            console.log(key, value);
             return new Promise(async (resolve, reject) => {
                 try {
                     await AsyncStorage.setItem(key, value);
@@ -124,9 +125,7 @@ export default {
         getAsyncStorage(key) {
             return new Promise(async (resolve, reject) => {
                 try {
-                    let val = await AsyncStorage.getItem(key);
-                    console.log(key);
-                    console.log(val);
+                    const val = await AsyncStorage.getItem(key);
                     resolve(val);
                 } catch (e) {
                     reject(e);

+ 4 - 6
models/loadingModel.js

@@ -1,7 +1,5 @@
-import React from "react";
-import { TopviewGetInstance, Icon, Tip } from "beeshell";
-import { View, Text, ActivityIndicator, StyleSheet } from "react-native";
-//加载页
+
+// 加载页
 export default {
     state: {
         status: "loading",
@@ -20,7 +18,7 @@ export default {
         success(title) {
             setState({
                 status: "success",
-                title: title,
+                title,
                 show: true,
                 time: 3000,
             });
@@ -30,7 +28,7 @@ export default {
         warnning(title) {
             setState({
                 status: "warn",
-                title: title,
+                title,
                 show: true,
                 time: 3000,
             });

+ 1 - 0
models/moenyRecordModel.js

@@ -1,3 +1,4 @@
+/* eslint-disable no-unused-vars */
 export default {
     state: {},
     actions: ({ model, setState }) => ({

+ 5 - 6
models/orderInfoModel.js

@@ -1,12 +1,11 @@
-//订单信息操作
+/* eslint-disable no-unused-vars */
+// 订单信息操作
 export default {
     state: {},
     actions: ({ model, setState }) => ({
-        //商家获取订单列表
+        // 商家获取订单列表
         getOrderList(page, size, query) {
-            const { loading, success, warnning } = model("loadingModel");
             const { httpGet } = model("httpModel");
-            const { orderSuceess } = model("wordsModel");
             return httpGet(
                 "/orderInfo/my",
                 {
@@ -18,9 +17,9 @@ export default {
             );
         },
 
-        //商家手动接单(接单,拒单)
+        // 商家手动接单(接单,拒单)
         receivedOrder(orderId, pass) {
-            const { loading, success, warnning } = model("loadingModel");
+            const {  success } = model("loadingModel");
             const { httpGet } = model("httpModel");
             const { orderSuceess } = model("wordsModel");
             return httpGet(

+ 46 - 48
models/userModel.js

@@ -1,5 +1,8 @@
-//用户状态 (商家状态,全局)
-import * as RootNavigation from "../navigation/RootNavigation.js";
+/* eslint-disable no-console */
+/* eslint-disable no-underscore-dangle */
+// 用户状态 (商家状态,全局)
+import * as RootNavigation from "../navigation/RootNavigation";
+
 export default {
     state: {
         mid: 0,
@@ -21,7 +24,7 @@ export default {
             const { updateUser } = model();
             const { httpGet } = model("httpModel");
             return httpGet("/merchant/my").then(res => {
-                let _res = { ...res };
+                const _res = { ...res };
                 if (_res) {
                     updateUser(_res);
                 }
@@ -35,21 +38,19 @@ export default {
             const { getAsyncStorage } = model("httpModel");
             return new Promise(resolve => {
                 getUserInfo()
-                    .then(async _ => {
+                    .then(async () => {
                         let guideStep = await getAsyncStorage("guideStep");
-                        if (status == "PASS") {
+                        if (status === "PASS") {
                             guideStep = "4";
                         }
                         if (guideStep) {
-                            setState({ guideStep: guideStep, isLogin: true });
+                            setState({ guideStep, isLogin: true });
                         } else {
                             setState({ isLogin: true });
                         }
-                        const { isLogin } = model();
-                        console.log(isLogin);
                         resolve();
                     })
-                    .catch(_ => {
+                    .catch(() => {
                         setState({ isLogin: false });
                         resolve();
                     });
@@ -57,12 +58,11 @@ export default {
         },
         loginByPassword(phone, password) {
             const { httpPost, addAsyncStorage } = model("httpModel");
-            const { checkLogin } = model();
-            const { loading, success, warnning } = model("loadingModel");
+            const {  success, warnning } = model("loadingModel");
 
             return httpPost("/auth/login", {
                 username: phone,
-                password: password,
+                password,
             })
                 .then(res => {
                     if (res) {
@@ -76,27 +76,26 @@ export default {
                 });
         },
         loginByCode(phone, code) {
-            loading();
-            httpPost("/auth/phoneLogin", {
-                phone: phone,
-                code: code,
-            })
-                .then(res => {
-                    if (res) {
-                        updateUser(res);
-                    }
-                })
-                .catch(e => {
-                    console.log(e);
-                });
+			console.log(phone,code);
+            // httpPost("/auth/phoneLogin", {
+            //     phone,
+            //     code,
+            // })
+            //     .then(res => {
+            //         if (res) {
+            //             updateUser(res);
+            //         }
+            //     })
+            //     .catch(e => {
+            //         console.log(e);
+            //     });
         },
         registerFirst({ ...data }) {
             setState({ registerInfo: data });
             RootNavigation.navigate("RegisterSe");
         },
         registerUser({ ...data }) {
-            const { checkLogin } = model();
-            const { loading, success } = model("loadingModel");
+            const { success } = model("loadingModel");
             const { httpPost, addAsyncStorage } = model("httpModel");
             httpPost("/auth/merchantRegister", data, {}, true).then(res => {
                 addAsyncStorage("token", res).then(() => {
@@ -117,7 +116,7 @@ export default {
         },
         registerSecend({ ...data }) {
             const { registerInfo, registerUser } = model();
-            let _registerInfo = {
+            const _registerInfo = {
                 ...registerInfo,
                 ...data,
             };
@@ -137,16 +136,15 @@ export default {
         },
         saveMerchant({ ...data }) {
             const { mid, changeGuideStep } = model();
-            const { loading, success } = model("loadingModel");
-            const { httpPost, addAsyncStorage } = model("httpModel");
+            const { httpPost } = model("httpModel");
             httpPost(
                 "/merchant/saveDTO",
                 {
                     ...data,
-                    mid: mid,
+                    mid,
                 },
                 { body: "json" }
-            ).then(res => {
+            ).then(() => {
                 changeGuideStep("5");
             });
         },
@@ -157,12 +155,12 @@ export default {
         },
         updateMerchant({ ...data }) {
             const { mid, getUserInfo } = model();
-            const { httpPost, addAsyncStorage } = model("httpModel");
+            const { httpPost } = model("httpModel");
             return httpPost(
                 "/merchant/saveDTO",
                 {
                     ...data,
-                    mid: mid,
+                    mid,
                 },
                 { body: "json" },
                 true
@@ -176,15 +174,15 @@ export default {
         uploadStoreImg(img, type) {
             const { updateMerchant, mid, registerInfo } = model();
             if (mid !== 0) {
-                if (type == "banner") {
+                if (type === "banner") {
                     return updateMerchant({ banner: img });
-                } else if (type == "qualification") {
+                } if (type === "qualification") {
                     return updateMerchant({ qualification: img });
-                } else {
+                } 
                     return updateMerchant({ logo: img });
-                }
-            } else if (type == "qualification") {
-                let _registerInfo = { ...registerInfo };
+                
+            } if (type === "qualification") {
+                const _registerInfo = { ...registerInfo };
                 _registerInfo.qualification = img;
                 console.log(_registerInfo);
                 setState({
@@ -192,7 +190,8 @@ export default {
                 });
 
                 return Promise.resolve();
-            }
+			}
+			return Promise.reject();
         },
         userLogout() {
             const { removeAsyncStorage } = model("httpModel");
@@ -218,16 +217,16 @@ export default {
             const { getAsyncStorage } = model("httpModel");
 
             return new Promise(resolve => {
-                if (mid == 0) {
+                if (mid === 0) {
                     resolve("");
                 } else {
                     getAsyncStorage("guideStep").then(res => {
                         console.log(res);
                         let guideStep = res;
-                        if (status == "PASS" && !guideStep) {
+                        if (status === "PASS" && !guideStep) {
                             guideStep = "5";
                         }
-                        setState({ guideStep: guideStep, isLogin: true });
+                        setState({ guideStep, isLogin: true });
                         resolve(guideStep || "1");
                     });
                 }
@@ -237,22 +236,21 @@ export default {
             const { isOpening, getUserInfo } = model();
             const { httpGet } = model("httpModel");
             const { success } = model("loadingModel");
-            let { showDialog } = model("dialogModel");
-            let { removeTips, editSuccess } = model("wordsModel");
+            const { showDialog } = model("dialogModel");
             if (isOpening) {
                 showDialog({
                     bodyText: "停止当前营业,直到下次营业开启",
                     status: "danger",
                     cancelable: true,
                     confirmCallback: () => {
-                        httpGet("/merchant/closeMer", {}, true).then(res => {
+                        httpGet("/merchant/closeMer", {}, true).then(() => {
                             success("操作成功");
                             getUserInfo();
                         });
                     },
                 });
             } else {
-                httpGet("/merchant/closeMer", {}, true).then(res => {
+                httpGet("/merchant/closeMer", {}, true).then(() => {
                     success("操作成功");
                     getUserInfo();
                 });

+ 10 - 9
models/wordsModel.js

@@ -1,10 +1,11 @@
 import { i18n, keys } from "../language";
+
 export default {
     state: {},
     actions: ({ model, setState }) => ({
         getWords() {
-            console.log("aaaa");
-            var words = {};
+			
+            const words = {};
             keys.forEach(item => {
                 words[item] = i18n.t(item);
             });
@@ -27,16 +28,16 @@ export default {
             } = model();
 
             return {
-                MONDAY: MONDAY,
-                TUESDAY: TUESDAY,
-                WEDNESDAY: WEDNESDAY,
-                THURSDAY: THURSDAY,
-                FRIDAY: FRIDAY,
-                SATURDAY: SATURDAY,
+                MONDAY,
+                TUESDAY,
+                WEDNESDAY,
+                THURSDAY,
+                FRIDAY,
+                SATURDAY,
                 SUNDAY,
                 all: every,
             };
         },
     }),
 };
-//国际化
+// 国际化

+ 18 - 19
navigation/BasicNavigator.js

@@ -1,5 +1,4 @@
 import * as React from "react";
-import { useModel } from "flooks";
 
 import Guide1Screen from "../screens/Guide1Screen";
 import EditBanner from "../screens/EditBannerScreen";
@@ -16,28 +15,28 @@ import Goods from "../screens/Goods";
 
 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} />
-            <Screen name='Money' component={MoneyListScreen} />
+      <>
+        <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} />
+        <Screen name='Money' component={MoneyListScreen} />
 
-            {Bank(Screen)}
+        {Bank(Screen)}
 
-            {SetEvent(Screen)}
+        {SetEvent(Screen)}
 
-            {Coupon(Screen)}
+        {Coupon(Screen)}
 
-            {Appraisal(Screen)}
+        {Appraisal(Screen)}
 
-            {Goods(Screen)}
-        </>
+        {Goods(Screen)}
+      </>
     );
 }

+ 53 - 54
navigation/BottomTabNavigator.js

@@ -1,82 +1,81 @@
-import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
+
 import * as React from "react";
-import { useTheme, Text } from "@ui-kitten/components";
+import { Text } from "@ui-kitten/components";
+import { useModel } from "flooks";
+import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
 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 BottomTab = createBottomTabNavigator();
 
-export default function BottomTabNavigator({ navigation, route }) {
-    const theme = useTheme();
+export default function BottomTabNavigator() {
     const { tab1, tab2, tab3 } = useModel("wordsModel");
     return (
-        <BottomTab.Navigator
-            headerMode='none'
-            initialRouteName='Home'
-            removeClippedSubviews={true}
-            lazy={true}
-            backBehavior='initialRoute'
-            unmountOnBlur={true}
-        >
-            <BottomTab.Screen
-                tabBarTestID='home'
-                name='Home'
-                component={HomeScreen}
-                options={{
+      <BottomTab.Navigator
+        headerMode='none'
+        initialRouteName='Home'
+        removeClippedSubviews
+        lazy
+        backBehavior='initialRoute'
+        unmountOnBlur
+      >
+        <BottomTab.Screen
+          tabBarTestID='home'
+          name='Home'
+          component={HomeScreen}
+          options={{
                     tabBarLabel: ({ focused }) => (
-                        <Text
-                            category='c1'
-                            status={focused ? "primary" : "info"}
-                        >
-                            {tab1}
-                        </Text>
+                      <Text
+                        category='c1'
+                        status={focused ? "primary" : "info"}
+                      >
+                        {tab1}
+                      </Text>
                     ),
                     tabBarIcon: ({ focused }) => (
-                        <TabBarIcon focused={focused} name='home' />
+                      <TabBarIcon focused={focused} name='home' />
                     ),
                 }}
-            />
-            <BottomTab.Screen
-                tabBarTestID='order'
-                name='Order'
-                component={OrderScreen}
-                options={{
+        />
+        <BottomTab.Screen
+          tabBarTestID='order'
+          name='Order'
+          component={OrderScreen}
+          options={{
                     tabBarLabel: ({ focused }) => (
-                        <Text
-                            category='c1'
-                            status={focused ? "primary" : "info"}
-                        >
-                            {tab2}
-                        </Text>
+                      <Text
+                        category='c1'
+                        status={focused ? "primary" : "info"}
+                      >
+                        {tab2}
+                      </Text>
                     ),
                     tabBarIcon: ({ focused }) => (
-                        <TabBarIcon focused={focused} name='file-text' />
+                      <TabBarIcon focused={focused} name='file-text' />
                     ),
                 }}
-            />
+        />
 
-            <BottomTab.Screen
-                tabBarTestID='user'
-                name='User'
-                component={UserScreen}
-                options={{
+        <BottomTab.Screen
+          tabBarTestID='user'
+          name='User'
+          component={UserScreen}
+          options={{
                     tabBarLabel: ({ focused }) => (
-                        <Text
-                            category='c1'
-                            status={focused ? "primary" : "info"}
-                        >
-                            {tab3}
-                        </Text>
+                      <Text
+                        category='c1'
+                        status={focused ? "primary" : "info"}
+                      >
+                        {tab3}
+                      </Text>
                     ),
                     tabBarIcon: ({ focused }) => (
-                        <TabBarIcon focused={focused} name='person' />
+                      <TabBarIcon focused={focused} name='person' />
                     ),
                 }}
-            />
-        </BottomTab.Navigator>
+        />
+      </BottomTab.Navigator>
     );
 }

+ 38 - 53
navigation/GuideStackNavigator.js

@@ -1,7 +1,4 @@
-import {
-    createStackNavigator,
-    CardStyleInterpolators,
-} from "@react-navigation/stack";
+
 import * as React from "react";
 
 import Guide1Screen from "../screens/Guide1Screen";
@@ -10,70 +7,58 @@ import Guide3Screen from "../screens/Guide3Screen";
 import Guide4Screen from "../screens/Guide4Screen";
 import StoreAudit from "../screens/StoreAudit";
 
-const config = {
-    animation: "spring",
-    config: {
-        stiffness: 1000,
-        damping: 500,
-        mass: 3,
-        overshootClamping: true,
-        restDisplacementThreshold: 0.01,
-        restSpeedThreshold: 0.01,
-    },
-};
 export default function GuideScreens(Screen, guideStep) {
-    console.log(guideStep);
-    if (guideStep == "1") {
+    if (guideStep === "1") {
         return (
-            <Screen
-                name='Guide1'
-                component={Guide1Screen}
-                options={{
-                    animationTypeForReplace: guideStep == "1" ? "pop" : "push",
+          <Screen
+            name='Guide1'
+            component={Guide1Screen}
+            options={{
+                    animationTypeForReplace: guideStep === "1" ? "pop" : "push",
                 }}
-            />
+          />
         );
-    } else if (guideStep == "2") {
+    } if (guideStep === "2") {
         return (
-            <Screen
-                name='Guide2'
-                component={Guide2Screen}
-                options={{
-                    animationTypeForReplace: guideStep == "2" ? "pop" : "push",
+          <Screen
+            name='Guide2'
+            component={Guide2Screen}
+            options={{
+                    animationTypeForReplace: guideStep === "2" ? "pop" : "push",
                 }}
-            />
+          />
         );
-    } else if (guideStep == "3") {
+    } if (guideStep === "3") {
         return (
-            <Screen
-                name='Guide3'
-                component={Guide3Screen}
-                options={{
-                    animationTypeForReplace: guideStep == "3" ? "pop" : "push",
+          <Screen
+            name='Guide3'
+            component={Guide3Screen}
+            options={{
+                    animationTypeForReplace: guideStep === "3" ? "pop" : "push",
                 }}
-            />
+          />
         );
-    } else if (guideStep == "4") {
+    } if (guideStep === "4") {
         return (
-            <Screen
-                name='Guide4'
-                component={Guide4Screen}
-                options={{
-                    animationTypeForReplace: guideStep == "4" ? "pop" : "push",
+          <Screen
+            name='Guide4'
+            component={Guide4Screen}
+            options={{
+                    animationTypeForReplace: guideStep === "4" ? "pop" : "push",
                 }}
-            />
+          />
         );
-    } else if (guideStep == "5") {
+    } if (guideStep === "5") {
         return (
-            <Screen
-                name='StoreAudit'
-                component={StoreAudit}
-                options={{
-                    animationTypeForReplace: guideStep == "5" ? "pop" : "push",
+          <Screen
+            name='StoreAudit'
+            component={StoreAudit}
+            options={{
+                    animationTypeForReplace: guideStep === "5" ? "pop" : "push",
                 }}
-            />
+          />
         );
-    } else {
+    } 
         return <></>;
-    }
+    
 }

+ 0 - 54
navigation/LoadingModel.js

@@ -1,54 +0,0 @@
-import * as React from "react";
-import { useModel } from "flooks";
-import {
-    Image,
-    Platform,
-    StyleSheet,
-    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 { 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("RechargeDetail", {
-            //     id: 444,
-            // });
-            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>;
-}

+ 11 - 23
navigation/LoginStackNavigator.js

@@ -3,39 +3,27 @@ import {
     CardStyleInterpolators,
 } from "@react-navigation/stack";
 import * as React from "react";
-import { useModel } from "flooks";
 
 import LoginScreen from "../screens/LoginScreen";
 import RegisterScreen from "../screens/RegisterScreen";
 import RegisterSeScreen from "../screens/RegisterSeScreen";
-import { useFocusEffect } from "@react-navigation/native";
+
 const LoginStack = createStackNavigator();
 
-const config = {
-    animation: "spring",
-    config: {
-        stiffness: 1000,
-        damping: 500,
-        mass: 3,
-        overshootClamping: true,
-        restDisplacementThreshold: 0.01,
-        restSpeedThreshold: 0.01,
-    },
-};
 
-export default function LoginStackNavigator({ navigation, route }) {
+export default function LoginStackNavigator() {
     return (
-        <LoginStack.Navigator
-            headerMode='none'
-            screenOptions={{
+      <LoginStack.Navigator
+        headerMode='none'
+        screenOptions={{
                 gestureEnabled: true,
                 cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS,
             }}
-            initialRouteName='Login'
-        >
-            <LoginStack.Screen name='Login' component={LoginScreen} />
-            <LoginStack.Screen name='Register' component={RegisterScreen} />
-            <LoginStack.Screen name='RegisterSe' component={RegisterSeScreen} />
-        </LoginStack.Navigator>
+        initialRouteName='Login'
+      >
+        <LoginStack.Screen name='Login' component={LoginScreen} />
+        <LoginStack.Screen name='Register' component={RegisterScreen} />
+        <LoginStack.Screen name='RegisterSe' component={RegisterSeScreen} />
+      </LoginStack.Navigator>
     );
 }

+ 5 - 4
navigation/RootNavigation.js

@@ -1,7 +1,8 @@
+/* eslint-disable no-unused-expressions */
 // RootNavigation.js
-import { StackActions } from "@react-navigation/native";
 import * as React from "react";
-import { CommonActions } from "@react-navigation/native";
+import { CommonActions,StackActions } from "@react-navigation/native";
+
 export const navigationRef = React.createRef();
 
 export function navigate(name, params) {
@@ -23,8 +24,8 @@ export function reset(name, params) {
             key: null,
             routes: [
                 {
-                    name: name,
-                    params: params,
+                    name,
+                    params,
                 },
             ],
         })

+ 41 - 43
navigation/TopTabNavigator.js

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

文件差异内容过多而无法显示
+ 784 - 0
package-lock.json


+ 14 - 0
package.json

@@ -41,6 +41,7 @@
     "flooks": "^1.2.0",
     "i18n-js": "^3.5.1",
     "moment": "^2.25.3",
+    "qs": "^6.9.4",
     "react": "16.9.0",
     "react-dom": "16.9.0",
     "react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
@@ -62,9 +63,22 @@
     "@babel/core": "^7.10.0",
     "@babel/preset-env": "^7.9.6",
     "@expo/webpack-config": "^0.11.25",
+    "@typescript-eslint/eslint-plugin": "^3.0.2",
+    "@typescript-eslint/parser": "^3.0.2",
+    "babel-eslint": "^10.1.0",
     "babel-loader": "^8.1.0",
     "babel-plugin-import": "^1.13.0",
     "babel-preset-expo": "^8.1.0",
+    "eslint": "^6.8.0",
+    "eslint-config-airbnb": "^18.1.0",
+    "eslint-config-prettier": "^6.11.0",
+    "eslint-plugin-flowtype": "^5.1.3",
+    "eslint-plugin-import": "^2.20.2",
+    "eslint-plugin-jsx-a11y": "^6.2.3",
+    "eslint-plugin-prettier": "^3.1.3",
+    "eslint-plugin-react": "^7.20.0",
+    "eslint-plugin-react-hooks": "^2.5.1",
+    "eslint-plugin-react-native": "^3.8.1",
     "jest-expo": "^37.0.0",
     "prettier": "^2.0.5",
     "react-native-svg": "11.0.1"

+ 201 - 209
screens/AddGoodsClassification.js

@@ -1,43 +1,91 @@
+/* eslint-disable no-underscore-dangle */
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
-import scrollPage from "../components/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 ActionButton from "react-native-action-button";
+import { useModel } from "flooks";
+import ScrollPage from "../components/ScrollPage";
 import NavHeaderBar from "../components/NavHeaderBar";
 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) => (
-    <Text {...props} category='s1'>
-        {title}
-    </Text>
+  <Text {...props} category='s1'>
+    {title}
+  </Text>
 );
 
-export default function AddGoodsClassification({ navigation, route }) {
+const styles = StyleSheet.create({
+    flex1: {
+        backgroundColor: "rgba(0,0,0,0)",
+        paddingHorizontal: 15,
+        paddingBottom: 20,
+    },
+    list: {
+        backgroundColor: "rgba(0,0,0,0)",
+    },
+    container: {
+        backgroundColor: "#EEEEEE",
+        paddingTop: 20,
+    },
+    tabContent: {
+        backgroundColor: "#fff",
+        marginTop: 20,
+    },
+    img: {
+        width: 100,
+        height: 100,
+        alignSelf: "center",
+    },
+    img2: {
+        width: 97,
+        height: 21,
+        alignSelf: "center",
+        marginTop: 2,
+    },
+    text: {
+        marginTop: 16,
+    },
+    layoutLeft: {
+        // flexDirection: "row",
+        paddingVertical: 10,
+        justifyContent: "center",
+        alignItems: "center",
+    },
+    form: {
+        paddingHorizontal: 26,
+        paddingVertical: 20,
+    },
+    textareaContainer: {
+        backgroundColor: "#F0F0F0",
+        height: 100,
+        borderRadius: 4,
+    },
+    textarea: {
+        textAlignVertical: "top", // hack android
+        fontSize: 13,
+        color: "#333",
+        paddingHorizontal: 14,
+        paddingVertical: 10,
+        height: 100,
+    },
+});
+
+
+export default function AddGoodsClassification({  route }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
     const { httpGet, httpPost } = useModel("httpModel", true);
-    const { registerSecend, guideStep } = useModel("userModel", true);
     const { success } = useModel("loadingModel", true);
 
     const {
@@ -52,61 +100,20 @@ export default function AddGoodsClassification({ navigation, route }) {
     } = useModel("wordsModel");
     const { showDialog } = useModel("dialogModel", true);
     const { selectInfos, changeSelect } = useModel("goodsModel");
-    const [categoryList, changeCategoryList] = 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(
-        React.useCallback(() => {
-            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");
-            }
+	const [pageType, changeType] = React.useState("signboard");
 
-            getAllGoods();
-        }, [])
-    );
 
-    React.useEffect(() => {
-        if (selectId && selectId != "new") {
-            getSelectGoods();
-        } else if (selectId == "new") {
-            setGoodsClass(selectInfos);
-        }
-    }, [selectId]);
-    function getSelectGoods() {
-        httpGet("/classification/allGoods", {
-            classificationId: selectId,
-        }).then(res => {
-            let list = res || [];
-            list = list.filter(item => {
-                return item != null;
-            });
-            setGoodsClass(list);
-        });
-    }
-    function getAllGoods() {
-        httpGet("/goods/my").then(res => {
-            changeGoods(res);
-        });
-    }
-
-    const topGoods = React.useMemo(() => {
-        if (pageType == "signboard") {
+	const topGoods = React.useMemo(() => {
+        if (pageType === "signboard") {
             return goods.filter(item => {
                 return item.signboard;
             });
-        } else {
+        } 
             return [...goodsClass];
-        }
+        
     }, [goods, goodsClass]);
 
     const elseGoods = React.useMemo(() => {
@@ -114,60 +121,38 @@ export default function AddGoodsClassification({ navigation, route }) {
             return goods.filter(item => {
                 return !item.signboard;
             });
-        } else {
-            let _topIds = topGoods.map(item => {
+        } 
+            const _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 [sort, changeSort] = React.useState("");
-    const [goodsIds, changeGoodsIds] = React.useState("");
-
-    const canNext = React.useMemo(() => {
-        return true;
-    }, [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") {
+	
+	function getSelectGoods() {
+        httpGet("/classification/allGoods", {
+            classificationId: selectId,
+        }).then(res => {
+            let list = res || [];
+            list = list.filter(item => {
+                return item != null;
+            });
+            setGoodsClass(list);
+        });
+	}
+	
+	function getAllGoods() {
+        httpGet("/goods/my").then(res => {
+            changeGoods(res);
+        });
+	}
+	
+	function changeSignboard(id, signboard, tips, info) {
+        if (pageType === "signboard") {
             httpPost(
                 "/goods/save",
                 {
@@ -177,23 +162,23 @@ export default function AddGoodsClassification({ navigation, route }) {
                 { body: "json" }
             ).then(res => {
                 success(tips + successText);
-                let _goods = goods.map(item => {
-                    if (item.id != id) {
+                const _goods = goods.map(item => {
+                    if (item.id !== id) {
                         return item;
-                    } else {
+                    } 
                         return res;
-                    }
+                    
                 });
                 changeGoods(_goods);
             });
-        } else if (pageType == "classification" && selectId == "new") {
-            let _goodsClass = [...goodsClass];
+        } else if (pageType === "classification" && selectId === "new") {
+            const _goodsClass = [...goodsClass];
             if (signboard) {
                 _goodsClass.push(info);
             } else {
                 _goodsClass.splice(
                     _goodsClass.findIndex(item => {
-                        return item.id == id;
+                        return item.id === id;
                     }),
                     1
                 );
@@ -201,9 +186,8 @@ export default function AddGoodsClassification({ navigation, route }) {
             success(tips + successText);
             setGoodsClass(_goodsClass);
             changeSelect(_goodsClass);
-        } else {
-            if (signboard) {
-                let ids = topGoods.map(item => {
+        } else if (signboard) {
+                const ids = topGoods.map(item => {
                     return item.id;
                 });
                 ids.push(id);
@@ -214,7 +198,7 @@ export default function AddGoodsClassification({ navigation, route }) {
                         string: ids.join(","),
                     },
                     { body: "json" }
-                ).then(res => {
+                ).then(() => {
                     success(tips + successText);
                     getSelectGoods();
                 });
@@ -226,50 +210,113 @@ export default function AddGoodsClassification({ navigation, route }) {
                         goodId: id,
                     },
                     { body: "json" }
-                ).then(res => {
+                ).then(() => {
                     success(tips + successText);
                     getSelectGoods();
                 });
             }
-        }
     }
 
+
+
+    useFocusEffect(
+        React.useCallback(() => {
+            changeBackground(theme["color-primary-500"]);
+            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();
+        } else if (selectId === "new") {
+            setGoodsClass(selectInfos);
+        }
+    }, [selectId]);
+
+   
+
+  
+    const chooseGoodsItem = ({ item }) => (
+      <GoodsCard
+        info={item}
+        key={item.id}
+        isAdd
+        removeEvent={() => {
+                showDialog({
+                    bodyText: removeTips,
+                    status: "danger",
+                    cancelable: true,
+                    confirmCallback: () => {
+                        changeSignboard(item.id, false, remove, item);
+                    },
+                });
+            }}
+      />
+    );
+    const goodsItem = ({ item }) => (
+      <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,
+                    });
+                }
+            }}
+      />
+    );
+
+   
     return (
-        <>
-            <NavHeaderBar title={goodsClassificationTitle1} />
-            <ScrollPage>
-                <Layout style={styles.container}>
-                    <Card
-                        appearance='headerList'
-                        header={props => {
+      <>
+        <NavHeaderBar title={goodsClassificationTitle1} />
+        <ScrollPage>
+          <Layout style={styles.container}>
+            <Card
+              appearance='headerList'
+              header={props => {
                             return Header(props, goodsClassificationTitle2);
                         }}
-                        disabled={true}
-                    >
-                        <List
-                            data={topGoods}
-                            style={styles.list}
-                            renderItem={chooseGoodsItem}
-                            ListEmptyComponent={EmptyComponent}
-                        />
-                    </Card>
+              disabled
+            >
+              <List
+                data={topGoods}
+                style={styles.list}
+                renderItem={chooseGoodsItem}
+                ListEmptyComponent={EmptyComponent}
+              />
+            </Card>
 
-                    <Card
-                        appearance='headerList'
-                        header={props => {
+            <Card
+              appearance='headerList'
+              header={props => {
                             return Header(props, goodsClassificationTitle3);
                         }}
-                        disabled={true}
-                    >
-                        <List
-                            data={elseGoods}
-                            style={styles.list}
-                            renderItem={goodsItem}
-                            ListEmptyComponent={EmptyComponent}
-                        />
-                    </Card>
-                </Layout>
-                {/* <ActionButton
+              disabled
+            >
+              <List
+                data={elseGoods}
+                style={styles.list}
+                renderItem={goodsItem}
+                ListEmptyComponent={EmptyComponent}
+              />
+            </Card>
+          </Layout>
+          {/* <ActionButton
                     style={{ zIndex: 2 }}
                     buttonColor={theme["color-primary-500"]}
                     onPress={() => {
@@ -284,63 +331,8 @@ export default function AddGoodsClassification({ navigation, route }) {
                     }}
                     position='center'
                 /> */}
-            </ScrollPage>
-        </>
+        </ScrollPage>
+      </>
     );
 }
 
-const styles = StyleSheet.create({
-    flex1: {
-        backgroundColor: "rgba(0,0,0,0)",
-        paddingHorizontal: 15,
-        paddingBottom: 20,
-    },
-    list: {
-        backgroundColor: "rgba(0,0,0,0)",
-    },
-    container: {
-        backgroundColor: "#EEEEEE",
-        paddingTop: 20,
-    },
-    tabContent: {
-        backgroundColor: "#fff",
-        marginTop: 20,
-    },
-    img: {
-        width: 100,
-        height: 100,
-        alignSelf: "center",
-    },
-    img2: {
-        width: 97,
-        height: 21,
-        alignSelf: "center",
-        marginTop: 2,
-    },
-    text: {
-        marginTop: 16,
-    },
-    layoutLeft: {
-        // flexDirection: "row",
-        paddingVertical: 10,
-        justifyContent: "center",
-        alignItems: "center",
-    },
-    form: {
-        paddingHorizontal: 26,
-        paddingVertical: 20,
-    },
-    textareaContainer: {
-        backgroundColor: "#F0F0F0",
-        height: 100,
-        borderRadius: 4,
-    },
-    textarea: {
-        textAlignVertical: "top", // hack android
-        fontSize: 13,
-        color: "#333",
-        paddingHorizontal: 14,
-        paddingVertical: 10,
-        height: 100,
-    },
-});

+ 32 - 66
screens/Appraisal/ComplaintlistScreen.js

@@ -1,56 +1,39 @@
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
+import { useModel } from "flooks";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
-import { useModel } from "flooks";
-import {
-    Layout,
-    Tab,
-    TabView,
-    Text,
-    useTheme,
-    Button,
-    Card,
-    List,
-    Select,
-    SelectItem,
-    IndexPath,
-    Avatar,
-    Divider,
-} from "@ui-kitten/components";
+import { useTheme } from "@ui-kitten/components";
 import { useFocusEffect } from "@react-navigation/native";
-import ScrollPage from "../../components/ScrollPage";
 import NavHeaderBar from "../../components/NavHeaderBar";
 import Complaint from "../../components/Complaint";
 
 import ListComponent from "../../components/ListComponent";
 
-// 余额
-const data = ["2020-03", "2020-04", "2020-05"];
-const ItemSeparatorComponent = props => <Divider />;
+const styles = StyleSheet.create({
+    top: {
+        alignItems: "center",
+        paddingVertical: 10,
+        marginBottom: 10,
+    },
+    list: {
+        flex: 1,
+        backgroundColor: "rgb(242, 242, 242)",
+        paddingHorizontal: 15,
+        paddingTop: 20,
+    },
+    separatorStyle: {
+        marginHorizontal: 13,
+    },
+});
 
-export default function CouponListScreen({ navigation, route }) {
+// 余额
+export default function CouponListScreen() {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-    const { getUserInfo, money } = useModel("appUserModel");
-    const { httpPost, httpGet } = useModel("httpModel", true);
-    const [selectedIndex, setSelectedIndex] = React.useState(
-        new IndexPath(data.length - 1)
-    );
 
-    const {
-        userTitle6,
-        storeAudioText1,
-        storeAudioText2,
-        storeAudioText3,
-        storeAudioText4,
-        complete,
-    } = useModel("wordsModel");
+    // const {} = useModel("wordsModel");
     const { getMyList } = useModel("complaintModel");
 
     useFocusEffect(
@@ -60,36 +43,19 @@ export default function CouponListScreen({ navigation, route }) {
     );
 
     const walletItem = ({ item, index }) => (
-        <Complaint key={index} info={item} />
+      <Complaint key={index} info={item} />
     );
 
     return (
-        <>
-            <NavHeaderBar title='我的投诉' />
-            <ListComponent
-                getInfo={getMyList}
-                renderItem={walletItem}
-                style={styles.list}
-                separatorStyle={styles.separatorStyle}
-                showEmpty={true}
-            />
-        </>
+      <>
+        <NavHeaderBar title='我的投诉' />
+        <ListComponent
+          getInfo={getMyList}
+          renderItem={walletItem}
+          style={styles.list}
+          separatorStyle={styles.separatorStyle}
+          showEmpty
+        />
+      </>
     );
 }
-
-const styles = StyleSheet.create({
-    top: {
-        alignItems: "center",
-        paddingVertical: 10,
-        marginBottom: 10,
-    },
-    list: {
-        flex: 1,
-        backgroundColor: "rgb(242, 242, 242)",
-        paddingHorizontal: 15,
-        paddingTop: 20,
-    },
-    separatorStyle: {
-        marginHorizontal: 13,
-    },
-});

+ 52 - 75
screens/Appraisal/EmailDetail.js

@@ -1,91 +1,16 @@
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
 import { useModel } from "flooks";
 import {
     Layout,
-    Tab,
-    TabView,
     Text,
     useTheme,
-    Button,
-    Card,
-    List,
-    Select,
-    SelectItem,
-    IndexPath,
-    Avatar,
-    Divider,
 } from "@ui-kitten/components";
 import { useFocusEffect } from "@react-navigation/native";
-import ScrollPage from "../../components/ScrollPage";
 import NavHeaderBar from "../../components/NavHeaderBar";
-import Email from "../../components/Email";
-
-import ListComponent from "../../components/ListComponent";
-
-// 余额
-const data = ["2020-03", "2020-04", "2020-05"];
-const ItemSeparatorComponent = props => <Divider />;
-
-export default function EmailDetailScreen({ navigation, route }) {
-    const theme = useTheme();
-    const { changeBackground } = useModel("barModel");
-    const { getUserInfo, money } = useModel("appUserModel");
-    const { httpPost, httpGet } = useModel("httpModel", true);
-
-    const {} = useModel("wordsModel");
-    // const { getMyList } = useModel("emailModel");
-
-    useFocusEffect(
-        React.useCallback(() => {
-            changeBackground(theme["color-primary-500"]);
-        }, [])
-    );
-
-    const emailItem = ({ item, index }) => <Email key={index} info={item} />;
-
-    return (
-        <>
-            <NavHeaderBar title='系统邮箱' />
-            <Layout style={styles.main}>
-                <Layout style={styles.top}>
-                    <Text category='c1'>订单提示</Text>
-                    <Text category='c1'>12月26日</Text>
-                </Layout>
-
-                {/* 普通内容 */}
-                <Text category='c1' style={styles.content}>
-                    您的订单已经被取消收款方老司机的发链接SDK溜老司机的上路考订水房间了圣诞节弗兰克斯家电快溜缝胶看楼上的甲方看了圣诞节放凌空加施蒂利克福建省浪蝶狂蜂监考老师的加菲看楼上的积分了开机啥的敖德萨所多
-                </Text>
-
-                {/* 提现到账 */}
-                <Layout>
-                    <Text category='h4'>
-                        153.98<Text category='c1'>元</Text>
-                    </Text>
-                    <Text category='c1' style={styles.text}>
-                        提现到:<Text category='c1'>中国大众银行(4756)</Text>
-                    </Text>
-                    <Text category='c1' style={styles.text}>
-                        到账时间:<Text category='c1'>2020-12-31 10:48</Text>
-                    </Text>
-                </Layout>
-
-                {/* 审核提交 */}
-                <Text category='c1' style={styles.wait}>
-                    您所提交的商品正在审核中,请您耐心等待...
-                </Text>
-            </Layout>
-        </>
-    );
-}
 
 const styles = StyleSheet.create({
     top: {
@@ -125,3 +50,55 @@ const styles = StyleSheet.create({
         paddingVertical: 20,
     },
 });
+
+export default function EmailDetailScreen() {
+    const theme = useTheme();
+    const { changeBackground } = useModel("barModel");
+    // const {} = useModel("wordsModel");
+    // const { getMyList } = useModel("emailModel");
+
+    useFocusEffect(
+        React.useCallback(() => {
+            changeBackground(theme["color-primary-500"]);
+        }, [])
+    );
+
+    return (
+      <>
+        <NavHeaderBar title='系统邮箱' />
+        <Layout style={styles.main}>
+          <Layout style={styles.top}>
+            <Text category='c1'>订单提示</Text>
+            <Text category='c1'>12月26日</Text>
+          </Layout>
+
+          {/* 普通内容 */}
+          <Text category='c1' style={styles.content}>
+            您的订单已经被取消收款方老司机的发链接SDK溜老司机的上路考订水房间了圣诞节弗兰克斯家电快溜缝胶看楼上的甲方看了圣诞节放凌空加施蒂利克福建省浪蝶狂蜂监考老师的加菲看楼上的积分了开机啥的敖德萨所多
+          </Text>
+
+          {/* 提现到账 */}
+          <Layout>
+            <Text category='h4'>
+              153.98
+              <Text category='c1'>元</Text>
+            </Text>
+            <Text category='c1' style={styles.text}>
+              提现到:
+              <Text category='c1'>中国大众银行(4756)</Text>
+            </Text>
+            <Text category='c1' style={styles.text}>
+              到账时间:
+              <Text category='c1'>2020-12-31 10:48</Text>
+            </Text>
+          </Layout>
+
+          {/* 审核提交 */}
+          <Text category='c1' style={styles.wait}>
+            您所提交的商品正在审核中,请您耐心等待...
+          </Text>
+        </Layout>
+      </>
+    );
+}
+

+ 36 - 68
screens/Appraisal/SystemEmail.js

@@ -1,56 +1,42 @@
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
 import { useModel } from "flooks";
 import {
-    Layout,
-    Tab,
-    TabView,
-    Text,
     useTheme,
-    Button,
-    Card,
-    List,
-    Select,
-    SelectItem,
-    IndexPath,
-    Avatar,
-    Divider,
 } from "@ui-kitten/components";
 import { useFocusEffect } from "@react-navigation/native";
-import ScrollPage from "../../components/ScrollPage";
+import ListComponent from '../../components/ListComponent';
 import NavHeaderBar from "../../components/NavHeaderBar";
 import Email from "../../components/Email";
 
-import ListComponent from "../../components/ListComponent";
 
-// 余额
-const data = ["2020-03", "2020-04", "2020-05"];
-const ItemSeparatorComponent = props => <Divider />;
+const styles = StyleSheet.create({
+    top: {
+        alignItems: "center",
+        paddingVertical: 10,
+        marginBottom: 10,
+    },
+    list: {
+        flex: 1,
+        backgroundColor: "#fff",
+        paddingHorizontal: 15,
+        // paddingTop: 20,
+        marginTop: 20,
+    },
+    separatorStyle: {
+        marginHorizontal: 13,
+    },
+});
 
-export default function SystemEmailScreen({ navigation, route }) {
+
+export default function SystemEmailScreen({ navigation }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-    const { getUserInfo, money } = useModel("appUserModel");
-    const { httpPost, httpGet } = useModel("httpModel", true);
-    const [selectedIndex, setSelectedIndex] = React.useState(
-        new IndexPath(data.length - 1)
-    );
 
-    const {
-        userTitle6,
-        storeAudioText1,
-        storeAudioText2,
-        storeAudioText3,
-        storeAudioText4,
-        complete,
-    } = useModel("wordsModel");
+    // const {} = useModel("wordsModel");
     const { getMyList } = useModel("emailModel");
 
     useFocusEffect(
@@ -60,46 +46,28 @@ export default function SystemEmailScreen({ navigation, route }) {
     );
 
     const emailItem = ({ item, index }) => (
-        <Email
-            key={index}
-            info={item}
-            pressEvent={() => {
-                console.log("aaaaaa");
+      <Email
+        key={index}
+        info={item}
+        pressEvent={() => {
                 navigation.navigate("EmailDetail", {
                     id: index,
                 });
             }}
-        />
+      />
     );
 
     return (
-        <>
-            <NavHeaderBar title='系统邮箱' />
-            <ListComponent
-                getInfo={getMyList}
-                renderItem={emailItem}
-                style={styles.list}
-                separatorStyle={styles.separatorStyle}
-                showEmpty={true}
-            />
-        </>
+      <>
+        <NavHeaderBar title='系统邮箱' />
+        <ListComponent
+          getInfo={getMyList}
+          renderItem={emailItem}
+          style={styles.list}
+          separatorStyle={styles.separatorStyle}
+          showEmpty
+        />
+      </>
     );
 }
 
-const styles = StyleSheet.create({
-    top: {
-        alignItems: "center",
-        paddingVertical: 10,
-        marginBottom: 10,
-    },
-    list: {
-        flex: 1,
-        backgroundColor: "#fff",
-        paddingHorizontal: 15,
-        // paddingTop: 20,
-        marginTop: 20,
-    },
-    separatorStyle: {
-        marginHorizontal: 13,
-    },
-});

+ 8 - 8
screens/Appraisal/index.js

@@ -6,14 +6,14 @@ import EmailDetail from "./EmailDetail";
 
 export default function Set(Screen) {
     return (
-        <>
-            {/* 投诉列表 */}
-            <Screen name='Complaintlist' component={ComplaintlistScreen} />
+      <>
+        {/* 投诉列表 */}
+        <Screen name='Complaintlist' component={ComplaintlistScreen} />
 
-            {/* 系统邮箱 */}
-            <Screen name='SystemEmail' component={SystemEmail} />
-            {/* 邮件详情 */}
-            <Screen name='EmailDetail' component={EmailDetail} />
-        </>
+        {/* 系统邮箱 */}
+        <Screen name='SystemEmail' component={SystemEmail} />
+        {/* 邮件详情 */}
+        <Screen name='EmailDetail' component={EmailDetail} />
+      </>
     );
 }

+ 99 - 102
screens/Bank/AddScreen.js

@@ -1,34 +1,46 @@
+/* eslint-disable camelcase */
+/* eslint-disable no-undef */
+/* eslint-disable no-shadow */
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import { StyleSheet } from "react-native";
 import { useModel } from "flooks";
-import NavHeaderBar from "../../components/NavHeaderBar";
 import { useFocusEffect } from "@react-navigation/native";
 import {
     Layout,
     Button,
     useTheme,
-    TopNavigationAction,
-    Icon,
-    Input,
     Radio,
 } from "@ui-kitten/components";
 import FormInput from "../../components/FormInput";
+import NavHeaderBar from "../../components/NavHeaderBar";
 
-import ListComponent from "../../components/ListComponent";
 
-const PlusIcon = props => <Icon {...props} fill='#fff' name='plus' />;
+
+const styles = StyleSheet.create({
+    form: {
+        paddingHorizontal: 10,
+    },
+    radio: {
+        paddingVertical: 15,
+        paddingHorizontal: 15,
+    },
+    btn: {
+        marginHorizontal: 15,
+        marginVertical: 10,
+    },
+});
+
 export default function BankScreen({ navigation, route }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
     const {
-        bindBankText1,
+       bindBankText1,
         bankTitle1,
         bankTitle2,
         bankTitle3,
         bankTitle4,
         register_form_4,
-        sendCode,
         bankPla1,
         bankPla2,
         bankPla3,
@@ -40,7 +52,6 @@ export default function BankScreen({ navigation, route }) {
         next,
         successText,
         add,
-        editText,
         confirm,
         delText,
     } = useModel("wordsModel");
@@ -54,9 +65,8 @@ export default function BankScreen({ navigation, route }) {
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
-            console.log(route);
-            let { params } = route;
-            let { id, pageName } = params || {};
+            const { params } = route;
+            const { id, pageName } = params || {};
             if (id) {
                 setId(id);
             }
@@ -76,7 +86,7 @@ export default function BankScreen({ navigation, route }) {
 
     React.useEffect(() => {
         if (id) {
-            httpGet("/bankCard/get/" + id, {}, true).then(res => {
+            httpGet(`/bankCard/get/${id}`, {}, true).then(res => {
                 function getVal(value) {
                     return value || "";
                 }
@@ -101,9 +111,9 @@ export default function BankScreen({ navigation, route }) {
             checked
         ) {
             return true;
-        } else {
+        } 
             return false;
-        }
+        
     }, [bankName, cardNo, realName, idNo, phone, code, checked, id]);
 
     const submit = () => {
@@ -125,7 +135,7 @@ export default function BankScreen({ navigation, route }) {
             true
         ).then(res => {
             success(add + successText);
-            let query = {};
+            const query = {};
             if (prePage === "reCharge") {
                 query.selectId = res.id;
             }
@@ -135,7 +145,7 @@ export default function BankScreen({ navigation, route }) {
 
     const remove = () => {
         removeEvent(() => {
-            httpPost("/bankCard/del/" + id, {}, true).then(res => {
+            httpPost(`/bankCard/del/${  id}`, {}, true).then(() => {
                 success(delText + successText);
                 navigation.navigate(prePage);
             });
@@ -143,96 +153,83 @@ export default function BankScreen({ navigation, route }) {
     };
 
     return (
-        <>
-            <NavHeaderBar title={bindBankText1} />
+      <>
+        <NavHeaderBar title={bindBankText1} />
 
-            <Layout style={styles.form}>
-                {/* 银行 */}
-                <FormInput
-                    appearance='inner'
-                    label={bankTitle1}
-                    placeholder={bankPla1}
-                    value={bankName}
-                    onChange={changeBankName}
-                />
-                {/* 银行卡 */}
-                <FormInput
-                    appearance='inner'
-                    label={bankTitle2}
-                    placeholder={bankPla2}
-                    value={cardNo}
-                    onChange={changeCardId}
-                />
-                {/* 姓名 */}
-                <FormInput
-                    appearance='inner'
-                    label={bankTitle3}
-                    placeholder={bankPla3}
-                    value={realName}
-                    onChange={changeRealName}
-                />
-                {/* 身份证号 */}
-                <FormInput
-                    appearance='inner'
-                    label={bankTitle4}
-                    placeholder={bankPla4}
-                    value={idNo}
-                    onChange={changeIdNo}
-                />
-                {/* 手机号 */}
-                <FormInput
-                    appearance='inner'
-                    type='phone'
-                    label={register_form_4}
-                    placeholder={register_pla_4}
-                    value={phone}
-                    onChange={changePhone}
-                />
-                {/* 验证码 */}
-                {id == 0 && (
-                    <FormInput
-                        appearance='inner'
-                        type='code'
-                        label={login_form_3}
-                        placeholder={login_pla_3}
-                        value={code}
-                        onChange={changeCode}
-                        btnText='发送验证码'
-                    />
+        <Layout style={styles.form}>
+          {/* 银行 */}
+          <FormInput
+            appearance='inner'
+            label={bankTitle1}
+            placeholder={bankPla1}
+            value={bankName}
+            onChange={changeBankName}
+          />
+          {/* 银行卡 */}
+          <FormInput
+            appearance='inner'
+            label={bankTitle2}
+            placeholder={bankPla2}
+            value={cardNo}
+            onChange={changeCardId}
+          />
+          {/* 姓名 */}
+          <FormInput
+            appearance='inner'
+            label={bankTitle3}
+            placeholder={bankPla3}
+            value={realName}
+            onChange={changeRealName}
+          />
+          {/* 身份证号 */}
+          <FormInput
+            appearance='inner'
+            label={bankTitle4}
+            placeholder={bankPla4}
+            value={idNo}
+            onChange={changeIdNo}
+          />
+          {/* 手机号 */}
+          <FormInput
+            appearance='inner'
+            type='phone'
+            label={register_form_4}
+            placeholder={register_pla_4}
+            value={phone}
+            onChange={changePhone}
+          />
+          {/* 验证码 */}
+          {id === 0 && (
+            <FormInput
+              appearance='inner'
+              type='code'
+              label={login_form_3}
+              placeholder={login_pla_3}
+              value={code}
+              onChange={changeCode}
+              btnText='发送验证码'
+            />
                 )}
-            </Layout>
-            {id == 0 && (
-                <Radio
-                    style={styles.radio}
-                    checked={checked}
-                    onChange={nextChecked => setChecked(nextChecked)}
-                >
-                    {bankTitle5}
-                </Radio>
+        </Layout>
+        {id === 0 && (
+        <Radio
+          style={styles.radio}
+          checked={checked}
+          onChange={nextChecked => setChecked(nextChecked)}
+        >
+          {bankTitle5}
+        </Radio>
             )}
 
-            <Button style={styles.btn} disabled={!canNext} onPress={submit}>
-                {prePage == "reCharge" ? next : confirm}
-            </Button>
-            {id != 0 && (
-                <Button appearance='ghost' status='info' onPress={remove}>
-                    {delText}
-                </Button>
+        <Button style={styles.btn} disabled={!canNext} onPress={submit}>
+          {prePage === "reCharge" ? next : confirm}
+        </Button>
+        {id !== 0 && (
+        <Button appearance='ghost' status='info' onPress={remove}>
+          {delText}
+        </Button>
             )}
-        </>
+      </>
     );
 }
 
-const styles = StyleSheet.create({
-    form: {
-        paddingHorizontal: 10,
-    },
-    radio: {
-        paddingVertical: 15,
-        paddingHorizontal: 15,
-    },
-    btn: {
-        marginHorizontal: 15,
-        marginVertical: 10,
-    },
-});

+ 83 - 80
screens/Bank/MainScreen.js

@@ -2,7 +2,6 @@ import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import { StyleSheet } from "react-native";
 import { useModel } from "flooks";
-import NavHeaderBar from "../../components/NavHeaderBar";
 import { useFocusEffect } from "@react-navigation/native";
 import {
     Layout,
@@ -12,11 +11,35 @@ import {
     Icon,
     Divider,
 } from "@ui-kitten/components";
-
+import NavHeaderBar from "../../components/NavHeaderBar";
 import ListComponent from "../../components/ListComponent";
 import BankCard from "../../components/BankCard";
 
 const PlusIcon = props => <Icon {...props} fill='#fff' name='plus' />;
+
+
+const styles = StyleSheet.create({
+    list: {
+        flex: 1,
+        backgroundColor: "#EEEEEE",
+        paddingVertical: 7,
+    },
+    separatorStyle: {
+        height: 6,
+        backgroundColor: "#EEEEEE",
+    },
+    subBtn: {
+        paddingHorizontal: 15,
+        paddingVertical: 20,
+        width: "100%",
+        position: "absolute",
+        bottom: 90,
+        left: 0,
+        backgroundColor: "transparent",
+    },
+});
+
+
 export default function BankScreen({ navigation, route }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
@@ -24,8 +47,8 @@ export default function BankScreen({ navigation, route }) {
         "wordsModel"
     );
     const { aliAccount } = useModel("userModel");
-    const { showDialog } = useModel("dialogModel");
-    const { httpPost, httpGet } = useModel("httpModel", true);
+    // const {  } = useModel("dialogModel");
+    const {  httpGet } = useModel("httpModel", true);
     const [pageName, setPageName] = React.useState("Bank");
     const [selectId, setSelectId] = React.useState();
     const [showList, changeShow] = React.useState(false);
@@ -33,7 +56,7 @@ export default function BankScreen({ navigation, route }) {
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
-            const { name, params } = route;
+            const { name } = route;
             setPageName(name);
         }, [])
     );
@@ -42,13 +65,13 @@ export default function BankScreen({ navigation, route }) {
     }
 
     const renderItem = ({ item, index }) => (
-        <BankCard
-            key={index}
-            info={item}
-            type={pageName == "Bank" ? "edit" : "choose"}
-            selectId={selectId}
-            pressEvent={() => {
-                if (pageName == "Bank") {
+      <BankCard
+        key={index}
+        info={item}
+        type={pageName === "Bank" ? "edit" : "choose"}
+        selectId={selectId}
+        pressEvent={() => {
+                if (pageName === "Bank") {
                     navigation.navigate("AddBank", {
                         id: item.id,
                         pageName,
@@ -57,51 +80,51 @@ export default function BankScreen({ navigation, route }) {
                     setSelectId(item.id);
                 }
             }}
-        />
+      />
     );
 
     const aliAccountNo = React.useMemo(() => {
         if (aliAccount && aliAccount.length > 4) {
-            return "支付宝尾号" + aliAccount.substr(aliAccount.length - 5, 4);
-        } else if (aliAccount) {
-            return "支付宝尾号" + aliAccount.substr(0, aliAccount.length);
-        } else {
+            return `支付宝尾号${  aliAccount.substr(aliAccount.length - 5, 4)}`;
+        } if (aliAccount) {
+            return `支付宝尾号${  aliAccount.substr(0, aliAccount.length)}`;
+        } 
             return "";
-        }
+        
     }, [aliAccount]);
 
     const ListFooterComponent = () => (
-        <>
-            <Divider style={styles.separatorStyle} />
-            <BankCard
-                disabled={true}
-                info={{
+      <>
+        <Divider style={styles.separatorStyle} />
+        <BankCard
+          disabled
+          info={{
                     bankName: ALI_PAY,
                     cardNo: aliAccountNo,
                     avatar:
                         "https://idingdong.oss-cn-hangzhou.aliyuncs.com/image/2020-05-21-19-10-04YaHrcXTX.png",
                 }}
-            />
-        </>
+        />
+      </>
     );
 
     const NextButton = () => (
-        <Layout style={{ height: 100, backgroundColor: "transparent" }} />
+      <Layout style={{ height: 100, backgroundColor: "transparent" }} />
     );
     const renderRightActions = () => (
-        <TopNavigationAction
-            icon={PlusIcon}
-            onPress={() => {
+      <TopNavigationAction
+        icon={PlusIcon}
+        onPress={() => {
                 navigation.navigate("AddBank", {
                     pageName,
                 });
             }}
-        />
+      />
     );
 
     const emptyEvent = isEmpty => {
         const { name } = route;
-        if (name == "ChooseBank" && isEmpty) {
+        if (name === "ChooseBank" && isEmpty) {
             navigation.replace("AddBank", {
                 pageName: "Recharge",
             });
@@ -111,61 +134,41 @@ export default function BankScreen({ navigation, route }) {
     };
 
     return (
-        <>
-            {showList && (
-                <NavHeaderBar
-                    title={pageName == "Bank" ? userTitle62 : bankMainTitle}
-                    accessoryRight={renderRightActions}
-                />
+      <>
+        {showList && (
+        <NavHeaderBar
+          title={pageName === "Bank" ? userTitle62 : bankMainTitle}
+          accessoryRight={renderRightActions}
+        />
             )}
-            <ListComponent
-                getInfo={getList}
-                renderItem={renderItem}
-                style={styles.list}
-                separatorStyle={styles.separatorStyle}
-                ListFooterComponent={
-                    pageName == "Bank" ? ListFooterComponent : NextButton
+        <ListComponent
+          getInfo={getList}
+          renderItem={renderItem}
+          style={styles.list}
+          separatorStyle={styles.separatorStyle}
+          ListFooterComponent={
+                    pageName === "Bank" ? ListFooterComponent : NextButton
                 }
-                showEmpty={pageName === "ChooseBank"}
-                emptyEvent={emptyEvent}
-                showList={showList}
-                extraData={{ selectId: selectId }}
-            />
-            {pageName == "ChooseBank" && showList && (
-                <Layout style={styles.subBtn}>
-                    <Button
-                        disabled={!selectId}
-                        onPress={() => {
+          showEmpty={pageName === "ChooseBank"}
+          emptyEvent={emptyEvent}
+          showList={showList}
+          extraData={{ selectId }}
+        />
+        {pageName === "ChooseBank" && showList && (
+        <Layout style={styles.subBtn}>
+          <Button
+            disabled={!selectId}
+            onPress={() => {
                             navigation.navigate("Recharge", {
-                                selectId: selectId,
+                                selectId,
                             });
                         }}
-                    >
-                        {next}
-                    </Button>
-                </Layout>
+          >
+            {next}
+          </Button>
+        </Layout>
             )}
-        </>
+      </>
     );
 }
 
-const styles = StyleSheet.create({
-    list: {
-        flex: 1,
-        backgroundColor: "#EEEEEE",
-        paddingVertical: 7,
-    },
-    separatorStyle: {
-        height: 6,
-        backgroundColor: "#EEEEEE",
-    },
-    subBtn: {
-        paddingHorizontal: 15,
-        paddingVertical: 20,
-        width: "100%",
-        position: "absolute",
-        bottom: 90,
-        left: 0,
-        backgroundColor: "transparent",
-    },
-});

+ 99 - 134
screens/Bank/MoneyListScreen.js

@@ -1,48 +1,92 @@
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
 import { useModel } from "flooks";
 import {
     Layout,
-    Tab,
-    TabView,
-    Text,
     useTheme,
-    Button,
-    Card,
-    List,
     Select,
     SelectItem,
     IndexPath,
-    Avatar,
-    Divider,
     TopNavigation,
     TopNavigationAction,
     Icon,
 } from "@ui-kitten/components";
 import { useFocusEffect } from "@react-navigation/native";
-import NavHeaderBar from "../../components/NavHeaderBar";
 import MoneyRecord from "../../components/MoneyRecord";
 
 import ListComponent from "../../components/ListComponent";
+
 const BackIcon = props => <Icon {...props} fill='#fff' name='arrow-back' />;
 
-const ItemSeparatorComponent = props => <Divider />;
 
-export default function MoneyListScreen({ navigation, route }) {
+const styles = StyleSheet.create({
+    container: {
+        flex: 1,
+        paddingBottom: 33,
+        paddingVertical: 40,
+        alignItems: "center",
+    },
+    icon: {
+        width: 90,
+        height: 80,
+        marginBottom: 26,
+    },
+    text: {
+        fontWeight: "500",
+        marginBottom: 7,
+    },
+    button: {
+        marginTop: 19,
+    },
+    lay: {
+        flexDirection: "row",
+        paddingHorizontal: 17,
+        paddingBottom: 20,
+    },
+    flex1: {
+        flex: 1,
+        flexShrink: 0,
+    },
+    money: {
+        textAlign: "center",
+        fontWeight: "normal",
+    },
+    tiltle: {
+        fontSize: 12,
+        color: "#A43506",
+        alignSelf: "center",
+        flexShrink: 0,
+    },
+    selectMain: {
+        backgroundColor: "transparent",
+    },
+    select: {
+        paddingVertical: 10,
+        paddingHorizontal: 20,
+        backgroundColor: "transparent",
+        flexShrink: 0,
+        minWidth: 150,
+    },
+    list: {
+        backgroundColor: "#fff",
+        flex: 1,
+    },
+    separatorStyle: {
+        marginHorizontal: 13,
+    },
+});
+
+
+export default function MoneyListScreen({ navigation }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-    const { getUserInfo, money } = useModel("appUserModel");
+    const { getUserInfo } = useModel("appUserModel");
     const { selectTiltle1, selectTiltle2, selectTiltle3 } = useModel(
         "wordsModel"
     );
-    const { httpPost, httpGet } = useModel("httpModel", true);
     const { moneyRecordList } = useModel("moenyRecordModel", true);
     const [selectedIndex, setSelectedIndex] = React.useState(new IndexPath(0));
     const data = [
@@ -59,55 +103,33 @@ export default function MoneyListScreen({ navigation, route }) {
             type: "WITHDRAW",
         },
     ];
-    const displayValue = data[selectedIndex.row]["title"];
+    const displayValue = data[selectedIndex.row].title;
 
     const [child, setChild] = React.useState();
     const [startState, changeStart] = React.useState(true);
 
-    function getMenuList(list, parentid) {
-        var children = list.filter(item => {
-            return item.parentId.toString() === parentid.toString();
-        });
-        children = children.map(item => {
-            return {
-                ...item,
-                children: this.getMenuList(list, item.menuId),
-            };
-        });
-
-        return children.sort((a, b) => {
-            return a.sort - b.sort;
-        });
-    }
-
+ 
     const renderOption = (item, index) => (
-        <SelectItem key={index} title={item.title} />
+      <SelectItem key={index} title={item.title} />
     );
     const selectElement = TextProps => (
-        <Layout style={[styles.select, TextProps.style]}>
-            <Select
-                value={displayValue}
-                selectedIndex={selectedIndex}
-                onSelect={index => {
+      <Layout style={[styles.select, TextProps.style]}>
+        <Select
+          value={displayValue}
+          selectedIndex={selectedIndex}
+          onSelect={index => {
                     setSelectedIndex(index);
                     changeStart(true);
                 }}
-                appearance='bar'
-                state='primary'
-            >
-                {data.map(renderOption)}
-            </Select>
-        </Layout>
+          appearance='bar'
+          state='primary'
+        >
+          {data.map(renderOption)}
+        </Select>
+      </Layout>
     );
 
-    const {
-        userTitle6,
-        storeAudioText1,
-        storeAudioText2,
-        storeAudioText3,
-        storeAudioText4,
-        complete,
-    } = useModel("wordsModel");
+    // const {} = useModel("wordsModel");
 
     useFocusEffect(
         React.useCallback(() => {
@@ -118,97 +140,40 @@ export default function MoneyListScreen({ navigation, route }) {
 
     // 获取列表
     function getList(page, size) {
-        let type = data[selectedIndex.row]["type"] || "";
+        const type = data[selectedIndex.row].type || "";
         return moneyRecordList(page, size, { type }).then(res => {
             changeStart(false);
             return Promise.reslove(res);
         });
     }
     const renderBackAction = () => (
-        <TopNavigationAction
-            icon={BackIcon}
-            onPress={() => navigation.goBack()}
-        />
+      <TopNavigationAction
+        icon={BackIcon}
+        onPress={() => navigation.goBack()}
+      />
     );
 
     const walletItem = ({ item, index }) => (
-        <MoneyRecord key={index} info={item} />
+      <MoneyRecord key={index} info={item} />
     );
 
     return (
-        <>
-            <TopNavigation
-                alignment='center'
-                title={selectElement}
-                accessoryLeft={renderBackAction}
-            />
-            <ListComponent
-                setChild={setChild}
-                getInfo={getList}
-                renderItem={walletItem}
-                style={styles.list}
-                separatorStyle={styles.separatorStyle}
-                showEmpty={true}
-                extraData={{ child: child }}
-                startState={startState}
-            />
-        </>
+      <>
+        <TopNavigation
+          alignment='center'
+          title={selectElement}
+          accessoryLeft={renderBackAction}
+        />
+        <ListComponent
+          setChild={setChild}
+          getInfo={getList}
+          renderItem={walletItem}
+          style={styles.list}
+          separatorStyle={styles.separatorStyle}
+          showEmpty
+          extraData={{ child }}
+          startState={startState}
+        />
+      </>
     );
 }
-
-const styles = StyleSheet.create({
-    container: {
-        flex: 1,
-        paddingBottom: 33,
-        paddingVertical: 40,
-        alignItems: "center",
-    },
-    icon: {
-        width: 90,
-        height: 80,
-        marginBottom: 26,
-    },
-    text: {
-        fontWeight: "500",
-        marginBottom: 7,
-    },
-    button: {
-        marginTop: 19,
-    },
-    lay: {
-        flexDirection: "row",
-        paddingHorizontal: 17,
-        paddingBottom: 20,
-    },
-    flex1: {
-        flex: 1,
-        flexShrink: 0,
-    },
-    money: {
-        textAlign: "center",
-        fontWeight: "normal",
-    },
-    tiltle: {
-        fontSize: 12,
-        color: "#A43506",
-        alignSelf: "center",
-        flexShrink: 0,
-    },
-    selectMain: {
-        backgroundColor: "transparent",
-    },
-    select: {
-        paddingVertical: 10,
-        paddingHorizontal: 20,
-        backgroundColor: "transparent",
-        flexShrink: 0,
-        minWidth: 150,
-    },
-    list: {
-        backgroundColor: "#fff",
-        flex: 1,
-    },
-    separatorStyle: {
-        marginHorizontal: 13,
-    },
-});

+ 135 - 125
screens/Bank/RechargeDetailScreen.js

@@ -1,22 +1,75 @@
+/* eslint-disable camelcase */
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import { StyleSheet, Image } from "react-native";
-import { useModel } from "flooks";
-import NavHeaderBar from "../../components/NavHeaderBar";
-import { useFocusEffect, useRoute } from "@react-navigation/native";
-import ScrollPage from "../../components/ScrollPage";
 import {
     Layout,
-    Button,
     useTheme,
     Icon,
     Divider,
-    Input,
     Text,
 } from "@ui-kitten/components";
+import { useModel } from "flooks";
+import { useFocusEffect, useRoute } from "@react-navigation/native";
 import moment from "moment";
-const PlusIcon = props => <Icon {...props} fill='#fff' name='plus' />;
-export default function RechargeDetailScreen({ navigation }) {
+import NavHeaderBar from "../../components/NavHeaderBar";
+import ScrollPage from "../../components/ScrollPage";
+
+
+const styles = StyleSheet.create({
+    top: {
+        flexDirection: "row",
+        alignItems: "center",
+        paddingTop: 7,
+        paddingLeft: 30,
+        paddingRight: 56,
+    },
+    image: {
+        width: 66,
+        height: 66,
+        flexShrink: 0,
+    },
+    icon: {
+        width: 33,
+        height: 33,
+        flexShrink: 0,
+    },
+    line: {
+        flex: 1,
+        height: 2,
+    },
+    activeLine: {
+        backgroundColor: "#FFC21C",
+    },
+    errorLine: {
+        backgroundColor: "#F15A3C",
+    },
+    tips: {
+        paddingBottom: 11,
+        alignItems: "center",
+    },
+    form: {
+        marginTop: 7,
+        paddingVertical: 20,
+        paddingHorizontal: 13,
+    },
+    item: {
+        flexDirection: "row",
+        justifyContent: "space-between",
+        marginBottom: 10,
+    },
+    name: {
+        color: "#787878",
+    },
+});
+
+
+
+const img1=require("../../assets/images/logo_1.png")
+const img2=require("../../assets/images/apply2.png")
+
+
+export default function RechargeDetailScreen() {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
     const {
@@ -28,12 +81,12 @@ export default function RechargeDetailScreen({ navigation }) {
         rechargeTitle2,
         rechargeTitle3,
     } = useModel("wordsModel");
-    const { httpPost, httpGet } = useModel("httpModel", true);
-    const { success } = useModel("loadingModel");
+    const {  httpGet } = useModel("httpModel", true);
+    // const {  } = useModel("loadingModel");
     const [applyInfo, setApplyInfo] = React.useState({});
     const route = useRoute();
 
-    const { amount, bankCard, enabled, id, status, withdrawTime } = applyInfo;
+    const { amount, bankCard,  status, withdrawTime } = applyInfo;
 
     const { bankName, cardNo } = bankCard || {};
 
@@ -46,11 +99,11 @@ export default function RechargeDetailScreen({ navigation }) {
     const showTip = React.useMemo(() => {
         if (status === "SUCCESS") {
             return Apply_SUCCESS;
-        } else if (status === "FAIL") {
+        } if (status === "FAIL") {
             return Apply_FAIL;
-        } else {
+        } 
             return Apply_PENDING;
-        }
+        
     }, [Apply_SUCCESS, Apply_PENDING, Apply_FAIL]);
 
     const getTime = React.useMemo(() => {
@@ -58,145 +111,102 @@ export default function RechargeDetailScreen({ navigation }) {
             return moment(withdrawTime, "YYYY-MM-DD HH:mm:ss")
                 .add(2, "hours")
                 .format("YYYY-MM-DD HH:mm:ss");
-        } else {
+        } 
             return "";
-        }
+        
     }, [withdrawTime]);
 
     const showBankInfo = React.useMemo(() => {
         if (bankName && cardNo) {
             return (
-                bankName +
-                " (" +
-                (cardNo.length > 5
+                `${bankName 
+                } (${ 
+                cardNo.length > 5
                     ? cardNo.substr(cardNo.length - 5, 4)
-                    : cardNo.substr(0, cardNo.length)) +
-                ")"
+                    : cardNo.substr(0, cardNo.length) 
+                })`
             );
-        } else {
+        } 
             return "";
-        }
+        
     }, [bankName, cardNo]);
 
     function refreshEvent() {
         const { params } = route;
         const { id } = params || {};
-        return httpGet("/withdrawApply/get/" + id, {}, true).then(res => {
+        return httpGet(`/withdrawApply/get/${  id}`, {}, true).then(res => {
             setApplyInfo(res);
         });
     }
 
     return (
-        <>
-            <NavHeaderBar title={WITHDRAW} />
-            <ScrollPage enabledFresh={true} refreshEvent={refreshEvent}>
-                <Layout style={styles.top}>
-                    <Image
-                        source={require("../../assets/images/logo_1.png")}
-                        style={styles.image}
-                    />
-                    <Divider style={[styles.line, styles.activeLine]} />
-                    <Image
-                        source={require("../../assets/images/apply2.png")}
-                        style={styles.icon}
-                    />
-                    {status === "SUCCESS" ? (
-                        <Divider style={[styles.line, styles.activeLine]} />
+      <>
+        <NavHeaderBar title={WITHDRAW} />
+        <ScrollPage enabledFresh refreshEvent={refreshEvent}>
+          <Layout style={styles.top}>
+            <Image
+              source={img1}
+              style={styles.image}
+            />
+            <Divider style={[styles.line, styles.activeLine]} />
+            <Image
+              source={img2}
+              style={styles.icon}
+            />
+            {status === "SUCCESS" ? (
+              <Divider style={[styles.line, styles.activeLine]} />
                     ) : status === "FAIL" ? (
-                        <Divider style={[styles.line, styles.errorLine]} />
+                      <Divider style={[styles.line, styles.errorLine]} />
                     ) : (
-                        <Divider style={[styles.line]} />
+                      <Divider style={[styles.line]} />
                     )}
 
-                    {status === "SUCCESS" ? (
-                        <Icon
-                            fill='#FFC21C'
-                            name='checkmark-circle-2'
-                            style={styles.icon}
-                        />
+            {status === "SUCCESS" ? (
+              <Icon
+                fill='#FFC21C'
+                name='checkmark-circle-2'
+                style={styles.icon}
+              />
                     ) : status === "FAIL" ? (
-                        <Icon
-                            fill='#F15A3C'
-                            name='checkmark-circle-2'
-                            style={styles.icon}
-                        />
+                      <Icon
+                        fill='#F15A3C'
+                        name='checkmark-circle-2'
+                        style={styles.icon}
+                      />
                     ) : (
-                        <Icon
-                            fill='#EEEEEE'
-                            name='checkmark-circle-2'
-                            style={styles.icon}
-                        />
+                      <Icon
+                        fill='#EEEEEE'
+                        name='checkmark-circle-2'
+                        style={styles.icon}
+                      />
                     )}
-                </Layout>
-                <Layout style={styles.tips}>
-                    <Text>{showTip}</Text>
-                </Layout>
-
-                <Layout style={styles.form}>
-                    {getTime != "" && (
-                        <Layout style={styles.item}>
-                            <Text style={styles.name}>{rechargeTime}</Text>
-                            <Text>{getTime}</Text>
-                        </Layout>
+          </Layout>
+          <Layout style={styles.tips}>
+            <Text>{showTip}</Text>
+          </Layout>
+
+          <Layout style={styles.form}>
+            {getTime !== "" && (
+            <Layout style={styles.item}>
+              <Text style={styles.name}>{rechargeTime}</Text>
+              <Text>{getTime}</Text>
+            </Layout>
                     )}
 
-                    <Layout style={styles.item}>
-                        <Text style={styles.name}>{rechargeTitle2}</Text>
-                        <Text>{showBankInfo}</Text>
-                    </Layout>
-                    <Layout style={styles.item}>
-                        <Text style={styles.name}>{rechargeTitle3}</Text>
-                        <Text>¥{amount}</Text>
-                    </Layout>
-                </Layout>
-            </ScrollPage>
-        </>
+            <Layout style={styles.item}>
+              <Text style={styles.name}>{rechargeTitle2}</Text>
+              <Text>{showBankInfo}</Text>
+            </Layout>
+            <Layout style={styles.item}>
+              <Text style={styles.name}>{rechargeTitle3}</Text>
+              <Text>
+                ¥
+                {amount}
+              </Text>
+            </Layout>
+          </Layout>
+        </ScrollPage>
+      </>
     );
 }
 
-const styles = StyleSheet.create({
-    top: {
-        flexDirection: "row",
-        alignItems: "center",
-        paddingTop: 7,
-        paddingLeft: 30,
-        paddingRight: 56,
-    },
-    image: {
-        width: 66,
-        height: 66,
-        flexShrink: 0,
-    },
-    icon: {
-        width: 33,
-        height: 33,
-        flexShrink: 0,
-    },
-    line: {
-        flex: 1,
-        height: 2,
-    },
-    activeLine: {
-        backgroundColor: "#FFC21C",
-    },
-    errorLine: {
-        backgroundColor: "#F15A3C",
-    },
-    tips: {
-        paddingBottom: 11,
-        alignItems: "center",
-    },
-    form: {
-        marginTop: 7,
-        paddingVertical: 20,
-        paddingHorizontal: 13,
-    },
-    item: {
-        flexDirection: "row",
-        justifyContent: "space-between",
-        marginBottom: 10,
-    },
-    name: {
-        color: "#787878",
-    },
-});

+ 75 - 91
screens/Bank/RechargeScreen.js

@@ -2,35 +2,61 @@ import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import { StyleSheet } from "react-native";
 import { useModel } from "flooks";
-import NavHeaderBar from "../../components/NavHeaderBar";
 import { useFocusEffect, useRoute } from "@react-navigation/native";
 import {
     Layout,
     Button,
     useTheme,
-    TopNavigationAction,
-    Icon,
     Divider,
     Input,
     Text,
 } from "@ui-kitten/components";
 
-import ListComponent from "../../components/ListComponent";
+import NavHeaderBar from "../../components/NavHeaderBar";
 import BankCard from "../../components/BankCard";
 
-const PlusIcon = props => <Icon {...props} fill='#fff' name='plus' />;
+const styles = StyleSheet.create({
+    list: {
+        flex: 1,
+        backgroundColor: "#EEEEEE",
+        paddingVertical: 7,
+    },
+    separatorStyle: {
+        height: 6,
+        backgroundColor: "#EEEEEE",
+    },
+    subBtn: {
+        paddingHorizontal: 15,
+        paddingVertical: 20,
+        width: "100%",
+        position: "absolute",
+        bottom: 90,
+        left: 0,
+        backgroundColor: "transparent",
+    },
+    input: {
+        marginTop: 7,
+        paddingTop: 10,
+        paddingHorizontal: 13,
+        paddingBottom: 28,
+    },
+    left: {
+        fontWeight: "normal",
+        marginRight: 18,
+    },
+});
+
+
 export default function RechargeScreen({ navigation }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
     const { rechargeBtnText, WITHDRAW, applySuccess } = useModel("wordsModel");
-    const { aliAccount } = useModel("userModel");
     const { getUserInfo, money } = useModel("appUserModel");
     const { httpPost, httpGet } = useModel("httpModel", true);
     const { success } = useModel("loadingModel");
     const [bankCardId, setBankCardId] = React.useState();
     const [bankCradInfo, setBankCradInfo] = React.useState({});
     const [value, setVal] = React.useState("");
-    const [showValue, setShowVal] = React.useState();
     const route = useRoute();
 
     useFocusEffect(
@@ -47,7 +73,7 @@ export default function RechargeScreen({ navigation }) {
 
     React.useEffect(() => {
         if (bankCardId) {
-            httpGet("/bankCard/get/" + bankCardId).then(res => {
+            httpGet(`/bankCard/get/${bankCardId}`).then(res => {
                 setBankCradInfo(res);
             });
         } else {
@@ -55,41 +81,31 @@ export default function RechargeScreen({ navigation }) {
         }
     }, [bankCardId]);
 
-    const aliAccountNo = React.useMemo(() => {
-        if (aliAccount && aliAccount.length > 4) {
-            return "支付宝尾号" + aliAccount.substr(aliAccount.length - 5, 4);
-        } else if (aliAccount) {
-            return "支付宝尾号" + aliAccount.substr(0, aliAccount.length);
-        } else {
-            return "";
-        }
-    }, [aliAccount]);
+    
 
     const canSubmit = React.useMemo(() => {
-        let _value = Number(value);
-        if (bankCardId && _value && _value <= (money || 0)) {
+        const value1 = Number(value);
+        if (bankCardId && value1 && value1 <= (money || 0)) {
             return true;
-        } else {
+        } 
             return false;
-        }
+        
     }, [value, bankCardId]);
 
     const showMoeny = React.useMemo(() => {
         if (money) {
             return money.toFixed(2);
-        } else {
+        } 
             return "0.00";
-        }
-        return false;
     }, [money]);
 
     function submit() {
-        let _value = Number(value);
+        const value1 = Number(value);
         httpPost(
             "/withdrawApply/apply",
             {
-                amount: _value,
-                bankCardId: bankCardId,
+                amount: value1,
+                bankCardId,
             },
             {},
             true
@@ -102,80 +118,48 @@ export default function RechargeScreen({ navigation }) {
     }
 
     return (
-        <>
-            <NavHeaderBar title={WITHDRAW} />
-            <Divider style={styles.separatorStyle} />
-            <BankCard
-                type='edit'
-                pressEvent={() => {
+      <>
+        <NavHeaderBar title={WITHDRAW} />
+        <Divider style={styles.separatorStyle} />
+        <BankCard
+          type='edit'
+          pressEvent={() => {
                     navigation.navigate("ChooseBank");
                 }}
-                info={bankCradInfo}
-            />
+          info={bankCradInfo}
+        />
 
-            <Layout style={styles.input}>
-                <Input
-                    appearance='reCharge'
-                    label='提现金额'
-                    value={value}
-                    accessoryLeft={() => (
-                        <Text category='h2' style={styles.left}>
-                            ¥
-                        </Text>
+        <Layout style={styles.input}>
+          <Input
+            appearance='reCharge'
+            label='提现金额'
+            value={value}
+            accessoryLeft={() => (
+              <Text category='h2' style={styles.left}>
+                ¥
+              </Text>
                     )}
-                    caption={"可用余额" + showMoeny + "元"}
-                    keyboardType='numeric'
-                    onChangeText={text => {
+            caption={`可用余额${  showMoeny  }元`}
+            keyboardType='numeric'
+            onChangeText={text => {
                         setVal(text);
                     }}
-                    onBlur={() => {
-                        console.log(value);
-                        let _value = Number(value);
-                        if (_value > (money || 0)) {
+            onBlur={() => {
+                        const value1 = Number(value);
+                        if (value1 > (money || 0)) {
                             setVal(showMoeny);
                         } else {
-                            setVal(_value.toFixed(2));
+                            setVal(value1.toFixed(2));
                         }
                     }}
-                />
-            </Layout>
+          />
+        </Layout>
 
-            <Layout style={styles.subBtn}>
-                <Button disabled={!canSubmit} onPress={submit}>
-                    {rechargeBtnText}
-                </Button>
-            </Layout>
-        </>
+        <Layout style={styles.subBtn}>
+          <Button disabled={!canSubmit} onPress={submit}>
+            {rechargeBtnText}
+          </Button>
+        </Layout>
+      </>
     );
 }
-
-const styles = StyleSheet.create({
-    list: {
-        flex: 1,
-        backgroundColor: "#EEEEEE",
-        paddingVertical: 7,
-    },
-    separatorStyle: {
-        height: 6,
-        backgroundColor: "#EEEEEE",
-    },
-    subBtn: {
-        paddingHorizontal: 15,
-        paddingVertical: 20,
-        width: "100%",
-        position: "absolute",
-        bottom: 90,
-        left: 0,
-        backgroundColor: "transparent",
-    },
-    input: {
-        marginTop: 7,
-        paddingTop: 10,
-        paddingHorizontal: 13,
-        paddingBottom: 28,
-    },
-    left: {
-        fontWeight: "normal",
-        marginRight: 18,
-    },
-});

+ 8 - 8
screens/Bank/index.js

@@ -8,13 +8,13 @@ import MoneyListScreen from "./MoneyListScreen";
 
 export default function Bank(Screen) {
     return (
-        <>
-            <Screen name='Bank' component={BankScreen} />
-            <Screen name='AddBank' component={AddBankScreen} />
-            <Screen name='ChooseBank' component={BankScreen} />
-            <Screen name='Recharge' component={RechargeScreen} />
-            <Screen name='RechargeDetail' component={RechargeDetailScreen} />
-            <Screen name='MyRecord' component={MoneyListScreen} />
-        </>
+      <>
+        <Screen name='Bank' component={BankScreen} />
+        <Screen name='AddBank' component={AddBankScreen} />
+        <Screen name='ChooseBank' component={BankScreen} />
+        <Screen name='Recharge' component={RechargeScreen} />
+        <Screen name='RechargeDetail' component={RechargeDetailScreen} />
+        <Screen name='MyRecord' component={MoneyListScreen} />
+      </>
     );
 }

+ 35 - 35
screens/BankScreen.js

@@ -2,62 +2,62 @@ import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import { StyleSheet } from "react-native";
 import { useModel } from "flooks";
-import NavHeaderBar from "../components/NavHeaderBar";
 import {
     Layout,
-    Button,
-    useTheme,
     TopNavigationAction,
     Icon,
 } from "@ui-kitten/components";
+import NavHeaderBar from "../components/NavHeaderBar";
 
 import ListComponent from "../components/ListComponent";
 
+
+const styles = StyleSheet.create({
+    list: {
+        flex: 1,
+        backgroundColor: "#EEEEEE",
+        paddingVertical: 7,
+    },
+    separatorStyle: {
+        height: 6,
+    },
+});
+
+
 const PlusIcon = props => <Icon {...props} fill='#fff' name='plus' />;
-export default function BankScreen({ navigation, route }) {
-    const theme = useTheme();
-    const { changeBackground } = useModel("barModel");
+
+
+
+export default function BankScreen({ navigation }) {
     const { userTitle62 } = useModel("wordsModel");
-    const { httpPost, httpGet } = useModel("httpModel", true);
 
     function getList() {
         return Promise.resolve();
     }
 
-    const renderItem = ({ item, index }) => <Layout key={index} />;
+    const renderItem = ({  index }) => <Layout key={index} />;
 
     const renderRightActions = () => (
-        <TopNavigationAction
-            icon={PlusIcon}
-            onPress={() => {
+      <TopNavigationAction
+        icon={PlusIcon}
+        onPress={() => {
                 navigation.navigat("AddBank");
             }}
-        />
+      />
     );
 
     return (
-        <>
-            <NavHeaderBar
-                title={userTitle62}
-                accessoryRight={renderRightActions}
-            />
-            <ListComponent
-                getInfo={getList}
-                renderItem={renderItem}
-                style={styles.list}
-                separatorStyle={styles.separatorStyle}
-            />
-        </>
+      <>
+        <NavHeaderBar
+          title={userTitle62}
+          accessoryRight={renderRightActions}
+        />
+        <ListComponent
+          getInfo={getList}
+          renderItem={renderItem}
+          style={styles.list}
+          separatorStyle={styles.separatorStyle}
+        />
+      </>
     );
 }
-
-const styles = StyleSheet.create({
-    list: {
-        flex: 1,
-        backgroundColor: "#EEEEEE",
-        paddingVertical: 7,
-    },
-    separatorStyle: {
-        height: 6,
-    },
-});

+ 107 - 113
screens/Coupon/AddScreen.js

@@ -1,33 +1,47 @@
+/* eslint-disable no-shadow */
+/* eslint-disable no-unused-vars */
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import { StyleSheet } from "react-native";
 import { useModel } from "flooks";
-import NavHeaderBar from "../../components/NavHeaderBar";
 import { useFocusEffect } from "@react-navigation/native";
 import {
     Layout,
     Button,
     useTheme,
-    TopNavigationAction,
-    Icon,
-    Input,
-    Radio,
     Divider,
 } from "@ui-kitten/components";
+import NavHeaderBar from "../../components/NavHeaderBar";
 import FormInput from "../../components/FormInput";
 
-const PlusIcon = props => <Icon {...props} fill='#fff' name='plus' />;
+
+const styles = StyleSheet.create({
+    form: {
+        paddingHorizontal: 10,
+        flex: 1,
+        marginTop: 10,
+    },
+    radio: {
+        paddingVertical: 15,
+        paddingHorizontal: 15,
+    },
+    btn: {
+        marginHorizontal: 15,
+        marginVertical: 10,
+    },
+    btnList: {
+        alignItems: "center",
+    },
+    label: {
+        width: 105,
+    },
+});
 
 export default function CouponAddScreen({ navigation, route }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
 
-    const { httpPost, httpGet } = useModel("httpModel", true);
-    const { userId } = useModel("userModel");
-    const { success } = useModel("loadingModel", true);
-    const { removeEvent } = useModel("dialogModel", true);
     const [id, setId] = React.useState();
-    const [prePage, setPrePage] = React.useState();
     const { defaultStartTime, defaultEndTime, saveInfo, removeInfo } = useModel(
         "couponModel"
     );
@@ -40,8 +54,8 @@ export default function CouponAddScreen({ navigation, route }) {
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
-            let { params } = route;
-            let { id, pageName } = params || {};
+            const { params } = route;
+            const { id, pageName } = params || {};
             if (id) {
                 setId(id);
             } else {
@@ -70,9 +84,9 @@ export default function CouponAddScreen({ navigation, route }) {
     const canNext = React.useMemo(() => {
         if (name && amount && startDate && endDate) {
             return true;
-        } else {
+        } 
             return false;
-        }
+        
     }, [name, amount, fullAmount, id, startDate, endDate]);
 
     const submit = () => {
@@ -90,105 +104,85 @@ export default function CouponAddScreen({ navigation, route }) {
     };
 
     return (
-        <>
-            <NavHeaderBar title='编辑(新增)优惠券' />
-
-            <Layout style={styles.form}>
-                {/* 优惠券名称 */}
-                <FormInput
-                    label='优惠券名称'
-                    labelStyle={styles.label}
-                    key={1}
-                    placeholder='输入优惠券名称'
-                    value={name}
-                    onChange={changeName}
-                />
-                {/* 优惠券金额 */}
-                <FormInput
-                    label='优惠券金额'
-                    labelStyle={styles.label}
-                    key={2}
-                    placeholder='输入金额'
-                    type='money'
-                    value={amount}
-                    onChange={changeAmount}
-                />
-
-                <Divider />
-                {/* 优惠券门槛金额 */}
-                <FormInput
-                    label='优惠券门槛金额'
-                    labelStyle={styles.label}
-                    key={3}
-                    placeholder='输入门槛金额'
-                    type='money'
-                    value={fullAmount}
-                    onChange={changeFullAmount}
-                />
-
-                {/* 优惠券开始时间 */}
-                <FormInput
-                    label='优惠券开始时间'
-                    labelStyle={styles.label}
-                    key={4}
-                    placeholder=''
-                    type='date'
-                    value={startDate}
-                    onChange={changeStartDate}
-                />
-
-                {/* 优惠券结束时间 */}
-                <FormInput
-                    label='优惠券结束时间'
-                    labelStyle={styles.label}
-                    key={5}
-                    placeholder=''
-                    type='date'
-                    value={endDate}
-                    onChange={changeEndDate}
-                />
-
-                <Layout style={styles.btnList}>
-                    <Button
-                        style={styles.btn}
-                        disabled={!canNext}
-                        onPress={submit}
-                    >
-                        确定
-                    </Button>
-                    {id != null && (
-                        <Button
-                            appearance='ghost'
-                            status='info'
-                            onPress={remove}
-                        >
-                            删除
-                        </Button>
+      <>
+        <NavHeaderBar title='编辑(新增)优惠券' />
+
+        <Layout style={styles.form}>
+          {/* 优惠券名称 */}
+          <FormInput
+            label='优惠券名称'
+            labelStyle={styles.label}
+            key={1}
+            placeholder='输入优惠券名称'
+            value={name}
+            onChange={changeName}
+          />
+          {/* 优惠券金额 */}
+          <FormInput
+            label='优惠券金额'
+            labelStyle={styles.label}
+            key={2}
+            placeholder='输入金额'
+            type='money'
+            value={amount}
+            onChange={changeAmount}
+          />
+
+          <Divider />
+          {/* 优惠券门槛金额 */}
+          <FormInput
+            label='优惠券门槛金额'
+            labelStyle={styles.label}
+            key={3}
+            placeholder='输入门槛金额'
+            type='money'
+            value={fullAmount}
+            onChange={changeFullAmount}
+          />
+
+          {/* 优惠券开始时间 */}
+          <FormInput
+            label='优惠券开始时间'
+            labelStyle={styles.label}
+            key={4}
+            placeholder=''
+            type='date'
+            value={startDate}
+            onChange={changeStartDate}
+          />
+
+          {/* 优惠券结束时间 */}
+          <FormInput
+            label='优惠券结束时间'
+            labelStyle={styles.label}
+            key={5}
+            placeholder=''
+            type='date'
+            value={endDate}
+            onChange={changeEndDate}
+          />
+
+          <Layout style={styles.btnList}>
+            <Button
+              style={styles.btn}
+              disabled={!canNext}
+              onPress={submit}
+            >
+              确定
+            </Button>
+            {id != null && (
+            <Button
+              appearance='ghost'
+              status='info'
+              onPress={remove}
+            >
+              删除
+            </Button>
                     )}
-                </Layout>
-            </Layout>
-        </>
+          </Layout>
+        </Layout>
+      </>
     );
 }
 
-const styles = StyleSheet.create({
-    form: {
-        paddingHorizontal: 10,
-        flex: 1,
-        marginTop: 10,
-    },
-    radio: {
-        paddingVertical: 15,
-        paddingHorizontal: 15,
-    },
-    btn: {
-        marginHorizontal: 15,
-        marginVertical: 10,
-    },
-    btnList: {
-        alignItems: "center",
-    },
-    label: {
-        width: 105,
-    },
-});
+

+ 6 - 6
screens/Coupon/index.js

@@ -5,11 +5,11 @@ import CouponAddScreen from "./AddScreen";
 
 export default function Set(Screen) {
     return (
-        <>
-            {/* 优惠券列表 */}
-            <Screen name='CouponList' component={listScreen} />
-            {/* 新增优惠券 */}
-            <Screen name='CouponAdd' component={CouponAddScreen} />
-        </>
+      <>
+        {/* 优惠券列表 */}
+        <Screen name='CouponList' component={listScreen} />
+        {/* 新增优惠券 */}
+        <Screen name='CouponAdd' component={CouponAddScreen} />
+      </>
     );
 }

+ 37 - 66
screens/Coupon/listScreen.js

@@ -1,56 +1,42 @@
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
-    Image,
-    Platform,
     StyleSheet,
     View,
-    ImageBackground,
 } from "react-native";
 import { useModel } from "flooks";
 import {
-    Layout,
-    Tab,
-    TabView,
-    Text,
     useTheme,
     Button,
-    Card,
-    List,
-    Select,
-    SelectItem,
-    IndexPath,
-    Avatar,
-    Divider,
 } from "@ui-kitten/components";
 import { useFocusEffect } from "@react-navigation/native";
-import ScrollPage from "../../components/ScrollPage";
 import NavHeaderBar from "../../components/NavHeaderBar";
 import Coupon from "../../components/Coupon";
 
 import ListComponent from "../../components/ListComponent";
 
-// 余额
-const data = ["2020-03", "2020-04", "2020-05"];
-const ItemSeparatorComponent = props => <Divider />;
 
-export default function CouponListScreen({ navigation, route }) {
+const styles = StyleSheet.create({
+    top: {
+        alignItems: "center",
+        paddingVertical: 10,
+        marginBottom: 10,
+    },
+    list: {
+        flex: 1,
+        backgroundColor: "rgb(242, 242, 242)",
+        paddingHorizontal: 15,
+    },
+    separatorStyle: {
+        marginHorizontal: 13,
+    },
+});
+
+
+export default function CouponListScreen({ navigation }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-    const { getUserInfo, money } = useModel("appUserModel");
-    const { httpPost, httpGet } = useModel("httpModel", true);
-    const [selectedIndex, setSelectedIndex] = React.useState(
-        new IndexPath(data.length - 1)
-    );
-
-    const {
-        userTitle6,
-        storeAudioText1,
-        storeAudioText2,
-        storeAudioText3,
-        storeAudioText4,
-        complete,
-    } = useModel("wordsModel");
+    // const {} = useModel("wordsModel");
     const { getMyList } = useModel("couponModel");
 
     useFocusEffect(
@@ -62,41 +48,26 @@ export default function CouponListScreen({ navigation, route }) {
     const walletItem = ({ item, index }) => <Coupon key={index} info={item} />;
 
     return (
-        <>
-            <NavHeaderBar title='优惠券管理' />
-            <View style={styles.top}>
-                <Button
-                    appearance='outline'
-                    onPress={() => {
+      <>
+        <NavHeaderBar title='优惠券管理' />
+        <View style={styles.top}>
+          <Button
+            appearance='outline'
+            onPress={() => {
                         navigation.navigate("CouponAdd");
                     }}
-                >
-                    新增优惠券
-                </Button>
-            </View>
-            <ListComponent
-                getInfo={getMyList}
-                renderItem={walletItem}
-                style={styles.list}
-                separatorStyle={styles.separatorStyle}
-                showEmpty={true}
-            />
-        </>
+          >
+            新增优惠券
+          </Button>
+        </View>
+        <ListComponent
+          getInfo={getMyList}
+          renderItem={walletItem}
+          style={styles.list}
+          separatorStyle={styles.separatorStyle}
+          showEmpty
+        />
+      </>
     );
 }
 
-const styles = StyleSheet.create({
-    top: {
-        alignItems: "center",
-        paddingVertical: 10,
-        marginBottom: 10,
-    },
-    list: {
-        flex: 1,
-        backgroundColor: "rgb(242, 242, 242)",
-        paddingHorizontal: 15,
-    },
-    separatorStyle: {
-        marginHorizontal: 13,
-    },
-});

+ 105 - 114
screens/EditBannerScreen.js

@@ -2,29 +2,74 @@ import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
     Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
-import scrollPage from "../components/ScrollPage";
-import { useModel } from "flooks";
 import {
     Layout,
-    Tab,
-    TabView,
     Text,
     useTheme,
     Button,
-    Card,
 } from "@ui-kitten/components";
-import FormInput from "../components/FormInput";
 import { useFocusEffect } from "@react-navigation/native";
+import { useModel } from "flooks";
+import ScrollPage from "../components/ScrollPage";
 import NavHeaderBar from "../components/NavHeaderBar";
-import GoodsCard from "../components/GoodsCard";
 import UpLoadImage from "../components/UpLoadImage";
 
-export default function EditBannerScreen({ navigation, route }) {
+const styles = StyleSheet.create({
+    container: {
+        flex: 1,
+        paddingBottom: 33,
+    },
+    icon: {
+        width: 90,
+        height: 80,
+        marginBottom: 26,
+    },
+    text: {
+        fontWeight: "500",
+        marginBottom: 7,
+    },
+    top: {
+        paddingVertical: 7,
+        height: 114,
+        backgroundColor: "#eee",
+        alignSelf: "stretch",
+        alignItems: "center",
+        justifyContent: "center",
+    },
+    banner: {
+        flex: 1,
+        alignSelf: "stretch",
+    },
+    logo: {
+        width: 50,
+        height: 50,
+        borderRadius: 3,
+    },
+    remove: {
+        position: "absolute",
+        bottom: 10,
+        right: 10,
+    },
+    upload: {
+        marginTop: 21,
+        width: 133,
+        height: 133,
+        alignSelf: "center",
+    },
+    main: {
+        paddingHorizontal: 24,
+        paddingVertical: 14,
+    },
+    button: {
+        alignSelf: "center",
+        marginTop: 19,
+    },
+});
+
+
+export default function EditBannerScreen({  route }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
     const {
@@ -57,39 +102,39 @@ export default function EditBannerScreen({ navigation, route }) {
     );
 
     return (
-        <>
-            <NavHeaderBar
-                title={
+      <>
+        <NavHeaderBar
+          title={
                     editText +
-                    (type == "banner"
+                    (type === "banner"
                         ? bannerTitle
-                        : type == "qualification"
+                        : type === "qualification"
                         ? qualificationTitle
                         : logoTitle)
                 }
-            />
-            <ScrollPage>
-                <Layout style={styles.container}>
-                    <Layout style={styles.top}>
-                        <Image
-                            source={{
+        />
+        <ScrollPage>
+          <Layout style={styles.container}>
+            <Layout style={styles.top}>
+              <Image
+                source={{
                                 uri:
-                                    type == "banner"
+                                    type === "banner"
                                         ? banner
-                                        : type == "qualification"
+                                        : type === "qualification"
                                         ? qualification ||
                                           registerInfo.qualification
                                         : logo,
                             }}
-                            style={[
-                                type == "logo" ? styles.logo : styles.banner,
+                style={[
+                                type === "logo" ? styles.logo : styles.banner,
                             ]}
-                        />
-                        <Button
-                            style={styles.remove}
-                            size='tiny'
-                            status='danger'
-                            onPress={() => {
+              />
+              <Button
+                style={styles.remove}
+                size='tiny'
+                status='danger'
+                onPress={() => {
                                 showDialog({
                                     bodyText: removeTips,
                                     status: "danger",
@@ -99,95 +144,41 @@ export default function EditBannerScreen({ navigation, route }) {
                                     },
                                 });
                             }}
-                        >
-                            {remove}
-                        </Button>
-                    </Layout>
-                    <Layout style={styles.main}>
-                        <Text category='c1'>
-                            {uplaodText +
-                                (type == "banner"
+              >
+                {remove}
+              </Button>
+            </Layout>
+            <Layout style={styles.main}>
+              <Text category='c1'>
+                {uplaodText +
+                                (type === "banner"
                                     ? bannerTitle
-                                    : type == "qualification"
+                                    : type === "qualification"
                                     ? qualificationTitle
                                     : logoTitle)}
-                        </Text>
-                        <UpLoadImage
-                            style={styles.upload}
-                            value={img}
-                            changeIcon={changeImg}
-                            size={133}
-                        />
+              </Text>
+              <UpLoadImage
+                style={styles.upload}
+                value={img}
+                changeIcon={changeImg}
+                size={133}
+              />
 
-                        <Button
-                            disabled={!img}
-                            style={styles.button}
-                            onPress={() => {
-                                uploadStoreImg(img, type).then((_) => {
+              <Button
+                disabled={!img}
+                style={styles.button}
+                onPress={() => {
+                                uploadStoreImg(img, type).then(() => {
                                     changeImg("");
                                 });
                             }}
-                        >
-                            {uplaodImg}
-                        </Button>
-                    </Layout>
-                </Layout>
-            </ScrollPage>
-        </>
+              >
+                {uplaodImg}
+              </Button>
+            </Layout>
+          </Layout>
+        </ScrollPage>
+      </>
     );
 }
 
-const styles = StyleSheet.create({
-    container: {
-        flex: 1,
-        paddingBottom: 33,
-    },
-    icon: {
-        width: 90,
-        height: 80,
-        marginBottom: 26,
-    },
-    text: {
-        fontWeight: "500",
-        marginBottom: 7,
-    },
-    button: {
-        marginTop: 19,
-    },
-    top: {
-        paddingVertical: 7,
-        height: 114,
-        backgroundColor: "#eee",
-        alignSelf: "stretch",
-        alignItems: "center",
-        justifyContent: "center",
-    },
-    banner: {
-        flex: 1,
-        alignSelf: "stretch",
-    },
-    logo: {
-        width: 50,
-        height: 50,
-        borderRadius: 3,
-    },
-    remove: {
-        position: "absolute",
-        bottom: 10,
-        right: 10,
-    },
-    upload: {
-        marginTop: 21,
-        width: 133,
-        height: 133,
-        alignSelf: "center",
-    },
-    main: {
-        paddingHorizontal: 24,
-        paddingVertical: 14,
-    },
-    button: {
-        alignSelf: "center",
-        marginTop: 19,
-    },
-});

+ 63 - 79
screens/EditGoods.js

@@ -1,50 +1,59 @@
+/* eslint-disable no-underscore-dangle */
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
-import scrollPage from "../components/ScrollPage";
-import { useModel } from "flooks";
 import {
     Layout,
-    Tab,
-    TabView,
-    Text,
     useTheme,
     Button,
-    Card,
     List,
 } from "@ui-kitten/components";
-import FormInput from "../components/FormInput";
+import { useModel } from "flooks";
 import { useFocusEffect } from "@react-navigation/native";
 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 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,
+    },
+});
+
+
+export default function EditGoods({ navigation }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-    const { banner, logo, uploadStoreImg } = useModel("userModel");
+    // const {  } = 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");
-
+	} = useModel("wordsModel");
+	
+	function getAllGoods() {
+        httpGet("/goods/my").then(res => {
+            changeGoods(res);
+        });
+    }
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
@@ -52,74 +61,49 @@ export default function EditGoods({ navigation, route }) {
         }, [])
     );
 
-    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={() => {
+      <GoodsCardLarge
+        appearance='classification'
+        type='goodsList'
+        key={item.id}
+        info={item}
+        canEdit
+        style={{ marginBottom: 7 }}
+        onPress={() => {
                 navigation.navigate("AddGoods", {
                     id: item.id,
                 });
             }}
-            changeInfo={info => {
-                var _goods = [...goods];
+        changeInfo={info => {
+                const _goods = [...goods];
                 _goods.splice(index, 1, info);
-                console.log(_goods);
                 changeGoods(_goods);
             }}
-        />
+      />
     );
 
     return (
-        <>
-            <NavHeaderBar title={userTitle3} />
-            <Layout style={styles.container}>
-                <Layout style={styles.bntLay}>
-                    <Button
-                        onPress={() => {
+      <>
+        <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={EmptyComponent}
-                />
-            </Layout>
-        </>
+            >
+              {addGoods2}
+            </Button>
+          </Layout>
+          <List
+            style={styles.list}
+            data={goods}
+            renderItem={goodsItem}
+            ListEmptyComponent={EmptyComponent}
+          />
+        </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,
-    },
-});

+ 160 - 172
screens/FullReduction.js

@@ -1,34 +1,68 @@
+/* eslint-disable no-underscore-dangle */
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
-import scrollPage from "../components/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 { useModel } from "flooks";
 import { useFocusEffect } from "@react-navigation/native";
-import NavHeaderBar from "../components/NavHeaderBar";
-import GoodsCard from "../components/GoodsCard";
 import ActionButton from "react-native-action-button";
+import EmptyComponent from "../components/EmptyComponent";
+import NavHeaderBar from "../components/NavHeaderBar";
+
+
+const styles = StyleSheet.create({
+    all: {
+        backgroundColor: "#fff",
+        flex: 1,
+    },
+    lay: {
+        backgroundColor: "#fff",
+    },
+    padBot: {
+        paddingBottom: 100,
+    },
+    list: {
+        paddingVertical: 10,
+        paddingHorizontal: 15,
+        backgroundColor: "transparent",
+        flex: 1,
+    },
+    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",
+    },
+});
+
 
-export default function FullReduction({ navigation, route }) {
+
+export default function FullReduction() {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel", true);
     const { mid } = useModel("userModel");
@@ -44,7 +78,6 @@ export default function FullReduction({ navigation, route }) {
         editText,
         confirm,
         cancel,
-        complete,
         successText,
         removeTips,
     } = useModel("wordsModel");
@@ -67,85 +100,8 @@ export default function FullReduction({ navigation, route }) {
         }, [])
     );
 
-    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'
-                    defaultValue={info.fullAmount.toString()}
-                    style={styles.input}
-                    key={index + 0}
-                    keyboardType='numeric'
-                    onChangeText={value => changeText(value, index, "full")}
-                />
-                <Text>{fullReduction2}</Text>
-                <Input
-                    size='small'
-                    defaultValue={info.minusAmount.toString()}
-                    style={styles.input}
-                    key={index + 1}
-                    keyboardType='numeric'
-                    onChangeText={value => changeText(value, index, "minus")}
-                />
-            </Layout>
-
-            <Button
-                size='small'
-                disabled={!info.minusAmount || !info.fullAmount}
-                onPress={() => saveInfo(info, index)}
-            >
-                {confirm}
-            </Button>
-            {!!info.id && (
-                <Button
-                    size='small'
-                    appearance='outline'
-                    style={styles.buttonlast}
-                    onPress={() => cancelInfo(info, index)}
-                >
-                    {cancel}
-                </Button>
-            )}
-        </Layout>
-    );
-    const editInfo = (info, index) => {
-        let _fullReductions = [...fullReductions];
+	const editInfo = (info, index) => {
+        const _fullReductions = [...fullReductions];
         info.edit = true;
         _fullReductions[index] = info;
         changeFllReduction(_fullReductions);
@@ -156,10 +112,10 @@ export default function FullReduction({ navigation, route }) {
             status: "danger",
             cancelable: true,
             confirmCallback: () => {
-                httpPost("/fullReduction/del/" + info.id)
-                    .then(res => {
+                httpPost(`/fullReduction/del/${  info.id}`)
+                    .then(() => {
                         success(successText);
-                        let _fullReductions = [...fullReductions];
+                        const _fullReductions = [...fullReductions];
                         _fullReductions.splice(index, 1);
                         changeFllReduction(_fullReductions);
                     })
@@ -170,7 +126,7 @@ export default function FullReduction({ navigation, route }) {
         });
     };
     const cancelInfo = (info, index) => {
-        let _fullReductions = [...fullReductions];
+        const _fullReductions = [...fullReductions];
         if (info.id) {
             info.edit = false;
             _fullReductions[index] = info;
@@ -193,7 +149,7 @@ export default function FullReduction({ navigation, route }) {
         )
             .then(res => {
                 success(successText);
-                let _fullReductions = [...fullReductions];
+                const _fullReductions = [...fullReductions];
                 _fullReductions.splice(index, 1, {
                     ...res,
                     edit: false,
@@ -205,9 +161,9 @@ export default function FullReduction({ navigation, route }) {
             });
     };
     function changeText(value, index, type) {
-        let _fullReductions = [...fullReductions];
-        let info = _fullReductions[index];
-        if (type == "full") {
+        const _fullReductions = [...fullReductions];
+        const info = _fullReductions[index];
+        if (type === "full") {
             info.fullAmount = value;
         } else {
             info.minusAmount = value;
@@ -216,9 +172,8 @@ export default function FullReduction({ navigation, route }) {
         changeFllReduction(_fullReductions);
     }
     const addFullReduction = () => {
-        console.log("aaa");
-        let _fullReductions = [...fullReductions];
-        let last = _fullReductions[_fullReductions.length - 1];
+        const _fullReductions = [...fullReductions];
+        const last = _fullReductions[_fullReductions.length - 1];
         if (last.id) {
             _fullReductions.push({
                 fullAmount: "",
@@ -226,75 +181,108 @@ export default function FullReduction({ navigation, route }) {
             });
             changeFllReduction(_fullReductions);
         }
+	};
+	
+
+    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'
+            defaultValue={info.fullAmount.toString()}
+            style={styles.input}
+            key={index + 0}
+            keyboardType='numeric'
+            onChangeText={value => changeText(value, index, "full")}
+          />
+          <Text>{fullReduction2}</Text>
+          <Input
+            size='small'
+            defaultValue={info.minusAmount.toString()}
+            style={styles.input}
+            key={index + 1}
+            keyboardType='numeric'
+            onChangeText={value => changeText(value, index, "minus")}
+          />
+        </Layout>
+
+        <Button
+          size='small'
+          disabled={!info.minusAmount || !info.fullAmount}
+          onPress={() => saveInfo(info, index)}
+        >
+          {confirm}
+        </Button>
+        {!!info.id && (
+        <Button
+          size='small'
+          appearance='outline'
+          style={styles.buttonlast}
+          onPress={() => cancelInfo(info, index)}
+        >
+          {cancel}
+        </Button>
+            )}
+      </Layout>
+    );
+
+	const renderItem = ({ item, index }) => {
+        if (!item.id || item.edit) {
+            return editItem(item, index);
+        } 
+            return saveItem(item);
+        
     };
 
     return (
-        <>
-            <NavHeaderBar title={userTitle21} />
-            <Layout style={styles.all}>
-                <Layout style={[styles.all]}>
-                    <List
-                        style={styles.list}
-                        data={fullReductions}
-                        renderItem={renderItem}
-                        ListEmptyComponent={EmptyComponent}
-                        keyboardShouldPersistTaps='handled'
-                    />
-                </Layout>
-                <ActionButton
-                    buttonColor={theme["color-primary-500"]}
-                    onPress={addFullReduction}
-                    position='left'
-                />
-            </Layout>
-        </>
+      <>
+        <NavHeaderBar title={userTitle21} />
+        <Layout style={styles.all}>
+          <Layout style={[styles.all]}>
+            <List
+              style={styles.list}
+              data={fullReductions}
+              renderItem={renderItem}
+              ListEmptyComponent={EmptyComponent}
+              keyboardShouldPersistTaps='handled'
+            />
+          </Layout>
+          <ActionButton
+            buttonColor={theme["color-primary-500"]}
+            onPress={addFullReduction}
+            position='left'
+          />
+        </Layout>
+      </>
     );
 }
 
-const PulsIcon = props => (
-    <Icon
-        {...props}
-        style={[props.style, { width: 33, height: 33 }]}
-        name='plus-circle'
-    />
-);
-const styles = StyleSheet.create({
-    all: {
-        backgroundColor: "#fff",
-        flex: 1,
-    },
-    lay: {
-        backgroundColor: "#fff",
-    },
-    padBot: {
-        paddingBottom: 100,
-    },
-    list: {
-        paddingVertical: 10,
-        paddingHorizontal: 15,
-        backgroundColor: "transparent",
-        flex: 1,
-    },
-    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",
-    },
-});
+

+ 276 - 278
screens/Goods/GoodsDetailScreen.js

@@ -1,289 +1,287 @@
-import * as WebBrowser from "expo-web-browser";
-import * as React from "react";
-import {
-    Image,
-    Platform,
-    StyleSheet,
-    View,
-    ImageBackground,
-} from "react-native";
-import scrollPage from "../components/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 NavHeaderBar from "../../components/NavHeaderBar";
-import GoodsCard from "../../components/GoodsCard";
-import ActionButton from "react-native-action-button";
+// import * as WebBrowser from "expo-web-browser";
+// import * as React from "react";
+// import {
+//     Image,
+//     Platform,
+//     StyleSheet,
+//     View,
+//     ImageBackground,
+// } from "react-native";
+// import {
+//     Layout,
+//     Tab,
+//     TabView,
+//     Text,
+//     useTheme,
+//     Button,
+//     Card,
+//     List,
+//     Input,
+//     Icon,
+// } from "@ui-kitten/components";
+// import { useModel } from "flooks";
+// import { useFocusEffect } from "@react-navigation/native";
+// import ActionButton from "react-native-action-button";
+// import ScrollPage from "../../components/ScrollPage";
+// import EmptyComponent from "../../components/EmptyComponent";
+// import NavHeaderBar from "../../components/NavHeaderBar";
 
-export default function GoodsDetailScreen({ 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");
+// export default function GoodsDetailScreen() {
+//     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"]);
+//     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) => {
-                if (res.length > 0) {
-                    changeFllReduction(
-                        res.map((item) => {
-                            return { ...item, edit: false };
-                        })
-                    );
-                }
-            });
-        }, [])
-    );
+//             httpGet("/fullReduction/my").then((res) => {
+//                 if (res.length > 0) {
+//                     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 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>
+//     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>
-    );
+//             <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}
-                    key={0}
-                    keyboardType='numeric'
-                    onChangeText={(value) => changeText(value, index, "full")}
-                />
-                <Text>{fullReduction2}</Text>
-                <Input
-                    size='small'
-                    value={info.minusAmount}
-                    style={styles.input}
-                    key={1}
-                    keyboardType='numeric'
-                    onChangeText={(value) => changeText(value, index, "minus")}
-                />
-            </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}
+//                     key={0}
+//                     keyboardType='numeric'
+//                     onChangeText={(value) => changeText(value, index, "full")}
+//                 />
+//                 <Text>{fullReduction2}</Text>
+//                 <Input
+//                     size='small'
+//                     value={info.minusAmount}
+//                     style={styles.input}
+//                     key={1}
+//                     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();
-        }
+//             <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);
-        }
-    };
+//         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>
-        </>
-    );
-}
+//     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",
-    },
-});
+// 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",
+//     },
+// });

+ 188 - 199
screens/Goods/GoodsSpecificationScreen.js

@@ -1,36 +1,71 @@
+/* eslint-disable no-underscore-dangle */
+/* eslint-disable no-shadow */
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
 import { useModel } from "flooks";
 import {
     Layout,
-    Tab,
-    TabView,
     Text,
     useTheme,
     Button,
-    Card,
     Input,
-    Icon,
 } from "@ui-kitten/components";
-import EmptyComponent from "../../components/EmptyComponent";
-import FormInput from "../../components/FormInput";
 import { useFocusEffect, useRoute } from "@react-navigation/native";
+import ActionButton from "react-native-action-button";
 import ListComponent from "../../components/ListComponent";
 import NavHeaderBar from "../../components/NavHeaderBar";
-import GoodsCard from "../../components/GoodsCard";
-import ActionButton from "react-native-action-button";
 
-export default function GoodsSpecificationScreen({ navigation }) {
+
+
+const styles = StyleSheet.create({
+    lay: {
+        backgroundColor: "#fff",
+        flex: 1,
+    },
+    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",
+    },
+    money: {
+        marginLeft: 10,
+    },
+});
+
+
+export default function GoodsSpecificationScreen() {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel", true);
-    const { mid } = useModel("userModel");
+    // const { mid } = useModel("userModel");
     const { httpGet, httpPost } = useModel("httpModel", true);
     const { success, warnning } = useModel("loadingModel", true);
     const { showDialog } = useModel("dialogModel");
@@ -42,14 +77,10 @@ export default function GoodsSpecificationScreen({ navigation }) {
     const [isNew, changeIsNew] = React.useState(false);
 
     const {
-        userTitle21,
-        fullReduction2,
-        fullReduction1,
         delText,
         editText,
         confirm,
         cancel,
-        complete,
         successText,
         removeTips,
     } = useModel("wordsModel");
@@ -63,8 +94,8 @@ export default function GoodsSpecificationScreen({ navigation }) {
     const route = useRoute();
 
     function getList() {
-        let { params } = route;
-        let { goodsId } = params || {};
+        const { params } = route;
+        const { goodsId } = params || {};
         setGoodsId(goodsId);
         return httpGet(
             "/goodsSpecification/byGoodsId",
@@ -79,16 +110,16 @@ export default function GoodsSpecificationScreen({ navigation }) {
             } else {
                 changeIsNew(false);
             }
-            let content = res || [];
+            const content = res || [];
             if (isNew || addNew) {
                 content.push({ name: "", amount: "" });
             }
 
             return Promise.resolve({
                 content: content.map(item => {
-                    let _info = { ...item, amount: item.amount.toString() };
+                    const _info = { ...item, amount: item.amount.toString() };
 
-                    if (!_info.id || editList.indexOf(_info.id) != -1) {
+                    if (!_info.id || editList.indexOf(_info.id) !== -1) {
                         _info.edit = true;
                     } else {
                         _info.edit = false;
@@ -98,112 +129,22 @@ export default function GoodsSpecificationScreen({ navigation }) {
                 last: true,
             });
         });
-    }
-
-    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}>
-            <Layout style={[styles.text, styles.flexRow]}>
-                <Text category='c1'>添加{info.name}</Text>
-                <Layout style={styles.money}>
-                    <Text category='c1'>¥{info.amount}</Text>
-                </Layout>
-            </Layout>
-
-            <Button
-                size='small'
-                appearance='outline'
-                onPress={() => editInfo(info.id)}
-            >
-                {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>规格</Text>
-                <Input
-                    size='small'
-                    defaultValue={info.name}
-                    style={styles.input}
-                    key={index + "_0"}
-                    keyboardType='numeric'
-                    onChangeText={text => {
-                        let _editInfo = { ...allEditInfo } || {};
-                        if (!_editInfo[info.id || "new"]) {
-                            _editInfo[info.id || "new"] = {};
-                        }
-                        _editInfo[info.id || "new"]["name"] = text;
-                        setEdit(_editInfo);
-                    }}
-                />
-                <Text>价钱</Text>
-                <Input
-                    size='small'
-                    defaultValue={info.amount}
-                    style={styles.input}
-                    key={index + "_1"}
-                    keyboardType='numeric'
-                    onChangeText={text => {
-                        let _editInfo = { ...allEditInfo } || {};
-                        if (!_editInfo[info.id || "new"]) {
-                            _editInfo[info.id || "new"] = {};
-                        }
-                        _editInfo[info.id || "new"]["amount"] = text;
-                        setEdit(_editInfo);
-                    }}
-                />
-            </Layout>
-
-            <Button size='small' onPress={() => saveInfo(info)}>
-                {confirm}
-            </Button>
-            <Button
-                size='small'
-                appearance='outline'
-                style={styles.buttonlast}
-                onPress={() => cancelInfo(info)}
-            >
-                {cancel}
-            </Button>
-        </Layout>
-    );
-
-    function setName(index, text) {}
-
-    function setAmount(index, text) {}
-
-    const editInfo = id => {
-        let _editList = [...editList];
+	const editInfo = id => {
+        const _editList = [...editList];
         _editList.push(id);
         setEditList(_editList);
         changeState(true);
     };
-    const delInfo = (info, index) => {
+    const delInfo = (info) => {
         showDialog({
             bodyText: removeTips,
             status: "danger",
             cancelable: true,
             confirmCallback: () => {
-                httpPost("/goodsSpecification/del/" + info.id)
-                    .then(res => {
+                httpPost(`/goodsSpecification/del/${  info.id}`)
+                    .then(() => {
                         success(successText);
                         changeState(true);
                     })
@@ -213,16 +154,16 @@ export default function GoodsSpecificationScreen({ navigation }) {
             },
         });
     };
-    //取消
+    // 取消
     const cancelInfo = info => {
-        let _editInfo = { ...allEditInfo };
+        const _editInfo = { ...allEditInfo };
         _editInfo[info.id || "new"] = {};
         setEdit(_editInfo);
 
         if (info.id) {
             let _editList = [...editList];
             _editList = _editList.filter(item => {
-                return item != res.id;
+                return item !== info.id;
             });
             setEditList(_editList);
         } else if (!isNew) {
@@ -230,38 +171,134 @@ export default function GoodsSpecificationScreen({ navigation }) {
         }
         changeState(true);
     };
-    //保存
+    // 保存
     const saveInfo = info => {
-        let _editInfo = { ...allEditInfo };
+        const _editInfo = { ...allEditInfo };
         let name = "";
         let amount = "";
         if (_editInfo[info.id || "new"]) {
-            name = _editInfo[info.id || "new"]["name"];
-            amount = _editInfo[info.id || "new"]["amount"];
+            name = _editInfo[info.id || "new"].name;
+            amount = _editInfo[info.id || "new"].amount;
         }
-        let data = {
+        const data = {
             ...info,
-            name: name,
-            amount: amount,
-            goodsId: goodsId,
+            name,
+            amount,
+            goodsId,
         };
         if (!info.id && !isNew) {
             changeNew(false);
         }
 
         addClassGoods(data).then(res => {
-            _editInfo["new"] = {};
+            _editInfo.new = {};
             _editInfo[res.id] = {};
             setEdit(_editInfo);
             let _editList = [...editList];
             _editList = _editList.filter(item => {
-                return item != res.id;
+                return item !== res.id;
             });
             setEditList(_editList);
             changeState(true);
         });
     };
 
+	
+	const saveItem = (info, index) => (
+  <Layout style={styles.item}>
+    <Layout style={[styles.text, styles.flexRow]}>
+      <Text category='c1'>
+        添加
+        {info.name}
+      </Text>
+      <Layout style={styles.money}>
+        <Text category='c1'>
+          ¥
+          {info.amount}
+        </Text>
+      </Layout>
+    </Layout>
+  
+    <Button
+      size='small'
+      appearance='outline'
+      onPress={() => editInfo(info.id)}
+    >
+      {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>规格</Text>
+      <Input
+        size='small'
+        defaultValue={info.name}
+        style={styles.input}
+        key={`${index  }_0`}
+        keyboardType='numeric'
+        onChangeText={text => {
+						  const _editInfo = { ...allEditInfo } || {};
+						  if (!_editInfo[info.id || "new"]) {
+							  _editInfo[info.id || "new"] = {};
+						  }
+						  _editInfo[info.id || "new"].name = text;
+						  setEdit(_editInfo);
+					  }}
+      />
+      <Text>价钱</Text>
+      <Input
+        size='small'
+        defaultValue={info.amount}
+        style={styles.input}
+        key={`${index  }_1`}
+        keyboardType='numeric'
+        onChangeText={text => {
+						  const _editInfo = { ...allEditInfo } || {};
+						  if (!_editInfo[info.id || "new"]) {
+							  _editInfo[info.id || "new"] = {};
+						  }
+						  _editInfo[info.id || "new"].amount = text;
+						  setEdit(_editInfo);
+					  }}
+      />
+    </Layout>
+  
+    <Button size='small' onPress={() => saveInfo(info)}>
+      {confirm}
+    </Button>
+    <Button
+      size='small'
+      appearance='outline'
+      style={styles.buttonlast}
+      onPress={() => cancelInfo(info)}
+    >
+      {cancel}
+    </Button>
+  </Layout>
+	  );
+
+    const renderItem = ({ item, index }) => {
+        if (!item.id || item.edit) {
+            return editItem(item, index);
+        } 
+            return saveItem(item);
+        
+    };
+
+   
+
+    
     //
     const addFullReduction = () => {
         changeNew(true);
@@ -269,73 +306,25 @@ export default function GoodsSpecificationScreen({ navigation }) {
     };
 
     return (
-        <>
-            <NavHeaderBar title='商品规格编辑' />
+      <>
+        <NavHeaderBar title='商品规格编辑' />
 
-            <Layout style={[styles.lay]}>
-                <ListComponent
-                    getInfo={getList}
-                    renderItem={renderItem}
-                    style={styles.list}
-                    separatorStyle={styles.separatorStyle}
-                    showEmpty={true}
-                    extraData={{ allEditInfo }}
-                    startState={startState}
-                />
-                <ActionButton
-                    buttonColor={theme["color-primary-500"]}
-                    onPress={addFullReduction}
-                    position='left'
-                />
-            </Layout>
-        </>
+        <Layout style={[styles.lay]}>
+          <ListComponent
+            getInfo={getList}
+            renderItem={renderItem}
+            style={styles.list}
+            separatorStyle={styles.separatorStyle}
+            showEmpty
+            extraData={{ allEditInfo }}
+            startState={startState}
+          />
+          <ActionButton
+            buttonColor={theme["color-primary-500"]}
+            onPress={addFullReduction}
+            position='left'
+          />
+        </Layout>
+      </>
     );
 }
-
-const PulsIcon = props => (
-    <Icon
-        {...props}
-        style={[props.style, { width: 33, height: 33 }]}
-        name='plus-circle'
-    />
-);
-const styles = StyleSheet.create({
-    lay: {
-        backgroundColor: "#fff",
-        flex: 1,
-    },
-    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",
-    },
-    money: {
-        marginLeft: 10,
-    },
-});

+ 57 - 75
screens/Goods/SearchScreen.js

@@ -1,49 +1,57 @@
+/* eslint-disable no-underscore-dangle */
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
 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 SearchScreen({ navigation, route }) {
+
+
+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,
+    },
+});
+
+
+export default function SearchScreen({ navigation }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-    const { banner, logo, uploadStoreImg } = useModel("userModel");
+    // const { } = 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");
+	function getAllGoods() {
+        httpGet("/goods/my").then(res => {
+            changeGoods(res);
+        });
+    }
 
     useFocusEffect(
         React.useCallback(() => {
@@ -52,68 +60,42 @@ export default function SearchScreen({ navigation, route }) {
         }, [])
     );
 
-    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={() => {
+      <GoodsCardLarge
+        appearance='classification'
+        type='goodsList'
+        key={item.id}
+        info={item}
+        canEdit
+        style={{ marginBottom: 7 }}
+        onPress={() => {
                 navigation.navigate("AddGoods", {
                     id: item.id,
                 });
             }}
-            changeInfo={info => {
-                var _goods = [...goods];
+        changeInfo={info => {
+                const _goods = [...goods];
                 _goods.splice(index, 1, info);
-                console.log(_goods);
                 changeGoods(_goods);
             }}
-        />
+      />
     );
 
     return (
-        <>
-            <NavHeaderBar title={userTitle3} />
-            <Layout style={styles.container}>
-                <Layout style={styles.bntLay}>
-                    <Input />
-                </Layout>
-                <List
-                    style={styles.list}
-                    data={goods}
-                    renderItem={goodsItem}
-                    ListEmptyComponent={EmptyComponent}
-                />
-            </Layout>
-        </>
+      <>
+        <NavHeaderBar title={userTitle3} />
+        <Layout style={styles.container}>
+          <Layout style={styles.bntLay}>
+            {/* <Input /> */}
+          </Layout>
+          <List
+            style={styles.list}
+            data={goods}
+            renderItem={goodsItem}
+            ListEmptyComponent={EmptyComponent}
+          />
+        </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,
-    },
-});

+ 10 - 10
screens/Goods/index.js

@@ -5,15 +5,15 @@ import GoodsSpecificationScreen from "./GoodsSpecificationScreen";
 
 export default function Set(Screen) {
     return (
-        <>
-            {/* 搜索 */}
-            <Screen name='SearchScreen' component={SearchScreen} />
-            {/* 商品规格 */}
-            <Screen
-                name='GoodsSpecification'
-                component={GoodsSpecificationScreen}
-                initialParams={{ goodsId: 562 }}
-            />
-        </>
+      <>
+        {/* 搜索 */}
+        <Screen name='SearchScreen' component={SearchScreen} />
+        {/* 商品规格 */}
+        <Screen
+          name='GoodsSpecification'
+          component={GoodsSpecificationScreen}
+          initialParams={{ goodsId: 562 }}
+        />
+      </>
     );
 }

+ 228 - 237
screens/Guide1Screen.js

@@ -1,31 +1,85 @@
+/* eslint-disable no-shadow */
+/* eslint-disable camelcase */
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
-import scrollPage from "../components/ScrollPage";
-import { useModel } from "flooks";
 import {
     Layout,
-    Tab,
-    TabView,
     Text,
     useTheme,
     Button,
     Card,
 } from "@ui-kitten/components";
-import FormInput from "../components/FormInput";
+import { useModel } from "flooks";
 import { useFocusEffect, useRoute } from "@react-navigation/native";
+import moment from 'moment';
+import Textarea from "react-native-textarea";
+import ScrollPage from "../components/ScrollPage";
+import FormInput from "../components/FormInput";
 import ConnectButton from "../components/ConnectButton";
 import GuideHeaderBar from "../components/GuideHeaderBar";
-import Textarea from "react-native-textarea";
 import NavHeaderBar from "../components/NavHeaderBar";
-import moment from "moment";
-import { CommonActions } from "@react-navigation/native";
+
+
+
+const styles = StyleSheet.create({
+    container: {
+        flex: 1,
+        paddingBottom: 33,
+    },
+    tabContent: {
+        backgroundColor: "#fff",
+        marginTop: 20,
+    },
+    img: {
+        width: 100,
+        height: 100,
+        alignSelf: "center",
+    },
+    img2: {
+        width: 97,
+        height: 21,
+        alignSelf: "center",
+        marginTop: 2,
+    },
+    text: {
+        marginTop: 16,
+    },
+    layoutLeft: {
+        // flexDirection: "row",
+        paddingVertical: 10,
+        justifyContent: "center",
+        alignItems: "center",
+    },
+    form: {
+        paddingHorizontal: 26,
+        paddingVertical: 20,
+    },
+    textareaContainer: {
+        backgroundColor: "#F0F0F0",
+        height: 100,
+        borderRadius: 4,
+    },
+    textarea: {
+        textAlignVertical: "top", // hack android
+        fontSize: 13,
+        color: "#333",
+        paddingHorizontal: 14,
+        paddingVertical: 10,
+        height: 100,
+    },
+    lay: {
+        flexDirection: "row",
+        marginLeft: 120,
+        marginBottom: 10,
+    },
+    money: {
+        marginLeft: 10,
+    },
+});
+
 
 export default function Guide1Screen({ navigation }) {
     const theme = useTheme();
@@ -69,31 +123,48 @@ export default function Guide1Screen({ navigation }) {
     const [startTime, changeStartTime] = React.useState("08:00");
     const [endTime, changeEndTime] = React.useState("22:00");
     const [introduction, changeIntroduction] = React.useState();
-    const [loadingSuccess, ChangeLoadingSuccess] = React.useState(false);
     const [defaultValue, ChangeDefaultValue] = React.useState("");
     const [goodsSpecification, changeGoodsSpecification] = React.useState([]);
-    const [isIn, changeIn] = React.useState(false);
 
     const [img, changeImg] = React.useState();
-    const timeValue = React.useMemo(() => {
-        if (week && startTime && endTime) {
-            return week + " " + startTime + "~" + endTime;
-        } else {
-            return " ";
+  
+    function getInfo(res) {
+        changeName(res.name || "");
+        if (res.discountAmount) {
+            changeDiscountAmount(res.discountAmount.toString());
         }
-    }, [week, startTime, endTime]);
+        if (res.amount) {
+            changeAmount(res.amount.toString());
+        }
+        if (res.inventory) {
+            changeInventory(res.inventory.toString());
+        }
+        changeWeek(res.week || "");
+        changeStartTime(res.startTime || "");
+        changeEndTime(res.endTime || "");
+        changeIntroduction(res.introduction || "");
+        // if (res.img && res.img.length) {
+        changeImg(res.img);
+        // }
 
+        if (res.week) {
+            ChangeDefaultValue([
+                `${moment(res.startTime, "HH:mm:ss").format("HH:mm") 
+                    }~${ 
+                    moment(res.endTime, "HH:mm:ss").format("HH:mm")}`,
+                res.week,
+            ]);
+        }
+    }
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
-            let { params } = route;
+            const { params } = route;
             if (params) {
                 if (params.id) {
-                    changeIn(false);
                     changeId(params.id);
-                    httpGet("/goods/get/" + params.id).then(res => {
+                    httpGet(`/goods/get/${params.id}`).then(res => {
                         getInfo(res);
-                        ChangeLoadingSuccess(true);
                     });
 
                     httpGet(
@@ -107,51 +178,27 @@ export default function Guide1Screen({ navigation }) {
                     });
                 }
             } else {
-                ChangeLoadingSuccess(true);
                 getInfo({});
             }
         }, [])
     );
 
-    function getInfo(res) {
-        changeName(res.name || "");
-        if (res.discountAmount) {
-            changeDiscountAmount(res.discountAmount.toString());
-        }
-        if (res.amount) {
-            changeAmount(res.amount.toString());
-        }
-        if (res.inventory) {
-            changeInventory(res.inventory.toString());
-        }
-        changeWeek(res.week || "");
-        changeStartTime(res.startTime || "");
-        changeEndTime(res.endTime || "");
-        changeIntroduction(res.introduction || "");
-        console.log(res);
-        // if (res.img && res.img.length) {
-        changeImg(res.img);
-        // }
-
-        if (res.week) {
-            ChangeDefaultValue([
-                moment(res.startTime, "HH:mm:ss").format("HH:mm") +
-                    "~" +
-                    moment(res.endTime, "HH:mm:ss").format("HH:mm"),
-                res.week,
-            ]);
-        }
-    }
 
     const specify = () => {
         return goodsSpecification.map(item => {
             return (
-                <Layout key={item.id} style={styles.lay}>
-                    <Text category='c1'>添加{item.name}</Text>
-                    <Layout style={styles.money}>
-                        <Text category='c1'>¥{item.amount}</Text>
-                    </Layout>
+              <Layout key={item.id} style={styles.lay}>
+                <Text category='c1'>
+                  添加
+                  {item.name}
+                </Text>
+                <Layout style={styles.money}>
+                  <Text category='c1'>
+                    ¥
+                    {item.amount}
+                  </Text>
                 </Layout>
+              </Layout>
             );
         });
     };
@@ -167,9 +214,9 @@ export default function Guide1Screen({ navigation }) {
             img
         ) {
             return true;
-        } else {
+        } 
             return false;
-        }
+        
     }, [
         name,
         amount,
@@ -183,56 +230,56 @@ export default function Guide1Screen({ navigation }) {
     ]);
 
     return (
-        <>
-            {routeName != "AddGoods" ? (
-                <GuideHeaderBar />
+      <>
+        {routeName !== "AddGoods" ? (
+          <GuideHeaderBar />
             ) : (
-                <NavHeaderBar title={addGoods} />
+              <NavHeaderBar title={addGoods} />
             )}
 
-            <ScrollPage>
-                <Layout style={styles.container}>
-                    {routeName != "AddGoods" && (
-                        <Card appearance='headFilled'>
-                            <Text category='s1'>{guide1_title1}</Text>
-                            <Text category='s1'>{guideHome_title2}</Text>
-                        </Card>
+        <ScrollPage>
+          <Layout style={styles.container}>
+            {routeName !== "AddGoods" && (
+            <Card appearance='headFilled'>
+              <Text category='s1'>{guide1_title1}</Text>
+              <Text category='s1'>{guideHome_title2}</Text>
+            </Card>
                     )}
-                    <Card appearance='formFilled'>
-                        {/* 商品名称 */}
-                        <FormInput
-                            label={guide1_form_1}
-                            placeholder={guide1_pla_1}
-                            value={name}
-                            onChange={changeName}
-                            style={{ paddingVertical: 3 }}
-                        />
-                        {/* 商品价格 */}
-                        <FormInput
-                            label={guide1_form_2}
-                            placeholder={guide1_pla_2}
-                            value={amount}
-                            type='money'
-                            onChange={changeAmount}
-                            textAlign='right'
-                        />
+            <Card appearance='formFilled'>
+              {/* 商品名称 */}
+              <FormInput
+                label={guide1_form_1}
+                placeholder={guide1_pla_1}
+                value={name}
+                onChange={changeName}
+                style={{ paddingVertical: 3 }}
+              />
+              {/* 商品价格 */}
+              <FormInput
+                label={guide1_form_2}
+                placeholder={guide1_pla_2}
+                value={amount}
+                type='money'
+                onChange={changeAmount}
+                textAlign='right'
+              />
 
-                        {/* 优惠价格 */}
-                        <FormInput
-                            label={guide1_form_3}
-                            placeholder={guide1_pla_3}
-                            value={discountAmount}
-                            type='money'
-                            onChange={changeDiscountAmount}
-                            textAlign='right'
-                        />
-                        {id != 0 && (
-                            <>
-                                {/* 商品规格 */}
-                                <FormInput
-                                    label='商品规格'
-                                    type='url'
-                                    changePath={() => {
+              {/* 优惠价格 */}
+              <FormInput
+                label={guide1_form_3}
+                placeholder={guide1_pla_3}
+                value={discountAmount}
+                type='money'
+                onChange={changeDiscountAmount}
+                textAlign='right'
+              />
+              {id !== 0 && (
+                <>
+                  {/* 商品规格 */}
+                  <FormInput
+                    label='商品规格'
+                    type='url'
+                    changePath={() => {
                                         navigation.navigate(
                                             "GoodsSpecification",
                                             {
@@ -240,58 +287,58 @@ export default function Guide1Screen({ navigation }) {
                                             }
                                         );
                                     }}
-                                    textAlign='right'
-                                />
-                                {specify()}
-                            </>
+                    textAlign='right'
+                  />
+                  {specify()}
+                </>
                         )}
 
-                        {/* 每日供应数量 */}
-                        <FormInput
-                            label={guide1_form_4}
-                            placeholder={guide1_pla_4}
-                            value={inventory}
-                            type='amount'
-                            onChange={changeInventory}
-                        />
+              {/* 每日供应数量 */}
+              <FormInput
+                label={guide1_form_4}
+                placeholder={guide1_pla_4}
+                value={inventory}
+                type='amount'
+                onChange={changeInventory}
+              />
 
-                        {/* 供应时间 */}
-                        <FormInput
-                            label={guide1_form_5}
-                            type='openTime'
-                            defaultValue={defaultValue}
-                            onChange={(week, startTime, endTime) => {
+              {/* 供应时间 */}
+              <FormInput
+                label={guide1_form_5}
+                type='openTime'
+                defaultValue={defaultValue}
+                onChange={(week, startTime, endTime) => {
                                 changeWeek(week);
                                 changeStartTime(startTime);
                                 changeEndTime(endTime);
                             }}
-                        />
+              />
 
-                        <Layout>
-                            <Textarea
-                                containerStyle={styles.textareaContainer}
-                                style={styles.textarea}
-                                onChangeText={changeIntroduction}
-                                defaultValue={introduction}
-                                maxLength={50}
-                                placeholder={guide1_pla_5}
-                                placeholderTextColor={"#B4B4B4"}
-                                underlineColorAndroid={"transparent"}
-                            />
-                        </Layout>
+              <Layout>
+                <Textarea
+                  containerStyle={styles.textareaContainer}
+                  style={styles.textarea}
+                  onChangeText={changeIntroduction}
+                  defaultValue={introduction}
+                  maxLength={50}
+                  placeholder={guide1_pla_5}
+                  placeholderTextColor="#B4B4B4"
+                  underlineColorAndroid="transparent"
+                />
+              </Layout>
 
-                        <FormInput
-                            type='img'
-                            value={img}
-                            textAlign='right'
-                            onChange={changeImg}
-                        />
+              <FormInput
+                type='img'
+                value={img}
+                textAlign='right'
+                onChange={changeImg}
+              />
 
-                        <Layout style={styles.layoutLeft} level='1'>
-                            <Button
-                                status='primary'
-                                disabled={!canNext}
-                                onPress={() => {
+              <Layout style={styles.layoutLeft} level='1'>
+                <Button
+                  status='primary'
+                  disabled={!canNext}
+                  onPress={() => {
                                     httpPost(
                                         "/goods/save",
                                         {
@@ -311,8 +358,8 @@ export default function Guide1Screen({ navigation }) {
                                         true
                                     ).then(res => {
                                         if (!id) {
-                                            let { params } = route;
-                                            let { classifyId } = params || {};
+                                            const { params } = route;
+                                            const { classifyId } = params || {};
                                             if (classifyId) {
                                                 addClassification(
                                                     classifyId,
@@ -321,50 +368,50 @@ export default function Guide1Screen({ navigation }) {
                                             }
                                         }
                                         success(
-                                            (id ? "修改" : "添加") + "成功"
+                                            `${id ? "修改" : "添加"  }成功`
                                         );
-                                        if (routeName != "AddGoods") {
+                                        if (routeName !== "AddGoods") {
                                             changeGuideStep(2);
                                         } else {
                                             navigation.goBack();
                                         }
                                     });
                                 }}
-                            >
-                                {routeName != "AddGoods" ? next : confirm}
-                            </Button>
-                            {routeName == "AddGoods" && id != 0 && (
-                                <Button
-                                    appearance='ghost'
-                                    status='info'
-                                    style={{ marginTop: 10 }}
-                                    onPress={() => {
+                >
+                  {routeName !== "AddGoods" ? next : confirm}
+                </Button>
+                {routeName === "AddGoods" && id !== 0 && (
+                <Button
+                  appearance='ghost'
+                  status='info'
+                  style={{ marginTop: 10 }}
+                  onPress={() => {
                                         showDialog({
                                             bodyText: removeTips,
                                             cancelable: true,
                                             confirmCallback: () => {
                                                 httpPost(
-                                                    "/goods/del/" + id,
+                                                    `/goods/del/${  id}`,
                                                     {},
                                                     {},
                                                     true
-                                                ).then(res => {
+                                                ).then(() => {
                                                     success("删除成功");
                                                     navigation.goBack();
                                                 });
                                             },
                                         });
                                     }}
-                                >
-                                    {delText}
-                                </Button>
+                >
+                  {delText}
+                </Button>
                             )}
-                            {routeName != "AddGoods" && (
-                                <Button
-                                    style={{ marginTop: 10 }}
-                                    appearance='ghost'
-                                    status='primary'
-                                    onPress={() => {
+                {routeName !== "AddGoods" && (
+                <Button
+                  style={{ marginTop: 10 }}
+                  appearance='ghost'
+                  status='primary'
+                  onPress={() => {
                                         showDialog({
                                             bodyText: passTips,
                                             cancelable: true,
@@ -373,71 +420,15 @@ export default function Guide1Screen({ navigation }) {
                                             },
                                         });
                                     }}
-                                >
-                                    {pass}
-                                </Button>
+                >
+                  {pass}
+                </Button>
                             )}
-                        </Layout>
-                    </Card>
-                    {routeName != "AddGoods" && <ConnectButton />}
-                </Layout>
-            </ScrollPage>
-        </>
+              </Layout>
+            </Card>
+            {routeName !== "AddGoods" && <ConnectButton />}
+          </Layout>
+        </ScrollPage>
+      </>
     );
 }
-
-const styles = StyleSheet.create({
-    container: {
-        flex: 1,
-        paddingBottom: 33,
-    },
-    tabContent: {
-        backgroundColor: "#fff",
-        marginTop: 20,
-    },
-    img: {
-        width: 100,
-        height: 100,
-        alignSelf: "center",
-    },
-    img2: {
-        width: 97,
-        height: 21,
-        alignSelf: "center",
-        marginTop: 2,
-    },
-    text: {
-        marginTop: 16,
-    },
-    layoutLeft: {
-        // flexDirection: "row",
-        paddingVertical: 10,
-        justifyContent: "center",
-        alignItems: "center",
-    },
-    form: {
-        paddingHorizontal: 26,
-        paddingVertical: 20,
-    },
-    textareaContainer: {
-        backgroundColor: "#F0F0F0",
-        height: 100,
-        borderRadius: 4,
-    },
-    textarea: {
-        textAlignVertical: "top", // hack android
-        fontSize: 13,
-        color: "#333",
-        paddingHorizontal: 14,
-        paddingVertical: 10,
-        height: 100,
-    },
-    lay: {
-        flexDirection: "row",
-        marginLeft: 120,
-        marginBottom: 10,
-    },
-    money: {
-        marginLeft: 10,
-    },
-});

+ 136 - 136
screens/Guide2Screen.js

@@ -1,37 +1,85 @@
+/* eslint-disable no-underscore-dangle */
+/* eslint-disable camelcase */
+/* eslint-disable no-unused-vars */
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
-import scrollPage from "../components/ScrollPage";
-import { useModel } from "flooks";
-import NavHeaderBar from "../components/NavHeaderBar";
 import {
     Layout,
-    Tab,
-    TabView,
     Text,
     useTheme,
     Button,
     Card,
 } from "@ui-kitten/components";
-import FormInput from "../components/FormInput";
+import { useModel } from "flooks";
 import { useFocusEffect, useRoute } from "@react-navigation/native";
+import ScrollPage from "../components/ScrollPage";
+import NavHeaderBar from "../components/NavHeaderBar";
+import FormInput from "../components/FormInput";
 import ConnectButton from "../components/ConnectButton";
 import GuideHeaderBar from "../components/GuideHeaderBar";
-import Textarea from "react-native-textarea";
-import * as RootNavigation from "../navigation/RootNavigation.js";
+import * as RootNavigation from "../navigation/RootNavigation";
+
+
+const styles = StyleSheet.create({
+    container: {
+        flex: 1,
+        paddingBottom: 33,
+    },
+    tabContent: {
+        backgroundColor: "#fff",
+        marginTop: 20,
+    },
+    img: {
+        width: 100,
+        height: 100,
+        alignSelf: "center",
+    },
+    img2: {
+        width: 97,
+        height: 21,
+        alignSelf: "center",
+        marginTop: 2,
+    },
+    text: {
+        marginTop: 16,
+    },
+    layoutLeft: {
+        // flexDirection: "row",
+        paddingVertical: 10,
+        justifyContent: "center",
+        alignItems: "center",
+    },
+    form: {
+        paddingHorizontal: 26,
+        paddingVertical: 20,
+    },
+    textareaContainer: {
+        backgroundColor: "#F0F0F0",
+        height: 100,
+        borderRadius: 4,
+    },
+    textarea: {
+        textAlignVertical: "top", // hack android
+        fontSize: 13,
+        color: "#333",
+        paddingHorizontal: 14,
+        paddingVertical: 10,
+        height: 100,
+    },
+});
 
-export default function Guide1Screen({ navigation }) {
+
+
+
+export default function Guide1Screen() {
     const route = useRoute();
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-    const { httpGet, httpPost } = useModel("httpModel", true);
-    const { registerSecend, changeGuideStep, mid } = useModel(
+    const {  httpPost } = useModel("httpModel", true);
+    const { changeGuideStep, mid } = useModel(
         "userModel",
         true
     );
@@ -71,7 +119,7 @@ export default function Guide1Screen({ navigation }) {
     );
     React.useEffect(() => {
         if (selectInfos.length > 0) {
-            let _ids = selectInfos.map(item => {
+            const _ids = selectInfos.map(item => {
                 return item.id;
             });
             changeGoodsIds(_ids.join(","));
@@ -81,9 +129,9 @@ export default function Guide1Screen({ navigation }) {
     const canNext = React.useMemo(() => {
         if (name && sort) {
             return true;
-        } else {
+        } 
             return false;
-        }
+        
     }, [name, sort, goodsIds]);
 
     const addClass = () => {
@@ -100,75 +148,75 @@ export default function Guide1Screen({ navigation }) {
     };
 
     return (
-        <>
-            {pageName != "AddNewClass" && <GuideHeaderBar />}
-            {pageName === "AddNewClass" && <NavHeaderBar title='添加分类' />}
-            <ScrollPage>
-                <Layout style={styles.container}>
-                    {pageName != "AddNewClass" && (
-                        <Card appearance='headFilled'>
-                            <Text category='s1'>{guide2_title1}</Text>
-                            <Text category='s1'>{guide2_title2}</Text>
-                        </Card>
+      <>
+        {pageName !== "AddNewClass" && <GuideHeaderBar />}
+        {pageName === "AddNewClass" && <NavHeaderBar title='添加分类' />}
+        <ScrollPage>
+          <Layout style={styles.container}>
+            {pageName !== "AddNewClass" && (
+            <Card appearance='headFilled'>
+              <Text category='s1'>{guide2_title1}</Text>
+              <Text category='s1'>{guide2_title2}</Text>
+            </Card>
                     )}
-                    <Card appearance='formFilled'>
-                        {/* 类别名称 */}
-                        <FormInput
-                            label={guide2_form_1}
-                            placeholder={guide2_pla_1}
-                            value={name}
-                            onChange={changeName}
-                            style={{ paddingVertical: 3 }}
-                        />
-                        {/* 显示排序 */}
-                        <FormInput
-                            label={guide2_form_2}
-                            value={sort}
-                            type='actionSheet'
-                            list={[1, 2, 3, 4, 5, 6, 7, 8, 9]}
-                            onChange={changeSort}
-                            textAlign='right'
-                        />
+            <Card appearance='formFilled'>
+              {/* 类别名称 */}
+              <FormInput
+                label={guide2_form_1}
+                placeholder={guide2_pla_1}
+                value={name}
+                onChange={changeName}
+                style={{ paddingVertical: 3 }}
+              />
+              {/* 显示排序 */}
+              <FormInput
+                label={guide2_form_2}
+                value={sort}
+                type='actionSheet'
+                list={[1, 2, 3, 4, 5, 6, 7, 8, 9]}
+                onChange={changeSort}
+                textAlign='right'
+              />
 
-                        {/* 商品 */}
-                        <FormInput
-                            label={guide2_form_3}
-                            value={goodsIds}
-                            type='url'
-                            changePath={() => {
+              {/* 商品 */}
+              <FormInput
+                label={guide2_form_3}
+                value={goodsIds}
+                type='url'
+                changePath={() => {
                                 RootNavigation.navigate("AddClassification", {
                                     type: "classification",
                                     classificationId: "new",
                                     preKey: route.name,
                                 });
                             }}
-                            textAlign='right'
-                        />
-                        {pageName === "AddNewClass" && (
-                            <Layout style={styles.layoutLeft} level='1'>
-                                <Button
-                                    status='primary'
-                                    disabled={!canNext}
-                                    onPress={() => {
+                textAlign='right'
+              />
+              {pageName === "AddNewClass" && (
+                <Layout style={styles.layoutLeft} level='1'>
+                  <Button
+                    status='primary'
+                    disabled={!canNext}
+                    onPress={() => {
                                         addClass().then(_ => {
                                             success("添加成功");
                                             RootNavigation.goBack();
                                             changeSelect([]);
                                         });
                                     }}
-                                >
-                                    确定
-                                </Button>
-                            </Layout>
+                  >
+                    确定
+                  </Button>
+                </Layout>
                         )}
-                    </Card>
-                    {pageName !== "AddNewClass" && (
-                        <ConnectButton>
-                            <Layout style={styles.layoutLeft} level='1'>
-                                <Button
-                                    status='primary'
-                                    disabled={!canNext}
-                                    onPress={() => {
+            </Card>
+            {pageName !== "AddNewClass" && (
+            <ConnectButton>
+              <Layout style={styles.layoutLeft} level='1'>
+                <Button
+                  status='primary'
+                  disabled={!canNext}
+                  onPress={() => {
                                         addClass()
                                             .then(_ => {
                                                 success("添加成功");
@@ -176,14 +224,14 @@ export default function Guide1Screen({ navigation }) {
                                             })
                                             .then(e => {});
                                     }}
-                                >
-                                    {next}
-                                </Button>
-                                <Button
-                                    style={{ marginTop: 10 }}
-                                    appearance='ghost'
-                                    status='primary'
-                                    onPress={() => {
+                >
+                  {next}
+                </Button>
+                <Button
+                  style={{ marginTop: 10 }}
+                  appearance='ghost'
+                  status='primary'
+                  onPress={() => {
                                         showDialog({
                                             bodyText: passTips,
                                             cancelable: true,
@@ -192,62 +240,14 @@ export default function Guide1Screen({ navigation }) {
                                             },
                                         });
                                     }}
-                                >
-                                    {pass}
-                                </Button>
-                            </Layout>
-                        </ConnectButton>
+                >
+                  {pass}
+                </Button>
+              </Layout>
+            </ConnectButton>
                     )}
-                </Layout>
-            </ScrollPage>
-        </>
+          </Layout>
+        </ScrollPage>
+      </>
     );
 }
-
-const styles = StyleSheet.create({
-    container: {
-        flex: 1,
-        paddingBottom: 33,
-    },
-    tabContent: {
-        backgroundColor: "#fff",
-        marginTop: 20,
-    },
-    img: {
-        width: 100,
-        height: 100,
-        alignSelf: "center",
-    },
-    img2: {
-        width: 97,
-        height: 21,
-        alignSelf: "center",
-        marginTop: 2,
-    },
-    text: {
-        marginTop: 16,
-    },
-    layoutLeft: {
-        // flexDirection: "row",
-        paddingVertical: 10,
-        justifyContent: "center",
-        alignItems: "center",
-    },
-    form: {
-        paddingHorizontal: 26,
-        paddingVertical: 20,
-    },
-    textareaContainer: {
-        backgroundColor: "#F0F0F0",
-        height: 100,
-        borderRadius: 4,
-    },
-    textarea: {
-        textAlignVertical: "top", // hack android
-        fontSize: 13,
-        color: "#333",
-        paddingHorizontal: 14,
-        paddingVertical: 10,
-        height: 100,
-    },
-});

+ 87 - 92
screens/Guide3Screen.js

@@ -1,112 +1,23 @@
+/* eslint-disable camelcase */
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
-import scrollPage from "../components/ScrollPage";
 import { useModel } from "flooks";
 import {
     Layout,
-    Tab,
-    TabView,
     Text,
     useTheme,
     Button,
     Card,
 } from "@ui-kitten/components";
-import FormInput from "../components/FormInput";
 import { useFocusEffect } from "@react-navigation/native";
+import ScrollPage from "../components/ScrollPage";
+import FormInput from "../components/FormInput";
 import ConnectButton from "../components/ConnectButton";
 import GuideHeaderBar from "../components/GuideHeaderBar";
-import Textarea from "react-native-textarea";
-
-export default function Guide1Screen({ navigation, route }) {
-    const theme = useTheme();
-    const { changeBackground } = useModel("barModel");
-    const { httpGet } = useModel("httpModel", true);
-    const { saveMerchant, guideStep, checkInfo, changeGuideStep } = useModel(
-        "userModel",
-        true
-    );
-
-    const {
-        guide3_title1,
-        guide3_title2,
-        guide3_form_1,
-        guide3_pla_1,
-        guide3_form_2,
-        guide3_pla_2,
-        complete,
-    } = useModel("wordsModel");
-    const [aliName, changeAliName] = React.useState("");
-    const [aliAccount, changeAliAccount] = React.useState("");
-    useFocusEffect(
-        React.useCallback(() => {
-            changeBackground(theme["color-primary-500"]);
-            checkInfo({
-                aliAccountEvent: changeAliAccount,
-                aliNameEvent: changeAliName,
-            });
-        }, [])
-    );
-
-    const canNext = React.useMemo(() => {
-        if (aliAccount && aliName) {
-            return true;
-        } else {
-            return false;
-        }
-    }, [aliName, aliAccount]);
 
-    return (
-        <>
-            <GuideHeaderBar />
-            <ScrollPage>
-                <Layout style={styles.container}>
-                    <Card appearance='headFilled'>
-                        <Text category='s1'>{guide3_title1}</Text>
-                        <Text category='s1'>{guide3_title2}</Text>
-                    </Card>
-                    <Card appearance='formFilled'>
-                        {/* 支付宝账号 */}
-                        <FormInput
-                            label={guide3_form_1}
-                            placeholder={guide3_pla_1}
-                            value={aliName}
-                            onChange={changeAliName}
-                            style={{ paddingVertical: 3 }}
-                        />
-                        {/* 支付宝账户名 */}
-                        <FormInput
-                            label={guide3_form_2}
-                            placeholder={guide3_pla_2}
-                            value={aliAccount}
-                            onChange={changeAliAccount}
-                            style={{ paddingVertical: 3 }}
-                        />
-
-                        <Layout style={styles.layoutLeft} level='1'>
-                            <Button
-                                status='primary'
-                                disabled={!canNext}
-                                onPress={() =>
-                                    saveMerchant({ aliName, aliAccount })
-                                }
-                            >
-                                {complete}
-                            </Button>
-                        </Layout>
-                    </Card>
-                    <ConnectButton />
-                </Layout>
-            </ScrollPage>
-        </>
-    );
-}
 
 const styles = StyleSheet.create({
     container: {
@@ -156,3 +67,87 @@ const styles = StyleSheet.create({
         height: 100,
     },
 });
+
+
+
+export default function Guide1Screen() {
+    const theme = useTheme();
+    const { changeBackground } = useModel("barModel");
+    const { saveMerchant, checkInfo } = useModel(
+        "userModel",
+        true
+    );
+
+    const {
+        guide3_title1,
+        guide3_title2,
+        guide3_form_1,
+        guide3_pla_1,
+        guide3_form_2,
+        guide3_pla_2,
+        complete,
+    } = useModel("wordsModel");
+    const [aliName, changeAliName] = React.useState("");
+    const [aliAccount, changeAliAccount] = React.useState("");
+    useFocusEffect(
+        React.useCallback(() => {
+            changeBackground(theme["color-primary-500"]);
+            checkInfo({
+                aliAccountEvent: changeAliAccount,
+                aliNameEvent: changeAliName,
+            });
+        }, [])
+    );
+
+    const canNext = React.useMemo(() => {
+        if (aliAccount && aliName) {
+            return true;
+        } 
+            return false;
+        
+    }, [aliName, aliAccount]);
+
+    return (
+      <>
+        <GuideHeaderBar />
+        <ScrollPage>
+          <Layout style={styles.container}>
+            <Card appearance='headFilled'>
+              <Text category='s1'>{guide3_title1}</Text>
+              <Text category='s1'>{guide3_title2}</Text>
+            </Card>
+            <Card appearance='formFilled'>
+              {/* 支付宝账号 */}
+              <FormInput
+                label={guide3_form_1}
+                placeholder={guide3_pla_1}
+                value={aliName}
+                onChange={changeAliName}
+                style={{ paddingVertical: 3 }}
+              />
+              {/* 支付宝账户名 */}
+              <FormInput
+                label={guide3_form_2}
+                placeholder={guide3_pla_2}
+                value={aliAccount}
+                onChange={changeAliAccount}
+                style={{ paddingVertical: 3 }}
+              />
+
+              <Layout style={styles.layoutLeft} level='1'>
+                <Button
+                  status='primary'
+                  disabled={!canNext}
+                  onPress={() =>
+                                    saveMerchant({ aliName, aliAccount })}
+                >
+                  {complete}
+                </Button>
+              </Layout>
+            </Card>
+            <ConnectButton />
+          </Layout>
+        </ScrollPage>
+      </>
+    );
+}

+ 41 - 49
screens/Guide4Screen.js

@@ -1,68 +1,21 @@
+/* eslint-disable camelcase */
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
-import scrollPage from "../components/ScrollPage";
 import { useModel } from "flooks";
 import {
     Layout,
-    Tab,
-    TabView,
     Text,
     useTheme,
     Button,
     Card,
 } from "@ui-kitten/components";
-import FormInput from "../components/FormInput";
 import { useFocusEffect } from "@react-navigation/native";
+import ScrollPage from "../components/ScrollPage";
 import ConnectButton from "../components/ConnectButton";
 import GuideHeaderBar from "../components/GuideHeaderBar";
-import Textarea from "react-native-textarea";
-
-export default function Guide1Screen({ navigation, route }) {
-    const theme = useTheme();
-    const { changeBackground } = useModel("barModel");
-    const { httpGet } = useModel("httpModel", true);
-    const { saveMerchant, changeGuideStep } = useModel("userModel", true);
-
-    const { guide4_title1, guide4_title2, complete } = useModel("wordsModel");
-    useFocusEffect(
-        React.useCallback(() => {
-            changeBackground(theme["color-primary-500"]);
-        }, [])
-    );
-
-    return (
-        <>
-            <GuideHeaderBar />
-            <ScrollPage>
-                <Layout style={styles.container}>
-                    <Card appearance='headFilled'>
-                        <Text category='s1'>{guide4_title1}</Text>
-                        <Text category='s1'>{guide4_title2}</Text>
-                    </Card>
-
-                    <Layout style={styles.layoutLeft} level='1'>
-                        <Button
-                            status='primary'
-                            onPress={() =>
-                                changeGuideStep(5)
-                            }
-                        >
-                            {complete}
-                        </Button>
-                    </Layout>
-                    <ConnectButton />
-                </Layout>
-            </ScrollPage>
-        </>
-    );
-}
 
 const styles = StyleSheet.create({
     container: {
@@ -112,3 +65,42 @@ const styles = StyleSheet.create({
         height: 100,
     },
 });
+
+
+export default function Guide1Screen() {
+    const theme = useTheme();
+    const { changeBackground } = useModel("barModel");
+    const {  changeGuideStep } = useModel("userModel", true);
+
+    const { complete,guide4_title1,guide4_title2 } = useModel("wordsModel");
+    useFocusEffect(
+        React.useCallback(() => {
+            changeBackground(theme["color-primary-500"]);
+        }, [])
+    );
+
+    return (
+      <>
+        <GuideHeaderBar />
+        <ScrollPage>
+          <Layout style={styles.container}>
+            <Card appearance='headFilled'>
+              <Text category='s1'>{guide4_title1}</Text>
+              <Text category='s1'>{guide4_title2}</Text>
+            </Card>
+
+            <Layout style={styles.layoutLeft} level='1'>
+              <Button
+                status='primary'
+                onPress={() =>
+                                changeGuideStep(5)}
+              >
+                {complete}
+              </Button>
+            </Layout>
+            <ConnectButton />
+          </Layout>
+        </ScrollPage>
+      </>
+    );
+}

+ 255 - 278
screens/HomeScreen.js

@@ -2,16 +2,12 @@ import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
     Image,
-    Platform,
     StyleSheet,
     TouchableOpacity,
-    View,
     ImageBackground,
     ScrollView,
 } from "react-native";
-import scrollPage from "../components/ScrollPage";
 import { useModel } from "flooks";
-import Badge from "../components/Badge";
 import {
     Layout,
     Text,
@@ -22,25 +18,112 @@ import {
     MenuItem,
     OverflowMenu,
     TopNavigation,
-    TopNavigationAction,
-    Modal,
-    List,
+	TopNavigationAction
 } from "@ui-kitten/components";
-import FormInput from "../components/FormInput";
-import { useFocusEffect, useNavigation } from "@react-navigation/native";
-import NavHeaderBar from "../components/NavHeaderBar";
-import GoodsCard from "../components/GoodsCard";
-import Textarea from "react-native-textarea";
+import { createMaterialTopTabNavigator } from "@react-navigation/material-top-tabs";
+import { useFocusEffect } from "@react-navigation/native";
+import Badge from "../components/Badge";
 import HomePage1 from "./HomeScreenPage1";
 import HomePage2 from "./HomeScreenPage2";
 import HomePage3 from "./HomeScreenPage3";
-import * as RootNavigation from "../navigation/RootNavigation.js";
-import { createMaterialTopTabNavigator } from "@react-navigation/material-top-tabs";
+import * as RootNavigation from "../navigation/RootNavigation";
+
+const styles = StyleSheet.create({
+    container: {
+        flex: 1,
+        backgroundColor: "#F0F0F0",
+    },
+    touch: {
+        width: 53,
+        height: 53,
+        position: "absolute",
+        left: 10,
+        top: 10,
+        zIndex: 2,
+    },
+    icon: {
+        width: 53,
+        height: 53,
+        backgroundColor: "#E5E5E5",
+        borderRadius: 3,
+    },
+    text: {
+        fontWeight: "500",
+        marginBottom: 7,
+    },
+    button: {
+        marginTop: 19,
+    },
+    banner: {
+        height: 100,
+        backgroundColor: "#E5E5E5",
+    },
+    FlexRow: {
+        flexDirection: "row",
+        alignItems: "center",
+        marginTop: 2,
+    },
+    zanImg: {
+        width: 12,
+        height: 12,
+        marginRight: 3,
+    },
+    layItem: {
+        width: 40,
+        marginRight: 10,
+    },
+    cardMain: {
+        alignItems: "center",
+        zIndex: 1,
+    },
+    cardTop: {
+        height: 53,
+        alignItems: "center",
+        justifyContent: "center",
+    },
+    badges: {
+        flexDirection: "row",
+        justifyContent: "center",
+    },
+    badge: {
+        marginRight: 15,
+    },
+    labelText: {
+        textAlign: "left",
+        fontSize: 13,
+        paddingHorizontal: 10,
+        minWidth: 120,
+    },
+    homeCard: {
+        position: "absolute",
+        left: 13,
+        top: 66,
+        right: 13,
+        zIndex: 2,
+    },
+    mainContent: {
+        marginTop: 100,
+        backgroundColor: "transparent",
+    },
+    tab: {
+        backgroundColor: "#eee",
+    },
+    tabContainer: {
+        backgroundColor: "transparent",
+    },
+    tabIndicator: {
+        backgroundColor: "#FFC21C",
+    },
+});
+
+
+
+
 const Tab = createMaterialTopTabNavigator();
 const labelText = (focused, title) => (
-    <Text category='s1' status={focused ? "primary" : ""}>
-        {title}
-    </Text>
+  <Text category='s1' status={focused ? "primary" : ""}>
+    {title}
+  </Text>
 );
 const NextIcon = props => <Icon {...props} name='arrow-ios-downward' />;
 
@@ -50,17 +133,19 @@ const ShareIcon = props => <Icon {...props} name='share-outline' />;
 
 const MenuIcon = props => <Icon {...props} name='more-vertical' />;
 
-const InfoIcon = props => <Icon {...props} name='info' />;
-
 const LogoutIcon = props => <Icon {...props} name='log-out' />;
 
+const img1 = require("../assets/images/zan.png")
+
+const img2 = require("../assets/images/cai.png")
+
+
 export default function HomeScreen({ navigation, route }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
     const {
         showName,
         logo,
-        introduction,
         proclamation,
         updateMerchant,
         banner,
@@ -73,8 +158,6 @@ export default function HomeScreen({ navigation, route }) {
     const {
         homeBar,
         homeTip1,
-        homeTitle1,
-        homeTitle2,
         homeTitle3,
         homeTip2,
         homeTip3,
@@ -84,11 +167,9 @@ export default function HomeScreen({ navigation, route }) {
         fullReduction2,
         fullReduction1,
     } = useModel("wordsModel");
-    const [bannerImg, changeBannerImg] = React.useState([]);
-    const [merchantNatureList, changeMerchantNatureList] = React.useState([]);
     const [fullReductions, changeFllReduction] = React.useState([]);
     const { showDialog } = useModel("dialogModel", true);
-    const { httpPost, httpGet } = useModel("httpModel", true);
+    const { httpGet } = useModel("httpModel", true);
 
     useFocusEffect(
         React.useCallback(() => {
@@ -106,35 +187,35 @@ export default function HomeScreen({ navigation, route }) {
     };
 
     const renderMenuAction = () => (
-        <TopNavigationAction icon={MenuIcon} onPress={toggleMenu} />
+      <TopNavigationAction icon={MenuIcon} onPress={toggleMenu} />
     );
 
     const renderRightActions = () => (
-        <React.Fragment>
-            <TopNavigationAction icon={SearchIcon} />
-            <TopNavigationAction
-                icon={MailIcon}
-                onPress={() => {
+      <>
+        <TopNavigationAction icon={SearchIcon} />
+        <TopNavigationAction
+          icon={MailIcon}
+          onPress={() => {
                     RootNavigation.navigate("SystemEmail");
                 }}
-            />
-            <TopNavigationAction icon={ShareIcon} />
-            <OverflowMenu
-                anchor={renderMenuAction}
-                visible={menuVisible}
-                onBackdropPress={toggleMenu}
-            >
-                {/* <MenuItem accessoryLeft={InfoIcon} title='切换语言' /> */}
-                <MenuItem
-                    accessoryLeft={LogoutIcon}
-                    title='退出登录'
-                    onPress={() => {
+        />
+        <TopNavigationAction icon={ShareIcon} />
+        <OverflowMenu
+          anchor={renderMenuAction}
+          visible={menuVisible}
+          onBackdropPress={toggleMenu}
+        >
+          {/* <MenuItem accessoryLeft={InfoIcon} title='切换语言' /> */}
+          <MenuItem
+            accessoryLeft={LogoutIcon}
+            title='退出登录'
+            onPress={() => {
                         toggleMenu();
                         userLogout();
                     }}
-                />
-            </OverflowMenu>
-        </React.Fragment>
+          />
+        </OverflowMenu>
+      </>
     );
 
     const renderBackAction = () => <Text category='h6'>{homeBar}</Text>;
@@ -142,20 +223,19 @@ export default function HomeScreen({ navigation, route }) {
     const badgeList = list => {
         return list.map(item => {
             return (
-                <Badge style={styles.badge} key={item.id}>
-                    {fullReduction1}
-                    {item.fullAmount}
-                    {fullReduction2}
-                    {item.minusAmount}
-                </Badge>
+              <Badge style={styles.badge} key={item.id}>
+                {fullReduction1}
+                {item.fullAmount}
+                {fullReduction2}
+                {item.minusAmount}
+              </Badge>
             );
         });
     };
+	const [scrollRef, setScroll] = React.useState();
 
     React.useEffect(() => {
-        const unsubscribe = navigation.addListener("tabPress", e => {
-            console.log(navigation);
-            console.log(route);
+        const unsubscribe = navigation.addListener("tabPress", () => {
             if (route.name === "Home") {
                 navigation.jumpTo("homeTab1");
                 if (scrollRef) {
@@ -165,104 +245,94 @@ export default function HomeScreen({ navigation, route }) {
         });
 
         return unsubscribe;
-    }, [navigation]);
+	}, [navigation]);
 
-    const [scrollRef, setScroll] = React.useState();
 
+ 
     return (
-        <>
-            <TopNavigation
-                appearance='homeBar'
-                alignment='center'
-                accessoryLeft={renderBackAction}
-                accessoryRight={renderRightActions}
-            />
-            <ScrollView contentContainerStyle={{ flexGrow: 1 }} ref={setScroll}>
-                <Layout style={styles.container}>
-                    <ImageBackground
-                        source={{ uri: banner }}
-                        style={styles.banner}
-                    >
-                        <Button
-                            appearance='bannerButton'
-                            onPress={() =>
+      <>
+        <TopNavigation
+          appearance='homeBar'
+          alignment='center'
+          accessoryLeft={renderBackAction}
+          accessoryRight={renderRightActions}
+        />
+        <ScrollView contentContainerStyle={{ flexGrow: 1 }} ref={setScroll}>
+          <Layout style={styles.container}>
+            <ImageBackground
+              source={{ uri: banner }}
+              style={styles.banner}
+            >
+              <Button
+                appearance='bannerButton'
+                onPress={() =>
                                 RootNavigation.navigate("EditBanner", {
                                     type: "banner",
-                                })
-                            }
-                        >
-                            {homeTip1}
-                        </Button>
-                    </ImageBackground>
+                                })}
+              >
+                {homeTip1}
+              </Button>
+            </ImageBackground>
 
-                    <Card
-                        disabled={true}
-                        appearance='homeCard'
-                        style={styles.homeCard}
-                    >
-                        <TouchableOpacity
-                            style={styles.touch}
-                            onPress={() =>
+            <Card
+              disabled
+              appearance='homeCard'
+              style={styles.homeCard}
+            >
+              <TouchableOpacity
+                style={styles.touch}
+                onPress={() =>
                                 RootNavigation.navigate("EditBanner", {
                                     type: "logo",
-                                })
-                            }
-                        >
-                            <Image source={{ uri: logo }} style={styles.icon} />
-                        </TouchableOpacity>
+                                })}
+              >
+                <Image source={{ uri: logo }} style={styles.icon} />
+              </TouchableOpacity>
 
-                        <Layout style={styles.cardMain}>
-                            <Layout style={styles.cardTop}>
-                                <Text>{showName}</Text>
-                                <Layout style={[styles.FlexRow]}>
-                                    <Layout
-                                        style={[styles.FlexRow, styles.layItem]}
-                                    >
-                                        <Image
-                                            source={require("../assets/images/zan.png")}
-                                            style={styles.zanImg}
-                                        />
-                                        <Text category='c1' status='primary'>
-                                            {goodNum || 0}
-                                        </Text>
-                                    </Layout>
-                                    <Layout
-                                        style={[styles.FlexRow, styles.layItem]}
-                                    >
-                                        <Image
-                                            source={require("../assets/images/cai.png")}
-                                            style={styles.zanImg}
-                                        />
-                                        <Text category='c1' status='info'>
-                                            {badNum || 0}
-                                        </Text>
-                                    </Layout>
-                                    <Layout>
-                                        <Text category='c1' status='info'>
-                                            {homeTip2}:{monthSales || 0}
-                                        </Text>
-                                    </Layout>
-                                </Layout>
-                            </Layout>
-                            <Layout style={styles.badges}>
-                                {badgeList(fullReductions)}
-                            </Layout>
-                        </Layout>
-                        <Button
-                            appearance='ghost'
-                            status='info'
-                            accessoryRight={NextIcon}
-                            children={TextProps => (
-                                <Text
-                                    style={[TextProps.style, styles.labelText]}
-                                    numberOfLines={1}
-                                    ellipsizeMode='tail'
-                                >
-                                    {homeTip3}:
-                                    {proclamation || "暂无通告,点击编辑"}
-                                </Text>
-                            )}
-                            onPress={() => {
+              <Layout style={styles.cardMain}>
+                <Layout style={styles.cardTop}>
+                  <Text>{showName}</Text>
+                  <Layout style={[styles.FlexRow]}>
+                    <Layout
+                      style={[styles.FlexRow, styles.layItem]}
+                    >
+                      <Image
+                        source={img1}
+                        style={styles.zanImg}
+                      />
+                      <Text category='c1' status='primary'>
+                        {goodNum || 0}
+                      </Text>
+                    </Layout>
+                    <Layout
+                      style={[styles.FlexRow, styles.layItem]}
+                    >
+                      <Image
+                        source={img2}
+                        style={styles.zanImg}
+                      />
+                      <Text category='c1' status='info'>
+                        {badNum || 0}
+                      </Text>
+                    </Layout>
+                    <Layout>
+                      <Text category='c1' status='info'>
+                        {homeTip2}
+                        :
+                        {monthSales || 0}
+                      </Text>
+                    </Layout>
+                  </Layout>
+                </Layout>
+                <Layout style={styles.badges}>
+                  {badgeList(fullReductions)}
+                </Layout>
+              </Layout>
+              <Button
+                appearance='ghost'
+                status='info'
+                accessoryRight={NextIcon}
+                onPress={() => {
                                 showDialog({
                                     pla: "",
                                     maxLength: 50,
@@ -275,157 +345,64 @@ export default function HomeScreen({ navigation, route }) {
                                     },
                                 });
                             }}
-                        />
-                    </Card>
+              >
+                <Text
+                  style={styles.labelText}
+                  numberOfLines={1}
+                  ellipsizeMode='tail'
+                >
+                  {homeTip3}
+                  :
+                  {proclamation || "暂无通告,点击编辑"}
+                </Text>
+              </Button>
+            </Card>
 
-                    <Layout style={styles.mainContent}>
-                        <Tab.Navigator
-                            initialRouteName='homeTab1'
-                            lazy={true}
-                            backBehavior='initialRoute'
-                            unmountOnBlur={true}
-                            tabBarOptions={{
+            <Layout style={styles.mainContent}>
+              <Tab.Navigator
+                initialRouteName='homeTab1'
+                lazy
+                backBehavior='initialRoute'
+                unmountOnBlur
+                tabBarOptions={{
                                 activeTintColor: "#FFC21C",
                                 inactiveTintColor: "#000",
                                 style: styles.tab,
                                 indicatorStyle: styles.tabIndicator,
                                 labelStyle: styles.tab,
                             }}
-                        >
-                            <Tab.Screen
-                                name='homeTab1'
-                                component={HomePage1}
-                                options={{
+              >
+                <Tab.Screen
+                  name='homeTab1'
+                  component={HomePage1}
+                  options={{
                                     tabBarLabel: ({ focused }) =>
                                         labelText(focused, homeTab1),
                                 }}
-                            />
-                            <Tab.Screen
-                                name='homeTab2'
-                                component={HomePage2}
-                                options={{
+                />
+                <Tab.Screen
+                  name='homeTab2'
+                  component={HomePage2}
+                  options={{
                                     tabBarLabel: ({ focused }) =>
                                         labelText(focused, homeTab2),
                                 }}
-                            />
-                            <Tab.Screen
-                                name='homeTab3'
-                                component={HomePage3}
-                                options={{
+                />
+                <Tab.Screen
+                  name='homeTab3'
+                  component={HomePage3}
+                  options={{
                                     tabBarLabel: ({ focused }) =>
                                         labelText(focused, homeTab3),
                                 }}
-                            />
-                        </Tab.Navigator>
-                    </Layout>
-                </Layout>
-            </ScrollView>
-        </>
+                />
+              </Tab.Navigator>
+            </Layout>
+          </Layout>
+        </ScrollView>
+      </>
     );
 }
 
-const styles = StyleSheet.create({
-    container: {
-        flex: 1,
-        backgroundColor: "#F0F0F0",
-    },
-    touch: {
-        width: 53,
-        height: 53,
-        position: "absolute",
-        left: 10,
-        top: 10,
-        zIndex: 2,
-    },
-    icon: {
-        width: 53,
-        height: 53,
-        backgroundColor: "#E5E5E5",
-        borderRadius: 3,
-    },
-    text: {
-        fontWeight: "500",
-        marginBottom: 7,
-    },
-    button: {
-        marginTop: 19,
-    },
-    banner: {
-        height: 100,
-        backgroundColor: "#E5E5E5",
-    },
-    FlexRow: {
-        flexDirection: "row",
-        alignItems: "center",
-        marginTop: 2,
-    },
-    zanImg: {
-        width: 12,
-        height: 12,
-        marginRight: 3,
-    },
-    layItem: {
-        width: 40,
-        marginRight: 10,
-    },
-    cardMain: {
-        alignItems: "center",
-        zIndex: 1,
-    },
-    cardTop: {
-        height: 53,
-        alignItems: "center",
-        justifyContent: "center",
-    },
-    badges: {
-        flexDirection: "row",
-        justifyContent: "center",
-    },
-    badge: {
-        marginRight: 15,
-    },
-    labelText: {
-        textAlign: "left",
-        fontSize: 13,
-        paddingHorizontal: 10,
-        minWidth: 120,
-    },
-    homeCard: {
-        position: "absolute",
-        left: 13,
-        top: 66,
-        right: 13,
-        zIndex: 2,
-    },
-    mainContent: {
-        marginTop: 100,
-        backgroundColor: "transparent",
-    },
-    tab: {
-        backgroundColor: "#eee",
-    },
-    tabContainer: {
-        backgroundColor: "transparent",
-    },
-    tabIndicator: {
-        backgroundColor: "#FFC21C",
-    },
-});
 
-const _pickImage = () => {
-    return new Promise(async (resolve, reject) => {
-        try {
-            let result = await ImagePicker.launchImageLibraryAsync({
-                mediaTypes: ImagePicker.MediaTypeOptions.All,
-                allowsEditing: true,
-                aspect: [4, 3],
-                quality: 1,
-            });
-            if (!result.cancelled) {
-                resolve(result.uri);
-            }
-        } catch (e) {
-            reject(e);
-        }
-    });
-};
+

+ 209 - 210
screens/HomeScreenPage1.js

@@ -1,38 +1,105 @@
+/* eslint-disable no-underscore-dangle */
 import * as React from "react";
 import {
     Icon,
-    useTheme,
     Text,
     Card,
     Layout,
-    List,
     ListItem,
     Button,
 } from "@ui-kitten/components";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
     Dimensions,
 } from "react-native";
 import { useFocusEffect } from "@react-navigation/native";
 import { useModel } from "flooks";
 import GoodsCard from "../components/GoodsCardVertical";
 import GoodsCardLarge from "../components/GoodsCard";
-import * as RootNavigation from "../navigation/RootNavigation.js";
-import ActionButton from "react-native-action-button";
+import * as RootNavigation from "../navigation/RootNavigation";
 import EmptyComponent from "../components/EmptyComponent";
 import {
     ClassificationUtil,
     getClassificationByName,
 } from "../Utils/SystemRuleUtil";
 
-const width = Dimensions.get("window").width;
-const height = Dimensions.get("window").height;
-export default function HomePage1(props) {
-    const theme = useTheme();
+const styles = StyleSheet.create({
+    tabContainer: {
+        backgroundColor: "transparent",
+        flex: 1,
+    },
+    goodsList: {
+        flexDirection: "row",
+        justifyContent: "space-between",
+        paddingVertical: 10,
+        width: Dimensions.get("window").width - 30,
+        backgroundColor: "#F0F0F0",
+    },
+    title: {
+        alignSelf: "stretch",
+    },
+    card: {
+        alignItems: "center",
+        backgroundColor: "#F0F0F0",
+    },
+    container: {
+        backgroundColor: "#F0F0F0",
+        maxWidth: 93,
+        paddingBottom: 100,
+        width: 93,
+        flexShrink: 0,
+    },
+    content: {
+        flexDirection: "row",
+        minHeight: 200,
+        flex: 1,
+    },
+    goodsContainer: {
+        flex: 1,
+        backgroundColor: "#FFFFFF",
+        paddingBottom: 100,
+        paddingTop: 10,
+    },
+    classificat: {
+        backgroundColor: "#F0F0F0",
+    },
+    addClassificat: {
+        width: 36,
+        alignSelf: "center",
+        marginTop: 20,
+    },
+    addGoods: {
+        width: 40,
+        height: 40,
+        alignSelf: "flex-end",
+        marginTop: 20,
+        marginRight: 15,
+    },
+    add: {
+        flex: 1,
+        backgroundColor: "#FFF5D8",
+        borderColor: "#FFF5D8",
+        minHeight: 232,
+        marginHorizontal: 2,
+    },
+    selectItem: {
+        color: "#FFC21C",
+        fontWeight: "bold",
+    },
+    hid: {
+        width: 10,
+        height: 10,
+        position: "absolute",
+        right: -10,
+    },
+});
+
+
+
+const StarIcon = props => <Icon {...props} name='plus' />;
+
+
+export default function HomePage1() {
     const { httpPost, httpGet } = useModel("httpModel", true);
     const [classifications, setClassifications] = React.useState([]);
     const [selectId, changeSelectId] = React.useState(0);
@@ -47,14 +114,21 @@ export default function HomePage1(props) {
         setClassificationId,
         getMyClassification,
         Classifications,
-    } = useModel("goodsModel");
+	} = useModel("goodsModel");
+	
+	function getGoods() {
+        httpGet("/goods/my").then(res => {
+            setGoods(res);
+        });
+    }
+
     useFocusEffect(
         React.useCallback(() => {
             changeBackground("#fff");
             getMyClassification().then(res => {
                 if (!classificationId) {
-                    let _classifications = [...res];
-                    let { id } = _classifications.shift() || {};
+                    const _classifications = [...res];
+                    const { id } = _classifications.shift() || {};
                     changeSelectId(id);
                 } else {
                     changeSelectId(classificationId);
@@ -68,22 +142,16 @@ export default function HomePage1(props) {
         setClassifications(Classifications);
     }, [Classifications]);
 
-    function getGoods() {
-        httpGet("/goods/my").then(res => {
-            setGoods(res);
-        });
-    }
+  
     const topGoods = React.useMemo(() => {
         return goods.filter(item => {
             return item.signboard;
         });
-    }, [goods]);
+	}, [goods]);
+	
+	
+
 
-    const elseGoods = React.useMemo(() => {
-        return goods.filter(item => {
-            return !item.signboard;
-        });
-    }, [goods]);
 
     React.useEffect(() => {
         function getAllGoods() {
@@ -105,7 +173,7 @@ export default function HomePage1(props) {
     const selectClassInfo = React.useMemo(() => {
         return (
             classifications.find(item => {
-                return item.id == selectId;
+                return item.id === selectId;
             }) || {}
         );
     }, [selectId, classifications]);
@@ -113,39 +181,39 @@ export default function HomePage1(props) {
     const classificationList = () => {
         return classifications.map((item, index) => {
             return (
-                <ListItem
-                    appearance='classification'
-                    key={index}
-                    title={textprops => (
-                        <Text
-                            {...textprops}
-                            style={[
+              <ListItem
+                appearance='classification'
+                key={index}
+                title={textprops => (
+                  <Text
+                    {...textprops}
+                    style={[
                                 textprops.style,
                                 { textAlign: "center" },
                                 item.id === selectId && styles.selectItem,
                             ]}
-                        >
-                            {item.name}
-                        </Text>
+                  >
+                    {item.name}
+                  </Text>
                     )}
-                    accessoryRight={props => {
+                accessoryRight={props => {
                         if (!item.isOpen) {
                             return (
-                                <Icon
-                                    fill='rgb(241, 90, 60)'
-                                    {...props}
-                                    style={[props.style, styles.hid]}
-                                    name='power'
-                                />
+                              <Icon
+                                fill='rgb(241, 90, 60)'
+                                {...props}
+                                style={[props.style, styles.hid]}
+                                name='power'
+                              />
                             );
-                        } else {
+                        } 
                             return null;
-                        }
+                        
                     }}
-                    onPress={() => {
+                onPress={() => {
                         changeSelectId(item.id);
                     }}
-                />
+              />
             );
         });
     };
@@ -153,30 +221,46 @@ export default function HomePage1(props) {
     const classGoodsList = () => {
         return goodsClass.map((item, index) => {
             return (
-                <GoodsCardLarge
-                    key={index}
-                    appearance='classification'
-                    info={item}
-                />
+              <GoodsCardLarge
+                key={index}
+                appearance='classification'
+                info={item}
+              />
             );
         });
     };
 
-    const topGoodsItem = ({ item, index }) => <GoodsCard info={item} />;
     const PulsIcon = props => (
-        <Icon
-            {...props}
-            style={[props.style, { width: 50, height: 50 }]}
-            name='plus'
-        />
-    );
+      <Icon
+        {...props}
+        // eslint-disable-next-line react/destructuring-assignment
+        style={[props.style, { width: 50, height: 50 }]}
+        name='plus'
+      />
+	);
+	
+	
+    function changeSignboard(id, signboard) {
+        httpPost(
+            "/goods/save",
+            {
+                id,
+                signboard,
+            },
+            { body: "json" }
+        ).then(() => {
+            success(remove + successText);
+            getGoods();
+        });
+    }
+
     const topGoodsMap = list => {
-        var _list = list.map((item, index) => {
+        const _list = list.map((item, index) => {
             return (
-                <GoodsCard
-                    info={item}
-                    key={index}
-                    removeEvent={() => {
+              <GoodsCard
+                info={item}
+                key={index}
+                removeEvent={() => {
                         showDialog({
                             bodyText: removeTips,
                             status: "danger",
@@ -186,90 +270,77 @@ export default function HomePage1(props) {
                             },
                         });
                     }}
-                />
+              />
             );
         });
-        if (_list.length == 0) {
+        if (_list.length === 0) {
             _list.push(
-                <Button
-                    style={styles.add}
-                    accessoryLeft={PulsIcon}
-                    key={1}
-                    onPress={() => {
+              <Button
+                style={styles.add}
+                accessoryLeft={PulsIcon}
+                key={1}
+                onPress={() => {
                         RootNavigation.navigate("AddClassification", {
                             type: "signboard",
                         });
                     }}
-                />
+              />
             );
         }
-        if (_list.length == 1) {
+        if (_list.length === 1) {
             _list.push(
-                <Button
-                    style={styles.add}
-                    accessoryLeft={PulsIcon}
-                    key={2}
-                    onPress={() => {
+              <Button
+                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(remove + successText);
-            getGoods();
-        });
-    }
 
     return (
-        <>
-            <Layout style={styles.tabContainer}>
-                <Card
-                    appearance='homePage1Card'
-                    disabled={true}
-                    style={styles.card}
-                    backgroundColor='#F0F0F0'
-                    header={props => (
-                        <Text {...props} style={[styles.title, props.style]}>
-                            店主推荐
-                        </Text>
+      <>
+        <Layout style={styles.tabContainer}>
+          <Card
+            appearance='homePage1Card'
+            disabled
+            style={styles.card}
+            backgroundColor='#F0F0F0'
+            header={props => (
+              <Text {...props} style={[styles.title, props.style]}>
+                店主推荐
+              </Text>
                     )}
-                >
-                    {/* <List
+          >
+            {/* <List
                     style={styles.goodsList}
                     data={topGoods}
                     renderItem={topGoodsItem}
                 /> */}
-                    <Layout style={styles.goodsList}>
-                        {topGoodsMap(topGoods)}
-                    </Layout>
-                </Card>
+            <Layout style={styles.goodsList}>
+              {topGoodsMap(topGoods)}
+            </Layout>
+          </Card>
 
-                <Layout style={styles.content}>
-                    <Layout style={styles.container}>
-                        {classificationList()}
-                        <Button
-                            style={styles.addClassificat}
-                            appearance='classification'
-                            onPress={() => {
+          <Layout style={styles.content}>
+            <Layout style={styles.container}>
+              {classificationList()}
+              <Button
+                style={styles.addClassificat}
+                appearance='classification'
+                onPress={() => {
                                 RootNavigation.navigate("ClassificationManage");
                             }}
-                        >
-                            编辑分类
-                        </Button>
-                    </Layout>
-                    {/* <List
+              >
+                编辑分类
+              </Button>
+            </Layout>
+            {/* <List
                         style={styles.container}
                         data={classifications}
                         renderItem={classificationItem}
@@ -277,24 +348,24 @@ export default function HomePage1(props) {
                          
                         )}
                     /> */}
-                    <Layout style={styles.goodsContainer}>
-                        {classGoodsList()}
+            <Layout style={styles.goodsContainer}>
+              {classGoodsList()}
 
-                        {goodsClass.length === 0 && <EmptyComponent />}
+              {goodsClass.length === 0 && <EmptyComponent />}
 
-                        <Button
-                            style={styles.addGoods}
-                            appearance='classification'
-                            status='danger'
-                            accessoryLeft={StarIcon}
-                            onPress={() => {
-                                let _classificationUtil = new ClassificationUtil(
+              <Button
+                style={styles.addGoods}
+                appearance='classification'
+                status='danger'
+                accessoryLeft={StarIcon}
+                onPress={() => {
+                                const _classificationUtil = new ClassificationUtil(
                                     selectClassInfo
                                 );
                                 if (
-                                    _classificationUtil.getType() ==
+                                    _classificationUtil.getType() ===
                                         getClassificationByName("好评") ||
-                                    _classificationUtil.getType() ==
+                                    _classificationUtil.getType() ===
                                         getClassificationByName("折扣")
                                 ) {
                                     setClassificationId(selectId);
@@ -311,86 +382,14 @@ export default function HomePage1(props) {
                                     });
                                 }
                             }}
-                        />
-                    </Layout>
-                </Layout>
+              />
             </Layout>
-        </>
+          </Layout>
+        </Layout>
+      </>
     );
 }
-const StarIcon = props => <Icon {...props} name='plus' />;
-
 // const goodsItem = ({ item, index }) => (
 //     <GoodsCardLarge key={index} appearance='classification' info={item} />
 // );
 
-const styles = StyleSheet.create({
-    tabContainer: {
-        backgroundColor: "transparent",
-        flex: 1,
-    },
-    goodsList: {
-        flexDirection: "row",
-        justifyContent: "space-between",
-        paddingVertical: 10,
-        width: width - 30,
-        backgroundColor: "#F0F0F0",
-    },
-    title: {
-        alignSelf: "stretch",
-    },
-    card: {
-        alignItems: "center",
-        backgroundColor: "#F0F0F0",
-    },
-    container: {
-        backgroundColor: "#F0F0F0",
-        maxWidth: 93,
-        paddingBottom: 100,
-        width: 93,
-        flexShrink: 0,
-    },
-    content: {
-        flexDirection: "row",
-        minHeight: 200,
-        flex: 1,
-    },
-    goodsContainer: {
-        flex: 1,
-        backgroundColor: "#FFFFFF",
-        paddingBottom: 100,
-        paddingTop: 10,
-    },
-    classificat: {
-        backgroundColor: "#F0F0F0",
-    },
-    addClassificat: {
-        width: 36,
-        alignSelf: "center",
-        marginTop: 20,
-    },
-    addGoods: {
-        width: 40,
-        height: 40,
-        alignSelf: "flex-end",
-        marginTop: 20,
-        marginRight: 15,
-    },
-    add: {
-        flex: 1,
-        backgroundColor: "#FFF5D8",
-        borderColor: "#FFF5D8",
-        minHeight: 232,
-        marginHorizontal: 2,
-    },
-    selectItem: {
-        color: "#FFC21C",
-        fontWeight: "bold",
-    },
-    hid: {
-        width: 10,
-        height: 10,
-        position: "absolute",
-        right: -10,
-    },
-});

+ 56 - 74
screens/HomeScreenPage2.js

@@ -1,91 +1,18 @@
 import * as React from "react";
 import {
-    Icon,
-    useTheme,
-    Text,
-    Card,
     Layout,
-    List,
-    ListItem,
     Button,
 } from "@ui-kitten/components";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
-    Dimensions,
 } from "react-native";
-import { useFocusEffect } from "@react-navigation/native";
 import { useModel } from "flooks";
 import CommentCard from "../components/Comment";
 import Badge from "../components/Badge";
-import * as RootNavigation from "../navigation/RootNavigation.js";
+import * as RootNavigation from "../navigation/RootNavigation";
 
-const width = Dimensions.get("window").width;
-const height = Dimensions.get("window").height;
-export default function HomePage2(props) {
-    const theme = useTheme();
-    const { httpPost, httpGet } = useModel("httpModel", true);
-    const [commentList, setCommentList] = React.useState([{}, {}, {}]);
-    const [selectId, changeSelectId] = React.useState(0);
-    const { showDialog } = useModel("dialogModel", true);
 
-    const { editAutoBack, autoBackText } = useModel("wordsModel");
 
-    const allCommentList = () => {
-        return commentList.map((item, index) => {
-            return <CommentCard key={index} />;
-        });
-    };
-
-    return (
-        <Layout style={styles.tabContainer}>
-            <Layout style={styles.bageList}>
-                <Badge appearance='fill' status='warning' right={5} bottom={4}>
-                    全部7345
-                </Badge>
-                <Badge appearance='fill' right={5} bottom={4}>
-                    最新
-                </Badge>
-                <Badge appearance='fill' right={5} bottom={4}>
-                    好评1213
-                </Badge>
-                <Badge appearance='fill' status='info' right={5} bottom={4}>
-                    差评12
-                </Badge>
-                <Badge appearance='fill' right={5} bottom={4}>
-                    最新
-                </Badge>
-                <Badge appearance='fill' right={5} bottom={4}>
-                    好评1213
-                </Badge>
-                <Badge appearance='fill' status='info' right={5} bottom={4}>
-                    差评12
-                </Badge>
-            </Layout>
-            <Layout style={styles.back}>
-                <Button
-                    style={styles.backButtn}
-                    onPress={() => {
-                        RootNavigation.navigate("Automatic");
-                    }}
-                >
-                    {editAutoBack}
-                </Button>
-            </Layout>
-
-            <Layout style={styles.container}>{allCommentList()}</Layout>
-        </Layout>
-    );
-}
-const classificationItem = ({ item, index }) => <CommentCard />;
-const StarIcon = props => <Icon {...props} name='plus-outline' />;
-
-const goodsItem = ({ item, index }) => (
-    <GoodsCardLarge appearance='classification' />
-);
 
 const styles = StyleSheet.create({
     tabContainer: {
@@ -119,3 +46,58 @@ const styles = StyleSheet.create({
     },
     container: {},
 });
+
+
+
+export default function HomePage2() {
+     // eslint-disable-next-line no-unused-vars
+     const [commentList, setCommentList] = React.useState([{}, {}, {}]);
+
+    const { editAutoBack } = useModel("wordsModel");
+
+    const allCommentList = () => {
+        return commentList.map((item, index) => {
+            return <CommentCard key={index} />;
+        });
+    };
+
+    return (
+      <Layout style={styles.tabContainer}>
+        <Layout style={styles.bageList}>
+          <Badge appearance='fill' status='warning' right={5} bottom={4}>
+            全部7345
+          </Badge>
+          <Badge appearance='fill' right={5} bottom={4}>
+            最新
+          </Badge>
+          <Badge appearance='fill' right={5} bottom={4}>
+            好评1213
+          </Badge>
+          <Badge appearance='fill' status='info' right={5} bottom={4}>
+            差评12
+          </Badge>
+          <Badge appearance='fill' right={5} bottom={4}>
+            最新
+          </Badge>
+          <Badge appearance='fill' right={5} bottom={4}>
+            好评1213
+          </Badge>
+          <Badge appearance='fill' status='info' right={5} bottom={4}>
+            差评12
+          </Badge>
+        </Layout>
+        <Layout style={styles.back}>
+          <Button
+            style={styles.backButtn}
+            onPress={() => {
+                        RootNavigation.navigate("Automatic");
+                    }}
+          >
+            {editAutoBack}
+          </Button>
+        </Layout>
+
+        <Layout style={styles.container}>{allCommentList()}</Layout>
+      </Layout>
+    );
+}

+ 183 - 212
screens/HomeScreenPage3.js

@@ -1,58 +1,112 @@
+/* eslint-disable no-underscore-dangle */
 import * as React from "react";
 import {
     Icon,
-    useTheme,
     Text,
-    Card,
     Layout,
-    List,
-    ListItem,
     Button,
     Menu,
     MenuItem,
 } from "@ui-kitten/components";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
-    Dimensions,
 } from "react-native";
-import { useFocusEffect } from "@react-navigation/native";
 import { useModel } from "flooks";
-import CommentCard from "../components/Comment";
-import Badge from "../components/Badge";
-import UpLoadImage from "../components/UpLoadImage";
 import Textarea from "react-native-textarea";
-import * as RootNavigation from "../navigation/RootNavigation.js";
-
 import OpenTimeUtil from "../Utils/OpenTimeUtil";
 import ListUtil from "../Utils/ListUtil";
-import ActionButton from "react-native-action-button";
+import UpLoadImage from "../components/UpLoadImage";
+import * as RootNavigation from "../navigation/RootNavigation";
+
+
+const ForwardIcon = props => (
+  <Icon
+    {...props}
+    name='arrow-ios-forward'
+    fill='#B4B4B4'
+    style={{ width: 15, height: 15, fontWeight: 500 }}
+  />
+  );
+  
+  const styles = StyleSheet.create({
+	  tabContainer: {
+		  backgroundColor: "#fff",
+		  flex: 1,
+	  },
+	  top: {
+		  paddingVertical: 20,
+		  paddingHorizontal: 13,
+	  },
+	  imgList: {
+		  flexDirection: "row",
+	  },
+	  upload: {
+		  marginRight: 10,
+		  width: 67,
+		  flexShrink: 0,
+	  },
+	  textareaContainer: {
+		  backgroundColor: "#F0F0F0",
+		  height: 100,
+		  alignSelf: "stretch",
+		  borderRadius: 4,
+	  },
+	  textarea: {
+		  textAlignVertical: "top", // hack android
+		  fontSize: 13,
+		  color: "#333",
+		  paddingHorizontal: 14,
+		  paddingVertical: 10,
+		  height: 100,
+	  },
+	  text: {
+		  paddingVertical: 10,
+	  },
+	  button: {
+		  alignSelf: "flex-end",
+		  marginTop: 10,
+		  marginRight: 14,
+	  },
+	  menu: {
+		  borderColor: "#EEEEEE",
+		  borderTopWidth: 6,
+		  backgroundColor: "#fff",
+		  paddingHorizontal: 15,
+	  },
+	  menuItem: {},
+	  lable: {
+		  flexDirection: "row",
+		  flex: 1,
+	  },
+	  lableName: {
+		  flexShrink: 0,
+		  flexBasis: "50%",
+		  marginHorizontal: 8,
+		  fontSize: 13,
+	  },
+	  lableText: {}
+  });
+  
 
 const Label = (props, title, value) => (
-    <Layout style={[styles.lable]}>
-        <Text {...props} style={[styles.lableName]}>
-            {title}
-        </Text>
-        <Text
-            {...props}
-            style={[props.style, styles.lableText]}
-            numberOfLines={1}
-            ellipsizeMode='tail'
-        >
-            {value}
-        </Text>
-    </Layout>
+  <Layout style={[styles.lable]}>
+    <Text {...props} style={[styles.lableName]}>
+      {title}
+    </Text>
+    <Text
+      {...props}
+      // eslint-disable-next-line react/destructuring-assignment
+      style={[props.style, styles.lableText]}
+      numberOfLines={1}
+      ellipsizeMode='tail'
+    >
+      {value}
+    </Text>
+  </Layout>
 );
 
-export default function HomePage3(props) {
-    const theme = useTheme();
-    const { httpPost, httpGet } = useModel("httpModel", true);
-    const [commentList, setCommentList] = React.useState([{}, {}, {}]);
-    const [selectId, changeSelectId] = React.useState(0);
-    const { showDialog } = useModel("dialogModel", true);
+export default function HomePage3() {
+	const { showDialog } = useModel("dialogModel", true);
     const [text, changeText] = React.useState("");
     const {
         img,
@@ -67,11 +121,9 @@ export default function HomePage3(props) {
         startTime,
     } = useModel("userModel");
     const categoryList = new ListUtil(category);
-    const { loading, success } = useModel("loadingModel");
+    const { success } = useModel("loadingModel");
 
     const {
-        editText,
-        autoBackText,
         home3Title1,
         home3Title2,
         confirm,
@@ -80,34 +132,35 @@ export default function HomePage3(props) {
     } = useModel("wordsModel");
 
     const imgList = React.useMemo(() => {
-        let list = img ? img.split(",") : [];
+        const list = img ? img.split(",") : [];
         list.push("");
-        console.log(list);
         return [...new Set(list)];
     }, [img]);
 
     const openTime = React.useMemo(() => {
         if (startTime && endTime && week && weekWords) {
-            let _o = new OpenTimeUtil(startTime, endTime, week, weekWords());
+            // eslint-disable-next-line no-underscore-dangle
+            const _o = new OpenTimeUtil(startTime, endTime, week, weekWords());
             return _o.getShowStr();
-        } else {
+        } 
             return "";
-        }
+        
     }, [startTime, endTime, week, weekWords]);
 
+    // eslint-disable-next-line no-shadow
     function changeImg(img, index) {
-        let _imgs = [...imgList];
+        const _imgs = [...imgList];
         _imgs.splice(index, 1, img);
-        let _img1 = new Set(_imgs);
+        const _img1 = new Set(_imgs);
         updateMerchant({
             img: [..._img1].join(","),
         });
     }
 
     function delImg(index) {
-        let _imgs = [...imgList];
+        const _imgs = [...imgList];
         _imgs.splice(index, 1);
-        let _img1 = new Set(_imgs);
+        const _img1 = new Set(_imgs);
         updateMerchant({
             img: [..._img1].join(","),
         });
@@ -116,17 +169,18 @@ export default function HomePage3(props) {
     const showImgList = list => {
         return list.map((item, index) => {
             return (
-                <Layout key={index} style={styles.upload}>
-                    <UpLoadImage
-                        value={item}
-                        changeIcon={img => changeImg(img, index)}
-                        size={67}
-                        hasCancel={true}
-                        delEvent={() => {
+              <Layout key={index} style={styles.upload}>
+                <UpLoadImage
+                  value={item}
+                  // eslint-disable-next-line no-shadow
+                  changeIcon={img => changeImg(img, index)}
+                  size={67}
+                  hasCancel
+                  delEvent={() => {
                             delImg(index);
                         }}
-                    />
-                </Layout>
+                />
+              </Layout>
             );
         });
     };
@@ -138,7 +192,7 @@ export default function HomePage3(props) {
             defaultValue: val,
             InputType: type,
             isEdit: true,
-            title: title,
+            title,
             cancelable: true,
             confirmCallback: info => {
                 updateMerchant({ [key]: info });
@@ -147,190 +201,107 @@ export default function HomePage3(props) {
     }
 
     return (
-        <Layout style={styles.tabContainer}>
-            <Layout style={styles.top}>
-                <Layout style={styles.imgList}>{showImgList(imgList)}</Layout>
+      <Layout style={styles.tabContainer}>
+        <Layout style={styles.top}>
+          <Layout style={styles.imgList}>{showImgList(imgList)}</Layout>
 
-                <Layout>
-                    <Text style={styles.text}>{home3Title1}</Text>
-                    <Textarea
-                        containerStyle={styles.textareaContainer}
-                        style={styles.textarea}
-                        onChangeText={changeText}
-                        defaultValue={introduction}
-                        maxLength={500}
-                        placeholder={home3Title2}
-                        placeholderTextColor={"#B4B4B4"}
-                        underlineColorAndroid={"transparent"}
-                    />
-                    <Button
-                        size='small'
-                        style={styles.button}
-                        onPress={() => {
+          <Layout>
+            <Text style={styles.text}>{home3Title1}</Text>
+            <Textarea
+              containerStyle={styles.textareaContainer}
+              style={styles.textarea}
+              onChangeText={changeText}
+              defaultValue={introduction}
+              maxLength={500}
+              placeholder={home3Title2}
+              placeholderTextColor="#B4B4B4"
+              underlineColorAndroid="transparent"
+            />
+            <Button
+              size='small'
+              style={styles.button}
+              onPress={() => {
                             updateMerchant({
                                 introduction: text,
-                            }).then(res => {
+                            }).then(() => {
                                 success("成功");
                             });
                         }}
-                    >
-                        {confirm}
-                    </Button>
-                </Layout>
-            </Layout>
-            <Menu style={styles.menu}>
-                <MenuItem
-                    title={props =>
-                        Label(props, getWordsStr("register_form_1"), name)
-                    }
-                    accessoryRight={ForwardIcon}
-                    style={styles.menuItem}
-                    onPress={() =>
+            >
+              {confirm}
+            </Button>
+          </Layout>
+        </Layout>
+        <Menu style={styles.menu}>
+          <MenuItem
+            title={props =>
+                        Label(props, getWordsStr("register_form_1"), name)}
+            accessoryRight={ForwardIcon}
+            style={styles.menuItem}
+            onPress={() =>
                         showChange(
                             "name",
                             name,
                             getWordsStr("register_form_1"),
                             25,
                             "text"
-                        )
-                    }
-                />
-                <MenuItem
-                    title={props =>
+                        )}
+          />
+          <MenuItem
+            title={props =>
                         Label(
                             props,
                             getWordsStr("guideHome_form_1"),
                             categoryList.getKey("name")
-                        )
-                    }
-                    accessoryRight={ForwardIcon}
-                    style={styles.menuItem}
-                    onPress={() => {}}
-                />
-                <MenuItem
-                    title={props =>
-                        Label(props, getWordsStr("guideHome_form_2"), address)
-                    }
-                    accessoryRight={ForwardIcon}
-                    style={styles.menuItem}
-                    onPress={() =>
+                        )}
+            accessoryRight={ForwardIcon}
+            style={styles.menuItem}
+            onPress={() => {}}
+          />
+          <MenuItem
+            title={props =>
+                        Label(props, getWordsStr("guideHome_form_2"), address)}
+            accessoryRight={ForwardIcon}
+            style={styles.menuItem}
+            onPress={() =>
                         showChange(
                             "address",
                             address,
                             getWordsStr("guideHome_form_2")
-                        )
-                    }
-                />
-                <MenuItem
-                    title={props =>
-                        Label(props, getWordsStr("guideHome_form_3"), phone)
-                    }
-                    accessoryRight={ForwardIcon}
-                    style={styles.menuItem}
-                    onPress={() =>
+                        )}
+          />
+          <MenuItem
+            title={props =>
+                        Label(props, getWordsStr("guideHome_form_3"), phone)}
+            accessoryRight={ForwardIcon}
+            style={styles.menuItem}
+            onPress={() =>
                         showChange(
                             "phone",
                             phone,
                             getWordsStr("guideHome_form_3"),
                             11,
                             "phone"
-                        )
-                    }
-                />
-                <MenuItem
-                    title={props =>
-                        Label(props, getWordsStr("guideHome_form_4"), openTime)
-                    }
-                    accessoryRight={ForwardIcon}
-                    style={styles.menuItem}
-                    onPress={() => {}}
-                />
-                <MenuItem
-                    title={getWordsStr("guideHome_form_5")}
-                    accessoryRight={ForwardIcon}
-                    style={styles.menuItem}
-                    onPress={() => {
+                        )}
+          />
+          <MenuItem
+            title={props =>
+                        Label(props, getWordsStr("guideHome_form_4"), openTime)}
+            accessoryRight={ForwardIcon}
+            style={styles.menuItem}
+            onPress={() => {}}
+          />
+          <MenuItem
+            title={getWordsStr("guideHome_form_5")}
+            accessoryRight={ForwardIcon}
+            style={styles.menuItem}
+            onPress={() => {
                         RootNavigation.navigate("EditBanner", {
                             type: "qualification",
                         });
                     }}
-                />
-            </Menu>
-        </Layout>
+          />
+        </Menu>
+      </Layout>
     );
 }
-
-const ForwardIcon = props => (
-    <Icon
-        {...props}
-        name='arrow-ios-forward'
-        fill='#B4B4B4'
-        style={{ width: 15, height: 15, fontWeight: 500 }}
-    />
-);
-const classificationItem = ({ item, index }) => <CommentCard />;
-const StarIcon = props => <Icon {...props} name='plus-outline' />;
-
-const goodsItem = ({ item, index }) => (
-    <GoodsCardLarge appearance='classification' />
-);
-
-const styles = StyleSheet.create({
-    tabContainer: {
-        backgroundColor: "#fff",
-        flex: 1,
-    },
-    top: {
-        paddingVertical: 20,
-        paddingHorizontal: 13,
-    },
-    imgList: {
-        flexDirection: "row",
-    },
-    upload: {
-        marginRight: 10,
-        width: 67,
-        width: 67,
-        flexShrink: 0,
-    },
-    textareaContainer: {
-        backgroundColor: "#F0F0F0",
-        height: 100,
-        alignSelf: "stretch",
-        borderRadius: 4,
-    },
-    textarea: {
-        textAlignVertical: "top", // hack android
-        fontSize: 13,
-        color: "#333",
-        paddingHorizontal: 14,
-        paddingVertical: 10,
-        height: 100,
-    },
-    text: {
-        paddingVertical: 10,
-    },
-    button: {
-        alignSelf: "flex-end",
-        marginTop: 10,
-        marginRight: 14,
-    },
-    menu: {
-        borderColor: "#EEEEEE",
-        borderTopWidth: 6,
-        backgroundColor: "#fff",
-        paddingHorizontal: 15,
-    },
-    menuItem: {},
-    lable: {
-        flexDirection: "row",
-        flex: 1,
-    },
-    lableName: {
-        flexShrink: 0,
-        flexBasis: "50%",
-        marginHorizontal: 8,
-        fontSize: 13,
-    },
-    lableText: {}
-});

+ 185 - 177
screens/LoginScreen.js

@@ -1,196 +1,24 @@
+/* eslint-disable no-unused-vars */
+/* eslint-disable camelcase */
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
     Image,
-    Platform,
     StyleSheet,
     View,
-    ImageBackground,
 } from "react-native";
-import scrollPage from "../components/ScrollPage";
-import { useModel } from "flooks";
 import {
     Layout,
     Tab,
     TabView,
-    Text,
     useTheme,
     Button,
 } from "@ui-kitten/components";
-import FormInput from "../components/FormInput";
+import { useModel } from "flooks";
 import { useFocusEffect } from "@react-navigation/native";
-import * as RootNavigation from "../navigation/RootNavigation.js";
+import * as RootNavigation from "../navigation/RootNavigation";
+import FormInput from "../components/FormInput";
 // import { useAndroidBackHandler } from "react-navigation-backhandler";
-
-export default function LoginScreen({ navigation, route }) {
-    const theme = useTheme();
-    const { changeBackground } = useModel("barModel", true);
-    const {
-        welcom,
-        login_tab_1,
-        login_tab_2,
-        login_form_1,
-        login_pla_1,
-        login_form_2,
-        login_pla_2,
-        login_form_3,
-        login_pla_3,
-        login_btn_sub,
-        login_btn_forget,
-        login_btn_rej,
-        login_btn_code_1,
-        login_btn_code_2,
-    } = useModel("wordsModel");
-
-    const tabs = [
-        {
-            value: 1,
-            label: login_tab_1,
-        },
-        {
-            value: 2,
-            label: login_tab_2,
-        },
-    ];
-
-    const [selectedIndex, setSelectedIndex] = React.useState(0);
-
-    const [phone, changePhone] = React.useState("");
-    const [password, changePassword] = React.useState("");
-    const [code, changeCode] = React.useState("");
-    const [sendNum, changeNum] = React.useState(60);
-    const [isSend, changeSend] = React.useState(false);
-
-    const canLogin = React.useMemo(() => {
-        if (
-            (selectedIndex == 0 && phone && password) ||
-            (selectedIndex == 1 && phone && code)
-        ) {
-            return true;
-        } else {
-            return false;
-        }
-    }, [phone, password, code, selectedIndex]);
-
-    const { loginByPassword, loginByCode } = useModel("userModel", true);
-    useFocusEffect(
-        React.useCallback(() => {
-            changeBackground(theme["color-primary-100"]);
-        }, [])
-    );
-    return (
-        <View
-            style={[
-                styles.container,
-                { backgroundColor: theme["color-primary-100"] },
-            ]}
-        >
-            <View style={styles.center}>
-                <Image
-                    source={require("../assets/images/loginImg.png")}
-                    style={styles.image}
-                />
-
-                <Image
-                    source={require("../assets/images/loginLogo.png")}
-                    style={styles.logo}
-                />
-
-                <View style={styles.tabContent}>
-                    <TabView
-                        selectedIndex={selectedIndex}
-                        onSelect={index => setSelectedIndex(index)}
-                        indicatorStyle={{ height: 0 }}
-                    >
-                        <Tab title={login_tab_1}>
-                            <Layout style={styles.tabMain}>
-                                {/* 手机号 */}
-                                <FormInput
-                                    label={login_form_1 + ":"}
-                                    value={phone}
-                                    type='phone'
-                                    placeholder={login_pla_1}
-                                    onChange={changePhone}
-                                    textAlign='right'
-                                    labelStyle={{ width: 50 }}
-                                />
-
-                                {/* 密码 */}
-                                <FormInput
-                                    label={login_form_2 + ":"}
-                                    value={password}
-                                    type='password'
-                                    placeholder={login_pla_2}
-                                    onChange={changePassword}
-                                    textAlign='right'
-                                    labelStyle={{ width: 50 }}
-                                />
-                            </Layout>
-                        </Tab>
-                        <Tab title={login_tab_2}>
-                            <Layout style={styles.tabMain}>
-                                {/* 手机号 */}
-                                <FormInput
-                                    label={login_form_1 + ":"}
-                                    value={phone}
-                                    type='phone'
-                                    placeholder={login_pla_1}
-                                    onChange={changePhone}
-                                    textAlign='right'
-                                    labelStyle={{ width: 50 }}
-                                />
-
-                                {/* 验证码 */}
-                                <FormInput
-                                    label={login_form_3 + ":"}
-                                    value={code}
-                                    type='code'
-                                    placeholder={login_pla_3}
-                                    onChange={changeCode}
-                                    textAlign='right'
-                                    btnText={login_btn_code_1}
-                                    labelStyle={{ width: 50 }}
-                                />
-                            </Layout>
-                        </Tab>
-                    </TabView>
-
-                    {/* 注册找回密码 */}
-                    <Layout style={styles.btnList} level='1'>
-                        <Button appearance='ghost' status='basic' size='small'>
-                            {login_btn_forget}
-                        </Button>
-                        <Button
-                            appearance='ghost'
-                            status='basic'
-                            size='tiny'
-                            onPress={() => RootNavigation.navigate("Register")}
-                        >
-                            {login_btn_rej}
-                        </Button>
-                    </Layout>
-                    {/* 登录 */}
-                    <Layout style={styles.layoutLeft} level='1'>
-                        <Button
-                            status='primary'
-                            disabled={!canLogin}
-                            onPress={() => {
-                                if (selectedIndex === 0) {
-                                    loginByPassword(phone, password);
-                                } else {
-                                    loginByCode(phone, code).then(_ => {});
-                                }
-                            }}
-                        >
-                            {login_btn_sub}
-                        </Button>
-                    </Layout>
-                </View>
-            </View>
-        </View>
-    );
-}
-
 const styles = StyleSheet.create({
     container: {
         flex: 1,
@@ -275,3 +103,183 @@ const styles = StyleSheet.create({
         paddingHorizontal: 10,
     },
 });
+
+
+const img1 = require("../assets/images/loginImg.png")
+const img2 = require("../assets/images/loginLogo.png")
+
+
+
+
+
+export default function LoginScreen() {
+    const theme = useTheme();
+    const { changeBackground } = useModel("barModel", true);
+    const {
+        welcom,
+        login_tab_1,
+        login_tab_2,
+        login_form_1,
+        login_pla_1,
+        login_form_2,
+        login_pla_2,
+        login_form_3,
+        login_pla_3,
+        login_btn_sub,
+        login_btn_forget,
+        login_btn_rej,
+        login_btn_code_1,
+        login_btn_code_2,
+    } = useModel("wordsModel");
+
+    const tabs = [
+        {
+            value: 1,
+            label: login_tab_1,
+        },
+        {
+            value: 2,
+            label: login_tab_2,
+        },
+    ];
+
+    const [selectedIndex, setSelectedIndex] = React.useState(0);
+
+    const [phone, changePhone] = React.useState("");
+    const [password, changePassword] = React.useState("");
+    const [code, changeCode] = React.useState("");
+    const [sendNum, changeNum] = React.useState(60);
+    const [isSend, changeSend] = React.useState(false);
+
+    const canLogin = React.useMemo(() => {
+        if (
+            (selectedIndex === 0 && phone && password) ||
+            (selectedIndex === 1 && phone && code)
+        ) {
+            return true;
+        // eslint-disable-next-line no-else-return
+        } else {
+            return false;
+        }
+    }, [phone, password, code, selectedIndex]);
+
+    const { loginByPassword, loginByCode } = useModel("userModel", true);
+    useFocusEffect(
+        React.useCallback(() => {
+            changeBackground(theme["color-primary-100"]);
+        }, [])
+    );
+    return (
+      <View
+        style={[
+                styles.container,
+                { backgroundColor: theme["color-primary-100"] },
+            ]}
+      >
+        <View style={styles.center}>
+          <Image
+            source={img1}
+            style={styles.image}
+          />
+
+          <Image
+            source={img2}
+            style={styles.logo}
+          />
+
+          <View style={styles.tabContent}>
+            <TabView
+              selectedIndex={selectedIndex}
+              onSelect={index => setSelectedIndex(index)}
+              indicatorStyle={{ height: 0 }}
+            >
+              <Tab title={login_tab_1}>
+                <Layout style={styles.tabMain}>
+                  {/* 手机号 */}
+                  <FormInput
+                    label={`${login_form_1  }:`}
+                    value={phone}
+                    type='phone'
+                    placeholder={login_pla_1}
+                    onChange={changePhone}
+                    textAlign='right'
+                    labelStyle={{ width: 50 }}
+                  />
+
+                  {/* 密码 */}
+                  <FormInput
+                    label={`${login_form_2  }:`}
+                    value={password}
+                    type='password'
+                    placeholder={login_pla_2}
+                    onChange={changePassword}
+                    textAlign='right'
+                    labelStyle={{ width: 50 }}
+                  />
+                </Layout>
+              </Tab>
+              <Tab title={login_tab_2}>
+                <Layout style={styles.tabMain}>
+                  {/* 手机号 */}
+                  <FormInput
+                    label={`${login_form_1  }:`}
+                    value={phone}
+                    type='phone'
+                    placeholder={login_pla_1}
+                    onChange={changePhone}
+                    textAlign='right'
+                    labelStyle={{ width: 50 }}
+                  />
+
+                  {/* 验证码 */}
+                  <FormInput
+                    label={`${login_form_3  }:`}
+                    value={code}
+                    type='code'
+                    placeholder={login_pla_3}
+                    onChange={changeCode}
+                    textAlign='right'
+                    btnText={login_btn_code_1}
+                    labelStyle={{ width: 50 }}
+                  />
+                </Layout>
+              </Tab>
+            </TabView>
+
+            {/* 注册找回密码 */}
+            <Layout style={styles.btnList} level='1'>
+              <Button appearance='ghost' status='basic' size='small'>
+                {login_btn_forget}
+              </Button>
+              <Button
+                appearance='ghost'
+                status='basic'
+                size='tiny'
+                onPress={() => RootNavigation.navigate("Register")}
+              >
+                {login_btn_rej}
+              </Button>
+            </Layout>
+            {/* 登录 */}
+            <Layout style={styles.layoutLeft} level='1'>
+              <Button
+                status='primary'
+                disabled={!canLogin}
+                onPress={() => {
+                                if (selectedIndex === 0) {
+                                    loginByPassword(phone, password);
+                                } else {
+                                    loginByCode(phone, code).then(_ => {});
+                                }
+                            }}
+              >
+                {login_btn_sub}
+              </Button>
+            </Layout>
+          </View>
+        </View>
+      </View>
+    );
+}
+
+

+ 98 - 115
screens/MoneyListScreen.js

@@ -1,30 +1,19 @@
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
 import { useModel } from "flooks";
 import {
     Layout,
-    Tab,
-    TabView,
     Text,
     useTheme,
     Button,
-    Card,
-    List,
     Select,
     SelectItem,
     IndexPath,
-    Avatar,
-    Divider,
 } from "@ui-kitten/components";
 import { useFocusEffect } from "@react-navigation/native";
-import ScrollPage from "../components/ScrollPage";
 import NavHeaderBar from "../components/NavHeaderBar";
 import MoneyRecord from "../components/MoneyRecord";
 
@@ -32,111 +21,7 @@ import ListComponent from "../components/ListComponent";
 
 // 余额
 const data = ["2020-03", "2020-04", "2020-05"];
-const ItemSeparatorComponent = props => <Divider />;
 
-export default function MoneyListScreen({ navigation, route }) {
-    const theme = useTheme();
-    const { changeBackground } = useModel("barModel");
-    const { getUserInfo, money } = useModel("appUserModel");
-    const { httpPost, httpGet } = useModel("httpModel", true);
-    const [selectedIndex, setSelectedIndex] = React.useState(
-        new IndexPath(data.length - 1)
-    );
-
-    const {
-        userTitle6,
-        storeAudioText1,
-        storeAudioText2,
-        storeAudioText3,
-        storeAudioText4,
-        complete,
-    } = useModel("wordsModel");
-
-    const displayValue = data[selectedIndex.row];
-
-    useFocusEffect(
-        React.useCallback(() => {
-            changeBackground(theme["color-primary-500"]);
-            getUserInfo();
-        }, [])
-    );
-
-    // 获取列表
-    function getList(page, size) {
-        return httpGet(
-            "/moneyRecord/my",
-            {
-                page,
-                size,
-            },
-            true
-        );
-    }
-
-    const renderOption = (title, index) => (
-        <SelectItem key={index} title={title} />
-    );
-    const selectElement = () => (
-        <Layout style={[styles.select]}>
-            <Select
-                value={displayValue}
-                selectedIndex={selectedIndex}
-                onSelect={index => setSelectedIndex(index)}
-            >
-                {data.map(renderOption)}
-            </Select>
-        </Layout>
-    );
-
-    const walletItem = ({ item, index }) => (
-        <MoneyRecord key={index} info={item} />
-    );
-
-    return (
-        <>
-            <NavHeaderBar title={userTitle6} />
-            <Layout
-                style={[
-                    styles.lay,
-                    {
-                        backgroundColor: theme["color-primary-500"],
-                        borderColor: theme["color-primary-500"],
-                    },
-                ]}
-            >
-                <Text category='c1' style={[styles.flex1, styles.tiltle]}>
-                    余额
-                </Text>
-                <Text
-                    category='h2'
-                    style={[styles.flex1, styles.money]}
-                    status='control'
-                >
-                    {money || 0}
-                </Text>
-                <Button
-                    appearance='ghost'
-                    style={[styles.flex1]}
-                    size='large'
-                    status='control'
-                    onPress={() => {
-                        navigation.navigate("ChooseBank");
-                    }}
-                >
-                    提现
-                </Button>
-            </Layout>
-            <ListComponent
-                getInfo={getList}
-                renderItem={walletItem}
-                ListHeaderComponent={selectElement}
-                style={styles.list}
-                separatorStyle={styles.separatorStyle}
-                showEmpty={true}
-            />
-        </>
-    );
-}
 
 const styles = StyleSheet.create({
     container: {
@@ -189,3 +74,101 @@ const styles = StyleSheet.create({
         marginHorizontal: 13,
     },
 });
+
+
+export default function MoneyListScreen({ navigation }) {
+    const theme = useTheme();
+    const { changeBackground } = useModel("barModel");
+    const { getUserInfo, money } = useModel("appUserModel");
+    const {  httpGet } = useModel("httpModel", true);
+    const [selectedIndex, setSelectedIndex] = React.useState(
+        new IndexPath(data.length - 1)
+    );
+
+    const {userTitle6} = useModel("wordsModel");
+
+    const displayValue = data[selectedIndex.row];
+
+    useFocusEffect(
+        React.useCallback(() => {
+            changeBackground(theme["color-primary-500"]);
+            getUserInfo();
+        }, [])
+    );
+
+    // 获取列表
+    function getList(page, size) {
+        return httpGet(
+            "/moneyRecord/my",
+            {
+                page,
+                size,
+            },
+            true
+        );
+    }
+
+    const renderOption = (title, index) => (
+      <SelectItem key={index} title={title} />
+    );
+    const selectElement = () => (
+      <Layout style={[styles.select]}>
+        <Select
+          value={displayValue}
+          selectedIndex={selectedIndex}
+          onSelect={index => setSelectedIndex(index)}
+        >
+          {data.map(renderOption)}
+        </Select>
+      </Layout>
+    );
+
+    const walletItem = ({ item, index }) => (
+      <MoneyRecord key={index} info={item} />
+    );
+
+    return (
+      <>
+        <NavHeaderBar title={userTitle6} />
+        <Layout
+          style={[
+                    styles.lay,
+                    {
+                        backgroundColor: theme["color-primary-500"],
+                        borderColor: theme["color-primary-500"],
+                    },
+                ]}
+        >
+          <Text category='c1' style={[styles.flex1, styles.tiltle]}>
+            余额
+          </Text>
+          <Text
+            category='h2'
+            style={[styles.flex1, styles.money]}
+            status='control'
+          >
+            {money || 0}
+          </Text>
+          <Button
+            appearance='ghost'
+            style={[styles.flex1]}
+            size='large'
+            status='control'
+            onPress={() => {
+                        navigation.navigate("ChooseBank");
+                    }}
+          >
+            提现
+          </Button>
+        </Layout>
+        <ListComponent
+          getInfo={getList}
+          renderItem={walletItem}
+          ListHeaderComponent={selectElement}
+          style={styles.list}
+          separatorStyle={styles.separatorStyle}
+          showEmpty
+        />
+      </>
+    );
+}

+ 0 - 88
screens/OrderListScreen.js

@@ -1,88 +0,0 @@
-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";
-import { useFocusEffect } from "@react-navigation/native";
-import OrderCard from "../components/OrderCard";
-import EmptyComponent from "../components/EmptyComponent";
-export default function OrderListScreen({ route }) {
-    // const route = useRoute();
-
-    const { httpGet } = useModel("httpModel");
-    const {
-        tab2,
-        fullReduction2,
-        fullReduction1,
-        delText,
-        editText,
-        confirm,
-        cancel,
-        complete,
-        successText,
-        removeTips,
-    } = useModel("wordsModel");
-    const [pageName, changeName] = React.useState(""); //状态
-    const [orderList, SetorderList] = React.useState([]); //订单列表
-
-    useFocusEffect(
-        React.useCallback(() => {
-            console.log(route);
-            changeName(route.name);
-            if (route.name) {
-                getOrderList();
-            }
-        }, [])
-    );
-
-    function getOrderList() {
-        SetorderList([]);
-        httpGet("/orderInfo/my").then((res) => {
-            SetorderList(res.content);
-        });
-    }
-
-    const orderItem = ({ item, index }) => (
-        <OrderCard
-            style={{ marginHorizontal: 10, marginBottom: 15 }}
-            appearance='classification'
-            key={item.id}
-            info={item}
-            updateInfo={()=>{
-                getOrderList()
-            }}
-        />
-    );
-
-    return (
-        <List
-            style={styles.list}
-            data={orderList}
-            renderItem={orderItem}
-            ListEmptyComponent={EmptyComponent}
-        />
-    );
-}
-
-const styles = StyleSheet.create({
-    list: {
-        flex: 1,
-        backgroundColor: "#eee",
-        paddingVertical: 15,
-    },
-});

+ 77 - 80
screens/OrderScreen.js

@@ -1,29 +1,55 @@
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
-import { Ionicons } from "@expo/vector-icons";
-import { Dimensions, StyleSheet } from "react-native";
+import {  StyleSheet } from "react-native";
 import { setModel, useModel } from "flooks";
-import NavHeaderBar from "../components/NavHeaderBar";
-import { useFocusEffect, useNavigation } from "@react-navigation/native";
+import { useFocusEffect} from "@react-navigation/native";
 import {
     Layout,
-    Text,
-    ButtonGroup,
     Button,
     TabBar,
     Tab,
     useTheme,
 } from "@ui-kitten/components";
+import NavHeaderBar from "../components/NavHeaderBar";
 import OrderCard from "../components/OrderCard";
 import ListComponent from "../components/ListComponent";
 
-//订单功能模块
+// 订单功能模块
 import orderInfoModel from "../models/orderInfoModel";
 
 // const Tab = createMaterialTopTabNavigator();
 
 const orderStatus = ["NOT_RECEIVED", "RECEIVED", "REJECTED", "COMPLETED"];
 
+
+const styles = StyleSheet.create({
+    tabBack: {
+        backgroundColor: "#eee",
+        borderWidth: 0,
+    },
+    indicatorStyle: {
+        backgroundColor: "#FFC21C",
+    },
+    buttonGroup: {
+        justifyContent: "center",
+        paddingVertical: 7,
+        flexDirection: "row",
+        backgroundColor: "#eee",
+    },
+    separatorStyle: {
+        height: 0,
+    },
+    list: {
+        flex: 1,
+        backgroundColor: "#eee",
+        marginTop: 10,
+    },
+    label: {
+        backgroundColor: "#eee",
+    },
+});
+
+
 export default function OrderScreen() {
     const {
         NOT_RECEIVED,
@@ -31,7 +57,6 @@ export default function OrderScreen() {
         REJECTED,
         COMPLETED,
         tab2,
-        orderTitleBtn1,
         orderTitleBtn2,
     } = useModel("wordsModel");
 
@@ -51,20 +76,20 @@ export default function OrderScreen() {
             changeStart(true);
         }, [])
     );
-    const orderItem = ({ item, index }) => (
-        <OrderCard
-            style={{ marginHorizontal: 10, marginBottom: 15 }}
-            appearance='classification'
-            key={item.id}
-            info={item}
-            updateInfo={() => {
+    const orderItem = ({ item }) => (
+      <OrderCard
+        style={{ marginHorizontal: 10, marginBottom: 15 }}
+        appearance='classification'
+        key={item.id}
+        info={item}
+        updateInfo={() => {
                 changeStart(true);
             }}
-        />
+      />
     );
 
     function getList(page, size) {
-        let query = {
+        const query = {
             merchantStatus: orderStatus[selectedIndex],
         };
         return getOrderList(page, size, query).then(res => {
@@ -74,72 +99,44 @@ export default function OrderScreen() {
     }
 
     return (
-        <>
-            <Layout style={[styles.tabBack, { flex: 1 }]}>
-                <NavHeaderBar title={tab2} />
-                <Layout style={styles.buttonGroup}>
-                    <Button
-                        style={{ marginRight: 10 }}
-                        onPress={() =>
-                            updateMerchant({ automaticOrder: !automaticOrder })
-                        }
-                    >
-                        {automaticOrder ? "手动接单" : "自动接单"}
-                    </Button>
-                    <Button appearance='outline'>{orderTitleBtn2}</Button>
-                </Layout>
-                <TabBar
-                    selectedIndex={selectedIndex}
-                    indicatorStyle={styles.indicatorStyle}
-                    style={styles.label}
-                    onSelect={index => {
+      <>
+        <Layout style={[styles.tabBack, { flex: 1 }]}>
+          <NavHeaderBar title={tab2} />
+          <Layout style={styles.buttonGroup}>
+            <Button
+              style={{ marginRight: 10 }}
+              onPress={() =>
+                            updateMerchant({ automaticOrder: !automaticOrder })}
+            >
+              {automaticOrder ? "手动接单" : "自动接单"}
+            </Button>
+            <Button appearance='outline'>{orderTitleBtn2}</Button>
+          </Layout>
+          <TabBar
+            selectedIndex={selectedIndex}
+            indicatorStyle={styles.indicatorStyle}
+            style={styles.label}
+            onSelect={index => {
                         setSelectedIndex(index);
                         changeStart(true);
                     }}
-                >
-                    <Tab appearance='homeTab' title={NOT_RECEIVED} />
-                    <Tab appearance='homeTab' title={RECEIVED} />
-                    <Tab appearance='homeTab' title={REJECTED} />
-                    <Tab appearance='homeTab' title={COMPLETED} />
-                </TabBar>
+          >
+            <Tab appearance='homeTab' title={NOT_RECEIVED} />
+            <Tab appearance='homeTab' title={RECEIVED} />
+            <Tab appearance='homeTab' title={REJECTED} />
+            <Tab appearance='homeTab' title={COMPLETED} />
+          </TabBar>
 
-                <ListComponent
-                    initialNumToRender={3}
-                    getInfo={getList}
-                    renderItem={orderItem}
-                    style={styles.list}
-                    separatorStyle={styles.separatorStyle}
-                    showEmpty={true}
-                    startState={startState}
-                />
-            </Layout>
-        </>
+          <ListComponent
+            initialNumToRender={3}
+            getInfo={getList}
+            renderItem={orderItem}
+            style={styles.list}
+            separatorStyle={styles.separatorStyle}
+            showEmpty
+            startState={startState}
+          />
+        </Layout>
+      </>
     );
 }
-
-const styles = StyleSheet.create({
-    tabBack: {
-        backgroundColor: "#eee",
-        borderWidth: 0,
-    },
-    indicatorStyle: {
-        backgroundColor: "#FFC21C",
-    },
-    buttonGroup: {
-        justifyContent: "center",
-        paddingVertical: 7,
-        flexDirection: "row",
-        backgroundColor: "#eee",
-    },
-    separatorStyle: {
-        height: 0,
-    },
-    list: {
-        flex: 1,
-        backgroundColor: "#eee",
-        marginTop: 10,
-    },
-    label: {
-        backgroundColor: "#eee",
-    },
-});

+ 204 - 205
screens/RegisterScreen.js

@@ -1,210 +1,209 @@
-import * as WebBrowser from "expo-web-browser";
-import * as React from "react";
+/* eslint-disable camelcase */
+import * as WebBrowser from 'expo-web-browser';
+import * as React from 'react';
 import {
-    Image,
-    Platform,
-    StyleSheet,
-    View,
-    ImageBackground,
-} from "react-native";
-import scrollPage from "../components/ScrollPage";
-import { useModel } from "flooks";
+  Image,
+  StyleSheet,
+} from 'react-native';
+import { useModel } from 'flooks';
 import {
-    Layout,
-    Tab,
-    TabView,
-    Text,
-    useTheme,
-    Button,
-} from "@ui-kitten/components";
-import FormInput from "../components/FormInput";
-import { useFocusEffect } from "@react-navigation/native";
-import ConnectButton from "../components/ConnectButton";
-
-export default function RegisterScreen({ navigation, route }) {
-    const theme = useTheme();
-    const { changeBackground } = useModel("barModel");
-
-    const {
-        welcom,
-        register_form_1,
-        register_pla_1,
-        register_form_2,
-        register_pla_2,
-        register_form_4,
-        register_pla_4,
-        login_form_3,
-        login_pla_3,
-        login_form_2,
-        login_pla_2,
-        register_form_3,
-        register_pla_3,
-        next,
-        login_btn_code_1,
-    } = useModel("wordsModel");
-
-    useFocusEffect(
-        React.useCallback(() => {
-            changeBackground(theme["background-basic-color-1"]);
-        }, [])
-    );
-
-    const [name, changeName] = React.useState("");
-    const [showName, changeShowName] = React.useState("");
-    const [phone, changePhone] = React.useState("");
-    const [password, changePassword] = React.useState("");
-    const [password2, changePassword2] = React.useState("");
-    const [code, changeCode] = React.useState("");
-
-    const canNext = React.useMemo(() => {
-        if (
-            name &&
-            showName &&
-            phone &&
-            code &&
-            password &&
-            password == password2
-        ) {
-            return true;
-        } else {
-            return false;
-        }
-    }, [name, showName, phone, password, code, password2]);
-
-    const { registerFirst } = useModel("userModel", true);
-
-    return (
-        <ScrollPage>
-            <Layout style={styles.container}>
-                <Image
-                    source={require("../assets/images/logo_1.png")}
-                    style={styles.logo}
-                />
-                <Image
-                    source={require("../assets/images/logo_2.png")}
-                    style={styles.logo2}
-                />
-                <Text style={styles.text} category='h6'>
-                    {welcom}
-                </Text>
-
-                <Layout style={styles.form}>
-                    {/* 输入商家名称 */}
-                    <FormInput
-                        label={register_form_1 + ":"}
-                        value={name}
-                        placeholder={register_pla_1}
-                        onChange={changeName}
-                        textAlign='right'
-                    />
-                    {/* 显示名称: */}
-                    <FormInput
-                        label={register_form_2 + ":"}
-                        value={showName}
-                        placeholder={register_pla_2}
-                        onChange={changeShowName}
-                        textAlign='right'
-                    />
-
-                    {/* 手机号 */}
-                    <FormInput
-                        label={register_form_4 + ":"}
-                        value={phone}
-                        type='phone'
-                        placeholder={register_pla_4}
-                        onChange={changePhone}
-                        textAlign='right'
-                    />
-
-                    {/* 验证码 */}
-                    <FormInput
-                        label={login_form_3 + ":"}
-                        value={code}
-                        type='code'
-                        placeholder={login_pla_3}
-                        onChange={changeCode}
-                        textAlign='right'
-                        btnText={login_btn_code_1}
-                    />
-
-                    {/* 密码 */}
-                    <FormInput
-                        label={login_form_2 + ":"}
-                        value={password}
-                        type='password'
-                        placeholder={login_pla_2}
-                        onChange={changePassword}
-                        textAlign='right'
-                    />
-
-                    {/* 确认密码 */}
-                    <FormInput
-                        label={register_form_3 + ":"}
-                        value={password2}
-                        type='password'
-                        placeholder={register_pla_3}
-                        onChange={changePassword2}
-                        textAlign='right'
-                    />
-
-                    <Layout style={styles.layoutLeft} level='1'>
-                        <Button
-                            status='primary'
-                            disabled={!canNext}
-                            onPress={() =>
-                                registerFirst({
-                                    name,
-                                    showName,
-                                    phone,
-                                    password,
-                                })
-                            }
-                        >
-                            {next}
-                        </Button>
-                    </Layout>
-                </Layout>
-
-                <ConnectButton />
-            </Layout>
-        </ScrollPage>
-    );
-}
+  Layout,
+  Text,
+  useTheme,
+  Button,
+} from '@ui-kitten/components';
+import { useFocusEffect } from '@react-navigation/native';
+import FormInput from '../components/FormInput';
+import ScrollPage from '../components/ScrollPage';
+import ConnectButton from '../components/ConnectButton';
+
 
 const styles = StyleSheet.create({
-    container: {
-        flex: 1,
-        alignItems: "center",
-        justifyContent: "center",
-        paddingTop: 10,
-        paddingBottom: 33,
-    },
-    tabContent: {
-        backgroundColor: "#fff",
-        marginTop: 20,
-    },
-    logo: {
-        width: 100,
-        height: 100,
-        alignSelf: "center",
-    },
-    logo2: {
-        width: 97,
-        height: 21,
-        alignSelf: "center",
-        marginTop: 2,
-    },
-    text: {
-        marginTop: 16,
-    },
-    layoutLeft: {
-        flexDirection: "row",
-        paddingVertical: 10,
-        justifyContent: "center",
-    },
-    form: {
-        paddingHorizontal: 16,
-        paddingVertical: 20,
-        alignSelf: "stretch",
-    },
+  container: {
+    flex: 1,
+    alignItems: 'center',
+    justifyContent: 'center',
+    paddingTop: 10,
+    paddingBottom: 33,
+  },
+  tabContent: {
+    backgroundColor: '#fff',
+    marginTop: 20,
+  },
+  logo: {
+    width: 100,
+    height: 100,
+    alignSelf: 'center',
+  },
+  logo2: {
+    width: 97,
+    height: 21,
+    alignSelf: 'center',
+    marginTop: 2,
+  },
+  text: {
+    marginTop: 16,
+  },
+  layoutLeft: {
+    flexDirection: 'row',
+    paddingVertical: 10,
+    justifyContent: 'center',
+  },
+  form: {
+    paddingHorizontal: 16,
+    paddingVertical: 20,
+    alignSelf: 'stretch',
+  },
 });
+
+
+const img1 = require('../assets/images/logo_1.png')
+const img2 = require('../assets/images/logo_2.png')
+
+
+
+export default function RegisterScreen() {
+  const theme = useTheme();
+  const { changeBackground } = useModel('barModel');
+
+  const {
+    welcom,
+    register_form_1,
+    register_pla_1,
+    register_form_2,
+    register_pla_2,
+    register_form_4,
+    register_pla_4,
+    login_form_3,
+    login_pla_3,
+    login_form_2,
+    login_pla_2,
+    register_form_3,
+    register_pla_3,
+    next,
+    login_btn_code_1,
+  } = useModel('wordsModel');
+
+  useFocusEffect(
+    React.useCallback(() => {
+      changeBackground(theme['background-basic-color-1']);
+    }, []),
+  );
+
+  const [name, changeName] = React.useState('');
+  const [showName, changeShowName] = React.useState('');
+  const [phone, changePhone] = React.useState('');
+  const [password, changePassword] = React.useState('');
+  const [password2, changePassword2] = React.useState('');
+  const [code, changeCode] = React.useState('');
+
+  const canNext = React.useMemo(() => {
+    if (
+      name
+            && showName
+            && phone
+            && code
+            && password
+            && password === password2
+    ) {
+      return true;
+    }
+    return false;
+  }, [name, showName, phone, password, code, password2]);
+
+  const { registerFirst } = useModel('userModel', true);
+
+  return (
+    <ScrollPage>
+      <Layout style={styles.container}>
+        <Image
+          source={img1}
+          style={styles.logo}
+        />
+        <Image
+          source={img2}
+          style={styles.logo2}
+        />
+        <Text style={styles.text} category="h6">
+          {welcom}
+        </Text>
+        <Layout style={styles.form}>
+          {/* 输入商家名称 */}
+          <FormInput
+            label={`${register_form_1}:`}
+            value={name}
+            placeholder={register_pla_1}
+            onChange={changeName}
+            textAlign="right"
+          />
+          {/* 显示名称: */}
+          <FormInput
+            label={`${register_form_2}:`}
+            value={showName}
+            placeholder={register_pla_2}
+            onChange={changeShowName}
+            textAlign="right"
+          />
+
+          {/* 手机号 */}
+          <FormInput
+            label={`${register_form_4}:`}
+            value={phone}
+            type="phone"
+            placeholder={register_pla_4}
+            onChange={changePhone}
+            textAlign="right"
+          />
+
+          {/* 验证码 */}
+          <FormInput
+            label={`${login_form_3}:`}
+            value={code}
+            type="code"
+            placeholder={login_pla_3}
+            onChange={changeCode}
+            textAlign="right"
+            btnText={login_btn_code_1}
+          />
+
+          {/* 密码 */}
+          <FormInput
+            label={`${login_form_2}:`}
+            value={password}
+            type="password"
+            placeholder={login_pla_2}
+            onChange={changePassword}
+            textAlign="right"
+          />
+
+          {/* 确认密码 */}
+          <FormInput
+            label={`${register_form_3}:`}
+            value={password2}
+            type="password"
+            placeholder={register_pla_3}
+            onChange={changePassword2}
+            textAlign="right"
+          />
+
+          <Layout style={styles.layoutLeft} level="1">
+            <Button
+              status="primary"
+              disabled={!canNext}
+              onPress={() => registerFirst({
+                name,
+                showName,
+                phone,
+                password,
+              })}
+            >
+              {next}
+            </Button>
+          </Layout>
+        </Layout>
+
+        <ConnectButton />
+      </Layout>
+    </ScrollPage>
+  );
+}

+ 131 - 138
screens/RegisterSeScreen.js

@@ -1,47 +1,75 @@
+/* eslint-disable no-shadow */
+/* eslint-disable camelcase */
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
+import { useModel } from "flooks";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
-import scrollPage from "../components/ScrollPage";
-import { useModel } from "flooks";
 import {
     Layout,
-    Tab,
-    TabView,
     Text,
     useTheme,
     Button,
     Card,
 } from "@ui-kitten/components";
+
+import { useFocusEffect } from "@react-navigation/native";
+
+import ScrollPage from "../components/ScrollPage";
 import FormInput from "../components/FormInput";
-import { useFocusEffect, useRoute } from "@react-navigation/native";
 import ConnectButton from "../components/ConnectButton";
 import GuideHeaderBar from "../components/GuideHeaderBar";
-import OpenTime from "../components/OpenTime";
-import * as RootNavigation from "../navigation/RootNavigation.js";
+import * as RootNavigation from "../navigation/RootNavigation";
+
+const styles = StyleSheet.create({
+    container: {
+        flex: 1,
+        paddingBottom: 33,
+    },
+    tabContent: {
+        backgroundColor: "#fff",
+        marginTop: 20,
+    },
+    logo: {
+        width: 100,
+        height: 100,
+        alignSelf: "center",
+    },
+    logo2: {
+        width: 97,
+        height: 21,
+        alignSelf: "center",
+        marginTop: 2,
+    },
+    text: {
+        marginTop: 16,
+    },
+    layoutLeft: {
+        flexDirection: "row",
+        paddingVertical: 10,
+        justifyContent: "center",
+    },
+    form: {
+        paddingHorizontal: 26,
+        paddingVertical: 20,
+    },
+});
 
-export default function RegisterScreen({ navigation }) {
+export default function RegisterScreen() {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
     const { httpGet } = useModel("httpModel", true);
     const { registerSecend, registerInfo } = useModel("userModel");
-    const route = useRoute();
     const {
         guideHome_title1,
         guideHome_title2,
         guideHome_form_1,
         guideHome_form_2,
-        guideHome_form_3,
         guideHome_form_4,
         guideHome_form_5,
         guideHome_form_6,
         guideHome_form_7,
-        guideHome_pla_1,
         guideHome_pla_2,
         guideHome_pla_3,
         next,
@@ -63,7 +91,6 @@ export default function RegisterScreen({ navigation }) {
     );
 
     React.useEffect(() => {
-        console.log(registerInfo);
         if (registerInfo && registerInfo.qualification) {
             changeQualification(registerInfo.qualification);
         }
@@ -78,103 +105,102 @@ export default function RegisterScreen({ navigation }) {
     const [logo, changeLogo] = React.useState();
     const timeValue = React.useMemo(() => {
         if (week && startTime && endTime) {
-            return week + " " + startTime + "~" + endTime;
-        } else {
+            return `${week  } ${  startTime  }~${  endTime}`;
+        } 
             return " ";
-        }
+        
     }, [week, startTime, endTime]);
 
     const canNext = React.useMemo(() => {
         if ((category, address, merchantNatureId, logo)) {
             return true;
-        } else {
+        } 
             return false;
-        }
+        
     }, [logo]);
 
-    const { registerFirst } = useModel("userModel", true);
 
     return (
-        <>
-            <GuideHeaderBar />
-            <ScrollPage>
-                <Layout style={styles.container}>
-                    <Card appearance='headFilled'>
-                        <Text category='s1'>{guideHome_title1}</Text>
-                        <Text category='s1'>{guideHome_title2}</Text>
-                    </Card>
-                    <Card appearance='formFilled'>
-                        {/* 输入商家名称 */}
-                        <FormInput
-                            label={guideHome_form_1}
-                            selectTitle={guideHome_form_1}
-                            type='select'
-                            value={category}
-                            onChange={changeCategory}
-                            textAlign='right'
-                            selectList={categoryList}
-                            style={{ paddingVertical: 5 }}
-                        />
-
-                        <FormInput
-                            label={guideHome_form_2}
-                            value={address}
-                            onChange={changeAddress}
-                            textAlign='right'
-                        />
-
-                        <FormInput
-                            label={guideHome_form_4}
-                            selectTitle={guideHome_form_4}
-                            type='openTime'
-                            value={timeValue}
-                            onChange={(week, startTime, endTime) => {
+      <>
+        <GuideHeaderBar />
+        <ScrollPage>
+          <Layout style={styles.container}>
+            <Card appearance='headFilled'>
+              <Text category='s1'>{guideHome_title1}</Text>
+              <Text category='s1'>{guideHome_title2}</Text>
+            </Card>
+            <Card appearance='formFilled'>
+              {/* 输入商家名称 */}
+              <FormInput
+                label={guideHome_form_1}
+                selectTitle={guideHome_form_1}
+                type='select'
+                value={category}
+                onChange={changeCategory}
+                textAlign='right'
+                selectList={categoryList}
+                style={{ paddingVertical: 5 }}
+              />
+
+              <FormInput
+                label={guideHome_form_2}
+                value={address}
+                onChange={changeAddress}
+                textAlign='right'
+              />
+
+              <FormInput
+                label={guideHome_form_4}
+                selectTitle={guideHome_form_4}
+                type='openTime'
+                value={timeValue}
+                onChange={(week, startTime, endTime) => {
                                 changeWeek(week);
                                 changeStartTime(startTime);
                                 changeEndTime(endTime);
                             }}
-                            textAlign='right'
-                            style={{ paddingVertical: 5 }}
-                        />
-
-                        <FormInput
-                            label={guideHome_form_5}
-                            sub={guideHome_pla_2}
-                            type='url'
-                            value={qualification ? "已上传" : " "}
-                            textAlign='right'
-                            style={{ paddingVertical: 5 }}
-                            changePath={() => {
+                textAlign='right'
+                style={{ paddingVertical: 5 }}
+              />
+
+              <FormInput
+                label={guideHome_form_5}
+                sub={guideHome_pla_2}
+                type='url'
+                value={qualification ? "已上传" : " "}
+                textAlign='right'
+                style={{ paddingVertical: 5 }}
+                changePath={() => {
                                 RootNavigation.navigate("EditBanner", {
                                     type: "qualification",
                                 });
                             }}
-                        />
-
-                        <FormInput
-                            label={guideHome_form_6}
-                            sub={guideHome_pla_3}
-                            selectTitle={guideHome_form_6}
-                            type='select'
-                            value={merchantNatureId}
-                            textAlign='right'
-                            style={{ paddingVertical: 5 }}
-                            onChange={changeMerchantNatureId}
-                            selectList={merchantNatureList}
-                        />
-
-                        <FormInput
-                            label={guideHome_form_7}
-                            type='img'
-                            value={logo}
-                            textAlign='right'
-                            onChange={changeLogo}
-                        />
-                        <Layout style={styles.layoutLeft} level='1'>
-                            <Button
-                                status='primary'
-                                disabled={!canNext}
-                                onPress={() =>
+              />
+
+              <FormInput
+                label={guideHome_form_6}
+                sub={guideHome_pla_3}
+                selectTitle={guideHome_form_6}
+                type='select'
+                value={merchantNatureId}
+                textAlign='right'
+                style={{ paddingVertical: 5 }}
+                onChange={changeMerchantNatureId}
+                selectList={merchantNatureList}
+              />
+
+              <FormInput
+                label={guideHome_form_7}
+                type='img'
+                value={logo}
+                textAlign='right'
+                onChange={changeLogo}
+              />
+              <Layout style={styles.layoutLeft} level='1'>
+                <Button
+                  status='primary'
+                  disabled={!canNext}
+                  onPress={() =>
                                     registerSecend({
                                         category,
                                         address,
@@ -184,50 +210,17 @@ export default function RegisterScreen({ navigation }) {
                                         qualification,
                                         merchantNatureId,
                                         logo,
-                                    })
-                                }
-                            >
-                                {next}
-                            </Button>
-                        </Layout>
-                    </Card>
-                    <ConnectButton />
-                </Layout>
-            </ScrollPage>
-        </>
+                                    })}
+                >
+                  {next}
+                </Button>
+              </Layout>
+            </Card>
+            <ConnectButton />
+          </Layout>
+        </ScrollPage>
+      </>
     );
 }
 
-const styles = StyleSheet.create({
-    container: {
-        flex: 1,
-        paddingBottom: 33,
-    },
-    tabContent: {
-        backgroundColor: "#fff",
-        marginTop: 20,
-    },
-    logo: {
-        width: 100,
-        height: 100,
-        alignSelf: "center",
-    },
-    logo2: {
-        width: 97,
-        height: 21,
-        alignSelf: "center",
-        marginTop: 2,
-    },
-    text: {
-        marginTop: 16,
-    },
-    layoutLeft: {
-        flexDirection: "row",
-        paddingVertical: 10,
-        justifyContent: "center",
-    },
-    form: {
-        paddingHorizontal: 26,
-        paddingVertical: 20,
-    },
-});
+

+ 115 - 126
screens/Set/AutomaticScreen.js

@@ -1,141 +1,18 @@
 import * as React from "react";
 import {
-    Icon,
-    useTheme,
     Text,
-    Card,
     Layout,
-    List,
-    ListItem,
     Button,
-    Menu,
-    MenuItem,
-    ButtonGroup,
 } from "@ui-kitten/components";
 import {
-    Image,
-    Platform,
     StyleSheet,
     View,
-    ImageBackground,
-    Dimensions,
 } from "react-native";
-import { useFocusEffect } from "@react-navigation/native";
-import ScrollPage from "../../components/ScrollPage";
-import NavHeaderBar from "../../components/NavHeaderBar";
 import { useModel } from "flooks";
 import Textarea from "react-native-textarea";
-export default function AutomaticScreen({ navigation, route }) {
-    const { httpPost, httpGet } = useModel("httpModel", true);
-    const { userId } = useModel("userModel");
-    const { loading, success } = useModel("loadingModel");
-    const {
-        automaticText1,
-        automaticText2,
-        automaticText3,
-        automaticText4,
-        save,
-        cancel,
-        successText,
-    } = useModel("wordsModel");
-
-    const [goodContent, setGoodContent] = React.useState("");
-    const [badContent, setBadContent] = React.useState("");
-    const [id, setId] = React.useState("");
-
-    function refreshEvent() {
-        return httpGet("/automaticResponse/my").then(res => {
-            if (res) {
-                setGoodContent(res.goodContent || "");
-                setBadContent(res.badContent || "");
-                setId(res.id || "");
-            }
-        });
-    }
-
-    function submit() {
-        httpPost(
-            "/automaticResponse/save",
-            {
-                id,
-                userId,
-                goodContent,
-                badContent,
-            },
-            { body: "json" },
-            true
-        ).then(res => {
-            success(save + successText);
-            navigation.goBack();
-        });
-    }
-
-    const canSub = React.useMemo(() => {
-        if (goodContent || badContent) {
-            return true;
-        } else {
-            return false;
-        }
-    }, [goodContent, badContent]);
-
-    return (
-        <>
-            <NavHeaderBar title={automaticText1} />
-            <ScrollPage
-                enabledFresh={true}
-                refreshEvent={refreshEvent}
-                statusType='primary'
-            >
-                <Layout style={styles.lay}>
-                    <Text style={styles.text}>{automaticText2}</Text>
-                    <Textarea
-                        containerStyle={styles.textareaContainer}
-                        style={styles.textarea}
-                        onChangeText={setGoodContent}
-                        value={goodContent}
-                        maxLength={100}
-                        placeholder={automaticText4}
-                        placeholderTextColor={"#B4B4B4"}
-                        underlineColorAndroid={"transparent"}
-                    />
-                </Layout>
-
-                <Layout style={styles.lay}>
-                    <Text style={styles.text}>{automaticText3}</Text>
-                    <Textarea
-                        containerStyle={styles.textareaContainer}
-                        style={styles.textarea}
-                        onChangeText={setBadContent}
-                        value={badContent}
-                        maxLength={100}
-                        placeholder={automaticText4}
-                        placeholderTextColor={"#B4B4B4"}
-                        underlineColorAndroid={"transparent"}
-                    />
-                </Layout>
+import ScrollPage from "../../components/ScrollPage";
+import NavHeaderBar from "../../components/NavHeaderBar";
 
-                <View style={styles.buttonGroup}>
-                    <Button
-                        status='basic'
-                        appearance='outline'
-                        onPress={() => {
-                            navigation.goBack();
-                        }}
-                    >
-                        {cancel}
-                    </Button>
-                    <Button
-                        disabled={!canSub}
-                        appearance='filled'
-                        onPress={submit}
-                    >
-                        {save}
-                    </Button>
-                </View>
-            </ScrollPage>
-        </>
-    );
-}
 
 const styles = StyleSheet.create({
     lay: {
@@ -153,7 +30,6 @@ const styles = StyleSheet.create({
     upload: {
         marginRight: 10,
         width: 67,
-        width: 67,
         flexShrink: 0,
     },
     textareaContainer: {
@@ -191,3 +67,116 @@ const styles = StyleSheet.create({
         flexDirection: "row",
     },
 });
+
+
+export default function AutomaticScreen({ navigation }) {
+    const { httpPost, httpGet } = useModel("httpModel", true);
+    const { userId } = useModel("userModel");
+    const { success } = useModel("loadingModel");
+    const {
+        automaticText1,
+        automaticText2,
+        automaticText3,
+        automaticText4,
+        save,
+        cancel,
+        successText,
+    } = useModel("wordsModel");
+
+    const [goodContent, setGoodContent] = React.useState("");
+    const [badContent, setBadContent] = React.useState("");
+    const [id, setId] = React.useState("");
+
+    function refreshEvent() {
+        return httpGet("/automaticResponse/my").then(res => {
+            if (res) {
+                setGoodContent(res.goodContent || "");
+                setBadContent(res.badContent || "");
+                setId(res.id || "");
+            }
+        });
+    }
+
+    function submit() {
+        httpPost(
+            "/automaticResponse/save",
+            {
+                id,
+                userId,
+                goodContent,
+                badContent,
+            },
+            { body: "json" },
+            true
+        ).then(() => {
+            success(save + successText);
+            navigation.goBack();
+        });
+    }
+
+    const canSub = React.useMemo(() => {
+        if (goodContent || badContent) {
+            return true;
+        } 
+            return false;
+        
+    }, [goodContent, badContent]);
+
+    return (
+      <>
+        <NavHeaderBar title={automaticText1} />
+        <ScrollPage
+          enabledFresh
+          refreshEvent={refreshEvent}
+          statusType='primary'
+        >
+          <Layout style={styles.lay}>
+            <Text style={styles.text}>{automaticText2}</Text>
+            <Textarea
+              containerStyle={styles.textareaContainer}
+              style={styles.textarea}
+              onChangeText={setGoodContent}
+              value={goodContent}
+              maxLength={100}
+              placeholder={automaticText4}
+              placeholderTextColor="#B4B4B4"
+              underlineColorAndroid="transparent"
+            />
+          </Layout>
+
+          <Layout style={styles.lay}>
+            <Text style={styles.text}>{automaticText3}</Text>
+            <Textarea
+              containerStyle={styles.textareaContainer}
+              style={styles.textarea}
+              onChangeText={setBadContent}
+              value={badContent}
+              maxLength={100}
+              placeholder={automaticText4}
+              placeholderTextColor="#B4B4B4"
+              underlineColorAndroid="transparent"
+            />
+          </Layout>
+
+          <View style={styles.buttonGroup}>
+            <Button
+              status='basic'
+              appearance='outline'
+              onPress={() => {
+                            navigation.goBack();
+                        }}
+            >
+              {cancel}
+            </Button>
+            <Button
+              disabled={!canSub}
+              appearance='filled'
+              onPress={submit}
+            >
+              {save}
+            </Button>
+          </View>
+        </ScrollPage>
+      </>
+    );
+}

+ 117 - 126
screens/Set/ClassificationEditScreen.js

@@ -1,39 +1,80 @@
+/* eslint-disable camelcase */
+/* eslint-disable no-unused-vars */
+/* eslint-disable no-underscore-dangle */
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
 import { useModel } from "flooks";
 import {
     Layout,
-    Tab,
-    TabView,
-    Text,
-    useTheme,
     Button,
     Card,
 } from "@ui-kitten/components";
+import {  useRoute } from "@react-navigation/native";
 import FormInput from "../../components/FormInput";
-import { useFocusEffect, useRoute } from "@react-navigation/native";
 import ScrollPage from "../../components/ScrollPage";
 
+const styles = StyleSheet.create({
+    container: {
+        flex: 1,
+        paddingBottom: 33,
+    },
+    tabContent: {
+        backgroundColor: "#fff",
+        marginTop: 20,
+    },
+    img: {
+        width: 100,
+        height: 100,
+        alignSelf: "center",
+    },
+    img2: {
+        width: 97,
+        height: 21,
+        alignSelf: "center",
+        marginTop: 2,
+    },
+    text: {
+        marginTop: 16,
+    },
+    layoutLeft: {
+        flexDirection: "row",
+        paddingVertical: 10,
+        justifyContent: "center",
+        alignItems: "center",
+    },
+    form: {
+        paddingHorizontal: 26,
+        paddingVertical: 20,
+    },
+    textareaContainer: {
+        backgroundColor: "#F0F0F0",
+        height: 100,
+        borderRadius: 4,
+    },
+    textarea: {
+        textAlignVertical: "top", // hack android
+        fontSize: 13,
+        color: "#333",
+        paddingHorizontal: 14,
+        paddingVertical: 10,
+        height: 100,
+    },
+});
+
 export default function ClassificationEdit({ navigation }) {
     const route = useRoute();
-    const theme = useTheme();
-    const { changeBackground } = useModel("barModel");
     const { httpGet, httpPost } = useModel("httpModel", true);
-    const { registerSecend, changeGuideStep, mid } = useModel(
+    const {  mid } = useModel(
         "userModel",
         true
     );
     const { success } = useModel("loadingModel", true);
 
-    const {
-        guide2_title1,
+	const {
+		guide2_title1,
         guide2_title2,
         guide2_form_1,
         guide2_pla_1,
@@ -47,20 +88,18 @@ export default function ClassificationEdit({ navigation }) {
         guide1_pla_5,
         next,
         pass,
-        passTips,
-    } = useModel("wordsModel");
-    const { showDialog } = useModel("dialogModel", true);
+        passTips,} = useModel("wordsModel");
     const { removeCLass } = useModel("goodsModel", true);
     const [pageName, changePageName] = React.useState("");
     const [id, changeId] = React.useState("");
     const [name, changeName] = React.useState("");
     const [sort, changeSort] = React.useState("");
     const [goodsIds, changeGoodsIds] = React.useState("");
-    const { selectInfos, changeSelect } = useModel("goodsModel");
+    const { selectInfos } = useModel("goodsModel");
 
     React.useEffect(() => {
         if (selectInfos.length > 0) {
-            let _ids = selectInfos.map(item => {
+            const _ids = selectInfos.map(item => {
                 return item.id;
             });
             changeGoodsIds(_ids.join(","));
@@ -70,9 +109,9 @@ export default function ClassificationEdit({ navigation }) {
     const canNext = React.useMemo(() => {
         if (name && sort) {
             return true;
-        } else {
+        } 
             return false;
-        }
+        
     }, [name, sort, goodsIds]);
 
     const addClass = () => {
@@ -91,10 +130,10 @@ export default function ClassificationEdit({ navigation }) {
     };
 
     const refreshEvent = () => {
-        let { classifyId, classifyTitle } = route.params || {};
+        const { classifyId, classifyTitle } = route.params || {};
         changeId(classifyId || 0);
         changePageName(classifyTitle);
-        return httpGet("/classification/get/" + classifyId, {}, true).then(
+        return httpGet(`/classification/get/${  classifyId}`, {}, true).then(
             res => {
                 changeName(res.name || "");
                 changeSort(res.sort || 1);
@@ -110,119 +149,71 @@ export default function ClassificationEdit({ navigation }) {
     }
 
     return (
-        <>
-            <ScrollPage
-                statusType='primary'
-                navHeaderBarTitle={pageName}
-                enabledFresh={true}
-                refreshEvent={refreshEvent}
-            >
-                <Layout style={styles.container}>
-                    <Card appearance='formFilled'>
-                        {/* 类别名称 */}
-                        <FormInput
-                            label={guide2_form_1}
-                            placeholder={guide2_pla_1}
-                            value={name}
-                            onChange={changeName}
-                            style={{ paddingVertical: 3 }}
-                        />
-                        {/* 显示排序 */}
-                        <FormInput
-                            label={guide2_form_2}
-                            value={sort}
-                            type='actionSheet'
-                            list={[1, 2, 3, 4, 5, 6, 7, 8, 9]}
-                            onChange={changeSort}
-                            textAlign='right'
-                        />
+      <>
+        <ScrollPage
+          statusType='primary'
+          navHeaderBarTitle={pageName}
+          enabledFresh
+          refreshEvent={refreshEvent}
+        >
+          <Layout style={styles.container}>
+            <Card appearance='formFilled'>
+              {/* 类别名称 */}
+              <FormInput
+                label={guide2_form_1}
+                placeholder={guide2_pla_1}
+                value={name}
+                onChange={changeName}
+                style={{ paddingVertical: 3 }}
+              />
+              {/* 显示排序 */}
+              <FormInput
+                label={guide2_form_2}
+                value={sort}
+                type='actionSheet'
+                list={[1, 2, 3, 4, 5, 6, 7, 8, 9]}
+                onChange={changeSort}
+                textAlign='right'
+              />
 
-                        {/* 商品 */}
-                        <FormInput
-                            label={guide2_form_3}
-                            value={goodsIds}
-                            type='url'
-                            changePath={() => {
+              {/* 商品 */}
+              <FormInput
+                label={guide2_form_3}
+                value={goodsIds}
+                type='url'
+                changePath={() => {
                                 navigation.navigate("AddClassification", {
                                     type: "classification",
                                     classificationId: id,
                                 });
                             }}
-                            textAlign='right'
-                        />
-                        <Layout style={styles.layoutLeft} level='1'>
-                            <Button
-                                status='primary'
-                                disabled={!canNext}
-                                onPress={() => {
+                textAlign='right'
+              />
+              <Layout style={styles.layoutLeft} level='1'>
+                <Button
+                  status='primary'
+                  disabled={!canNext}
+                  onPress={() => {
                                     addClass().then(_ => {
                                         success("添加成功");
                                         navigation.goBack();
                                     });
                                 }}
-                            >
-                                确定
-                            </Button>
-                            <Button
-                                style={{ marginLeft: 20 }}
-                                appearance='outline'
-                                status='info'
-                                onPress={delEvent}
-                            >
-                                删除
-                            </Button>
-                        </Layout>
-                    </Card>
-                </Layout>
-            </ScrollPage>
-        </>
+                >
+                  确定
+                </Button>
+                <Button
+                  style={{ marginLeft: 20 }}
+                  appearance='outline'
+                  status='info'
+                  onPress={delEvent}
+                >
+                  删除
+                </Button>
+              </Layout>
+            </Card>
+          </Layout>
+        </ScrollPage>
+      </>
     );
 }
-
-const styles = StyleSheet.create({
-    container: {
-        flex: 1,
-        paddingBottom: 33,
-    },
-    tabContent: {
-        backgroundColor: "#fff",
-        marginTop: 20,
-    },
-    img: {
-        width: 100,
-        height: 100,
-        alignSelf: "center",
-    },
-    img2: {
-        width: 97,
-        height: 21,
-        alignSelf: "center",
-        marginTop: 2,
-    },
-    text: {
-        marginTop: 16,
-    },
-    layoutLeft: {
-        flexDirection: "row",
-        paddingVertical: 10,
-        justifyContent: "center",
-        alignItems: "center",
-    },
-    form: {
-        paddingHorizontal: 26,
-        paddingVertical: 20,
-    },
-    textareaContainer: {
-        backgroundColor: "#F0F0F0",
-        height: 100,
-        borderRadius: 4,
-    },
-    textarea: {
-        textAlignVertical: "top", // hack android
-        fontSize: 13,
-        color: "#333",
-        paddingHorizontal: 14,
-        paddingVertical: 10,
-        height: 100,
-    },
-});

+ 102 - 91
screens/Set/DistributionScreen.js

@@ -1,12 +1,50 @@
+/* eslint-disable react/destructuring-assignment */
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
-import ScrollPage from "../../components/ScrollPage";
 import { useModel } from "flooks";
 import { Layout, Input, Button, Text } from "@ui-kitten/components";
 import { StyleSheet } from "react-native";
+import ScrollPage from "../../components/ScrollPage";
+
+const styles = StyleSheet.create({
+    lay: {
+        flex: 1,
+        marginTop: 10,
+        paddingVertical: 20,
+    },
+    item: {
+        flexDirection: "row",
+        alignItems: "center",
+        marginBottom: 7,
+        alignSelf: "stretch",
+    },
+    lab: {
+        width: 119,
+        textAlign: "right",
+        marginRight: 38,
+        flexShrink: 0,
+    },
+    tip: {
+        width: 86,
+        paddingHorizontal: 8,
+        flexShrink: 0,
+    },
+    input: {
+        flexShrink: 1,
+        minWidth: 0,
+    },
+    btn: {
+        marginTop: 50,
+        marginBottom: 20,
+        alignSelf: "center",
+    },
+    bottom: {
+        paddingHorizontal: 70,
+    },
+});
 
-//配送设置
-export default function DistributionScreen({ navigation, route }) {
+// 配送设置
+export default function DistributionScreen({ navigation }) {
     const {
         distributionTitle,
         minutes,
@@ -21,7 +59,6 @@ export default function DistributionScreen({ navigation, route }) {
     } = useModel("wordsModel");
 
     const {
-        getUserInfo,
         startingAmount,
         preparationTime,
         updateMerchant,
@@ -41,61 +78,69 @@ export default function DistributionScreen({ navigation, route }) {
     }, [startingAmount, preparationTime]);
 
     const Lable = props => (
-        <Text category='c1' style={styles.lab}>
-            {props.children}
-        </Text>
+      <Text category='c1' style={styles.lab}>
+        {props.children}
+      </Text>
     );
     const Tip = props => (
-        <Text category='c1' status='info' style={styles.tip}>
-            {props.children}
-        </Text>
+      <Text category='c1' status='info' style={styles.tip}>
+        {props.children}
+      </Text>
     );
 
     const canSubmit = React.useMemo(() => {
         if (amount && time) {
             return true;
-        } else {
+        } 
             return false;
-        }
+        
     }, [amount, time]);
 
     return (
-        <ScrollPage statusType='primary' navHeaderBarTitle={distributionTitle}>
-            <Layout style={styles.lay}>
-                <Layout style={styles.item}>
-                    <Lable>{distributionText1}</Lable>
-                    <Input
-                        value={amount}
-                        onChangeText={text => {
+      <ScrollPage statusType='primary' navHeaderBarTitle={distributionTitle}>
+        <Layout style={styles.lay}>
+          <Layout style={styles.item}>
+            <Lable>{distributionText1}</Lable>
+            <Input
+              value={amount}
+              onChangeText={text => {
                             setAmount(text);
                         }}
-                        key={2}
-                        keyboardType='numeric'
-                        maxLength={3}
-                        placeholder={distributionText3}
-                        style={styles.input}
-                    />
-                    <Tip>(0-100{yuan})</Tip>
-                </Layout>
-                <Layout style={styles.item}>
-                    <Lable>{distributionText2}</Lable>
-                    <Input
-                        value={time}
-                        key={1}
-                        onChangeText={text => {
+              key={2}
+              keyboardType='numeric'
+              maxLength={3}
+              placeholder={distributionText3}
+              style={styles.input}
+            />
+            <Tip>
+              (0-100
+              {yuan}
+              )
+            </Tip>
+          </Layout>
+          <Layout style={styles.item}>
+            <Lable>{distributionText2}</Lable>
+            <Input
+              value={time}
+              key={1}
+              onChangeText={text => {
                             setTime(text);
                         }}
-                        keyboardType='numeric'
-                        maxLength={2}
-                        placeholder={distributionText4}
-                        style={styles.input}
-                    />
-                    <Tip>(1-30{minutes})</Tip>
-                </Layout>
+              keyboardType='numeric'
+              maxLength={2}
+              placeholder={distributionText4}
+              style={styles.input}
+            />
+            <Tip>
+              (1-30
+              {minutes}
+              )
+            </Tip>
+          </Layout>
 
-                <Button
-                    disabled={!canSubmit}
-                    onPress={() => {
+          <Button
+            disabled={!canSubmit}
+            onPress={() => {
                         updateMerchant({
                             startingAmount: amount,
                             preparationTime: time,
@@ -104,53 +149,19 @@ export default function DistributionScreen({ navigation, route }) {
                             navigation.goBack();
                         });
                     }}
-                    style={styles.btn}
-                >
-                    {confirm}
-                </Button>
-                <Text category='c1' status='info' style={styles.bottom}>
-                    {distributionText5}:
-                </Text>
-                <Text category='c1' status='info' style={styles.bottom}>
-                    {distributionText6}:
-                </Text>
-            </Layout>
-        </ScrollPage>
+            style={styles.btn}
+          >
+            {confirm}
+          </Button>
+          <Text category='c1' status='info' style={styles.bottom}>
+            {distributionText5}
+            :
+          </Text>
+          <Text category='c1' status='info' style={styles.bottom}>
+            {distributionText6}
+            :
+          </Text>
+        </Layout>
+      </ScrollPage>
     );
 }
-const styles = StyleSheet.create({
-    lay: {
-        flex: 1,
-        marginTop: 10,
-        paddingVertical: 20,
-    },
-    item: {
-        flexDirection: "row",
-        alignItems: "center",
-        marginBottom: 7,
-        alignSelf: "stretch",
-    },
-    lab: {
-        width: 119,
-        textAlign: "right",
-        marginRight: 38,
-        flexShrink: 0,
-    },
-    tip: {
-        width: 86,
-        paddingHorizontal: 8,
-        flexShrink: 0,
-    },
-    input: {
-        flexShrink: 1,
-        minWidth: 0,
-    },
-    btn: {
-        marginTop: 50,
-        marginBottom: 20,
-        alignSelf: "center",
-    },
-    bottom: {
-        paddingHorizontal: 70,
-    },
-});

+ 164 - 193
screens/Set/FirstOrderScreen.js

@@ -1,202 +1,173 @@
-import * as WebBrowser from "expo-web-browser";
-import * as React from "react";
+import * as WebBrowser from 'expo-web-browser';
+import * as React from 'react';
 import {
-    Image,
-    Platform,
-    StyleSheet,
-    View,
-    ImageBackground,
-} from "react-native";
-import { useModel } from "flooks";
+  StyleSheet,
+} from 'react-native';
+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";
+  Layout,
+  Text,
+  useTheme,
+  Button,
+  Input,
+} from '@ui-kitten/components';
+import { useFocusEffect } from '@react-navigation/native';
+import ScrollPage from '../../components/ScrollPage';
+import NavHeaderBar from '../../components/NavHeaderBar';
 
-export default function FirstOrderScreen({ navigation, route }) {
-    const theme = useTheme();
-    const { changeBackground } = useModel("barModel", true);
-    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 [money, changeMoney] = React.useState("");
-    const [edit, changeEdit] = React.useState(false);
-    useFocusEffect(
-        React.useCallback(() => {
-            changeBackground(theme["color-primary-500"]);
-        }, [])
-    );
+  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,
+	  paddingHorizontal: 15,
+	},
+	input: {
+	  marginHorizontal: 5,
+	  minWidth: 49,
+	},
+	text: {
+	  flex: 1,
+	},
+	flexRow: {
+	  flexDirection: 'row',
+	  alignItems: 'center',
+	},
+	buttonlast: {
+	  marginLeft: 10,
+	},
+	button: {
+	  alignSelf: 'flex-start',
+	},
+  });
+  
 
-    const { mid, firstOrder, updateMerchant } = useModel("userModel");
-    React.useEffect(() => {
-        if (!firstOrder) {
-            changeEdit(true);
-        } else {
-            changeMoney(firstOrder.toString() || "");
-        }
-    }, [firstOrder]);
+export default function FirstOrderScreen() {
+  const theme = useTheme();
+  const { changeBackground } = useModel('barModel', true);
 
-  
-    return (
-        <>
-            <NavHeaderBar title='首单' />
-            <ScrollPage
-                style={styles.lay}
-                enabledFresh={true}
-                refreshEvent={() => {
-                    return Promise.resolve();
-                }}
-            >
-                <Layout style={[styles.lay]}>
-                    <Layout style={styles.item}>
-                        <Layout style={[styles.text, styles.flexRow]}>
-                            <Text category='c2'>新用户立减</Text>
-                            {edit ? (
-                                <Input
-                                    size='small'
-                                    style={styles.input}
-                                    value={money}
-                                    keyboardType='numeric'
-                                    onChangeText={changeMoney}
-                                />
-                            ) : (
-                                <Text category='c2'>{money}</Text>
-                            )}
+  const {
+    delText,
+    editText,
+    cancel,
+  } = useModel('wordsModel');
+  const [money, changeMoney] = React.useState('');
+  const [edit, changeEdit] = React.useState(false);
+  useFocusEffect(
+    React.useCallback(() => {
+      changeBackground(theme['color-primary-500']);
+    }, []),
+  );
+
+  const {  firstOrder, updateMerchant } = useModel('userModel');
+  React.useEffect(() => {
+    if (!firstOrder) {
+      changeEdit(true);
+    } else {
+      changeMoney(firstOrder.toString() || '');
+    }
+  }, [firstOrder]);
+
+  return (
+    <>
+      <NavHeaderBar title="首单" />
+      <ScrollPage
+        style={styles.lay}
+        enabledFresh
+        refreshEvent={() => Promise.resolve()}
+      >
+        <Layout style={[styles.lay]}>
+          <Layout style={styles.item}>
+            <Layout style={[styles.text, styles.flexRow]}>
+              <Text category="c2">新用户立减</Text>
+              {edit ? (
+                <Input
+                  size="small"
+                  style={styles.input}
+                  value={money}
+                  keyboardType="numeric"
+                  onChangeText={changeMoney}
+                />
+              ) : (
+                <Text category="c2">{money}</Text>
+              )}
 
-                            <Text category='c2'>元</Text>
-                        </Layout>
-                        {!edit ? (
-                            <>
-                                <Button
-                                    size='small'
-                                    appearance='outline'
-                                    
-                                    onPress={() => {
-                                        changeEdit(true);
-                                    }}
-                                >
-                                    {editText}
-                                </Button>
-                                <Button
-                                    size='small'
-                                    appearance='outline'
-                                    style={styles.buttonlast}
-                                    onPress={() => {
-                                        changeEdit(false);
-                                    }}
-                                >
-                                    {cancel}
-                                </Button>
-                            </>
-                        ) : (
-                            <>
-                                <Button
-                                    size='small'
-                                    onPress={() => {
-                                        changeEdit(false);
-                                        updateMerchant({
-                                            firstOrder: money,
-                                        }).then(() => {
-                                            // success("保存成功");
-                                        });
-                                    }}
-                                >
-                                    保存
-                                </Button>
-                                {money != "" && (
-                                    <Button
-                                        size='small'
-                                        status='danger'
-                                        style={styles.buttonlast}
-                                        onPress={() => {
-                                            changeMoney("");
-                                            changeEdit(true);
-                                            updateMerchant({
-                                                firstOrder: 0,
-                                            }).then(() => {
-                                                // success("删除成功");
-                                            });
-                                        }}
-                                    >
-                                        {delText}
-                                    </Button>
-                                )}
-                            </>
-                        )}
-                    </Layout>
-                </Layout>
-            </ScrollPage>
-        </>
-    );
+              <Text category="c2">元</Text>
+            </Layout>
+            {!edit ? (
+              <>
+                <Button
+                  size="small"
+                  appearance="outline"
+                  onPress={() => {
+                    changeEdit(true);
+                  }}
+                >
+                  {editText}
+                </Button>
+                <Button
+                  size="small"
+                  appearance="outline"
+                  style={styles.buttonlast}
+                  onPress={() => {
+                    changeEdit(false);
+                  }}
+                >
+                  {cancel}
+                </Button>
+              </>
+            ) : (
+              <>
+                <Button
+                  size="small"
+                  onPress={() => {
+                        changeEdit(false);
+                        updateMerchant({
+                          firstOrder: money,
+                        }).then(() => {
+                          // success("保存成功");
+                        });
+                      }}
+                >
+                  保存
+                </Button>
+                {money !== '' && (
+                <Button
+                  size="small"
+                  status="danger"
+                  style={styles.buttonlast}
+                  onPress={() => {
+                            changeMoney('');
+                            changeEdit(true);
+                            updateMerchant({
+                              firstOrder: 0,
+                            }).then(() => {
+                              // success("删除成功");
+                            });
+                          }}
+                >
+                  {delText}
+                </Button>
+                )}
+              </>
+            )}
+          </Layout>
+        </Layout>
+      </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,
-        paddingHorizontal: 15,
-    },
-    input: {
-        marginHorizontal: 5,
-        minWidth: 49,
-    },
-    text: {
-        flex: 1,
-    },
-    flexRow: {
-        flexDirection: "row",
-        alignItems: "center",
-    },
-    buttonlast: {
-        marginLeft: 10,
-    },
-    button: {
-        alignSelf: "flex-start",
-    },
-});

+ 95 - 118
screens/Set/OrderSetting.js

@@ -1,49 +1,80 @@
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
 import {
-    Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
 import { useModel } from "flooks";
 import {
-    Layout,
-    Tab,
-    TabView,
     Text,
     useTheme,
-    Button,
-    Card,
-    List,
-    Select,
-    SelectItem,
-    IndexPath,
-    Avatar,
-    Divider,
     MenuItem,
     Toggle,
     Icon,
 } from "@ui-kitten/components";
 import { useFocusEffect } from "@react-navigation/native";
-import ScrollPage from "../../components/ScrollPage";
 import NavHeaderBar from "../../components/NavHeaderBar";
-import Email from "../../components/Email";
 
-import ListComponent from "../../components/ListComponent";
-
-// 余额
-const data = ["2020-03", "2020-04", "2020-05"];
-const ItemSeparatorComponent = props => <Divider />;
+const ForwardIcon = props => (
+  <Icon
+    {...props}
+    name='arrow-ios-forward'
+    fill='#B4B4B4'
+    style={{ width: 15, height: 15, fontWeight: 500 }}
+  />
+  );
+  
+  const styles = StyleSheet.create({
+	  top: {
+		  flexDirection: "row",
+		  alignItems: "center",
+		  paddingVertical: 10,
+		  marginBottom: 10,
+		  justifyContent: "space-between",
+	  },
+	  list: {
+		  flex: 1,
+		  backgroundColor: "#fff",
+		  paddingHorizontal: 15,
+		  // paddingTop: 20,
+		  marginTop: 20,
+	  },
+	  separatorStyle: {
+		  marginHorizontal: 13,
+	  },
+	  main: {
+		  marginTop: 10,
+		  paddingHorizontal: 15,
+		  paddingVertical: 10,
+	  },
+	  content: {
+		  color: "#787878",
+		  paddingVertical: 10,
+		  borderTopWidth: 1,
+		  borderColor: "#E5E5E5",
+	  },
+	  text: {
+		  color: "#787878",
+		  marginTop: 5,
+	  },
+	  wait: {
+		  textAlign: "center",
+		  paddingVertical: 20,
+	  },
+	  menuItem: {},
+	  title: {
+		  padding: 15,
+	  },
+	  bottom: {
+		  marginTop: 10,
+	  },
+  });
 
-export default function OrderSettingScreen({ navigation, route }) {
+export default function OrderSettingScreen({ navigation }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
     // const { automaticOrder } = useModel("userModel");
-    const { httpPost, httpGet } = useModel("httpModel", true);
 
-    const {} = useModel("wordsModel");
+    // const {} = useModel("wordsModel");
     // const { getMyList } = useModel("emailModel");
 
     const [automaticOrder, changeautoMaticOrder] = React.useState(true);
@@ -56,111 +87,57 @@ export default function OrderSettingScreen({ navigation, route }) {
         }, [])
     );
 
-    const emailItem = ({ item, index }) => <Email key={index} info={item} />;
 
     return (
-        <>
-            <NavHeaderBar title='订单' />
+      <>
+        <NavHeaderBar title='订单' />
 
-            <MenuItem
-                title='自动接单'
-                accessoryRight={props => (
-                    <Toggle
-                        key='Toggle'
-                        checked={automaticOrder}
-                        onChange={changeautoMaticOrder}
-                    />
-                )}
-                style={styles.menuItem}
+        <MenuItem
+          title='自动接单'
+          accessoryRight={() => (
+            <Toggle
+              key='Toggle'
+              checked={automaticOrder}
+              onChange={changeautoMaticOrder}
             />
-
-            <Text style={styles.title}>订单语音配置</Text>
-            <MenuItem
-                title='接单提醒'
-                accessoryRight={props => (
-                    <Toggle
-                        key='Toggle'
-                        checked={voice1}
-                        onChange={changeVoice1}
-                    />
                 )}
-                style={styles.menuItem}
+          style={styles.menuItem}
+        />
+
+        <Text style={styles.title}>订单语音配置</Text>
+        <MenuItem
+          title='接单提醒'
+          accessoryRight={() => (
+            <Toggle
+              key='Toggle'
+              checked={voice1}
+              onChange={changeVoice1}
             />
-            <MenuItem
-                title='骑手取餐提醒'
-                accessoryRight={props => (
-                    <Toggle
-                        key='Toggle'
-                        checked={voice2}
-                        onChange={changeVoice2}
-                    />
                 )}
-                style={styles.menuItem}
+          style={styles.menuItem}
+        />
+        <MenuItem
+          title='骑手取餐提醒'
+          accessoryRight={() => (
+            <Toggle
+              key='Toggle'
+              checked={voice2}
+              onChange={changeVoice2}
             />
+                )}
+          style={styles.menuItem}
+        />
 
-            <MenuItem
-                title='我的对账单'
-                accessoryRight={ForwardIcon}
-                style={styles.bottom}
-                onPress={() => {
+        <MenuItem
+          title='我的对账单'
+          accessoryRight={ForwardIcon}
+          style={styles.bottom}
+          onPress={() => {
                     navigation.navigate("MyRecord");
                 }}
-            />
-        </>
+        />
+      </>
     );
 }
 
-const ForwardIcon = props => (
-    <Icon
-        {...props}
-        name='arrow-ios-forward'
-        fill='#B4B4B4'
-        style={{ width: 15, height: 15, fontWeight: 500 }}
-    />
-);
 
-const styles = StyleSheet.create({
-    top: {
-        flexDirection: "row",
-        alignItems: "center",
-        paddingVertical: 10,
-        marginBottom: 10,
-        justifyContent: "space-between",
-    },
-    list: {
-        flex: 1,
-        backgroundColor: "#fff",
-        paddingHorizontal: 15,
-        // paddingTop: 20,
-        marginTop: 20,
-    },
-    separatorStyle: {
-        marginHorizontal: 13,
-    },
-    main: {
-        marginTop: 10,
-        paddingHorizontal: 15,
-        paddingVertical: 10,
-    },
-    content: {
-        color: "#787878",
-        paddingVertical: 10,
-        borderTopWidth: 1,
-        borderColor: "#E5E5E5",
-    },
-    text: {
-        color: "#787878",
-        marginTop: 5,
-    },
-    wait: {
-        textAlign: "center",
-        paddingVertical: 20,
-    },
-    menuItem: {},
-    title: {
-        padding: 15,
-    },
-    bottom: {
-        marginTop: 10,
-    },
-});

+ 135 - 144
screens/Set/SystemClassificationEditScreen.js

@@ -1,49 +1,68 @@
+/* eslint-disable no-underscore-dangle */
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
-import ListComponent from "../../components/ListComponent";
-import TipNavHeader from "../../components/TipNavHeader";
 import { useModel } from "flooks";
 import {
     Layout,
-    Input,
     Button,
     Text,
-    ListItem,
     Icon,
     Toggle,
 } from "@ui-kitten/components";
-import { StyleSheet, View } from "react-native";
-import ListUtil from "../../Utils/ListUtil";
+import { StyleSheet } from "react-native";
+import { useRoute } from "@react-navigation/native";
+import ListComponent from "../../components/ListComponent";
+import TipNavHeader from "../../components/TipNavHeader";
 import {
     ClassificationUtil,
     getClassificationByName,
 } from "../../Utils/SystemRuleUtil";
-import { useRoute } from "@react-navigation/native";
 import GoodsCard from "../../components/GoodsCard";
-const ForwardIcon = props => (
-    <Icon
-        {...props}
-        name='arrow-ios-forward'
-        fill='#B4B4B4'
-        style={{ width: 15, height: 15, fontWeight: 500 }}
-    />
-);
-//系统分类编辑
+
+
+
+const StarIcon = props => <Icon {...props} name='plus' />;
+const styles = StyleSheet.create({
+    text1: {
+        marginTop: 10,
+        marginLeft: 57,
+        maxWidth: 200,
+    },
+    list: {
+        backgroundColor: "#fff",
+    },
+    separatorStyle: {
+        height: 0,
+    },
+    right: {
+        flexDirection: "row",
+        alignItems: "center",
+    },
+    addGoods: {
+        width: 33,
+        margin: 15,
+    },
+    toggle: {
+        alignSelf: "flex-start",
+        marginTop: 10,
+    },
+    top: {
+        backgroundColor: "rgb(238, 238, 238)",
+        paddingHorizontal: 13,
+        paddingVertical: 10,
+        marginTop: 10,
+    },
+});
+
+
+
+// 系统分类编辑
 export default function SystemClassificationEditScreen({ navigation }) {
-    const {
-        ClassificationManage,
-        ClassificationManageText6,
-        getWordsStr,
-    } = useModel("wordsModel");
-
-    const {
-        getUserInfo,
-        startingAmount,
-        preparationTime,
-        updateMerchant,
-    } = useModel("userModel");
+    const { ClassificationManageText6,getWordsStr, } = useModel("wordsModel");
+
+    // const {} = useModel("userModel");
     const route = useRoute();
-    const { success } = useModel("loadingModel");
+    // const {  } = useModel("loadingModel");
     const { httpGet } = useModel("httpModel");
     const { clossClassTip, saveInfo, removeClassGoods } = useModel(
         "goodsModel",
@@ -55,35 +74,26 @@ export default function SystemClassificationEditScreen({ navigation }) {
     const [tips, setTipList] = React.useState([]);
     const [classifyInfo, setClass] = React.useState(new ClassificationUtil());
     const [delId, setDel] = React.useState(0);
-    const [isOpen, changeIsOpen] = React.useState(false);
-
-    const checkEvent = isChecked => {
-        changeIsOpen(isChecked);
-        if (!isChecked) {
-            clossClassTip(() => {
-                saveInfo({
-                    ...classifyInfo.allInfo,
-                    isOpen: isChecked,
-                }).then(res => {
-                    getInfo(classifyInfo.id);
-                });
-            });
-        } else {
-            saveInfo({
-                ...classifyInfo.allInfo,
-                isOpen: isChecked,
-            }).then(res => {
-                getInfo(classifyInfo.id);
-            });
-        }
-    };
+	const [isOpen, changeIsOpen] = React.useState(false);
+	
 
+	function getInfo(classifyId) {
+        return httpGet(`/classification/get/${classifyId}`, {}, true).then(
+            res => {
+                setTitle(res.name || "");
+                const classify = new ClassificationUtil(res);
+                setClass(classify);
+                setTipList(classify.getMenuTipsList());
+                changeIsOpen(res.isOpen);
+            }
+        );
+	}
     function getList() {
-        let { classifyId, classifyTitle } = route.params || {};
+        const { classifyId } = route.params || {};
         setId(classifyId || 0);
         setDel(0);
         return getInfo(classifyId)
-            .then(_ => {
+            .then(() => {
                 return httpGet("/classification/allGoods", {
                     classificationId: classifyId,
                 });
@@ -100,127 +110,108 @@ export default function SystemClassificationEditScreen({ navigation }) {
             });
     }
 
-    function getInfo(classifyId) {
-        return httpGet("/classification/get/" + classifyId, {}, true).then(
-            res => {
-                setTitle(res.name || "");
-                let classify = new ClassificationUtil(res);
-                setClass(classify);
-                setTipList(classify.getMenuTipsList());
-                changeIsOpen(res.isOpen);
-            }
-        );
-    }
-
-    const goodsItem = ({ item, index }) => (
-        <GoodsCard
-            appearance='classification'
-            key={index}
-            info={item}
-            removeEvent={() => remove(id, item.id)}
-        />
-    );
+ 
+	
+	
+    const checkEvent = isChecked => {
+        changeIsOpen(isChecked);
+        if (!isChecked) {
+            clossClassTip(() => {
+                saveInfo({
+                    ...classifyInfo.allInfo,
+                    isOpen: isChecked,
+                }).then(() => {
+                    getInfo(classifyInfo.id);
+                });
+            });
+        } else {
+            saveInfo({
+                ...classifyInfo.allInfo,
+                isOpen: isChecked,
+            }).then(() => {
+                getInfo(classifyInfo.id);
+            });
+        }
+    };
 
-    function remove(classId, goodsId) {
-        removeClassGoods(classId, goodsId, res => {
+	function remove(classId, goodsId) {
+        removeClassGoods(classId, goodsId, () => {
             setDel(goodsId);
         });
     }
+    const goodsItem = ({ item, index }) => (
+      <GoodsCard
+        appearance='classification'
+        key={index}
+        info={item}
+        removeEvent={() => remove(id, item.id)}
+      />
+    );
+
+   
 
     function TipsTexts() {
-        let _tips =
+        const _tips =
             [...tips].map((item, index) => {
                 return <Text key={index}>{getWordsStr(item)}</Text>;
             }) || [];
 
         _tips.push(
-            <Toggle
-                key='Toggle'
-                checked={isOpen}
-                onChange={checkEvent}
-                style={styles.toggle}
-            >
-                {isOpen ? "开启" : "关闭"}
-            </Toggle>
+          <Toggle
+            key='Toggle'
+            checked={isOpen}
+            onChange={checkEvent}
+            style={styles.toggle}
+          >
+            {isOpen ? "开启" : "关闭"}
+          </Toggle>
         );
 
         return _tips;
     }
 
     return (
-        <>
-            <TipNavHeader title={title}>{TipsTexts()}</TipNavHeader>
-
-            <Layout style={styles.top}>
-                <Text category='h6'>{ClassificationManageText6}</Text>
-            </Layout>
-            <ListComponent
-                getInfo={getList}
-                renderItem={goodsItem}
-                separatorStyle={styles.separatorStyle}
-                showEmpty={true}
-                delId={delId}
-                style={styles.list}
-                extraData={{ id: id }}
-                ListFooterComponent={() => {
+      <>
+        <TipNavHeader title={title}>{TipsTexts()}</TipNavHeader>
+
+        <Layout style={styles.top}>
+          <Text category='h6'>{ClassificationManageText6}</Text>
+        </Layout>
+        <ListComponent
+          getInfo={getList}
+          renderItem={goodsItem}
+          separatorStyle={styles.separatorStyle}
+          showEmpty
+          delId={delId}
+          style={styles.list}
+          extraData={{ id }}
+          ListFooterComponent={() => {
                     if (
-                        classifyInfo.getType() !=
+                        classifyInfo.getType() !==
                             getClassificationByName("好评") &&
-                        classifyInfo.getType() !=
+                        classifyInfo.getType() !==
                             getClassificationByName("折扣")
                     ) {
                         return (
-                            <Button
-                                style={styles.addGoods}
-                                appearance='classification'
-                                status='danger'
-                                accessoryLeft={StarIcon}
-                                onPress={() => {
+                          <Button
+                            style={styles.addGoods}
+                            appearance='classification'
+                            status='danger'
+                            accessoryLeft={StarIcon}
+                            onPress={() => {
                                     navigation.navigate("AddClassification", {
                                         type: "classification",
                                         classificationId: id,
                                     });
                                 }}
-                            />
+                          />
                         );
-                    } else {
+                    } 
                         return <></>;
-                    }
+                    
                 }}
-            />
-        </>
+        />
+      </>
     );
 }
 
-const StarIcon = props => <Icon {...props} name='plus' />;
-const styles = StyleSheet.create({
-    text1: {
-        marginTop: 10,
-        marginLeft: 57,
-        maxWidth: 200,
-    },
-    list: {
-        backgroundColor: "#fff",
-    },
-    separatorStyle: {
-        height: 0,
-    },
-    right: {
-        flexDirection: "row",
-        alignItems: "center",
-    },
-    addGoods: {
-        width: 33,
-        margin: 15,
-    },
-    toggle: {
-        alignSelf: "flex-start",
-        marginTop: 10,
-    },
-    top: {
-        backgroundColor: "rgb(238, 238, 238)",
-        paddingHorizontal: 13,
-        paddingVertical: 10,
-        marginTop: 10,
-    },
-});

+ 25 - 25
screens/Set/index.js

@@ -10,30 +10,30 @@ import OrderSetting from "./OrderSetting";
 
 export default function Set(Screen) {
     return (
-        <>
-            {/* 自动回复 */}
-            <Screen name='Automatic' component={AutomaticScreen} />
-            {/* 物流设置 */}
-            <Screen name='Distribution' component={DistributionScreen} />
-            {/* 分类管理 */}
-            <Screen
-                name='ClassificationManage'
-                component={ClassificationManageScreen}
-            />
-            {/* 系统分类编辑 */}
-            <Screen
-                name='SystemClassificationEdit'
-                component={SystemClassificationEditScreen}
-            />
-            {/* 普通分类编辑 */}
-            <Screen
-                name='ClassificationEdit'
-                component={ClassificationEditScreen}
-            />
-            {/* 首单优惠 */}
-            <Screen name='FirstOrder' component={FirstOrderScreen} />
-            {/* 首单优惠 */}
-            <Screen name='OrderSetting' component={OrderSetting} />
-        </>
+      <>
+        {/* 自动回复 */}
+        <Screen name='Automatic' component={AutomaticScreen} />
+        {/* 物流设置 */}
+        <Screen name='Distribution' component={DistributionScreen} />
+        {/* 分类管理 */}
+        <Screen
+          name='ClassificationManage'
+          component={ClassificationManageScreen}
+        />
+        {/* 系统分类编辑 */}
+        <Screen
+          name='SystemClassificationEdit'
+          component={SystemClassificationEditScreen}
+        />
+        {/* 普通分类编辑 */}
+        <Screen
+          name='ClassificationEdit'
+          component={ClassificationEditScreen}
+        />
+        {/* 首单优惠 */}
+        <Screen name='FirstOrder' component={FirstOrderScreen} />
+        {/* 首单优惠 */}
+        <Screen name='OrderSetting' component={OrderSetting} />
+      </>
     );
 }

+ 83 - 88
screens/StoreAudit.js

@@ -1,30 +1,47 @@
 import * as WebBrowser from "expo-web-browser";
 import * as React from "react";
+import { useFocusEffect } from "@react-navigation/native";
 import {
     Image,
-    Platform,
     StyleSheet,
-    View,
-    ImageBackground,
 } from "react-native";
-import scrollPage from "../components/ScrollPage";
 import { useModel } from "flooks";
 import {
     Layout,
-    Tab,
-    TabView,
     Text,
     useTheme,
     Button,
-    Card,
 } from "@ui-kitten/components";
-import FormInput from "../components/FormInput";
-import { useFocusEffect } from "@react-navigation/native";
 import NavHeaderBar from "../components/NavHeaderBar";
-import GoodsCard from "../components/GoodsCard";
 import ConnectButton from "../components/ConnectButton";
+import ScrollPage from '../components/ScrollPage'
+
+const img = require("../assets/images/shehe1.png");
+const img1 = require("../assets/images/shenhe.png");
 
-export default function StoreAudit({ navigation, route }) {
+const styles = StyleSheet.create({
+    container: {
+        flex: 1,
+        paddingBottom: 33,
+        paddingVertical: 40,
+        alignItems: "center",
+    },
+    icon: {
+        width: 90,
+        height: 80,
+        marginBottom: 26,
+    },
+    text: {
+        fontWeight: "500",
+        marginBottom: 7,
+    },
+    button: {
+        marginTop: 19,
+    },
+});
+
+
+export default function StoreAudit() {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
     const { status, changeGuideStep, getUserInfo } = useModel("userModel");
@@ -37,8 +54,6 @@ export default function StoreAudit({ navigation, route }) {
         storeAudioText4,
         complete,
     } = useModel("wordsModel");
-    const [categoryList, changeCategoryList] = React.useState([]);
-    const [merchantNatureList, changeMerchantNatureList] = React.useState([]);
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
@@ -50,84 +65,64 @@ export default function StoreAudit({ navigation, route }) {
     }
 
     return (
-        <>
-            <NavHeaderBar title={storeAudio} back={false} />
-            <ScrollPage enabledFresh={true} refreshEvent={refreshEvent}>
-                <Layout style={styles.container}>
-                    {status == "PENDING" ? (
-                        <>
-                            <Image
-                                source={require("../assets/images/shenhe.png")}
-                                style={styles.icon}
-                            />
-                            <Text
-                                category='h6'
-                                status='info'
-                                style={styles.text}
-                            >
-                                {storeAudioText1}
-                            </Text>
-                            <Text
-                                category='h6'
-                                status='info'
-                                style={styles.text}
-                            >
-                                {storeAudioText2}
-                            </Text>
-                        </>
+      <>
+        <NavHeaderBar title={storeAudio} back={false} />
+        <ScrollPage enabledFresh refreshEvent={refreshEvent}>
+          <Layout style={styles.container}>
+            {status === "PENDING" ? (
+              <>
+                <Image
+                  source={img1}
+                  style={styles.icon}
+                />
+                <Text
+                  category='h6'
+                  status='info'
+                  style={styles.text}
+                >
+                  {storeAudioText1}
+                </Text>
+                <Text
+                  category='h6'
+                  status='info'
+                  style={styles.text}
+                >
+                  {storeAudioText2}
+                </Text>
+              </>
                     ) : (
-                        <>
-                            <Image
-                                source={require("../assets/images/shehe1.png")}
-                                style={styles.icon}
-                            />
-                            <Text
-                                category='h6'
-                                status='primary'
-                                style={styles.text}
-                            >
-                                {storeAudioText3}
-                            </Text>
-                            <Text
-                                category='h6'
-                                status='primary'
-                                style={styles.text}
-                            >
-                                {storeAudioText4}
-                            </Text>
-                            <Button
-                                style={styles.button}
-                                onPress={() => changeGuideStep("finish")}
-                            >
-                                {complete}
-                            </Button>
-                        </>
+                      <>
+                        <Image
+                          source={img}
+                          style={styles.icon}
+                        />
+                        <Text
+                          category='h6'
+                          status='primary'
+                          style={styles.text}
+                        >
+                          {storeAudioText3}
+                        </Text>
+                        <Text
+                          category='h6'
+                          status='primary'
+                          style={styles.text}
+                        >
+                          {storeAudioText4}
+                        </Text>
+                        <Button
+                          style={styles.button}
+                          onPress={() => changeGuideStep("finish")}
+                        >
+                          {complete}
+                        </Button>
+                      </>
                     )}
 
-                    <ConnectButton />
-                </Layout>
-            </ScrollPage>
-        </>
+            <ConnectButton />
+          </Layout>
+        </ScrollPage>
+      </>
     );
 }
 
-const styles = StyleSheet.create({
-    container: {
-        flex: 1,
-        paddingBottom: 33,
-        paddingVertical: 40,
-        alignItems: "center",
-    },
-    icon: {
-        width: 90,
-        height: 80,
-        marginBottom: 26,
-    },
-    text: {
-        fontWeight: "500",
-        marginBottom: 7,
-    },
-    button: {
-        marginTop: 19,
-    },
-});

部分文件因为文件数量过多而无法显示