Commit 43abb0b1 authored by didam's avatar didam
parents 47ade379 9c57ac87
...@@ -5,6 +5,7 @@ import M from 'moment' ...@@ -5,6 +5,7 @@ import M from 'moment'
import SvgAnimatedLinearGradient from 'react-native-svg-animated-linear-gradient' import SvgAnimatedLinearGradient from 'react-native-svg-animated-linear-gradient'
import Svg, { Circle, Rect } from 'react-native-svg' import Svg, { Circle, Rect } from 'react-native-svg'
import Colors from '../../library/colors'; import Colors from '../../library/colors';
import MaterialIcons from 'react-native-vector-icons/MaterialIcons'
const dateNow = M().format('DD-MM-YYYY') const dateNow = M().format('DD-MM-YYYY')
...@@ -13,24 +14,27 @@ class History extends Component { ...@@ -13,24 +14,27 @@ class History extends Component {
super(props) super(props)
this.state = { this.state = {
data: [ data: [
{ jam: '17.30', tanggal: M().format('DD-MM-YYYY') }, { jam: '17.30', tanggal: M().format('DD-MM-YYYY'), noKontrak: 'K-01239912' },
{ jam: '17.30', tanggal: '06-03-2020' }, { jam: '17.30', tanggal: '06-03-2020', noKontrak: 'K-01239913' },
{ jam: '17.30', tanggal: '05-03-2020' }, { jam: '17.30', tanggal: '05-03-2020', noKontrak: 'K-01239914' },
{ jam: '17.30', tanggal: '05-03-2020' }, { jam: '17.30', tanggal: '05-03-2020', noKontrak: 'K-01239915' },
{ jam: '17.30', tanggal: '05-03-2020' }, { jam: '17.30', tanggal: '05-03-2020', noKontrak: 'K-01239916' },
{ jam: '17.30', tanggal: '05-03-2020' }, { jam: '17.30', tanggal: '05-03-2020', noKontrak: 'K-01239917' },
{ jam: '17.30', tanggal: '04-03-2020' }, { jam: '17.30', tanggal: '04-03-2020', noKontrak: 'K-01239918' },
{ jam: '17.30', tanggal: '04-03-2020' }, { jam: '17.30', tanggal: '04-03-2020', noKontrak: 'K-01239919' },
{ jam: '17.30', tanggal: '04-03-2020' }, { jam: '17.30', tanggal: '04-03-2020', noKontrak: 'K-01239920' },
{ jam: '17.30', tanggal: '04-03-2020' }, { jam: '17.30', tanggal: '04-03-2020', noKontrak: 'K-01239921' },
{ jam: '17.30', tanggal: '04-03-2020' }, { jam: '17.30', tanggal: '04-03-2020', noKontrak: 'K-01239922' },
{ jam: '17.30', tanggal: '03-03-2020' }, { jam: '17.30', tanggal: '03-03-2020', noKontrak: 'K-01239923' },
{ jam: '17.30', tanggal: '03-03-2020' }, { jam: '17.30', tanggal: '03-03-2020', noKontrak: 'K-01239924' },
], ],
date: new Date(), date: new Date(),
yesterday: '', yesterday: '',
loading: true, loading: true,
dataLoad: false dataLoad: false,
OrientationStatus : '',
Height_Layout : '',
Width_Layout : '',
} }
} }
...@@ -43,10 +47,28 @@ class History extends Component { ...@@ -43,10 +47,28 @@ class History extends Component {
}, 2000); }, 2000);
} }
DetectOrientation() {
if (this.state.Width_Layout > this.state.Height_Layout) {
this.setState({
OrientationStatus: 'Landscape'
});
}
else {
this.setState({
OrientationStatus: 'Portrait'
});
}
}
render() { render() {
return ( return (
<Container> <Container
<View style={{ height: '10%', width: '100%', backgroundColor: '#e4b300', zIndex: 1 }}> onLayout={(event) => this.setState({
Width_Layout: event.nativeEvent.layout.width,
Height_Layout: event.nativeEvent.layout.height
}, () => this.DetectOrientation())}>
<View style={this.state.OrientationStatus == 'Landscape'? { width: '100%', backgroundColor: '#e4b300', zIndex: 1, height: 80 } : { width: '100%', backgroundColor: '#e4b300', zIndex: 1, height: '10%'}}>
<View style={{ alignItems: 'center', justifyContent: 'center', marginTop: 20 }}> <View style={{ alignItems: 'center', justifyContent: 'center', marginTop: 20 }}>
<Text style={{ fontWeight: 'bold', fontSize: 20, fontStyle: 'italic' }}>My History</Text> <Text style={{ fontWeight: 'bold', fontSize: 20, fontStyle: 'italic' }}>My History</Text>
</View> </View>
...@@ -57,13 +79,20 @@ class History extends Component { ...@@ -57,13 +79,20 @@ class History extends Component {
<View style={{ backgroundColor: '#f5f5f5', paddingHorizontal: 20, zIndex: 3, height: '90%' }}> <View style={{ backgroundColor: '#f5f5f5', paddingHorizontal: 20, zIndex: 3, height: '90%' }}>
<ScrollView style={{ flex: 1 }} showsVerticalScrollIndicator={false}> <ScrollView style={this.state.OrientationStatus == 'Landscape'? { flex: 1, marginBottom: 40 } : {flex: 1}} showsVerticalScrollIndicator={false}>
{this.state.data.map((item, index) => { {this.state.data.map((item, index) => {
return ( return (
<View> <View>
{this.state.dataLoad && ( {this.state.dataLoad && (
<View style={{ marginTop: index == 0 ? 40 : 20, marginBottom: index == this.state.data.length - 1 ? 20 : 0, height: 120 }}> <View style={{ marginTop: index == 0 ? 40 : 20, marginBottom: index == this.state.data.length - 1 ? 20 : 0, height: 120 }}>
<View style={{ width: '100%', height: 100, backgroundColor: '#fff', borderRadius: 10 }}> <View style={{ width: '100%', height: 100, backgroundColor: '#fff', borderRadius: 10, padding: 10, flexDirection: 'row' }}>
<View style={{ width: '70%' }}>
<Text style={{ fontWeight: '700', fontSize: 16 }}>{item.noKontrak}</Text>
</View>
<View style={{ width: '30%', justifyContent: 'flex-end', alignSelf: 'center', flexDirection: 'row' }}>
<Text style={{ color: '#e4b300' }}>Detail</Text>
<MaterialIcons name="navigate-next" size={20} color={'#e4b300'} />
</View>
</View> </View>
<Text style={{ textAlign: 'right', fontStyle: 'italic', fontSize: 12, marginTop: 5, color: '#cccccc' }}>{item.tanggal == String(dateNow) ? item.jam : item.tanggal == this.state.yesterday ? 'yesterday' : item.tanggal} </Text> <Text style={{ textAlign: 'right', fontStyle: 'italic', fontSize: 12, marginTop: 5, color: '#cccccc' }}>{item.tanggal == String(dateNow) ? item.jam : item.tanggal == this.state.yesterday ? 'yesterday' : item.tanggal} </Text>
</View> </View>
...@@ -74,11 +103,11 @@ class History extends Component { ...@@ -74,11 +103,11 @@ class History extends Component {
borderRadius={200} borderRadius={200}
marginTop={10} marginTop={10}
width={'100%'} width={'100%'}
duration={800}
> >
<Rect x="0" y="30" rx="5" ry="1" width="1000" height="100" /> <Rect x="0" y="30" rx="5" ry="1" width="1000" height="100" />
</SvgAnimatedLinearGradient> </SvgAnimatedLinearGradient>
) )}
}
</View> </View>
) )
})} })}
......
...@@ -9,8 +9,8 @@ export default class Appraisal extends Component { ...@@ -9,8 +9,8 @@ export default class Appraisal extends Component {
super(props) super(props)
this.state = { this.state = {
arrayDummy: [ arrayDummy: [
{ noKontrak: 'K-2001920', namaWerehouse: 'Branch-2', petugas: 'Dadang', tglTerima: '03-03-2020', status: 'Draft' }, { noKontrak: 'K-2001920', namaWerehouse: 'Branch-2', petugas: 'Dadang Tukimin', tglTerima: '03-03-2020', status: 'Draft', brand: 'Honda', type: 'Revo', noPol: 'B 4203 PWK' },
{ noKontrak: 'K-2001921', namaWerehouse: 'Branch-1', petugas: 'Dudung', tglTerima: '03-03-2020', status: 'Need Approval' }, { noKontrak: 'K-2001921', namaWerehouse: 'Branch-1', petugas: 'Dudung Tukimin', tglTerima: '03-03-2020', status: 'Need Approval', brand: 'Honda', type: 'Beat', noPol: 'B 4203 STW' },
] ]
} }
} }
...@@ -21,7 +21,30 @@ export default class Appraisal extends Component { ...@@ -21,7 +21,30 @@ export default class Appraisal extends Component {
{this.state.arrayDummy.map((item, index) => { {this.state.arrayDummy.map((item, index) => {
return ( return (
<View key={index} style={{ paddingHorizontal: 7 }}> <View key={index} style={{ paddingHorizontal: 7 }}>
<TouchableOpacity style={{ width: '100%', backgroundColor: '#FFFFFF', borderRadius: 15, paddingHorizontal: 10, shadowRadius: 80, paddingVertical: 10, marginTop: 10 }} onPress={() => this.props.navigation.navigate('MenuAppraisal')}> <TouchableOpacity style={{ marginTop: 10, borderRadius: 20 }} onPress={() => this.props.navigation.navigate('MenuAppraisal')}>
<View style={{ height: 60, backgroundColor: '#e4b300', justifyContent: 'space-between', paddingHorizontal: 20, flexDirection: 'row', borderTopRightRadius: 10, borderTopLeftRadius: 10 }}>
<View style={{ justifyContent: 'center' }}>
<Text style={{ color: 'white', fontSize: 16, fontWeight: '700' }}>{item.noKontrak}</Text>
<Text style={{ color: 'white', fontSize: 14 }}>{item.petugas}</Text>
</View>
<View style={{ justifyContent: 'center' }}>
<Text style={{ color: 'white', fontSize: 14, textAlign: 'center' }}>{item.namaWerehouse}</Text>
</View>
</View>
<View style={{ height: 60, backgroundColor: '#E6E6E6', justifyContent: 'space-between', paddingHorizontal: 20, flexDirection: 'row', borderBottomRightRadius: 10, borderBottomLeftRadius: 10 }}>
<View style={{ justifyContent: 'center' }}>
<Text style={{ color: 'black', fontSize: 14 }}>{item.brand} - {item.type}</Text>
<Text style={{ color: 'black', fontSize: 14 }}>{item.noPol}</Text>
</View>
<View style={{ justifyContent: 'center' }}>
<Text style={{ color: 'black', fontSize: 14, textAlign: 'center' }}>{item.status}</Text>
</View>
</View>
{/* <View style={{ backgroundColor: '#E6E6E6', borderBottomRightRadius: 10, borderBottomLeftRadius: 10, justifyContent: 'center', paddingHorizontal: 20, paddingVertical: 10, borderTopWidth: .7, borderTopColor: 'black' }}>
</View> */}
</TouchableOpacity>
{/* <TouchableOpacity style={{ width: '100%', backgroundColor: '#FFFFFF', borderRadius: 15, paddingHorizontal: 10, shadowRadius: 80, paddingVertical: 10, marginTop: 10 }} onPress={() => this.props.navigation.navigate('MenuAppraisal')}>
<View style={{ width: 120, height: 20, backgroundColor: 'black', marginLeft: -20, marginTop: 5, borderTopRightRadius: 5, borderBottomRightRadius: 5 }}> <View style={{ width: 120, height: 20, backgroundColor: 'black', marginLeft: -20, marginTop: 5, borderTopRightRadius: 5, borderBottomRightRadius: 5 }}>
<Text style={{ color: 'white', textAlign: 'center' }}>{item.status}</Text> <Text style={{ color: 'white', textAlign: 'center' }}>{item.status}</Text>
</View> </View>
...@@ -40,25 +63,21 @@ export default class Appraisal extends Component { ...@@ -40,25 +63,21 @@ export default class Appraisal extends Component {
borderLeftColor: 'transparent', borderLeftColor: 'transparent',
}} /> }} />
<View style={{ flexDirection: 'row' }}> <View style={{ flexDirection: 'row' }}>
<View style={{ width: '80%' }}> <View style={{ width: '80%' }}>
{/* <View style={{ flexDirection: 'row', width: '100%', backgroundColor: 'red' }}> */}
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}> <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
<Text style={{ alignSelf: 'center', fontSize: 16, fontWeight: 'bold' }}>{item.noKontrak}</Text> <Text style={{ alignSelf: 'center', fontSize: 16, fontWeight: 'bold' }}>{item.noKontrak}</Text>
<Text style={{ alignSelf: 'center', fontSize: 14 }}>{item.namaWerehouse}</Text> <Text style={{ alignSelf: 'center', fontSize: 14 }}>{item.namaWerehouse}</Text>
</View> </View>
{/* </View> */}
{/* <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}> */}
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}> <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
<Text style={{ alignSelf: 'center', fontSize: 14 }}>{item.tglTerima}</Text> <Text style={{ alignSelf: 'center', fontSize: 14 }}>{item.tglTerima}</Text>
<Text style={{ alignSelf: 'center', fontSize: 14 }}>{item.petugas}</Text> <Text style={{ alignSelf: 'center', fontSize: 14 }}>{item.petugas}</Text>
</View> </View>
{/* </View> */}
</View> </View>
<View style={{ justifyContent: 'center', width: '20%', alignItems: 'flex-end' }}> <View style={{ justifyContent: 'center', width: '20%', alignItems: 'flex-end' }}>
<Next name="navigate-next" size={26} /> <Next name="navigate-next" size={26} />
</View> </View>
</View> </View>
</TouchableOpacity> </TouchableOpacity> */}
</View> </View>
) )
})} })}
......
...@@ -808,19 +808,6 @@ export default class sampleMenuAppraisal extends Component { ...@@ -808,19 +808,6 @@ export default class sampleMenuAppraisal extends Component {
/> />
</View> </View>
</View> </View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5 }}>
<View style={{ justifyContent: 'center', width: '45%' }}>
<Text style={{ fontSize: 13 }}>Nilai Pembanding Rekondisi</Text>
</View>
<View style={styles.viewInputEnable}>
<TextInput
onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput}
value={this.state.namaRemote}
editable
/>
</View>
</View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5 }}> <View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5 }}>
<View style={{ justifyContent: 'center', width: '45%' }}> <View style={{ justifyContent: 'center', width: '45%' }}>
<Text style={{ fontSize: 13 }}>Pokok Pembiayaan</Text> <Text style={{ fontSize: 13 }}>Pokok Pembiayaan</Text>
......
...@@ -2,7 +2,7 @@ import React, { Component } from 'react'; ...@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { Container, Text, View } from 'native-base'; import { Container, Text, View } from 'native-base';
import LinearGradient from 'react-native-linear-gradient'; import LinearGradient from 'react-native-linear-gradient';
import Colors from '../../library/colors'; import Colors from '../../library/colors';
import { TouchableOpacity, ImageBackground, Image, ScrollView, StyleSheet, Dimensions} from 'react-native'; import { TouchableOpacity, ImageBackground, Image, ScrollView, StyleSheet, Dimensions } from 'react-native';
import FontAwesome5Icon from 'react-native-vector-icons/FontAwesome5'; import FontAwesome5Icon from 'react-native-vector-icons/FontAwesome5';
import { import {
Menu, Menu,
...@@ -11,7 +11,9 @@ import { ...@@ -11,7 +11,9 @@ import {
MenuTrigger, MenuTrigger,
renderers renderers
} from 'react-native-popup-menu'; } from 'react-native-popup-menu';
import { Dropdown } from 'react-native-material-dropdown';
import Images from '../../library/images'; import Images from '../../library/images';
import api from '../../service/api';
class HomePageScreen extends Component { class HomePageScreen extends Component {
constructor(props) { constructor(props) {
...@@ -29,25 +31,51 @@ class HomePageScreen extends Component { ...@@ -29,25 +31,51 @@ class HomePageScreen extends Component {
name: 'Merapi Datang Kembali', name: 'Merapi Datang Kembali',
image: Images.news3 image: Images.news3
}, },
] ],
arrayWarehouse: [],
selectedWarehouse: ''
} }
} }
handleNav(item) { handleNav(item) {
if (item == 'Penerimaan') { if (item == 'Penerimaan') {
this.props.navigation.navigate('Penerimaan') if (this.state.selectedWarehouse != "") {
} else if ( item == 'Appraisal') { this.props.navigation.navigate('Penerimaan', { data: this.state.selectedWarehouse })
} else {
alert('Select Warehouse First!')
}
} else if (item == 'Appraisal') {
this.props.navigation.navigate('Appraisal') this.props.navigation.navigate('Appraisal')
} else { } else {
this.props.navigation.navigate('MenuPenerimaan') this.props.navigation.navigate('MenuPenerimaan')
} }
} }
componentDidMount() {
this.getWarehouse()
}
getWarehouse(){
api.create().getWarehouse().then((response) => {
// alert(JSON.stringify(response.data))
if (response.data.status == "success") {
let arrayWarehouse = []
response.data.data.map((item, index) => {
arrayWarehouse.push({
value: item.warehouse_id,
label: item.warehouse_name
})
})
this.setState({ arrayWarehouse })
}
})
}
render() { render() {
const height = Dimensions.get('window').height const height = Dimensions.get('window').height
const width = Dimensions.get('window').width const width = Dimensions.get('window').width
return ( return (
<Container style={{backgroundColor:'#f8f8f8'}}> <Container style={{ backgroundColor: '#f8f8f8' }}>
{/* <LinearGradient style={{borderBottomLeftRadius: 25, height: 150, width: '100%', justifyContent:'flex-end', padding: 20}} colors={[Colors.blackBasic, Colors.yellowBasic]} start={{x: 0, y: .5}} end={{x: 0, y: .4}}> {/* <LinearGradient style={{borderBottomLeftRadius: 25, height: 150, width: '100%', justifyContent:'flex-end', padding: 20}} colors={[Colors.blackBasic, Colors.yellowBasic]} start={{x: 0, y: .5}} end={{x: 0, y: .4}}>
<View style={{flexDirection:'row', justifyContent: 'space-between',}}> <View style={{flexDirection:'row', justifyContent: 'space-between',}}>
<Text style={{color:'#fff'}}> Dadang Kuspriadi </Text> <Text style={{color:'#fff'}}> Dadang Kuspriadi </Text>
...@@ -71,12 +99,24 @@ class HomePageScreen extends Component { ...@@ -71,12 +99,24 @@ class HomePageScreen extends Component {
</LinearGradient> */} </LinearGradient> */}
<ScrollView style={{flex: 1}}> <ScrollView style={{flex: 1}}>
<ImageBackground source={Images.background2} style={{width: '100%', height: 200, justifyContent:'center'}}> <ImageBackground source={Images.background2} style={{width: '100%', height: 200, justifyContent:'center'}}>
<View style={{alignItems: 'center', justifyContent: 'center', marginTop: 100}}> <View style={{ alignItems: 'center', justifyContent: 'center', marginTop: 100 }}>
<Text style={{color:'#fff', fontSize: 20}}> DADANG TUKIMIN</Text> <Text style={{ color: '#fff', fontSize: 20 }}> DADANG TUKIMIN</Text>
</View> </View>
<View style={{alignItems:'flex-end', justifyContent:'flex-end', marginTop: 20, paddingHorizontal: 20, flexDirection:'row'}}> <View style={{ alignItems: 'flex-end', justifyContent: 'flex-end', marginTop: 20, paddingHorizontal: 20, flexDirection: 'row' }}>
<Text style={{color:'#fff', fontSize: 14}}> Warehouse</Text> <Dropdown
<FontAwesome5Icon name={'angle-down'} color={'#fff'} size={20} style={{marginLeft: 10, marginBottom: -1}}/> label='-- Warehouse --'
labelFontSize={12}
itemColor={'#e6e6e6'}
textColor={'#fff'}
baseColor={'#fff'}
selectedItemColor={'#black'}
containerStyle={{ width: '45%' }}
data={this.state.arrayWarehouse}
onChangeText={(e) => this.setState({ selectedWarehouse: e })}
value={this.state.selectedWarehouse}
/>
{/* <Text style={{color:'#fff', fontSize: 14}}> Warehouse</Text>
<FontAwesome5Icon name={'angle-down'} color={'#fff'} size={20} style={{marginLeft: 10, marginBottom: -1}}/> */}
</View> </View>
</ImageBackground> </ImageBackground>
<View style={{padding: 10, paddingVertical: 20, flexDirection: 'row', width:'100%'}}> <View style={{padding: 10, paddingVertical: 20, flexDirection: 'row', width:'100%'}}>
......
import React, { Component } from 'react' import React, { Component } from 'react'
import { Text, View, ScrollView, TouchableOpacity } from 'react-native' import { Text, View, ScrollView, TouchableOpacity } from 'react-native'
import { Container, Fab, Icon } from 'native-base' import { Container, Fab, Icon } from 'native-base'
import Next from 'react-native-vector-icons/MaterialIcons' import SvgAnimatedLinearGradient from 'react-native-svg-animated-linear-gradient'
import Svg, { Circle, Rect } from 'react-native-svg'
import api from '../../../service/api'
export default class Penerimaan extends Component { export default class Penerimaan extends Component {
...@@ -11,55 +13,76 @@ export default class Penerimaan extends Component { ...@@ -11,55 +13,76 @@ export default class Penerimaan extends Component {
arrayDummy: [ arrayDummy: [
{ noKontrak: 'K-2001920', namaWerehouse: 'Branch-1', petugas: 'Dadang', tglTerima: '03-03-2020' }, { noKontrak: 'K-2001920', namaWerehouse: 'Branch-1', petugas: 'Dadang', tglTerima: '03-03-2020' },
{ noKontrak: 'K-2001921', namaWerehouse: 'Branch-2', petugas: 'Dudung', tglTerima: '03-03-2020' }, { noKontrak: 'K-2001921', namaWerehouse: 'Branch-2', petugas: 'Dudung', tglTerima: '03-03-2020' },
] ],
loading: true,
listClar: []
} }
} }
componentDidMount() {
this.getListData()
// alert(JSON.stringify(this.props))
}
getListData() {
api.create().getListClar({
warehouse_id: Number(this.props.navigation.state.params.data)
}).then((response) => {
let listClar = []
response.data.data.map((item, index) => {
listClar.push(item)
})
this.setState({ listClar }, () => {
setTimeout(() => {
this.setState({ loading: false })
}, 500);
})
})
}
render() { render() {
return ( return (
<Container style={{ flex: 1 }}> <Container style={{ flex: 1 }}>
<ScrollView style={{ paddingHorizontal: 20, backgroundColor: '#F5F5F5', paddingTop: 10 }} showsVerticalScrollIndicator={false} > <ScrollView style={{ paddingHorizontal: 20, backgroundColor: '#F5F5F5', paddingTop: 10 }} showsVerticalScrollIndicator={false} >
{this.state.arrayDummy.map((item, index) => { {this.state.listClar.map((item, index) => {
return ( return (
<View key={index} style={{ paddingHorizontal: 7 }}> <View key={index} style={{ paddingHorizontal: 7 }}>
<TouchableOpacity style={{ width: '100%', backgroundColor: '#FFFFFF', borderRadius: 15, paddingHorizontal: 10, shadowRadius: 80, paddingVertical: 10, marginTop: 10 }} onPress={() => this.props.navigation.navigate('MenuPenerimaan')}> {!this.state.loading && (
<View style={{ width: 80, height: 20, backgroundColor: 'black', marginLeft: -20, marginTop: 5, borderTopRightRadius: 5, borderBottomRightRadius: 5 }}> <TouchableOpacity style={{ marginTop: 10, borderRadius: 20 }} onPress={() => this.props.navigation.navigate('MenuPenerimaan', { data: item })}>
<Text style={{ color: 'white', textAlign: 'center' }}>{item.namaWerehouse}</Text> <View style={{ height: 60, backgroundColor: '#e4b300', justifyContent: 'space-between', paddingHorizontal: 20, flexDirection: 'row', borderTopRightRadius: 10, borderTopLeftRadius: 10 }}>
</View> <View style={{ justifyContent: 'center' }}>
<View style={{ <Text style={{ color: 'white', fontSize: 16, fontWeight: '700' }}>{item.contract_number}</Text>
backgroundColor: '#E6E6E6', height: 10, width: 10, <Text style={{ color: 'white', fontSize: 14 }}>{item.nasabah_name}</Text>
marginLeft: -20,
backgroundColor: 'transparent',
borderStyle: 'solid',
borderTopWidth: 8,
borderRightWidth: 0,
borderBottomWidth: 0,
borderLeftWidth: 10,
borderTopColor: 'black',
borderRightColor: 'transparent',
borderBottomColor: 'transparent',
borderLeftColor: 'transparent',
}} />
<View style={{ flexDirection: 'row' }}>
<View style={{ width: '80%' }}>
{/* <View style={{ flexDirection: 'row', width: '100%', backgroundColor: 'red' }}> */}
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
<Text style={{ alignSelf: 'center', fontSize: 16, fontWeight: 'bold' }}>{item.noKontrak}</Text>
{/* <Text style={{ alignSelf: 'center', fontSize: 14 }}>{item.namaWerehouse}</Text> */}
</View> </View>
{/* </View> */} <View style={{ justifyContent: 'center' }}>
{/* <View style={{ flexDirection: 'row', justifyContent: 'space-between' }}> */} <Text style={{ color: 'white', fontSize: 14, textAlign: 'center' }}>{item.warehouse_code}</Text>
<View style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
<Text style={{ alignSelf: 'center', fontSize: 14 }}>{item.tglTerima}</Text>
<Text style={{ alignSelf: 'center', fontSize: 14 }}>{item.petugas}</Text>
</View> </View>
{/* </View> */}
</View> </View>
<View style={{ justifyContent: 'center', width: '20%', alignItems: 'flex-end' }}> <View style={{ height: 60, backgroundColor: '#E6E6E6', justifyContent: 'space-between', paddingHorizontal: 20, flexDirection: 'row', borderBottomRightRadius: 10, borderBottomLeftRadius: 10 }}>
<Next name="navigate-next" size={26} /> <View style={{ justifyContent: 'center' }}>
<Text style={{ color: 'black', fontSize: 14 }}>{item.brand} - {item.model}</Text>
<Text style={{ color: 'black', fontSize: 14 }}>{item.police_number}</Text>
</View>
<View style={{ justifyContent: 'center' }}>
<Text style={{ color: 'black', fontSize: 14, textAlign: 'center' }}>{item.collector}</Text>
</View>
</View> </View>
</View> </TouchableOpacity>
</TouchableOpacity> )}
{this.state.loading && (
<SvgAnimatedLinearGradient
height={140}
borderRadius={200}
marginTop={-10}
width={'100%'}
duration={800}
primaryColor="#fff3c9"
secondaryColor="#e4b300"
>
<Rect x="0" y="30" rx="5" ry="1" width="1000" height="120" />
</SvgAnimatedLinearGradient>
)}
</View> </View>
) )
})} })}
...@@ -71,8 +94,8 @@ export default class Penerimaan extends Component { ...@@ -71,8 +94,8 @@ export default class Penerimaan extends Component {
containerStyle={{}} containerStyle={{}}
style={{ backgroundColor: '#e4b300' }} style={{ backgroundColor: '#e4b300' }}
position="bottomRight" position="bottomRight"
onPress={() => this.props.navigation.navigate('MenuPenerimaan')} onPress={() => this.props.navigation.navigate('MenuPenerimaan', { data: "" })}
> >
<Icon name="add" /> <Icon name="add" />
</Fab> </Fab>
</Container> </Container>
......
...@@ -13,12 +13,13 @@ export default class sampleMenuPenerimaan extends Component { ...@@ -13,12 +13,13 @@ export default class sampleMenuPenerimaan extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
data: this.props.navigation.state.params.data || "",
dateUpdate: M(new Date()).format('DD-MMM-YYYY'), dateUpdate: M(new Date()).format('DD-MMM-YYYY'),
datePenerimaan: M(new Date()).format('DD-MMM-YYYY'), datePenerimaan: M(new Date()).format('DD-MMM-YYYY'),
checked: 'first', checked: 'first',
progress: false, progress: false,
kodeWerehouse: '#daridepan', kodeWerehouse: '#daridepan',
namaWerehouse: '#daridepan', warehouse_name: '',
kodeRemote: '', kodeRemote: '',
namaRemote: '', namaRemote: '',
tanggalPenerimaan: '', tanggalPenerimaan: '',
...@@ -29,7 +30,7 @@ export default class sampleMenuPenerimaan extends Component { ...@@ -29,7 +30,7 @@ export default class sampleMenuPenerimaan extends Component {
} }
componentDidMount() { componentDidMount() {
// alert(this.state.date) // alert(JSON.stringify(this.props))
} }
handlePenerimaanDate(date) { handlePenerimaanDate(date) {
...@@ -43,6 +44,7 @@ export default class sampleMenuPenerimaan extends Component { ...@@ -43,6 +44,7 @@ export default class sampleMenuPenerimaan extends Component {
} }
render() { render() {
let { data } = this.state
return ( return (
<Container style={{ flex: 1, paddingHorizontal: 20, paddingBottom: 20 }}> <Container style={{ flex: 1, paddingHorizontal: 20, paddingBottom: 20 }}>
<ScrollView <ScrollView
...@@ -82,11 +84,11 @@ export default class sampleMenuPenerimaan extends Component { ...@@ -82,11 +84,11 @@ export default class sampleMenuPenerimaan extends Component {
<View style={{ height: 30, justifyContent: 'center' }}> <View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Kode Cabang</Text> <Text style={{ fontSize: 13 }}>Kode Cabang</Text>
</View> </View>
<View style={styles.viewInputDisable}> <View style={this.state.data == "" ? styles.viewInputEnable : styles.viewInputDisable}>
<TextInput <TextInput
style={styles.textInput} style={styles.textInput}
value={'#dropdown'} value={this.state.data == "" ? null : String(data.branch_id)}
editable={false} editable={this.state.data == "" ? true : false}
/> />
</View> </View>
</View> </View>
...@@ -95,11 +97,11 @@ export default class sampleMenuPenerimaan extends Component { ...@@ -95,11 +97,11 @@ export default class sampleMenuPenerimaan extends Component {
<View style={{ height: 30, justifyContent: 'center' }}> <View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Nama Cabang</Text> <Text style={{ fontSize: 13 }}>Nama Cabang</Text>
</View> </View>
<View style={styles.viewInputDisable}> <View style={this.state.data == "" ? styles.viewInputEnable : styles.viewInputDisable}>
<TextInput <TextInput
style={styles.textInput} style={styles.textInput}
value={'#autofill'} value={this.state.data == "" ? null : String(data.warehouse_code)}
editable={false} editable={this.state.data == "" ? true : false}
/> />
</View> </View>
</View> </View>
...@@ -108,11 +110,11 @@ export default class sampleMenuPenerimaan extends Component { ...@@ -108,11 +110,11 @@ export default class sampleMenuPenerimaan extends Component {
<View style={{ height: 30, justifyContent: 'center' }}> <View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>No Kontrak Payung</Text> <Text style={{ fontSize: 13 }}>No Kontrak Payung</Text>
</View> </View>
<View style={styles.viewInputDisable}> <View style={this.state.data == "" ? styles.viewInputEnable : styles.viewInputDisable}>
<TextInput <TextInput
style={styles.textInput} style={styles.textInput}
value={'#livesearch'} value={this.state.data == "" ? null : String(data.contract_number)}
editable={false} editable={this.state.data == "" ? true : false}
/> />
</View> </View>
</View> </View>
...@@ -124,8 +126,8 @@ export default class sampleMenuPenerimaan extends Component { ...@@ -124,8 +126,8 @@ export default class sampleMenuPenerimaan extends Component {
<View style={styles.viewInputDisable}> <View style={styles.viewInputDisable}>
<TextInput <TextInput
style={styles.textInput} style={styles.textInput}
value={'#autofill'} value={this.state.data == "" ? null : String(data.sub_contract_number)}
editable={false} editable={this.state.data == "" ? true : false}
/> />
</View> </View>
</View> </View>
...@@ -137,8 +139,8 @@ export default class sampleMenuPenerimaan extends Component { ...@@ -137,8 +139,8 @@ export default class sampleMenuPenerimaan extends Component {
<View style={styles.viewInputDisable}> <View style={styles.viewInputDisable}>
<TextInput <TextInput
style={styles.textInput} style={styles.textInput}
value={'#autofill'} value={this.state.data == "" ? null : String(data.nasabah_name)}
editable={false} editable={this.state.data == "" ? true : false}
/> />
</View> </View>
</View> </View>
...@@ -149,10 +151,10 @@ export default class sampleMenuPenerimaan extends Component { ...@@ -149,10 +151,10 @@ export default class sampleMenuPenerimaan extends Component {
</View> </View>
<View style={styles.viewInputEnable}> <View style={styles.viewInputEnable}>
<TextInput <TextInput
onChangeText={(e) => this.setState({ kodeWerehouse: e })} onChangeText={(e) => this.setState({ warehouse_name: e })}
style={styles.textInput} style={styles.textInput}
value={this.state.kodeWerehouse} value={this.state.data == "" ? null : String(data.warehouse_name)}
editable editable={this.state.data == "" ? true : false}
/> />
</View> </View>
</View> </View>
...@@ -165,7 +167,7 @@ export default class sampleMenuPenerimaan extends Component { ...@@ -165,7 +167,7 @@ export default class sampleMenuPenerimaan extends Component {
<TextInput <TextInput
onChangeText={(e) => this.setState({ namaWerehouse: e })} onChangeText={(e) => this.setState({ namaWerehouse: e })}
style={styles.textInput} style={styles.textInput}
value={this.state.namaWerehouse} value={data.warehouse_code}
editable editable
/> />
</View> </View>
...@@ -179,7 +181,7 @@ export default class sampleMenuPenerimaan extends Component { ...@@ -179,7 +181,7 @@ export default class sampleMenuPenerimaan extends Component {
<TextInput <TextInput
onChangeText={(e) => this.setState({ kodeRemote: e })} onChangeText={(e) => this.setState({ kodeRemote: e })}
style={styles.textInput} style={styles.textInput}
value={this.state.kodeRemote} value={data.remote_code}
editable editable
/> />
</View> </View>
...@@ -193,7 +195,7 @@ export default class sampleMenuPenerimaan extends Component { ...@@ -193,7 +195,7 @@ export default class sampleMenuPenerimaan extends Component {
<TextInput <TextInput
onChangeText={(e) => this.setState({ namaRemote: e })} onChangeText={(e) => this.setState({ namaRemote: e })}
style={styles.textInput} style={styles.textInput}
value={this.state.namaRemote} value={data.remote_name}
editable editable
/> />
</View> </View>
...@@ -216,7 +218,7 @@ export default class sampleMenuPenerimaan extends Component { ...@@ -216,7 +218,7 @@ export default class sampleMenuPenerimaan extends Component {
/> />
<TextInput <TextInput
style={styles.textInput} style={styles.textInput}
value={this.state.datePenerimaan} value={data.date_in}
editable={false} editable={false}
/> />
</TouchableOpacity> </TouchableOpacity>
...@@ -263,7 +265,7 @@ export default class sampleMenuPenerimaan extends Component { ...@@ -263,7 +265,7 @@ export default class sampleMenuPenerimaan extends Component {
progress={!this.state.progress} progress={!this.state.progress}
onPress={next => { onPress={next => {
setTimeout(() => { setTimeout(() => {
this.props.navigation.navigate('MenuPenerimaan2') this.props.navigation.navigate('MenuPenerimaan2', { data: this.state.data })
next() next()
}, 300); }, 300);
}} }}
......
...@@ -11,6 +11,7 @@ export default class sampleMenuPenerimaan2 extends Component { ...@@ -11,6 +11,7 @@ export default class sampleMenuPenerimaan2 extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
data: this.props.navigation.state.params.data || "",
date: new Date(), date: new Date(),
checked: 'first', checked: 'first',
object: null, object: null,
...@@ -22,7 +23,13 @@ export default class sampleMenuPenerimaan2 extends Component { ...@@ -22,7 +23,13 @@ export default class sampleMenuPenerimaan2 extends Component {
kunci: null kunci: null
} }
} }
componentDidMount(){
// alert(JSON.stringify(this.state.data))
}
render() { render() {
let { data } = this.state
return ( return (
<Container style={{ flex: 1, paddingHorizontal: 10, paddingBottom: 20 }}> <Container style={{ flex: 1, paddingHorizontal: 10, paddingBottom: 20 }}>
<ScrollView showsVerticalScrollIndicator={false}> <ScrollView showsVerticalScrollIndicator={false}>
...@@ -97,7 +104,7 @@ export default class sampleMenuPenerimaan2 extends Component { ...@@ -97,7 +104,7 @@ export default class sampleMenuPenerimaan2 extends Component {
<View style={{ borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, justifyContent: 'center', borderRadius: 5, width: '60%' }}> <View style={{ borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, justifyContent: 'center', borderRadius: 5, width: '60%' }}>
<TextInput <TextInput
style={{ paddingHorizontal: 10, paddingVertical: 0, color: '#999999' }} style={{ paddingHorizontal: 10, paddingVertical: 0, color: '#999999' }}
value={'Test'} value={this.state.data == "" ? "" : `${data.brand} - ${data.model}`}
/> />
</View> </View>
<View style={{ width: '40%', flexDirection: 'row', justifyContent: 'space-between', paddingHorizontal: 5 }}> <View style={{ width: '40%', flexDirection: 'row', justifyContent: 'space-between', paddingHorizontal: 5 }}>
...@@ -128,7 +135,7 @@ export default class sampleMenuPenerimaan2 extends Component { ...@@ -128,7 +135,7 @@ export default class sampleMenuPenerimaan2 extends Component {
<View style={{ borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, justifyContent: 'center', borderRadius: 5, width: '60%' }}> <View style={{ borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, justifyContent: 'center', borderRadius: 5, width: '60%' }}>
<TextInput <TextInput
style={{ paddingHorizontal: 10, paddingVertical: 0, color: '#999999' }} style={{ paddingHorizontal: 10, paddingVertical: 0, color: '#999999' }}
value={'Test'} value={data.chassis_number}
/> />
</View> </View>
<View style={{ width: '40%', flexDirection: 'row', justifyContent: 'space-between', paddingHorizontal: 5 }}> <View style={{ width: '40%', flexDirection: 'row', justifyContent: 'space-between', paddingHorizontal: 5 }}>
...@@ -159,7 +166,7 @@ export default class sampleMenuPenerimaan2 extends Component { ...@@ -159,7 +166,7 @@ export default class sampleMenuPenerimaan2 extends Component {
<View style={{ borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, justifyContent: 'center', borderRadius: 5, width: '60%' }}> <View style={{ borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, justifyContent: 'center', borderRadius: 5, width: '60%' }}>
<TextInput <TextInput
style={{ paddingHorizontal: 10, paddingVertical: 0, color: '#999999' }} style={{ paddingHorizontal: 10, paddingVertical: 0, color: '#999999' }}
value={'Test'} value={data.police_number}
/> />
</View> </View>
<View style={{ width: '40%', flexDirection: 'row', justifyContent: 'space-between', paddingHorizontal: 5 }}> <View style={{ width: '40%', flexDirection: 'row', justifyContent: 'space-between', paddingHorizontal: 5 }}>
...@@ -190,7 +197,7 @@ export default class sampleMenuPenerimaan2 extends Component { ...@@ -190,7 +197,7 @@ export default class sampleMenuPenerimaan2 extends Component {
<View style={{ borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, justifyContent: 'center', borderRadius: 5, width: '60%' }}> <View style={{ borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, justifyContent: 'center', borderRadius: 5, width: '60%' }}>
<TextInput <TextInput
style={{ paddingHorizontal: 10, paddingVertical: 0, color: '#999999' }} style={{ paddingHorizontal: 10, paddingVertical: 0, color: '#999999' }}
value={'Test'} value={data.engine_number}
/> />
</View> </View>
<View style={{ width: '40%', flexDirection: 'row', justifyContent: 'space-between', paddingHorizontal: 5 }}> <View style={{ width: '40%', flexDirection: 'row', justifyContent: 'space-between', paddingHorizontal: 5 }}>
...@@ -231,16 +238,16 @@ export default class sampleMenuPenerimaan2 extends Component { ...@@ -231,16 +238,16 @@ export default class sampleMenuPenerimaan2 extends Component {
<View style={{ width: '40%', flexDirection: 'row', justifyContent: 'space-between', paddingHorizontal: 5 }}> <View style={{ width: '40%', flexDirection: 'row', justifyContent: 'space-between', paddingHorizontal: 5 }}>
<View> <View>
<RadioButton <RadioButton
value="true" value={data.stnk_recondition}
status={this.state.stnk === 'true' ? 'checked' : 'unchecked'} status={data.stnk_recondition === true ? 'checked' : 'unchecked'}
onPress={() => { this.setState({ stnk: 'true' }); }} onPress={() => { this.setState({ stnk: true }); }}
/> />
</View> </View>
<View> <View>
<RadioButton <RadioButton
value="false" value={data.stnk_recondition}
status={this.state.stnk === 'false' ? 'checked' : 'unchecked'} status={data.stnk_recondition === false ? 'checked' : 'unchecked'}
onPress={() => { this.setState({ stnk: 'false' }); }} onPress={() => { this.setState({ stnk: false }); }}
/> />
</View> </View>
</View> </View>
...@@ -262,15 +269,15 @@ export default class sampleMenuPenerimaan2 extends Component { ...@@ -262,15 +269,15 @@ export default class sampleMenuPenerimaan2 extends Component {
<View style={{ width: '40%', flexDirection: 'row', justifyContent: 'space-between', paddingHorizontal: 5 }}> <View style={{ width: '40%', flexDirection: 'row', justifyContent: 'space-between', paddingHorizontal: 5 }}>
<View> <View>
<RadioButton <RadioButton
value="true" value={data.unit_key}
status={this.state.kunci === 'true' ? 'checked' : 'unchecked'} status={data.unit_key === true ? 'checked' : 'unchecked'}
onPress={() => { this.setState({ kunci: 'true' }); }} onPress={() => { this.setState({ kunci: 'true' }); }}
/> />
</View> </View>
<View> <View>
<RadioButton <RadioButton
value="false" value={data.unit_key}
status={this.state.kunci === 'false' ? 'checked' : 'unchecked'} status={data.unit_key === false ? 'checked' : 'unchecked'}
onPress={() => { this.setState({ kunci: 'false' }); }} onPress={() => { this.setState({ kunci: 'false' }); }}
/> />
</View> </View>
...@@ -296,7 +303,7 @@ export default class sampleMenuPenerimaan2 extends Component { ...@@ -296,7 +303,7 @@ export default class sampleMenuPenerimaan2 extends Component {
progress={!this.state.progress} progress={!this.state.progress}
onPress={next => { onPress={next => {
setTimeout(() => { setTimeout(() => {
this.props.navigation.navigate('MenuPenerimaan3') this.props.navigation.navigate('MenuPenerimaan3', {data: this.state.data})
next() next()
}, 300); }, 300);
}} }}
......
...@@ -15,6 +15,7 @@ export default class sampleMenuPenerimaan3 extends Component { ...@@ -15,6 +15,7 @@ export default class sampleMenuPenerimaan3 extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
data: this.props.navigation.state.params.data || "",
date: new Date(), date: new Date(),
checked: 'first', checked: 'first',
progress: false, progress: false,
...@@ -25,6 +26,10 @@ export default class sampleMenuPenerimaan3 extends Component { ...@@ -25,6 +26,10 @@ export default class sampleMenuPenerimaan3 extends Component {
} }
} }
componentDidMount() {
// alert(JSON.stringify(this.state.data))
}
async requestCameraPermission(type) { async requestCameraPermission(type) {
try { try {
const granted = await PermissionsAndroid.request( const granted = await PermissionsAndroid.request(
...@@ -59,7 +64,12 @@ export default class sampleMenuPenerimaan3 extends Component { ...@@ -59,7 +64,12 @@ export default class sampleMenuPenerimaan3 extends Component {
RNFetchBlob.fs.readFile(res.uri, 'base64') RNFetchBlob.fs.readFile(res.uri, 'base64')
.then((data) => { .then((data) => {
if (type == 'rangka') { if (type == 'rangka') {
this.setState({ imageRangka: res.uri }, () => alert(this.state.imageRangka)) this.setState({
data: {
...this.state.data,
chassis_number_photo: res.uri
}
})
} else { } else {
let mesinArray = [] let mesinArray = []
mesinArray.push({ mesinArray.push({
...@@ -80,9 +90,8 @@ export default class sampleMenuPenerimaan3 extends Component { ...@@ -80,9 +90,8 @@ export default class sampleMenuPenerimaan3 extends Component {
} }
} }
render() { render() {
let { data } = this.state
return ( return (
<Container style={{ flex: 1, paddingHorizontal: 20, paddingBottom: 20 }}> <Container style={{ flex: 1, paddingHorizontal: 20, paddingBottom: 20 }}>
...@@ -142,13 +151,13 @@ export default class sampleMenuPenerimaan3 extends Component { ...@@ -142,13 +151,13 @@ export default class sampleMenuPenerimaan3 extends Component {
width: '100%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5 width: '100%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
}} }}
> >
{this.state.imageRangka == '' ? {data.chassis_number_photo == '' ?
<View style={{ width: '100%', height: '100%', justifyContent: 'center', alignContent: 'center' }}> <View style={{ width: '100%', height: '100%', justifyContent: 'center', alignContent: 'center' }}>
<Text style={{ color: 'rgba(237, 57, 99, .5)', textAlign: 'center', fontSize: 40 }}>+</Text> <Text style={{ color: 'rgba(237, 57, 99, .5)', textAlign: 'center', fontSize: 40 }}>+</Text>
</View> : </View> :
<Image <Image
style={{ width: '100%', height: '100%', resizeMode: 'contain' }} style={{ width: '100%', height: '100%', resizeMode: 'cover' }}
source={{ uri: this.state.imageRangka }} source={{ uri: data.chassis_number_photo }}
/> />
} }
</View> </View>
...@@ -165,13 +174,13 @@ export default class sampleMenuPenerimaan3 extends Component { ...@@ -165,13 +174,13 @@ export default class sampleMenuPenerimaan3 extends Component {
width: '100%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5 width: '100%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
}} }}
> >
{this.state.imageMesin == '' ? {data.engine_number_photo == '' ?
<View style={{ width: '100%', height: '100%', justifyContent: 'center', alignContent: 'center' }}> <View style={{ width: '100%', height: '100%', justifyContent: 'center', alignContent: 'center' }}>
<Text style={{ color: 'rgba(237, 57, 99, .5)', textAlign: 'center', fontSize: 40 }}>+</Text> <Text style={{ color: 'rgba(237, 57, 99, .5)', textAlign: 'center', fontSize: 40 }}>+</Text>
</View> : </View> :
<Image <Image
style={{ width: '100%', height: '100%', resizeMode: 'stretch' }} style={{ width: '100%', height: '100%', resizeMode: 'stretch' }}
source={{ uri: this.state.imageMesin }} source={{ uri: data.engine_number_photo }}
/> />
} }
</View> </View>
......
const Constant = { const Constant = {
BASE_URL : 'https://103.44.149.207:8080/projectmanagement/public/mobile/', BASE_URL : 'http:/103.44.149.215:8080/projectmanagement_dev/public/mobile/',
//USER //USER
TOKEN: 'TOKEN', TOKEN: 'TOKEN',
......
...@@ -24,7 +24,7 @@ const create = () => { ...@@ -24,7 +24,7 @@ const create = () => {
// alert(url) // alert(url)
// api.setBaseURL(`${url}/api/`) // api.setBaseURL(`${url}/api/`)
} else { } else {
token = "" token = "05ddbcb9f17bc952ed1c66fa2664e63710ed869a5bbb5079dcfec4424b9057a240b758b8b45fb7f617ffba0a966ebc2dd0e392491112ec8c64a2f311492dd0f0"
// url = Constant.BASE_URL.MASTER + '/api/' // url = Constant.BASE_URL.MASTER + '/api/'
// alert(url) // alert(url)
// api.setBaseURL(`${url}/api/`) // api.setBaseURL(`${url}/api/`)
...@@ -43,9 +43,14 @@ const create = () => { ...@@ -43,9 +43,14 @@ const create = () => {
const methodPost = (value) => POST('something', value) const methodPost = (value) => POST('something', value)
const login = (value) => POST('auth/login', value) const login = (value) => POST('auth/login', value)
const getListClar = (value) => api.post('demo/get_list_clar', value)
const getWarehouse = () => GET('demo/get_user_warehouse')
return { return {
login login,
getListClar,
getWarehouse
} }
} }
......
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