panhui 5 سال پیش
والد
کامیت
89d5fe6dc7
42فایلهای تغییر یافته به همراه2567 افزوده شده و 328 حذف شده
  1. 73 33
      App.js
  2. 59 0
      Redux/DataListRedux.js
  3. 15 0
      Redux/RefreashRedux.js
  4. 15 0
      Utils/ListUtil.js
  5. 53 0
      Utils/OpenTimeUtil.js
  6. BIN
      assets/images/apply2.png
  7. BIN
      assets/images/apply3.png
  8. 88 0
      components/BankCard.js
  9. 44 14
      components/Dialog.js
  10. 62 21
      components/FormInput.js
  11. 3 1
      components/GoodsCard.js
  12. 115 0
      components/ListComponent.js
  13. 94 0
      components/MoneyRecord.js
  14. 3 1
      components/NavHeaderBar.js
  15. 48 3
      components/ScrollPage.js
  16. 44 2
      language/zh.js
  17. 345 0
      mapping.json
  18. 10 0
      models/dialogModel.js
  19. 34 12
      models/httpModel.js
  20. 62 36
      models/userModel.js
  21. 25 2
      models/wordsModel.js
  22. 6 0
      navigation/BasicNavigator.js
  23. 17 40
      navigation/GuideStackNavigator.js
  24. 13 14
      navigation/LoadingModel.js
  25. 238 0
      screens/Bank/AddScreen.js
  26. 171 0
      screens/Bank/MainScreen.js
  27. 202 0
      screens/Bank/RechargeDetailScreen.js
  28. 181 0
      screens/Bank/RechargeScreen.js
  29. 18 0
      screens/Bank/index.js
  30. 63 0
      screens/BankScreen.js
  31. 9 26
      screens/Guide1Screen.js
  32. 2 2
      screens/Guide2Screen.js
  33. 1 1
      screens/Guide4Screen.js
  34. 14 16
      screens/HomeScreen.js
  35. 19 23
      screens/HomeScreenPage1.js
  36. 9 29
      screens/HomeScreenPage2.js
  37. 121 40
      screens/HomeScreenPage3.js
  38. 76 8
      screens/MoneyListScreen.js
  39. 2 2
      screens/RegisterSeScreen.js
  40. 195 0
      screens/Set/AutomaticScreen.js
  41. 11 0
      screens/Set/index.js
  42. 7 2
      screens/StoreAudit.js

+ 73 - 33
App.js

@@ -30,7 +30,7 @@ import * as models from "./models";
 import LoadingModel from "./navigation/LoadingModel";
 import BottomTabNavigator from "./navigation/BottomTabNavigator";
 import LoginStackNavigator from "./navigation/LoginStackNavigator";
-import GuideStackNavigator from "./navigation/GuideStackNavigator";
+import GuideScreens from "./navigation/GuideStackNavigator";
 import BasicScreens from "./navigation/BasicNavigator";
 import { navigationRef } from "./navigation/RootNavigation";
 
