Commit 6b1962f4 authored by didam's avatar didam

didam

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