فهرست منبع

0914处理中

panhui 5 سال پیش
والد
کامیت
ffaaf7fea4

+ 1 - 1
App.tsx

@@ -58,7 +58,7 @@ export default function App() {
                 bottom={50}
                 left={20}
               >
-                骑手端测试版 (0904) 语言包导入
+                骑手端测试版 (0914) 问题列表清理
               </Button>
               <Navigation colorScheme={colorScheme} />
             </Div>

+ 4 - 1
locales/zh-CN.json

@@ -169,5 +169,8 @@
   "yong-hu-shou-dao-shi-jian": "用户收到时间",
   "ben-dan-pai-song-shou-ru": "本单派送收入",
   "shu-ru-zhen-shi-xing-ming": "输入真实姓名",
-  "lu-xian-gui-hua": "路线规划"
+  "lu-xian-gui-hua": "路线规划",
+  "que-ding": "确定",
+  "wu-fa-lian-xi-shang-yong-hu": "无法联系上用户",
+  "yong-hu-ju-qian": "用户拒签"
 }

+ 195 - 0
login/ForgetPsdScreen.tsx

@@ -0,0 +1,195 @@
+import { StackScreenProps } from '@react-navigation/stack';
+import * as React from 'react';
+import {
+  Div,
+  Button,
+  Image,
+  Text,
+  Avatar,
+  Input,
+  Icon,
+  Radio,
+} from 'react-native-magnus';
+import { TextInputMask } from 'react-native-masked-text';
+import { ScrollView } from 'react-native-gesture-handler';
+import { useTranslation } from 'react-i18next';
+
+import { useCreation } from 'ahooks';
+import useModel from 'flooks';
+
+import Login from './model';
+
+import { MainStackParamList } from '../types';
+import { connect } from '../utils/SystemUtils';
+import Navigation from '../navigation/LoginStackNavigator';
+import SmsInput from '../components/SmsInput';
+import { verify } from '../utils/SmsUtil';
+
+export default function ForgetPsdScreen({ navigation }: StackScreenProps) {
+  const { changePsd } = useModel(Login, []);
+
+  const { t } = useTranslation();
+
+  const [phone, setPhone] = React.useState<string>('');
+  const [code, setCode] = React.useState<string>('');
+  const [password, setpassword] = React.useState<string>('');
+  const [password2, setpassword2] = React.useState<string>('');
+
+  const canSubmit = useCreation(() => {
+    if (phone && code && password && password === password2) {
+      return true;
+    } else {
+      return false;
+    }
+  }, [phone, code, password, password2]);
+
+  function submit() {
+    verify(phone, code).then((res) => {
+      console.log(res);
+    });
+  }
+
+  return (
+    <Div bg="gray100" flex={1}>
+      <ScrollView
+        contentContainerStyle={{
+          flexGrow: 1,
+          backgroundColor: '#f2f2f2',
+        }}
+      >
+        <Div
+          bg="white"
+          py={20}
+          px={25}
+          borderTopWidth={5}
+          borderColor="gray100"
+          flex={1}
+        >
+          <Div row alignItems="center" py={10}>
+            <Text w={96} textAlign="right">
+              {t('shou-ji-hao')}:
+            </Text>
+            <Div
+              flex={1}
+              bg="gray100"
+              rounded="sm"
+              px={15}
+              ml={5}
+              h={30}
+              alignItems="stretch"
+            >
+              <TextInputMask
+                type={'custom'}
+                placeholderTextColor="#a6a6a6"
+                px={12}
+                value={phone}
+                keyboardType="numeric"
+                options={{
+                  mask: '999 9999 9999',
+                }}
+                onChangeText={(text) => {
+                  setPhone(text);
+                }}
+                style={{ flex: 1, fontSize: 14 }}
+                placeholder={t('shu-ru-shou-ji-hao')}
+              />
+
+              {__DEV__ && (
+                <Input
+                  onChangeText={(text) => {
+                    setPhone(text);
+                  }}
+                />
+              )}
+            </Div>
+          </Div>
+          <SmsInput phone={phone} onCodeChange={setCode} />
+
+          <Div row alignItems="center" py={10}>
+            <Text w={96} textAlign="right">
+              {t('mi-ma')}:
+            </Text>
+            <Input
+              flex={1}
+              bg="gray100"
+              rounded="sm"
+              loaderColor="gray400"
+              px={12}
+              ml={5}
+              h={30}
+              type={'custom'}
+              value={password}
+              borderWidth={0}
+              fontSize="md"
+              secureTextEntry
+              opacity={1}
+              loaderColor="gray400"
+              color="gray900"
+              onChangeText={(text) => {
+                setpassword(text);
+              }}
+              style={{ flex: 1 }}
+              placeholder={t('shu-ru-mi-ma')}
+            />
+          </Div>
+          <Div row alignItems="center" py={10}>
+            <Text w={96} textAlign="right">
+              {t('que-ren-mi-ma')}:
+            </Text>
+            <Input
+              flex={1}
+              bg="gray100"
+              rounded="sm"
+              px={12}
+              ml={5}
+              h={30}
+              type={'custom'}
+              value={password2}
+              borderWidth={0}
+              fontSize="md"
+              secureTextEntry
+              opacity={1}
+              loaderColor="gray400"
+              color="gray900"
+              onChangeText={(text) => {
+                setpassword2(text);
+              }}
+              style={{ flex: 1 }}
+              placeholder={t('zai-ci-shu-ru-que-ren-mi-ma')}
+            />
+          </Div>
+
+          <Button
+            w={112}
+            bg="yellow500"
+            alignSelf="center"
+            fontSize="sm"
+            my={20}
+            disabled={!canSubmit}
+            onPress={() =>
+              changePsd(phone, code, password, () => {
+                navigation.goBack();
+              })
+            }
+          >
+            {t('que-ding')}
+          </Button>
+
+          <Button
+            w={112}
+            color="yellow500"
+            bg="none"
+            borderColor="gray100"
+            borderWidth={1}
+            alignSelf="center"
+            fontSize="sm"
+            my={20}
+            onPress={() => connect(navigation)}
+          >
+            {t('lian-xi-ke-fu')}
+          </Button>
+        </Div>
+      </ScrollView>
+    </Div>
+  );
+}

