|
|
@@ -0,0 +1,100 @@
|
|
|
+import * as WebBrowser from 'expo-web-browser';
|
|
|
+import * as React from 'react';
|
|
|
+import { StyleSheet, View, FlatList, Image } from 'react-native';
|
|
|
+import { Flex } from '@ant-design/react-native';
|
|
|
+
|
|
|
+import Header from './Header'; // 头部
|
|
|
+
|
|
|
+import Text from '../../components/Text';
|
|
|
+import Button from '../../components/Button';
|
|
|
+
|
|
|
+export default function OrderScreen() {
|
|
|
+ const [orderList, setorderList] = React.useState([{ id: 1, name: '订单1' }]);
|
|
|
+
|
|
|
+ return (
|
|
|
+ <>
|
|
|
+ <Header />
|
|
|
+
|
|
|
+ <FlatList
|
|
|
+ contentContainerStyle={styles.list}
|
|
|
+ data={orderList}
|
|
|
+ renderItem={({ item }) => <Item name={item.name} />}
|
|
|
+ keyExtractor={(item) => item.id}
|
|
|
+ />
|
|
|
+ </>
|
|
|
+ );
|
|
|
+}
|
|
|
+
|
|
|
+// 订单组件
|
|
|
+function Item({ name }) {
|
|
|
+ return (
|
|
|
+ <View style={styles.item}>
|
|
|
+ <Flex align="start">
|
|
|
+ <Image
|
|
|
+ style={styles.icon}
|
|
|
+ resizeMode="cover"
|
|
|
+ source={{ uri: 'https://picsum.photos/700' }}
|
|
|
+ />
|
|
|
+ <Flex.Item style={styles.main}>
|
|
|
+ <Flex>
|
|
|
+ <Flex.Item>
|
|
|
+ <Text size="s1" bold>
|
|
|
+ 麦当劳
|
|
|
+ </Text>
|
|
|
+ </Flex.Item>
|
|
|
+ <Text size="c2">预计14:26送达</Text>
|
|
|
+ </Flex>
|
|
|
+ <Text size="c2" style={{ marginTop: 10 }}>
|
|
|
+ 订单时间:2019-05-21
|
|
|
+ </Text>
|
|
|
+ <Flex style={styles.orderDetail}>
|
|
|
+ <Text size="c1">订单商品</Text>
|
|
|
+ <Flex.Item>
|
|
|
+ <Text size="c2">大鸡腿等3件</Text>
|
|
|
+ </Flex.Item>
|
|
|
+ <Text size="c2">¥9999.99</Text>
|
|
|
+ </Flex>
|
|
|
+ </Flex.Item>
|
|
|
+ </Flex>
|
|
|
+ <Image
|
|
|
+ style={{ height: 200 }}
|
|
|
+ resizeMode="cover"
|
|
|
+ source={{ uri: 'https://picsum.photos/700' }}
|
|
|
+ />
|
|
|
+ <Flex justify="end" style={styles.btns}>
|
|
|
+ <Button outline size="small" fontColor="#000">
|
|
|
+ 联系商家
|
|
|
+ </Button>
|
|
|
+ </Flex>
|
|
|
+ </View>
|
|
|
+ );
|
|
|
+}
|
|
|
+
|
|
|
+const styles = StyleSheet.create({
|
|
|
+ item: {
|
|
|
+ paddingVertical: 20,
|
|
|
+ paddingHorizontal: 10,
|
|
|
+ backgroundColor: '#fff',
|
|
|
+ borderRadius: 3,
|
|
|
+ },
|
|
|
+ list: {
|
|
|
+ padding: 15,
|
|
|
+ },
|
|
|
+ icon: {
|
|
|
+ width: 53,
|
|
|
+ height: 53,
|
|
|
+ borderRadius: 3,
|
|
|
+ },
|
|
|
+ main: {
|
|
|
+ marginLeft: 5,
|
|
|
+ },
|
|
|
+ orderDetail: {
|
|
|
+ paddingVertical: 10,
|
|
|
+ borderTopWidth: 1,
|
|
|
+ borderColor: '#E5E5E5',
|
|
|
+ marginTop: 10,
|
|
|
+ },
|
|
|
+ btns: {
|
|
|
+ paddingTop: 15,
|
|
|
+ },
|
|
|
+});
|