Commit 8b89561d authored by Trisno's avatar Trisno
parents 68fc5794 f5b33cc3
{
"expo": {
"name": "Excelso_update v1.12.05.2020",
"name": "Excelso_update v1. Sore_12.05.2020",
"slug": "excelso-pro",
"privacy": "public",
"sdkVersion": "36.0.0",
......
......@@ -48,22 +48,12 @@ import OrderDetail from './OrderDetail';
import RewardsList from './RewardsList';
import RewardDetail from './RewardDetail';
import RewardSelect from './RewardSelect';
import Outlets from './Outlets';
import RewardHistory from './RewardHistory';
enableScreens();
function Outlets() {
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>
Outlets !
</Text>
</View>
)
}
const Tab = createBottomTabNavigator();
function HomePage({navigation}) {
......@@ -161,7 +151,9 @@ class Auth extends React.Component {
<Stack.Screen name="Card Info" component={CardInfo} />
<Stack.Screen name="Shopping Cart" component={ShoppingCart} />
<Stack.Screen name="Order History" component={OrderHistory} />
<Stack.Screen name="Reward History" component={RewardHistory} />
<Stack.Screen name="Order Detail" component={OrderDetail} options={({ navigation, route }) => ({ headerLeft: props => <HeaderBackButton {...props} onPress={()=>navigation.navigate('Home',{screen:'ORDER'})}/>,
})}/>
</>
......
......@@ -294,7 +294,7 @@ class Home extends React.Component {
<TouchableOpacity style={styles.submitUpgradePemium} activeOpacity={.5} onPress={this.onPress}>
<Text style={{ textAlign: 'center', bottom: 5, color: 'white' }}>TOP BALANCE </Text>
</TouchableOpacity>
<Text>12 May 2019 </Text>
<Text> sore 12 May 2019 </Text>
<View style={{ height: 60 }}></View>
</View>
</View>
......
This diff is collapsed.
......@@ -88,7 +88,7 @@ class RewardDetail extends React.Component {
}
useDVoucher() {
this.props.navigation.navigate('Order Detail')
this.props.navigation.navigate('Reward History')
}
......
import React from 'react';
import { View, Text, Image, StyleSheet, ScrollView, Alert, TouchableOpacity } from 'react-native';
import { Card } from 'react-native-shadow-cards'
import { connect } from 'react-redux';
import Axios from 'axios';
import moment from 'moment'
class RewardHistory extends React.Component {
constructor(props) {
super(props)
this.state = {
rewardsList: []
}
}
componentDidMount() {
this.getRewardsList()
this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.getRewardsList()
});
}
componentWillUnmount() {
this._unsubscribe()
}
getRewardsList() {
let params = {
session_id: this.props.session_id
}
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/reward/history', params).then(res => {
let data = res.data.rewards
// console.log(data)
data.map((item,key) => {
// console.log(item.expire_time)
item.expire_time = moment(item.expire_time).format("DD MMMM YYYY")
item.used_time = moment(item.used_time).format("DD MMMM YYYY")
})
// console.log(data)
this.setState({
rewardsList: data
})
}).catch(error => {
let response = error.response.data;
Alert.alert(response.status, response.msg);
})
}
render() {
return (
<View style={styles.container}>
<ScrollView style={styles.body}>
{
this.state.rewardsList.map((item, key) => (
<TouchableOpacity key={key} onPress={() => this.props.navigation.navigate('Reward Detail', { rewardId: item.id })}>
<View style={{ alignItems: 'center' }}>
<Card style={{ padding: 5, margin: 10 }}>
<View>
<Image source={{ uri: item.reward.title_image }}
resizeMethod="resize"
resizeMode='cover'
style={{ height: 150, width: '100%' }} />
</View>
<View style={{ flexDirection: 'row', justifyContent:'space-between', padding:10 }}>
<View>
<Text style={{fontWeight:'bold', textAlign:'left'}}>{item.reward.title}</Text>
<Text style={{textAlign:'left'}}>{item.reward.subtitle}</Text>
</View>
<View>
<Text style={{textAlign:'right'}}>Digunakan:</Text>
<Text style={{textAlign:'right'}}>{item.used_time}</Text>
</View>
</View>
</Card>
</View>
</TouchableOpacity>
))
}
</ScrollView>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white',
},
header: {
flex: 0.1,
backgroundColor: '#ccb46c',
justifyContent: 'center'
},
body: {
flex: 3,
},
list_detail_order: {
flex: 1,
margin: 20,
borderWidth: 1,
}
})
const mapStateToProps = (state) => {
return {
session_id: state.session_id,
}
}
export default connect(mapStateToProps)(RewardHistory);
\ No newline at end of file
......@@ -96,17 +96,17 @@ class RewardSelect extends React.Component {
<View>
<Image source={{ uri: item.reward.title_image }}
resizeMethod="resize"
resizeMode='cover'
style={{ height: 150, width: '100%' }} />
resizeMode='stretch'
style={{ height: 150, width: 430 }} />
</View>
<View style={{ flexDirection: 'row', justifyContent:'space-between', padding:10 }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}>
<View>
<Text style={{fontWeight:'bold', textAlign:'left'}}>{item.reward.title}</Text>
<Text style={{textAlign:'left'}}>{item.reward.subtitle}</Text>
<Text style={{ fontWeight: 'bold' }}>{item.reward.title}</Text>
<Text>{item.reward.subtitle}</Text>
</View>
<View>
<Text style={{textAlign:'right'}}>Expired</Text>
<Text style={{textAlign:'right'}}>{item.expire_time}</Text>
<Text style={{ textAlign: 'right' }}>Expired</Text>
<Text style={{ textAlign: 'right' }}>{item.expire_time}</Text>
</View>
</View>
</Card>
......
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