@@ -53,6 +53,7 @@ const config = {
 
 export default function App(props) {
     const [isLoadingComplete, setLoadingComplete] = React.useState(false);
+    const { getWords } = useModel("wordsModel", true);
     // Load any resources or data that we need prior to rendering the app
     React.useEffect(() => {
         async function loadResourcesAndDataAsync() {
@@ -63,6 +64,7 @@ export default function App(props) {
                     ...Ionicons.font,
                     "space-mono": require("./assets/fonts/SpaceMono-Regular.ttf"),
                 });
+                getWords();
             } catch (e) {
                 // We might want to provide this error information to an error reporting service
                 console.warn(e);
@@ -75,6 +77,41 @@ export default function App(props) {
         loadResourcesAndDataAsync();
     }, []);
 
+    const [loginState, setLogin] = React.useState("loading");
+    const { getUserInfo, getGuideStep, initApp, refreashReason } = useModel(
+        "userModel"
+    );
+
+    React.useEffect(() => {
+        console.log("刷新");
+        console.log(initApp);
+        if (initApp && refreashReason != "guideStep") {
+            setLogin("loading");
+            getUserInfo()
+                .then(() => {
+                    getGuideStep().then(res => {
+                        if (res == "finish") {
+                            setLogin("login");
+                        } else {
+                            setLogin(res);
+                        }
+                    });
+                })
+                .catch(() => {
+                    setLogin("loginOut");
+                });
+        } else if (initApp && refreashReason == "guideStep") {
+            setLogin("loading");
+            getGuideStep().then(res => {
+                if (res == "finish") {
+                    setLogin("login");
+                } else {
+                    setLogin(res);
+                }
+            });
+        }
+    }, [initApp]);
+
     if (!isLoadingComplete && !props.skipLoadingScreen) {
         return null;
     } else {
@@ -89,39 +126,42 @@ export default function App(props) {
                     <Loading />
                     <Dialog />
                     <Layout style={{ flex: 1 }}>
-                        <NavigationContainer ref={navigationRef}>
-                            <Stack.Navigator
-                                headerMode='none'
-                                initialRouteName='LoadingModel'
-                                screenOptions={{
-                                    gestureEnabled: true,
-                                    cardStyleInterpolator:
-                                        CardStyleInterpolators.forHorizontalIOS,
-                                }}
-                            >
-                                <Stack.Screen
+                        {loginState != "loading" && (
+                            <NavigationContainer ref={navigationRef}>
+                                <Stack.Navigator
+                                    headerMode='none'
+                                    screenOptions={{
+                                        gestureEnabled: true,
+                                        cardStyleInterpolator:
+                                            CardStyleInterpolators.forHorizontalIOS,
+                                    }}
+                                    // initialRouteName="Automatic"
+                                >
+                                    {/* <Stack.Screen
                                     name='LoadingModel'
                                     component={LoadingModel}
-                                />
-                                {/* 首页tab组件页面 */}
-                                <Stack.Screen
-                                    name='Root'
-                                    component={BottomTabNavigator}
-                                />
-                                {/* 注册后指南页面 */}
-                                <Stack.Screen
-                                    name='Guide'
-                                    component={GuideStackNavigator}
-                                />
-                                {/* 登录部分页面 */}
-                                <Stack.Screen
-                                    name='Login'
-                                    component={LoginStackNavigator}
-                                />
-                                {/* 基础功能页面 */}
-                                {BasicScreens(Stack.Screen)}
-                            </Stack.Navigator>
-                        </NavigationContainer>
+                                /> */}
+
+                                    {GuideScreens(Stack.Screen, loginState)}
+
+                                    {loginState === "login" && (
+                                        <Stack.Screen
+                                            name='Root'
+                                            component={BottomTabNavigator}
+                                        />
+                                    )}
+                                    {loginState === "loginOut" && (
+                                        <Stack.Screen
+                                            name='Login'
+                                            component={LoginStackNavigator}
+                                        />
+                                    )}
+
+                                    {/* 基础功能页面 */}
+                                    {BasicScreens(Stack.Screen)}
+                                </Stack.Navigator>
+                            </NavigationContainer>
+                        )}
                     </Layout>
                     {/* <ActionButton
                         buttonColor='#FFC21C'
@@ -138,7 +178,7 @@ export default function App(props) {
     }
 }
 
-const StarIcon = (props) => (
+const StarIcon = props => (
     <Icon
         {...props}
         style={{ width: 30, height: 30 }}

+ 59 - 0
Redux/DataListRedux.js

@@ -0,0 +1,59 @@
+//下拉刷新,获取更多数据处理
+export const initDataState = {
+    page: 0,
+    size: 20,
+    finish: false,
+    loading: false,
+    refreshing: false,
+    dataList: [],
+    error: "",
+};
+export function DataListReducer(state, action) {
+    switch (action.type) {
+        case "startRefresh":
+            return {
+                ...state,
+                page: 0,
+                finish: false,
+                refreshing: true,
+                dataList: [],
+            };
+        case "refreshSuccess":
+            return {
+                ...state,
+                refreshing: false,
+            };
+        case "refreshError":
+            return {
+                ...state,
+                error: action.payload.error,
+                dataList: [],
+                refreshing: false,
+            };
+        case "startPageMore":
+            return {
+                ...state,
+                loading: true,
+            };
+        case "pageMoreSuccess":
+            return {
+                ...state,
+                loading: false,
+            };
+        case "pageMoreError":
+            return {
+                ...state,
+                error: action.payload.error,
+                loading: false,
+            };
+        case "setInfo":
+            return {
+                ...state,
+                dataList: action.payload.list,
+                finish: action.payload.finish,
+                page: action.payload.finish ? state.page : state.page + 1,
+            };
+        default:
+            return state;
+    }
+}

+ 15 - 0
Redux/RefreashRedux.js

@@ -0,0 +1,15 @@
+//下拉刷新,获取更多数据处理
+export const initState = {
+    refreshing: false,
+    error: false,
+};
+export function refreashReducer(state, action) {
+    switch (action.type) {
+        case "startRefresh":
+            return { refreshing: true, error: false };
+        case "refreshFinish":
+            return { refreshing: false, error: false };
+        case "refreshError":
+            return { refreshing: false, error: true };
+    }
+}

+ 15 - 0
Utils/ListUtil.js

@@ -0,0 +1,15 @@
+export default class ListUtil {
+    constructor(list) {
+        console.log(list);
+        this.list = list || [];
+    }
+
+    getKey(key) {
+        let _list=[...this.list]
+        if (_list.length > 0) {
+            return _list.pop()[key];
+        } else {
+            return "";
+        }
+    }
+}

+ 53 - 0
Utils/OpenTimeUtil.js

@@ -0,0 +1,53 @@
+import moment from "moment";
+export default class OpenTimeUtil {
+    constructor(startTime, endTime, week, weekWords) {
+        this.startTime = startTime || "08:00:00";
+        this.endTime = endTime || "23:00:00";
+        this.week = week || "";
+        this.weekWords = weekWords || {};
+    }
+
+    getStartTimeStr() {
+        return moment(this.startTime, "HH:mm:ss").format("HH:mm");
+    }
+
+    getEndTimeStr() {
+        return moment(this.endTime, "HH:mm:ss").format("HH:mm");
+    }
+
+    getWeekStr() {
+        let _weeks = this.week.split(",");
+        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()
+        );
+    }
+
+    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 || [];
+    }
+
+    setWeekWords(weekWords) {
+        this.weekWords = weekWords || {};
+    }
+}

BIN
assets/images/apply2.png


BIN
assets/images/apply3.png


+ 88 - 0
components/BankCard.js

@@ -0,0 +1,88 @@
+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: {
+        flexDirection: "row",
+        alignItems: "center",
+        backgroundColor: "transparent",
+    },
+    avatar: {
+        width: 33,
+        height: 33,
+        backgroundColor: "#eee",
+    },
+    center: {
+        flex: 1,
+        marginLeft: 14,
+        backgroundColor: "transparent",
+    },
+    text2: {
+        paddingTop: 5,
+    },
+    code: {
+        alignSelf: "flex-start",
+    },
+    icon: {
+        width: 20,
+        position: "absolute",
+        right: 0,
+        top: "50%",
+        marginTop: -10,
+    },
+});

+ 44 - 14
components/Dialog.js

@@ -1,6 +1,13 @@
 import React from "react";
 import { StyleSheet } from "react-native";
-import { Modal, Card, Text, Button, Layout } from "@ui-kitten/components";
+import {
+    Modal,
+    Card,
+    Text,
+    Button,
+    Layout,
+    Input,
+} from "@ui-kitten/components";
 import { useModel, setModel } from "flooks";
 import dialogModel from "../models/dialogModel";
 import Textarea from "react-native-textarea";
@@ -100,10 +107,10 @@ export default function Dialog(props) {
             <Card
                 style={styles.card}
                 appearance='diaogOutline'
-                header={(props) => {
+                header={props => {
                     return Header(props, showAllInfo.title || tip);
                 }}
-                footer={(props) => {
+                footer={props => {
                     return Footer(
                         props,
                         showAllInfo.cancelLabelText || cancel,
@@ -129,18 +136,41 @@ export default function Dialog(props) {
                 }}
             >
                 {showAllInfo.isEdit ? (
-                    <Textarea
-                        containerStyle={styles.textareaContainer}
-                        style={styles.textarea}
-                        onChangeText={changeIntroduction}
-                        defaultValue={showAllInfo.defaultValue}
-                        maxLength={showAllInfo.maxLength}
-                        placeholder={showAllInfo.pla}
-                        placeholderTextColor={"#B4B4B4"}
-                        underlineColorAndroid={"transparent"}
-                    />
+                    showAllInfo.InputType ? (
+                        <Input
+                            dataDetectorTypes={
+                                showAllInfo.InputType == "phone"
+                                    ? "phoneNumber"
+                                    : "default"
+                            }
+                            keyboardType={
+                                showAllInfo.InputType == "phone"
+                                    ? "phone-pad"
+                                    : "default"
+                            }
+                            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"}
+                        />
+                    )
                 ) : (
-                    <Text {...props} category='p1' status={showAllInfo.status || ""}>
+                    <Text
+                        {...props}
+                        category='p1'
+                        status={showAllInfo.status || ""}
+                    >
                         {showAllInfo.bodyText || "确认删除吗"}
                     </Text>
                 )}

+ 62 - 21
components/FormInput.js

@@ -18,7 +18,7 @@ import UpLoadImage from "./UpLoadImage";
 import moment from "moment";
 import Actionsheet from "./Actionsheet";
 
-const AlertIcon = (props) => <Icon {...props} name='alert-circle-outline' />;
+const AlertIcon = props => <Icon {...props} name='alert-circle-outline' />;
 
 function* flattenSelect(array, key) {
     for (const item of array) {
@@ -31,14 +31,15 @@ function* flattenSelect(array, key) {
     }
 }
 
-const FormInput = React.memo((props) => {
+const FormInput = React.memo(props => {
+    const { appearance } = props;
     const [secureTextEntry, setSecureTextEntry] = React.useState(true);
     const { cancel, confirm } = useModel("wordsModel");
     const toggleSecureEntry = () => {
         setSecureTextEntry(!secureTextEntry);
     };
 
-    const renderIcon = (props) => (
+    const renderIcon = props => (
         <TouchableWithoutFeedback onPress={toggleSecureEntry}>
             <Icon {...props} name={secureTextEntry ? "eye-off" : "eye"} />
         </TouchableWithoutFeedback>
@@ -58,7 +59,7 @@ const FormInput = React.memo((props) => {
         } else if (props.type === "password") {
             _props = {
                 ..._props,
-                accessoryRight: (ImageProps) => renderIcon(ImageProps),
+                accessoryRight: ImageProps => renderIcon(ImageProps),
                 secureTextEntry: secureTextEntry,
             };
         } else if (props.type == "code") {
@@ -76,7 +77,7 @@ const FormInput = React.memo((props) => {
         if (props.onChange) {
             _props = {
                 ..._props,
-                onChangeText: (nextValue) => props.onChange(nextValue),
+                onChangeText: nextValue => props.onChange(nextValue),
             };
         }
 
@@ -91,22 +92,27 @@ const FormInput = React.memo((props) => {
     //     }
     // };
 
-    const Label = (props) => {
+    const Label = props => {
         return (
             <View
                 style={[
-                    styles.label,
+                    appearance === "inner" ? styles.labelleft : styles.label,
                     props.type === "img" ? { alignSelf: "flex-start" } : {},
                     props.labelStyle || {},
                 ]}
             >
-                <Text category='c1' style={{ textAlign: "right" }}>
+                <Text
+                    category='c1'
+                    style={{
+                        textAlign: appearance != "inner" ? "right" : "left",
+                    }}
+                >
                     {props.label}
                 </Text>
             </View>
         );
     };
-    const ForwardIcon = (props) => <Icon {...props} name='arrow-ios-forward' />;
+    const ForwardIcon = props => <Icon {...props} name='arrow-ios-forward' />;
 
     const selectList = props.selectList ? props.selectList : [];
 
@@ -117,7 +123,7 @@ const FormInput = React.memo((props) => {
         if (props.type === "select" && props.value && selectList.length > 0) {
             const childrens = [...flattenSelect(selectList, "children")];
             return (
-                childrens.find((item) => {
+                childrens.find(item => {
                     return item.id == props.value;
                 }) || { name: " " }
             );
@@ -132,6 +138,16 @@ const FormInput = React.memo((props) => {
         console.log(val);
     }
 
+    const Btn = ({ btnText }) => (
+        <Button
+            appearance='ghost'
+            size='tiny'
+            style={{ paddingVertical: 8, marginLeft: 5 }}
+        >
+            {btnText}
+        </Button>
+    );
+
     const theme = useTheme();
 
     function getMain(type, props) {
@@ -148,7 +164,7 @@ const FormInput = React.memo((props) => {
                         }}
                     />
                     <BottomModal
-                        ref={(c) => {
+                        ref={c => {
                             changeBottomModalx(c);
                         }}
                         title={props.selectTitle}
@@ -231,10 +247,38 @@ const FormInput = React.memo((props) => {
                     changeIcon={props.onChange}
                 />
             );
+        } else if (appearance == "inner" && props.type == "code") {
+            return (
+                <Input
+                    {...inputProps}
+                    accessoryLeft={leftprops => (
+                        <Label {...props} {...leftprops} />
+                    )}
+                    accessoryRight={() => (
+                        <Btn btnText={props.btnText} />
+                    )}
+                    size='small'
+                    style={styles.input}
+                    appearance='innerCode'
+                />
+            );
+        } else if (appearance == "inner") {
+            return (
+                <Input
+                    {...inputProps}
+                    accessoryLeft={leftprops => (
+                        <Label {...props} {...leftprops} />
+                    )}
+                    size='small'
+                    style={styles.input}
+                    appearance='inner'
+                />
+            );
         } else {
             return <Input {...inputProps} size='small' style={styles.input} />;
         }
     }
+
     return (
         <Layout
             level='1'
@@ -242,9 +286,10 @@ const FormInput = React.memo((props) => {
                 styles.inputContainer,
                 { ...props.style },
                 props.type === "img" ? { flexDirection: "column" } : {},
+                { paddingVertical: appearance == "inner" ? 0 : 10 },
             ]}
         >
-            <Label {...props} />
+            {appearance !== "inner" && <Label {...props} />}
 
             {(!props.value || props.value == " ") && (
                 <Text category='c1' style={styles.sub}>
@@ -254,15 +299,7 @@ const FormInput = React.memo((props) => {
 
             {getMain(props.type, props)}
 
-            {props.type == "code" && (
-                <Button
-                    appearance='ghost'
-                    size='tiny'
-                    style={{ paddingVertical: 8, marginLeft: 5 }}
-                >
-                    {props.btnText}
-                </Button>
-            )}
+            {appearance !== "inner" && props.type == "code" && Btn(props)}
         </Layout>
     );
 });
@@ -291,6 +328,10 @@ const styles = StyleSheet.create({
         marginRight: 19,
         flexShrink: 0,
     },
+    labelleft: {
+        width: 73,
+        flexShrink: 0,
+    },
     right: {
         flexDirection: "row",
     },

+ 3 - 1
components/GoodsCard.js

@@ -15,6 +15,7 @@ export default function GoodsCard(props) {
     const { info } = props;
     const { id, img, name, introduction, totalSales, discountAmount, amount } =
         info || {};
+
     return (
         <Card
             style={[!props.appearance && styles.card, props.style]}
@@ -103,13 +104,14 @@ export default function GoodsCard(props) {
         </Card>
     );
 }
-const StarIcon = (props) => <Icon {...props} name='minus-outline' />;
+const StarIcon = props => <Icon {...props} name='minus-outline' />;
 
 const styles = StyleSheet.create({
     card: { marginTop: 10 },
     layout: {
         flexDirection: "row",
         height: 80,
+        backgroundColor: "transparent",
     },
     avatar: {
         width: 80,

+ 115 - 0
components/ListComponent.js

@@ -0,0 +1,115 @@
+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 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 {
+        getInfo,
+        renderItem,
+        ListHeaderComponent,
+        style,
+        separatorStyle,
+        ListFooterComponent,
+        showEmpty,
+        emptyEvent,
+        showList,
+        extraData,
+    } = props;
+
+    useFocusEffect(
+        React.useCallback(() => {
+            onRefresh();
+        }, [])
+    );
+
+    function getList() {
+        if (getInfo != null) {
+            return getInfo(page, size).then(res => {
+                if (res.numberOfElements === 0) {
+                    emptyEvent(true);
+                } else {
+                    emptyEvent(false);
+                }
+                dispatch({
+                    type: "setInfo",
+                    payload: { list: res.content, finish: res.last },
+                });
+            });
+        } else {
+            return Promise.reject();
+        }
+    }
+
+    // 刷新接口
+    function onRefresh() {
+        dispatch({ type: "startPageMore" });
+        getList()
+            .then(() => {
+                dispatch({ type: "pageMoreSuccess" });
+            })
+            .catch(e => {
+                dispatch({
+                    type: "pageMoreError",
+                    payload: { error: e.message },
+                });
+            });
+    }
+
+    // 到页面底部加载更多
+    function gotEnd() {
+        dispatch({ type: "startRefresh" });
+        getList()
+            .then(() => {
+                dispatch({ type: "refreshSuccess" });
+            })
+            .catch(e => {
+                dispatch({
+                    type: "refreshError",
+                    payload: { error: e.message },
+                });
+            });
+    }
+
+    const changePorps = React.useMemo(() => {
+        let _props = { renderItem: () => <Layout /> };
+        if (showList != false) {
+            _props = { renderItem };
+            if (showEmpty) {
+                _props = {
+                    ..._props,
+                    EmptyComponent,
+                };
+            }
+
+            if (extraData) {
+                _props = {
+                    ..._props,
+                    extraData,
+                };
+            }
+        }
+        return _props;
+    }, [showList, showEmpty, extraData]);
+
+    return (
+        <List
+            refreshing={refreshing}
+            style={[style]}
+            data={dataList}
+            ListHeaderComponent={ListHeaderComponent}
+            onRefresh={onRefresh}
+            onEndReached={0.2}
+            ItemSeparatorComponent={() => <Divider style={[separatorStyle]} />}
+            onEndReachedThreshold={gotEnd}
+            ListFooterComponent={ListFooterComponent}
+            {...changePorps}
+        />
+    );
+}

+ 94 - 0
components/MoneyRecord.js

@@ -0,0 +1,94 @@
+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",
+        alignItems: "center",
+        backgroundColor: 'transparent',
+    },
+    avatar: {
+        width: 33,
+        height: 33,
+        backgroundColor: "#eee",
+    },
+    center: {
+        flex: 1,
+        marginLeft: 14,
+        backgroundColor: 'transparent',
+    },
+    text2: {
+        paddingTop: 5,
+        paddingBottom: 3,
+    },
+    code: {
+        alignSelf: "flex-start",
+    },
+    icon: {
+        width: 20,
+        position: "absolute",
+        right: 0,
+        top: "50%",
+        marginTop: -10,
+    },
+});

+ 3 - 1
components/NavHeaderBar.js

@@ -12,7 +12,7 @@ import { useModel } from "flooks";
 import { Image, StyleSheet } from "react-native";
 import * as RootNavigation from "../navigation/RootNavigation.js";
 
-const BackIcon = (props) => <Icon {...props} fill='#fff' name='arrow-back' />;
+const BackIcon = props => <Icon {...props} fill='#fff' name='arrow-back' />;
 
 export default function NavHeaderBar(props) {
     const theme = useTheme();
@@ -22,11 +22,13 @@ export default function NavHeaderBar(props) {
             onPress={() => RootNavigation.goBack()}
         />
     );
+    const { accessoryRight } = props;
     return (
         <TopNavigation
             alignment='center'
             title={props.title}
             accessoryLeft={props.back != false && renderBackAction}
+            accessoryRight={accessoryRight}
         />
     );
 }

+ 48 - 3
components/ScrollPage.js

@@ -1,10 +1,55 @@
 import React from "react";
-import { ScrollView } from "react-native";
-
+import { ScrollView, RefreshControl } from "react-native";
+import { initState, refreashReducer } from "../Redux/RefreashRedux";
+import { useFocusEffect } from "@react-navigation/native";
 export default function scrollPage(props) {
+    const { style, enabledFresh, refreshEvent } = props;
+    const [state, dispatch] = React.useReducer(refreashReducer, initState);
+    const { refreshing, error } = state;
+    
+    useFocusEffect(
+        React.useCallback(() => {
+            if (enabledFresh && refreshEvent) {
+                onRefresh();
+            }
+        }, [])
+    );
+
+    function onRefresh() {
+        dispatch({
+            type: "startRefresh",
+        });
+        if (refreshEvent) {
+            refreshEvent()
+                .then(() => {
+                    dispatch({
+                        type: "refreshFinish",
+                    });
+                })
+                .catch(() => {
+                    dispatch({
+                        type: "refreshError",
+                    });
+                });
+        } else {
+            setTimeout(() => {
+                dispatch({
+                    type: "refreshFinish",
+                });
+            }, 1000);
+        }
+    }
+
     return (
         <ScrollView
-            style={[props.style]}
+            refreshControl={
+                <RefreshControl
+                    refreshing={refreshing}
+                    onRefresh={onRefresh}
+                    enabled={enabledFresh || false}
+                />
+            }
+            style={style}
             contentContainerStyle={{ flexGrow: 1 }}
         >
             {props.children}

+ 44 - 2
language/zh.js

@@ -110,8 +110,8 @@ export default {
     userTitle34: "我的推荐位",
     userTitle41: "自动接单、订单语音设置",
     userTitle42: "我的对账单",
-    userTitle61: "余额查询",
-    userTitle62: "账单查询",
+    userTitle61: "账单查询",
+    userTitle62: "我的银行卡",
 
     orderTitleBtn1: "手动接单",
     orderTitleBtn2: "编辑语音",
@@ -127,6 +127,29 @@ export default {
     overTips: "确定要拒单吗?",
     orderSuceess: "操作成功",
 
+    //银行卡
+    bankMainTitle: "选择银行卡",
+    bindBankText1: "绑定银行卡",
+    bankTitle1: "银行",
+    bankTitle2: "卡号",
+    bankTitle3: "姓名",
+    bankTitle4: "身份证号",
+    bankPla1: "输入银行名称",
+    bankPla2: "输入银行卡号",
+    bankPla3: "输入银行名称",
+    bankPla4: "输入银行名称",
+    bankTitle5: "同意《叮咚外卖快捷支付服务协议》",
+    rechargeBtnText: "预计两小时内到账,确认提现",
+
+
+    //设置
+    
+    automaticText1:'自动评价回复',
+    automaticText2:'好评自动评价回复',
+    automaticText3:'差评自动评价回复',
+    automaticText4:'添加回复(不超过100字)',
+
+
     //公共的文字
 
     changeToEnglish: "切换到泰文",
@@ -136,6 +159,7 @@ export default {
     next: "下一步",
     pass: "跳过",
     cancel: "取消",
+    save: "保存",
     confirm: "确认",
     MONDAY: "周一",
     TUESDAY: "周二",
@@ -163,6 +187,7 @@ export default {
     uplaodImg: "上传图片",
     removeTips: "确定要移除吗?移除后不可恢复",
     autoBackText: "自动回复",
+    editAutoBack:"编辑自动回复",
     storeBackInfo: "商家回复",
     delText: "删除",
     successText: "成功",
@@ -171,7 +196,13 @@ export default {
     fullReduction1: "满",
     fullReduction2: "减",
     loading: "加载中",
+    sendCode: "发送验证码",
+    applySuccess: "申请成功",
+    rechargeTime: "预计到账时间",
+    rechargeTitle2: "银行卡",
+    rechargeTitle3:'提现金额',
 
+    //订单状态
     NOT_RECEIVED: "未接单",
     RECEIVED: "已接单",
     REJECTED: "退单",
@@ -189,4 +220,15 @@ export default {
     TAKE_MEAL: "已到店",
     MEAL_DELIVERY: "正在配送中",
     CARRY_OUT: "送达",
+
+    //账单状态
+    BUY: "购买",
+    INCOME: "收入",
+    REFUND: "退款",
+    WITHDRAW: "提现",
+
+    //提现状态
+    Apply_SUCCESS: "提现成功",
+    Apply_PENDING: "提现处理中",
+    Apply_FAIL: "提现失败",
 };

+ 345 - 0
mapping.json

@@ -107,6 +107,168 @@
             }
         },
         "Input": {
+            "meta": {
+                "scope": "all",
+                "parameters": {
+                    "paddingVertical": {
+                        "type": "number"
+                    },
+                    "paddingHorizontal": {
+                        "type": "number"
+                    },
+                    "minHeight": {
+                        "type": "number"
+                    },
+                    "borderRadius": {
+                        "type": "number"
+                    },
+                    "borderWidth": {
+                        "type": "number"
+                    },
+                    "borderColor": {
+                        "type": "string"
+                    },
+                    "borderBottomWidth": {
+                        "type": "number"
+                    },
+                    "backgroundColor": {
+                        "type": "string"
+                    },
+                    "textMarginHorizontal": {
+                        "type": "number"
+                    },
+                    "textFontFamily": {
+                        "type": "string"
+                    },
+                    "textFontSize": {
+                        "type": "number"
+                    },
+                    "textFontWeight": {
+                        "type": "string"
+                    },
+                    "textColor": {
+                        "type": "string"
+                    },
+                    "placeholderColor": {
+                        "type": "string"
+                    },
+                    "iconWidth": {
+                        "type": "number"
+                    },
+                    "iconHeight": {
+                        "type": "number"
+                    },
+                    "iconMarginHorizontal": {
+                        "type": "number"
+                    },
+                    "iconTintColor": {
+                        "type": "string"
+                    },
+                    "labelColor": {
+                        "type": "string"
+                    },
+                    "labelFontFamily": {
+                        "type": "string"
+                    },
+                    "labelFontSize": {
+                        "type": "number"
+                    },
+                    "labelFontWeight": {
+                        "type": "string"
+                    },
+                    "labelMarginBottom": {
+                        "type": "number"
+                    },
+                    "captionMarginTop": {
+                        "type": "number"
+                    },
+                    "captionColor": {
+                        "type": "string"
+                    },
+                    "captionFontFamily": {
+                        "type": "string"
+                    },
+                    "captionFontSize": {
+                        "type": "number"
+                    },
+                    "captionFontWeight": {
+                        "type": "string"
+                    },
+                    "captionIconWidth": {
+                        "type": "number"
+                    },
+                    "captionIconHeight": {
+                        "type": "number"
+                    },
+                    "captionIconMarginRight": {
+                        "type": "number"
+                    },
+                    "captionIconTintColor": {
+                        "type": "string"
+                    }
+                },
+                "appearances": {
+                    "default": {
+                        "default": true
+                    },
+                    "inner": {
+                        "default": false
+                    }
+                },
+                "variantGroups": {
+                    "status": {
+                        "basic": {
+                            "default": true
+                        },
+                        "primary": {
+                            "default": false
+                        },
+                        "success": {
+                            "default": false
+                        },
+                        "info": {
+                            "default": false
+                        },
+                        "warning": {
+                            "default": false
+                        },
+                        "danger": {
+                            "default": false
+                        },
+                        "control": {
+                            "default": false
+                        }
+                    },
+                    "size": {
+                        "small": {
+                            "default": true
+                        },
+                        "medium": {
+                            "default": false
+                        },
+                        "large": {
+                            "default": false
+                        }
+                    }
+                },
+                "states": {
+                    "hover": {
+                        "default": false,
+                        "priority": 0,
+                        "scope": "all"
+                    },
+                    "disabled": {
+                        "default": false,
+                        "priority": 1,
+                        "scope": "all"
+                    },
+                    "focused": {
+                        "default": false,
+                        "priority": 2,
+                        "scope": "all"
+                    }
+                }
+            },
             "appearances": {
                 "default": {
                     "mapping": {
@@ -159,6 +321,132 @@
                             }
                         }
                     }
+                },
+                "inner": {
+                    "mapping": {
+                        "paddingHorizontal": 0,
+                        "textMarginHorizontal": 0,
+                        "backgroundColor": "transparent"
+                    },
+                    "variantGroups": {
+                        "status": {
+                            "basic": {
+                                "backgroundColor": "transparent",
+                                "labelColor": "text-basic-color",
+                                "captionColor": "color-danger-500",
+                                "state": {
+                                    "focused": {
+                                        "backgroundColor": "transparent"
+                                    },
+                                    "active": {
+                                        "backgroundColor": "transparent"
+                                    },
+                                    "hover": {
+                                        "backgroundColor": "transparent"
+                                    },
+                                    "disabled": {
+                                        "backgroundColor": "transparent"
+                                    }
+                                }
+                            }
+                        },
+                        "size": {
+                            "small": {
+                                "minHeight": "size-small",
+                                "borderRadius": "border-radius",
+                                "borderWidth": 0,
+                                "borderBottomWidth": 1,
+                                "paddingVertical": 10,
+                                "textFontSize": "text-subtitle-2-font-size",
+                                "textFontWeight": "normal"
+                            }
+                        }
+                    }
+                },
+                "innerCode": {
+                    "mapping": {
+                        "paddingHorizontal": 0,
+                        "textMarginHorizontal": 0,
+                        "backgroundColor": "transparent"
+                    },
+                    "variantGroups": {
+                        "status": {
+                            "basic": {
+                                "backgroundColor": "transparent",
+                                "labelColor": "text-basic-color",
+                                "captionColor": "color-danger-500",
+                                "state": {
+                                    "focused": {
+                                        "backgroundColor": "transparent"
+                                    },
+                                    "active": {
+                                        "backgroundColor": "transparent"
+                                    },
+                                    "hover": {
+                                        "backgroundColor": "transparent"
+                                    },
+                                    "disabled": {
+                                        "backgroundColor": "transparent"
+                                    }
+                                }
+                            }
+                        },
+                        "size": {
+                            "small": {
+                                "minHeight": "size-small",
+                                "borderRadius": "border-radius",
+                                "borderWidth": 0,
+                                "borderBottomWidth": 1,
+                                "paddingVertical": 5,
+                                "textFontSize": "text-subtitle-2-font-size",
+                                "textFontWeight": "normal"
+                            }
+                        }
+                    }
+                },
+                "reCharge": {
+                    "mapping": {
+                        "paddingHorizontal": 0,
+                        "textMarginHorizontal": 0,
+                        "backgroundColor": "transparent"
+                    },
+                    "variantGroups": {
+                        "status": {
+                            "basic": {
+                                "backgroundColor": "transparent",
+                                "labelColor": "text-basic-color",
+                                "captionColor": "#787878",
+                                "state": {
+                                    "focused": {
+                                        "backgroundColor": "transparent"
+                                    },
+                                    "active": {
+                                        "backgroundColor": "transparent"
+                                    },
+                                    "hover": {
+                                        "backgroundColor": "transparent"
+                                    },
+                                    "disabled": {
+                                        "backgroundColor": "transparent"
+                                    }
+                                }
+                            }
+                        },
+                        "size": {
+                            "small": {
+                                "minHeight": "size-small",
+                                "borderRadius": "border-radius",
+                                "borderWidth": 0,
+                                "borderBottomWidth": 1,
+                                "paddingVertical": 7,
+                                "textFontSize": "text-heading-2-font-size",
+                                "textFontWeight": "normal",
+                                "captionMarginTop": 6,
+                                "labelMarginBottom": 10,
+                                "labelFontSize": 12
+                            }
+                        }
+                    }
                 }
             }
         },
@@ -714,6 +1002,14 @@
                                 "textFontSize": 12,
                                 "textFontWeight": "normal",
                                 "iconMarginHorizontal": 0
+                            },
+                            "large": {
+                                "minWidth": 0,
+                                "minHeight": 20,
+                                "paddingHorizontal": 0,
+                                "textFontWeight": "normal",
+                                "paddingVertical": 0,
+                                "textMarginHorizontal": 26
                             }
                         }
                     }
@@ -1575,6 +1871,55 @@
                             }
                         }
                     }
+                },
+                "walletCard": {
+                    "mapping": {
+                        "accentHeight": 0,
+                        "bodyPaddingHorizontal": 13,
+                        "bodyPaddingVertical": 9,
+                        "borderColor": "transparent",
+                        "borderRadius": 3,
+                        "footerPaddingHorizontal": 13,
+                        "footerPaddingVertical": 10
+                    },
+                    "variantGroups": {
+                        "status": {
+                            "basic": {
+                                "accentHeight": 4,
+                                "accentBackgroundColor": "color-basic-default"
+                            },
+                            "primary": {
+                                "accentHeight": 4,
+                                "accentBackgroundColor": "color-primary-default"
+                            },
+                            "success": {
+                                "accentHeight": 4,
+                                "accentBackgroundColor": "color-success-default"
+                            },
+                            "info": {
+                                "accentHeight": 4,
+                                "accentBackgroundColor": "color-info-default"
+                            },
+                            "warning": {
+                                "accentHeight": 4,
+                                "accentBackgroundColor": "color-warning-default"
+                            },
+                            "danger": {
+                                "accentHeight": 4,
+                                "accentBackgroundColor": "color-danger-default"
+                            },
+                            "control": {
+                                "accentHeight": 4,
+                                "accentBackgroundColor": "color-control-default"
+                            }
+                        },
+                        "direction": {
+                            "vertical": {
+                                "bodyPaddingHorizontal": 0,
+                                "bodyPaddingVertical": 0
+                            }
+                        }
+                    }
                 }
             }
         },

+ 10 - 0
models/dialogModel.js

@@ -30,5 +30,15 @@ export default {
         hideDialog() {
             setState({ diloadShow: false });
         },
+        removeEvent(confirmCallback, tips) {
+            const { showDialog } = model();
+            const { removeTips } = model("wordsModel");
+            showDialog({
+                bodyText: removeTips,
+                status: "danger",
+                cancelable: true,
+                confirmCallback: confirmCallback,
+            });
+        },
     }),
 };

+ 34 - 12
models/httpModel.js

@@ -22,13 +22,13 @@ export default {
                 baseURL: baseUrl,
             });
             axiosInstance.interceptors.request.use(
-                (config) => setConfig(config),
-                (error) => setConfigError(error)
+                config => setConfig(config),
+                error => setConfigError(error)
             );
 
             axiosInstance.interceptors.response.use(
-                (response) => successEvent(response),
-                (error) => errorEvent(error)
+                response => successEvent(response),
+                error => errorEvent(error)
             );
             return axiosInstance;
         },
@@ -65,10 +65,10 @@ export default {
                     .get(url, {
                         params: params,
                     })
-                    .then((res) => {
+                    .then(res => {
                         resolve(res.data);
                     })
-                    .catch((e) => {
+                    .catch(e => {
                         if (needWarning) {
                             warnning(e.error);
                         }
@@ -89,10 +89,10 @@ export default {
             return new Promise((resolve, reject) => {
                 getAxiosInstance()
                     .post(url, body, { withCredentials: true })
-                    .then((res) => {
+                    .then(res => {
                         resolve(res.data);
                     })
-                    .catch((e) => {
+                    .catch(e => {
                         reject(e);
                         if (needWarning) {
                             warnning(e.error);
@@ -101,14 +101,36 @@ export default {
             });
         },
         addAsyncStorage(key, value) {
-            console.log(value);
-            return AsyncStorage.setItem(key, value);
+            return new Promise(async (resolve, reject) => {
+                try {
+                    await AsyncStorage.setItem(key, value);
+                    resolve();
+                } catch (e) {
+                    reject(e);
+                }
+            });
         },
         removeAsyncStorage(key) {
-            return AsyncStorage.removeItem(key);
+            return new Promise(async (resolve, reject) => {
+                try {
+                    await AsyncStorage.removeItem(key);
+                    resolve();
+                } catch (e) {
+                    reject(e);
+                }
+            });
         },
         getAsyncStorage(key) {
-            return AsyncStorage.getItem(key);
+            return new Promise(async (resolve, reject) => {
+                try {
+                    let val = await AsyncStorage.getItem(key);
+                    console.log(key);
+                    console.log(val);
+                    resolve(val);
+                } catch (e) {
+                    reject(e);
+                }
+            });
         },
     }),
 };

+ 62 - 36
models/userModel.js

@@ -9,30 +9,30 @@ export default {
         isLogin: false,
         guideStep: 0,
         registerInfo: null,
+        initApp: true,
+        refreashReason: "login",
     },
     actions: ({ model, setState }) => ({
-        updateUser({ ...userInfo }) {
+        updateUser(userInfo) {
             setState({ ...userInfo });
         },
-        decrement() {
-            const { count } = model();
-            setState({ count: count - 1 });
-        },
-        async getUserInfo() {
+        getUserInfo() {
+            setState({ initApp: false });
             const { updateUser } = model();
             const { httpGet } = model("httpModel");
-            return httpGet("/merchant/my").then((res) => {
-                if (res) {
-                    updateUser(res);
+            return httpGet("/merchant/my").then(res => {
+                let _res = { ...res };
+                if (_res) {
+                    updateUser(_res);
                 }
             });
         },
         checkLogin() {
             const { getUserInfo, status } = model();
             const { getAsyncStorage } = model("httpModel");
-            return new Promise((resolve) => {
+            return new Promise(resolve => {
                 getUserInfo()
-                    .then(async (_) => {
+                    .then(async _ => {
                         let guideStep = await getAsyncStorage("guideStep");
                         if (status == "PASS") {
                             guideStep = 4;
@@ -46,7 +46,7 @@ export default {
                         console.log(isLogin);
                         resolve();
                     })
-                    .catch((_) => {
+                    .catch(_ => {
                         setState({ isLogin: false });
                         resolve();
                     });
@@ -61,14 +61,14 @@ export default {
                 username: phone,
                 password: password,
             })
-                .then((res) => {
+                .then(res => {
                     if (res) {
                         addAsyncStorage("token", res);
                         success("登录成功");
-                        checkLogin();
+                        setState({ initApp: true });
                     }
                 })
-                .catch((e) => {
+                .catch(e => {
                     warnning(e.error);
                 });
         },
@@ -78,12 +78,12 @@ export default {
                 phone: phone,
                 code: code,
             })
-                .then((res) => {
+                .then(res => {
                     if (res) {
                         updateUser(res);
                     }
                 })
-                .catch((e) => {
+                .catch(e => {
                     console.log(e);
                 });
         },
@@ -94,15 +94,14 @@ export default {
         registerUser({ ...data }) {
             const { checkLogin } = model();
             const { loading, success } = model("loadingModel");
-            const { httpPost, addAsyncStorage, removeAsyncStorage } = model(
-                "httpModel"
-            );
-            httpPost("/auth/merchantRegister", data, {}, true).then((res) => {
+            const { httpPost, addAsyncStorage } = model("httpModel");
+            httpPost("/auth/merchantRegister", data, {}, true).then(res => {
                 addAsyncStorage("token", res).then(() => {
                     if (res) {
                         success("注册成功");
-                        removeAsyncStorage("guideStep");
-                        RootNavigation.reset("LoadingModel");
+                        addAsyncStorage("guideStep", 1).then(() => {
+                            setState({ initApp: true });
+                        });
                     }
                 });
             });
@@ -121,16 +120,11 @@ export default {
             };
             registerUser(_registerInfo);
         },
-        changeGuideStep(step, next) {
+        changeGuideStep(step) {
             const { addAsyncStorage } = model("httpModel");
-            addAsyncStorage("guideStep", step);
-            if (step == "finish") {
-                setState({
-                    guideStep: "finish",
-                });
-            } else {
-                RootNavigation.replace(next);
-            }
+            addAsyncStorage("guideStep", step.toString()).then(() => {
+                setState({ initApp: true, refreashReason: "guideStep" });
+            });
         },
         saveMerchant({ ...data }) {
             const { mid, changeGuideStep } = model();
@@ -143,8 +137,8 @@ export default {
                     mid: mid,
                 },
                 { body: "json" }
-            ).then((res) => {
-                changeGuideStep(3, "Guide4");
+            ).then(res => {
+                changeGuideStep(4);
             });
         },
         checkInfo({ aliAccountEvent, aliNameEvent }) {
@@ -163,10 +157,10 @@ export default {
                 },
                 { body: "json" },
                 true
-            ).then((res) => {
+            ).then(res => {
                 // success("修改成功");
                 if (res) {
-                    getUserInfo(res);
+                    getUserInfo();
                 }
             });
         },
@@ -194,9 +188,41 @@ export default {
         userLogout() {
             const { removeAsyncStorage } = model("httpModel");
             const { success } = model("loadingModel");
+
             return removeAsyncStorage("token").then(() => {
+                setState({
+                    mid: 0,
+                    name: "未登录",
+                    showName: "未登录",
+                    phone: "",
+                    isLogin: false,
+                    guideStep: 0,
+                    registerInfo: null,
+                    initApp: true,
+                    refreashReason: "loginOut",
+                });
                 success("退出成功");
             });
         },
+        getGuideStep() {
+            const { mid, status } = model();
+            const { getAsyncStorage } = model("httpModel");
+
+            return new Promise(resolve => {
+                if (mid == 0) {
+                    resolve("");
+                } else {
+                    getAsyncStorage("guideStep").then(res => {
+                        console.log(res);
+                        let guideStep = res;
+                        if (status == "PASS" && !guideStep) {
+                            guideStep = "5";
+                        }
+                        setState({ guideStep: guideStep, isLogin: true });
+                        resolve(guideStep || "1");
+                    });
+                }
+            });
+        },
     }),
 };

+ 25 - 2
models/wordsModel.js

@@ -5,7 +5,7 @@ export default {
         getWords() {
             console.log("aaaa");
             var words = {};
-            keys.forEach((item) => {
+            keys.forEach(item => {
                 words[item] = i18n.t(item);
             });
             setState({ ...words });
@@ -14,6 +14,29 @@ export default {
             const allWords = model();
             return allWords[key];
         },
+        weekWords() {
+            const {
+                MONDAY,
+                TUESDAY,
+                WEDNESDAY,
+                THURSDAY,
+                FRIDAY,
+                SATURDAY,
+                SUNDAY,
+                every,
+            } = model();
+
+            return {
+                MONDAY: MONDAY,
+                TUESDAY: TUESDAY,
+                WEDNESDAY: WEDNESDAY,
+                THURSDAY: THURSDAY,
+                FRIDAY: FRIDAY,
+                SATURDAY: SATURDAY,
+                SUNDAY,
+                all: every,
+            };
+        },
     }),
 };
-//国际化
+//国际化

+ 6 - 0
navigation/BasicNavigator.js

@@ -8,6 +8,8 @@ import AddGoodsClassification from "../screens/AddGoodsClassification";
 import FullReduction from "../screens/FullReduction";
 import Guide2Screen from "../screens/Guide2Screen";
 import MoneyListScreen from "../screens/MoneyListScreen";
+import Bank from "../screens/Bank";
+import SetEvent from "../screens/Set";
 
 export default function BasicScreens(Screen) {
     return (
@@ -23,6 +25,10 @@ export default function BasicScreens(Screen) {
             <Screen name='FullReduction' component={FullReduction} />
             <Screen name='AddNewClass' component={Guide2Screen} />
             <Screen name='Money' component={MoneyListScreen} />
+
+            {Bank(Screen)}
+
+            {SetEvent(Screen)}
         </>
     );
 }

+ 17 - 40
navigation/GuideStackNavigator.js

@@ -3,7 +3,6 @@ import {
     CardStyleInterpolators,
 } from "@react-navigation/stack";
 import * as React from "react";
-import { useModel } from "flooks";
 
 import Guide1Screen from "../screens/Guide1Screen";
 import Guide2Screen from "../screens/Guide2Screen";
@@ -11,8 +10,6 @@ import Guide3Screen from "../screens/Guide3Screen";
 import Guide4Screen from "../screens/Guide4Screen";
 import StoreAudit from "../screens/StoreAudit";
 
-const GuideStack = createStackNavigator();
-
 const config = {
     animation: "spring",
     config: {
@@ -24,42 +21,22 @@ const config = {
         restSpeedThreshold: 0.01,
     },
 };
-
-export default function GuideStackNavigator() {
-    const { guideStep } = useModel("userModel");
-    const initial = React.useMemo(() => {
-        if (guideStep == 0) {
-            return "Guide1";
-        } else if (guideStep == 1) {
-            return "Guide2";
-        } else if (guideStep == 2) {
-            return "Guide3";
-        } else if (guideStep == 3) {
-            return "Guide4";
-        } else if (guideStep == 4) {
-            return "StoreAudit";
-        } else {
-            return "Guide1";
+export default function GuideScreens(Screen, guideStep) {
+    console.log(guideStep);
+    if (guideStep == "1") {
+        {
+            /* 商品 */
         }
-    }, [guideStep]);
-
-    return (
-        <GuideStack.Navigator
-            headerMode='none'
-            screenOptions={{
-                gestureEnabled: true,
-                cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS,
-            }}
-            initialRouteName={initial}
-        >
-            {/* 商品 */}
-            <GuideStack.Screen name='Guide1' component={Guide1Screen} />
-            {/* 分类 */}
-            <GuideStack.Screen name='Guide2' component={Guide2Screen} />
-            {/* 支付宝 */}
-            <GuideStack.Screen name='Guide3' component={Guide3Screen} />
-            <GuideStack.Screen name='Guide4' component={Guide4Screen} />
-            <GuideStack.Screen name='StoreAudit' component={StoreAudit} />
-        </GuideStack.Navigator>
-    );
+        return <Screen name='Guide1' component={Guide1Screen} />;
+    } else if (guideStep == "2") {
+        return <Screen name='Guide2' component={Guide2Screen} />;
+    } else if (guideStep == "3") {
+        return <Screen name='Guide3' component={Guide3Screen} />;
+    } else if (guideStep == "4") {
+        return <Screen name='Guide4' component={Guide4Screen} />;
+    } else if (guideStep == "5") {
+        return <Screen name='StoreAudit' component={StoreAudit} />;
+    } else {
+        return <></>;
+    }
 }

