import * as WebBrowser from 'expo-web-browser'; import * as React from 'react'; import { Div, Button, Image, Text, Avatar } from 'react-native-magnus'; import { Flex, SwipeAction } from '@ant-design/react-native'; import { ScrollView } from 'react-native-gesture-handler'; import { useTranslation } from 'react-i18next'; import { useRequest, useCreation } from '@umijs/hooks'; import useModel from 'flooks'; import AddressModel from './model'; // detail模块通用方法 import Header from '../../components/Header'; const AddressItem = ({ info, goNext, del }) => { const { t } = useTranslation(); const right = [ { text: t('shan-chu'), onPress: () => { console.log('删除'); del(); }, style: { backgroundColor: 'red', color: 'white' }, }, ]; return (
{info.addressName}
{info.name} {info.sex} {info.phone}
{info.isDefault && ( )}
); }; export default function AddressScreen({ navigation }) { const { t } = useTranslation(); const { addressList, getAddressList, delAddress } = useModel(AddressModel, [ 'addressList', ]); const addressRequest = useRequest(getAddressList); return ( <>
{addressList.map((item) => { return ( { delAddress(item.id); }} goNext={() => { navigation.navigate('EditAddress', { id: item.id, }); }} /> ); })} ); }