Authored by 孙凯

add 调拨发货 review by hongmo

... ... @@ -35,6 +35,7 @@ import stockStatsInitialState from './reducers/stockStats/stockStatsInitialState
import deliveryStatsInitialState from './reducers/deliveryStats/deliveryStatsInitialState';
import requestStatsInitialState from './reducers/requestStats/requestStatsInitialState';
import refoundStatisticsInitialState from './reducers/refoundStatistics/refoundStatisticsInitialState';
import transferShipmentInitialState from './reducers/transferShipment/transferShipmentInitialState';
import App from './containers/App';
import GuideContainer from './containers/GuideContainer';
... ... @@ -53,6 +54,7 @@ import DeliveryStatsContainer from './containers/DeliveryStatsContainer'
import MessageDetailContainer from './containers/MessageDetailContainer'
import RequestStatsContainer from './containers/RequestStatsContainer'
import RefoundStatisticsContainer from './containers/RefoundStatisticsContainer'
import TransferShipmentContainer from './containers/TransferShipmentContainer'
import NavBar from './components/NavBar';
import TabIcon from './containers/TabIcon';
... ... @@ -79,6 +81,7 @@ function getInitialState() {
deliveryStats: (new deliveryStatsInitialState()),
requestStats: (new requestStatsInitialState()),
refoundStats: (new refoundStatisticsInitialState()),
transferShipment: (new transferShipmentInitialState()),
};
return _initState;
}
... ... @@ -271,7 +274,17 @@ export default function native(platform) {
type='push'
panHandlers={Platform.OS === 'android' ? null : undefined}
/>
<Scene
key='TransferShipment'
component={TransferShipmentContainer}
title='调拨发货'
hideNavBar={false}
initial={false}
navBar={NavBar}
titleStyle={styles.navTitle}
type='push'
panHandlers={Platform.OS === 'android' ? null : undefined}
/>
<Scene
key='AboutUs'
component={AboutUsContainer}
... ...
... ... @@ -78,7 +78,7 @@ let styles = StyleSheet.create({
flex: 1,
flexDirection: 'row',
flexWrap: 'wrap',
justifyContent: 'center',
justifyContent: 'flex-start',
backgroundColor: 'white',
},
row: {
... ...
'use strict';
import React, {Component} from 'react';
import LoadMoreIndicator from '../indicator/LoadMoreIndicator';
import LoadingIndicator from '../indicator/LoadingIndicator';
import moment from 'moment';
import SearchBar from '../search/SearchBar';
import TransferShipmentCell from './TransferShipmentCell';
import {
StyleSheet,
View,
Text,
ListView,
Image,
Dimensions,
TouchableHighlight,
} from 'react-native';
export default class TransferShipment extends Component {
constructor(props) {
super (props);
this.dataSource = new ListView.DataSource({
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
});
this._renderRow = this._renderRow.bind(this);
}
_renderRow(rowData, sectionID, rowID) {
return(
<TransferShipmentCell />
)
}
render() {
return (
<View style={styles.container}>
<ListView
style={styles.listContainer}
dataSource={this.dataSource.cloneWithRows([1,1,1])}
renderRow={this._renderRow}
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
},
listContainer: {
flex: 1,
}
});
... ...
'use strict';
import React, {Component} from 'react';
import CheckBox from 'react-native-checkbox';
import {
StyleSheet,
View,
Text,
ListView,
Image,
Dimensions,
TouchableHighlight,
TextInput,
} from 'react-native';
export default class TransferShipmentCell extends Component {
constructor(props) {
super (props);
this._onSubmitEditing = this._onSubmitEditing.bind(this);
this._onChangeText = this._onChangeText.bind(this);
this._onCheckBoxChanged = this._onCheckBoxChanged.bind(this);
this.state = {
hasChecked: false,
};
}
_onSubmitEditing(event){
let value = event.nativeEvent.text;
}
_onChangeText(text){
}
_onCheckBoxChanged(checked){
this.setState({hasChecked : !checked});
}
render() {
let checkedLable = 'SKU: 2541123 下单时间:2017-05-02'
return (
<View style={styles.container}>
<View style={styles.titleBar}>
<CheckBox
label={checkedLable}
containerStyle={styles.checkboxStyle}
checkboxStyle={styles.checkboxIconStyle}
labelStyle={styles.labelStyle}
underlayColor={'transparent'}
checkedImage={require('../../images/tabbar/home.png')}
uncheckedImage={require('../../images/tabbar/message_normal.png')}
checked={this.state.hasChecked}
onChange={this._onCheckBoxChanged}
/>
<View style={styles.tip}>
</View>
</View>
<View style={styles.cell}>
<Text style={styles.cellText} numberOfLines={1}>商品条码:KT-2017156</Text>
</View>
<View style={styles.cell}>
<Text style={styles.cellText} numberOfLines={1}>规格:红色/L 单号:175023</Text>
</View>
<View style={styles.cell}>
<Text style={styles.cellText1} numberOfLines={1}>缺货数:1110</Text>
<Text style={styles.cellText2} numberOfLines={1}>收获数:1111</Text>
<Text style={styles.cellText3} numberOfLines={1}>已发数:1110</Text>
<Text style={styles.cellText4} numberOfLines={1}>当前需发数:5111</Text>
</View>
<View style={styles.textInputCell}>
<Text style={styles.cellText} numberOfLines={1}>发货:</Text>
<TextInput style={styles.inputText}
ref = 'textInput'
placeholder={'单行输入'}
onSubmitEditing={this._onSubmitEditing}
onChangeText={this._onChangeText}
/>
</View>
<View style={styles.place}/>
</View>
);
}
}
let {width, height} = Dimensions.get('window');
const styles = StyleSheet.create({
container: {
width: width,
height: 220,
backgroundColor: 'white',
},
place: {
width: width,
height: 10,
backgroundColor: 'white',
},
titleBar: {
width: width,
height: 40,
backgroundColor: 'yellow',
flexDirection: 'row',
alignItems: 'center',
},
checkboxStyle: {
width: width - 50,
height: 40,
backgroundColor: 'transparent',
},
checkboxIconStyle: {
marginLeft : 10,
marginTop: 6,
width: 18,
height: 18,
backgroundColor: 'transparent',
},
labelStyle: {
marginTop: 5,
backgroundColor: 'transparent',
},
tip: {
width: 40,
height: 40,
backgroundColor: 'red',
},
cell: {
width: width,
height: 40,
backgroundColor: 'white',
flexDirection: 'row',
alignItems: 'center',
},
cellText: {
fontSize:15,
marginLeft: 10,
alignItems: 'center',
},
cellText1: {
fontSize:15,
marginLeft: 10,
width: 2 * Math.ceil((width-10)/9),
textAlign: 'left',
color: 'black',
},
cellText2: {
fontSize:15,
width: 2 * Math.ceil((width-10)/9),
textAlign: 'left',
color: 'red',
},
cellText3: {
fontSize:15,
width: 2 * Math.ceil((width-10)/9),
textAlign: 'left',
color: 'black',
},
cellText4: {
fontSize:15,
width: 3 * Math.ceil((width-10)/9),
textAlign: 'left',
color: 'black',
},
textInputCell: {
width: width,
height: 50,
flexDirection: 'row',
alignItems: 'center',
},
inputText:{
width: width - 80,
height: 40,
backgroundColor:'transparent',
fontSize:15,
marginLeft: 10,
borderWidth: 1,
borderColor: '#CCC',
borderRadius: 4,
marginTop: 5,
},
});
... ...
'use strict';
import React from 'react';
import ReactNative from 'react-native';
const {
Component,
} = React;
const {
TouchableHighlight,
Alert,
Dimensions,
StyleSheet,
View,
Text,
Image,
Platform,
TextInput,
} = ReactNative;
export default class SearchBar extends Component{
constructor(props) {
super (props);
this._onSubmitEditing = this._onSubmitEditing.bind(this);
this._onChangeText = this._onChangeText.bind(this);
}
_onSubmitEditing(event){
let value = event.nativeEvent.text;
this.props.onSearch && this.props.onSearch(value);
}
_onChangeText(text){
this.props.searchChangeText && this.props.searchChangeText(text);
}
render(){
let {placeholder} = this.props;
return (
<View style={styles.container}>
<TextInput style={styles.inputText}
placeholder={placeholder?placeholder:'搜索'}
onSubmitEditing={this._onSubmitEditing}
onChangeText={this._onChangeText}
/>
<Image source={require('../../images/tabbar/home.png')} style={styles.searchIcon}/>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flexDirection: 'row',
height: 40,
backgroundColor: 'white',
alignItems: 'center'
},
inputText:{
flex:1,
backgroundColor:'transparent',
fontSize:15,
marginLeft: 10,
},
searchIcon: {
marginLeft: 5,
marginRight: 20,
width: 15,
height: 20,
resizeMode: 'stretch'
},
});
... ...
... ... @@ -72,6 +72,7 @@ export default keyMirror({
GO_TO_DELIVERY_STATS: null,
GO_TO_REQUEST_STATS: null,
GO_TO_ACCOUNT_SETTLEMENT: null,
GO_TO_TRANSFER_SHIPMENT: null,
SETUP_DEFAULT_SHOP: null,
... ...
... ... @@ -25,7 +25,7 @@ module.exports = {
stockStats: 'stockStats',
deliveryStats: 'deliveryStats',
requestStats: 'requestStats',
accountSettlement: 'accountSettlement',
transferShipment: 'transferShipment',
},
dateFilterKey: {
date: 1,//天
... ...
... ... @@ -44,7 +44,7 @@ function mapDispatchToProps(dispatch) {
};
}
export default class AccountSettlementContainer extends Component {
class AccountSettlementContainer extends Component {
constructor(props) {
super(props);
... ...
... ... @@ -65,7 +65,7 @@ class App extends Component {
componentDidMount() {
errorHandler.init();
this.props.actions.getStoredUserInfo();
this.props.actions.getGuideDisplayState();
}
... ...
... ... @@ -47,7 +47,7 @@ function mapDispatchToProps(dispatch) {
};
}
export default class DeliveryStatsContainer extends Component {
class DeliveryStatsContainer extends Component {
constructor(props) {
super(props);
... ...
... ... @@ -57,7 +57,7 @@ function mapDispatchToProps(dispatch) {
};
}
export default class GuideContainer extends Component {
class GuideContainer extends Component {
constructor(props) {
super(props);
... ... @@ -106,7 +106,4 @@ export default class GuideContainer extends Component {
}
}
/**
* Connect the properties
*/
export default connect(mapStateToProps, mapDispatchToProps)(GuideContainer);
... ...
... ... @@ -100,6 +100,11 @@ class HomeContainer extends Component {
thumb: require('../images/duizhang.png'),
title: '对账结算',
},
{
type: CONFIG.statsKey.transferShipment,
thumb: require('../images/duizhang.png'),
title: '调拨发货',
},
];
}
... ...
... ... @@ -61,7 +61,7 @@ function mapDispatchToProps(dispatch) {
};
}
export default class LoginContainer extends Component {
class LoginContainer extends Component {
constructor(props) {
super(props);
... ...
... ... @@ -61,7 +61,7 @@ function mapDispatchToProps(dispatch) {
};
}
export default class LogoutContainer extends Component {
class LogoutContainer extends Component {
constructor(props) {
super(props);
... ...
... ... @@ -59,7 +59,7 @@ function mapDispatchToProps(dispatch) {
};
}
export default class MessageDetailContainer extends Component {
class MessageDetailContainer extends Component {
constructor(props) {
super(props);
... ...
... ... @@ -61,7 +61,7 @@ function mapDispatchToProps(dispatch) {
};
}
export default class ModifyPasswordContainer extends Component {
class ModifyPasswordContainer extends Component {
constructor(props) {
super(props);
... ...
... ... @@ -49,7 +49,7 @@ function mapDispatchToProps(dispatch) {
}
export default class RefoundStatisticsContainer extends Component {
class RefoundStatisticsContainer extends Component {
constructor(props) {
super(props);
this.onChangeDate = this.onChangeDate.bind(this);
... ...
... ... @@ -47,7 +47,7 @@ function mapDispatchToProps(dispatch) {
};
}
export default class RequestStatsContainer extends Component {
class RequestStatsContainer extends Component {
constructor(props) {
super(props);
... ...
... ... @@ -46,7 +46,7 @@ function mapDispatchToProps(dispatch) {
};
}
export default class StockStatsContainer extends Component {
class StockStatsContainer extends Component {
constructor(props) {
super(props);
... ...
'use strict';
import React, { Component } from 'react';
import Immutable, {List, Record} from 'immutable';
import TransferShipment from '../components/TransferShipment/TransferShipment'
import {
StyleSheet,
View,
Text,
ListView,
Dimensions,
Platform,
} from 'react-native';
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {Map} from 'immutable';
import * as transferShipmentActions from '../reducers/transferShipment/transferShipmentActions';
const actions = [
transferShipmentActions,
];
function mapStateToProps(state) {
return {
...state
}
};
function mapDispatchToProps(dispatch) {
const creators = Map()
.merge(...actions)
.filter(value => typeof value === 'function')
.toObject();
return {
actions: bindActionCreators(creators, dispatch),
dispatch
};
}
class TransferShipmentContainer extends Component {
constructor(props) {
super(props);
}
componentDidMount() {
}
componentWillUnmount() {
}
render() {
return (
<View style={styles.container}>
<TransferShipment />
</View>
);
}
}
let {width, height} = Dimensions.get('window');
let navbarHeight = (Platform.OS === 'android') ? 50 : 64;
let styles = StyleSheet.create({
container: {
top: navbarHeight,
height: height - navbarHeight,
paddingBottom: (Platform.OS === 'android') ? 24 : 0,
},
});
export default connect(mapStateToProps, mapDispatchToProps)(TransferShipmentContainer);
... ...
... ... @@ -26,6 +26,7 @@ const {
GO_TO_DELIVERY_STATS,
GO_TO_REQUEST_STATS,
GO_TO_ACCOUNT_SETTLEMENT,
GO_TO_TRANSFER_SHIPMENT,
SETUP_DEFAULT_SHOP,
SWITCH_SHOP,
... ... @@ -133,6 +134,11 @@ export function goToStatsPage(type) {
return {
type: GO_TO_ACCOUNT_SETTLEMENT,
};
case CONFIG.statsKey.transferShipment:
Actions.TransferShipment();
return {
type: GO_TO_TRANSFER_SHIPMENT,
};
}
}
... ...
... ... @@ -27,6 +27,7 @@ const {
GO_TO_DELIVERY_STATS,
GO_TO_REQUEST_STATS,
GO_TO_ACCOUNT_SETTLEMENT,
GO_TO_TRANSFER_SHIPMENT,
SETUP_DEFAULT_SHOP,
SWITCH_SHOP,
... ... @@ -91,6 +92,7 @@ export default function userReducer(state = initialState, action) {
case GO_TO_DELIVERY_STATS:
case GO_TO_REQUEST_STATS:
case GO_TO_ACCOUNT_SETTLEMENT:
case GO_TO_TRANSFER_SHIPMENT:
return state;
case LOGOUT:
... ...
... ... @@ -21,6 +21,7 @@ import saleStats from './saleStatistics/saleStatisticsReducer';
import deliveryStats from './deliveryStats/deliveryStatsReducer';
import requestStats from './requestStats/requestStatsReducer';
import refoundStats from './refoundStatistics/refoundStatisticsReducer'
import transferShipment from './transferShipment/transferShipmentReducer'
import { combineReducers } from 'redux';
... ... @@ -42,6 +43,7 @@ const rootReducer = combineReducers({
deliveryStats,
requestStats,
refoundStats,
transferShipment,
});
export default rootReducer;
... ...
/**
* # guideActions.js
*
* App user guide
*
*/
'use strict';
import {Actions} from 'react-native-router-flux';
import TransferShipmentService from '../../services/TransferShipmentService';
import {Alert, Linking} from 'react-native';
const {
LOGOUT,
} = require('../../constants/actionTypes').default;
... ...
'use strict';
/**
* ## Import immutable record
*/
import {List, Record} from 'immutable';
let InitialState = Record({
});
export default InitialState;
... ...
'use strict';
/**
* ## Imports
*
* InitialState
*/
import InitialState from './transferShipmentInitialState';
import Immutable, {List, Record} from 'immutable';
const {
LOGOUT,
} = require('../../constants/actionTypes').default;
const initialState = new InitialState;
/**
* ## guideReducer function
* @param {Object} state - initialState
* @param {Object} action - type and payload
*/
export default function userReducer(state = initialState, action) {
if (!(state instanceof InitialState)) return initialState.merge(state);
switch (action.type) {
case LOGOUT:{
return state;
}
return state;
}
return state;
}
... ...
'use strict';
import Request from './Request';
import moment from 'moment';
export default class TransferShipmentService {
constructor () {
this.api = new Request();
}
}
... ...
... ... @@ -16,10 +16,11 @@
"react": "15.0.2",
"react-immutable-proptypes": "^1.7.1",
"react-native": "^0.26.2",
"react-native-checkbox": "^1.1.0",
"react-native-device-info": "^0.9.3",
"react-native-drawer": "^2.2.2",
"react-native-fabric": "^0.2.2",
"react-native-router-flux": "^3.30.0",
"react-native-router-flux": "3.38.0",
"react-native-simple-store": "^1.0.1",
"react-redux": "^4.4.5",
"redux": "^3.5.2",
... ...