Commit 0714322f authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

set base url (2)

parent 01c1429d
...@@ -27,8 +27,9 @@ class MenuConfirmation extends React.Component { ...@@ -27,8 +27,9 @@ class MenuConfirmation extends React.Component {
} }
componentDidMount() { componentDidMount() {
// console.log("INI URLS : "+this.props.BASE_URL)
// 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)
...@@ -74,7 +75,7 @@ class MenuConfirmation extends React.Component { ...@@ -74,7 +75,7 @@ class MenuConfirmation extends React.Component {
// console.log(params) // console.log(params)
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/booking', params).then(res => { Axios.post(this.props.BASE_URL+'crm/v2/transaction/booking', params).then(res => {
// add API use voucher here // add API use voucher here
...@@ -85,7 +86,7 @@ class MenuConfirmation extends React.Component { ...@@ -85,7 +86,7 @@ class MenuConfirmation extends React.Component {
// long: this.props.long // long: this.props.long
// } // }
// Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/reward/use_reward', param).then(res => { // Axios.post('https://excelsocrm.ravintoladevs.com/crm/v2/reward/use_reward', param).then(res => {
// console.log(res.data) // console.log(res.data)
// }).catch(error => { // }).catch(error => {
// const { navigation } = this.props // const { navigation } = this.props
...@@ -149,7 +150,7 @@ class MenuConfirmation extends React.Component { ...@@ -149,7 +150,7 @@ class MenuConfirmation extends React.Component {
// console.log(params) // console.log(params)
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/transaction/booking', params).then(res => { Axios.post(this.props.BASE_URL+'crm/v2/transaction/booking', params).then(res => {
// add API use voucher here // add API use voucher here
// let param = { // let param = {
// session_id: this.props.session_id, // session_id: this.props.session_id,
...@@ -158,7 +159,7 @@ class MenuConfirmation extends React.Component { ...@@ -158,7 +159,7 @@ class MenuConfirmation extends React.Component {
// long: this.props.long // long: this.props.long
// } // }
// Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/reward/use_reward', param).then(res => { // Axios.post('https://excelsocrm.ravintoladevs.com/crm/v2/reward/use_reward', param).then(res => {
// console.log(res.data) // console.log(res.data)
// }).catch(error => { // }).catch(error => {
// const { navigation } = this.props // const { navigation } = this.props
...@@ -561,7 +562,8 @@ const mapStateToProps = (state) => { ...@@ -561,7 +562,8 @@ const mapStateToProps = (state) => {
name_outlet: state.name_outlet, name_outlet: state.name_outlet,
outlet_detailadress: state.outlet_detailadress, outlet_detailadress: state.outlet_detailadress,
lat: state.lat, lat: state.lat,
long: state.long long: state.long,
BASE_URL : state.BASE_URL,
} }
} }
......
...@@ -35,6 +35,7 @@ class PickupName extends React.Component { ...@@ -35,6 +35,7 @@ class PickupName extends React.Component {
componentDidMount() { componentDidMount() {
this._getPermissions() this._getPermissions()
console.log("INI BASE : " + this.props.BASE_URL)
} }
...@@ -103,7 +104,7 @@ class PickupName extends React.Component { ...@@ -103,7 +104,7 @@ class PickupName extends React.Component {
session_id: this.props.session_id session_id: this.props.session_id
} }
Axios.post("https://excelsocrm.ravintoladev.com/crm/v2/outlet/get_list", params).then(res => { Axios.post(this.props.BASE_URL+"crm/v2/outlet/get_list", params).then(res => {
let dataOutlets = res.data.outlets; let dataOutlets = res.data.outlets;
// console.log("INI ADALAH DATA OUTLETS : " + JSON.stringify(dataOutlets)) // console.log("INI ADALAH DATA OUTLETS : " + JSON.stringify(dataOutlets))
for (let i = 0; i < dataOutlets.length; i++) { for (let i = 0; i < dataOutlets.length; i++) {
...@@ -398,7 +399,8 @@ const mapStateToProps = (state) => { ...@@ -398,7 +399,8 @@ const mapStateToProps = (state) => {
outlet_id: state.outlet_id, outlet_id: state.outlet_id,
name_outlet: state.name_outlet, name_outlet: state.name_outlet,
outlet_detailadress: state.outlet_detailadress, outlet_detailadress: state.outlet_detailadress,
language: state.language language: state.language,
BASE_URL: state.BASE_URL
} }
} }
......
...@@ -23,8 +23,6 @@ class Renewal extends React.Component { ...@@ -23,8 +23,6 @@ class Renewal extends React.Component {
// console.log(this.props.BASE_URL) // console.log(this.props.BASE_URL)
} }
<<<<<<< HEAD
=======
_handleRenewal() { _handleRenewal() {
Alert.alert( Alert.alert(
"Renewal", "Renewal",
...@@ -43,7 +41,6 @@ class Renewal extends React.Component { ...@@ -43,7 +41,6 @@ class Renewal extends React.Component {
) )
} }
>>>>>>> 3e3692eccd3a8082482d5d3ac9218561fbefd778
_renewal() { _renewal() {
let params = { let params = {
session_id: this.props.session_id session_id: this.props.session_id
...@@ -80,12 +77,8 @@ class Renewal extends React.Component { ...@@ -80,12 +77,8 @@ class Renewal extends React.Component {
date.setFullYear(date.getFullYear() + 1); date.setFullYear(date.getFullYear() + 1);
let date_nextyear_string = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() let date_nextyear_string = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate()
<<<<<<< HEAD
=======
console.log("INI YA : " + date_nextyear_string) console.log("INI YA : " + date_nextyear_string)
>>>>>>> 3e3692eccd3a8082482d5d3ac9218561fbefd778
this.setState({ this.setState({
current_balance: balance, current_balance: balance,
expired: expired, expired: expired,
......
...@@ -30,7 +30,7 @@ class RewardHistory extends React.Component { ...@@ -30,7 +30,7 @@ class RewardHistory extends React.Component {
let params = { let params = {
session_id: this.props.session_id session_id: this.props.session_id
} }
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/reward/history', params).then(res => { Axios.post(this.props.BASE_URL+'crm/v2/reward/history', params).then(res => {
let data = res.data.rewards let data = res.data.rewards
// console.log(data) // console.log(data)
data.map((item, key) => { data.map((item, key) => {
...@@ -119,7 +119,8 @@ const mapStateToProps = (state) => { ...@@ -119,7 +119,8 @@ const mapStateToProps = (state) => {
return { return {
session_id: state.session_id, session_id: state.session_id,
languange: state.language languange: state.language,
BASE_URL: state.BASE_URL
} }
} }
......
...@@ -16,7 +16,7 @@ class RewardSelect extends React.Component { ...@@ -16,7 +16,7 @@ class RewardSelect extends React.Component {
} }
componentDidMount() { componentDidMount() {
console.log(this.props.BASE_URL); console.log("INI URL NYA :"+this.props.BASE_URL);
this.getRewardsList() this.getRewardsList()
this._unsubscribe = this.props.navigation.addListener('focus', () => { this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.getRewardsList() this.getRewardsList()
......
...@@ -46,7 +46,7 @@ class ShoppingCart extends React.Component { ...@@ -46,7 +46,7 @@ class ShoppingCart extends React.Component {
componentDidMount() { componentDidMount() {
console.log(this.props.home_address) console.log("INI YA : "+this.props.BASE_URL)
// console.log('INI VALUE : ' + this.props.value_voucher) // console.log('INI VALUE : ' + this.props.value_voucher)
if (!this.props.type_pickup) { if (!this.props.type_pickup) {
this.getRate() this.getRate()
...@@ -65,7 +65,7 @@ class ShoppingCart extends React.Component { ...@@ -65,7 +65,7 @@ class ShoppingCart extends React.Component {
let params = this.props.route.params; let params = this.props.route.params;
if (params != undefined) { if (params != undefined) {
if (params.outlet_change != undefined && params.outlet_change) { if (params.outlet_change != undefined && params.outlet_change) {
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/menu/get_list', { Axios.post(this.props.BASE_URL+'crm/v2/menu/get_list', {
outlet_id: params.outlet_id outlet_id: params.outlet_id
}).then(res => { }).then(res => {
let data = res.data.data let data = res.data.data
...@@ -341,7 +341,7 @@ class ShoppingCart extends React.Component { ...@@ -341,7 +341,7 @@ class ShoppingCart extends React.Component {
// console.log("INI PRAMETER NYA : " + JSON.stringify(params)) // console.log("INI PRAMETER NYA : " + JSON.stringify(params))
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/delivery/rate', params).then(res => { Axios.post(this.props.BASE_URL+'crm/v2/delivery/rate', params).then(res => {
this.setState({ this.setState({
grabamount: res.data.data.amount, grabamount: res.data.data.amount,
...@@ -410,7 +410,7 @@ class ShoppingCart extends React.Component { ...@@ -410,7 +410,7 @@ class ShoppingCart extends React.Component {
session_id: this.props.session_id, session_id: this.props.session_id,
} }
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile', params).then(res => { Axios.post(this.props.BASE_URL+'crm/v2/member/get_profile', params).then(res => {
const { kaspro_balance, kaspro_point } = res.data const { kaspro_balance, kaspro_point } = res.data
this.setState({ this.setState({
kasproBalance: kaspro_balance.replace(/,/g, ''), kasproBalance: kaspro_balance.replace(/,/g, ''),
...@@ -1071,6 +1071,7 @@ const mapStateToProps = (state) => { ...@@ -1071,6 +1071,7 @@ const mapStateToProps = (state) => {
grabpickup: state.grabpickup, grabpickup: state.grabpickup,
grabdropoff: state.grabdropoff, grabdropoff: state.grabdropoff,
grabdestination: state.grabdestination, grabdestination: state.grabdestination,
BASE_URL: state.BASE_URL
} }
} }
......
...@@ -16,13 +16,13 @@ class setBaseUrl extends React.Component { ...@@ -16,13 +16,13 @@ class setBaseUrl extends React.Component {
} }
handleSetUrl() { handleSetUrl() {
if (this.state.base_url == '') { if (this.state.base_url == '') {
Alert.alert('','Url tidak boleh kosong!') Alert.alert('', 'Url tidak boleh kosong!')
} else { } else {
let setUrls = { let setUrls = {
BASE_URL: this.state.base_url BASE_URL: this.state.base_url
} }
this.props.setUrlProps(setUrls); this.props.setUrlProps(setUrls);
Alert.alert('Berhasil','berhasil set ke : ' + this.props.BASE_URL) Alert.alert('Berhasil', 'berhasil set ke : ' + this.state.base_url)
} }
} }
...@@ -37,9 +37,11 @@ class setBaseUrl extends React.Component { ...@@ -37,9 +37,11 @@ class setBaseUrl extends React.Component {
value={this.state.base_url} value={this.state.base_url}
autoCapitalize="none" autoCapitalize="none"
placeholder={this.props.BASE_URL} /> placeholder={this.props.BASE_URL} />
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368',marginTop:20,justifyContent:'center' }}> <TouchableOpacity onPress={()=> this.handleSetUrl()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginTop: 20, justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>CHANGE URL </Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>CHANGE URL </Text>
</View> </View>
</TouchableOpacity>
</View> </View>
</View> </View>
</View> </View>
......
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