+ 17 - 6
login/LoginScreen.tsx

@@ -93,7 +93,7 @@ function LoginByPsd() {
   const loginModel = useModel(Login, []);
 
   return (
-    <Div bg="white">
+    <Div bg="white" h="100%">
       <Div row alignItems="center" py={10}>
         <Text w={96} textAlign="right">
           {t('shou-ji-hao')}:
@@ -120,7 +120,7 @@ function LoginByPsd() {
             }}
             style={{ flex: 1, fontSize: 14 }}
             placeholderTextColor="#a6a6a6"
-            placeholder={t('shu-ru-shang-jia-ming-cheng')}
+            placeholder={t('shu-ru-shou-ji-hao')}
           />
           {__DEV__ && (
             <Input
@@ -202,8 +202,9 @@ function LoginByCode() {
   const [phone, setphone] = React.useState<string>('');
   const [code, setCode] = React.useState<string>('');
   const loginModel = useModel(Login, []);
+  const navigation = useNavigation();
   return (
-    <Div bg="white">
+    <Div bg="white" h="100%">
       <Div row alignItems="center" py={10}>
         <Text w={96} textAlign="right">
           {t('shou-ji-hao')}:
@@ -245,10 +246,20 @@ function LoginByCode() {
       <SmsInput phone={phone} onCodeChange={setCode} type="login" />
 
       <Div row justifyContent="space-between" pl={90}>
-        <Button color="gray400" fontSize="sm" bg="white">
+        {/* <Button
+          color="gray400"
+          fontSize="sm"
+          bg="white"
+          onPress={() => navigation.navigate('ForgetPsd')}
+        >
           {t('wang-ji-mi-ma')}
-        </Button>
-        <Button color="gray400" fontSize="sm" bg="white">
+        </Button> */}
+        <Button
+          color="gray400"
+          fontSize="sm"
+          bg="white"
+          onPress={() => navigation.navigate('Register')}
+        >
           {t('qi-shou-zhu-ce')}
         </Button>
       </Div>

+ 22 - 1
login/model.ts

@@ -69,12 +69,33 @@ const MapModel = (now) => ({
         toastInfo(e.error);
       });
   },
+  changePsd(phone, code, password, back) {
+    toastShow();
+    return request
+      .post('/user/changePassword', {
+        params: {
+          password,
+          key: '+86' + submitPhone(phone),
+          code,
+          identity: 'RIDER',
+        },
+      })
+      .then(() => {
+        toastSuccess('修改成功');
+        if (back) {
+          back();
+        }
+      })
+      .catch((e) => {
+        toastInfo(e.error);
+      });
+  },
   loginByRegister(phone, password) {
     toastShow();
     return request
       .post('/auth/loginByRegister', {
         data: {
-          phone: phone,
+          phone: submitPhone(phone),
           password,
           identity: 'RIDER',
         },

+ 28 - 6
mine/MineInfoScreen.tsx

@@ -69,13 +69,35 @@ export default function MineInfoScreen({ navigation }: StackScreenProps) {
             <Icon ml={5} name="right" fontSize="sm" />
           </Div>
         </Button>
-        <Div mb={10} row bg="white" row h={55} alignItems="center" px={15}>
-          <Text flex={1} fontSize="sm">
-            {t('geng-gai-mi-ma')}:
-          </Text>
 
-          <Icon ml={5} name="right" fontSize="sm" />
-        </Div>
+        <Button
+          mb={10}
+          bg="transparent"
+          p={0}
+          block
+          onPress={() => {
+            navigation.navigate('LoginStack', {
+              screen: 'ForgetPsd',
+            });
+          }}
+        >
+          <Div
+            flex={1}
+            mb={10}
+            row
+            bg="white"
+            row
+            h={55}
+            alignItems="center"
+            px={15}
+          >
+            <Text flex={1} fontSize="sm">
+              {t('geng-gai-mi-ma')}:
+            </Text>
+
+            <Icon ml={5} name="right" fontSize="sm" />
+          </Div>
+        </Button>
         <Div bg="white" px={15}>
           <Div
             row

+ 156 - 0
modals/ApplayRefundModalScreen.tsx

@@ -0,0 +1,156 @@
+import { StackScreenProps } from '@react-navigation/stack';
+import * as React from 'react';
+import * as Animatable from 'react-native-animatable';
+import {
+  Div,
+  Button,
+  RadioGroup,
+  Radio,
+  Image,
+  Text,
+  Avatar,
+  Input,
+} from 'react-native-magnus';
+import { ScrollView } from 'react-native-gesture-handler';
+import { useTranslation } from 'react-i18next';
+import Request from '../utils/RequestUtils';
+import { toastInfo, toastSuccess } from '../utils/SystemUtils';
+
+const ReasonMap = new Map([
+  [
+    'RIDER_CANNOT_REACH_USER',
+    {
+      name: 'wu-fa-lian-xi-shang-yong-hu',
+    },
+  ],
+  [
+    'DO_NOT_WANT_SOMETHING_TEMPORARILY',
+    {
+      name: 'yong-hu-ju-qian',
+    },
+  ],
+  [
+    'OTHER',
+    {
+      name: 'qi-ta',
+      hasInput: true,
+    },
+  ],
+]);
+
+export default function ApplayRefundModalScreen({
+  navigation,
+  route,
+}: StackScreenProps) {
+  const { params } = route;
+  const { orderId } = params || {};
+  const { t } = useTranslation();
+
+  const [reason, setReason] = React.useState<string>('RIDER_CANNOT_REACH_USER');
+  const [extra, setExtra] = React.useState<string>('');
+
+  const inRef = React.useRef();
+
+  return (
+    <Div flex={1} bg="black600" alignItems="center" justifyContent="center">
+      <Animatable.View animation="slideInUp" duration={300}>
+        <Div bg="white" p={10} rounded="sm" minW={287}>
+          <Text fontSize="xl" fontWeight="bold" textAlign="center">
+            取消订单申请
+          </Text>
+
+          <Div px={10} py={10}>
+            <RadioGroup
+              value={reason}
+              onChange={(value: any) => {
+                if (value !== 'OTHER') {
+                  setExtra('');
+                }
+                setReason(value);
+              }}
+            >
+              {[...ReasonMap.keys()].map((item, index) => {
+                let info = ReasonMap.get(item);
+                return (
+                  <Radio
+                    value={item}
+                    key={index}
+                    activeColor="yellow500"
+                    inactiveColor="gray300"
+                    pr={20}
+                    my={5}
+                  >
+                    <Text ml={6} fontSize="sm" color="black">
+                      {t(info.name)}
+                    </Text>
+
+                    {info.hasInput && (
+                      <Input
+                        w={96}
+                        h={25}
+                        opacity={1}
+                        loaderColor="gray400"
+                        color="gray900"
+                        fontSize="sm"
+                        value={extra}
+                        onChangeText={setExtra}
+                        ml={5}
+                        bg="gray100"
+                      />
+                    )}
+                  </Radio>
+                );
+              })}
+            </RadioGroup>
+          </Div>
+          <Text color="gray500" textAlign="right" fontSize="xs">
+            (作为责任评判的依据之一,请如实填写)
+          </Text>
+          <Div row py={10} mt={10}>
+            <Button
+              flex={1}
+              mx={3}
+              rounded="xs"
+              bg="white"
+              color="black"
+              borderWidth={1}
+              borderColor="yellow500"
+              fontSize="sm"
+              onPress={() => navigation.goBack()}
+            >
+              {t('qu-xiao')}
+            </Button>
+            <Button
+              flex={1}
+              mx={3}
+              rounded="xs"
+              bg="yellow500"
+              fontSize="sm"
+              onPress={() => {
+                Request.get('/orderRefundApply/apply', {
+                  params: {
+                    orderId,
+                    reason,
+                    remark: extra,
+                    img: '',
+                  },
+                })
+                  .then((res) => {
+                    toastSuccess('申请提交成功');
+                  })
+                  .catch((e) => {
+                    toastInfo(e.error);
+                  })
+                  .finally(() => {
+                    navigation.goBack();
+                  });
+              }}
+            >
+              {t('que-ren')}
+            </Button>
+          </Div>
+        </Div>
+      </Animatable.View>
+    </Div>
+  );
+}

+ 8 - 0
navigation/LoginStackNavigator.tsx

@@ -20,6 +20,8 @@ import TransportationScreen from '../login/TransportationScreen';
 import ApplyLocationScreen from '../login/ApplyLocationScreen';
 import AuditResultScreen from '../login/AuditResultScreen';
 
+import ForgetPsdScreen from '../login/ForgetPsdScreen';
+
 //地图模块
 import SearchMapScreen from '../map/SearchMapScreen';
 
@@ -102,6 +104,12 @@ export default function Navigation({
         options={{ title: t('xuan-ze-di-dian') }}
         component={SearchMapScreen}
       />
+
+      <MainStack.Screen
+        name="ForgetPsd"
+        options={{ title: '找回密码' }}
+        component={ForgetPsdScreen}
+      />
     </MainStack.Navigator>
   );
 }

+ 7 - 0
navigation/ModalStackNavigator.tsx

@@ -16,6 +16,7 @@ import { MineStackParamList } from '../types';
 
 import AlertModalScreen from '../modals/AlertModalScreen';
 import InputModalScreen from '../modals/InputModalScreen';
+import ApplayRefundModalScreen from '../modals/ApplayRefundModalScreen';
 
 const ModalStack = createStackNavigator<MineStackParamList>();
 export default function Navigation({
@@ -32,9 +33,15 @@ export default function Navigation({
         animationEnabled: false,
         headerShown: false,
       }}
+      initialRouteName="Applay"
     >
       <ModalStack.Screen name="Alert" component={AlertModalScreen} />
       <ModalStack.Screen name="Promot" component={InputModalScreen} />
+      <ModalStack.Screen
+        name="Applay"
+        component={ApplayRefundModalScreen}
+        initialParams={{ orderId: 3046 }}
+      />
     </ModalStack.Navigator>
   );
 }

+ 1 - 1
navigation/OrderStackNavigator.tsx

@@ -49,7 +49,7 @@ export default function Navigation({
         name="OrderDetail"
         component={OrderDetailScreen}
         options={{ title: t('ding-dan-xiang-qing') }}
-        initialParams={{ orderId: 2077 }}
+        initialParams={{ orderId: 3076 }}
       />
       <OrderStack.Screen
         name="OrderMap"

+ 2 - 2
navigation/index.tsx

@@ -48,8 +48,8 @@ export default function Navigation({
   const initRoute = useCreation(() => {
     // if (__DEV__) {
     //   return {
-    //     name: 'NoticeStack',
-    //     screen: 'EmailDetail',
+    // 		name: 'Modal',
+    // 		screen:'OrderDetail'
     //   };
     // } else {
     return {

+ 56 - 7
order/OrderCom.tsx

@@ -1,6 +1,7 @@
 import * as React from 'react';
 import { Div, Button, Image, Text, Avatar } from 'react-native-magnus';
 import { useTranslation } from 'react-i18next';
+import { RiderStatusMap } from '../utils/RiderInfoUtils';
 
 export default function OrderCom({
   info,
@@ -23,7 +24,7 @@ export default function OrderCom({
   } = info;
 
   const { t } = useTranslation();
-
+  const orderStatusInfo = RiderStatusMap.get(riderStatus);
   return (
     <Button bg="white" p={0} block mb={15} onPress={goDetail}>
       <Div flex={1}>
@@ -43,29 +44,77 @@ export default function OrderCom({
               {deliveryAmount}
             </Text>
           </Div>
+          {orderStatusInfo.type === 'merchant' && (
+            <Text fontSize="xl" color="black" fontWeight="bold" pt={2}>
+              {t('liu-shui-hao')}:{info.id}
+            </Text>
+          )}
+
           <Div row mt={10}>
-            <Text fontSize="sm" color="gray600">
+            <Text
+              fontSize={orderStatusInfo.type === 'merchant' ? 'xl' : 'sm'}
+              color={orderStatusInfo.type === 'merchant' ? 'black' : 'gray500'}
+              fontWeight={
+                orderStatusInfo.type === 'merchant' ? 'bold' : 'normal'
+              }
+            >
               1.5Km
             </Text>
             <Div flex={1} ml={12}>
-              <Text fontSize="sm" pb={3}>
+              <Text
+                fontSize={orderStatusInfo.type === 'merchant' ? 'xl' : 'sm'}
+                color={
+                  orderStatusInfo.type === 'merchant' ? 'black' : 'gray600'
+                }
+                fontWeight={
+                  orderStatusInfo.type === 'merchant' ? 'bold' : 'normal'
+                }
+                pb={3}
+              >
                 {merShowName}
               </Text>
-              <Text fontSize="xs">{merAddress}</Text>
+              <Text
+                fontSize={orderStatusInfo.type === 'merchant' ? 'lg' : 'xs'}
+                color={
+                  orderStatusInfo.type === 'merchant' ? 'black' : 'gray600'
+                }
+                fontWeight={
+                  orderStatusInfo.type === 'merchant' ? 'bold' : 'normal'
+                }
+              >
+                {merAddress}
+              </Text>
             </Div>
           </Div>
           <Div row mt={10}>
-            <Text fontSize="sm" color="gray600">
+            <Text
+              fontSize={orderStatusInfo.type === 'user' ? 'xl' : 'sm'}
+              color={orderStatusInfo.type === 'user' ? 'black' : 'gray500'}
+              fontWeight={orderStatusInfo.type === 'user' ? 'bold' : 'normal'}
+            >
               1.5Km
             </Text>
             <Div flex={1} ml={12}>
               {user.nickName && (
-                <Text fontSize="sm" pb={5}>
+                <Text
+                  fontSize={orderStatusInfo.type === 'user' ? 'xl' : 'sm'}
+                  color={orderStatusInfo.type === 'user' ? 'black' : 'gray500'}
+                  fontWeight={
+                    orderStatusInfo.type === 'user' ? 'bold' : 'normal'
+                  }
+                  pb={5}
+                >
                   {user.nickName}
                 </Text>
               )}
 
-              <Text fontSize="xs">{userAddress}</Text>
+              <Text
+                fontSize={orderStatusInfo.type === 'user' ? 'lg' : 'xs'}
+                color={orderStatusInfo.type === 'user' ? 'black' : 'gray500'}
+                fontWeight={orderStatusInfo.type === 'user' ? 'bold' : 'normal'}
+              >
+                {userAddress}
+              </Text>
             </Div>
           </Div>
         </Div>

+ 160 - 23
order/OrderDetailScreen.tsx

@@ -1,9 +1,10 @@
 import { StackScreenProps } from '@react-navigation/stack';
 import * as React from 'react';
-import { Div, Button, Image, Text, Avatar } from 'react-native-magnus';
+import { Div, Button, Image, Text, Avatar, Icon } from 'react-native-magnus';
+import { Menu } from 'teaset';
 import { ScrollView } from 'react-native-gesture-handler';
-import { useRequest, useCreation } from 'ahooks';
-import { RefreshControl } from 'react-native';
+import { useRequest, useCreation, useMount } from 'ahooks';
+import { RefreshControl, Dimensions } from 'react-native';
 import { toastInfo, toastSuccess, alert } from '../utils/SystemUtils';
 
 import { RiderStatusMap } from '../utils/RiderInfoUtils';
@@ -16,6 +17,17 @@ import { useSafeArea } from 'react-native-safe-area-context';
 
 import { changeCord, goMap } from '../utils/MapUtils';
 
+import { connect } from '../utils/SystemUtils';
+
+import Request from '../utils/RequestUtils';
+
+function RightMenuItem({ text = '' }) {
+  return (
+    <Text fontSize="sm" color="black">
+      {text}
+    </Text>
+  );
+}
 export default function OrderDetailScreen({
   navigation,
   route,
@@ -31,15 +43,69 @@ export default function OrderDetailScreen({
     []
   );
 
+  navigation.setOptions({
+    headerRight: (props) => (
+      <Button
+        bg="none"
+        px={15}
+        py={0}
+        w={50}
+        h={50}
+        onPress={() => {
+          const x = Dimensions.get('window').width - 80,
+            y = 0,
+            width = 50,
+            height = 50;
+          let items = [
+            {
+              title: '联系客服',
+              onPress: () => connect(navigation),
+            },
+          ];
+          if (!isRefund && statusInfo.type && statusInfo.type !== 'order') {
+            items.splice(0, 0, {
+              title: '取消订单申请',
+              onPress: () => {
+                navigation.navigate('Modal', {
+                  screen: 'Applay',
+                  params: {
+                    orderId,
+                  },
+                });
+              },
+            });
+          }
+          Menu.show({ x, y, width, height }, items, {
+            popoverStyle: {
+              backgroundColor: '#fff',
+            },
+          });
+        }}
+      >
+        <Icon
+          name="more-horizontal"
+          color="white"
+          fontFamily="Feather"
+          fontSize="lg"
+        ></Icon>
+      </Button>
+    ),
+  });
+
   const { data, loading, reload, run } = useRequest(
     `/orderInfo/get/${orderId}`,
     {
+      manual: true,
       defaultLoading: false,
       debounceInterval: 1000,
       initialData: {},
     }
   );
 
+  useMount(() => {
+    run();
+  });
+
   const orderGoodsSpecs = useCreation(() => {
     return data.orderGoodsSpecs || [];
   }, [data]);
@@ -58,6 +124,14 @@ export default function OrderDetailScreen({
     }, 0);
   }, [orderGoodsSpecs]);
 
+  const isRefund = useCreation(() => {
+    if (data.status === 'REFUNDED_PENDING') {
+      return true;
+    } else {
+      return false;
+    }
+  }, [data]);
+
   function orderChange() {
     alert(navigation, {
       msg: statusInfo.infoText,
@@ -91,8 +165,26 @@ export default function OrderDetailScreen({
 
   return (
     <Div bg="gray100" flex={1}>
+      {/* <ModalDropdown ref={menu} options={['option 1', 'option 2']} /> */}
       {statusInfo.type && statusInfo.type !== 'order' && (
         <Div row bg="white" py={12}>
+          {__DEV__ &&
+            !isRefund &&
+            statusInfo.type &&
+            statusInfo.type !== 'order' && (
+              <Button
+                onPress={() => {
+                  navigation.navigate('Modal', {
+                    screen: 'Applay',
+                    params: {
+                      orderId,
+                    },
+                  });
+                }}
+              >
+                取消订单
+              </Button>
+            )}
           <Div flex={1} alignItems="center">
             <Text fontSize="xl" color="red500">
               {data.deliveryAmount}
@@ -300,7 +392,7 @@ export default function OrderDetailScreen({
                     {t('fen')}
                   </Text>
                   <Text fontSize="sm" flex={1} color="red500" textAlign="right">
-                    ¥{data.totalAmount || 0}
+                    ¥{data.realAmount || 0}
                   </Text>
                 </Div>
 
@@ -338,26 +430,71 @@ export default function OrderDetailScreen({
                 </Button>
               )}
             </Div>
-            {(statusInfo.type === 'merchant' || statusInfo.type === 'user') && (
-              <Button
-                block
-                mx={15}
-                my={10}
-                bg="yellow500"
-                onPress={() => {
-                  goMap(
-                    statusInfo.type === 'merchant'
-                      ? data.merShowName
-                      : data.userAddress,
-                    statusInfo.type === 'merchant'
-                      ? changeCord(data.merLocation)
-                      : changeCord(data.location),
-                    navigation
-                  );
-                }}
+
+            <Div h={35} w="100%" />
+
+            {(statusInfo.type === 'merchant' || statusInfo.type === 'user') &&
+              !isRefund && (
+                <Div position="absolute" bottom={0} left={0} right={0}>
+                  <Button
+                    block
+                    mx={15}
+                    my={10}
+                    bg="yellow500"
+                    onPress={() => {
+                      goMap(
+                        statusInfo.type === 'merchant'
+                          ? data.merShowName
+                          : data.userAddress,
+                        statusInfo.type === 'merchant'
+                          ? changeCord(data.merLocation)
+                          : changeCord(data.location),
+                        navigation
+                      );
+                    }}
+                  >
+                    {t('cha-kan-dao-hang')}
+                  </Button>
+                </Div>
+              )}
+
+            {isRefund && (
+              <Div
+                row
+                position="absolute"
+                bottom={0}
+                left={0}
+                right={0}
+                px={15}
+                py={10}
               >
-                {t('cha-kan-dao-hang')}
-              </Button>
+                <Button flex={1} bg="gray300" disabled>
+                  订单申请取消中
+                </Button>
+                <Button
+                  w={105}
+                  ml={5}
+                  bg="yellow500"
+                  onPress={() => {
+                    Request.get('/orderRefundApply/cancel', {
+                      params: {
+                        orderId,
+                      },
+                    })
+                      .then((res) => {
+                        toastSuccess('取消成功');
+                      })
+                      .catch((e) => {
+                        toastInfo(e.error);
+                      })
+                      .finally(() => {
+                        run();
+                      });
+                  }}
+                >
+                  撤销申请
+                </Button>
+              </Div>
             )}
           </>
         )}

+ 5 - 2
order/OrderScreen.tsx

@@ -16,10 +16,9 @@ import { useTranslation } from 'react-i18next';
 
 import moment from 'moment';
 
-import { promot } from '../utils/SystemUtils';
+import { promot, toastSuccess, alert, toastInfo } from '../utils/SystemUtils';
 import { orderRiderStatus, RiderStatusMap } from '../utils/RiderInfoUtils';
 import request from '../utils/RequestUtils';
-import { toastSuccess, alert } from '../utils/SystemUtils';
 import { goMap, changeCord } from '../utils/MapUtils';
 
 import OrderCom from './OrderCom';
@@ -162,6 +161,10 @@ export default function OrderScreen({ navigation }: StackScreenProps) {
               receiverOrder={() => {
                 receiverOrder(item.id, (res) => {
                   toastSuccess(t('jie-dan-cheng-gong'));
+                  run();
+                }).catch((res) => {
+                  toastInfo('该订单异常暂不能接单');
+                  run();
                 });
               }}
               goMap={() => {

+ 5 - 0
package-lock.json

@@ -13226,6 +13226,11 @@
         "tinymask": "1.0.2"
       }
     },
+    "react-native-material-menu": {
+      "version": "1.1.3",
+      "resolved": "https://registry.npmjs.org/react-native-material-menu/-/react-native-material-menu-1.1.3.tgz",
+      "integrity": "sha512-/4j47dWP7x0laIYKkbKxgaG2663u8o02+OrNe4Qpdmmt9KrBAuAaU3wMpry1WC/ECh6ZjnACJYx0s06mSvdOlA=="
+    },
     "react-native-modal": {
       "version": "11.5.6",
       "resolved": "https://registry.npmjs.org/react-native-modal/-/react-native-modal-11.5.6.tgz",

+ 1 - 0
package.json

@@ -53,6 +53,7 @@
     "react-native-gifted-chat": "^0.16.3",
     "react-native-magnus": "^1.0.40",
     "react-native-masked-text": "^1.13.0",
+    "react-native-material-menu": "^1.1.3",
     "react-native-modal": "^11.5.6",
     "react-native-reanimated": "~1.9.0",
     "react-native-safe-area-context": "~3.0.7",

+ 4 - 1
stores/User.ts

@@ -102,10 +102,13 @@ const user = (now) => ({
         toastInfo(e.error);
       });
   },
-  getInit() {
+  getInit(back) {
     const { getUser } = now();
     return getUser()
       .catch((id) => {
+        if (back) {
+          back(id);
+        }
         const { verifiedInfo, riderInfo } = now();
         console.log(id);
         console.log(verifiedInfo);

+ 16 - 1
utils/SmsUtil.ts

@@ -1,4 +1,5 @@
 import request from './RequestUtils';
+import { toastInfo } from './RequestUtils';
 
 const templateMap = new Map([
   [
@@ -44,4 +45,18 @@ function sendSms(phone, type) {
   });
 }
 
-export { sendSms, submitPhone };
+function verify(phone, code) {
+  return request
+    .get('/sms/verify', {
+      params: {
+        phone: `+86${submitPhone(phone)}`,
+        code,
+      },
+    })
+    .catch((e) => {
+      toastInfo(e.error);
+      return;
+    });
+}
+
+export { sendSms, submitPhone, verify };

+ 1 - 1
utils/SystemUtils.ts

@@ -87,5 +87,5 @@ export {
   toastSuccess,
   getMoney,
   alert,
-  PopoverPicker,
+  // PopoverPicker,
 };