index.vue 29 KB

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