index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050
  1. <template>
  2. <div class="pb_content">
  3. <div class="pb_content_body">
  4. <div class="student_head">
  5. <!-- <img src="../assets/banner.png" alt="" /> -->
  6. <el-carousel trigger="click" style="width: 100%; height: 100%">
  7. <el-carousel-item v-for="item in bannerList" :key="item.id">
  8. <!-- <h3 class="small">{{ item }}</h3> -->
  9. <img class="imgS" :src="item.poster" alt="" />
  10. </el-carousel-item>
  11. </el-carousel>
  12. </div>
  13. <div class="reBox">
  14. <div class="reTop">
  15. <div>课程</div>
  16. <div>
  17. <div class="search" @click="selectAll">
  18. <img src="../assets/icon/search.png" alt="" />
  19. </div>
  20. <input class="sInput" type="text" placeholder="请输入关键字" v-model="sCourse" />
  21. </div>
  22. </div>
  23. <div class="choose">
  24. <div class="all_choose" v-for="(item, index) in CourseType[0]" :key="index"
  25. :style="{ margin: !CourseTypeJson[item.id].length && 0 }">
  26. <span v-if="CourseTypeJson[item.id].length">{{ item.name }}:</span>
  27. <div class="typeCss" v-if="CourseTypeJson[item.id].length">
  28. <div class="cName" @click="getCourse(item.name, '', item.id, 1)"
  29. :class="typeE.indexOf(item.id) != -1 ? 'isCType' : ''">
  30. 全部
  31. </div>
  32. <div v-for="(item1, index1) in CourseTypeJson[item.id]" :key="index + '-' + index1" :label="item1.id"
  33. @click="getCourse(item.name, item.id, item1.id, 2)">
  34. <div class="cName" :class="
  35. typea == item1.id || typeb == item1.id || typed == item1.id
  36. ? 'isCType'
  37. : ''
  38. ">
  39. {{ item1.name }}
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. <div class="body_student" v-loading="loading">
  47. <div class="typeCheck">
  48. <el-switch v-model="typeCheck"></el-switch><span>分类显示</span>
  49. </div>
  50. <div>
  51. <div class="main_box">
  52. <div style="display:flex;flex-wrap:wrap" v-if="!typeCheck">
  53. <div class="box_course" v-for="(item, index) in zoneClass" :key="index">
  54. <div class="wheel">
  55. <img :src="
  56. item.cover
  57. ? JSON.parse(item.cover)[0].url
  58. : require('../assets/wheel.png')
  59. " alt="" />
  60. </div>
  61. <div class="middle_white">
  62. <div class="textOverflow">{{ item.title }}</div>
  63. <div class="nameAndLength">
  64. <el-tooltip class="typeN" effect="light" :content="item.typename" placement="top">
  65. <div>{{ item.typename }}</div>
  66. </el-tooltip>
  67. <div>{{ JSON.parse(item.chapters).length }}阶段</div>
  68. </div>
  69. <div class="school_box">
  70. <el-tooltip effect="light" :content="item.school" placement="top">
  71. <div class="school">
  72. {{ item.school }}
  73. </div>
  74. </el-tooltip>
  75. <div style="color: #b4b4b4">{{ item.utime }}</div>
  76. </div>
  77. </div>
  78. <div class="now_study" @click="
  79. goTo(
  80. '/courseDetail?courseId=' +
  81. item.courseId +
  82. '&userid=' +
  83. userid +
  84. '&oid=' +
  85. oid +
  86. '&org=' +
  87. org +
  88. '&cid=' +
  89. classId +
  90. '&tType=' +
  91. tType +
  92. '&screenType=' +
  93. screenType
  94. )
  95. ">
  96. 立即学习
  97. </div>
  98. </div>
  99. </div>
  100. <div v-else>
  101. <div class="FirstTypeBox" v-for="(type, tindex) in CourseType2" :key="tindex">
  102. <div class="title">{{ type.name }}</div>
  103. <div style="display: flex;flex-flow: wrap;margin-top: 20px;">
  104. <div class="box_course" v-for="(item, index) in type.course" :key="tindex + '-' + index">
  105. <div class="wheel">
  106. <img :src="
  107. item.cover
  108. ? JSON.parse(item.cover)[0].url
  109. : require('../assets/wheel.png')
  110. " alt="" />
  111. </div>
  112. <div class="middle_white">
  113. <div class="textOverflow">{{ item.title }}</div>
  114. <div class="nameAndLength">
  115. <el-tooltip class="typeN" effect="light" :content="item.typename" placement="top">
  116. <div>{{ item.typename }}</div>
  117. </el-tooltip>
  118. <div>{{ JSON.parse(item.chapters).length }}阶段</div>
  119. </div>
  120. <div class="school_box">
  121. <el-tooltip effect="light" :content="item.school" placement="top">
  122. <div class="school">
  123. {{ item.school }}
  124. </div>
  125. </el-tooltip>
  126. <div style="color: #b4b4b4">{{ item.utime }}</div>
  127. </div>
  128. </div>
  129. <div class="now_study" @click="
  130. goTo(
  131. '/courseDetail?courseId=' +
  132. item.courseId +
  133. '&userid=' +
  134. userid +
  135. '&oid=' +
  136. oid +
  137. '&org=' +
  138. org +
  139. '&cid=' +
  140. classId +
  141. '&tType=' +
  142. tType +
  143. '&screenType=' +
  144. screenType
  145. )
  146. ">
  147. 立即学习
  148. </div>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. <div class="course_empty" v-if="zoneClass.length == 0">
  154. 暂无课程
  155. </div>
  156. </div>
  157. </div>
  158. <div class="student_page" style="margin: 15px 0 0" v-if="zoneClass.length > 0 && !typeCheck">
  159. <el-pagination background layout="prev, pager, next" :page-size="10" :total="total" v-if="page"
  160. @current-change="handleCurrentChange">
  161. </el-pagination>
  162. </div>
  163. </div>
  164. </div>
  165. </div>
  166. </template>
  167. <script>
  168. export default {
  169. data() {
  170. return {
  171. zoneList: [],
  172. zoneClass: [],
  173. page: 1,
  174. total: 0,
  175. isListAjax: false,
  176. zoneListId: "",
  177. bannerList: [],
  178. userid: this.$route.query.userid,
  179. oid: this.$route.query.oid,
  180. classId: this.$route.query.cid,
  181. tType: this.$route.query.tType,
  182. org: this.$route.query.org,
  183. screenType: this.$route.query.screenType,
  184. CourseType: [],
  185. CourseType2: [],
  186. CourseTypeJson: {},
  187. courseTypeId: {},
  188. sCourse: "",
  189. isCType: "",
  190. typea: "",
  191. typeb: "",
  192. typed: "",
  193. typeE: [],
  194. loading: "",
  195. typeCheck: false
  196. };
  197. },
  198. watch: {
  199. typeCheck(newValue, oldValue) {
  200. this.loading = true
  201. if (newValue) {
  202. this.selectAll()
  203. } else {
  204. this.page = 1
  205. this.selectAll2()
  206. }
  207. }
  208. },
  209. methods: {
  210. goTo(path) {
  211. this.$router.push(path);
  212. },
  213. //获取专区下的课程
  214. getZoneClass(zid) {
  215. this.isListAjax = true;
  216. // const loading = this.openLoading(document.querySelector(".main_box"));
  217. let params = {
  218. bid: zid,
  219. oid: this.oid,
  220. page: this.page,
  221. };
  222. this.ajax
  223. .get(this.$store.state.api + "getZoneClassStudent", params)
  224. .then((res) => {
  225. // loading.close();
  226. this.isListAjax = false;
  227. this.zoneClass = res.data[0];
  228. this.total = res.data[0].length ? res.data[0][0].num : 0;
  229. })
  230. .catch((err) => {
  231. console.error(err);
  232. });
  233. },
  234. getCourse(typeName, ftypeId, typeid, type) {
  235. this.page = 1;
  236. this.zoneClass = [];
  237. if (typeName == "年级") {
  238. if (type == 1) {
  239. if (this.typeE.indexOf(typeid) != -1) {
  240. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  241. } else {
  242. this.typeE.push(typeid);
  243. if (this.typea != "") {
  244. this.typea = "";
  245. }
  246. }
  247. } else {
  248. if (this.typea == typeid) {
  249. this.typea = "";
  250. } else {
  251. this.typea = typeid;
  252. if (this.typeE.indexOf(ftypeId) != -1) {
  253. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  254. }
  255. }
  256. }
  257. } else if (typeName == "专栏") {
  258. if (type == 1) {
  259. if (this.typeE.indexOf(typeid) != -1) {
  260. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  261. } else {
  262. this.typeE.push(typeid);
  263. if (this.typeb != "") {
  264. this.typeb = "";
  265. }
  266. }
  267. } else {
  268. if (this.typeb == typeid) {
  269. this.typeb = "";
  270. } else {
  271. this.typeb = typeid;
  272. if (this.typeE.indexOf(ftypeId) != -1) {
  273. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  274. }
  275. }
  276. }
  277. } else if (typeName == "栏目") {
  278. if (type == 1) {
  279. if (this.typeE.indexOf(typeid) != -1) {
  280. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  281. } else {
  282. this.typeE.push(typeid);
  283. if (this.typeb != "") {
  284. this.typeb = "";
  285. }
  286. }
  287. } else {
  288. if (this.typeb == typeid) {
  289. this.typeb = "";
  290. } else {
  291. this.typeb = typeid;
  292. if (this.typeE.indexOf(ftypeId) != -1) {
  293. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  294. }
  295. }
  296. }
  297. } else if (typeName == "主题") {
  298. if (type == 1) {
  299. if (this.typeE.indexOf(typeid) != -1) {
  300. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  301. } else {
  302. this.typeE.push(typeid);
  303. if (this.typeb != "") {
  304. this.typeb = "";
  305. }
  306. }
  307. } else {
  308. if (this.typeb == typeid) {
  309. this.typeb = "";
  310. } else {
  311. this.typeb = typeid;
  312. if (this.typeE.indexOf(ftypeId) != -1) {
  313. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  314. }
  315. }
  316. }
  317. } else if (typeName == "学院") {
  318. if (type == 1) {
  319. if (this.typeE.indexOf(typeid) != -1) {
  320. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  321. } else {
  322. this.typeE.push(typeid);
  323. if (this.typeb != "") {
  324. this.typeb = "";
  325. }
  326. }
  327. } else {
  328. if (this.typeb == typeid) {
  329. this.typeb = "";
  330. } else {
  331. this.typeb = typeid;
  332. if (this.typeE.indexOf(ftypeId) != -1) {
  333. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  334. }
  335. }
  336. }
  337. } else if (typeName == "学科") {
  338. if (type == 1) {
  339. if (this.typeE.indexOf(typeid) != -1) {
  340. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  341. } else {
  342. this.typeE.push(typeid);
  343. if (this.typed != "") {
  344. this.typed = "";
  345. }
  346. }
  347. } else {
  348. if (this.typed == typeid) {
  349. this.typed = "";
  350. } else {
  351. this.typed = typeid;
  352. if (this.typeE.indexOf(ftypeId) != -1) {
  353. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  354. }
  355. }
  356. }
  357. }
  358. this.loading = true;
  359. if (this.typeCheck) {
  360. this.selectAll();
  361. } else {
  362. this.selectAll2();
  363. }
  364. },
  365. selectAll() {
  366. this.zoneListId = 0;
  367. this.isListAjax = true;
  368. let params = {
  369. uid: this.userid,
  370. oid: this.oid,
  371. typea: this.typea != undefined ? this.typea : "",
  372. typeb: this.typeb != undefined ? this.typeb : "",
  373. typec: "",
  374. typed: this.typed != undefined ? this.typed : "",
  375. typeE: this.typeE.join(","),
  376. // typeE: "",
  377. cu: "",
  378. cn: this.sCourse,
  379. classid: this.classId,
  380. org: this.org,
  381. page: this.page,
  382. };
  383. this.ajax
  384. .get(this.$store.state.api + "selectTypeCourse2Mode", params)
  385. .then((res) => {
  386. this.loading = false;
  387. this.isListAjax = false;
  388. this.zoneClass = res.data[0];
  389. // this.total = res.data[0].length ? res.data[0][0].num : 0;
  390. let CourseType2 = JSON.parse(JSON.stringify(this.CourseType[0]))
  391. for (var i = 0; i < CourseType2.length; i++) {
  392. CourseType2[i].course = []
  393. for (var j = 0; j < res.data[0].length; j++) {
  394. if (res.data[0][j].pid && res.data[0][j].pid.indexOf(CourseType2[i].id) != -1) {
  395. CourseType2[i].course.push(res.data[0][j])
  396. }
  397. }
  398. }
  399. let noTypeCourse = []
  400. for (var j = 0; j < res.data[0].length; j++) {
  401. if (!res.data[0][j].pid) {
  402. noTypeCourse.push(res.data[0][j])
  403. }
  404. }
  405. if (noTypeCourse.length > 0) {
  406. CourseType2.push({
  407. course: noTypeCourse,
  408. name: '其他'
  409. })
  410. }
  411. CourseType2 = CourseType2.filter(item => {
  412. return item.course.length > 0;
  413. })
  414. this.CourseType2 = CourseType2
  415. // this.selectType({
  416. // data: [res.data[1], res.data[2], res.data[3], res.data[4]],
  417. // });
  418. this.getBanner({
  419. data: [res.data[6], res.data[5], res.data[7]],
  420. });
  421. })
  422. .catch((err) => {
  423. console.error(err);
  424. });
  425. },
  426. selectAll2() {
  427. this.zoneListId = 0;
  428. this.isListAjax = true;
  429. let params = {
  430. uid: this.userid,
  431. oid: this.oid,
  432. typea: this.typea != undefined ? this.typea : "",
  433. typeb: this.typeb != undefined ? this.typeb : "",
  434. typec: "",
  435. typed: this.typed != undefined ? this.typed : "",
  436. typeE: this.typeE.join(","),
  437. // typeE: "",
  438. cu: "",
  439. cn: this.sCourse,
  440. classid: this.classId,
  441. org: this.org,
  442. page: this.page,
  443. };
  444. this.ajax
  445. .get(this.$store.state.api + "selectTypeCourse2", params)
  446. .then((res) => {
  447. this.loading = false;
  448. this.isListAjax = false;
  449. this.zoneClass = res.data[0];
  450. this.total = res.data[0].length ? res.data[0][0].num : 0;
  451. let CourseType2 = []
  452. // this.selectType({
  453. // data: [res.data[1], res.data[2], res.data[3], res.data[4]],
  454. // });
  455. this.getBanner({
  456. data: [res.data[6], res.data[5], res.data[7]],
  457. });
  458. })
  459. .catch((err) => {
  460. console.error(err);
  461. });
  462. },
  463. checkZone(id) {
  464. this.page = 1;
  465. this.zoneListId = id;
  466. this.getZoneClass(id);
  467. },
  468. // handleCurrentChange(val) {
  469. // this.page = val;
  470. // this.getZoneClass(this.zoneListId);
  471. // },
  472. handleCurrentChange(val) {
  473. this.loading = true;
  474. this.page = val;
  475. this.selectAll2();
  476. },
  477. //获取banner
  478. getBanner(res) {
  479. // var a = false;
  480. // if (this.org == "eb2af5e9-ac3d-46b6-9fe3-3c1c364f018d") {
  481. // a = true;
  482. // }
  483. // let params = {
  484. // oid: this.org,
  485. // };
  486. // this.ajax
  487. // .get(this.$store.state.api + "selectBannerByOid", params)
  488. // .then((res) => {
  489. if (res.data[0].length > 0) {
  490. this.bannerList = res.data[0];
  491. } else {
  492. this.getBannerByOid({
  493. data: [res.data[1], res.data[2]],
  494. });
  495. }
  496. // })
  497. // .catch((err) => {
  498. // console.error(err);
  499. // });
  500. },
  501. getBannerByOid(res) {
  502. // let params = {
  503. // oid: this.oid,
  504. // };
  505. // this.ajax
  506. // .get(this.$store.state.api + "selectBannerByOid", params)
  507. // .then((res) => {
  508. if (res.data[0].length > 0) {
  509. this.bannerList = res.data[0];
  510. } else {
  511. this.getOldBanner({
  512. data: [res.data[1]],
  513. });
  514. }
  515. // })
  516. // .catch((err) => {
  517. // console.error(err);
  518. // });
  519. },
  520. getOldBanner(res) {
  521. // this.ajax
  522. // .get(this.$store.state.api + "getBanner", "")
  523. // .then((res) => {
  524. this.bannerList = res.data[0];
  525. // })
  526. // .catch((err) => {
  527. // console.error(err);
  528. // });
  529. },
  530. selectAllType() {
  531. let params = {
  532. org: this.org && this.org != "" ? this.org : "",
  533. oid: this.oid && this.oid != "" ? this.oid : "",
  534. };
  535. this.ajax
  536. .get(this.$store.state.api + "selectAllType", params)
  537. .then((res) => {
  538. this.CourseTypeJson = {};
  539. this.CourseType = res.data;
  540. for (var i = 0; i < res.data[0].length; i++) {
  541. if (!this.cid) {
  542. this.courseTypeId[res.data[0][i].id] = "";
  543. }
  544. if (!this.CourseTypeJson[res.data[0][i].id]) {
  545. this.CourseTypeJson[res.data[0][i].id] = [];
  546. }
  547. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  548. if (res.data[0][i].name == "栏目") {
  549. this.CourseType[0][i].name = "主题";
  550. }
  551. }
  552. if (res.data[2].length == 0 && res.data[3].length == 0) {
  553. for (var j = 0; j < res.data[1].length; j++) {
  554. if (res.data[0][i].id == res.data[1][j].pid) {
  555. if (!this.CourseTypeJson[res.data[0][i].id]) {
  556. this.CourseTypeJson[res.data[0][i].id] = [];
  557. }
  558. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); // 去除公共分类
  559. }
  560. }
  561. } else {
  562. if (res.data[2].length > 0) {
  563. for (var j = 0; j < res.data[2].length; j++) {
  564. if (res.data[0][i].id == res.data[2][j].pid) {
  565. this.CourseTypeJson[res.data[0][i].id].push(res.data[2][j]); // 去除公共分类
  566. }
  567. }
  568. }
  569. if (res.data[3].length > 0) {
  570. for (var j = 0; j < res.data[3].length; j++) {
  571. if (res.data[0][i].id == res.data[3][j].pid) {
  572. this.CourseTypeJson[res.data[0][i].id].push(res.data[3][j]); // 去除公共分类
  573. }
  574. }
  575. }
  576. }
  577. }
  578. if (this.typeCheck) {
  579. this.selectAll();
  580. } else {
  581. this.selectAll2();
  582. }
  583. this.$forceUpdate();
  584. })
  585. .catch((err) => {
  586. console.error(err);
  587. });
  588. },
  589. selectType(res) {
  590. // this.ajax
  591. // .get(this.$store.state.api + "selectType")
  592. // .then((res) => {
  593. this.CourseTypeJson = {};
  594. this.CourseType = res.data;
  595. for (var i = 0; i < res.data[0].length; i++) {
  596. if (!this.cid) {
  597. this.courseTypeId[res.data[0][i].id] = "";
  598. }
  599. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  600. if (res.data[0][i].name == "栏目") {
  601. this.CourseType[0][i].name = "主题";
  602. }
  603. }
  604. for (var j = 0; j < res.data[1].length; j++) {
  605. if (res.data[0][i].id == res.data[1][j].pid) {
  606. if (!this.CourseTypeJson[res.data[0][i].id]) {
  607. this.CourseTypeJson[res.data[0][i].id] = [];
  608. }
  609. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); // 去除公共分类
  610. }
  611. }
  612. }
  613. this.selectTypeByOid({ data: [res.data[0], res.data[2]] });
  614. this.selectTypeByOrg({ data: [res.data[0], res.data[3]] });
  615. // })
  616. // .catch((err) => {
  617. // console.error(err);
  618. // });
  619. },
  620. selectTypeByOid(res) {
  621. // let params = {
  622. // oid: this.oid,
  623. // };
  624. // this.ajax
  625. // .get(this.$store.state.api + "selectTypeByOid", params)
  626. // .then((res) => {
  627. for (var i = 0; i < res.data[0].length; i++) {
  628. for (var j = 0; j < res.data[1].length; j++) {
  629. if (res.data[0][i].id == res.data[1][j].pid) {
  630. if (!this.CourseTypeJson[res.data[0][i].id]) {
  631. this.CourseTypeJson[res.data[0][i].id] = [];
  632. }
  633. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
  634. }
  635. }
  636. }
  637. this.$forceUpdate();
  638. // })
  639. // .catch((err) => {
  640. // console.error(err);
  641. // });
  642. },
  643. selectTypeByOrg(res) {
  644. // let params = {
  645. // oid: this.org,
  646. // };
  647. // this.ajax
  648. // .get(this.$store.state.api + "selectTypeByOrg", params)
  649. // .then((res) => {
  650. for (var i = 0; i < res.data[0].length; i++) {
  651. for (var j = 0; j < res.data[1].length; j++) {
  652. if (res.data[0][i].id == res.data[1][j].pid) {
  653. if (!this.CourseTypeJson[res.data[0][i].id]) {
  654. this.CourseTypeJson[res.data[0][i].id] = [];
  655. }
  656. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
  657. }
  658. }
  659. }
  660. this.$forceUpdate();
  661. // })
  662. // .catch((err) => {
  663. // console.error(err);
  664. // });
  665. },
  666. },
  667. beforeDestroy() {
  668. clearInterval(this.timer);
  669. this.timer = null;
  670. },
  671. created() {
  672. this.loading = true;
  673. // this.selectType();
  674. this.selectAllType();
  675. // this.getBanner();
  676. this.timer = setInterval(() => {
  677. this.selectAllType();
  678. // this.getBanner();
  679. }, 60000);
  680. document.scrollingElement.scrollTop = 0;
  681. },
  682. };
  683. </script>
  684. <style scoped>
  685. @media screen and (max-width: 1024px) {
  686. .box_course {
  687. margin: 0px 5px 20px 5px !important;
  688. }
  689. }
  690. .student_head .imgS {
  691. width: 100%;
  692. height: 100%;
  693. cursor: pointer;
  694. object-fit: cover;
  695. }
  696. .top {
  697. padding: 20px 30px 20px 1%;
  698. box-sizing: border-box;
  699. display: flex;
  700. align-items: center;
  701. }
  702. .top div {
  703. cursor: pointer;
  704. box-sizing: border-box;
  705. height: 35px;
  706. line-height: 35px;
  707. margin: 0 10px 0 0;
  708. padding-bottom: 5px;
  709. width: 80px;
  710. text-align: center;
  711. }
  712. .top .active {
  713. border-bottom: 3px solid #0e71e6;
  714. }
  715. .isactive {
  716. border-bottom: 3px solid #0e71e6;
  717. }
  718. .box_fk {
  719. width: 8px;
  720. height: 21px;
  721. background: #0e71e6;
  722. margin-right: 5px;
  723. }
  724. .wheel {
  725. width: 100%;
  726. height: 140px;
  727. }
  728. .man {
  729. width: 16px;
  730. height: 16px;
  731. }
  732. .wheel>img,
  733. .man>img {
  734. width: 100%;
  735. height: 100%;
  736. object-fit: cover;
  737. }
  738. .box_course {
  739. display: flex;
  740. flex-direction: column;
  741. flex-wrap: nowrap;
  742. /* margin: 0px 1% 20px; */
  743. margin: 0 15px 20px 0;
  744. width: 300px;
  745. height: 260px;
  746. /*border: 1px solid #cecece; */
  747. border-radius: 10px;
  748. overflow: hidden;
  749. box-shadow: 0px 1px 3px 0px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%),
  750. 0px 2px 1px -1px rgb(0 0 0 / 12%);
  751. justify-content: space-between;
  752. }
  753. .middle_white {
  754. font-size: 14px;
  755. margin: 5px 10px;
  756. }
  757. .people {
  758. display: flex;
  759. align-items: center;
  760. }
  761. .people>div:nth-child(2) {
  762. margin-left: 10px;
  763. }
  764. .now_study {
  765. width: 100%;
  766. height: 40px;
  767. color: #fff;
  768. background: #4a9eed;
  769. text-align: center;
  770. line-height: 40px;
  771. font-size: 13px;
  772. cursor: pointer;
  773. }
  774. .now_study:hover {
  775. background: #205cc6;
  776. }
  777. .main_box {
  778. width: 100%;
  779. /* display: flex; */
  780. /* flex-direction: row; */
  781. /* flex-wrap: wrap; */
  782. /* justify-content: flex-start; */
  783. margin: 0 auto;
  784. }
  785. .right_bottom_flex {
  786. width: 219px;
  787. height: 144px;
  788. margin: auto 0;
  789. }
  790. .right_bottom_flex>img {
  791. width: 100%;
  792. height: 100%;
  793. }
  794. .body_student {
  795. margin: 0 auto;
  796. width: 90%;
  797. height: 100%;
  798. }
  799. .student_head {
  800. width: 100%;
  801. /* height: 30%; */
  802. }
  803. .textOverflow {
  804. padding: 0 5px 0 0px;
  805. width: 95%;
  806. overflow: hidden;
  807. white-space: nowrap;
  808. text-overflow: ellipsis;
  809. font-weight: bold;
  810. font-size: 16px;
  811. }
  812. .student_page {
  813. margin-top: 10px;
  814. }
  815. .course_empty {
  816. width: 100%;
  817. height: 200px;
  818. display: flex;
  819. align-items: center;
  820. justify-content: center;
  821. }
  822. .choose {
  823. display: flex;
  824. flex-direction: column;
  825. flex-wrap: nowrap;
  826. height: 100%;
  827. justify-content: space-evenly;
  828. align-items: flex-start;
  829. padding: 10px 0;
  830. }
  831. .all_choose {
  832. display: flex;
  833. flex-direction: row;
  834. align-items: baseline;
  835. margin: 10px 0;
  836. width: 100%;
  837. }
  838. .all_choose>span {
  839. min-width: 80px;
  840. display: block;
  841. letter-spacing: 14px;
  842. }
  843. .all_choose>span:nth-child(1) {
  844. font-weight: bold;
  845. }
  846. .all_choose>>>.el-checkbox-group {
  847. display: flex;
  848. flex-direction: row;
  849. width: 820px;
  850. flex-wrap: wrap;
  851. align-content: center;
  852. justify-content: flex-start;
  853. align-items: center;
  854. margin-top: 3px;
  855. }
  856. .all_choose>.el-checkbox-group>>>.el-checkbox {
  857. margin-bottom: 10px;
  858. display: flex;
  859. flex-direction: row;
  860. align-items: center;
  861. }
  862. .all_choose>.el-checkbox-group>.el-checkbox>>>.el-checkbox__label {
  863. min-width: 80px;
  864. overflow: hidden;
  865. width: 80px;
  866. text-overflow: ellipsis;
  867. white-space: nowrap;
  868. }
  869. .all_choose>.el-checkbox-group>.el-checkbox>>>.el-checkbox__label:hover {
  870. width: auto;
  871. }
  872. .cName {
  873. cursor: pointer;
  874. margin: 0 10px 10px 0;
  875. color: #b9b6b9;
  876. min-width: 80px;
  877. width: 80px;
  878. white-space: nowrap;
  879. overflow: hidden;
  880. text-overflow: ellipsis;
  881. }
  882. .reBox {
  883. position: relative;
  884. top: -25px;
  885. z-index: 999;
  886. /* left: auto; */
  887. /* right: auto; */
  888. background: #fff;
  889. width: 90%;
  890. border-radius: 5px;
  891. padding-left: 20px;
  892. margin: 0 auto;
  893. box-sizing: border-box;
  894. }
  895. .reTop {
  896. padding: 20px 0 0 0;
  897. border-bottom: 1px solid #eee;
  898. width: 98%;
  899. display: flex;
  900. flex-direction: row;
  901. flex-wrap: nowrap;
  902. align-items: center;
  903. justify-content: space-between;
  904. }
  905. .reTop>div:nth-child(1) {
  906. font-weight: bold;
  907. width: 40px;
  908. border-bottom: 1px solid #205cc6;
  909. padding-bottom: 20px;
  910. color: #205cc6;
  911. font-size: 20px;
  912. }
  913. .reTop>div:nth-child(2) {
  914. display: flex;
  915. flex-direction: row;
  916. align-items: center;
  917. border: 1px solid #ccced3;
  918. width: 300px;
  919. border-radius: 8px;
  920. padding: 5px 0;
  921. margin-bottom: 10px;
  922. }
  923. .search {
  924. width: 20px;
  925. padding: 0 5px;
  926. }
  927. .search>img {
  928. width: 100%;
  929. height: 100%;
  930. }
  931. .sInput {
  932. border: none;
  933. width: 85%;
  934. }
  935. .sInput:focus-visible {
  936. outline: none;
  937. }
  938. .nameAndLength {
  939. display: flex;
  940. flex-direction: row;
  941. flex-wrap: nowrap;
  942. align-items: center;
  943. justify-content: space-between;
  944. margin: 5px 0;
  945. }
  946. .typeN {
  947. width: 200px;
  948. white-space: nowrap;
  949. overflow: hidden;
  950. text-overflow: ellipsis;
  951. }
  952. .isCType {
  953. color: #6282c2;
  954. }
  955. .typeCss {
  956. display: flex;
  957. flex-direction: row;
  958. flex-wrap: wrap;
  959. justify-content: flex-start;
  960. align-items: center;
  961. }
  962. .school {
  963. white-space: nowrap;
  964. overflow: hidden;
  965. text-overflow: ellipsis;
  966. max-width: 50%;
  967. box-sizing: border-box;
  968. }
  969. .school_box {
  970. display: flex;
  971. align-items: center;
  972. justify-content: space-between;
  973. }
  974. .FirstTypeBox {}
  975. .FirstTypeBox+.FirstTypeBox {
  976. margin-top: 20px;
  977. }
  978. .FirstTypeBox>.title {
  979. font-size: 24px;
  980. font-weight: 700;
  981. }
  982. .typeCheck {
  983. display: flex;
  984. align-items: center;
  985. justify-content: flex-end;
  986. /* margin-bottom: 20px; */
  987. }
  988. .typeCheck>span {
  989. margin-left: 10px;
  990. }
  991. </style>