Commit 51963584 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

change

parent 3c9b1e99
{
"expo": {
"name": "Excelso_update v1.08.05.2020",
"name": "Excelso_update v1.11.05.2020",
"slug": "excelso-pro",
"privacy": "public",
"sdkVersion": "36.0.0",
......
This diff is collapsed.
......@@ -32,6 +32,7 @@
"react": "~16.9.0",
"react-currency-format": "^1.0.0",
"react-dom": "~16.9.0",
"react-htmltext": "^0.40.2",
"react-material-ui-form-validator": "^2.0.10",
"react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz",
"react-native-check-box": "^2.1.7",
......@@ -61,7 +62,7 @@
"react-native-view-pager": "^0.2.3",
"react-native-view-shot": "3.0.2",
"react-native-web": "~0.11.7",
"react-native-webview": "^9.0.1",
"react-native-webview": "^7.4.3",
"react-navigation": "^4.2.2",
"react-redux": "^7.2.0",
"react-redux-i18n": "^1.9.3",
......
......@@ -34,7 +34,7 @@ const ActionType = {
SET_ORDER_FINISH: 'SET_ORDER_FINISH',
UPDATE_MENU: 'UPDATE_MENU',
CHANGE_QUANTITY: 'CHANGE_QUANTITY',
SET_CORDINAT :'SET_CORDINAT',
SET_TRANS_ID:'SET_TRANS_ID',
CHANGE_TO_CHART:'CHANGE_TO_CHART'
}
......
......@@ -76,7 +76,10 @@ const globalState = {
balanceUsed:'',
pointused:'',
trans_id:''
trans_id:'',
lat:'',
long:''
}
......@@ -247,6 +250,14 @@ const rootReducer = (state = globalState, action) => {
}
}
case ActionType.SET_CORDINAT: {
return {
...state,
lat: action.data.lat,
long: action.data.long
}
}
case ActionType.SET_CHANGE_OUTLET: {
return {
...state,
......
......@@ -34,6 +34,7 @@ class Home extends React.Component {
this._account();
this._getPermissions()
this._renderCarousell()
console.log("INI LAT : " + this.props.lat)
this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
......@@ -72,11 +73,20 @@ class Home extends React.Component {
let latitude = location.coords.latitude;
let longitude = location.coords.longitude;
this.setState({
my_lat: latitude,
my_long: longitude
})
let cordinate = {
lat: this.state.my_lat,
long: this.state.my_long,
}
this.props.setCordinatProps(cordinate);
this._getOutletClosest();
}
......@@ -284,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>8 May 2019 </Text>
<Text>11 May 2019 </Text>
<View style={{ height: 60 }}></View>
</View>
</View>
......@@ -385,6 +395,13 @@ const mapDispatchToProps = (dispacth) => {
}
}),
setCordinatProps: (cordinate) => dispacth({
type: ActionType.SET_CORDINAT,
data: {
lat: cordinate.lat,
long: cordinate.long,
}
}),
}
}
......@@ -407,6 +424,8 @@ const mapStateToProps = (state) => {
proses: state.proses,
pageEmailConfirmation: state.pageEmailConfirmation,
language: state.language,
lat: state.lat,
long: state.long,
}
}
......
......@@ -15,7 +15,7 @@ class Item extends React.Component {
handleChangeQuantity = (item, qty) => {
if (qty == '') {
qty=0
item.qty=0
} else {
const order_item = {
......
......@@ -15,8 +15,11 @@ class RewardDetail extends React.Component {
image: '',
title: '',
subtitle: '',
deskripsi: "",
expire: ''
content: "",
expire: '',
code: '',
used:'',
dateNow:''
}
}
......@@ -30,24 +33,41 @@ class RewardDetail extends React.Component {
session_id: this.props.session_id,
reward_id: this.props.route.params.rewardId
}
console.log(params);
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/reward/get_detail', params).then(res => {
this.setState({
image: res.data.reward.reward.content_image,
title: res.data.reward.reward.title,
subtitle: res.data.reward.reward.subtitle,
deskripsi: res.data.reward.reward.content,
content: res.data.reward.reward.content,
expire: res.data.reward.expire_time,
code: res.data.reward.verification_number,
used : res.data.reward.used,
})
// console.log("INI TITLE : " + JSON.stringify())
// console.log("INI SUBTITILE : " + JSON.stringify())
console.log("INI IMAGE : " + JSON.stringify())
// console.log("INI DESKRIPSI : " + JSON.stringify(res.data.reward.reward.subtitle))
})
}
useVoucher(){
let params = {
reward_id: this.props.route.params.rewardId,
lat : this.props.lat,
long : this.props.long
}
console.log("PARAMETER : " + JSON.stringify(params) )
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/reward/use_reward', params).then(res => {
console.long('RESPONE : ' + res)
})
// this.props.navigation.navigate('Home',{screen:'MENU'})
}
useDVoucher(){
this.props.navigation.navigate('Order Detail')
}
render() {
const deskripsi = this.state.deskripsi
......@@ -55,16 +75,24 @@ class RewardDetail extends React.Component {
<View style={styles.container}>
<ScrollView style={styles.body}>
<View style={styles.body}>
{/* <View style={styles.images}> */}
<Image style={{ height: 250, width: '100%' }} source={this.state.image ? { uri: this.state.image } : null} />
{/* </View> */}
<View style={{margin:20}}>
<HTML html={this.state.deskripsi} />
<View style={{ height: 70, flex: 1, backgroundColor: '#03989E', top: -60, marginRight: 10, marginLeft: 10 }}>
<Text style={{ margin: 5 }}>Voucher code : </Text>
<Text style={{ fontSize: 30, textAlign: 'center', fontWeight: 'bold', bottom: 5 }}>{this.state.code}</Text>
</View>
<View style={{ margin: 10 }}>
<Button title="Validate" />
<View style={{ height: 70, flex: 1, backgroundColor: 'black', top: -70, marginRight: 10, marginLeft: 10 }}>
<Text style={{ margin: 5 , color:'white'}}>Expired Date : </Text>
<Text style={{ fontSize: 30, textAlign: 'center', fontWeight: 'bold', bottom: 5 ,color:'white' }}>{this.state.expire}</Text>
</View>
</View>
<View style={{ flex: 1, top: -60, margin: 10 }}>
{
this.state.used == 0 ?(
<Button title="USE VOUCHER" onPress={() => this.useVoucher()}></Button>
):( <Button title="USED" onPress={()=>this.props.navigation.navigate('Menu Select')()}></Button>)
}
<HTML html={this.state.content} />
</View>
</ScrollView>
</View>
)
......@@ -100,6 +128,8 @@ const mapStateToProps = (state) => {
return {
session_id: state.session_id,
lat: state.lat,
long: state.long,
}
}
......
......@@ -16,8 +16,6 @@ import Axios from 'axios';
import HTML from 'react-native-render-html';
export default class TopUpInfo extends React.Component {
constructor(props){
super(props);
......
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