Authored by 于良

代码格式化 review by 盖剑秋

... ... @@ -4,7 +4,7 @@ import React from 'react';
import ReactNative from 'react-native';
import DeviceInfo from 'react-native-device-info';
let {
const {
Component,
} = React;
... ...
... ... @@ -4,7 +4,7 @@ import React from 'react';
import ReactNative from 'react-native';
let {
const {
Component,
} = React;
... ...
... ... @@ -4,7 +4,7 @@ import React from 'react';
import ReactNative from 'react-native';
let {
const {
Component,
} = React;
... ...
... ... @@ -4,7 +4,7 @@ import React from 'react';
import ReactNative from 'react-native';
import Immutable, {List, Record} from 'immutable';
let {
const {
Component,
} = React;
... ...
... ... @@ -6,7 +6,7 @@ import ReactNative from 'react-native';
import GuideItem from './GuideItem';
import PageControl from './PageControl';
let {
const {
Component,
} = React;
... ...
... ... @@ -4,7 +4,7 @@ import React from 'react';
import ReactNative from 'react-native';
import Button from 'apsl-react-native-button';
let {
const {
Component,
} = React;
... ...
... ... @@ -7,7 +7,7 @@ import TrendTextSection from './TrendTextSection';
import Placeholder from './Placeholder';
import Category from './Category';
let {
const {
Component,
} = React;
... ...
... ... @@ -4,7 +4,7 @@ import React from 'react';
import ReactNative from 'react-native';
import Button from 'apsl-react-native-button';
let {
const {
Component,
} = React;
... ... @@ -15,7 +15,7 @@ const {
Text,
Dimensions,
TextInput,
TouchableWithoutFeedback,
TouchableOpacity,
} = ReactNative;
export default class Login extends Component {
... ... @@ -50,13 +50,13 @@ export default class Login extends Component {
autoCapitalize={'none'}
autoCorrect={false}
/>
<TouchableWithoutFeedback
<TouchableOpacity
onPress={this.props.onDeleteUserPress}>
<Image
style={styles.buttonDelete}
source={require('../images/delete.png')}
/>
</TouchableWithoutFeedback>
</TouchableOpacity>
</View>
);
}
... ... @@ -74,13 +74,13 @@ export default class Login extends Component {
autoCapitalize={'none'}
autoCorrect={false}
/>
<TouchableWithoutFeedback
<TouchableOpacity
onPress={this.props.onShowPwdPress}>
<Image
style={styles.buttonDelete}
source={require('../images/eyes@2x.png')}
source={require('../images/eyes.png')}
/>
</TouchableWithoutFeedback>
</TouchableOpacity>
</View>
);
}
... ... @@ -88,10 +88,10 @@ export default class Login extends Component {
return (
<Image style={styles.container} source={require('../images/login@2x.png')} resizeMode={'cover'} >
<Image style={styles.container} source={require('../images/login.png')} resizeMode={'cover'} >
<Image
style={styles.logo}
source={require('../images/logo@2x.png')}
source={require('../images/logo.png')}
/>
{this.renderUserText()}
{this.renderPwdText()}
... ...
... ... @@ -4,7 +4,7 @@ import React from 'react';
import ReactNative from 'react-native';
import Button from 'apsl-react-native-button';
let {
const {
Component,
} = React;
... ...
... ... @@ -7,7 +7,7 @@ import Immutable, {List} from 'immutable';
import moment from 'moment';
import ImmutablePropTypes from 'react-immutable-proptypes';
let {
const {
Component,
} = React;
... ...
... ... @@ -3,7 +3,7 @@
import React from 'react';
import ReactNative from 'react-native';
let {
const {
Component,
} = React;
... ...
... ... @@ -4,7 +4,7 @@ import React from 'react';
import ReactNative from 'react-native';
import Button from 'apsl-react-native-button';
let {
const {
Component,
} = React;
... ...
... ... @@ -4,7 +4,7 @@ import React from 'react';
import ReactNative from 'react-native';
import assign from 'object-assign';
let {
const {
Component,
} = React;
... ...
... ... @@ -4,7 +4,7 @@ import React from 'react';
import ReactNative from 'react-native';
let {
const {
Component,
} = React;
... ...
... ... @@ -4,7 +4,7 @@ import React from 'react';
import ReactNative from 'react-native';
let {
const {
Component,
} = React;
... ...
... ... @@ -4,7 +4,7 @@ import React from 'react';
import ReactNative from 'react-native';
import PlainText from './PlainText';
let {
const {
Component,
} = React;
... ...
... ... @@ -8,7 +8,7 @@ import CalendarTrigger from './calendar/CalendarTrigger';
import CalendarPicker from './calendar/CalendarPicker';
import ChartView from './LineChart/ChartView'
let {
const {
Component,
} = React;
... ...
... ... @@ -8,7 +8,7 @@ import {Actions} from "react-native-router-flux";
import Immutable, {List} from 'immutable';
import ImmutablePropTypes from 'react-immutable-proptypes';
let {
const {
Component,
} = React;
... ...
... ... @@ -4,7 +4,7 @@ import React from 'react';
import ReactNative from 'react-native';
let {
const {
Component,
} = React;
... ...
... ... @@ -5,7 +5,7 @@ import ReactNative from 'react-native';
import PlainText from './PlainText';
import TrendText from './TrendText';
let {
const {
Component,
} = React;
... ...
... ... @@ -3,7 +3,7 @@
import React from 'react';
import ReactNative from 'react-native';
let {
const {
Component,
} = React;
... ...
... ... @@ -12,7 +12,7 @@ import AboutUs from '../components/AboutUs';
import * as userActions from '../reducers/user/userActions';
let {
const {
Component,
} = React;
... ...
... ... @@ -14,7 +14,7 @@ import {connect} from 'react-redux';
import {Map} from 'immutable';
import {Actions} from 'react-native-router-flux';
let {
const {
Component,
} = React;
... ...
... ... @@ -13,7 +13,7 @@ import * as deviceActions from '../reducers/device/deviceActions';
import Guide from '../components/Guide';
let {
const {
Component,
} = React;
... ...
... ... @@ -14,7 +14,7 @@ import * as homeActions from '../reducers/home/homeActions';
import * as messageActions from '../reducers/message/messageActions';
import CONFIG from '../constants/config';
let {
const {
Component,
} = React;
... ...
... ... @@ -12,7 +12,7 @@ import * as userActions from '../reducers/user/userActions';
import * as deviceActions from '../reducers/device/deviceActions';
import Login from '../components/Login';
let {
const {
Component,
} = React;
... ...
... ... @@ -12,7 +12,7 @@ import * as userActions from '../reducers/user/userActions';
import * as deviceActions from '../reducers/device/deviceActions';
import Logout from '../components/Logout';
let {
const {
Component,
} = React;
... ...
... ... @@ -12,7 +12,7 @@ import Message from '../components/Message';
import * as messageActions from '../reducers/message/messageActions';
let {
const {
Component,
} = React;
... ...
... ... @@ -13,7 +13,7 @@ import * as messageActions from '../reducers/message/messageActions';
import * as deviceActions from '../reducers/device/deviceActions';
import MessageDetail from '../components/MessageDetail';
let {
const {
Component,
} = React;
... ...
... ... @@ -12,7 +12,7 @@ import * as userActions from '../reducers/user/userActions';
import * as deviceActions from '../reducers/device/deviceActions';
import ModifyPassword from '../components/ModifyPassword';
let {
const {
Component,
} = React;
... ...
... ... @@ -15,7 +15,7 @@ import moment from 'moment';
import Immutable, {List, Record} from 'immutable';
import config from '../constants/config';
let {
const {
Component,
} = React;
... ...
... ... @@ -12,7 +12,7 @@ import User from '../components/User';
import * as userActions from '../reducers/user/userActions';
let {
const {
Component,
} = React;
... ...
'use strict';
import store from 'react-native-simple-store';
import CONFIG from '../constants/config';
export default class AppAuthToken {
/**
* ## AppAuthToken
*
* set the key from the config
*/
constructor () {
this.SESSION_TOKEN_KEY = CONFIG.storeKey.SESSION_TOKEN_KEY;
}
/**
* ### storeSessionToken
* Store the session key
*/
storeSessionToken(sessionToken) {
return store.save(this.SESSION_TOKEN_KEY, {
sessionToken: sessionToken
});
}
/**
* ### getSessionToken
*/
getSessionToken() {
return store.get(this.SESSION_TOKEN_KEY);
}
/**
* ### deleteSessionToken
* Deleted during log out
*/
deleteSessionToken() {
return store.delete(this.SESSION_TOKEN_KEY);
}
}
'use strict';
import {Platform} from "react-native";
import {Platform, Dimensions} from 'react-native';
import CONFIG from '../constants/config';
import DeviceInfo from 'react-native-device-info';
import queryString from 'query-string';
... ... @@ -162,8 +162,8 @@ export default class Request {
_publicParams() {
let app_version = DeviceInfo.getBuildNumber();
let os_version = DeviceInfo.getSystemVersion();
let client_type = React.Platform.OS === 'ios' ? 'iphone' : 'android';
let {height, width} = React.Dimensions.get('window');
let client_type = Platform.OS === 'ios' ? 'iphone' : 'android';
let {height, width} = Dimensions.get('window');
let screen_size = width + 'x' + height;
return {
... ...
... ... @@ -3,7 +3,7 @@
export default function timeoutPromise(ms, promise) {
return new Promise((resolve, reject) => {
const timeoutId = setTimeout(() => {
reject(new Error("promise timeout"))
reject(new Error("Network timeout"))
}, ms);
promise.then(
(res) => {
... ...