index.vue 35 KB

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