feat: 细节优化
This commit is contained in:
parent
f833d95dfa
commit
3b99caa72b
@ -175,7 +175,7 @@ export default function OwnerPage() {
|
|||||||
<ThemedText style={styles.headerTitle}>
|
<ThemedText style={styles.headerTitle}>
|
||||||
Top Memory Makers
|
Top Memory Makers
|
||||||
</ThemedText>
|
</ThemedText>
|
||||||
<View className='opacity-0'>123</View>
|
<ThemedText className='opacity-0'>123</ThemedText>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', gap: 16, marginHorizontal: 16 }}>
|
<View style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', gap: 16, marginHorizontal: 16 }}>
|
||||||
<TouchableOpacity onPress={() => { setLocationModalVisible(true) }} style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', gap: 8 }}>
|
<TouchableOpacity onPress={() => { setLocationModalVisible(true) }} style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', gap: 8 }}>
|
||||||
|
|||||||
@ -79,7 +79,7 @@ const styles = StyleSheet.create({
|
|||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
padding: 16,
|
padding: 16,
|
||||||
borderRadius: 12,
|
borderRadius: 24,
|
||||||
zIndex: 2,
|
zIndex: 2,
|
||||||
backgroundColor: '#fff',
|
backgroundColor: '#fff',
|
||||||
},
|
},
|
||||||
|
|||||||
@ -27,16 +27,17 @@ Notifications.setNotificationHandler({
|
|||||||
export const reverseGeocode = async (latitude: number, longitude: number) => {
|
export const reverseGeocode = async (latitude: number, longitude: number) => {
|
||||||
try {
|
try {
|
||||||
const addressResults = await fetchApi<Address[]>(`/area/gecoding?latitude=${latitude}&longitude=${longitude}`);
|
const addressResults = await fetchApi<Address[]>(`/area/gecoding?latitude=${latitude}&longitude=${longitude}`);
|
||||||
console.log('地址:', addressResults);
|
if (Object.keys(addressResults).length === 0) {
|
||||||
for (let address of addressResults) {
|
return null;
|
||||||
console.log('地址:', address);
|
}
|
||||||
|
console.log('地址1:', addressResults);
|
||||||
|
|
||||||
if (Platform.OS === 'web') {
|
if (Platform.OS === 'web') {
|
||||||
localStorage.setItem('location', JSON.stringify(address));
|
localStorage.setItem('location', JSON.stringify(addressResults));
|
||||||
} else {
|
} else {
|
||||||
SecureStore.setItemAsync('location', JSON.stringify(address));
|
SecureStore.setItemAsync('location', JSON.stringify(addressResults));
|
||||||
}
|
|
||||||
return address;
|
|
||||||
}
|
}
|
||||||
|
return addressResults
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('逆地理编码失败:', error);
|
console.log('逆地理编码失败:', error);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user