index.vue 37 KB

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