Authored by 叶弯弯

Merge branch 'develop' of git.yoho.cn:mobile/yh_vendor into develop

... ... @@ -17,6 +17,8 @@
5AC1B39F4940B0FAC56474FA /* libPods-YH_Vendor.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B562CE3CB8E496AF9768090D /* libPods-YH_Vendor.a */; };
87AF818B1CFD959D00ACE834 /* libRNDeviceInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 87AF818A1CFD959D00ACE834 /* libRNDeviceInfo.a */; };
87AF81AF1D00324300ACE834 /* echarts.min.js in Resources */ = {isa = PBXBuildFile; fileRef = 87AF81AE1D00324300ACE834 /* echarts.min.js */; };
87AF81B21D01168400ACE834 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 87AF81B01D01168400ACE834 /* libReact.a */; };
87AF81B31D01168400ACE834 /* libSSZipArchive.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 87AF81B11D01168400ACE834 /* libSSZipArchive.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
... ... @@ -49,6 +51,8 @@
5B51D3B6F0CB3E5047D881CA /* Pods-YH_Vendor.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YH_Vendor.debug.xcconfig"; path = "Pods/Target Support Files/Pods-YH_Vendor/Pods-YH_Vendor.debug.xcconfig"; sourceTree = "<group>"; };
87AF818A1CFD959D00ACE834 /* libRNDeviceInfo.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libRNDeviceInfo.a; path = "../../../../Library/Developer/Xcode/DerivedData/YH_Vendor-hikjhmoukakxyvegrfxjqofhevhj/Build/Products/Release-iphonesimulator/libRNDeviceInfo.a"; sourceTree = "<group>"; };
87AF81AE1D00324300ACE834 /* echarts.min.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = echarts.min.js; sourceTree = "<group>"; };
87AF81B01D01168400ACE834 /* libReact.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libReact.a; path = "Pods/../build/Debug-iphoneos/libReact.a"; sourceTree = "<group>"; };
87AF81B11D01168400ACE834 /* libSSZipArchive.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libSSZipArchive.a; path = "Pods/../build/Debug-iphoneos/libSSZipArchive.a"; sourceTree = "<group>"; };
B562CE3CB8E496AF9768090D /* libPods-YH_Vendor.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-YH_Vendor.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
... ... @@ -64,6 +68,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
87AF81B21D01168400ACE834 /* libReact.a in Frameworks */,
87AF81B31D01168400ACE834 /* libSSZipArchive.a in Frameworks */,
87AF818B1CFD959D00ACE834 /* libRNDeviceInfo.a in Frameworks */,
5AC1B39F4940B0FAC56474FA /* libPods-YH_Vendor.a in Frameworks */,
);
... ... @@ -168,6 +174,8 @@
D5ECECDEB080EA5509812B91 /* Frameworks */ = {
isa = PBXGroup;
children = (
87AF81B01D01168400ACE834 /* libReact.a */,
87AF81B11D01168400ACE834 /* libSSZipArchive.a */,
87AF818A1CFD959D00ACE834 /* libRNDeviceInfo.a */,
B562CE3CB8E496AF9768090D /* libPods-YH_Vendor.a */,
);
... ... @@ -426,6 +434,10 @@
);
INFOPLIST_FILE = YH_Vendor/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/build/Debug-iphoneos",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
... ... @@ -450,6 +462,10 @@
);
INFOPLIST_FILE = YH_Vendor/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/build/Debug-iphoneos",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
... ...
... ... @@ -27,7 +27,7 @@ export default class AboutUs extends Component {
<Text style={styles.name}>Yoho!Buy有货</Text>
<View style={styles.version}>
<Text style={styles.versionText}>当前版本:</Text>
<Text style={styles.versionText}>{'v' + DeviceInfo.getBuildNumber()}</Text>
<Text style={styles.versionText}>{'v' + DeviceInfo.getVersion()}</Text>
</View>
<TouchableHighlight underlayColor={'white'} style={[styles.update, {opacity: this.props.showUpdate ? 1 : 0}]}
onPress={this.props.showUpdate ? () => {this.props.updateVersion()} : () => {}}>
... ...
... ... @@ -6,6 +6,7 @@ import ReactNative from 'react-native';
import Immutable, {List} from 'immutable';
import moment from 'moment';
import ImmutablePropTypes from 'react-immutable-proptypes';
import LoadingIndicator from './indicator/LoadingIndicator';
const {
Component,
... ... @@ -78,8 +79,12 @@ export default class Meassage extends Component {
<ListView style={styles.list}
dataSource={this.ds.cloneWithRows(this.props.items.toArray())}
renderRow={this.renderItem}
enableEmptySections={true}
renderSeparator={(sectionID, rowID) => <View key={`${sectionID}-${rowID}`} style={styles.separator}/>}
/>
<LoadingIndicator
isVisible={this.props.isFetching}
/>
</View>
);
... ...
... ... @@ -140,6 +140,8 @@ const styles = StyleSheet.create({
position: 'absolute',
right: 15,
bottom: 33,
width: 60,
paddingLeft: 30,
},
});
... ... @@ -176,7 +178,7 @@ class NavBar extends React.Component {
this.renderTitle = this.renderTitle.bind(this);
}
componentWillMount() {
componentDidMount() {
if (Platform.OS === 'android') {
BackAndroid.addEventListener('hardwareBackPress', this.onBackAndroid);
}
... ... @@ -413,8 +415,13 @@ class NavBar extends React.Component {
const brandName = this.props.getBrandName ? this.props.getBrandName(childState) : '';
return (
<View style={styles.userInfoContainer} >
<Text style={styles.userInfoTitle} onPress={() => {Actions.Logout();}}>{brandName}</Text>
<Image source={require('../images/white.png')} style={styles.whiteArrow}/>
<Text style={styles.userInfoTitle}>{brandName}</Text>
<TouchableOpacity
onPress={() => {Actions.Logout();}}
style={styles.whiteArrow}
>
<Image source={require('../images/white.png')} />
</TouchableOpacity>
</View>
);
... ...
... ... @@ -39,7 +39,7 @@ export default class User extends Component {
);
}
_renderRow(item) {
_renderRow(item, sectionID, rowID) {
let icon = item.icon;
return (
<TouchableHighlight underlayColor={'white'} onPress={() => this.props.onItemPressed(item)}>
... ... @@ -47,7 +47,8 @@ export default class User extends Component {
<Image source={item.icon}/>
<Text style={styles.title}>{item.title}</Text>
<Text>{item.subtitle}</Text>
<Image source={item.arrow} />
{rowID === 1 ? <Image source={item.arrow} /> : null}
</View>
</TouchableHighlight>
);
... ...
... ... @@ -8,6 +8,7 @@ import {
Text,
Platform,
NativeModules,
Dimensions,
} from 'react-native';
export default class ChartView extends Component {
... ... @@ -50,7 +51,7 @@ export default class ChartView extends Component {
}
}
const chartHeight = (Platform.OS === 'android') ? 250 : 175;
const chartHeight = (Platform.OS === 'android') ? 250 : 250;
const styles = StyleSheet.create({
container: {
... ... @@ -59,7 +60,7 @@ const styles = StyleSheet.create({
titleStyle: {
fontSize: 14,
color: '#b1b1b1',
marginTop: 20,
marginTop: 15,
marginLeft: 15,
},
chartStyle: {
... ... @@ -70,17 +71,19 @@ const styles = StyleSheet.create({
},
});
const fontSize = (Platform.OS === 'android') ? 14 : 24;
const fontSize = (Platform.OS === 'android') ? 14 : 14;
const width = Dimensions.get('window').width;
function getHTMLString(xData, yData, jsPath) {
const HTML = `
<!DOCTYPE html>
<html style="height: 100%; margin: 0px;">
<html style="width: ` + width + `; height: 100%; margin: 0px;">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"/>
</head>
<body style="height: 100%; margin: 0px;">
<div id="container" style="height: 100%; margin: 0px; min-height: 250px;"></div>
<body style="width: ` + width + `; height: 100%; margin: 0px;">
<div id="container" style="width: ` + width + `; height: 100%; margin: 0px; min-height: 250px;"></div>
<script type="text/javascript" src="`+ jsPath +`"></script>
<script type="text/javascript">
var dom = document.getElementById("container");
... ... @@ -91,6 +94,13 @@ function getHTMLString(xData, yData, jsPath) {
title: {
show: false,
},
grid: {
left: '5%',
top: 60,
right: '8%',
width: '90%',
height: '65%',
},
xAxis: {
type: 'category',
boundaryGap: true,
... ... @@ -114,7 +124,7 @@ function getHTMLString(xData, yData, jsPath) {
splitLine: {
show: false,
},
data:[`+xData+`]
data:[` + xData + `]
},
yAxis: {
type: 'value',
... ... @@ -135,7 +145,7 @@ function getHTMLString(xData, yData, jsPath) {
trigger: 'axis',
alwaysShowContent: 'true',
position: function (point,params,dom) {
return [point[0]/7*7-40,0];
return [point[0] / 7 * 7 - 20, 20];
},
backgroundColor: 'orange',
formatter: '{c}',
... ... @@ -148,8 +158,7 @@ function getHTMLString(xData, yData, jsPath) {
opacity: 1,
},
},
extraCssText: 'box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);',
padding:[10,20],
padding:[5, 10],
},
series: [
{
... ...
... ... @@ -31,7 +31,7 @@ export default class LoadingIndicator extends Component {
overlayHeight: 100,
overlayColor: 'rgba(0,0,0,0.6)',
size: (Platform.OS === 'ios') ? 'large' : 'Normal',
color: (Platform.OS === 'ios') ? 'gray' : 'gray',
color: (Platform.OS === 'ios') ? 'white' : 'gray',
text: '加载中...',
textColor: '#eeeeee',
textFontSize: 14,
... ...
... ... @@ -74,6 +74,7 @@ class MessageContainer extends Component {
<Message
items={this.props.message.messageList}
onPressItem={this.pressRow}
isFetching={this.props.message.isFetching}
/>
</View>
);
... ...
... ... @@ -37,47 +37,47 @@ export default function messageReducer(state = initialState, action) {
if (!(state instanceof InitialState)) return initialState.merge(state);
switch (action.type) {
case MESSAGE_DETAIL:{
// let nextState = state.setIn(['messageDetail', 'title'], action.payload.title)
// .setIn(['messageDetail', 'content'], action.payload.content)
// .setIn(['messageDetail', 'time'], action.payload.createTime)
// .setIn(['messageDetail', 'id'], action.payload.id)
// .setIn(['messageDetail', 'isRead'], action.payload.isRead)
// .setIn();
case MESSAGE_DETAIL: {
let nextState = state.set('messageDetail', action.payload);
return nextState;
}
case REQUEST_MSG_NUM:
case BATCH_SET_MSG_IS_READ:
case REQUEST_MSG_LIST:
{
case REQUEST_MSG_LIST: {
let nextState = state.set('isFetching', true)
.set('error', null);
return nextState;
}
case REQUEST_MSG_NUM_SUCCESS: {
let nextState = state.set('isFetching', false)
.set('error', null)
.set('unreadNum', action.payload);
return nextState;
}
case REQUEST_MSG_LIST_SUCCESS: {
let nextState = state.set('isFetching', false)
.set('error', null)
.set('messageList', Immutable.fromJS(action.payload.list));
return nextState;
}
case BATCH_SET_MSG_IS_READ_SUCCESS: {
case REQUEST_MSG_LIST_FAILURE: {
return state.set('isFetching', false)
.set('error', null);
.set('error', action.payload);
}
case REQUEST_MSG_NUM_SUCCESS: {
let nextState = state.set('unreadNum', action.payload);
return nextState;
}
case BATCH_SET_MSG_IS_READ_SUCCESS: {
// console.log(state);
let nextState = state.setIn(['messageList', state.messageDetail, 'isRead'], true);
// console.log(nextState);
return nextState;
}
case REQUEST_MSG_NUM:
case REQUEST_MSG_NUM_FAILURE:
case BATCH_SET_MSG_IS_READ:
case BATCH_SET_MSG_IS_READ_FAILURE:
case REQUEST_MSG_LIST_FAILURE:
{
return state.set('isFetching', false)
.set('error', action.payload);
}
return state;
case SWITCH_BRAND:
case LOGOUT:
return initialState;
... ...