|
@@ -25,11 +25,6 @@ import { Dimensions } from 'react-native'
|
|
|
const { height, width } = Dimensions.get('window');
|
|
|
|
|
|
export default class VideoExplain extends Component {
|
|
|
- static propTypes = {
|
|
|
- // uri: PropTypes.string,
|
|
|
- // title: PropTypes.string,
|
|
|
- // details: PropTypes.string,
|
|
|
- };
|
|
|
state = {
|
|
|
isFull: false,
|
|
|
video_height: 210,
|
|
@@ -38,7 +33,8 @@ export default class VideoExplain extends Component {
|
|
|
width: "100%"
|
|
|
},
|
|
|
collectImage: require('../images/courseDetails/collect.png'),
|
|
|
- isCollect: true
|
|
|
+ isCollect: true,
|
|
|
+ numberLine: 2
|
|
|
};
|
|
|
|
|
|
render() {
|
|
@@ -68,7 +64,7 @@ export default class VideoExplain extends Component {
|
|
|
/>
|
|
|
<View style={styles.videoExplain}>
|
|
|
<View style={styles.title}>
|
|
|
- <Text style={styles.font}>{this.props.dataList}</Text>
|
|
|
+ <Text style={styles.font}>{this.props.dataList.title}</Text>
|
|
|
<View style={styles.icon}>
|
|
|
<TouchableOpacity onPress={this.collection.bind(this)}>
|
|
|
<Image source={this.state.collectImage} style={styles.iconSize} />
|
|
@@ -80,9 +76,9 @@ export default class VideoExplain extends Component {
|
|
|
</View>
|
|
|
<View style={[styles.title, styles.tops]}>
|
|
|
<Text style={styles.font}>课程介绍:</Text>
|
|
|
- <Text style={styles.clor}>更多 ></Text>
|
|
|
+ <Text style={styles.clor} onPress={() => this.open()}>更多 ></Text>
|
|
|
</View>
|
|
|
- <Text style={styles.clor}>{this.props.details}</Text>
|
|
|
+ <Text style={[ styles.clor, styles.introduce]} numberOfLines={this.state.numberLine}>{this.props.dataList.description}</Text>
|
|
|
</View>
|
|
|
</View>
|
|
|
);
|
|
@@ -125,6 +121,9 @@ export default class VideoExplain extends Component {
|
|
|
back(){
|
|
|
this.props.videoback();
|
|
|
}
|
|
|
+ start(){
|
|
|
+ this.video.start();
|
|
|
+ }
|
|
|
componentWillMount() {
|
|
|
this.backlistener=BackHandler.addEventListener(
|
|
|
"hardwareBackPress",
|
|
@@ -167,6 +166,12 @@ export default class VideoExplain extends Component {
|
|
|
share() {
|
|
|
alert('点击分享')
|
|
|
}
|
|
|
+ // 点击更多展开说明
|
|
|
+ open() {
|
|
|
+ this.setState({
|
|
|
+ numberLine: 10
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
@@ -205,5 +210,8 @@ const styles = StyleSheet.create({
|
|
|
},
|
|
|
tops: {
|
|
|
marginTop: 18
|
|
|
+ },
|
|
|
+ introduce: {
|
|
|
+ marginTop: 5
|
|
|
}
|
|
|
});
|