-
Notifications
You must be signed in to change notification settings - Fork 475
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
495 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* ShopReactNative | ||
* | ||
* @author Tony Wong | ||
* @date 2016-09-24 | ||
* @email 908601756@qq.com | ||
* @copyright Copyright © 2016 EleTeam | ||
* @license The MIT License (MIT) | ||
*/ | ||
|
||
import * as types from './actionTypes'; | ||
|
||
/** | ||
* 公共的actions | ||
*/ | ||
|
||
export let commonIsToasting = (isToasting) => { | ||
return (dispatch) => { | ||
dispatch({type:types.kCommonIsToasting, isToasting:isToasting}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/** | ||
* ShopReactNative | ||
* | ||
* @author Tony Wong | ||
* @date 2016-09-27 | ||
* @email 908601756@qq.com | ||
* @copyright Copyright © 2016 EleTeam | ||
* @license The MIT License (MIT) | ||
*/ | ||
|
||
import * as types from './actionTypes'; | ||
import Util from '../common/utils'; | ||
import * as urls from '../common/constants_url'; | ||
import {commonIsToasting} from './commonActions'; | ||
|
||
/** | ||
* 订单actions | ||
*/ | ||
|
||
export let orderCreate = (access_token, preorder_id, address_id, notice)=> { | ||
let url = urls.kUrlOrderCreate; | ||
let data = { | ||
access_token: access_token, | ||
preorder_id: preorder_id, | ||
address_id: address_id, | ||
notice: notice | ||
}; | ||
|
||
return dispatch => { | ||
dispatch({type: types.kOrderCreate}); | ||
return Util.post(url, data, | ||
(status, code, message, data, share) => { | ||
let order = {}; | ||
if (status) { | ||
order = data.order; | ||
}else{ | ||
dispatch(commonIsToasting(true)); | ||
} | ||
dispatch({type:types.kOrderCreateReceived, status:status, code:code, message:message, share:share, | ||
order:order}); | ||
dispatch(commonIsToasting(false)); | ||
}, | ||
(error) => { | ||
// console.log('Fetch banner list error: ' + error); | ||
dispatch({'type': types.kActionError}); | ||
} | ||
); | ||
} | ||
}; | ||
|
||
export let orderView = (order_id, access_token)=> { | ||
let url = urls.kUrlOrderView + order_id; | ||
let data = { | ||
access_token: access_token | ||
}; | ||
|
||
return dispatch => { | ||
dispatch({type: types.kOrderView}); | ||
return Util.post(url, data, | ||
(status, code, message, data, share) => { | ||
let order = {}; | ||
let address = {}; | ||
if (status) { | ||
order = data.order; | ||
address = data.address; | ||
} | ||
dispatch({type:types.kOrderViewReceived, status:status, code:code, message:message, share:share, | ||
order:order, address:address}); | ||
}, | ||
(error) => { | ||
// console.log('Fetch banner list error: ' + error); | ||
dispatch({'type': types.kActionError}); | ||
} | ||
); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* ShopReactNative | ||
* | ||
* @author Tony Wong | ||
* @date 2016-09-27 | ||
* @email 908601756@qq.com | ||
* @copyright Copyright © 2016 EleTeam | ||
* @license The MIT License (MIT) | ||
*/ | ||
|
||
import React, {Component} from 'react'; | ||
import {connect} from 'react-redux'; | ||
import OrderPage from '../pages/OrderPage'; | ||
|
||
class OrderContainer extends Component { | ||
render() { | ||
return ( | ||
<OrderPage {...this.props} /> | ||
) | ||
} | ||
} | ||
|
||
export default connect((state) => { | ||
return { orderReducer, userReducer, commonReducer} = state; | ||
})(OrderContainer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ import { | |
TextInput, | ||
View, | ||
Image, | ||
|
||
TouchableOpacity, | ||
InteractionManager, | ||
} from 'react-native'; | ||
|
Oops, something went wrong.