Commit 501fb054 authored by Afid's avatar Afid

Merge branch 'master' of ssh://repo.cs.co.id:2222/wahyu/bahanoprek

# Conflicts:
#	view/Account.js
#	view/ShoppingCart.js
parents 6ea744fa fbb969aa
...@@ -31,8 +31,8 @@ import * as Device from 'expo-device'; ...@@ -31,8 +31,8 @@ import * as Device from 'expo-device';
my_long: longitude my_long: longitude
}) })
console.log("MY LAT : " + this.state.my_lat) // console.log("MY LAT : " + this.state.my_lat)
console.log("MY LONG : " + this.state.my_long) // console.log("MY LONG : " + this.state.my_long)
this.getOutlet() this.getOutlet()
} }
......
...@@ -7,6 +7,6 @@ export async function setLogin(email, password) { ...@@ -7,6 +7,6 @@ export async function setLogin(email, password) {
await AsyncStorage.setItem('PASSWORD',password) await AsyncStorage.setItem('PASSWORD',password)
} catch (error) { } catch (error) {
console.log('Gagal Set Login : ' + error) // console.log('Gagal Set Login : ' + error)
} }
} }
...@@ -6,12 +6,12 @@ import ActionType from '../redux/globalActionType'; ...@@ -6,12 +6,12 @@ import ActionType from '../redux/globalActionType';
async function registerForPushNotificationsAsync() { async function registerForPushNotificationsAsync() {
const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS); const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS);
if (status !== 'granted') { if (status !== 'granted') {
console.log('No permission'); // console.log('No permission');
return; return;
} }
let fb_token = await Notifications.getExpoPushTokenAsync(); let fb_token = await Notifications.getExpoPushTokenAsync();
console.log(fb_token); // console.log(fb_token);
let SetPushNotif = { let SetPushNotif = {
fb_token: fb_token fb_token: fb_token
......
...@@ -34,12 +34,13 @@ class Account extends React.Component { ...@@ -34,12 +34,13 @@ class Account extends React.Component {
account_number: "", account_number: "",
expire_date: "", expire_date: "",
premium: "", premium: "",
my_lat:0, my_lat: 0,
my_long:0 my_long: 0
} }
} }
componentDidMount() { componentDidMount() {
this._getProfile() this._getProfile()
this._unsubscribe = this.props.navigation.addListener('focus', () => { this._unsubscribe = this.props.navigation.addListener('focus', () => {
this._getProfile() this._getProfile()
...@@ -86,7 +87,7 @@ class Account extends React.Component { ...@@ -86,7 +87,7 @@ class Account extends React.Component {
session_id: '' session_id: ''
} }
this.props.setConfig(configProps); this.props.setConfig(configProps);
// console.log(this.props.navigation.replace('Login')); this.props.navigation.replace('Login');
} }
_getProfile() { _getProfile() {
...@@ -305,7 +306,7 @@ class Account extends React.Component { ...@@ -305,7 +306,7 @@ class Account extends React.Component {
</View> </View>
</Card> </Card>
</TouchableOpacity> </TouchableOpacity>
):( ) : (
null null
)} )}
<TouchableOpacity onPress={() => this.props.navigation.navigate('Profile')} style={{ marginBottom: 10 }}> <TouchableOpacity onPress={() => this.props.navigation.navigate('Profile')} style={{ marginBottom: 10 }}>
......
...@@ -43,14 +43,14 @@ import ActionType from '../redux/globalActionType'; ...@@ -43,14 +43,14 @@ import ActionType from '../redux/globalActionType';
} }
capture(){ capture(){
console.log('IS SELFIE : ' + this.props.selfie) // console.log('IS SELFIE : ' + this.props.selfie)
console.log('IS IDCARD : ' + this.props.idcard) // console.log('IS IDCARD : ' + this.props.idcard)
if (this.props.selfie === true) { if (this.props.selfie === true) {
this.takePictureSelfie() this.takePictureSelfie()
console.log('ini foto selfie'); // console.log('ini foto selfie');
} else { } else {
this.takePictureIdCard() this.takePictureIdCard()
console.log('ini foto ktp'); // console.log('ini foto ktp');
} }
} }
...@@ -66,7 +66,7 @@ import ActionType from '../redux/globalActionType'; ...@@ -66,7 +66,7 @@ import ActionType from '../redux/globalActionType';
} }
this.props.setUriSelfi(UriProps); this.props.setUriSelfi(UriProps);
this.props.navigation.navigate("Upgrade Premium") this.props.navigation.navigate("Upgrade Premium")
console.log(photo); // console.log(photo);
// console.log("ini sudah di pencet" + photo_img) // console.log("ini sudah di pencet" + photo_img)
} }
} }
......
...@@ -21,7 +21,7 @@ class ChangeEmail extends React.Component { ...@@ -21,7 +21,7 @@ class ChangeEmail extends React.Component {
} }
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/auth/register_change_email', paramater).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/auth/register_change_email', paramater).then(res => {
console.log(res); // console.log(res);
let loginProps = { let loginProps = {
email: this.state.email email: this.state.email
......
...@@ -4,7 +4,7 @@ import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler'; ...@@ -4,7 +4,7 @@ import { ScrollView, TouchableOpacity } from 'react-native-gesture-handler';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import Axios from 'axios'; import Axios from 'axios';
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
import ravLog from '../helper/debug'; // import ravLog from '../helper/debug';
class DeliveryAddrees extends React.Component { class DeliveryAddrees extends React.Component {
constructor(props) { constructor(props) {
......
...@@ -18,20 +18,20 @@ class EmailConfirmation extends React.Component { ...@@ -18,20 +18,20 @@ class EmailConfirmation extends React.Component {
} }
componentDidMount(){ componentDidMount(){
console.log("SESSION " + this.props.session_id) // console.log("SESSION " + this.props.session_id)
} }
handleSubmit() { handleSubmit() {
this.setState({ this.setState({
spinner: true, spinner: true,
}) })
console.log(this.props.isEmailverif) // console.log(this.props.isEmailverif)
if (this.props.isEmailverif === true) { if (this.props.isEmailverif === true) {
let pageProps = { let pageProps = {
pageEmailConfirmation:false pageEmailConfirmation:false
} }
this.props.setPage(pageProps) this.props.setPage(pageProps)
console.log('hai ini gue kalau ada device yang sama!') // console.log('hai ini gue kalau ada device yang sama!')
let params = { let params = {
"session_id":this.props.session_id, "session_id":this.props.session_id,
...@@ -45,7 +45,7 @@ class EmailConfirmation extends React.Component { ...@@ -45,7 +45,7 @@ class EmailConfirmation extends React.Component {
"verification_code": this.state.confirmation_number "verification_code": this.state.confirmation_number
} }
Axios.post(BASE_URL_LOGIN, params).then(res => { Axios.post(BASE_URL_LOGIN, params).then(res => {
console.log('EMAIL CONFIRM : ' + JSON.stringify(res)) // console.log('EMAIL CONFIRM : ' + JSON.stringify(res))
let emailConfirmProps = { let emailConfirmProps = {
isEmailverif:false isEmailverif:false
} }
...@@ -55,7 +55,7 @@ class EmailConfirmation extends React.Component { ...@@ -55,7 +55,7 @@ class EmailConfirmation extends React.Component {
session_id: res.data.session_id session_id: res.data.session_id
} }
console.log('LOGIN PROPS : ' + JSON.stringify(loginProps)) // console.log('LOGIN PROPS : ' + JSON.stringify(loginProps))
this.props.setLoginInfo(loginProps) this.props.setLoginInfo(loginProps)
this.props.setEmailConfirm(emailConfirmProps) this.props.setEmailConfirm(emailConfirmProps)
...@@ -145,7 +145,7 @@ class EmailConfirmation extends React.Component { ...@@ -145,7 +145,7 @@ class EmailConfirmation extends React.Component {
}).catch(error => { }).catch(error => {
let response = error.response.data; let response = error.response.data;
console.log(response); // console.log(response);
this.setState({ this.setState({
spinner: false, spinner: false,
}) })
...@@ -198,7 +198,7 @@ const styles = StyleSheet.create({ ...@@ -198,7 +198,7 @@ const styles = StyleSheet.create({
}) })
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
console.log('EMAIL CONFIRM : ' + JSON.stringify(state)) // console.log('EMAIL CONFIRM : ' + JSON.stringify(state))
return { return {
isEmailverif: state.isEmailverif, isEmailverif: state.isEmailverif,
email: state.email, email: state.email,
......
...@@ -34,6 +34,9 @@ class Home extends React.Component { ...@@ -34,6 +34,9 @@ class Home extends React.Component {
this._renderCarousell() this._renderCarousell()
this._account(); this._account();
this._unsubscribe = this.props.navigation.addListener('focus', () => { this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator:true,
})
this._getPermissions() this._getPermissions()
this._renderCarousell() this._renderCarousell()
this._account(); this._account();
...@@ -151,7 +154,11 @@ class Home extends React.Component { ...@@ -151,7 +154,11 @@ class Home extends React.Component {
_orderNow = () => { _orderNow = () => {
if (this.props.outlet_id != '' && this.props.name_outlet != '') { if (this.props.outlet_id != '' && this.props.name_outlet != '') {
this.props.setTypePickup(true) this.props.setTypePickup(true)
this.props.navigation.navigate("Menu Select") this.props.navigation.navigate('Home', {
screen: 'MENU',
params: { user: 'jaxi' },
});
} else { } else {
Alert.alert('Belum dapat outlet terdekat') Alert.alert('Belum dapat outlet terdekat')
} }
......
...@@ -30,7 +30,7 @@ class Login extends React.Component { ...@@ -30,7 +30,7 @@ class Login extends React.Component {
} }
componentDidMount(){ componentDidMount(){
console.log(this.props.language) // console.log(this.props.language)
} }
async handleLoggin() { async handleLoggin() {
...@@ -61,7 +61,7 @@ class Login extends React.Component { ...@@ -61,7 +61,7 @@ class Login extends React.Component {
fb_token: fb_token, fb_token: fb_token,
os_version: os_version, os_version: os_version,
} }
console.log(deviceInfoProps); // console.log(deviceInfoProps);
this.props.setDeviceInfo(deviceInfoProps) this.props.setDeviceInfo(deviceInfoProps)
} }
...@@ -116,7 +116,7 @@ class Login extends React.Component { ...@@ -116,7 +116,7 @@ class Login extends React.Component {
"os_version": this.state.os_version, "os_version": this.state.os_version,
"app_version": this.state.app_version, "app_version": this.state.app_version,
} }
console.log(params) // console.log(params)
Axios.post(BASE_URL_LOGIN, params).then(res => { Axios.post(BASE_URL_LOGIN, params).then(res => {
const navigation = this.props.navigation const navigation = this.props.navigation
......
...@@ -20,13 +20,13 @@ class MenuConfirmation extends React.Component { ...@@ -20,13 +20,13 @@ class MenuConfirmation extends React.Component {
} }
componentDidMount(){ componentDidMount(){
console.log(" DESTINASI : "+ this.props.grabdestination) // console.log(" DESTINASI : "+ this.props.grabdestination)
console.log("ONGKIR"+ this.props.grabamount) // console.log("ONGKIR"+ this.props.grabamount)
console.log("drop off"+this.props.grabdropoff) // console.log("drop off"+this.props.grabdropoff)
console.log("pickup"+this.props.grabpickup) // console.log("pickup"+this.props.grabpickup)
console.log("type" +this.props.grabtype) // console.log("type" +this.props.grabtype)
console.log("BALANCED" +this.props.balanceUsed) // console.log("BALANCED" +this.props.balanceUsed)
console.log("POINT" +this.props.pointsused) // console.log("POINT" +this.props.pointsused)
} }
...@@ -83,9 +83,10 @@ class MenuConfirmation extends React.Component { ...@@ -83,9 +83,10 @@ class MenuConfirmation extends React.Component {
orderSuccess = () => { orderSuccess = () => {
this.props.setOrderFinish() this.props.setOrderFinish()
this.props.navigation.reset({ this.props.navigation.navigate('Home', {
routes: [{ name: 'Home' }] screen: 'ORDER',
}) params: { user: 'jax' },
});
} }
......
...@@ -23,8 +23,10 @@ class MenuSelection extends React.Component { ...@@ -23,8 +23,10 @@ class MenuSelection extends React.Component {
} }
} }
componentDidMount() { componentDidMount() {
if (this.props.outlet_id != '') { if (this.props.outlet_id != '') {
this.getMenuList() this.getMenuList()
} else { } else {
Alert.alert('Device belum mendapatkan lokasi anda') Alert.alert('Device belum mendapatkan lokasi anda')
...@@ -32,6 +34,9 @@ class MenuSelection extends React.Component { ...@@ -32,6 +34,9 @@ class MenuSelection extends React.Component {
// console.log("INI OUTLET : "+ this.props.outlet_id) // console.log("INI OUTLET : "+ this.props.outlet_id)
this._unsubscribe = this.props.navigation.addListener('focus', () => { this._unsubscribe = this.props.navigation.addListener('focus', () => {
if (this.props.outlet_id != '') { if (this.props.outlet_id != '') {
this.setState({
indicator:true
})
this.getMenuList() this.getMenuList()
} else { } else {
Alert.alert('Device belum mendapatkan lokasi anda') Alert.alert('Device belum mendapatkan lokasi anda')
...@@ -203,7 +208,7 @@ class MenuSelection extends React.Component { ...@@ -203,7 +208,7 @@ class MenuSelection extends React.Component {
</View> </View>
<View style={{ flex: 3 }}> <View style={{ flex: 3 }}>
{this.state.indicator == true ? ( {this.state.indicator == true ? (
<ActivityIndicator style={{top:10}} size="large" color="#c9af6d" /> <ActivityIndicator style={{ top: 10 }} size="large" color="#c9af6d" />
) : ( ) : (
<FlatList <FlatList
...@@ -220,10 +225,17 @@ class MenuSelection extends React.Component { ...@@ -220,10 +225,17 @@ class MenuSelection extends React.Component {
)} )}
</View> </View>
<View style={styles.shadow}> <View style={styles.shadow}>
{
this.state.indicator == true ? (<ActivityIndicator style={{ top: 10 }} size="large" color="#c9af6d" />):(
<View style={{ flexDirection: 'row', }}> <View style={{ flexDirection: 'row', }}>
<Text style={{ fontSize: 12, margin: 10 }}> Price Estimation / Item {this.props.order_quantity} </Text> <Text style={{ fontSize: 12, margin: 10 }}> Price Estimation / Item {this.props.order_quantity} </Text>
<Text style={{ fontSize: 20, margin: 10, marginBottom: 10 }}> Rp. {this.props.order_total}</Text> <Text style={{ fontSize: 20, margin: 10, marginBottom: 10 }}> Rp. {this.props.order_total}</Text>
</View> </View>
)
}
<View> <View>
<Button title="VIEW CART" onPress={() => this.props.navigation.navigate('Shopping Cart')}></Button> <Button title="VIEW CART" onPress={() => this.props.navigation.navigate('Shopping Cart')}></Button>
</View> </View>
......
...@@ -18,7 +18,7 @@ class NewPassword extends React.Component { ...@@ -18,7 +18,7 @@ class NewPassword extends React.Component {
} }
componentDidMount(){ componentDidMount(){
console.log(this.props) // console.log(this.props)
} }
validation(){ validation(){
...@@ -50,7 +50,7 @@ class NewPassword extends React.Component { ...@@ -50,7 +50,7 @@ class NewPassword extends React.Component {
'password': this.state.password, 'password': this.state.password,
'password_confirmation': this.state.password_confirmation 'password_confirmation': this.state.password_confirmation
} }
console.log(params); // console.log(params);
Axios.post(BASE_URL_NEW_PASSWORD,params).then(res => { Axios.post(BASE_URL_NEW_PASSWORD,params).then(res => {
this.setState({ this.setState({
spinner: false, spinner: false,
......
...@@ -174,9 +174,9 @@ class NewRegister extends React.Component { ...@@ -174,9 +174,9 @@ class NewRegister extends React.Component {
// "domicile": this.state.domicilie, // "domicile": this.state.domicilie,
} }
console.log(parameter); // console.log(parameter);
Axios.post(BASE_URL_REGISTER, parameter).then(res => { Axios.post(BASE_URL_REGISTER, parameter).then(res => {
console.log(res); // console.log(res);
let registerProps = { let registerProps = {
email: this.state.email, email: this.state.email,
full_name: this.state.full_name, full_name: this.state.full_name,
...@@ -215,7 +215,7 @@ class NewRegister extends React.Component { ...@@ -215,7 +215,7 @@ class NewRegister extends React.Component {
this.setState({ this.setState({
spinner: false, spinner: false,
}) })
console.log(JSON.stringify(error.response)); // console.log(JSON.stringify(error.response));
let response = error.response.data; let response = error.response.data;
Alert.alert( Alert.alert(
'', '',
......
...@@ -31,9 +31,9 @@ class OrderDetail extends React.Component { ...@@ -31,9 +31,9 @@ class OrderDetail extends React.Component {
} }
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/detail', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/detail', params).then(res => {
let data = res.data let data = res.data
console.log("INI OUTLET "+ data.outlet) // console.log("INI OUTLET "+ data.outlet)
console.log("OUTLET-CODE" + data.outlet_code) // console.log("OUTLET-CODE" + data.outlet_code)
console.log("TRANS-DISPLAY" + data.trans_type_display) // console.log("TRANS-DISPLAY" + data.trans_type_display)
this.setState({ this.setState({
outlet: data.outlet, outlet: data.outlet,
......
import React from 'react'; import React from 'react';
import { View, Text, TextInput, StyleSheet, ScrollView, Alert, TouchableOpacity } from 'react-native'; import { View, Text, TextInput, StyleSheet, ScrollView, Alert, TouchableOpacity,ActivityIndicator } from 'react-native';
import { Card } from 'react-native-shadow-cards' import { Card } from 'react-native-shadow-cards'
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import Axios from 'axios'; import Axios from 'axios';
...@@ -9,30 +9,49 @@ class OrderHistory extends React.Component { ...@@ -9,30 +9,49 @@ class OrderHistory extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
order_list: [] order_list: [],
indicator: true
} }
} }
componentDidMount() { componentDidMount() {
this.getOrderHistory()
this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator:true,
})
this.getOrderHistory() this.getOrderHistory()
});
} }
componentWillUnmount() {
this._unsubscribe();
}
// componentDidMount() {
// this.getOrderHistory()
// }
getOrderHistory() { getOrderHistory() {
let params = { let params = {
session_id: this.props.session_id session_id: this.props.session_id
} }
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/list', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/list', params).then(res => {
let data = res.data.data let data = res.data.data
console.log(data) // console.log(data)
this.setState({ this.setState({
order_list: data order_list: data,
indicator: false,
}) })
}).catch(error => { }).catch(error => {
let response = error.response.data; let response = error.response.data;
Alert.alert(response.msg); Alert.alert(response.msg);
this.setState({
indicator: false,
})
}) })
} }
...@@ -42,9 +61,9 @@ class OrderHistory extends React.Component { ...@@ -42,9 +61,9 @@ class OrderHistory extends React.Component {
<View style={styles.container}> <View style={styles.container}>
<ScrollView style={styles.body}> <ScrollView style={styles.body}>
{ {this.state.indicator == true ? (<ActivityIndicator style={{ justifyContent: "center" }} size="large" color="#c9af6d" />) :
this.state.order_list.map((item, key) => ( this.state.order_list.map((item, key) => (
<TouchableOpacity key={key} onPress={() => this.props.navigation.navigate('Order Detail', {idTrans:item.id})}> <TouchableOpacity key={key} onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: item.id })}>
<View key={key}> <View key={key}>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}> <Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<Text>OUTLET : {item.outlet}</Text> <Text>OUTLET : {item.outlet}</Text>
......
...@@ -83,7 +83,11 @@ class PickupName extends React.Component { ...@@ -83,7 +83,11 @@ class PickupName extends React.Component {
if (this.props.route.params.from == 'shoppingCart') { if (this.props.route.params.from == 'shoppingCart') {
this.props.navigation.navigate('Shopping Cart', {outlet_change: true, outlet_id: id}) this.props.navigation.navigate('Shopping Cart', {outlet_change: true, outlet_id: id})
} else { } else {
this.props.navigation.navigate("Menu Select")
this.props.navigation.navigate('Home', {
screen: 'MENU',
params: { user: 'jane' },
})
} }
} }
......
...@@ -50,8 +50,8 @@ export default class Register extends React.Component { ...@@ -50,8 +50,8 @@ export default class Register extends React.Component {
list_domicilie: list_domicilie, list_domicilie: list_domicilie,
}) })
console.log(this.state.list_gender); // console.log(this.state.list_gender);
console.log(this.state.list_domicilie); // console.log(this.state.list_domicilie);
}) })
} }
...@@ -71,7 +71,7 @@ export default class Register extends React.Component { ...@@ -71,7 +71,7 @@ export default class Register extends React.Component {
"domicile": this.state.domicilie, "domicile": this.state.domicilie,
} }
console.log(parameter); // console.log(parameter);
Axios.post(BASE_URL_REGISTER, parameter).then(res => { Axios.post(BASE_URL_REGISTER, parameter).then(res => {
console.log('sukses'); console.log('sukses');
}).catch(error => { }).catch(error => {
......
...@@ -24,14 +24,14 @@ class Renewal extends React.Component { ...@@ -24,14 +24,14 @@ class Renewal extends React.Component {
let params = { let params = {
session_id: this.props.session_id session_id: this.props.session_id
} }
console.log(params); // console.log(params);
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/card/renewal', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/card/renewal', params).then(res => {
// console.log('ini res ' + JSON.stringify(res.data)) // console.log('ini res ' + JSON.stringify(res.data))
this._getProfile(); this._getProfile();
Alert.alert('Renewal Berhasil'); Alert.alert('Renewal Berhasil');
}).catch(error => { }).catch(error => {
let response = error.response.data; let response = error.response.data;
console.log(response.msg) // console.log(response.msg)
Alert.alert(response.msg); Alert.alert(response.msg);
}) })
} }
...@@ -42,7 +42,7 @@ class Renewal extends React.Component { ...@@ -42,7 +42,7 @@ class Renewal extends React.Component {
} }
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile', params).then(res => {
console.log('ini res ' + JSON.stringify(res.data)) // console.log('ini res ' + JSON.stringify(res.data))
const dataCard = res.data const dataCard = res.data
let balance = dataCard.kaspro_balance let balance = dataCard.kaspro_balance
...@@ -65,7 +65,7 @@ class Renewal extends React.Component { ...@@ -65,7 +65,7 @@ class Renewal extends React.Component {
}).catch(error => { }).catch(error => {
console.log('ini error ' + error) // console.log('ini error ' + error)
}) })
} }
......
...@@ -44,7 +44,6 @@ class ShoppingCart extends React.Component { ...@@ -44,7 +44,6 @@ class ShoppingCart extends React.Component {
if (!this.props.type_pickup) { if (!this.props.type_pickup) {
this.getRate() this.getRate()
} }
this.getBalance() this.getBalance()
this._unsubscribe = this.props.navigation.addListener('focus', () => { this._unsubscribe = this.props.navigation.addListener('focus', () => {
...@@ -89,7 +88,7 @@ class ShoppingCart extends React.Component { ...@@ -89,7 +88,7 @@ class ShoppingCart extends React.Component {
pointsused: 0, pointsused: 0,
balanceused: 0 balanceused: 0
}) })
this.props.navigation.navigate("Delivery Address", {from : 'shoppingCart'}) this.props.navigation.navigate("Delivery Address", { from: 'shoppingCart' })
} else { } else {
// let typeProps = { // let typeProps = {
// type_pickup: true, // type_pickup: true,
...@@ -102,7 +101,7 @@ class ShoppingCart extends React.Component { ...@@ -102,7 +101,7 @@ class ShoppingCart extends React.Component {
pointsused: 0, pointsused: 0,
balanceused: 0 balanceused: 0
}) })
this.props.navigation.navigate('Pickup Name', {from : 'shoppingCart'}) this.props.navigation.navigate('Pickup Name', { from: 'shoppingCart' })
} }
} }
...@@ -134,6 +133,7 @@ class ShoppingCart extends React.Component { ...@@ -134,6 +133,7 @@ class ShoppingCart extends React.Component {
} }
if (quantity == 0) { if (quantity == 0) {
Alert.alert("Apakah anda ingin menghapus pesanan?");
const order_item = { const order_item = {
id: item.id, id: item.id,
name: item.name, name: item.name,
...@@ -147,8 +147,6 @@ class ShoppingCart extends React.Component { ...@@ -147,8 +147,6 @@ class ShoppingCart extends React.Component {
this.props.removeFromChart(order_item) this.props.removeFromChart(order_item)
} }
} }
} }
} }
...@@ -273,9 +271,6 @@ class ShoppingCart extends React.Component { ...@@ -273,9 +271,6 @@ class ShoppingCart extends React.Component {
this.props.setGrab(setGrabProps); this.props.setGrab(setGrabProps);
// console.log("INI SUKSES RESPONNYA ") // console.log("INI SUKSES RESPONNYA ")
// console.log('Delivery Amount Cart : ' + res.data.data.amount)
let OutletChange = { let OutletChange = {
outlet_id: res.data.data.outlet_id, outlet_id: res.data.data.outlet_id,
name_outlet: res.data.data.outlet_name, name_outlet: res.data.data.outlet_name,
...@@ -290,7 +285,7 @@ class ShoppingCart extends React.Component { ...@@ -290,7 +285,7 @@ class ShoppingCart extends React.Component {
this.props.setOrder(setOrdersProps); this.props.setOrder(setOrdersProps);
}).catch(error => { }).catch(error => {
console.log('ini error ' + error) // console.log('ini error ' + error)
}) })
} }
...@@ -317,7 +312,7 @@ class ShoppingCart extends React.Component { ...@@ -317,7 +312,7 @@ class ShoppingCart extends React.Component {
// console.log(this.state.kasproBalance, this.state.kasproPoint) // console.log(this.state.kasproBalance, this.state.kasproPoint)
}).catch(error => { }).catch(error => {
console.log('ini error ' + error) // console.log('ini error ' + error)
}) })
} }
...@@ -575,6 +570,10 @@ class ShoppingCart extends React.Component { ...@@ -575,6 +570,10 @@ class ShoppingCart extends React.Component {
</View> </View>
)} )}
</View> </View>
{this.props.type_pickup == true ? (
null
) : (
<View style={{ flexDirection: 'row', marginTop: 10, justifyContent: 'space-between' }}> <View style={{ flexDirection: 'row', marginTop: 10, justifyContent: 'space-between' }}>
<View> <View>
<Text style={{ paddingLeft: 20, paddingTop: 10, color: 'gray' }}>Tujuan</Text> <Text style={{ paddingLeft: 20, paddingTop: 10, color: 'gray' }}>Tujuan</Text>
...@@ -583,6 +582,8 @@ class ShoppingCart extends React.Component { ...@@ -583,6 +582,8 @@ class ShoppingCart extends React.Component {
<Text style={{ color: '#ccb46c' }}>{this.props.address}</Text> <Text style={{ color: '#ccb46c' }}>{this.props.address}</Text>
</View> </View>
</View> </View>
)}
<View style={{ margin: 20, }}> <View style={{ margin: 20, }}>
<Button title='Checkout' color='#ccb46c' onPress={() => this.checkOut()} /> <Button title='Checkout' color='#ccb46c' onPress={() => this.checkOut()} />
</View> </View>
...@@ -809,5 +810,4 @@ const mapStateToProps = (state) => { ...@@ -809,5 +810,4 @@ const mapStateToProps = (state) => {
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(ShoppingCart) export default connect(mapStateToProps, mapDispatchToProps)(ShoppingCart)
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