+ 13 - 14
navigation/LoadingModel.js

@@ -20,8 +20,6 @@ import {
 import { useFocusEffect } from "@react-navigation/native";
 export default function ModalScreen({ navigation }) {
     const theme = useTheme();
-    const { getWords } = useModel("wordsModel", true);
-    const { changeBackground } = useModel("barModel", true);
     const { checkLogin, isLogin, status, guideStep } = useModel("userModel");
 
     const [loading, changeLoading] = React.useState(true);
@@ -29,24 +27,25 @@ export default function ModalScreen({ navigation }) {
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
             getWords();
-            checkLogin().then((_) => {
+            checkLogin().then(_ => {
                 changeLoading(false);
             });
         }, [])
     );
-
     React.useEffect(() => {
         if (!loading) {
-            navigation.replace("Money");
-            // if (isLogin) {
-            //     if (status !== "PASS") {
-            //         navigation.replace("Guide");
-            //     } else {
-            //         navigation.replace("Root");
-            //     }
-            // } else {
-            //     navigation.replace("Login");
-            // }
+            // navigation.replace("RechargeDetail", {
+            //     id: 444,
+            // });
+            if (isLogin) {
+                if (status !== "PASS") {
+                    navigation.replace("Guide");
+                } else {
+                    navigation.replace("Root");
+                }
+            } else {
+                navigation.replace("Login");
+            }
         }
     });
 

+ 238 - 0
screens/Bank/AddScreen.js

@@ -0,0 +1,238 @@
+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 ListComponent from "../../components/ListComponent";
+
+const PlusIcon = props => <Icon {...props} fill='#fff' name='plus' />;
+export default function BankScreen({ navigation, route }) {
+    const theme = useTheme();
+    const { changeBackground } = useModel("barModel");
+    const {
+        bindBankText1,
+        bankTitle1,
+        bankTitle2,
+        bankTitle3,
+        bankTitle4,
+        register_form_4,
+        sendCode,
+        bankPla1,
+        bankPla2,
+        bankPla3,
+        bankPla4,
+        register_pla_4,
+        login_form_3,
+        login_pla_3,
+        bankTitle5,
+        next,
+        successText,
+        add,
+        editText,
+        confirm,
+        delText,
+    } = useModel("wordsModel");
+    const { httpPost, httpGet } = useModel("httpModel", true);
+    const { userId } = useModel("userModel");
+    const { success } = useModel("loadingModel");
+    const { removeEvent } = useModel("dialogModel", true);
+    const [id, setId] = React.useState(0);
+    const [prePage, setPrePage] = React.useState("Bank");
+
+    useFocusEffect(
+        React.useCallback(() => {
+            changeBackground(theme["color-primary-500"]);
+            console.log(route);
+            let { params } = route;
+            let { id, pageName } = params || {};
+            if (id) {
+                setId(id);
+            }
+            if (pageName) {
+                setPrePage(pageName);
+            }
+        }, [])
+    );
+
+    const [bankName, changeBankName] = React.useState("");
+    const [cardNo, changeCardId] = React.useState("");
+    const [realName, changeRealName] = React.useState("");
+    const [idNo, changeIdNo] = React.useState("");
+    const [phone, changePhone] = React.useState("");
+    const [code, changeCode] = React.useState("");
+    const [checked, setChecked] = React.useState(true);
+
+    React.useEffect(() => {
+        if (id) {
+            httpGet("/bankCard/get/" + id, {}, true).then(res => {
+                function getVal(value) {
+                    return value || "";
+                }
+                changeBankName(getVal(res.bankName));
+                changeCardId(getVal(res.cardNo));
+                changeRealName(getVal(res.realName));
+                changeIdNo(getVal(res.idNo));
+                changePhone(getVal(res.phone));
+                // changeCode(getVal(res.code));
+            });
+        }
+    }, [id]);
+
+    const canNext = React.useMemo(() => {
+        if (
+            bankName &&
+            cardNo &&
+            realName &&
+            idNo &&
+            phone &&
+            (code || id) &&
+            checked
+        ) {
+            return true;
+        } else {
+            return false;
+        }
+    }, [bankName, cardNo, realName, idNo, phone, code, checked, id]);
+
+    const submit = () => {
+        httpPost(
+            "/bankCard/save",
+            {
+                id: id || "",
+                bankName,
+                cardNo,
+                realName,
+                idNo,
+                phone,
+                code,
+                userId,
+            },
+            {
+                body: "json",
+            },
+            true
+        ).then(res => {
+            success(add + successText);
+            let query = {};
+            if (prePage === "reCharge") {
+                query.selectId = res.id;
+            }
+            navigation.navigate(prePage, query);
+        });
+    };
+
+    const remove = () => {
+        removeEvent(() => {
+            httpPost("/bankCard/del/" + id, {}, true).then(res => {
+                success(delText + successText);
+                navigation.navigate(prePage);
+            });
+        });
+    };
+
+    return (
+        <>
+            <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>
+            {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>
+            )}
+        </>
+    );
+}
+
+const styles = StyleSheet.create({
+    form: {
+        paddingHorizontal: 10,
+    },
+    radio: {
+        paddingVertical: 15,
+        paddingHorizontal: 15,
+    },
+    btn: {
+        marginHorizontal: 15,
+        marginVertical: 10,
+    },
+});

+ 171 - 0
screens/Bank/MainScreen.js

@@ -0,0 +1,171 @@
+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,
+    Divider,
+} from "@ui-kitten/components";
+
+import ListComponent from "../../components/ListComponent";
+import BankCard from "../../components/BankCard";
+
+const PlusIcon = props => <Icon {...props} fill='#fff' name='plus' />;
+export default function BankScreen({ navigation, route }) {
+    const theme = useTheme();
+    const { changeBackground } = useModel("barModel");
+    const { userTitle62, ALI_PAY, bankMainTitle, next } = useModel(
+        "wordsModel"
+    );
+    const { aliAccount } = useModel("userModel");
+    const { showDialog } = useModel("dialogModel");
+    const { httpPost, httpGet } = useModel("httpModel", true);
+    const [pageName, setPageName] = React.useState("Bank");
+    const [selectId, setSelectId] = React.useState();
+    const [showList, changeShow] = React.useState(false);
+
+    useFocusEffect(
+        React.useCallback(() => {
+            changeBackground(theme["color-primary-500"]);
+            const { name, params } = route;
+            setPageName(name);
+        }, [])
+    );
+    function getList(page, size) {
+        return httpGet("/bankCard/my", { page, size }, true);
+    }
+
+    const renderItem = ({ item, index }) => (
+        <BankCard
+            key={index}
+            info={item}
+            type={pageName == "Bank" ? "edit" : "choose"}
+            selectId={selectId}
+            pressEvent={() => {
+                if (pageName == "Bank") {
+                    navigation.navigate("AddBank", {
+                        id: item.id,
+                        pageName,
+                    });
+                } else {
+                    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]);
+
+    const ListFooterComponent = () => (
+        <>
+            <Divider style={styles.separatorStyle} />
+            <BankCard
+                disabled={true}
+                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" }} />
+    );
+    const renderRightActions = () => (
+        <TopNavigationAction
+            icon={PlusIcon}
+            onPress={() => {
+                navigation.navigate("AddBank", {
+                    pageName,
+                });
+            }}
+        />
+    );
+
+    const emptyEvent = isEmpty => {
+        const { name } = route;
+        if (name == "ChooseBank" && isEmpty) {
+            navigation.replace("AddBank", {
+                pageName: "Recharge",
+            });
+        } else {
+            changeShow(true);
+        }
+    };
+
+    return (
+        <>
+            {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
+                }
+                showEmpty={pageName === "ChooseBank"}
+                emptyEvent={emptyEvent}
+                showList={showList}
+                extraData={{ selectId: selectId }}
+            />
+            {pageName == "ChooseBank" && showList && (
+                <Layout style={styles.subBtn}>
+                    <Button
+                        disabled={!selectId}
+                        onPress={() => {
+                            navigation.navigate("Recharge", {
+                                selectId: selectId,
+                            });
+                        }}
+                    >
+                        {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",
+    },
+});

+ 202 - 0
screens/Bank/RechargeDetailScreen.js

@@ -0,0 +1,202 @@
+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 moment from "moment";
+const PlusIcon = props => <Icon {...props} fill='#fff' name='plus' />;
+export default function RechargeDetailScreen({ navigation }) {
+    const theme = useTheme();
+    const { changeBackground } = useModel("barModel");
+    const {
+        WITHDRAW,
+        Apply_SUCCESS,
+        Apply_PENDING,
+        Apply_FAIL,
+        rechargeTime,
+        rechargeTitle2,
+        rechargeTitle3,
+    } = useModel("wordsModel");
+    const { httpPost, httpGet } = useModel("httpModel", true);
+    const { success } = useModel("loadingModel");
+    const [applyInfo, setApplyInfo] = React.useState({});
+    const route = useRoute();
+
+    const { amount, bankCard, enabled, id, status, withdrawTime } = applyInfo;
+
+    const { bankName, cardNo } = bankCard || {};
+
+    useFocusEffect(
+        React.useCallback(() => {
+            changeBackground(theme["color-primary-500"]);
+        }, [])
+    );
+
+    const showTip = React.useMemo(() => {
+        if (status === "SUCCESS") {
+            return Apply_SUCCESS;
+        } else if (status === "FAIL") {
+            return Apply_FAIL;
+        } else {
+            return Apply_PENDING;
+        }
+    }, [Apply_SUCCESS, Apply_PENDING, Apply_FAIL]);
+
+    const getTime = React.useMemo(() => {
+        if (withdrawTime) {
+            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
+                    ? cardNo.substr(cardNo.length - 5, 4)
+                    : 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 => {
+            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]} />
+                    ) : status === "FAIL" ? (
+                        <Divider style={[styles.line, styles.errorLine]} />
+                    ) : (
+                        <Divider style={[styles.line]} />
+                    )}
+
+                    {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='#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 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",
+    },
+});

+ 181 - 0
screens/Bank/RechargeScreen.js

@@ -0,0 +1,181 @@
+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 BankCard from "../../components/BankCard";
+
+const PlusIcon = props => <Icon {...props} fill='#fff' name='plus' />;
+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(
+        React.useCallback(() => {
+            changeBackground(theme["color-primary-500"]);
+            const { params } = route;
+            const { selectId } = params || {};
+            if (selectId) {
+                setBankCardId(selectId);
+            }
+            getUserInfo();
+        }, [])
+    );
+
+    React.useEffect(() => {
+        if (bankCardId) {
+            httpGet("/bankCard/get/" + bankCardId).then(res => {
+                setBankCradInfo(res);
+            });
+        } else {
+            setBankCradInfo({});
+        }
+    }, [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)) {
+            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);
+        httpPost(
+            "/withdrawApply/apply",
+            {
+                amount: _value,
+                bankCardId: bankCardId,
+            },
+            {},
+            true
+        ).then(res => {
+            success(applySuccess);
+            navigation.replace("RechargeDetail", {
+                id: res.id,
+            });
+        });
+    }
+
+    return (
+        <>
+            <NavHeaderBar title={WITHDRAW} />
+            <Divider style={styles.separatorStyle} />
+            <BankCard
+                type='edit'
+                pressEvent={() => {
+                    navigation.navigate("ChooseBank");
+                }}
+                info={bankCradInfo}
+            />
+
+            <Layout style={styles.input}>
+                <Input
+                    appearance='reCharge'
+                    label='提现金额'
+                    value={value}
+                    accessoryLeft={() => (
+                        <Text category='h2' style={styles.left}>
+                            ¥
+                        </Text>
+                    )}
+                    caption={"可用余额" + showMoeny + "元"}
+                    keyboardType='numeric'
+                    onChangeText={text => {
+                        setVal(text);
+                    }}
+                    onBlur={() => {
+                        console.log(value);
+                        let _value = Number(value);
+                        if (_value > (money || 0)) {
+                            setVal(showMoeny);
+                        } else {
+                            setVal(_value.toFixed(2));
+                        }
+                    }}
+                />
+            </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,
+    },
+});

