Commit 15cb4e61 authored by d.arizona's avatar d.arizona

update

parent 70171da7
...@@ -85,7 +85,7 @@ export default class BaseHeader extends Component { ...@@ -85,7 +85,7 @@ export default class BaseHeader extends Component {
</View>} </View>}
{this.props.notification && <View style={{ alignItems: 'center', width: '100%', paddingBottom: 10, paddingHorizontal: 20, height: STATUSBAR_HEIGHT + 60, paddingTop: 50, flexDirection: 'row', justifyContent: 'space-between', backgroundColor: '#4cc9f0' }}> {this.props.notification && <View style={{ alignItems: 'center', width: '100%', paddingBottom: 10, paddingHorizontal: 20, height: STATUSBAR_HEIGHT + 60, paddingTop: 50, flexDirection: 'row', justifyContent: 'space-between', backgroundColor: '#4cc9f0' }}>
<TouchableOpacity onPress={this.props.onBackPress} style={{ marginBottom: -3, flexDirection: 'row' }}> <TouchableOpacity onPress={this.props.onBackPress} style={{ marginBottom: -3, flexDirection: 'row' }}>
<Image source={Images.icon_backwhite} style={{ width: 20, height: 15, alignSelf: 'center' }} /> {/* <Image source={Images.icon_backwhite} style={{ width: 20, height: 15, alignSelf: 'center' }} /> */}
<BaseText text={this.props.leftText} type={'bold'} style={{ marginLeft: 10, color: 'white', fontSize: 16, alignSelf: 'center' }} /> <BaseText text={this.props.leftText} type={'bold'} style={{ marginLeft: 10, color: 'white', fontSize: 16, alignSelf: 'center' }} />
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity style={{ justifyContent: 'center', alignSelf: 'center', marginBottom: -3, }} onPress={this.props.notificationPress}> <TouchableOpacity style={{ justifyContent: 'center', alignSelf: 'center', marginBottom: -3, }} onPress={this.props.notificationPress}>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -20,6 +20,7 @@ import { NavigationEvents } from 'react-navigation'; ...@@ -20,6 +20,7 @@ import { NavigationEvents } from 'react-navigation';
import Toast from 'react-native-toast-message'; import Toast from 'react-native-toast-message';
import Api from '../Services/Api'; import Api from '../Services/Api';
import Constant from '../Lib/Constant' import Constant from '../Lib/Constant'
import { titleCase } from '../Lib/Utils';
class HomePageScreen extends Component { class HomePageScreen extends Component {
constructor(props) { constructor(props) {
...@@ -83,9 +84,9 @@ class HomePageScreen extends Component { ...@@ -83,9 +84,9 @@ class HomePageScreen extends Component {
<View style={{width: '50%', paddingTop: 30}}> <View style={{width: '50%', paddingTop: 30}}>
<Image source={Images.logo_eCart} style={{width: 120, height: 35}}/> <Image source={Images.logo_eCart} style={{width: 120, height: 35}}/>
<View style={{elevation: 5, width: 85, height: 85, borderRadius: 85, borderWidth: 46, borderColor: 'white', marginTop: 25, backgroundColor: 'red', alignItems: 'center', justifyContent: 'center',}}> <View style={{elevation: 5, width: 85, height: 85, borderRadius: 85, borderWidth: 46, borderColor: 'white', marginTop: 25, backgroundColor: 'red', alignItems: 'center', justifyContent: 'center',}}>
<Image source={Images.beautyProduct} style={{width: 85, height: 85, borderRadius: 85}}/> <Image source={{uri: this.state.user != null? 'https://apiecart.eksad.com/' + this.state.user.data.user_image : Images.beautyProduct}} style={{width: 85, height: 85, borderRadius: 85}}/>
</View> </View>
<BaseText type={"bold"} text={'Kang Dadang'} style={{fontSize: 18, color: '#4b4b4b', marginLeft: 5, marginTop: 10}}/> <BaseText type={"bold"} text={this.state.user != null? titleCase(this.state.user.data.user_name) : 'Kang Dadang'} style={{fontSize: 18, color: '#4b4b4b', marginLeft: 5, marginTop: 10}}/>
</View> </View>
<View style={{width: '50%', alignItems:'flex-end'}}> <View style={{width: '50%', alignItems:'flex-end'}}>
{/* <Image source={Images.sliceCircleBlue} style={{width: '100%', height: 150}}/> */} {/* <Image source={Images.sliceCircleBlue} style={{width: '100%', height: 150}}/> */}
......
...@@ -23,7 +23,8 @@ class PaymentMethodScreen extends Component { ...@@ -23,7 +23,8 @@ class PaymentMethodScreen extends Component {
loading: false, loading: false,
currency: '', currency: '',
paymentMethod: [], paymentMethod: [],
paymentID: 0 paymentID: 0,
paymentName: ''
} }
} }
...@@ -51,6 +52,7 @@ class PaymentMethodScreen extends Component { ...@@ -51,6 +52,7 @@ class PaymentMethodScreen extends Component {
this.setState({ loading: true}) this.setState({ loading: true})
Api.create().getPaymentMethod().then(response => { Api.create().getPaymentMethod().then(response => {
if (response.data.status == "success") { if (response.data.status == "success") {
console.log(response.data)
this.setState({ this.setState({
paymentMethod: response.data.data.reverse(), paymentMethod: response.data.data.reverse(),
loading: false loading: false
...@@ -72,6 +74,7 @@ class PaymentMethodScreen extends Component { ...@@ -72,6 +74,7 @@ class PaymentMethodScreen extends Component {
</View> </View>
<View style={{ flexDirection: 'row', marginTop: 10 }}> <View style={{ flexDirection: 'row', marginTop: 10 }}>
<BaseText text={'Use'} type={'regular'} style={{ opacity: .7, fontSize: 12 }} /> <BaseText text={'Use'} type={'regular'} style={{ opacity: .7, fontSize: 12 }} />
<BaseText text={this.state.paymentName} type={'bold'} style={{ opacity: .7, fontSize: 12, marginLeft: 10}} />
</View> </View>
</View> </View>
<View style={{ flex: 1, backgroundColor: '#ececec'}}> <View style={{ flex: 1, backgroundColor: '#ececec'}}>
...@@ -85,23 +88,26 @@ class PaymentMethodScreen extends Component { ...@@ -85,23 +88,26 @@ class PaymentMethodScreen extends Component {
} }
{this.state.paymentMethod.map((item, index) => { {this.state.paymentMethod.map((item, index) => {
return ( return (
<View style={{ flexDirection: 'row', backgroundColor: 'white', padding: 20, borderBottomWidth: 1, borderBottomColor: '#e0e0e0', justifyContent: 'space-between' }}> <TouchableOpacity
onPress={() => {
this.props.navigation.state.params.setProps({paymentMethod: item})
this.setState({
paymentID: item.payment_method_id,
paymentName: item.payment_method_name
});
}}
style={{ flexDirection: 'row', backgroundColor: 'white', padding: 20, borderBottomWidth: 1, borderBottomColor: '#e0e0e0', justifyContent: 'space-between' }}>
<View style={{ flexDirection: 'row' }}> <View style={{ flexDirection: 'row' }}>
<TouchableOpacity <View
style={this.state.paymentID == item.payment_method_id ? styles.radioCircleClick : styles.radioCircle} style={this.state.paymentID == item.payment_method_id ? styles.radioCircleClick : styles.radioCircle}>
onPress={() => {
this.setState({
paymentID: item.payment_method_id,
});
}}>
{this.state.paymentID == item.payment_method_id && <View style={styles.selectedRb} />} {this.state.paymentID == item.payment_method_id && <View style={styles.selectedRb} />}
</TouchableOpacity> </View>
<BaseText text={item.payment_method_name} type={'regular'} style={{ opacity: .7, fontSize: 12, marginLeft: 20 }} /> <BaseText text={item.payment_method_name} type={'regular'} style={{ opacity: .7, fontSize: 12, marginLeft: 20 }} />
</View> </View>
{item.value != 0 && index == 0 ? {item.value != 0 && index == 0 ?
<BaseText text={item.value} type={'regular'} style={{ opacity: .7, fontSize: 12, marginLeft: 20 }} /> : <BaseText text={item.value} type={'regular'} style={{ opacity: .7, fontSize: 12, marginLeft: 20 }} /> :
null} null}
</View> </TouchableOpacity>
) )
})} })}
</View> </View>
......
...@@ -75,7 +75,12 @@ const create = (baseURL = 'https://apiecart.eksad.com/mobile/') => { ...@@ -75,7 +75,12 @@ const create = (baseURL = 'https://apiecart.eksad.com/mobile/') => {
const getWallet = () => api.get('get_wallet') const getWallet = () => api.get('get_wallet')
const topUpWallet = (body) => api.post('topup_wallet', body) const topUpWallet = (body) => api.post('topup_wallet', body)
const getPaymentMethod = () => api.get('get_payment_method') const getPaymentMethod = () => api.get('get_payment_method')
// Courier
const getCategoryCourier = () => api.get('get_category_courier') const getCategoryCourier = () => api.get('get_category_courier')
const getEstimateCourier = (rateId) => api.get(`get_estimate_courier/${rateId}`)
const getEstimateDelivery = (courierId) => api.get(`get_estimate_delivery/${courierId}`)
// Deal Of The Day // Deal Of The Day
const getPeriodeDeal = (body) => api.post('get_deal_product_per_periode', body) const getPeriodeDeal = (body) => api.post('get_deal_product_per_periode', body)
...@@ -189,7 +194,9 @@ const create = (baseURL = 'https://apiecart.eksad.com/mobile/') => { ...@@ -189,7 +194,9 @@ const create = (baseURL = 'https://apiecart.eksad.com/mobile/') => {
getNotification, getNotification,
getDetailNotif, getDetailNotif,
readNotification, readNotification,
readAllNotification readAllNotification,
getEstimateCourier,
getEstimateDelivery,
} }
} }
......
...@@ -52,6 +52,7 @@ const images = { ...@@ -52,6 +52,7 @@ const images = {
icon_coupon: require('../Images/Icons/icon_coupon.png'), icon_coupon: require('../Images/Icons/icon_coupon.png'),
icon_check: require('../Images/Icons/icon_check.png'), icon_check: require('../Images/Icons/icon_check.png'),
icon_pembayaran: require('../Images/Icons/icon_pembayaran.png'), icon_pembayaran: require('../Images/Icons/icon_pembayaran.png'),
icon_delete: require('../Images/Icons/icon_delete.png'),
// big image // big image
letter: require('../Images/letter.png'), letter: require('../Images/letter.png'),
......
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