index.vue 36 KB

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