-
Notifications
You must be signed in to change notification settings - Fork 198
/
Copy pathHome.js
102 lines (94 loc) · 2.21 KB
/
Home.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* 愁眉弯唇皆是为你从此眉间心上再无一人
*/
'use strict'
var React = require('react-native');
var {
ScrollView,
View,
Platform,
StyleSheet,
} = React;
var CloverSlider = require('./components/CloverSlider');
var JZListView = require('./components/JZListView');
var JZMenuCard = require('./components/JZMenuCard');
var JZRushCell = require('./components/JZRushCell');
var JZWebView = require('./components/JZWebView');
var JZDiscount = require('./components/JZDiscount');
var JZDisWebView = require('./components/JZDisWebView');
var Home = React.createClass({
//初始化
getInitialState(){
return {
//配置项
};
},
//选中一行
selectShop:function(shopData : Object){
if (Platform.OS === 'ios') {
this.props.navigator.push({
title:'限时抢购',
component:JZWebView,
passProps:{shopData},
});
}else{
//android对应的处理
}
},
selectRush:function(){
if (Platform.OS === 'ios') {
this.props.navigator.push({
title:'限时抢购',
component:JZWebView,
passProps:{},
});
}else{
//android对应的处理
}
},
selectDiscount:function(url){
console.log('dis _' + url);
if (Platform.OS === 'ios') {
this.props.navigator.push({
title:'限时抢购',
component:JZDisWebView,
passProps:{url},
});
}else{
//android对应的处理
}
},
render(){
return (
<View style = {styles.container}>
<ScrollView>
<CloverSlider />
<View style={{height : 4, backgroundColor : '#F2F2F2'}} />
<JZMenuCard />
<View style={{height : 4, backgroundColor : '#F2F2F2'}} />
<JZRushCell
onSelect = {() => this.selectRush()}
/>
<View style={{height : 4, backgroundColor : '#F2F2F2'}} />
<JZDiscount
onSelect1 = {(a) => this.selectDiscount(a)}
/>
<View style={{height : 4, backgroundColor : '#F2F2F2'}} />
<JZListView
onSelect = {() => this.selectShop('')}
/>
</ScrollView>
</View>
);
},
});
var styles = StyleSheet.create({
container:{
flex:1,
backgroundColor:'white',
},
});
module.exports = Home;