Commit 3add0435 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

finishing ngantuk

See merge request !52
parents 34e5dab7 53e898dc
...@@ -262,7 +262,7 @@ class CartScreen extends Component { ...@@ -262,7 +262,7 @@ class CartScreen extends Component {
<BarIndicator count={5} color='#4cc9f0' size={25}/> <BarIndicator count={5} color='#4cc9f0' size={25}/>
</View> : </View> :
<View style={[styles.scrollContent]}> <View style={[styles.scrollContent]}>
<View style={{padding: 20, flexDirection:'row', justifyContent: 'space-between', borderBottomColor: '#ececec', borderBottomWidth: 1}}> {this.state.listCart.length != 0 && <View style={{padding: 20, flexDirection:'row', justifyContent: 'space-between', borderBottomColor: '#ececec', borderBottomWidth: 1}}>
<View style={{flexDirection:'row'}}> <View style={{flexDirection:'row'}}>
<TouchableOpacity onPress={() => { <TouchableOpacity onPress={() => {
this.state.arrayCheck.length > 0 && this.state.arrayCheck.length == this.state.listCart.length? this.state.arrayCheck.length > 0 && this.state.arrayCheck.length == this.state.listCart.length?
...@@ -276,13 +276,13 @@ class CartScreen extends Component { ...@@ -276,13 +276,13 @@ class CartScreen extends Component {
<BaseText onPress={() => { <BaseText onPress={() => {
this.state.arrayCheck.length > 0 && this.state.arrayCheck.length == this.state.listCart.length? this.state.arrayCheck.length > 0 && this.state.arrayCheck.length == this.state.listCart.length?
this.setState({arrayCheck: [], dataCheckout: []}) : this.handleCheckAll() this.setState({arrayCheck: [], dataCheckout: []}) : this.handleCheckAll()
}} text={"Pilih Semua Orang"} type={"bold"} style={{opacity: .7, fontSize: 12, marginLeft: 15, alignSelf: 'flex-end',}}/> }} text={"Pilih Semua Barang"} type={"bold"} style={{opacity: .7, fontSize: 12, marginLeft: 15, alignSelf: 'flex-end',}}/>
</View> </View>
<View> <View>
<BaseText text={'Hapus'} type={"bold"} style={{opacity: .8, color: '#4cc9f0'}}/> <BaseText text={'Hapus'} type={"bold"} style={{opacity: .8, color: '#4cc9f0'}}/>
</View> </View>
</View> </View>}
<ScrollView showsVerticalScrollIndicator={false} style={{backgroundColor:'white'}}> <ScrollView showsVerticalScrollIndicator={false} style={this.state.listCart.length == 0? styles.scrollContent : {backgroundColor:'white'}}>
{this.state.listCart.map((item,index) => { {this.state.listCart.map((item,index) => {
return ( return (
<View key={index}> <View key={index}>
...@@ -384,7 +384,7 @@ class CartScreen extends Component { ...@@ -384,7 +384,7 @@ class CartScreen extends Component {
</View> </View>
<View style={{width: '100%', height: 15, backgroundColor: '#ececec'}}/> <View style={{width: '100%', height: 15, backgroundColor: '#ececec'}}/>
{index == this.state.listCart.length -1 && item.default_size.length > 0 && <View style={{height: 200, backgroundColor:'#ececec', width: '100%'}}/>} {index == this.state.listCart.length -1 && item.default_size.length > 0 && <View style={{height: 200, backgroundColor:'white', width: '100%'}}/>}
</View> </View>
) )
})} })}
...@@ -398,7 +398,7 @@ class CartScreen extends Component { ...@@ -398,7 +398,7 @@ class CartScreen extends Component {
<BaseText text={this.getTotalCart()} type={"bold"} style={{opacity: .8, color: '#4cc9f0'}}/> <BaseText text={this.getTotalCart()} type={"bold"} style={{opacity: .8, color: '#4cc9f0'}}/>
</View> </View>
<View style={{width: '40%'}}> <View style={{width: '40%'}}>
<BaseButton text={'Checkout'} onPress={() => this.handleNavigateCheckout()} fontSizeText={14}/> <BaseButton text={'Checkout'} color={this.state.listCart.length == 0? '#dedede' : '#4cc9f0'} onPress={() => this.state.listCart.length == 0? null : this.handleNavigateCheckout()} fontSizeText={14}/>
</View> </View>
</View> </View>
</View> </View>
......
This diff is collapsed.
...@@ -16,6 +16,7 @@ import Api from '../Services/Api'; ...@@ -16,6 +16,7 @@ import Api from '../Services/Api';
import moment from 'moment'; import moment from 'moment';
import Constant from '../Lib/Constant'; import Constant from '../Lib/Constant';
import { formatRp } from '../Lib/Utils'; import { formatRp } from '../Lib/Utils';
import { BarIndicator } from 'react-native-indicators';
class MyOrderScreen extends Component { class MyOrderScreen extends Component {
constructor(props) { constructor(props) {
...@@ -23,7 +24,8 @@ class MyOrderScreen extends Component { ...@@ -23,7 +24,8 @@ class MyOrderScreen extends Component {
this.state = { this.state = {
activeTab: 0, activeTab: 0,
listOrder: [], listOrder: [],
currency: '' currency: '',
loading: false
} }
} }
backAction = () => { backAction = () => {
...@@ -38,10 +40,12 @@ class MyOrderScreen extends Component { ...@@ -38,10 +40,12 @@ class MyOrderScreen extends Component {
} }
getListOrder() { getListOrder() {
this.setState({loading: true})
Api.create().getOrder().then((response) => { Api.create().getOrder().then((response) => {
if (response.data.status == 'success') { if (response.data.status == 'success') {
this.setState({listOrder: response.data.data}) this.setState({listOrder: response.data.data})
} }
this.setState({loading: false})
}) })
} }
...@@ -98,6 +102,9 @@ class MyOrderScreen extends Component { ...@@ -98,6 +102,9 @@ class MyOrderScreen extends Component {
<View style={{zIndex: 99}}> <View style={{zIndex: 99}}>
<BaseHeader leftText={'Pesanan Saya'} onBackPress={this.backAction}/> <BaseHeader leftText={'Pesanan Saya'} onBackPress={this.backAction}/>
</View> </View>
{this.state.loading? <View style={{flex: 1, backgroundColor: 'white', borderTopLeftRadius: 32, borderTopRightRadius: 32}}>
<BarIndicator count={5} color='#4cc9f0' size={25}/>
</View> :
<View style={{ <View style={{
flex: 1, flex: 1,
backgroundColor: 'white', backgroundColor: 'white',
...@@ -194,7 +201,7 @@ class MyOrderScreen extends Component { ...@@ -194,7 +201,7 @@ class MyOrderScreen extends Component {
</View> </View>
</Tab> </Tab>
</Tabs> </Tabs>
</View> </View>}
</Container> </Container>
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment