|
@@ -30,14 +30,9 @@ import CourseTitle from "./CourseTitle";
|
|
import SharedDialog from "./SharedDialog";
|
|
import SharedDialog from "./SharedDialog";
|
|
import ScheduleFlatItem from "./ScheduleFlatItem";
|
|
import ScheduleFlatItem from "./ScheduleFlatItem";
|
|
import CusVideo from "./CusVideo";
|
|
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"
|
|
|
|
-});
|
|
|
|
|
|
+import ScheduleUrl from '../services/schedule'
|
|
|
|
+
|
|
|
|
|
|
-type Props = {};
|
|
|
|
export default class SchedulePage extends BasePage {
|
|
export default class SchedulePage extends BasePage {
|
|
constructor(props) {
|
|
constructor(props) {
|
|
super(props);
|
|
super(props);
|
|
@@ -58,7 +53,16 @@ export default class SchedulePage extends BasePage {
|
|
seat_height: "2%",
|
|
seat_height: "2%",
|
|
flatlist_height: "60%",
|
|
flatlist_height: "60%",
|
|
isFull: false,
|
|
isFull: false,
|
|
- playing_key: 0
|
|
|
|
|
|
+ playing_key: 0,
|
|
|
|
+ scheduleTitle: '',
|
|
|
|
+ wareList: [],
|
|
|
|
+ colorList: [
|
|
|
|
+ '#FFBC3D',
|
|
|
|
+ '#FB5B76',
|
|
|
|
+ '#EC48E1',
|
|
|
|
+ '#39D6B9',
|
|
|
|
+ '#3397F0'
|
|
|
|
+ ]
|
|
};
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
@@ -93,7 +97,7 @@ export default class SchedulePage extends BasePage {
|
|
>
|
|
>
|
|
<CourseTitle
|
|
<CourseTitle
|
|
width={this.getWindowWidth()}
|
|
width={this.getWindowWidth()}
|
|
- title="第12周 爱上幼儿园"
|
|
|
|
|
|
+ title={this.state.scheduleTitle}
|
|
lefttype={1}
|
|
lefttype={1}
|
|
righttype={1}
|
|
righttype={1}
|
|
textcolor={"#231F20"}
|
|
textcolor={"#231F20"}
|
|
@@ -153,81 +157,9 @@ export default class SchedulePage extends BasePage {
|
|
renderItem={({ item }) => {
|
|
renderItem={({ item }) => {
|
|
return this.loadFlatItem(item);
|
|
return this.loadFlatItem(item);
|
|
}}
|
|
}}
|
|
- keyExtractor={(item, index) => item.key.toString()}
|
|
|
|
|
|
+ keyExtractor={(item, index) => item.id.toString()}
|
|
horizontal={false}
|
|
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:
|
|
|
|
- "https://www.apple.com/105/media/cn/iphone-x/2017/01df5b43-28e4-4848-bf20-490c34a926a7/films/feature/iphone-x-feature-cn-20170912_1280x720h.mp4"
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- key: 15,
|
|
|
|
- typecolor: "#3397F0",
|
|
|
|
- typename: "欢乐音乐",
|
|
|
|
- videoname: "小鸡捉虫子",
|
|
|
|
- videourl: "http://chimee.org/vod/1.mp4"
|
|
|
|
- }
|
|
|
|
- ]}
|
|
|
|
|
|
+ data={this.state.wareList}
|
|
/>
|
|
/>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
@@ -269,6 +201,32 @@ export default class SchedulePage extends BasePage {
|
|
componentWillUnmount() {
|
|
componentWillUnmount() {
|
|
BackHandler.removeEventListener("hardwareBackPress", this.onBackAndroid);
|
|
BackHandler.removeEventListener("hardwareBackPress", this.onBackAndroid);
|
|
}
|
|
}
|
|
|
|
+ componentDidMount() {
|
|
|
|
+ let colorTemp = '';
|
|
|
|
+ let colorIndexTemp = 0;
|
|
|
|
+ const colorList = this.state.colorList;
|
|
|
|
+ ScheduleUrl.getSchedule('KINDERGARTEN').success(res => {
|
|
|
|
+ res.data.wareList.forEach((item, index) => {
|
|
|
|
+ if (index === 0) {
|
|
|
|
+ colorTemp = item.subTitle;
|
|
|
|
+ }
|
|
|
|
+ if (item.subTitle === colorTemp) {
|
|
|
|
+ item.subColor = colorList[colorIndexTemp];
|
|
|
|
+ } else {
|
|
|
|
+ colorIndexTemp++;
|
|
|
|
+ if (colorIndexTemp > colorList.length - 1) {
|
|
|
|
+ colorIndexTemp = 0
|
|
|
|
+ }
|
|
|
|
+ colorTemp = item.subTitle;
|
|
|
|
+ item.subColor = colorList[colorIndexTemp];
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.setState({
|
|
|
|
+ scheduleTitle: res.data.category.title,
|
|
|
|
+ wareList: res.data.wareList
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }
|
|
showSharedDialog() {
|
|
showSharedDialog() {
|
|
this.video.pause();
|
|
this.video.pause();
|
|
this.shareddialog.setModalVisible(true);
|
|
this.shareddialog.setModalVisible(true);
|
|
@@ -336,7 +294,7 @@ export default class SchedulePage extends BasePage {
|
|
videoImage_x: pageX,
|
|
videoImage_x: pageX,
|
|
videoImage_y: pageY,
|
|
videoImage_y: pageY,
|
|
video_show: true,
|
|
video_show: true,
|
|
- video_uri: data.videourl,
|
|
|
|
|
|
+ video_uri: data.playUrl,
|
|
playing_key: data.key
|
|
playing_key: data.key
|
|
});
|
|
});
|
|
});
|
|
});
|