+ 18 - 0
screens/Bank/index.js

@@ -0,0 +1,18 @@
+import * as WebBrowser from "expo-web-browser";
+import * as React from "react";
+import BankScreen from "./MainScreen";
+import AddBankScreen from "./AddScreen";
+import RechargeScreen from "./RechargeScreen";
+import RechargeDetailScreen from "./RechargeDetailScreen";
+
+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} />
+        </>
+    );
+}

+ 63 - 0
screens/BankScreen.js

@@ -0,0 +1,63 @@
+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 ListComponent from "../components/ListComponent";
+
+const PlusIcon = props => <Icon {...props} fill='#fff' name='plus' />;
+export default function BankScreen({ navigation, route }) {
+    const theme = useTheme();
+    const { changeBackground } = useModel("barModel");
+    const { userTitle62 } = useModel("wordsModel");
+    const { httpPost, httpGet } = useModel("httpModel", true);
+
+    function getList() {
+        return Promise.resolve();
+    }
+
+    const renderItem = ({ item, index }) => <Layout key={index} />;
+
+    const renderRightActions = () => (
+        <TopNavigationAction
+            icon={PlusIcon}
+            onPress={() => {
+                navigation.navigat("AddBank");
+            }}
+        />
+    );
+
+    return (
+        <>
+            <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,
+    },
+});

