MainPage.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805
  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. DeviceEventEmitter
  22. } from 'react-native';
  23. import BasePage from '../BasePage';
  24. import Header from './Header';
  25. import MySwiper from './Swiper';
  26. import Dimensions from '../utils/dimensions';
  27. import TopicTitle from './TopicTitle';
  28. import ScrollRow from './ScrollRow';
  29. import LibraryUrl from '../services/library';
  30. import { ScrollView } from 'react-native-gesture-handler';
  31. import commonutil from '../utils/commonutil';
  32. import http_user from '../services/user';
  33. import Toast from '../components/Toast';
  34. export default class MainPage extends BasePage {
  35. constructor(props) {
  36. super(props);
  37. state: {
  38. file_user_data: new Map();
  39. }
  40. }
  41. updateRender(index) {
  42. // LibraryUrl.getIndex(index).success(res => {
  43. // }).fail(() => {
  44. // alert(1111)
  45. // })
  46. // 触发更新
  47. LibraryUrl.getIndex(index).then((res) => {
  48. console.log(res);
  49. const monthTopicTitle = res.data.monthTopic.zone.title;
  50. const monthTopicScroll = res.data.monthTopic.zoneCourseVOList;
  51. const schedule = res.data.schedule;
  52. const hotCourse = res.data.hotCourse;
  53. const recommend = res.data.recommend; //全部课程
  54. const banner = res.data.banner; //轮播图
  55. const pageCode = res.data.pageCode;
  56. // const listData = [];
  57. // for(let item in res.data){
  58. // console.log(item)
  59. // listData.push(1)
  60. // }
  61. // console.log(typeof listData)
  62. // console.log(listData)
  63. // console.log(listData.length)
  64. let scheduleWeek = schedule[0].featureMap ? schedule[0].featureMap.weekSeq : '1';
  65. this.setState({
  66. // listData: listData.length? listData : [],
  67. hotCourse,
  68. monthTopicTitle,
  69. monthTopicScroll,
  70. schedule,
  71. recommend,
  72. banner,
  73. scheduleWeek,
  74. pageCode
  75. });
  76. console.log(this.state.banner);
  77. });
  78. }
  79. componentWillUnmount() {
  80. this.refreshSubScription.remove();
  81. }
  82. state = {
  83. grade: '大学',
  84. ifGradeMenuShow: false,
  85. fadeAnim: new Animated.Value(0),
  86. schedule: [],
  87. recommend: [],
  88. listData: [],
  89. banner: [],
  90. currentSwitch: { title: '小学', param: 'PRIMARY_SCHOOL' },
  91. switchList: [
  92. // { title: '幼儿园', param: 'KINDERGARTEN' },
  93. { title: '学前', param: 'PRESCHOOL' },
  94. { title: '小学', param: 'PRIMARY_SCHOOL' },
  95. { title: '中学', param: 'MIDDLE_SCHOOL' }
  96. ],
  97. scheduleWeek: '1',
  98. username: '游客',
  99. avatar: '',
  100. isVip: false,
  101. showLoading: true
  102. };
  103. renderBtn = (item, index) => {
  104. return (
  105. // this.state.currentSwitch.param === item.param
  106. // ?
  107. // null
  108. // :
  109. // <TouchableOpacity onPress={() => this.switchGrade(index)} key={index} style={index === 1 ? styles.gradeItemMid : styles.gradeItem}>
  110. // <Text style={styles.gradeText}>{item.title}</Text>
  111. // </TouchableOpacity>
  112. <TouchableOpacity
  113. onPress={() => this.switchGrade(index)}
  114. key={index}
  115. style={index === 1 ? styles.gradeItemMid : styles.gradeItem}
  116. >
  117. <Text style={styles.gradeText}>{item.title}</Text>
  118. </TouchableOpacity>
  119. );
  120. };
  121. componentWillMount() {
  122. this.refreshSubScription = DeviceEventEmitter.addListener('indexInfo', () => {
  123. this.getUserInfo();
  124. });
  125. DeviceEventEmitter.emit('indexInfo');
  126. }
  127. componentDidMount() {
  128. // this.updateRender('PRIMARY_SCHOOL');
  129. }
  130. switchGrade = (index) => {
  131. const obj = this.state.switchList[index];
  132. this.setState({
  133. currentSwitch: obj
  134. });
  135. this.hideGradeMenu();
  136. // if (obj.param === this.state.currentSwitch.param) return
  137. if (!this.state.file_user_data.get('isVisitor')) {
  138. //这里更新个人信息学龄选项
  139. var bool = this.updateUserInfo(obj.param);
  140. }
  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. await global.storage
  469. .load({
  470. key: 'userInfo'
  471. })
  472. .then((result) => {
  473. this.state.file_user_data = commonutil.jsonToMap(result);
  474. var ageGroup = this.state.file_user_data.get('ageGroup');
  475. const username = this.state.file_user_data.get('nickName');
  476. const avatar = this.state.file_user_data.get('avatar');
  477. this.setState({
  478. username,
  479. avatar
  480. });
  481. var ageindex = 0;
  482. if (ageGroup === 'PRESCHOOL') {
  483. ageindex = 0;
  484. } else if (ageGroup === 'PRIMARY_SCHOOL') {
  485. ageindex = 1;
  486. } else if (ageGroup === 'MIDDLE_SCHOOL') {
  487. ageindex = 2;
  488. }
  489. this.switchGrade(ageindex);
  490. })
  491. .catch((err) => {
  492. console.log('ERROR' + err.message);
  493. });
  494. }
  495. async updateUserInfo(group) {
  496. let opts = {
  497. method: 'PUT', //请求方法
  498. body: { ageGroup: group } //请求体
  499. };
  500. await http_user.update_UserInfo(opts).then((res) => {
  501. this.state.file_user_data.set('ageGroup', res.data.ageGroup);
  502. this.state.file_user_data.set('avatar', res.data.avatar);
  503. this.state.file_user_data.set('birthday', res.data.birthday);
  504. this.state.file_user_data.set('channel', res.data.channel);
  505. this.state.file_user_data.set('city', res.data.city);
  506. this.state.file_user_data.set('country', res.data.country);
  507. this.state.file_user_data.set('eid', res.data.eid);
  508. this.state.file_user_data.set('gmtCreated', res.data.gmtCreated);
  509. this.state.file_user_data.set('gmtModified', res.data.gmtModified);
  510. this.state.file_user_data.set('mobile', res.data.mobile);
  511. this.state.file_user_data.set('nickName', res.data.nickName);
  512. this.state.file_user_data.set('province', res.data.province);
  513. this.state.file_user_data.set('school', res.data.school);
  514. this.state.file_user_data.set('sex', res.data.sex);
  515. this.state.file_user_data.set('status', res.data.status);
  516. this.state.file_user_data.set('uid', res.data.uid);
  517. this.saveUserInfo(commonutil.mapToJson(this.state.file_user_data));
  518. return true;
  519. });
  520. }
  521. // 搜索
  522. search() {
  523. this.toNextPage('SearchResult');
  524. }
  525. }
  526. const styles = StyleSheet.create({
  527. title_text: {
  528. justifyContent: 'center',
  529. alignItems: 'center',
  530. color: 'red',
  531. fontSize: 30,
  532. textAlign: 'center',
  533. marginTop: 30,
  534. marginBottom: 50
  535. },
  536. /* 搜索区域 */
  537. searchSection: {
  538. flex: 1,
  539. width: Dimensions.width,
  540. height: Dimensions.getHeight(60),
  541. flexDirection: 'row',
  542. alignItems: 'center',
  543. backgroundColor: '#f0f1f5',
  544. justifyContent: 'space-around',
  545. position: 'relative'
  546. },
  547. searchBox: {
  548. position: 'relative',
  549. width: Dimensions.getWidth(232),
  550. height: Dimensions.getHeight(40),
  551. backgroundColor: '#fff',
  552. borderRadius: 20
  553. },
  554. search: {
  555. width: 30,
  556. height: 30
  557. },
  558. rightBtn: {
  559. width: Dimensions.getWidth(113),
  560. height: Dimensions.getHeight(40),
  561. backgroundColor: '#fff',
  562. borderRadius: 20,
  563. alignItems: 'center',
  564. justifyContent: 'center',
  565. justifyContent: 'space-around',
  566. flexDirection: 'row',
  567. paddingLeft: 20,
  568. paddingRight: 10
  569. },
  570. rightBtnIcon: {
  571. width: Dimensions.getWidth(23),
  572. height: Dimensions.getHeight(23)
  573. },
  574. rightBtnText: {
  575. color: '#151515',
  576. fontSize: 18
  577. },
  578. callUpGrade: {
  579. width: 113,
  580. height: 120,
  581. borderRadius: 20,
  582. position: 'absolute',
  583. right: 9,
  584. top: 125,
  585. zIndex: 999,
  586. elevation: 999,
  587. backgroundColor: '#fff',
  588. flexDirection: 'column'
  589. },
  590. gradeItem: {
  591. zIndex: 999,
  592. flex: 1,
  593. alignItems: 'center',
  594. justifyContent: 'center'
  595. },
  596. gradeItemMid: {
  597. zIndex: 999,
  598. flex: 1,
  599. alignItems: 'center',
  600. justifyContent: 'center',
  601. borderTopWidth: 1,
  602. borderBottomWidth: 1,
  603. borderColor: '#f0f1f5'
  604. },
  605. gradeText: {
  606. color: '#151515',
  607. fontSize: 18
  608. }
  609. });
  610. const sectionData = [
  611. {
  612. title: 'swiper',
  613. data: [
  614. {
  615. //轮播
  616. key: 111,
  617. typea: 1,
  618. text: '第一种类型'
  619. },
  620. {
  621. //只有一个标题下面两个图片
  622. key: 222,
  623. typea: 2,
  624. item: {
  625. item_type: 1,
  626. title: '课程表:第一周',
  627. icon_item: [
  628. {
  629. icon:
  630. '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',
  631. name: '第一张图片文字'
  632. },
  633. {
  634. icon:
  635. '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',
  636. name: '第二张图片文字'
  637. }
  638. ]
  639. }
  640. }
  641. ]
  642. },
  643. {
  644. title: 'operation',
  645. data: [
  646. {
  647. //一个标题,大长图
  648. key: 444,
  649. typea: 3,
  650. title: '五月主题:五一启程,去看看不同世界',
  651. text: '每天30分钟,玩学两不误',
  652. icon_item: [
  653. {
  654. icon:
  655. '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',
  656. name: '第一张图片文字'
  657. },
  658. {
  659. icon:
  660. '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',
  661. name: '第二张图片文字'
  662. },
  663. {
  664. icon:
  665. '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',
  666. name: '第三张图片文字'
  667. },
  668. {
  669. icon:
  670. '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',
  671. name: '第四张图片文字'
  672. },
  673. {
  674. icon:
  675. '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',
  676. name: '第五张图片文字'
  677. }
  678. ]
  679. },
  680. {
  681. key: 555,
  682. typea: 4,
  683. title: '热门课程',
  684. text: 'text',
  685. mask: false,
  686. icon_item: [
  687. {
  688. icon:
  689. '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',
  690. name: '第一张图片文字'
  691. },
  692. {
  693. icon:
  694. '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',
  695. name: '第二张图片文字'
  696. },
  697. {
  698. icon:
  699. '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',
  700. name: '第三张图片文字'
  701. },
  702. {
  703. icon:
  704. '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',
  705. name: '第四张图片文字'
  706. },
  707. {
  708. icon:
  709. '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',
  710. name: '第五张图片文字'
  711. }
  712. ]
  713. }
  714. ]
  715. },
  716. {
  717. title: 'courses',
  718. data: [
  719. {
  720. //一个标题,大长图
  721. key: 444,
  722. typea: 5,
  723. title: '五月主题:五一启程,去看看不同世界',
  724. text: '每天30分钟,玩学两不误',
  725. icon_item: [
  726. {
  727. icon:
  728. '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',
  729. name: '第一张图片文字'
  730. },
  731. {
  732. icon:
  733. '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',
  734. name: '第二张图片文字'
  735. },
  736. {
  737. icon:
  738. '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',
  739. name: '第三张图片文字'
  740. },
  741. {
  742. icon:
  743. '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',
  744. name: '第四张图片文字'
  745. },
  746. {
  747. icon:
  748. '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',
  749. name: '第五张图片文字'
  750. }
  751. ]
  752. },
  753. {
  754. key: 555,
  755. typea: 5,
  756. title: '热门课程',
  757. text: 'text',
  758. mask: false,
  759. icon_item: [
  760. {
  761. icon:
  762. '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',
  763. name: '第一张图片文字'
  764. },
  765. {
  766. icon:
  767. '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',
  768. name: '第二张图片文字'
  769. },
  770. {
  771. icon:
  772. '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',
  773. name: '第三张图片文字'
  774. },
  775. {
  776. icon:
  777. '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',
  778. name: '第四张图片文字'
  779. },
  780. {
  781. icon:
  782. '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',
  783. name: '第五张图片文字'
  784. }
  785. ]
  786. }
  787. ]
  788. }
  789. ];