Skip to content

Commit

Permalink
Merge pull request #109 from p33a33/listEntryModifying
Browse files Browse the repository at this point in the history
orderList view fixed
  • Loading branch information
kyugshim authored Nov 2, 2020
2 parents 3b1602e + 7cfa305 commit 1faae87
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
13 changes: 6 additions & 7 deletions src/components/OrderListEntry.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Children } from 'react'
import { View } from 'react-native'
import { View, TouchableOpacity } from 'react-native'
import { Text, Button, Input, Image, ListItem } from 'react-native-elements'
import Icon from 'react-native-vector-icons/FontAwesome'
import { SERVER } from '../pages/config'
Expand All @@ -14,18 +14,17 @@ export default class OrderListEntry extends React.Component {
let { order, navigation } = this.props
let { title, price, image } = order.products[0]
return (

<ListItem bottomDivider style={{ width: "100%" }} containerStyle={{ margin: 0, alignContent: "center" }} onPress={() => navigation.navigate('ProductDetail', { info: orderInfo.product })}>
<ListItem.Content style={{ flexDirection: "row" }}>
<TouchableOpacity onPress={() => navigation.navigate('ProductDetail', { info: orderInfo.product })} >
<View style={{ flexDirection: "row", marginBottom: 10 }}>
<Image source={{ uri: `${SERVER}${image}` }} style={{ width: 90, height: 90 }} />
<View style={{ marginLeft: 100, alignSelf: "center" }}>
<View style={{ marginLeft: "35%", alignSelf: "center" }}>
<ListItem.Title style={{ letterSpacing: 1.5 }}>{title.toUpperCase()}</ListItem.Title>
<ListItem.Subtitle style={{ letterSpacing: 2, textAlign: "right" }}>{price}</ListItem.Subtitle>
<ListItem.Subtitle style={{ letterSpacing: 2, textAlign: "right" }}>{order.order_quantity}</ListItem.Subtitle>
<ListItem.Subtitle style={{ letterSpacing: 2, textAlign: "right" }}>{order.amount}</ListItem.Subtitle>
</View>
</ListItem.Content>
</ListItem>
</View>
</TouchableOpacity>
)
}
}
6 changes: 5 additions & 1 deletion src/pages/Feed/Mypage/MyItemList/MyItemList.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ export default class MyItemList extends React.Component {
list: []
}
this.getItems = this.getItems.bind(this)
this.handleDelete = this.handleDelete.bind(this)
}

getItems() {
Axios.get(`${SERVER}/myitem`)
.then(data => this.setState({ list: data.data }))
.then(data => {
this.setState({ list: data.data })
console.log(this.state.list)
})
}

componentDidMount = () => {
Expand Down
7 changes: 2 additions & 5 deletions src/pages/Feed/Mypage/OrderInfo/OrderInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,13 @@ export default class OrderInfo extends React.Component {
<ScrollView style={{ padding: 10 }}>
{this.state.orders && this.state.orders.map((order, key) => {
return <Card containerStyle={{ padding: 10, borderRadius: 15 }} key={key}>
<Card.Title>
<OrderListEntry order={order} navigation={this.props.navigation} />
</Card.Title>
<OrderListEntry order={order} navigation={this.props.navigation} />
<Card.Divider />
<Text>Order Number : {order.id}</Text>
<Text>Address : {order.address + order.addressDtail}</Text>
<Text>Status : {order.payment_status} </Text>
</Card>
})
}
})}
</ScrollView>
</View>
</LinearGradient>
Expand Down
7 changes: 3 additions & 4 deletions src/pages/Feed/Mypage/SellerOrderList/SellerOrderList.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ export default class SellerOrderList extends React.Component {
return (
<LinearGradient useAngle={true} angle={91.5} colors={['#E2E2E2', '#C9D6FF']} style={{ flex: 1, }}>
<View style={{ padding: 20, height: "100%" }}>
<Text h4 style={{ textAlign: "left", marginBottom: 20 }}>Orders</Text>
<Text h4 style={{ textAlign: "left" }}>Orders</Text>
<ScrollView style={{ padding: 10 }}>
{this.state.orders && this.state.orders.map((order, key) => {
return <Card containerStyle={{ padding: 10, borderRadius: 15 }} key={key}>
<Card.Title> <OrderListEntry order={order} navigation={this.props.navigation} /> </Card.Title>
<Card.Divider />
return <Card containerStyle={{ padding: 15, borderRadius: 15 }} key={key}>
<OrderListEntry order={order} navigation={this.props.navigation} />
<View style={{ flexDirection: "row", alignSelf: "center" }} >
<Picker
mode="dropdown"
Expand Down

0 comments on commit 1faae87

Please sign in to comment.