CourseDetails.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /**
  2. * Sample React Native App
  3. * https://github.com/facebook/react-native
  4. *
  5. * @format
  6. * @flow
  7. */
  8. import React, { Component } from "react";
  9. import {
  10. StyleSheet,
  11. Text,
  12. View,
  13. Image,
  14. ScrollView,
  15. FlatList
  16. } from "react-native";
  17. import VideoExplain from './components/VideoExplain'
  18. import CourseListRow from './components/CourseListRow'
  19. // import CourseListLine from './components/CourseListLine'
  20. export default class CourseDetails extends Component {
  21. state () {
  22. return {
  23. fullStyle: {}
  24. }
  25. }
  26. render() {
  27. return (
  28. <ScrollView style={{backgroundColor: '#F0F1F5', width: '100%', height: '100%'}}>
  29. <View>
  30. <VideoExplain
  31. full={this.full.bind(this)}
  32. title={'同步辅导语文一年级下册'}
  33. details={'汉字,作为象形文字,是中华文化的载体,本课程从甲骨文开始,让孩子爱上识字爱上文字的美。了解文字…'}
  34. uri={'http://chimee.org/vod/1.mp4'}
  35. />
  36. </View>
  37. <View style={ this.state.fullStyle }>
  38. <CourseListRow title={'课件'}></CourseListRow>
  39. <CourseListRow title={'课件'}></CourseListRow>
  40. <CourseListRow title={'课件'}></CourseListRow>
  41. </View>
  42. </ScrollView>
  43. );
  44. }
  45. full(isFull){
  46. if(isFull) {
  47. // 全屏时隐藏多余的view
  48. this.setState({
  49. fullStyle: {}
  50. })
  51. }else {
  52. // 全屏时隐藏多余的view
  53. this.setState({
  54. fullStyle: {
  55. display: 'none'
  56. }
  57. })
  58. }
  59. }
  60. }
  61. const styles = StyleSheet.create({
  62. });