Commit 692c6cd3 authored by Deni Rinaldi's avatar Deni Rinaldi

tambahan buat demo katanya

parent 3a4d696a
import React, { Component } from 'react'
import { Text, View, TextInput, ScrollView, StyleSheet } from 'react-native'
import { Text, View, TextInput, ScrollView, StyleSheet, BackHandler } from 'react-native'
import { Collapse, CollapseHeader, CollapseBody } from "accordion-collapse-react-native";
import { Thumbnail, List, ListItem, Separator, Container } from 'native-base';
import { RadioButton } from 'react-native-paper';
......@@ -39,10 +39,31 @@ export default class sampleMenuAppraisal3 extends Component {
}
}
validasi(){
componentDidMount() {
BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonClick);
}
componentWillUnmount() {
BackHandler.removeEventListener('hardwareBackPress', this.handleBackButtonClick);
}
handleBackButtonClick = () => {
this.props.navigation.goBack()
return true;
}
validasi() {
api.create().postAppraisal({
contract_id: this.props.navigation.state.params.contract_id
}).then((response) => {
}).then((response) => {
this.props.navigation.navigate('Appraisal')
})
}
draftData() {
api.create().postDraftAppraisal({
contract_id: this.state.data.contract_id
}).then((response) => {
this.props.navigation.navigate('Appraisal')
})
}
......@@ -239,7 +260,7 @@ export default class sampleMenuAppraisal3 extends Component {
</View>
</View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5 }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5 }}>
<View style={{ height: 30, justifyContent: 'center', width: '50%' }}>
<Text style={{ fontSize: 13 }}>Shock Depan</Text>
</View>
......@@ -645,7 +666,29 @@ export default class sampleMenuAppraisal3 extends Component {
{/* <View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingVertical: 2.5 }}>
</View> */}
<View style={{ width: '100%', justifyContent: 'flex-end', marginTop: 20, alignSelf: 'center', alignContent: 'flex-end', alignItems: 'center', marginBottom: 20 }}>
<View style={{ width: '100%', justifyContent: 'space-evenly', marginTop: 20, alignSelf: 'center', alignContent: 'flex-end', alignItems: 'center', marginBottom: 20, flexDirection: 'row' }}>
<AwesomeButton
backgroundColor={Colors.yellowBasic}
backgroundShadow={'#DBDBDB'}
backgroundPlaceholder={null}
backgroundDarker={'#FFED75'}
backgroundProgress={null}
width={120}
height={45}
raiseLevel={5}
borderRadius={10}
progressLoadingTime={1000}
progress={!this.state.progress}
onPress={next => {
setTimeout(() => {
this.draftData()
next()
}, 300);
}}
>
<Text style={{ color: 'black', fontWeight: '700' }}>Draft</Text>
</AwesomeButton>
<AwesomeButton
backgroundColor={Colors.yellowBasic}
backgroundShadow={'#DBDBDB'}
......@@ -660,7 +703,7 @@ export default class sampleMenuAppraisal3 extends Component {
progress={!this.state.progress}
onPress={next => {
setTimeout(() => {
this.validasi()
this.validasi()
next()
}, 300);
}}
......
......@@ -67,7 +67,7 @@ export default class Penerimaan extends Component {
return (
<View key={index} style={{ paddingHorizontal: 7 }}>
{!this.state.loading && (
<TouchableOpacity style={{ marginTop: 10, borderRadius: 20 }} onPress={() => this.props.navigation.navigate('MenuPenerimaan', { data: item })}>
<TouchableOpacity style={{ marginTop: 10, borderRadius: 20 }} onPress={() => this.props.navigation.navigate('MenuPenerimaan', { data: item, type: 'clar' })}>
<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.contract_number}</Text>
......@@ -112,7 +112,7 @@ export default class Penerimaan extends Component {
containerStyle={{}}
style={{ backgroundColor: '#e4b300' }}
position="bottomRight"
onPress={() => this.props.navigation.navigate('MenuPenerimaan', { data: "" })}
onPress={() => this.props.navigation.navigate('MenuPenerimaan', { data: ""})}
>
<Icon name="add" />
</Fab>
......
import React, { Component } from 'react'
import { Text, View, TextInput, ScrollView, StyleSheet } from 'react-native'
import { Text, View, TextInput, ScrollView, StyleSheet, BackHandler } from 'react-native'
import { Container } from 'native-base'
import { RadioButton } from 'react-native-paper';
import StepIndicator from 'react-native-step-indicator';
......@@ -25,7 +25,16 @@ export default class sampleMenuPenerimaan2 extends Component {
}
componentDidMount(){
// alert(JSON.stringify(this.state.data))
BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonClick);
}
componentWillUnmount() {
BackHandler.removeEventListener('hardwareBackPress', this.handleBackButtonClick);
}
handleBackButtonClick = () => {
this.props.navigation.goBack()
return true;
}
render() {
......
import React, { Component } from 'react'
import { Text, View, TextInput, ScrollView, StyleSheet, TouchableOpacity, PermissionsAndroid, Image, Modal } from 'react-native'
import { Text, View, TextInput, ScrollView, StyleSheet, TouchableOpacity, PermissionsAndroid, Image, Modal, BackHandler } from 'react-native'
import ImagePicker from 'react-native-image-picker';
import { Container } from 'native-base'
import { RadioButton } from 'react-native-paper';
......@@ -45,8 +45,17 @@ export default class sampleMenuPenerimaan3 extends Component {
photo6: this.props.navigation.state.params.data.photo_unit[5]
})
}
// alert(JSON.stringify(this.state.data))
// alert(JSON.stringify(this.state.data)) componentDidMount(){
BackHandler.addEventListener('hardwareBackPress', this.handleBackButtonClick);
}
componentWillUnmount() {
BackHandler.removeEventListener('hardwareBackPress', this.handleBackButtonClick);
}
handleBackButtonClick = () => {
this.props.navigation.goBack()
return true;
}
async requestCameraPermission(type) {
......@@ -119,8 +128,11 @@ export default class sampleMenuPenerimaan3 extends Component {
uri: res.uri
})
this.setState({
imageMesin: res.uri, mesinArray
}, () => alert(this.state.mesinArray))
data: {
...this.state.data,
engine_number_photo: res.uri
}
})
}
})
......@@ -169,12 +181,7 @@ export default class sampleMenuPenerimaan3 extends Component {
>
<View style={{ height: '85%' }}>
<ImageViewer
imageUrls={this.state.mesinArray}
// enableSwipeDown={true}
// index={this.state.Index}
// onSwipeDown={() => this.props.navigation.goBack()}
// onChange={(item) => this.next(item)}
// renderIndicator={() => (<View />)}
imageUrls={this.state.mesinArray}
/>
</View>
</Modal>
......@@ -234,7 +241,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={() => { this.requestCameraPermission('mesin') }}>
<View
style={{
width: '100%', height: '100%', borderColor: 'rgba(237, 57, 99, .5)', borderStyle: 'dotted', borderWidth: 2, borderRadius: 5
......@@ -370,8 +377,7 @@ export default class sampleMenuPenerimaan3 extends Component {
</View>
<Text style={{ fontSize: 10 }}>Belakang Kiri</Text>
</TouchableOpacity>
</View>
</View>
</View>
</View>
</ScrollView>
......@@ -456,6 +462,6 @@ const styles = StyleSheet.create({
viewInputEnable: { width: '63%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, justifyContent: 'center', height: 30, borderRadius: 5 },
viewInputDisable: { width: '63%', backgroundColor: '#E6E6E6', justifyContent: 'center', height: 30, borderRadius: 5 },
viewRangka: { width: '63%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, borderRadius: 5, padding: 10, height: 100, justifyContent: 'space-between' },
viewFotoUnit: { width: '63%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, borderRadius: 5, padding: 10, height: 150, justifyContent: 'space-between' },
viewFotoUnit: { width: '63%', borderColor: 'rgba(237, 57, 99, .5)', borderWidth: .8, borderRadius: 5, paddingHorizontal: 10, paddingVertical:20, height: 150, justifyContent: 'space-between' },
textInput: { paddingHorizontal: 10, paddingVertical: 0, color: '#999999' },
})
......@@ -57,6 +57,8 @@ const create = () => {
const postRejectApproval = (value) => POST('demo/rejecting_approval', value)
const postApprovalDetail = (value) => POST('demo/approval_detail', value)
const getHistory = () => GET('demo/get_history')
const getBranch = () => GET('demo/get_branch')
const getListClarByBranch = (value) => POST('demo/get_clar_by_branch_code', value)
return {
......@@ -74,7 +76,9 @@ const create = () => {
postPenolakan,
postDraftAppraisal,
postRejectApproval,
postApprovalDetail
postApprovalDetail,
getBranch,
getListClarByBranch
}
}
......
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