diff --git a/src/views/Home/MiniMap.tsx b/src/views/Home/MiniMap.tsx index 715dbd8..9bb3bc0 100644 --- a/src/views/Home/MiniMap.tsx +++ b/src/views/Home/MiniMap.tsx @@ -106,6 +106,7 @@ const styles = StyleSheet.create({ justifyContent: 'space-between', alignItems: 'center', padding: rpx(24), + paddingTop: rpx(-20), height: '100%', }, cont_left: { diff --git a/src/views/HomeStackNavigator.tsx b/src/views/HomeStackNavigator.tsx index d10b7e6..8d37b46 100644 --- a/src/views/HomeStackNavigator.tsx +++ b/src/views/HomeStackNavigator.tsx @@ -12,6 +12,7 @@ import UnlockSetting from './device/UnlockSetting'; import BleDistance from './device/BleDistance'; import DeviceShare from './device/DeviceShare'; import AddShare from './device/AddShare'; +import ShareQrcode from './device/shareQrcode'; // import BleBind from './bind/ble_bind'; import { getFocusedRouteNameFromRoute } from '@react-navigation/native'; @@ -27,6 +28,7 @@ type RootStackParamList = { UnlockSetting: undefined; DeviceShare: undefined; AddShare: undefined; + ShareQrcode: undefined; }; const Stack = createStackNavigator(); @@ -54,12 +56,12 @@ type Props = { export default function HomeStackNavigator({ navigation, route }: Props) { React.useEffect(() => { const routeName = getFocusedRouteNameFromRoute(route) ?? 'Home'; - const hideTabBarRoutes = ['DeviceList', 'BindIndex', 'SnBind', 'BleBind', 'ConfirmBind', 'DeviceMap', 'DeviceSet', 'UnlockSetting', 'BleDistance', 'DeviceShare']; // 添加新的路由名 - const shouldHideTabBar = hideTabBarRoutes.includes(routeName); + + - navigation.getParent()?.setOptions({ - tabBarStyle: shouldHideTabBar ? { display: 'none' } : undefined - }); + // navigation.getParent()?.setOptions({ + // tabBarStyle: shouldHideTabBar ? { display: 'none' } : undefined + // }); }, [navigation, route]); @@ -122,6 +124,11 @@ export default function HomeStackNavigator({ navigation, route }: Props) { component={AddShare} options={createScreenOptions('添加共享人')} /> + ); } \ No newline at end of file diff --git a/src/views/device/AddShare.tsx b/src/views/device/AddShare.tsx index 6e69e48..7f0fcec 100644 --- a/src/views/device/AddShare.tsx +++ b/src/views/device/AddShare.tsx @@ -1,8 +1,9 @@ import React, { useState } from 'react'; import { View, Text, StyleSheet, Image, TextInput, TouchableWithoutFeedback, Keyboard, TouchableOpacity, Modal } from 'react-native'; import { rpx } from '../../utils/rpx'; - +import { useNavigation } from '@react-navigation/native'; const AddShare = () => { + const navigation = useNavigation(); const [phone, setPhone] = useState(''); const [name, setName] = useState(''); const [time, setTime] = useState(''); @@ -12,6 +13,12 @@ const AddShare = () => { const [allowBleLocation, setAllowBleLocation] = useState(true); const handlePress = () => { setShowTimeModal(true); + } + const handleSubmit = () => { + navigation.navigate('ShareQrcode' as never); + } + const handlePhone = () => { + } return ( @@ -23,10 +30,13 @@ const AddShare = () => { value={phone} onChangeText={setPhone} /> + + + { /> - setShowBleInfo(true)}> - - - 上次蓝牙连接位置 - - {allowBleLocation ? '允许' : '不允许'} - - - + + + 确定 - - - - - - 是否允许租赁人查看{'\n'}上次蓝牙连接位置 - - - - setAllowBleLocation(true)} - > - 允许 - - {allowBleLocation && } - - - - - setAllowBleLocation(false)} - > - 不允许 - - {!allowBleLocation && } - - - - - - setShowBleInfo(false)} - > - 确定 - - - - { } const styles = StyleSheet.create({ + submitButton: { + width: rpx(688), + height: rpx(88), + backgroundColor: '#4297F3', + borderRadius: rpx(16), + justifyContent: 'center', + alignItems: 'center', + marginTop: rpx(50), + }, + submitButtonText: { + fontSize: rpx(32), + color: '#fff', + fontWeight: '500', + }, container: { flex: 1, backgroundColor: '#F3FCFF',