Commit 6b1962f4 authored by didam's avatar didam

didam

parent b5d200fd
...@@ -10,6 +10,7 @@ import fonts from '../../library/fonts'; ...@@ -10,6 +10,7 @@ import fonts from '../../library/fonts';
import api from '../../service/api'; import api from '../../service/api';
import reactotron from 'reactotron-react-native'; import reactotron from 'reactotron-react-native';
import moment from 'moment'; import moment from 'moment';
import { NavigationEvents } from 'react-navigation';
const dateNow = M().format('DD-MM-YYYY') const dateNow = M().format('DD-MM-YYYY')
...@@ -121,7 +122,10 @@ class History extends Component { ...@@ -121,7 +122,10 @@ class History extends Component {
onLayout={(event) => this.setState({ onLayout={(event) => this.setState({
Width_Layout: event.nativeEvent.layout.width, Width_Layout: event.nativeEvent.layout.width,
Height_Layout: event.nativeEvent.layout.height Height_Layout: event.nativeEvent.layout.height
}, () => this.DetectOrientation())}> }, () => this.DetectOrientation())}>
<NavigationEvents
onDidFocus={() => this.getHistory()}
/>
<View style={this.state.OrientationStatus == 'Landscape'? { width: '100%', backgroundColor: '#e4b300', zIndex: 1, height: 80 } : { width: '100%', backgroundColor: '#e4b300', zIndex: 1, height: '10%'}}> <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>
......
...@@ -10,6 +10,7 @@ import AwesomeButton from "react-native-really-awesome-button"; ...@@ -10,6 +10,7 @@ import AwesomeButton from "react-native-really-awesome-button";
import DocumentPicker from 'react-native-document-picker' import DocumentPicker from 'react-native-document-picker'
import RNFetchBlob from 'rn-fetch-blob' import RNFetchBlob from 'rn-fetch-blob'
import Colors from '../../../library/colors'; import Colors from '../../../library/colors';
import reactotron from 'reactotron-react-native';
export default class sampleMenuPenerimaan3 extends Component { export default class sampleMenuPenerimaan3 extends Component {
constructor(props) { constructor(props) {
...@@ -27,7 +28,7 @@ export default class sampleMenuPenerimaan3 extends Component { ...@@ -27,7 +28,7 @@ export default class sampleMenuPenerimaan3 extends Component {
} }
componentDidMount() { componentDidMount() {
// alert(JSON.stringify(this.state.data)) reactotron.log(this.state.data.photo_unit)
} }
async requestCameraPermission(type) { async requestCameraPermission(type) {
...@@ -145,7 +146,7 @@ export default class sampleMenuPenerimaan3 extends Component { ...@@ -145,7 +146,7 @@ export default class sampleMenuPenerimaan3 extends Component {
<View style={{ height: 30, justifyContent: 'center' }}> <View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Foto No Rangka</Text> <Text style={{ fontSize: 13 }}>Foto No Rangka</Text>
</View> </View>
<TouchableOpacity style={styles.viewRangka} onPress={() => this.requestCameraPermission('rangka')}> <TouchableOpacity style={styles.viewRangka} onPress={() => null}>
<View <View
style={{ style={{
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
...@@ -156,7 +157,7 @@ export default class sampleMenuPenerimaan3 extends Component { ...@@ -156,7 +157,7 @@ export default class sampleMenuPenerimaan3 extends Component {
<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: 'cover' }} style={{ width: '100%', height: '100%', resizeMode: 'cover', borderRadius: 5 }}
source={{ uri: data.chassis_number_photo }} source={{ uri: data.chassis_number_photo }}
/> />
} }
...@@ -168,7 +169,7 @@ export default class sampleMenuPenerimaan3 extends Component { ...@@ -168,7 +169,7 @@ export default class sampleMenuPenerimaan3 extends Component {
<View style={{ height: 30, justifyContent: 'center' }}> <View style={{ height: 30, justifyContent: 'center' }}>
<Text style={{ fontSize: 13 }}>Foto No Mesin</Text> <Text style={{ fontSize: 13 }}>Foto No Mesin</Text>
</View> </View>
<TouchableOpacity style={styles.viewRangka} onPress={() => { this.state.imageMesin != '' ? this.setState({ viewerMesin: true }) : this.requestCameraPermission('mesin') }}> <TouchableOpacity style={styles.viewRangka} onPress={() => {null}}>
<View <View
style={{ style={{
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
...@@ -179,7 +180,7 @@ export default class sampleMenuPenerimaan3 extends Component { ...@@ -179,7 +180,7 @@ export default class sampleMenuPenerimaan3 extends Component {
<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', borderRadius: 5 }}
source={{ uri: data.engine_number_photo }} source={{ uri: data.engine_number_photo }}
/> />
} }
...@@ -193,51 +194,36 @@ export default class sampleMenuPenerimaan3 extends Component { ...@@ -193,51 +194,36 @@ export default class sampleMenuPenerimaan3 extends Component {
</View> </View>
<View style={styles.viewFotoUnit}> <View style={styles.viewFotoUnit}>
<View style={{ flexDirection: 'row', height: '45%', justifyContent: 'space-between' }}> <View style={{ flexDirection: 'row', height: '45%', justifyContent: 'space-between' }}>
<View {this.state.data.photo_unit.map((item, index) => {
style={{ if (index < 3) {
width: '30%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5 return (
}} <View
> style={{
width: '30%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
</View> }}
<View >
style={{ <Image source={{uri: item}} resizeMode={'stretch'} style={{height: '100%', width: '100%', borderRadius: 20}}/>
width: '30%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5 </View>
}} )
> }
})}
</View>
<View
style={{
width: '30%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
}}
>
</View>
</View> </View>
<View style={{ flexDirection: 'row', height: '45%', justifyContent: 'space-between' }}> <View style={{ flexDirection: 'row', height: '45%', justifyContent: 'space-between' }}>
<View {this.state.data.photo_unit.map((item, index) => {
style={{ reactotron.log(item)
width: '30%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5 if (index > 2) {
}} return (
> <View
style={{
</View> width: '30%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
<View }}
style={{ >
width: '30%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5 <Image source={{uri: item}} resizeMode={'stretch'} style={{height: '100%', width: '100%', borderRadius: 20}}/>
}} </View>
> )
}
</View> })}
<View
style={{
width: '30%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
}}
>
</View>
</View> </View>
</View> </View>
......
...@@ -4,6 +4,7 @@ import { Container, Fab, Icon } from 'native-base' ...@@ -4,6 +4,7 @@ import { Container, Fab, Icon } from 'native-base'
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 api from '../../../service/api' import api from '../../../service/api'
import { NavigationEvents } from 'react-navigation'
export default class Penerimaan extends Component { export default class Penerimaan extends Component {
...@@ -44,8 +45,10 @@ export default class Penerimaan extends Component { ...@@ -44,8 +45,10 @@ export default class Penerimaan extends Component {
render() { render() {
return ( return (
<Container style={{ flex: 1 }}> <Container style={{ flex: 1 }}>
<NavigationEvents
onDidFocus={() => this.getListData()}
/>
<ScrollView style={{ paddingHorizontal: 20, backgroundColor: '#F5F5F5', paddingTop: 10 }} showsVerticalScrollIndicator={false} > <ScrollView style={{ paddingHorizontal: 20, backgroundColor: '#F5F5F5', paddingTop: 10 }} showsVerticalScrollIndicator={false} >
{this.state.listClar.map((item, index) => { {this.state.listClar.map((item, index) => {
return ( return (
<View key={index} style={{ paddingHorizontal: 7 }}> <View key={index} style={{ paddingHorizontal: 7 }}>
......
...@@ -73,7 +73,7 @@ export default class sampleMenuPenerimaan2 extends Component { ...@@ -73,7 +73,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.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 }}>
...@@ -104,7 +104,7 @@ export default class sampleMenuPenerimaan2 extends Component { ...@@ -104,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={this.state.data == "" ? "" : `${data.brand} - ${data.model}`} value={this.state.data == "" ? "" : `${data.brand}`}
/> />
</View> </View>
<View style={{ width: '40%', flexDirection: 'row', justifyContent: 'space-between', paddingHorizontal: 5 }}> <View style={{ width: '40%', flexDirection: 'row', justifyContent: 'space-between', paddingHorizontal: 5 }}>
......
...@@ -10,6 +10,8 @@ import AwesomeButton from "react-native-really-awesome-button"; ...@@ -10,6 +10,8 @@ import AwesomeButton from "react-native-really-awesome-button";
import DocumentPicker from 'react-native-document-picker' import DocumentPicker from 'react-native-document-picker'
import RNFetchBlob from 'rn-fetch-blob' import RNFetchBlob from 'rn-fetch-blob'
import Colors from '../../../library/colors'; import Colors from '../../../library/colors';
import api from '../../../service/api';
import reactotron from 'reactotron-react-native';
export default class sampleMenuPenerimaan3 extends Component { export default class sampleMenuPenerimaan3 extends Component {
constructor(props) { constructor(props) {
...@@ -90,6 +92,15 @@ export default class sampleMenuPenerimaan3 extends Component { ...@@ -90,6 +92,15 @@ export default class sampleMenuPenerimaan3 extends Component {
} }
} }
handlePenerimaan() {
api.create().postPenerimaan({
contract_id: this.state.data.contract_id
}).then((Response) => {
reactotron.log(Response)
})
this.props.navigation.navigate('Penerimaan')
}
render() { render() {
let { data } = this.state let { data } = this.state
return ( return (
...@@ -259,7 +270,7 @@ export default class sampleMenuPenerimaan3 extends Component { ...@@ -259,7 +270,7 @@ export default class sampleMenuPenerimaan3 extends Component {
progress={!this.state.progress} progress={!this.state.progress}
onPress={next => { onPress={next => {
setTimeout(() => { setTimeout(() => {
this.props.navigation.navigate('Penerimaan') this.handlePenerimaan()
next() next()
}, 300); }, 300);
}} }}
......
...@@ -97,10 +97,14 @@ class Profile extends Component { ...@@ -97,10 +97,14 @@ class Profile extends Component {
<AwesomeButton <AwesomeButton
width={'100%'} raiseLevel={3} springRelease={true} type="primary" width={'100%'} raiseLevel={3} springRelease={true} type="primary"
progress progress
backgroundDarker={'#e3b91f'} backgroundColor={Colors.yellowBasic}
backgroundShadow={'#e3c143'} backgroundShadow={'#DBDBDB'}
backgroundPlaceholder={null}
backgroundDarker={'#FFED75'}
// backgroundDarker={'#e3b91f'}
// backgroundShadow={'#e3c143'}
height={50} height={50}
borderColor={Colors.blackBasic} // borderColor={Colors.blackBasic}
backgroundColor={'#e4b300'} backgroundColor={'#e4b300'}
backgroundProgress={'#ffef85'} backgroundProgress={'#ffef85'}
progressLoadingTime={300} progressLoadingTime={300}
......
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