/** * Sample React Native App * https://github.com/facebook/react-native * * @format * @flow */ import React, { Component } from "react"; import { Platform, StyleSheet, Text, View, Image, TouchableOpacity, ImageBackground, FlatList, Button, DeviceEventEmitter } from "react-native"; import AndroidUtil from "../../util/AndroidUtil"; import BasePage from "../BasePage"; import CourseTitle from "./CourseTitle"; import ScheduleFlatItem from "./ScheduleFlatItem"; import CusVideo from "./CusVideo"; const instructions = Platform.select({ ios: "Press Cmd+R to reload,\n" + "Cmd+D or shake for dev menu", android: "Double tap R on your keyboard to reload,\n" + "Shake or press menu button for dev menu" }); type Props = {}; export default class SchedulePage extends BasePage { constructor(props) { super(props); this.state = { videoImg_flex: 1, videoImg_width: "100%", videoImg_height: "100%", video_flex: 0, video_width: "0%", video_height: "0%", video_uri: "http://efunvideo.ai160.com/vs2m/056/05602002/05602002001/05602002001.m3u8" }; } render() { return ( this.goBack()} // backPress={() => alert("点击返回")} sharedpress={() => alert("点击分享")} /> ( )} renderItem={({ item }) => { return this.loadFlatItem(item); }} keyExtractor={(item, index) => item.key.toString()} horizontal={false} data={[ { key: 1, typecolor: "#74E0FF", typename: "习惯养成", videoname: "碗里不剩一粒米", videourl: "碗里不剩一粒米xxxx" }, { key: 2, typecolor: "#FB5B76", typename: "品格礼仪", videoname: "我有很多朋友", videourl: "我有很多朋友xxxx" }, { key: 3, typecolor: "#EC48E1", typename: "自我保护", videoname: "小猫喵喵叫", videourl: "小猫喵喵叫xxxx" }, { key: 4, typecolor: "#39D6B9", typename: "亲子游戏", videoname: "安静的睡前游戏-全家人都睡了", videourl: "安静的睡前游戏xxxx" }, { key: 5, typecolor: "#3397F0", typename: "欢乐音乐", videoname: "小鸡捉虫子", videourl: "小鸡捉虫子xxxx" }, { key: 11, typecolor: "#74E0FF", typename: "习惯养成", videoname: "碗里不剩一粒米", videourl: "碗里不剩一粒米xxxx" }, { key: 12, typecolor: "#FB5B76", typename: "品格礼仪", videoname: "我有很多朋友", videourl: "我有很多朋友xxxx" }, { key: 13, typecolor: "#EC48E1", typename: "自我保护", videoname: "小猫喵喵叫", videourl: "小猫喵喵叫xxxx" }, { key: 14, typecolor: "#39D6B9", typename: "亲子游戏", videoname: "安静的睡前游戏-全家人都睡了", videourl: "安静的睡前游戏xxxx" }, { key: 15, typecolor: "#3397F0", typename: "欢乐音乐", videoname: "小鸡捉虫子", videourl: "http://efunvideo.ai160.com/vs2m/056/05602002/05602002001/05602002001.m3u8" } ]} /> ); } loadFlatItem(data) { return ( this.aa(data.videourl)} /> ); } aa(url) { alert(url); this.setState({ videoImg_flex: 0, videoImg_width: "0%", videoImg_height: "0%", video_flex: 1, video_width: "100%", video_height: "100%", video_uri: url }); } }