Authored by 于良

按照模块组织目录结构

import Community from './js/community/Community';
import App from './js/App';
Community('android');
\ No newline at end of file
App('android');
... ...
import Community from './js/community/Community';
import App from './js/App';
Community('ios');
App('ios');
... ...
'use strict';
import Community from './community/Community';
export default function native(platform) {
Community(platform);
}
... ...
'use strict';
import {Platform, Dimensions} from 'react-native';
import CONFIG from '../constants/config';
import CONFIG from '../config/config';
import DeviceInfo from 'react-native-device-info';
import queryString from 'query-string';
import md5 from 'md5';
... ...
... ... @@ -40,7 +40,7 @@ function getInitialState() {
}
export default function native(platform) {
export default function community(platform) {
let YH_Community = React.createClass({
... ... @@ -112,7 +112,7 @@ export default function native(platform) {
return this.navPushStyle(props);
}}
/>
</Scene>
</NewRouter>
</Provider>
... ...
... ... @@ -49,7 +49,14 @@ const styles = StyleSheet.create({
fontWeight: '500',
color: '#0A0A0A',
position: 'absolute',
top: Platform.OS === 'ios' ? 20 : 5,
...Platform.select({
ios: {
top: 20,
},
android: {
top: 5,
},
}),
left: 0,
right: 0,
backgroundColor: 'transparent',
... ... @@ -58,7 +65,14 @@ const styles = StyleSheet.create({
backgroundColor: 'transparent',
paddingTop: 0,
top: 0,
height: Platform.OS === 'ios' ? 64 : 50,
...Platform.select({
ios: {
height: 64,
},
android: {
height: 54,
},
}),
right: 0,
left: 0,
// borderBottomWidth: 0.5,
... ... @@ -69,7 +83,14 @@ const styles = StyleSheet.create({
width: 130,
height: 37,
position: 'absolute',
bottom: 4,
...Platform.select({
ios: {
top: 22,
},
android: {
top: 10,
},
}),
left: 2,
padding: 8,
flexDirection: 'row',
... ... @@ -78,7 +99,14 @@ const styles = StyleSheet.create({
width: 100,
height: 37,
position: 'absolute',
bottom: 4,
...Platform.select({
ios: {
top: 22,
},
android: {
top: 10,
},
}),
right: 2,
padding: 8,
},
... ... @@ -86,7 +114,14 @@ const styles = StyleSheet.create({
width: 100,
height: 37,
position: 'absolute',
bottom: 4,
...Platform.select({
ios: {
top: 20,
},
android: {
top: 8,
},
}),
left: 2,
padding: 8,
},
... ... @@ -125,7 +160,7 @@ const styles = StyleSheet.create({
const propTypes = {
navigationState: PropTypes.object,
backButtonImage: PropTypes.number,
backButtonImage: Image.propTypes.source,
wrapBy: PropTypes.any,
component: PropTypes.any,
backButtonTextStyle: Text.propTypes.style,
... ... @@ -316,6 +351,7 @@ class NavBar extends React.Component {
const style = [styles.leftButton, self.props.leftButtonStyle, state.leftButtonStyle];
const textStyle = [styles.barLeftButtonText, self.props.leftButtonTextStyle,
state.leftButtonTextStyle];
const leftButtonStyle = [styles.defaultImageStyle, state.leftButtonIconStyle];
if (state.leftButton) {
let Button = state.leftButton;
... ... @@ -343,7 +379,7 @@ class NavBar extends React.Component {
menuIcon = (
<Image
source={buttonImage}
style={state.leftButtonIconStyle || styles.defaultImageStyle}
style={leftButtonStyle}
/>
);
}
... ... @@ -351,7 +387,6 @@ class NavBar extends React.Component {
if (onPress && (state.leftTitle || buttonImage)) {
onPress = onPress.bind(null, state);
return (
<TouchableOpacity
key={'leftNavBarBtn'}
... ... @@ -366,7 +401,11 @@ class NavBar extends React.Component {
}
{buttonImage &&
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'flex-start' }}>
{menuIcon}
{menuIcon || <Image
source={buttonImage}
style={state.leftButtonIconStyle || styles.defaultImageStyle}
/>
}
</View>
}
</TouchableOpacity>
... ... @@ -435,9 +474,6 @@ class NavBar extends React.Component {
const renderTitle = selected.renderTitle ||
selected.component.renderTitle ||
this.props.renderTitle;
let sceneKey = state.sceneKey;
return (
<Animated.View
style={[
... ...
... ... @@ -12,8 +12,6 @@ import Home from '../components/Home';
import * as homeActions from '../reducers/home/homeActions';
import CONFIG from '../constants/config';
const {
StatusBar,
... ...
... ... @@ -7,7 +7,6 @@
'use strict';
import {Actions} from 'react-native-router-flux';
import CONFIG from '../../constants/config';
import HomeService from '../../services/HomeService';
const {
... ... @@ -16,7 +15,7 @@ const {
HOME_OVERVIEW_SUCCESS,
HOME_OVERVIEW_FAILURE,
} = require('../../constants/actionTypes').default;
... ... @@ -54,5 +53,3 @@ export function overview(shopId) {
});
};
}
... ...
'use strict';
import Request from './Request';
import Request from '../../common/services/Request';
import moment from 'moment';
export default class UserService {
... ... @@ -27,5 +27,5 @@ export default class UserService {
});
}
}
... ...
... ... @@ -18,7 +18,7 @@
"react-native": "^0.28.0",
"react-native-device-info": "^0.9.3",
"react-native-fabric": "^0.2.2",
"react-native-router-flux": "^3.30.0",
"react-native-router-flux": "^3.30.2",
"react-native-simple-store": "^1.0.1",
"react-redux": "^4.4.5",
"redux": "^3.5.2",
... ...