/** * Sample React Native App * https://github.com/facebook/react-native * * @format * @flow */ import React, { Component } from "react"; import { StyleSheet, Text, View, Image, ScrollView, StatusBar, BackHandler, FlatList, TouchableOpacity } from "react-native"; import Orientation from "react-native-orientation"; import CusVideo from "./CusVideo"; // 获取屏幕宽高 import { Dimensions } from 'react-native' const { height, width } = Dimensions.get('window'); import courseDetails from '../services/courseDetails' export default class VideoExplain extends Component { state = { isFull: false, video_height: 210, statusbar_hidden: false, videoStyle: { width: "100%" }, collectImage: require('../images/courseDetails/collect.png'), isCollect: true, numberLine: 2 }; componentWillReceiveProps(nextProps) { console.log(nextProps.dataList.id) const targetCode = nextProps.dataList.id; courseDetails.getisFavorites({ targetCode, }).then(res => { console.log('--------', res) if (res.code == 200 && res.data) { this.setState({ collectImage: require('../images/courseDetails/have_collect.png'), isCollect: false }) }else { this.setState({ collectImage: require('../images/courseDetails/collect.png'), isCollect: true }) } }).catch(error => console.log(error)) } render() { return (