Authored by 孙凯

add 退货页面 review by hongmo

... ... @@ -36,6 +36,7 @@ import deliveryStatsInitialState from './reducers/deliveryStats/deliveryStatsIni
import requestStatsInitialState from './reducers/requestStats/requestStatsInitialState';
import refoundStatisticsInitialState from './reducers/refoundStatistics/refoundStatisticsInitialState';
import transferShipmentInitialState from './reducers/transferShipment/transferShipmentInitialState';
import outOfStockInitialState from './reducers/outOfStock/outOfStockInitialState';
import App from './containers/App';
import GuideContainer from './containers/GuideContainer';
... ... @@ -55,6 +56,7 @@ import MessageDetailContainer from './containers/MessageDetailContainer'
import RequestStatsContainer from './containers/RequestStatsContainer'
import RefoundStatisticsContainer from './containers/RefoundStatisticsContainer'
import TransferShipmentContainer from './containers/TransferShipmentContainer'
import OutOfStockContainer from './containers/OutOfStockContainer'
import NavBar from './components/NavBar';
import TabIcon from './containers/TabIcon';
... ... @@ -82,6 +84,7 @@ function getInitialState() {
requestStats: (new requestStatsInitialState()),
refoundStats: (new refoundStatisticsInitialState()),
transferShipment: (new transferShipmentInitialState()),
outOfStock: (new outOfStockInitialState()),
};
return _initState;
}
... ... @@ -286,6 +289,17 @@ export default function native(platform) {
panHandlers={Platform.OS === 'android' ? null : undefined}
/>
<Scene
key="OutOfStock"
component={OutOfStockContainer}
hideNavBar={false}
initial={false}
navBar={NavBar}
title='提示缺货'
titleStyle={styles.navTitle}
type="push"
panHandlers={Platform.OS === 'android' ? null : undefined}
/>
<Scene
key='AboutUs'
component={AboutUsContainer}
title='关于我们'
... ...
'use strict';
import React, {Component} from 'react';
import LoadMoreIndicator from '../indicator/LoadMoreIndicator';
import LoadingIndicator from '../indicator/LoadingIndicator';
import moment from 'moment';
import {
StyleSheet,
View,
Text,
ListView,
Image,
Dimensions,
TouchableHighlight,
TextInput,
} from 'react-native';
export default class OutOfStock extends Component {
constructor(props) {
super (props);
}
render() {
return (
<View style={styles.container}>
<View style={styles.cell}>
<Text style={styles.cellText1} numberOfLines={1}>SKU:2564123</Text>
<Text style={styles.cellText2} numberOfLines={1}>商品条码:KT-2017156 红色/L</Text>
<Text style={styles.cellText3} numberOfLines={1}>当前需发数:5</Text>
</View>
<View style={styles.textInputCell}>
<Text style={styles.cellText} numberOfLines={1}>缺货:</Text>
<TextInput style={styles.inputText}
ref = 'textInput'
placeholder={'单行输入'}
/>
</View>
<Text style={styles.tip} numberOfLines={1}>*提货报缺后不可修改,平台将对顾客订单商品进行退单处理</Text>
</View>
);
}
}
let {width, height} = Dimensions.get('window');
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white',
},
cell: {
width: width,
height: 40,
backgroundColor: 'white',
flexDirection: 'row',
alignItems: 'center',
},
cellText1: {
fontSize:12,
marginLeft: 10,
width: Math.ceil((width-20)/3)-30,
textAlign: 'left',
color: 'black',
},
cellText2: {
fontSize:12,
width: Math.ceil((width-20)/3)+60,
textAlign: 'center',
color: 'red',
},
cellText3: {
fontSize:12,
width: Math.ceil((width-20)/3)-30,
textAlign: 'right',
color: 'black',
},
textInputCell: {
width: width,
height: 50,
flexDirection: 'row',
alignItems: 'center',
marginLeft: 20,
},
inputText:{
width: width - 80,
height: 40,
backgroundColor:'transparent',
fontSize:15,
marginLeft: 10,
borderWidth: 1,
borderColor: '#CCC',
borderRadius: 4,
marginTop: 5,
},
tip: {
marginTop: 20,
marginLeft: 20,
fontSize:12,
width: width-20,
textAlign: 'left',
color: 'red',
}
});
... ...
... ... @@ -30,7 +30,7 @@ export default class TransferShipment extends Component {
_renderRow(rowData, sectionID, rowID) {
return(
<TransferShipmentCell />
<TransferShipmentCell goToStatsPage={this.props.goToStatsPage}/>
)
}
... ...
... ... @@ -2,6 +2,7 @@
import React, {Component} from 'react';
import CheckBox from 'react-native-checkbox';
import CONFIG from '../../constants/config';
import {
StyleSheet,
... ... @@ -10,8 +11,8 @@ import {
ListView,
Image,
Dimensions,
TouchableHighlight,
TextInput,
TouchableOpacity,
} from 'react-native';
export default class TransferShipmentCell extends Component {
... ... @@ -53,8 +54,12 @@ export default class TransferShipmentCell extends Component {
checked={this.state.hasChecked}
onChange={this._onCheckBoxChanged}
/>
<View style={styles.tip}>
</View>
<TouchableOpacity onPress={() => {
this.props.goToStatsPage && this.props.goToStatsPage(CONFIG.statsKey.outOfStock);
}}>
<View style={styles.tip}>
</View>
</TouchableOpacity>
</View>
<View style={styles.cell}>
<Text style={styles.cellText} numberOfLines={1}>商品条码:KT-2017156</Text>
... ... @@ -119,8 +124,8 @@ const styles = StyleSheet.create({
backgroundColor: 'transparent',
},
tip: {
width: 40,
height: 40,
width: 30,
height: 30,
backgroundColor: 'red',
},
cell: {
... ...
... ... @@ -73,6 +73,7 @@ export default keyMirror({
GO_TO_REQUEST_STATS: null,
GO_TO_ACCOUNT_SETTLEMENT: null,
GO_TO_TRANSFER_SHIPMENT: null,
GO_TO_OUT_STOCK: null,
SETUP_DEFAULT_SHOP: null,
... ...
... ... @@ -26,6 +26,7 @@ module.exports = {
deliveryStats: 'deliveryStats',
requestStats: 'requestStats',
transferShipment: 'transferShipment',
outOfStock: 'outOfStock',
},
dateFilterKey: {
date: 1,//天
... ...
'use strict';
import React, { Component } from 'react';
import Immutable, {List, Record} from 'immutable';
import OutOfStock from '../components/OutOfStock/OutOfStock'
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 outOfStockActions from '../reducers/outOfStock/outOfStockActions';
const actions = [
outOfStockActions,
];
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 OutOfStockContainer extends Component {
constructor(props) {
super(props);
}
componentDidMount() {
}
componentWillUnmount() {
}
render() {
return (
<View style={styles.container}>
<OutOfStock />
</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)(OutOfStockContainer);
... ...
... ... @@ -49,6 +49,7 @@ class TransferShipmentContainer extends Component {
constructor(props) {
super(props);
this._goToStatsPage = this._goToStatsPage.bind(this);
}
componentDidMount() {
... ... @@ -59,10 +60,14 @@ class TransferShipmentContainer extends Component {
}
_goToStatsPage(type,params) {
this.props.actions.goToStatsPage(type);
}
render() {
return (
<View style={styles.container}>
<TransferShipment />
<TransferShipment goToStatsPage={this._goToStatsPage}/>
</View>
);
}
... ...
... ... @@ -22,6 +22,7 @@ import deliveryStats from './deliveryStats/deliveryStatsReducer';
import requestStats from './requestStats/requestStatsReducer';
import refoundStats from './refoundStatistics/refoundStatisticsReducer'
import transferShipment from './transferShipment/transferShipmentReducer'
import outOfStock from './outOfStock/outOfStockReducer'
import { combineReducers } from 'redux';
... ... @@ -44,6 +45,7 @@ const rootReducer = combineReducers({
requestStats,
refoundStats,
transferShipment,
outOfStock,
});
export default rootReducer;
... ...
/**
* # guideActions.js
*
* App user guide
*
*/
'use strict';
import {Actions} from 'react-native-router-flux';
import TransferShipmentService from '../../services/OutOfStockService';
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 './outOfStockInitialState';
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;
}
... ...
... ... @@ -9,9 +9,21 @@
import {Actions} from 'react-native-router-flux';
import TransferShipmentService from '../../services/TransferShipmentService';
import {Alert, Linking} from 'react-native';
import CONFIG from '../../constants/config';
const {
LOGOUT,
GO_TO_OUT_STOCK,
} = require('../../constants/actionTypes').default;
export function goToStatsPage(type) {
switch (type) {
case CONFIG.statsKey.outOfStock:
Actions.OutOfStock();
return {
type: GO_TO_OUT_STOCK,
};
}
}
... ...
... ... @@ -11,7 +11,7 @@ import Immutable, {List, Record} from 'immutable';
const {
LOGOUT,
GO_TO_OUT_STOCK,
} = require('../../constants/actionTypes').default;
... ... @@ -26,7 +26,7 @@ export default function userReducer(state = initialState, action) {
if (!(state instanceof InitialState)) return initialState.merge(state);
switch (action.type) {
case LOGOUT:{
case GO_TO_OUT_STOCK:{
return state;
}
return state;
... ...
'use strict';
import Request from './Request';
import moment from 'moment';
export default class OutOfStockService {
constructor () {
this.api = new Request();
}
}
... ...