MainPage.js 22 KB

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