targetDetail.js
7.66 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
/**
* Created by Cassie on 2018/05/14
*/
import React, { Component } from 'react';
import {
StyleSheet,
View,
Text,
TouchableOpacity,
Image,
ScrollView,
FlatList,
InteractionManager
} from 'react-native';
import {zoomW,zoomH} from '../../utils/getSize';
import {xnToast} from '../../utils/utils';
const back = require('../../img/returnB.png');
const dddB = require('../../img/dddB.png');
const cover = require('../../img/cover.png');
const linkTarget = require('../../img/linkTarget.png');
const bread = require('../../img/bread.png');
const member = require('../../img/member.png');
const progress = require('../../img/progress.png');
export default class TargetDetail extends Component {
static navigationOptions = ({ navigation, screenProps }) => ({
title:'详情',
headerLeft:(<View style={{display:'flex',flexDirection:'row'}}>
<TouchableOpacity style={styles.topIcon} onPress={navigation.state.params?navigation.state.params.back:null}>
<Image source={back} style={{width:(16/zoomH),height:(16/zoomH)}} resizeMode="contain" />
</TouchableOpacity>
</View>),
headerRight:(<View style={{display:'flex',flexDirection:'row'}}>
<TouchableOpacity style={styles.topIcon} onPress={navigation.state.params?navigation.state.params.back:null}>
<Image source={dddB} resizeMode="contain" />
</TouchableOpacity>
</View>)
});
constructor(props){
super(props);
this.state = {
sheetList:[{name:'0',pic:cover},{name:'1',pic:cover},{name:'2',pic:cover},{name:'3',pic:cover},{name:'4',pic:cover},{name:'5',pic:cover},{name:'6',pic:cover},{name:'7',pic:cover}],
};
};
componentDidMount(){
this.props.navigation.setParams({
back:() => {
InteractionManager.runAfterInteractions(() => {this.props.navigation.goBack();})
}
});
};
/* 渲染图片列表*/
keyExtractor = (item,index) => index;
renderItem = ({item,index}) => (
<TouchableOpacity activeOpacity={0.8}>
<View style={styles.attachItem}>
<Image source={item.pic} style={{width:(64/zoomH),height:(64/zoomH),borderRadius:7}} resizeMode="contain" />
</View>
</TouchableOpacity>
);
render(){
return(
<View style={styles.background}>
<ScrollView>
<View style={styles.targetTime}>
<View style={styles.dot} />
<Text style={{fontSize:12,color:'#999'}}>2018-04-01 8:00 —— </Text>
<View style={styles.dot} />
<Text style={{fontSize:12,color:'#999'}}>2018-04-30 18:00</Text>
</View>
<View style={styles.content}>
<Text style={{fontSize:18,color:'#000',marginBottom:(8/zoomH)}}>企信设计</Text>
<Text style={{fontSize:16,color:'#333'}}>不少设计师开始利用诸如斑点和小气泡这样的装饰性元素,分散在网页的各个角落。这些装饰性的元素大多以小圆点的形式呈现,它们的形态多种多样,但是总体上有着吸引视线、丰富视觉的功能。即使是基于相同的设计概念,不同的气泡和斑点,让每个设计项目都有着不同的性格。</Text>
<View style={{width:'100%',paddingTop:(10/zoomH),paddingBottom:(10/zoomH)}}>
<View style={styles.voiceItem} />
</View>
<FlatList showsHorizontalScrollIndicator={false} horizontal={true} keyExtractor={this.keyExtractor} data={this.state.sheetList} renderItem={this.renderItem} style={{paddingTop:(10/zoomH),paddingBottom:(15/zoomH)}} />
</View>
<TouchableOpacity activeOpacity={0.8} style={styles.settingItem} onPress={() => InteractionManager.runAfterInteractions(() => this.props.navigation.navigate('TargetAbout',{from:'关联任务'}))}>
<Image source={linkTarget} style={{width:(17/zoomW),height:(16/zoomH)}} resizeMode="contain" />
<Text style={{marginLeft:(10/zoomW),fontSize:16,color:'#333'}}>关联任务</Text>
<Text style={{flex:1,fontSize:16,color:'#000',textAlign:'right'}} />
<Image source={bread} style={{width:(6/zoomW),height:(11/zoomH)}} resizeMode="contain" />
</TouchableOpacity>
<TouchableOpacity activeOpacity={0.8} style={styles.settingItem} onPress={() => InteractionManager.runAfterInteractions(() => this.props.navigation.navigate('TargetAbout',{from:'成员'}))}>
<Image source={member} style={{width:(17/zoomW),height:(16/zoomH)}} resizeMode="contain" />
<Text style={{marginLeft:(10/zoomW),fontSize:16,color:'#333'}}>成员</Text>
<Text style={{flex:1,fontSize:16,color:'#000',textAlign:'right'}} />
<Image source={bread} style={{width:(6/zoomW),height:(11/zoomH)}} resizeMode="contain" />
</TouchableOpacity>
<View activeOpacity={0.8} style={styles.settingItem}>
<Image source={linkTarget} style={{width:(17/zoomW),height:(16/zoomH)}} resizeMode="contain" />
<Text style={{marginLeft:(10/zoomW),fontSize:16,color:'#333'}}>发起人</Text>
<Text style={{flex:1,fontSize:16,color:'#000',textAlign:'right'}}>发起人</Text>
<View style={{width:(6/zoomW)}} />
</View>
<View activeOpacity={0.8} style={styles.settingItem}>
<Image source={progress} style={{width:(17/zoomW),height:(16/zoomH)}} resizeMode="contain" />
<Text style={{marginLeft:(10/zoomW),fontSize:16,color:'#333'}}>汇报进度</Text>
<Text style={{flex:1,fontSize:16,color:'#000',textAlign:'right'}}>每周一 二 三 四 五 18:00</Text>
</View>
</ScrollView>
</View>
);
}
}
const styles = StyleSheet.create({
topIcon:{
paddingLeft:(10/zoomW),
paddingRight:(10/zoomW),
height:'100%',
display:'flex',
alignItems:'center'
},
background:{
flex:1,
backgroundColor:'#fff',
display:'flex',
alignItems:'center'
},
targetTime:{
width:'100%',
height:(34/zoomH),
backgroundColor:'#eee',
paddingLeft:(15/zoomW),
paddingRight:(15/zoomW),
display:'flex',
flexDirection:'row',
alignItems:'center'
},
dot:{
width:(5/zoomH),
height:(5/zoomH),
borderRadius:(2.5/zoomH),
backgroundColor:'#999',
marginRight:(7/zoomW)
},
content:{
width:'100%',
borderBottomWidth:StyleSheet.hairlineWidth,
borderColor:'#ddd',
borderStyle:'solid',
paddingLeft:(15/zoomW),
paddingRight:(15/zoomW),
paddingTop:(10/zoomH)
},
attachItem:{
width:(65/zoomH),
height:(65/zoomH),
borderStyle:'solid',
borderColor:'#ddd',
borderWidth:StyleSheet.hairlineWidth,
marginRight:(15/zoomW)
},
voiceItem:{
width:'100%',
height:(45/zoomH),
backgroundColor:'#f3f3f3',
borderRadius:7
},
settingItem:{
width:'100%',
height:(44/zoomH),
display:'flex',
flexDirection:'row',
alignItems:'center',
paddingLeft:(15/zoomW),
paddingRight:(15/zoomW)
}
});