Browse Source

测试删除

panhui 5 years ago
parent
commit
a8d6b75cf7

+ 1 - 1
login/AuditResultScreen.tsx

@@ -94,7 +94,7 @@ export default function AuditResultScreen({ navigation }: StackScreenProps) {
               alignSelf="center"
               onPress={() => {
                 removeAsyncStorage('riderIsApply');
-                navigation.dispatch(StackActions.replace('Root'));
+                navigation.dispatch(StackActions.replace('MainStack'));
               }}
             >
               完成

+ 10 - 1
login/LoginScreen.tsx

@@ -120,6 +120,14 @@ function LoginByPsd() {
             placeholderTextColor="#a6a6a6"
             placeholder={t('shu-ru-shang-jia-ming-cheng')}
           />
+          {__DEV__ && (
+            <Input
+              onChangeText={(text) => {
+                console.log(text);
+                setphone(text);
+              }}
+            />
+          )}
         </Div>
       </Div>
       <Div row alignItems="center" py={10}>
@@ -176,8 +184,9 @@ function LoginByPsd() {
         fontSize="sm"
         ml={96}
         mt={10}
+        disabled={!phone || !password}
         onPress={() => {
-          loginModel.loginByPsd();
+          loginModel.loginByPsd(phone, password);
         }}
       >
         {t('deng-lu')}

+ 9 - 1
login/RegisterScreen.tsx

@@ -92,7 +92,7 @@ export default function RegisterScreen({
               flex={1}
               bg="gray100"
               rounded="sm"
-              // px={15}
+              px={15}
               ml={5}
               h={30}
               alignItems="stretch"
@@ -112,6 +112,14 @@ export default function RegisterScreen({
                 style={{ flex: 1, fontSize: 14 }}
                 placeholder={t('shu-ru-shou-ji-hao')}
               />
+
+              {__DEV__ && (
+                <Input
+                  onChangeText={(text) => {
+                    setPhone(text);
+                  }}
+                />
+              )}
             </Div>
           </Div>
           <Div row alignItems="center" py={10}>

+ 5 - 5
login/model.ts

@@ -13,14 +13,14 @@ import User from '../stores/User';
 
 const MapModel = (now) => ({
   applyInfo: {},
-  loginByPsd() {
+  loginByPsd(username, password) {
     toastShow();
     return request
-      .post('/auth/login', {
+      .post('/auth/loginByRegister', {
         data: {
-          username: '1562356',
-          password: '123456',
-          expiration: '1',
+          phone: username,
+          password,
+          identity: 'RIDER',
         },
         requestType: 'form',
       })

+ 8 - 1
navigation/NoticeStackNavigator.tsx

@@ -15,6 +15,7 @@ import { useTranslation } from 'react-i18next';
 import { NoticeStackParamList } from '../types';
 
 import ChatScreen from '../notice/ChatScreen';
+import EmailDetailScreen from '../notice/EmailDetailScreen';
 
 const NoticeStack = createStackNavigator<NoticeStackParamList>();
 export default function Navigation({
@@ -25,7 +26,7 @@ export default function Navigation({
   const { t } = useTranslation();
   return (
     <NoticeStack.Navigator
-      initialRouteName="Chat"
+      initialRouteName="EmailDetail"
       screenOptions={{
         cardOverlayEnabled: true,
         cardStyle: { backgroundColor: '#f2f2f2', flex: 1 },
@@ -56,6 +57,12 @@ export default function Navigation({
         component={ChatScreen}
         options={{ title: '聊天' }}
       />
+      <NoticeStack.Screen
+        name="EmailDetail"
+        component={EmailDetailScreen}
+        options={{ title: '系统提醒' }}
+        initialParams={{ emailId: 2160 }}
+      />
     </NoticeStack.Navigator>
   );
 }

+ 13 - 14
navigation/index.tsx

@@ -46,18 +46,17 @@ export default function Navigation({
   const navRef = React.useRef();
 
   const initRoute = useCreation(() => {
-    console.log(initialRouteName);
-    if (__DEV__) {
-      return {
-        name: 'OrderStack',
-        screen: 'OrderDetail',
-      };
-    } else {
-      return {
-        name: initialRouteName !== 'MainStack' ? 'Login' : initialRouteName,
-        screen: initialRouteName !== 'MainStack' ? initialRouteName : 'Order',
-      };
-    }
+    // if (__DEV__) {
+    //   return {
+    //     name: 'NoticeStack',
+    //     screen: 'EmailDetail',
+    //   };
+    // } else {
+    return {
+      name: initialRouteName !== 'MainStack' ? 'LoginStack' : initialRouteName,
+      screen: initialRouteName !== 'MainStack' ? initialRouteName : 'Order',
+    };
+    // }
   }, [__DEV__, initialRouteName]);
 
   React.useEffect(() => {
@@ -74,7 +73,7 @@ export default function Navigation({
         })
       );
     }
-  }, [navRef, initialRouteName]);
+  }, [navRef, initRoute]);
 
   return (
     <NavigationContainer
@@ -100,7 +99,7 @@ function RootNavigator({ initRoute }) {
       }}
     >
       <Stack.Screen
-        name="Login"
+        name="LoginStack"
         component={LoginStackNavigator}
         options={{
           cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS,

+ 47 - 0
notice/EmailDetailScreen.tsx

@@ -0,0 +1,47 @@
+import { StackScreenProps } from '@react-navigation/stack';
+import * as React from 'react';
+import { RefreshControl } from 'react-native';
+import { Div, Button, Image, Text, Avatar } from 'react-native-magnus';
+import { ScrollView } from 'react-native-gesture-handler';
+import { useRequest } from 'ahooks';
+
+import { RootStackParamList } from '../types';
+
+export default function RegisterScreen({ navigation, route }) {
+  const { params } = route;
+  const { emailId } = params;
+  const { data, loading, reload } = useRequest(`/email/get/${emailId}`, {
+    refreshDeps: [emailId],
+    initialData: {},
+  });
+
+  return (
+    <Div bg="gray100">
+      <ScrollView
+        contentContainerStyle={{ flexGrow: 1, backgroundColor: '#f2f2f2' }}
+        refreshControl={
+          <RefreshControl refreshing={loading} onRefresh={reload} />
+        }
+      >
+        <Div my={10} px={15} py={5} bg="white">
+          <Div row justifyContent="space-between" py={10}>
+            <Text fontSize="xl" fontWeight="bold">
+              {data.title}
+            </Text>
+            <Text>12月26日</Text>
+          </Div>
+
+          <Text
+            py={10}
+            color="gray600"
+            borderTopColor="gray100"
+            borderTopWidth={1}
+            fontSize="sm"
+          >
+            {data.content}
+          </Text>
+        </Div>
+      </ScrollView>
+    </Div>
+  );
+}

+ 1 - 1
notice/NoticeCom.tsx

@@ -56,7 +56,7 @@ export default function NoticeCom({
         <Div flex={1} justifyContent="space-between" ml={5}>
           <Div row>
             <Text fontSize="sm" flex={1}>
-              {toUserName}
+              {type === 'user' ? toUserName : info.title}
             </Text>
             <Text fontSize="xs" color="gray400">
               {getChatTime(sendTime)}

+ 45 - 13
notice/NoticeScreen.tsx

@@ -1,5 +1,6 @@
 import { StackScreenProps } from '@react-navigation/stack';
 import * as React from 'react';
+import { useFocusEffect } from '@react-navigation/native';
 import { Div, Button, Image, Text, Avatar } from 'react-native-magnus';
 import { ScrollView, FlatList } from 'react-native-gesture-handler';
 import { useNavigation } from '@react-navigation/native';
@@ -24,14 +25,13 @@ export default function NoticeScreen({
 }: StackScreenProps<RootStackParamList, 'Login'>) {
   const { t } = useTranslation();
   const webRef = React.useRef();
-  const { initChat, chatList, sysNoticeList } = useModel(IM, [
-    'chatList',
-    'sysNoticeList',
-  ]);
-  useMount(() => {
-    initChat();
-  });
+  const { initChat } = useModel(IM, []);
 
+  useFocusEffect(
+    React.useCallback(() => {
+      initChat();
+    }, [])
+  );
   return (
     <Div bg="gray100" flex={1}>
       <Div bg="yellow500" pt={Constants.statusBarHeight + 11} pb={11}>
@@ -40,7 +40,7 @@ export default function NoticeScreen({
         </Text>
       </Div>
       <NoticeTab.Navigator
-        initialRouteName="Chat"
+        initialRouteName="Sys"
         style={{ flexGrow: 1 }}
         tabBarOptions={{
           inactiveTintColor: '#000',
@@ -78,13 +78,37 @@ export default function NoticeScreen({
   );
 }
 
-function SysNoticeScreen() {
+function SysNoticeScreen({ navigation }) {
+  const { sysNoticeList } = useModel(IM, ['sysNoticeList']);
   return (
-    <ScrollView
+    <FlatList
+      renderItem={({ item }) => {
+        return (
+          <NoticeCom
+            info={item}
+            type="email"
+            onPress={() => {
+              navigation.navigate('NoticeStack', {
+                screen: 'EmailDetail',
+                params: {
+                  emailId: item.id,
+                },
+              });
+            }}
+          />
+        );
+      }}
+      data={sysNoticeList}
+      keyExtractor={(item, index) => `email${index}`}
+      ListEmptyComponent={() => {
+        return (
+          <Text color="gary200" fontSize="sm" textAlign="center" py={20}>
+            暂无数据
+          </Text>
+        );
+      }}
       contentContainerStyle={{ flexGrow: 1, backgroundColor: '#fff' }}
-    >
-      <NoticeCom />
-    </ScrollView>
+    />
   );
 }
 
@@ -116,7 +140,15 @@ function UserChatScreen({ navigation }) {
         );
       }}
       data={chatList}
+      keyExtractor={(item, index) => `chat${index}`}
       contentContainerStyle={{ flexGrow: 1, backgroundColor: '#fff' }}
+      ListEmptyComponent={() => {
+        return (
+          <Text color="gary200" fontSize="sm" textAlign="center" py={20}>
+            暂无数据
+          </Text>
+        );
+      }}
     />
   );
 }

+ 182 - 99
order/OrderDetailScreen.tsx

@@ -4,6 +4,9 @@ import { Div, Button, Image, Text, Avatar } from 'react-native-magnus';
 import { ScrollView } from 'react-native-gesture-handler';
 import { useRequest, useCreation } from 'ahooks';
 import { RefreshControl } from 'react-native';
+import { toastInfo } from '../utils/SystemUtils';
+
+import { RiderStatusMap } from '../utils/RiderInfoUtils';
 
 export default function OrderDetailScreen({
   navigation,
@@ -22,6 +25,14 @@ export default function OrderDetailScreen({
     return data.orderGoodsSpecs || [];
   }, [data]);
 
+  const statusInfo = useCreation(() => {
+    if (data.riderStatus) {
+      return RiderStatusMap.get(data.riderStatus);
+    } else {
+      return {};
+    }
+  }, [data]);
+
   const totalNum = useCreation(() => {
     return orderGoodsSpecs.reduce((total, currentValue) => {
       return total + currentValue.num;
@@ -30,7 +41,7 @@ export default function OrderDetailScreen({
 
   return (
     <Div bg="gray100" flex={1}>
-      {data.merchantStatus && data.merchantStatus !== 'NOT_RECEIVED' && (
+      {statusInfo.type && statusInfo.type !== 'order' && (
         <Div row bg="white" py={12}>
           <Div flex={1} alignItems="center">
             <Text fontSize="xl" color="red500">
@@ -41,14 +52,25 @@ export default function OrderDetailScreen({
             </Text>
           </Div>
           <Div w={1} bg="gray100" />
-          <Div flex={1} alignItems="center">
-            <Text fontSize="xl" color="red500">
-              {data.timeOfArrival}
-            </Text>
-            <Text fontSize="sm" color="gray600">
-              预计送达时间
-            </Text>
-          </Div>
+          {statusInfo.type === 'finish' ? (
+            <Div flex={1} alignItems="center">
+              <Text fontSize="xl" color="red500">
+                {data.userReceivedTime}
+              </Text>
+              <Text fontSize="sm" color="gray600">
+                用户收到时间
+              </Text>
+            </Div>
+          ) : (
+            <Div flex={1} alignItems="center">
+              <Text fontSize="xl" color="red500">
+                {data.timeOfArrival}
+              </Text>
+              <Text fontSize="sm" color="gray600">
+                预计送达时间
+              </Text>
+            </Div>
+          )}
         </Div>
       )}
 
@@ -63,115 +85,176 @@ export default function OrderDetailScreen({
           <RefreshControl refreshing={loading} onRefresh={reload} />
         }
       >
-        {data.id && (
-          <Div bg="white" rounded="xs" px={15} py={10}>
-            {data.riderStatus !== 'NOT_RECEIVED' &&
-              data.riderStatus !== 'TAKE_MEAL' && (
-                <Div row py={10}>
-                  <Div flex={1}>
-                    <Text>我已到店</Text>
-                    <Text fontSize="sm" color="gray600" mt={2}>
-                      流水号:{data.id}
+        {statusInfo.type && (
+          <>
+            <Div bg="white" rounded="xs" px={15} py={10}>
+              {statusInfo.type === 'merchant' && (
+                <>
+                  <Div row py={10}>
+                    <Div flex={1}>
+                      <Text>我已到店</Text>
+                      <Text fontSize="sm" color="gray600" mt={2}>
+                        流水号:{data.id}
+                      </Text>
+                    </Div>
+                    <Button
+                      bg="yellow500"
+                      w={112}
+                      disabled={statusInfo.status != 0}
+                    >
+                      我已到店
+                    </Button>
+                  </Div>
+
+                  {statusInfo.status === 1 && (
+                    <Div row py={10}>
+                      <Div flex={1}>
+                        <Text>我已取货</Text>
+                        <Text fontSize="sm" color="gray600" mt={2} pr={48}>
+                          为避免货物纠纷,请在取货时 检查并拍照存证
+                        </Text>
+                      </Div>
+                      <Button bg="yellow500" w={112}>
+                        拍照取货
+                      </Button>
+                    </Div>
+                  )}
+                </>
+              )}
+              {(statusInfo.type === 'user' || statusInfo.type === 'finish') && (
+                <Div py={10}>
+                  <Text fontSize="sm">用户信息</Text>
+                  <Div px={10} mt={10}>
+                    <Text fontSize="xl" fontWeight="bold">
+                      {data.nickname}
+                    </Text>
+                    <Text fontSize="sm" mt={5}>
+                      {data.userAddress}
                     </Text>
                   </Div>
                   <Button
+                    block
                     bg="yellow500"
-                    w={112}
-                    disabled={data.riderStatus != 'RECEIVED'}
+                    mt={15}
+                    onPress={() => {
+                      if (!data.userId) {
+                        toastInfo('该订单缺少用户id,请重新下单');
+                        return;
+                      }
+                      navigation.navigate('NoticeStack', {
+                        screen: 'Chat',
+                        params: {
+                          toUserId: data.userId,
+                          toUserName: data.nickname,
+                        },
+                      });
+                    }}
                   >
-                    我已到店
+                    联系客户
                   </Button>
                 </Div>
               )}
 
-            {data.riderStatus === 'ARRIVE' && (
-              <Div row py={10}>
-                <Div flex={1}>
-                  <Text>我已取货</Text>
-                  <Text fontSize="sm" color="gray600" mt={2} pr={48}>
-                    为避免货物纠纷,请在取货时 检查并拍照存证
-                  </Text>
-                </Div>
-                <Button bg="yellow500" w={112}>
-                  拍照取货
-                </Button>
-              </Div>
-            )}
-
-            {data.riderStatus !== 'NOT_RECEIVED' && (
-              <Div borderTopColor="gray100" borderTopWidth={1} py={10}>
-                <Text fontSize="sm">商家信息</Text>
-                <Div px={10} mt={10}>
-                  <Text fontSize="sm">{data.merchantShowName}</Text>
-                  <Text fontSize="sm" mt={5}>
-                    {data.merchantShowName}
-                  </Text>
-                </Div>
-                <Button block bg="yellow500" mt={15}>
-                  联系商家
-                </Button>
-              </Div>
-            )}
-            {data.riderStatus !== 'NOT_RECEIVED' && (
-              <Div py={15}>
-                <Div row mt={10}>
-                  <Text fontSize="sm" color="gray600">
-                    1.5Km
-                  </Text>
-                  <Div flex={1} ml={12}>
-                    <Text fontSize="md" pb={3}>
-                      {data.merchantShowName}
+              {(statusInfo.type === 'merchant' ||
+                statusInfo.type === 'finish') && (
+                <Div borderTopColor="gray100" borderTopWidth={1} py={10}>
+                  <Text fontSize="sm">商家信息</Text>
+                  <Div px={10} mt={10}>
+                    <Text fontSize="xl" fontWeight="bold">
+                      {data.merShowName}
+                    </Text>
+                    <Text fontSize="sm" mt={5}>
+                      {data.merAddress}
                     </Text>
-                    <Text fontSize="sm">{data.merchantShowName}</Text>
                   </Div>
+                  <Button
+                    block
+                    bg="yellow500"
+                    mt={15}
+                    onPress={() => {
+                      if (!data.muserId) {
+                        toastInfo('该订单缺少商家id,请重新下单');
+                        return;
+                      }
+                      navigation.navigate('NoticeStack', {
+                        screen: 'Chat',
+                        params: {
+                          toUserId: data.muserId,
+                          toUserName: data.merShowName,
+                        },
+                      });
+                    }}
+                  >
+                    联系商家
+                  </Button>
                 </Div>
-                <Div row mt={10}>
-                  <Text fontSize="sm" color="gray600">
-                    1.5Km
-                  </Text>
-                  <Div flex={1} ml={12}>
-                    {data.nickName && (
-                      <Text fontSize="md" pb={5}>
-                        {data.nickName}
+              )}
+              {statusInfo.type === 'order' && (
+                <Div py={15}>
+                  <Div row mt={10}>
+                    <Text fontSize="sm" color="gray600">
+                      1.5Km
+                    </Text>
+                    <Div flex={1} ml={12}>
+                      <Text fontSize="md" pb={3}>
+                        {data.merShowName}
                       </Text>
-                    )}
-                    <Text fontSize="sm">{data.userAddress}</Text>
+                      <Text fontSize="sm">{data.merAddress}</Text>
+                    </Div>
+                  </Div>
+                  <Div row mt={10}>
+                    <Text fontSize="sm" color="gray600">
+                      1.5Km
+                    </Text>
+                    <Div flex={1} ml={12}>
+                      {data.nickName && (
+                        <Text fontSize="md" pb={5}>
+                          {data.nickName}
+                        </Text>
+                      )}
+                      <Text fontSize="sm">{data.userAddress}</Text>
+                    </Div>
                   </Div>
                 </Div>
-              </Div>
-            )}
+              )}
 
-            <Div borderTopColor="gray100" borderTopWidth={1} py={10}>
-              <Div row>
-                <Text fontSize="sm" flex={2}>
-                  商品信息
-                </Text>
-                <Text fontSize="sm" flex={1} textAlign="right">
-                  {totalNum}份
-                </Text>
-                <Text fontSize="sm" flex={1} color="red500" textAlign="right">
-                  ¥{data.totalAmount || 0}
-                </Text>
-              </Div>
+              <Div borderTopColor="gray100" borderTopWidth={1} py={10}>
+                <Div row>
+                  <Text fontSize="sm" flex={2}>
+                    商品信息
+                  </Text>
+                  <Text fontSize="sm" flex={1} textAlign="right">
+                    {totalNum}份
+                  </Text>
+                  <Text fontSize="sm" flex={1} color="red500" textAlign="right">
+                    ¥{data.totalAmount || 0}
+                  </Text>
+                </Div>
 
-              <Div p={15}>
-                {orderGoodsSpecs.map((item) => {
-                  const goods = item.goods;
-                  return (
-                    <Div row key={item.id} mt={5}>
-                      <Text fontSize="sm"> {goods.name}</Text>
-                      <Text fontSize="sm" color="gray500" ml={5}>
-                        {item.specification}
-                      </Text>
-                      <Text fontSize="sm" flex={1} textAlign="right">
-                        X {item.num}
-                      </Text>
-                    </Div>
-                  );
-                })}
+                <Div p={15}>
+                  {orderGoodsSpecs.map((item) => {
+                    const goods = item.goods;
+                    return (
+                      <Div row key={item.id} mt={5}>
+                        <Text fontSize="sm"> {goods.name}</Text>
+                        <Text fontSize="sm" color="gray500" ml={5}>
+                          {item.specification}
+                        </Text>
+                        <Text fontSize="sm" flex={1} textAlign="right">
+                          X {item.num}
+                        </Text>
+                      </Div>
+                    );
+                  })}
+                </Div>
               </Div>
             </Div>
-          </Div>
+            {(statusInfo.type === 'merchant' || statusInfo.type === 'user') && (
+              <Button block mx={15} my={10} bg="yellow500">
+                查看导航
+              </Button>
+            )}
+          </>
         )}
       </ScrollView>
     </Div>

+ 27 - 4
order/OrderScreen.tsx

@@ -1,6 +1,7 @@
 import { StackScreenProps } from '@react-navigation/stack';
 import * as React from 'react';
 import { RefreshControl } from 'react-native';
+import { useFocusEffect } from '@react-navigation/native';
 import { Div, Button, Image, Text, Avatar } from 'react-native-magnus';
 import { FlatList } from 'react-native-gesture-handler';
 import Constants from 'expo-constants';
@@ -27,7 +28,9 @@ export default function OrderScreen({ navigation }: StackScreenProps) {
 
   const { receiverOrder } = useModel(OrderModel, []);
 
-  const [chooseStatus, setChooseStatus] = React.useState<string>('RECEIVED');
+  const [chooseStatus, setChooseStatus] = React.useState<string>(
+    'NOT_RECEIVED'
+  );
   useMount(() => {
     getNowLocation();
   });
@@ -37,14 +40,20 @@ export default function OrderScreen({ navigation }: StackScreenProps) {
     return orderRiderStatus.get(chooseStatus);
   }, [chooseStatus]);
 
-  const { data, loading, reload } = useRequest(
+  useFocusEffect(
+    React.useCallback(() => {
+      run();
+    }, [])
+  );
+
+  const { data, loading, reload, run } = useRequest(
     () => {
       return request.get(chooseStatusInfo.requestUrl, {
         params: chooseStatusInfo.params,
       });
     },
     {
-      refreshDeps: [chooseStatusInfo],
+      manual: false,
       formatResult: chooseStatusInfo.formatResult,
       defaultLoading: false,
       debounceInterval: 1000,
@@ -78,7 +87,10 @@ export default function OrderScreen({ navigation }: StackScreenProps) {
               color={chooseStatus === item ? 'yellow500' : 'black'}
               fontSize="lg"
               py={15}
-              onPress={() => setChooseStatus(item)}
+              onPress={() => {
+                setChooseStatus(item);
+                run();
+              }}
             >
               {t(info.name)}
             </Button>
@@ -124,6 +136,17 @@ export default function OrderScreen({ navigation }: StackScreenProps) {
         refreshControl={
           <RefreshControl refreshing={loading} onRefresh={reload} />
         }
+        ListEmptyComponent={() => {
+          if (!loading) {
+            return (
+              <Text color="gary200" fontSize="sm" textAlign="center" py={20}>
+                暂无数据
+              </Text>
+            );
+          } else {
+            return <></>;
+          }
+        }}
       />
 
       <Div position="absolute" w={0} h={0} bottom={0} left={0} zIndex={0}>

+ 12 - 3
stores/User.ts

@@ -30,7 +30,7 @@ const user = (now) => ({
           userInfo = res;
           return request.get('/rider/my');
         } else {
-          return Promise.reject();
+          return Promise.reject('noRider');
         }
       })
       .then((res) => {
@@ -40,7 +40,9 @@ const user = (now) => ({
         return Promise.resolve();
       })
       .catch((e) => {
-        if (userInfo.id) {
+        if (e === 'noRider') {
+          return Promise.reject('noRider');
+        } else if (userInfo.id) {
           return request.get('/verified/my');
         } else {
           now({
@@ -102,9 +104,16 @@ const user = (now) => ({
     return getUser()
       .catch((id) => {
         const { verifiedInfo, riderInfo } = now();
-        if (id && riderInfo.id) {
+        console.log(id);
+        console.log(verifiedInfo);
+        console.log(riderInfo);
+        if (id === 'noRider') {
+          now({ initialRouteName: 'Login' });
+          return Promise.reject();
+        } else if (id && riderInfo.id) {
           if (riderInfo.status === 'PENDING') {
             now({ initialRouteName: 'AuditResult' });
+            return Promise.reject();
           } else if (riderInfo.status === 'DENY') {
             return getAsyncStorage('seApply');
           } else {

+ 40 - 2
utils/RiderInfoUtils.ts

@@ -88,6 +88,44 @@ const orderRiderStatus = new Map([
   ],
 ]);
 
+const RiderStatusMap = new Map([
+  [
+    'NOT_RECEIVED',
+    {
+      name: '未接单',
+      type: 'order',
+    },
+  ],
+  [
+    'RECEIVED',
+    {
+      name: '已接单,待取餐',
+      type: 'merchant',
+      status: 0,
+    },
+  ],
+  [
+    'ARRIVE',
+    {
+      name: '已到店,待取餐',
+      type: 'merchant',
+      status: 1,
+    },
+  ],
+  [
+    'TAKE_MEAL',
+    {
+      name: '已取餐,配送中',
+      type: 'user',
+    },
+  ],
+  [
+    'CARRY_OUT',
+    {
+      name: '已送达',
+      type: 'finish',
+    },
+  ],
+]);
 
-
-export { RiderMap, riderScore, orderRiderStatus };
+export { RiderMap, riderScore, orderRiderStatus, RiderStatusMap };

+ 2 - 0
utils/SystemUtils.ts

@@ -59,11 +59,13 @@ function toastHide() {
 }
 
 function toastSuccess(title) {
+  console.log(title);
   toastHide();
   if (__DEV__) return;
   Toast.success(title);
 }
 function toastInfo(title) {
+  console.log(title);
   toastHide();
   if (__DEV__) return;
   Toast.message(title);