MainPage.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784
  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. Platform,
  11. StyleSheet,
  12. Text,
  13. View,
  14. Image,
  15. FlatList,
  16. TouchableOpacity,
  17. ImageBackground,
  18. TextInput,
  19. Animated,
  20. StatusBar
  21. } from 'react-native';
  22. import BasePage from '../BasePage';
  23. import Header from './Header';
  24. import MySwiper from './Swiper';
  25. import Dimensions from '../utils/dimensions';
  26. import TopicTitle from './TopicTitle';
  27. import ScrollRow from './ScrollRow';
  28. import LibraryUrl from '../services/library';
  29. import { ScrollView } from 'react-native-gesture-handler';
  30. import commonutil from '../utils/commonutil';
  31. import http_user from '../services/user';
  32. export default class MainPage extends BasePage {
  33. constructor(props) {
  34. super(props);
  35. state: {
  36. file_user_data: new Map();
  37. }
  38. }
  39. updateRender(index) {
  40. // LibraryUrl.getIndex(index).success(res => {
  41. // }).fail(() => {
  42. // alert(1111)
  43. // })
  44. LibraryUrl.getIndex(index).then((res) => {
  45. console.log(res);
  46. const monthTopicTitle = res.data.monthTopic.zone.title;
  47. const monthTopicScroll = res.data.monthTopic.zoneCourseVOList;
  48. const schedule = res.data.schedule;
  49. const hotCourse = res.data.hotCourse;
  50. const recommend = res.data.recommend; //全部课程
  51. const banner = res.data.banner; //轮播图
  52. // const listData = [];
  53. // for(let item in res.data){
  54. // console.log(item)
  55. // listData.push(1)
  56. // }
  57. // console.log(typeof listData)
  58. // console.log(listData)
  59. // console.log(listData.length)
  60. let scheduleWeek = schedule[0].featureMap ? schedule[0].featureMap.weekSeq : '1';
  61. this.setState({
  62. // listData: listData.length? listData : [],
  63. hotCourse,
  64. monthTopicTitle,
  65. monthTopicScroll,
  66. schedule,
  67. recommend,
  68. banner,
  69. scheduleWeek
  70. });
  71. console.log(this.state.banner);
  72. });
  73. }
  74. state = {
  75. grade: '大学',
  76. text: '小伙子',
  77. ifGradeMenuShow: false,
  78. fadeAnim: new Animated.Value(0),
  79. schedule: [],
  80. recommend: [],
  81. listData: [],
  82. banner: [],
  83. currentSwitch: { title: '小学', param: 'PRIMARY_SCHOOL' },
  84. switchList: [
  85. // { title: '幼儿园', param: 'KINDERGARTEN' },
  86. { title: '学前', param: 'PRESCHOOL' },
  87. { title: '小学', param: 'PRIMARY_SCHOOL' },
  88. { title: '中学', param: 'MIDDLE_SCHOOL' }
  89. ],
  90. scheduleWeek: '1',
  91. username: '游客',
  92. avatar: '',
  93. isVip: false
  94. };
  95. renderBtn = (item, index) => {
  96. return (
  97. // this.state.currentSwitch.param === item.param
  98. // ?
  99. // null
  100. // :
  101. // <TouchableOpacity onPress={() => this.switchGrade(index)} key={index} style={index === 1 ? styles.gradeItemMid : styles.gradeItem}>
  102. // <Text style={styles.gradeText}>{item.title}</Text>
  103. // </TouchableOpacity>
  104. <TouchableOpacity
  105. onPress={() => this.switchGrade(index)}
  106. key={index}
  107. style={index === 1 ? styles.gradeItemMid : styles.gradeItem}
  108. >
  109. <Text style={styles.gradeText}>{item.title}</Text>
  110. </TouchableOpacity>
  111. );
  112. };
  113. componentWillMount() {
  114. this.getUserInfo();
  115. }
  116. componentDidMount() {
  117. // this.updateRender('PRIMARY_SCHOOL');
  118. }
  119. switchGrade = (index) => {
  120. console.log('====================================');
  121. console.log('switchGrade:' + index);
  122. console.log('====================================');
  123. const obj = this.state.switchList[index];
  124. this.setState({
  125. currentSwitch: obj
  126. });
  127. this.hideGradeMenu();
  128. // if (obj.param === this.state.currentSwitch.param) return
  129. //这里更新个人信息学龄选项
  130. var bool = this.updateUserInfo(obj.param);
  131. this.updateRender(obj.param);
  132. };
  133. render() {
  134. // const abc =Object.keys(this.state.data).map((k)=>this.state.data[k])
  135. return (
  136. <View style={{ flex: 1 }} onPress={this.hideGradeMenu}>
  137. {/* <SectionList sectionList组件 性能好 但是针对当前布局是否有要用的必要,以后可能迭代
  138. sections={this.state.listData}
  139. renderItem={({ item }) => {
  140. return this.loadFlatItem(item);
  141. }}
  142. keyExtractor={(item, index) => item.key.toString()}
  143. ListHeaderComponent={() => this.headerorfooterComponent()}
  144. renderSectionHeader={this.sectionTitle}
  145. onScroll={this.hideGradeMenu}
  146. /> */}
  147. <StatusBar barStyle={'dark-content'} backgroundColor={'white'} translucent={false} />
  148. <ScrollView
  149. style={{ height: Dimensions.height }}
  150. showsVerticalScrollIndicator={false}
  151. onScroll={this.hideGradeMenu}
  152. >
  153. {this.headerorfooterComponent()}
  154. {this.getSwiperElement()}
  155. {this.getScheduleElement()}
  156. {this.getMonthTopic()}
  157. {this.getHotCourse()}
  158. {this.getAllCourses()}
  159. </ScrollView>
  160. {this.state.ifGradeMenuShow ? (
  161. <Animated.View
  162. style={{
  163. ...styles.callUpGrade,
  164. opacity: this.state.fadeAnim
  165. }}
  166. >
  167. {this.state.switchList.map((item, index) => this.renderBtn(item, index))}
  168. </Animated.View>
  169. ) : null}
  170. </View>
  171. );
  172. }
  173. // 头部组件
  174. headerorfooterComponent() {
  175. return (
  176. <View>
  177. <Header
  178. uri={this.state.avatar}
  179. width={400}
  180. height={150}
  181. username= {this.state.username}
  182. isVip={this.state.isVip}
  183. onPress={() => this.toNextPage('userCenter')}
  184. />
  185. {/* 搜索区域 */}
  186. <View style={styles.searchSection}>
  187. <TextInput
  188. style={styles.searchBox}
  189. onChangeText={(text) => this.setState({ text })}
  190. value={this.state.text}
  191. />
  192. <TouchableOpacity onPress={this.tabCallOutHandler}>
  193. <View style={styles.rightBtn}>
  194. <Image source={require('../images/common/switch.png')} style={styles.rightBtnIcon} />
  195. <Text style={styles.rightBtnText}>{this.state.currentSwitch.title}</Text>
  196. </View>
  197. </TouchableOpacity>
  198. </View>
  199. </View>
  200. );
  201. }
  202. // 渲染轮播图
  203. getSwiperElement() {
  204. return (
  205. <View
  206. style={{
  207. height: Dimensions.getHeight(163),
  208. flex: 1,
  209. justifyContent: 'center',
  210. alignItems: 'center',
  211. flexDirection: 'row'
  212. }}
  213. >
  214. <View
  215. style={{
  216. width: Dimensions.getWidth(358),
  217. height: Dimensions.getHeight(153),
  218. justifyContent: 'center',
  219. overflow: 'hidden'
  220. }}
  221. >
  222. <MySwiper autoplay={true} loop={true} ifShowMiddle={true} data={this.state.banner} />
  223. </View>
  224. </View>
  225. );
  226. }
  227. // 渲染课程表
  228. getScheduleElement() {
  229. let renderScheduleItem = (item, index) => {
  230. const id = item.boothId;
  231. return (
  232. <TouchableOpacity
  233. style={{
  234. width: Dimensions.getWidth(172),
  235. height: Dimensions.getHeight(86),
  236. marginRight: 12
  237. }}
  238. onPress={() => this.toNextPage('SchedulePage', { id })}
  239. key={index}
  240. activeOpacity={1}
  241. >
  242. <ImageBackground
  243. source={{
  244. uri: item.boothContent
  245. }}
  246. key={index}
  247. style={{
  248. flex: 1,
  249. // justifyContent: "center",
  250. // alignItems: "center",
  251. borderRadius: 10
  252. }}
  253. >
  254. {item.operationContent === 'KINDERGARTE' ? null : (
  255. <View
  256. style={{
  257. width: Dimensions.getWidth(90),
  258. height: Dimensions.getHeight(45),
  259. marginLeft: Dimensions.getWidth(15),
  260. marginTop: Dimensions.getHeight(15),
  261. justifyContent: 'center',
  262. alignItems: 'center'
  263. }}
  264. >
  265. <Text
  266. style={{
  267. color: '#fff',
  268. fontSize: 18
  269. }}
  270. >
  271. {item.title}
  272. </Text>
  273. <Text
  274. style={{
  275. color: '#fff',
  276. fontSize: 18
  277. }}
  278. >
  279. {item.summary}
  280. </Text>
  281. </View>
  282. )}
  283. </ImageBackground>
  284. </TouchableOpacity>
  285. );
  286. };
  287. return (
  288. <View
  289. style={{
  290. flex: 1,
  291. flexDirection: 'column',
  292. height: Dimensions.getHeight(160)
  293. }}
  294. >
  295. <TopicTitle title={`课程表:第${this.state.scheduleWeek}周`} ifTubeShow={true} />
  296. {/* <View
  297. style={{
  298. flex: 2,
  299. flexDirection: "row",
  300. alignItems: 'center',
  301. paddingLeft: 10
  302. }}
  303. >
  304. {this.state.schedule.map((item, index) => renderScheduleItem(item, index))}
  305. </View> */}
  306. <FlatList
  307. data={this.state.schedule}
  308. horizontal={true}
  309. style={{ paddingLeft: '3.2%' }}
  310. renderItem={({ item, index }) => renderScheduleItem(item, index)}
  311. keyExtractor={(item, index) => index.toString()}
  312. showsHorizontalScrollIndicator={false}
  313. />
  314. </View>
  315. );
  316. }
  317. // 渲染月主题
  318. getMonthTopic() {
  319. return (
  320. <View
  321. style={{
  322. flex: 1,
  323. height: 225
  324. }}
  325. >
  326. <TopicTitle title={this.state.monthTopicTitle} summary={'每天30分钟'} ifTubeShow={true} />
  327. <ScrollRow
  328. itemWidth={352}
  329. itemHeight={153}
  330. nav={this.props.navigation.navigate}
  331. data={this.state.monthTopicScroll}
  332. />
  333. </View>
  334. );
  335. }
  336. // 渲染热门课程
  337. getHotCourse() {
  338. return (
  339. <View
  340. style={{
  341. flex: 1,
  342. height: 220
  343. }}
  344. >
  345. <TopicTitle title={'热门课程'} ifTubeShow={true} />
  346. <ScrollRow
  347. itemWidth={106}
  348. itemHeight={150}
  349. nav={this.props.navigation.navigate}
  350. data={this.state.hotCourse}
  351. />
  352. </View>
  353. );
  354. }
  355. // 渲染全部课程
  356. getAllCourses() {
  357. return (
  358. <View>
  359. {this.state.recommend.map((item, index) => {
  360. return (
  361. <View
  362. style={{
  363. flex: 1,
  364. height: 240
  365. }}
  366. key={index}
  367. >
  368. {index === 0 ? null : (
  369. <View style={{ width: Dimensions.width, height: 4, backgroundColor: '#f0f1f5' }} />
  370. )}
  371. <TopicTitle title={item.zone.title} />
  372. <ScrollRow
  373. itemWidth={106}
  374. itemHeight={150}
  375. nav={this.props.navigation.navigate}
  376. data={item.zoneCourseVOList}
  377. />
  378. </View>
  379. );
  380. })}
  381. </View>
  382. );
  383. }
  384. // 渲染每一个块儿 sectionList组件的data,没有用到,以后可能会用
  385. loadFlatItem(data) {
  386. switch (data.title) {
  387. // 轮播图
  388. case 'banner':
  389. return this.getSwiperElement();
  390. break;
  391. // 课程表
  392. case 'schedule':
  393. return this.getScheduleElement();
  394. break;
  395. // 大图主题
  396. case 'monthTopic':
  397. return this.getMonthTopic();
  398. break;
  399. // 热门课程
  400. case 'hotCourse':
  401. return this.getHotCourse();
  402. break;
  403. case 'recommend':
  404. return this.getAllCourses();
  405. break;
  406. default:
  407. break;
  408. }
  409. }
  410. // 渲染每一个section的title sectionList组件的data,没有用到,以后可能会用
  411. sectionTitle = (info) => {
  412. switch (info.section.title) {
  413. case 'operation':
  414. return (
  415. <View
  416. style={{
  417. width: Dimensions.width,
  418. height: 10,
  419. backgroundColor: '#f0f1f5'
  420. }}
  421. />
  422. );
  423. break;
  424. case 'courses':
  425. return <TopicTitle title={'全部课程'} tubeColor={'#7d9fff'} background={'#f0f1f5'} ifTubeShow={true} />;
  426. break;
  427. default:
  428. break;
  429. }
  430. };
  431. // 点击呼出学龄菜单
  432. tabCallOutHandler = () => {
  433. this.setState(
  434. {
  435. ifGradeMenuShow: !this.state.ifGradeMenuShow
  436. },
  437. () => {
  438. Animated.timing(this.state.fadeAnim, {
  439. toValue: this.state.ifGradeMenuShow ? 1 : 0,
  440. duration: 300
  441. }).start();
  442. }
  443. );
  444. };
  445. // 如果切换学龄在显示状态,那么在它失去焦点时将它隐藏
  446. hideGradeMenu = () => {
  447. if (this.state.ifGradeMenuShow) {
  448. this.setState({
  449. ifGradeMenuShow: false
  450. });
  451. }
  452. };
  453. async getUserInfo() {
  454. await global.storage
  455. .load({
  456. key: 'userInfo'
  457. })
  458. .then((result) => {
  459. this.state.file_user_data = commonutil.jsonToMap(result);
  460. console.log('=====MainPage获取本地用户信息============');
  461. console.log(commonutil.mapToJson(this.state.file_user_data));
  462. var ageGroup = this.state.file_user_data.get('ageGroup');
  463. const username = this.state.file_user_data.get('nickName');
  464. const avatar = this.state.file_user_data.get('avatar');
  465. this.setState({
  466. username,
  467. avatar
  468. })
  469. var ageindex = 0;
  470. if (ageGroup === 'PRESCHOOL') {
  471. ageindex = 0;
  472. } else if (ageGroup === 'PRIMARY_SCHOOL') {
  473. ageindex = 1;
  474. } else if (ageGroup === 'MIDDLE_SCHOOL') {
  475. ageindex = 2;
  476. }
  477. this.switchGrade(ageindex);
  478. })
  479. .catch((err) => {
  480. console.log('ERROR' + err.message);
  481. });
  482. }
  483. async updateUserInfo(group) {
  484. let opts = {
  485. method: 'PUT', //请求方法
  486. body: { ageGroup: group } //请求体
  487. };
  488. await http_user.update_UserInfo(opts).then((res) => {
  489. this.state.file_user_data.set('ageGroup', res.data.ageGroup);
  490. this.state.file_user_data.set('avatar', res.data.avatar);
  491. this.state.file_user_data.set('birthday', res.data.birthday);
  492. this.state.file_user_data.set('channel', res.data.channel);
  493. this.state.file_user_data.set('city', res.data.city);
  494. this.state.file_user_data.set('country', res.data.country);
  495. this.state.file_user_data.set('eid', res.data.eid);
  496. this.state.file_user_data.set('gmtCreated', res.data.gmtCreated);
  497. this.state.file_user_data.set('gmtModified', res.data.gmtModified);
  498. this.state.file_user_data.set('mobile', res.data.mobile);
  499. this.state.file_user_data.set('nickName', res.data.nickName);
  500. this.state.file_user_data.set('province', res.data.province);
  501. this.state.file_user_data.set('school', res.data.school);
  502. this.state.file_user_data.set('sex', res.data.sex);
  503. this.state.file_user_data.set('status', res.data.status);
  504. this.state.file_user_data.set('uid', res.data.uid);
  505. this.saveUserInfo(commonutil.mapToJson(this.state.file_user_data));
  506. return true;
  507. });
  508. }
  509. }
  510. const styles = StyleSheet.create({
  511. title_text: {
  512. justifyContent: 'center',
  513. alignItems: 'center',
  514. color: 'red',
  515. fontSize: 30,
  516. textAlign: 'center',
  517. marginTop: 30,
  518. marginBottom: 50
  519. },
  520. /* 搜索区域 */
  521. searchSection: {
  522. flex: 1,
  523. width: Dimensions.width,
  524. height: Dimensions.getHeight(60),
  525. flexDirection: 'row',
  526. alignItems: 'center',
  527. backgroundColor: '#f0f1f5',
  528. justifyContent: 'space-around',
  529. position: 'relative'
  530. },
  531. searchBox: {
  532. width: Dimensions.getWidth(232),
  533. height: Dimensions.getHeight(40),
  534. backgroundColor: '#fff',
  535. borderRadius: 20
  536. },
  537. rightBtn: {
  538. width: Dimensions.getWidth(113),
  539. height: Dimensions.getHeight(40),
  540. backgroundColor: '#fff',
  541. borderRadius: 20,
  542. alignItems: 'center',
  543. justifyContent: 'center',
  544. justifyContent: 'space-around',
  545. flexDirection: 'row',
  546. paddingLeft: 20,
  547. paddingRight: 10
  548. },
  549. rightBtnIcon: {
  550. width: Dimensions.getWidth(23),
  551. height: Dimensions.getHeight(23)
  552. },
  553. rightBtnText: {
  554. color: '#151515',
  555. fontSize: 18
  556. },
  557. callUpGrade: {
  558. width: 113,
  559. height: 120,
  560. borderRadius: 20,
  561. position: 'absolute',
  562. right: 9,
  563. top: 125,
  564. zIndex: 999,
  565. elevation: 999,
  566. backgroundColor: '#fff',
  567. flexDirection: 'column'
  568. },
  569. gradeItem: {
  570. zIndex: 999,
  571. flex: 1,
  572. alignItems: 'center',
  573. justifyContent: 'center'
  574. },
  575. gradeItemMid: {
  576. zIndex: 999,
  577. flex: 1,
  578. alignItems: 'center',
  579. justifyContent: 'center',
  580. borderTopWidth: 1,
  581. borderBottomWidth: 1,
  582. borderColor: '#f0f1f5'
  583. },
  584. gradeText: {
  585. color: '#151515',
  586. fontSize: 18
  587. }
  588. });
  589. const sectionData = [
  590. {
  591. title: 'swiper',
  592. data: [
  593. {
  594. //轮播
  595. key: 111,
  596. typea: 1,
  597. text: '第一种类型'
  598. },
  599. {
  600. //只有一个标题下面两个图片
  601. key: 222,
  602. typea: 2,
  603. item: {
  604. item_type: 1,
  605. title: '课程表:第一周',
  606. icon_item: [
  607. {
  608. icon:
  609. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  610. name: '第一张图片文字'
  611. },
  612. {
  613. icon:
  614. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  615. name: '第二张图片文字'
  616. }
  617. ]
  618. }
  619. }
  620. ]
  621. },
  622. {
  623. title: 'operation',
  624. data: [
  625. {
  626. //一个标题,大长图
  627. key: 444,
  628. typea: 3,
  629. title: '五月主题:五一启程,去看看不同世界',
  630. text: '每天30分钟,玩学两不误',
  631. icon_item: [
  632. {
  633. icon:
  634. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  635. name: '第一张图片文字'
  636. },
  637. {
  638. icon:
  639. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  640. name: '第二张图片文字'
  641. },
  642. {
  643. icon:
  644. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  645. name: '第三张图片文字'
  646. },
  647. {
  648. icon:
  649. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  650. name: '第四张图片文字'
  651. },
  652. {
  653. icon:
  654. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  655. name: '第五张图片文字'
  656. }
  657. ]
  658. },
  659. {
  660. key: 555,
  661. typea: 4,
  662. title: '热门课程',
  663. text: 'text',
  664. mask: false,
  665. icon_item: [
  666. {
  667. icon:
  668. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  669. name: '第一张图片文字'
  670. },
  671. {
  672. icon:
  673. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  674. name: '第二张图片文字'
  675. },
  676. {
  677. icon:
  678. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  679. name: '第三张图片文字'
  680. },
  681. {
  682. icon:
  683. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  684. name: '第四张图片文字'
  685. },
  686. {
  687. icon:
  688. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  689. name: '第五张图片文字'
  690. }
  691. ]
  692. }
  693. ]
  694. },
  695. {
  696. title: 'courses',
  697. data: [
  698. {
  699. //一个标题,大长图
  700. key: 444,
  701. typea: 5,
  702. title: '五月主题:五一启程,去看看不同世界',
  703. text: '每天30分钟,玩学两不误',
  704. icon_item: [
  705. {
  706. icon:
  707. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  708. name: '第一张图片文字'
  709. },
  710. {
  711. icon:
  712. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  713. name: '第二张图片文字'
  714. },
  715. {
  716. icon:
  717. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  718. name: '第三张图片文字'
  719. },
  720. {
  721. icon:
  722. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  723. name: '第四张图片文字'
  724. },
  725. {
  726. icon:
  727. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  728. name: '第五张图片文字'
  729. }
  730. ]
  731. },
  732. {
  733. key: 555,
  734. typea: 5,
  735. title: '热门课程',
  736. text: 'text',
  737. mask: false,
  738. icon_item: [
  739. {
  740. icon:
  741. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  742. name: '第一张图片文字'
  743. },
  744. {
  745. icon:
  746. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  747. name: '第二张图片文字'
  748. },
  749. {
  750. icon:
  751. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  752. name: '第三张图片文字'
  753. },
  754. {
  755. icon:
  756. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  757. name: '第四张图片文字'
  758. },
  759. {
  760. icon:
  761. 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1556277324856&di=dc1548a0c5ba10481af922e174912937&imgtype=0&src=http%3A%2F%2Fwww.51pptmoban.com%2Fd%2Ffile%2F2012%2F05%2F12%2F82c4568a90055adcf8fbb896f0841c69.jpg',
  762. name: '第五张图片文字'
  763. }
  764. ]
  765. }
  766. ]
  767. }
  768. ];