12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- /**
- * Sample React Native App
- * https://github.com/facebook/react-native
- *
- * @format
- * @flow
- */
- import React, { Component } from "react";
- import {
- StyleSheet,
- Text,
- View,
- Image,
- ScrollView,
- FlatList
- } from "react-native";
- import VideoExplain from './components/VideoExplain'
- import CourseListRow from './components/CourseListRow'
- import CourseListLine from './components/CourseListLine'
- import Comment from './components/Comment'
- import Order from './components/Order'
- import courseDetails from './services/courseDetails'
- export default class CourseDetails extends Component {
- componentDidMount() {
- const { courseId } = this.props.navigation.state.params;
- console.log(courseId)
- courseDetails.getCourseDetails(courseId).success(res => {
- console.log('列表',res.data)
- this.setState({
- courseList: 222
- })
- });
- }
- state = {
- fullStyle: {},
- lefts: 0,
- courseList: 111
- }
- render() {
- return (
- <View style={{backgroundColor: '#F0F1F5', width: '100%', height: '100%', position: 'relative'}}>
- <ScrollView>
- <View>
- <VideoExplain
- full={this.full.bind(this)}
- title={'同步辅导语文一年级下册'}
- details={'汉字,作为象形文字,是中华文化的载体,本课程从甲骨文开始,让孩子爱上识字爱上文字的美。了解文字…'}
- uri={'http://chimee.org/vod/1.mp4'}
- dataList={ this.state.courseList }
- videoback={this.back.bind(this) }
- />
- </View>
- <View style={ this.state.fullStyle }>
- <CourseListRow title={'课件'}></CourseListRow>
- <CourseListLine title={'课件'}></CourseListLine>
- <Comment title={ '全部评论' }></Comment>
- </View>
- </ScrollView>
- <Order left={ this.state.lefts }></Order>
- </View>
- );
- }
- back(){
- this.props.navigation.goBack()
- }
- full(isFull){
- if(isFull) {
- // 全屏时隐藏多余的view
- this.setState({
- fullStyle: {},
- lefts: 0
- })
- }else {
- // 全屏时隐藏多余的view
- this.setState({
- fullStyle: {
- display: 'none'
- },
- lefts: '-100%'
- })
- }
- }
- }
- const styles = StyleSheet.create({
-
- });
|