Skip to content

Commit

Permalink
Navigator跳转,增加icon
Browse files Browse the repository at this point in the history
  • Loading branch information
iscarecrow committed Jul 27, 2016
1 parent 6844d81 commit e534cf5
Show file tree
Hide file tree
Showing 16 changed files with 84 additions and 17 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
## 堆糖RN项目

#### 页面包括
-
- 商店
- 发现
- 设置


#### 启动命令

- react-native run-ios
- react-native run-ios


#### 特殊说明
- 有些容器包装了navgator的原因,线上项目此处交由客户端解决
6 changes: 4 additions & 2 deletions app/containers/NavExplore.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ class NavExplore extends Component {
rightButtonTitle: '分享',
onRightButtonPress: () => this._handleNavigationRequest(),
}}
style={{flex: 1}}
tintColor="#008888"
style={{flex:1}}
tintColor="#333"
barTintColor="green"
titleTextColor="green"
/>
);
}
Expand Down
22 changes: 8 additions & 14 deletions app/containers/NavMe.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,30 @@ import { connect } from 'react-redux';
import * as navigatorActions from '../actions/navigator';

import Me from './Me';
import NavStore from './NavStore';
import Set from './Set';

class NavMe extends Component {
_handleNavigationRequest(nextRoute) {
alert('分享还没做');
console.log(this.props);

this.props.navigator.push(nextRoute);
this.refs.nav.push(nextRoute);
}
render() {
const { navigatorData } = this.props;

const nextRoute = {
title: "购物车",
component: NavStore,
rightButtonTitle: 'Cancel',
onRightButtonPress: () => { this.refs.nav.navigator.pop(); }
leftButtonTitle: '',
title: "设置",
component: Set
};


return (
<NavigatorIOS
ref='nav'
initialRoute={{
component: Me,
title: '我',
rightButtonTitle: '购物车',
rightButtonIcon: require('../image/icon_set_dark/icon_set_dark.png'),
onRightButtonPress: () => this._handleNavigationRequest(nextRoute),
}}
style={{flex: 1}}
tintColor="#008888"
tintColor="#333"
/>
);
}
Expand Down
3 changes: 3 additions & 0 deletions app/containers/NavStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ class NavStore extends Component {
initialRoute={{
component: Store,
title: '堆糖商店',
rightButtonIcon: require('../image/icon_cart/icon_cart.png'),
leftButtonIcon:require('../image/icon_membership/icon_membership_for_all.png')
}}
style={{flex: 1}}
tintColor='#333'
/>
);
}
Expand Down
37 changes: 37 additions & 0 deletions app/containers/Set.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React, { Component } from 'react';
import {
Text,
View,
StyleSheet
} from 'react-native';

class Set extends Component {
constructor(props) {
super(props);
this.state = {

}
}
_handleNextPress(nextRoute) {
}
render() {
return (
<Text style={{marginTop: 200, alignSelf: 'center'}}>
设置页面
</Text>
);
}
}

var styles = StyleSheet.create({
tabContent: {
flex: 1,
alignItems: 'center',
},
tabText: {
color: 'white',
margin: 50,
},
});

export default Set;
Binary file added app/image/icon_cart/icon_cart@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/image/icon_cart/icon_cart@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions app/image/icon_set_dark/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "icon_set_dark@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x",
"filename" : "icon_set_dark@3x.png"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file added app/image/icon_set_dark/icon_set_dark@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/image/icon_set_dark/icon_set_dark@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e534cf5

Please sign in to comment.