+ 9 - 26
screens/Guide1Screen.js

@@ -20,7 +20,7 @@ import {
     Card,
 } from "@ui-kitten/components";
 import FormInput from "../components/FormInput";
-import { useFocusEffect } from "@react-navigation/native";
+import { useFocusEffect, useRoute } from "@react-navigation/native";
 import ScrollPage from "../components/ScrollPage";
 import ConnectButton from "../components/ConnectButton";
 import GuideHeaderBar from "../components/GuideHeaderBar";
@@ -29,7 +29,7 @@ import NavHeaderBar from "../components/NavHeaderBar";
 import moment from "moment";
 import { CommonActions } from "@react-navigation/native";
 
-export default function Guide1Screen({ navigation, route }) {
+export default function Guide1Screen({ navigation }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
     const { httpGet, httpPost } = useModel("httpModel", true);
@@ -58,7 +58,9 @@ export default function Guide1Screen({ navigation, route }) {
         removeTips,
     } = useModel("wordsModel");
     const { showDialog } = useModel("dialogModel");
+    const route = useRoute();
     const routeName = route.name;
+    console.log(routeName);
     const [id, changeId] = React.useState("");
 
     const [name, changeName] = React.useState("");
@@ -97,7 +99,7 @@ export default function Guide1Screen({ navigation, route }) {
 
     React.useEffect(() => {
         if (id) {
-            httpGet("/goods/get/" + id).then((res) => {
+            httpGet("/goods/get/" + id).then(res => {
                 getInfo(res);
                 ChangeLoadingSuccess(true);
             });
@@ -140,7 +142,6 @@ export default function Guide1Screen({ navigation, route }) {
         if (
             name &&
             amount &&
-            discountAmount &&
             inventory &&
             week &&
             startTime &&
@@ -256,19 +257,6 @@ export default function Guide1Screen({ navigation, route }) {
                                 status='primary'
                                 disabled={!canNext}
                                 onPress={() => {
-                                    console.log({
-                                        id,
-                                        name,
-                                        amount,
-                                        discountAmount,
-                                        inventory,
-                                        week,
-                                        startTime,
-                                        endTime,
-                                        introduction,
-                                        img,
-                                        merchantId: mid,
-                                    });
                                     httpPost(
                                         "/goods/save",
                                         {
@@ -286,19 +274,14 @@ export default function Guide1Screen({ navigation, route }) {
                                         },
                                         { body: "json" },
                                         true
-                                    ).then((res) => {
+                                    ).then(res => {
                                         success(id ? "修改" : "添加" + "成功");
                                         if (id) {
                                             getInfo(res);
                                         } else if (routeName != "AddGoods") {
-                                            changeGuideStep(1, "Guide2");
+                                            changeGuideStep(2);
                                         } else {
-                                            changeId(res.id);
-                                            navigation.dispatch(
-                                                CommonActions.setParams({
-                                                    id: res.id,
-                                                })
-                                            );
+                                            navigation.goBack();
                                         }
                                     });
                                 }}
@@ -334,7 +317,7 @@ export default function Guide1Screen({ navigation, route }) {
                                             bodyText: passTips,
                                             cancelable: true,
                                             confirmCallback: () => {
-                                                changeGuideStep(1, "Guide2");
+                                                changeGuideStep(2);
                                             },
                                         });
                                     }}

+ 2 - 2
screens/Guide2Screen.js

@@ -173,7 +173,7 @@ export default function Guide1Screen({ navigation }) {
                                         addClass()
                                             .then((_) => {
                                                 success("添加成功");
-                                                changeGuideStep(2, "Guide3");
+                                                changeGuideStep(3);
                                             })
                                             .then((e) => {});
                                     }}
@@ -189,7 +189,7 @@ export default function Guide1Screen({ navigation }) {
                                             bodyText: passTips,
                                             cancelable: true,
                                             confirmCallback: () => {
-                                                changeGuideStep(2, "Guide3");
+                                                changeGuideStep(3);
                                             },
                                         });
                                     }}

+ 1 - 1
screens/Guide4Screen.js

@@ -53,7 +53,7 @@ export default function Guide1Screen({ navigation, route }) {
                         <Button
                             status='primary'
                             onPress={() =>
-                                changeGuideStep(4,'StoreAudit')
+                                changeGuideStep(5)
                             }
                         >
                             {complete}

+ 14 - 16
screens/HomeScreen.js

@@ -42,17 +42,17 @@ const labelText = (focused, title) => (
         {title}
     </Text>
 );
-const NextIcon = (props) => <Icon {...props} name='arrow-ios-downward' />;
+const NextIcon = props => <Icon {...props} name='arrow-ios-downward' />;
 
-const SearchIcon = (props) => <Icon {...props} name='search-outline' />;
-const MailIcon = (props) => <Icon {...props} name='email-outline' />;
-const ShareIcon = (props) => <Icon {...props} name='share-outline' />;
+const SearchIcon = props => <Icon {...props} name='search-outline' />;
+const MailIcon = props => <Icon {...props} name='email-outline' />;
+const ShareIcon = props => <Icon {...props} name='share-outline' />;
 
-const MenuIcon = (props) => <Icon {...props} name='more-vertical' />;
+const MenuIcon = props => <Icon {...props} name='more-vertical' />;
 
-const InfoIcon = (props) => <Icon {...props} name='info' />;
+const InfoIcon = props => <Icon {...props} name='info' />;
 
-const LogoutIcon = (props) => <Icon {...props} name='log-out' />;
+const LogoutIcon = props => <Icon {...props} name='log-out' />;
 
 export default function HomeScreen({ navigation, route }) {
     const theme = useTheme();
@@ -93,7 +93,7 @@ export default function HomeScreen({ navigation, route }) {
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
-            httpGet("/fullReduction/my").then((res) => {
+            httpGet("/fullReduction/my").then(res => {
                 changeFllReduction(res);
             });
         }, [])
@@ -124,10 +124,8 @@ export default function HomeScreen({ navigation, route }) {
                     accessoryLeft={LogoutIcon}
                     title='退出登录'
                     onPress={() => {
-                        userLogout().then(() => {
-                            toggleMenu();
-                            RootNavigation.reset("LoadingModel");
-                        });
+                        toggleMenu();
+                        userLogout();
                     }}
                 />
             </OverflowMenu>
@@ -136,8 +134,8 @@ export default function HomeScreen({ navigation, route }) {
 
     const renderBackAction = () => <Text category='h6'>{homeBar}</Text>;
 
-    const badgeList = (list) => {
-        return list.map((item) => {
+    const badgeList = list => {
+        return list.map(item => {
             return (
                 <Badge style={styles.badge} key={item.id}>
                     {fullReduction1}
@@ -232,7 +230,7 @@ export default function HomeScreen({ navigation, route }) {
                             appearance='ghost'
                             status='info'
                             accessoryRight={NextIcon}
-                            children={(TextProps) => (
+                            children={TextProps => (
                                 <Text
                                     style={[TextProps.style, styles.labelText]}
                                     numberOfLines={1}
@@ -250,7 +248,7 @@ export default function HomeScreen({ navigation, route }) {
                                     isEdit: true,
                                     title: homeTitle3,
                                     cancelable: true,
-                                    confirmCallback: (info) => {
+                                    confirmCallback: info => {
                                         updateMerchant({ proclamation: info });
                                     },
                                 });

+ 19 - 23
screens/HomeScreenPage1.js

@@ -36,30 +36,33 @@ export default function HomePage1(props) {
     const [goods, setGoods] = React.useState([]);
     const [goodsClass, setGoodsClass] = React.useState([]);
     const { showDialog } = useModel("dialogModel", true);
-    const { removeTips, remove, successText } = useModel("userModel");
     const { success } = useModel("loadingModel", true);
+    const { removeTips, remove, successText } = useModel("wordsModel");
     useFocusEffect(
         React.useCallback(() => {
-            httpGet("/classification/my").then((res) => {
+            httpGet("/classification/my").then(res => {
                 setClassifications(res);
                 if (res.length > 0) {
                     changeSelectId(res[0].id);
                 }
             });
-            httpGet("/goods/my").then((res) => {
-                setGoods(res);
-            });
+            getGoods();
         }, [])
     );
 
+    function getGoods() {
+        httpGet("/goods/my").then(res => {
+            setGoods(res);
+        });
+    }
     const topGoods = React.useMemo(() => {
-        return goods.filter((item) => {
+        return goods.filter(item => {
             return item.signboard;
         });
     }, [goods]);
 
     const elseGoods = React.useMemo(() => {
-        return goods.filter((item) => {
+        return goods.filter(item => {
             return !item.signboard;
         });
     }, [goods]);
@@ -68,7 +71,7 @@ export default function HomePage1(props) {
         function getAllGoods() {
             httpGet("/classification/allGoods", {
                 classificationId: selectId,
-            }).then((res) => {
+            }).then(res => {
                 setGoodsClass(res);
             });
         }
@@ -80,7 +83,7 @@ export default function HomePage1(props) {
     const classificationItem = ({ item, index }) => (
         <ListItem
             appearance='classification'
-            title={(textprops) => (
+            title={textprops => (
                 <Text
                     {...textprops}
                     style={[
@@ -99,14 +102,14 @@ export default function HomePage1(props) {
     );
 
     const topGoodsItem = ({ item, index }) => <GoodsCard info={item} />;
-    const PulsIcon = (props) => (
+    const PulsIcon = props => (
         <Icon
             {...props}
             style={[props.style, { width: 50, height: 50 }]}
             name='plus'
         />
     );
-    const topGoodsMap = (list) => {
+    const topGoodsMap = list => {
         var _list = list.map((item, index) => {
             return (
                 <GoodsCard
@@ -162,16 +165,9 @@ export default function HomePage1(props) {
                 signboard,
             },
             { body: "json" }
-        ).then((res) => {
-            success(tips + successText);
-            let _goods = goods.map((item) => {
-                if (item.id != id) {
-                    return item;
-                } else {
-                    return res;
-                }
-            });
-            changeGoods(_goods);
+        ).then(res => {
+            success(remove + successText);
+            getGoods();
         });
     }
 
@@ -183,7 +179,7 @@ export default function HomePage1(props) {
                     disabled={true}
                     style={styles.card}
                     backgroundColor='#F0F0F0'
-                    header={(props) => (
+                    header={props => (
                         <Text {...props} style={[styles.title, props.style]}>
                             店主推荐
                         </Text>
@@ -244,7 +240,7 @@ export default function HomePage1(props) {
         </>
     );
 }
-const StarIcon = (props) => <Icon {...props} name='plus' />;
+const StarIcon = props => <Icon {...props} name='plus' />;
 
 const goodsItem = ({ item, index }) => (
     <GoodsCardLarge appearance='classification' info={item} />

+ 9 - 29
screens/HomeScreenPage2.js

@@ -22,6 +22,7 @@ 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";
 
 const width = Dimensions.get("window").width;
 const height = Dimensions.get("window").height;
@@ -32,7 +33,7 @@ export default function HomePage2(props) {
     const [selectId, changeSelectId] = React.useState(0);
     const { showDialog } = useModel("dialogModel", true);
 
-    const { editText, autoBackText } = useModel("wordsModel");
+    const { editAutoBack, autoBackText } = useModel("wordsModel");
 
     return (
         <Layout style={styles.tabContainer}>
@@ -60,35 +61,13 @@ export default function HomePage2(props) {
                 </Badge>
             </Layout>
             <Layout style={styles.back}>
-                <Text
-                    style={styles.backText}
-                    category='h1'
-                    status='info'
-                    ellipsizeMode='tail'
-                    numberOfLines={1}
-                >
-                    暂无自动回复暂无自动回复暂无自动回复暂无自动回复
-                </Text>
-
                 <Button
                     style={styles.backButtn}
-                    size='tiny'
-                    appearance='ghost'
                     onPress={() => {
-                        showDialog({
-                            pla: "",
-                            maxLength: 50,
-                            defaultValue: "",
-                            isEdit: true,
-                            title: editText + autoBackText,
-                            cancelable: true,
-                            confirmCallback: (info) => {
-                                // updateMerchant({ proclamation: info });
-                            },
-                        });
+                        RootNavigation.navigate("Automatic");
                     }}
                 >
-                    {editText}
+                    {editAutoBack}
                 </Button>
             </Layout>
 
@@ -103,7 +82,7 @@ export default function HomePage2(props) {
     );
 }
 const classificationItem = ({ item, index }) => <CommentCard />;
-const StarIcon = (props) => <Icon {...props} name='plus-outline' />;
+const StarIcon = props => <Icon {...props} name='plus-outline' />;
 
 const goodsItem = ({ item, index }) => (
     <GoodsCardLarge appearance='classification' />
@@ -114,7 +93,7 @@ const styles = StyleSheet.create({
         backgroundColor: "#fff",
         paddingTop: 20,
         paddingBottom: 80,
-        height: "100%",
+        flex: 1,
     },
     bageList: {
         flexDirection: "row",
@@ -123,9 +102,10 @@ const styles = StyleSheet.create({
         paddingBottom: 9,
     },
     back: {
-        paddingLeft: 15,
-        paddingBottom: 5,
+        paddingHorizontal: 13,
+        paddingVertical: 5,
         flexDirection: "row",
+        justifyContent: "flex-end",
     },
     backText: {
         width: 200,

+ 121 - 40
screens/HomeScreenPage3.js

@@ -28,8 +28,25 @@ import UpLoadImage from "../components/UpLoadImage";
 import Textarea from "react-native-textarea";
 import * as RootNavigation from "../navigation/RootNavigation.js";
 
-const width = Dimensions.get("window").width;
-const height = Dimensions.get("window").height;
+import OpenTimeUtil from "../Utils/OpenTimeUtil";
+import ListUtil from "../Utils/ListUtil";
+
+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>
+);
+
 export default function HomePage3(props) {
     const theme = useTheme();
     const { httpPost, httpGet } = useModel("httpModel", true);
@@ -37,7 +54,19 @@ export default function HomePage3(props) {
     const [selectId, changeSelectId] = React.useState(0);
     const { showDialog } = useModel("dialogModel", true);
     const [text, changeText] = React.useState("");
-    const { img, updateMerchant, introduction } = useModel("userModel");
+    const {
+        img,
+        updateMerchant,
+        introduction,
+        name,
+        phone,
+        address,
+        category,
+        week,
+        endTime,
+        startTime,
+    } = useModel("userModel");
+    const categoryList = new ListUtil(category);
     const { loading, success } = useModel("loadingModel");
 
     const {
@@ -47,6 +76,7 @@ export default function HomePage3(props) {
         home3Title2,
         confirm,
         getWordsStr,
+        weekWords,
     } = useModel("wordsModel");
 
     const imgList = React.useMemo(() => {
@@ -56,6 +86,15 @@ export default function HomePage3(props) {
         return [...new Set(list)];
     }, [img]);
 
+    const openTime = React.useMemo(() => {
+        if (startTime && endTime && week && weekWords) {
+            let _o = new OpenTimeUtil(startTime, endTime, week, weekWords());
+            return _o.getShowStr();
+        } else {
+            return "";
+        }
+    }, [startTime, endTime, week, weekWords]);
+
     function changeImg(img, index) {
         let _imgs = [...imgList];
         _imgs.splice(index, 1, img);
@@ -74,13 +113,13 @@ export default function HomePage3(props) {
         });
     }
 
-    const showImgList = (list) => {
+    const showImgList = list => {
         return list.map((item, index) => {
             return (
                 <Layout key={index} style={styles.upload}>
                     <UpLoadImage
                         value={item}
-                        changeIcon={(img) => changeImg(img, index)}
+                        changeIcon={img => changeImg(img, index)}
                         size={67}
                         hasCancel={true}
                         delEvent={() => {
@@ -92,6 +131,21 @@ export default function HomePage3(props) {
         });
     };
 
+    function showChange(key, val, title, max, type) {
+        showDialog({
+            pla: "",
+            maxLength: max || 50,
+            defaultValue: val,
+            InputType: type,
+            isEdit: true,
+            title: title,
+            cancelable: true,
+            confirmCallback: info => {
+                updateMerchant({ [key]: info });
+            },
+        });
+    }
+
     return (
         <Layout style={styles.tabContainer}>
             <Layout style={styles.top}>
@@ -115,7 +169,7 @@ export default function HomePage3(props) {
                         onPress={() => {
                             updateMerchant({
                                 introduction: text,
-                            }).then((res) => {
+                            }).then(res => {
                                 success("成功");
                             });
                         }}
@@ -127,54 +181,70 @@ export default function HomePage3(props) {
 
             <Menu style={styles.menu}>
                 <MenuItem
-                    title={getWordsStr("register_form_1")}
+                    title={props =>
+                        Label(props, getWordsStr("register_form_1"), name)
+                    }
                     accessoryRight={ForwardIcon}
                     style={styles.menuItem}
-                    onPress={() => {
-                        navigation.navigate("Home", {
-                            screen: "homeTab3",
-                        });
-                    }}
+                    onPress={() =>
+                        showChange(
+                            "name",
+                            name,
+                            getWordsStr("register_form_1"),
+                            25,
+                            "text"
+                        )
+                    }
                 />
                 <MenuItem
-                    title={getWordsStr("guideHome_form_1")}
+                    title={props =>
+                        Label(
+                            props,
+                            getWordsStr("guideHome_form_1"),
+                            categoryList.getKey("name")
+                        )
+                    }
                     accessoryRight={ForwardIcon}
                     style={styles.menuItem}
-                    onPress={() => {
-                        navigation.navigate("Home", {
-                            screen: "homeTab3",
-                        });
-                    }}
+                    onPress={() => {}}
                 />
                 <MenuItem
-                    title={getWordsStr("guideHome_form_2")}
+                    title={props =>
+                        Label(props, getWordsStr("guideHome_form_2"), address)
+                    }
                     accessoryRight={ForwardIcon}
                     style={styles.menuItem}
-                    onPress={() => {
-                        navigation.navigate("Home", {
-                            screen: "homeTab3",
-                        });
-                    }}
+                    onPress={() =>
+                        showChange(
+                            "address",
+                            address,
+                            getWordsStr("guideHome_form_2")
+                        )
+                    }
                 />
                 <MenuItem
-                    title={getWordsStr("guideHome_form_3")}
+                    title={props =>
+                        Label(props, getWordsStr("guideHome_form_3"), phone)
+                    }
                     accessoryRight={ForwardIcon}
                     style={styles.menuItem}
-                    onPress={() => {
-                        navigation.navigate("Home", {
-                            screen: "homeTab3",
-                        });
-                    }}
+                    onPress={() =>
+                        showChange(
+                            "phone",
+                            phone,
+                            getWordsStr("guideHome_form_3"),
+                            11,
+                            "phone"
+                        )
+                    }
                 />
                 <MenuItem
-                    title={getWordsStr("guideHome_form_4")}
+                    title={props =>
+                        Label(props, getWordsStr("guideHome_form_4"), openTime)
+                    }
                     accessoryRight={ForwardIcon}
                     style={styles.menuItem}
-                    onPress={() => {
-                        navigation.navigate("Home", {
-                            screen: "homeTab3",
-                        });
-                    }}
+                    onPress={() => {}}
                 />
                 <MenuItem
                     title={getWordsStr("guideHome_form_5")}
@@ -183,7 +253,7 @@ export default function HomePage3(props) {
                     onPress={() => {
                         RootNavigation.navigate("EditBanner", {
                             type: "qualification",
-                        })
+                        });
                     }}
                 />
             </Menu>
@@ -191,7 +261,7 @@ export default function HomePage3(props) {
     );
 }
 
-const ForwardIcon = (props) => (
+const ForwardIcon = props => (
     <Icon
         {...props}
         name='arrow-ios-forward'
@@ -200,7 +270,7 @@ const ForwardIcon = (props) => (
     />
 );
 const classificationItem = ({ item, index }) => <CommentCard />;
-const StarIcon = (props) => <Icon {...props} name='plus-outline' />;
+const StarIcon = props => <Icon {...props} name='plus-outline' />;
 
 const goodsItem = ({ item, index }) => (
     <GoodsCardLarge appearance='classification' />
@@ -209,7 +279,7 @@ const goodsItem = ({ item, index }) => (
 const styles = StyleSheet.create({
     tabContainer: {
         backgroundColor: "#fff",
-        height: "100%",
+        flex: 1,
     },
     top: {
         paddingVertical: 20,
@@ -253,4 +323,15 @@ const styles = StyleSheet.create({
         paddingHorizontal: 15,
     },
     menuItem: {},
+    lable: {
+        flexDirection: "row",
+        flex: 1,
+    },
+    lableName: {
+        flexShrink: 0,
+        flexBasis: "50%",
+        marginHorizontal: 8,
+        fontSize: 13,
+    },
+    lableText: {},
 });

+ 76 - 8
screens/MoneyListScreen.js

@@ -8,7 +8,6 @@ import {
     View,
     ImageBackground,
 } from "react-native";
-import scrollPage from "../decorator/scrollPage";
 import { useModel } from "flooks";
 import {
     Layout,
@@ -19,17 +18,31 @@ import {
     Button,
     Card,
     List,
+    Select,
+    SelectItem,
+    IndexPath,
+    Avatar,
+    Divider,
 } 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 MoneyRecord from "../components/MoneyRecord";
+
+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,
@@ -39,8 +52,9 @@ export default function MoneyListScreen({ navigation, route }) {
         storeAudioText4,
         complete,
     } = useModel("wordsModel");
-    const [categoryList, changeCategoryList] = React.useState([]);
-    const [merchantNatureList, changeMerchantNatureList] = React.useState([]);
+
+    const displayValue = data[selectedIndex.row];
+
     useFocusEffect(
         React.useCallback(() => {
             changeBackground(theme["color-primary-500"]);
@@ -48,6 +62,37 @@ export default function MoneyListScreen({ navigation, route }) {
         }, [])
     );
 
+    // 获取列表
+    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} />
@@ -73,13 +118,22 @@ export default function MoneyListScreen({ navigation, route }) {
                 <Button
                     appearance='ghost'
                     style={[styles.flex1]}
-                    size='small'
+                    size='large'
                     status='control'
+                    onPress={() => {
+                        navigation.navigate("ChooseBank");
+                    }}
                 >
                     提现
                 </Button>
             </Layout>
-            <List ></List>
+            <ListComponent
+                getInfo={getList}
+                renderItem={walletItem}
+                ListHeaderComponent={selectElement}
+                style={styles.list}
+                separatorStyle={styles.separatorStyle}
+            />
         </>
     );
 }
@@ -106,7 +160,7 @@ const styles = StyleSheet.create({
     lay: {
         flexDirection: "row",
         paddingHorizontal: 17,
-        paddingVertical: 20,
+        paddingBottom: 20,
     },
     flex1: {
         flex: 1,
@@ -114,10 +168,24 @@ const styles = StyleSheet.create({
     },
     money: {
         textAlign: "center",
+        fontWeight: "normal",
     },
     tiltle: {
         fontSize: 12,
         color: "#A43506",
         alignSelf: "center",
+        flexShrink: 0,
+    },
+    select: {
+        paddingVertical: 10,
+        paddingHorizontal: 20,
+        backgroundColor: "#EEEEEE",
+    },
+    list: {
+        backgroundColor: "#fff",
+        flex: 1,
+    },
+    separatorStyle: {
+        marginHorizontal: 13,
     },
 });

+ 2 - 2
screens/RegisterSeScreen.js

@@ -74,8 +74,8 @@ export default function RegisterScreen({ navigation }) {
     const [category, changeCategory] = React.useState("");
     const [address, changeAddress] = React.useState("");
     const [week, changeWeek] = React.useState("");
-    const [startTime, changeStartTime] = React.useState("08:00");
-    const [endTime, changeEndTime] = React.useState("22:00");
+    const [startTime, changeStartTime] = React.useState("08:00:00");
+    const [endTime, changeEndTime] = React.useState("22:00:00");
     const [merchantNatureId, changeMerchantNatureId] = React.useState("");
     const [logo, changeLogo] = React.useState();
     const timeValue = React.useMemo(() => {

+ 195 - 0
screens/Set/AutomaticScreen.js

@@ -0,0 +1,195 @@
+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,
+    TouchableOpacity,
+    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 theme = useTheme();
+    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.navigate("Home", {
+                screen: "homeTab2",
+            });
+        });
+    }
+
+    const canSub = React.useMemo(() => {
+        if (goodContent || badContent) {
+            return true;
+        } else {
+            return false;
+        }
+    }, [goodContent, badContent]);
+
+    return (
+        <>
+            <NavHeaderBar title={automaticText1} />
+            <ScrollPage enabledFresh={true} refreshEvent={refreshEvent}>
+                <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.navigate("Home", {
+                                screen: "homeTab2",
+                            });
+                        }}
+                    >
+                        {cancel}
+                    </Button>
+                    <Button
+                        disabled={!canSub}
+                        appearance='filled'
+                        onPress={submit}
+                    >
+                        {save}
+                    </Button>
+                </View>
+            </ScrollPage>
+        </>
+    );
+}
+
+const styles = StyleSheet.create({
+    lay: {
+        paddingHorizontal: 15,
+        paddingVertical: 20,
+        marginTop: 10,
+    },
+    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: {
+        paddingBottom: 10,
+    },
+    button: {
+        alignSelf: "flex-end",
+        marginTop: 10,
+        marginRight: 14,
+    },
+    menu: {
+        borderColor: "#EEEEEE",
+        borderTopWidth: 6,
+        backgroundColor: "#fff",
+        paddingHorizontal: 15,
+    },
+    menuItem: {},
+    buttonGroup: {
+        justifyContent: "space-around",
+        paddingVertical: 20,
+        flexDirection: "row",
+    },
+});

+ 11 - 0
screens/Set/index.js

@@ -0,0 +1,11 @@
+import * as WebBrowser from "expo-web-browser";
+import * as React from "react";
+import AutomaticScreen from "./AutomaticScreen";
+
+export default function Set(Screen) {
+    return (
+        <>
+            <Screen name='Automatic' component={AutomaticScreen} />
+        </>
+    );
+}

+ 7 - 2
screens/StoreAudit.js

@@ -29,7 +29,7 @@ import ConnectButton from "../components/ConnectButton";
 export default function StoreAudit({ navigation, route }) {
     const theme = useTheme();
     const { changeBackground } = useModel("barModel");
-    const { status, changeGuideStep } = useModel("userModel");
+    const { status, changeGuideStep, getUserInfo } = useModel("userModel");
 
     const {
         storeAudio,
@@ -47,10 +47,14 @@ export default function StoreAudit({ navigation, route }) {
         }, [])
     );
 
+    function refreshEvent() {
+        return getUserInfo();
+    }
+
     return (
         <>
             <NavHeaderBar title={storeAudio} back={false} />
-            <ScrollPage>
+            <ScrollPage enabledFresh={true} refreshEvent={refreshEvent}>
                 <Layout style={styles.container}>
                     {status == "PENDING" ? (
                         <>
@@ -101,6 +105,7 @@ export default function StoreAudit({ navigation, route }) {
                             </Button>
                         </>
                     )}
+
                     <ConnectButton />
                 </Layout>
             </ScrollPage>