-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathHome.js
More file actions
86 lines (83 loc) · 3.38 KB
/
Home.js
File metadata and controls
86 lines (83 loc) · 3.38 KB
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
import React, {Component} from 'react'
import {
View,Dimensions,Text,
} from 'react-native'
import MonthList from "./mMonth/MonthList";
const maxHeight = Dimensions.get('window').height;
const maxWidth = Dimensions.get('window').width;
export default class Home extends Component {
constructor(props){
super(props);
this.state ={
year : '',
month : ''
}
}
/* 返回模型
* month:{
* year : //所属年
* lunar : //阴历月份
* month : //公历月份
* describe : //描述
* systemMonth : number ,系统当前月
* days : [],
* marks : [],
* isSelectMore :
* selectDays : [],
* isGray : bool, //是否灰色展示(非本月)
* selectColor:PropTypes.string, //选中颜色
selectShape:PropTypes.string, // 圆:round 正方形:square,
selectSpace:PropTypes.number, //选中背景距离边格的距离,默认0,
* }
* */
render(){
return(
<View style = {{flex:1}}>
<View style = {{marginTop:44,justifyContent:'center',alignItems:'center'}}>
<Text style = {{fontSize:23}}>
{this.state.year + ' ' + this.state.month}
</Text>
</View>
<MonthList style = {{marginHorizontal:25,marginTop:64}}
width = {maxWidth - 50}
height = {270}
isSelectMore = {false}
isShowNotCurrentMonth = {true}
isSelectGray = {false}
horizontal = {true}
getShowTime = {(year,month) =>{
this.setState({
year:year,
month:month
})
}}
getMarks={(month) =>{
return [3,6,9];
}}
getSelectDays={(month) =>{
return [13,16,19];
}}
selectDaysBack={(days) =>{
// console.log(days);
}}/>
{/*<Month style = {{marginHorizontal:25,marginTop:64}}*/}
{/*width = {Dimensions.get('window').width - 50}*/}
{/*height = {270}*/}
{/*month = {{year:2018,*/}
{/*month:10,*/}
{/*systemMonth:10,*/}
{/*marks :[1,5,9],*/}
{/*isSelectMore:true,*/}
{/*selectDays:[1,8,15],*/}
{/*isGray:true,*/}
{/*markColor:'#FF0000',*/}
{/*selectColor : '#1E90FF',*/}
{/*selectShape : 'round',*/}
{/*selectSpace : 5,}}*/}
{/*selectDaysBack = {(days) =>{*/}
{/*console.log(days);*/}
{/*}}/>*/}
</View>
)
}
}