index.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251
  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.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. this.loading = true;
  859. // this.selectType();
  860. this.selectAllType();
  861. // this.getBanner();
  862. this.timer = setInterval(() => {
  863. this.selectAllType();
  864. // this.getBanner();
  865. }, 60000);
  866. document.scrollingElement.scrollTop = 0;
  867. },
  868. };
  869. </script>
  870. <style scoped>
  871. @media screen and (max-width: 1024px) {
  872. .box_course {
  873. margin: 0px 5px 20px 5px !important;
  874. }
  875. }
  876. .student_head .imgS {
  877. width: 100%;
  878. height: 100%;
  879. cursor: pointer;
  880. object-fit: cover;
  881. }
  882. .top {
  883. padding: 20px 30px 20px 1%;
  884. box-sizing: border-box;
  885. display: flex;
  886. align-items: center;
  887. }
  888. .top div {
  889. cursor: pointer;
  890. box-sizing: border-box;
  891. height: 35px;
  892. line-height: 35px;
  893. margin: 0 10px 0 0;
  894. padding-bottom: 5px;
  895. width: 80px;
  896. text-align: center;
  897. }
  898. .top .active {
  899. border-bottom: 3px solid #0e71e6;
  900. }
  901. .isactive {
  902. border-bottom: 3px solid #0e71e6;
  903. }
  904. .box_fk {
  905. width: 8px;
  906. height: 21px;
  907. background: #0e71e6;
  908. margin-right: 5px;
  909. }
  910. .wheel {
  911. width: 100%;
  912. height: 140px;
  913. }
  914. .man {
  915. width: 16px;
  916. height: 16px;
  917. }
  918. .wheel>img,
  919. .man>img {
  920. width: 100%;
  921. height: 100%;
  922. object-fit: cover;
  923. }
  924. .box_course {
  925. display: flex;
  926. flex-direction: column;
  927. flex-wrap: nowrap;
  928. /* margin: 0px 1% 20px; */
  929. margin: 0 15px 20px 0;
  930. width: 300px;
  931. /* height: 260px; */
  932. /*border: 1px solid #cecece; */
  933. border-radius: 10px;
  934. overflow: hidden;
  935. box-shadow: 0px 1px 3px 0px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%),
  936. 0px 2px 1px -1px rgb(0 0 0 / 12%);
  937. justify-content: space-between;
  938. cursor: pointer;
  939. }
  940. .middle_white {
  941. font-size: 14px;
  942. margin: 5px 10px 10px;
  943. }
  944. .people {
  945. display: flex;
  946. align-items: center;
  947. }
  948. .people>div:nth-child(2) {
  949. margin-left: 10px;
  950. }
  951. .now_study {
  952. width: 100%;
  953. height: 40px;
  954. color: #fff;
  955. background: #4a9eed;
  956. text-align: center;
  957. line-height: 40px;
  958. font-size: 13px;
  959. cursor: pointer;
  960. display: none;
  961. }
  962. .now_study:hover {
  963. background: #205cc6;
  964. }
  965. .main_box {
  966. width: 100%;
  967. /* display: flex; */
  968. /* flex-direction: row; */
  969. /* flex-wrap: wrap; */
  970. /* justify-content: flex-start; */
  971. margin: 0 auto;
  972. }
  973. .right_bottom_flex {
  974. width: 219px;
  975. height: 144px;
  976. margin: auto 0;
  977. }
  978. .right_bottom_flex>img {
  979. width: 100%;
  980. height: 100%;
  981. }
  982. .body_student {
  983. margin: 0 auto;
  984. width: 90%;
  985. height: 100%;
  986. }
  987. .student_head {
  988. width: 100%;
  989. /* height: 30%; */
  990. }
  991. .textOverflow {
  992. padding: 0 5px 0 0px;
  993. width: 95%;
  994. overflow: hidden;
  995. white-space: nowrap;
  996. text-overflow: ellipsis;
  997. font-weight: bold;
  998. font-size: 16px;
  999. }
  1000. .student_page {
  1001. margin-top: 10px;
  1002. }
  1003. .course_empty {
  1004. width: 100%;
  1005. height: 200px;
  1006. display: flex;
  1007. align-items: center;
  1008. justify-content: center;
  1009. }
  1010. .choose {
  1011. display: flex;
  1012. flex-direction: column;
  1013. flex-wrap: nowrap;
  1014. height: 100%;
  1015. justify-content: space-evenly;
  1016. align-items: flex-start;
  1017. padding: 10px 0;
  1018. }
  1019. .all_choose {
  1020. display: flex;
  1021. flex-direction: row;
  1022. align-items: baseline;
  1023. /* margin: 2px 0; */
  1024. width: 100%;
  1025. }
  1026. .all_choose>span {
  1027. min-width: 80px;
  1028. display: block;
  1029. letter-spacing: 14px;
  1030. }
  1031. .all_choose>span:nth-child(1) {
  1032. font-weight: bold;
  1033. }
  1034. .all_choose>>>.el-checkbox-group {
  1035. display: flex;
  1036. flex-direction: row;
  1037. width: 820px;
  1038. flex-wrap: wrap;
  1039. align-content: center;
  1040. justify-content: flex-start;
  1041. align-items: center;
  1042. margin-top: 3px;
  1043. }
  1044. .all_choose>.el-checkbox-group>>>.el-checkbox {
  1045. margin-bottom: 10px;
  1046. display: flex;
  1047. flex-direction: row;
  1048. align-items: center;
  1049. }
  1050. .all_choose>.el-checkbox-group>.el-checkbox>>>.el-checkbox__label {
  1051. min-width: 80px;
  1052. overflow: hidden;
  1053. width: 80px;
  1054. text-overflow: ellipsis;
  1055. white-space: nowrap;
  1056. }
  1057. .all_choose>.el-checkbox-group>.el-checkbox>>>.el-checkbox__label:hover {
  1058. width: auto;
  1059. }
  1060. .cName {
  1061. cursor: pointer;
  1062. margin: 0 10px 10px 0;
  1063. color: #b9b6b9;
  1064. min-width: 80px;
  1065. width: 80px;
  1066. white-space: nowrap;
  1067. overflow: hidden;
  1068. text-overflow: ellipsis;
  1069. }
  1070. .reBox {
  1071. position: relative;
  1072. top: -25px;
  1073. z-index: 999;
  1074. /* left: auto; */
  1075. /* right: auto; */
  1076. background: #fff;
  1077. width: 90%;
  1078. border-radius: 5px;
  1079. padding-left: 20px;
  1080. margin: 0 auto;
  1081. box-sizing: border-box;
  1082. }
  1083. .reTop {
  1084. padding: 20px 0 0 0;
  1085. border-bottom: 1px solid #eee;
  1086. width: 98%;
  1087. display: flex;
  1088. flex-direction: row;
  1089. flex-wrap: nowrap;
  1090. align-items: center;
  1091. justify-content: space-between;
  1092. }
  1093. .reTop>div:nth-child(1) {
  1094. font-weight: bold;
  1095. width: 40px;
  1096. border-bottom: 1px solid #205cc6;
  1097. padding-bottom: 20px;
  1098. color: #205cc6;
  1099. font-size: 20px;
  1100. }
  1101. .reTop>div:nth-child(2) {
  1102. display: flex;
  1103. flex-direction: row;
  1104. align-items: center;
  1105. border: 1px solid #ccced3;
  1106. width: 300px;
  1107. border-radius: 8px;
  1108. padding: 5px 0;
  1109. margin-bottom: 10px;
  1110. }
  1111. .search {
  1112. width: 20px;
  1113. padding: 0 5px;
  1114. }
  1115. .search>img {
  1116. width: 100%;
  1117. height: 100%;
  1118. }
  1119. .sInput {
  1120. border: none;
  1121. width: 85%;
  1122. }
  1123. .sInput:focus-visible {
  1124. outline: none;
  1125. }
  1126. .nameAndLength {
  1127. display: flex;
  1128. flex-direction: row;
  1129. flex-wrap: nowrap;
  1130. align-items: center;
  1131. justify-content: space-between;
  1132. margin: 5px 0;
  1133. }
  1134. .typeN {
  1135. width: 200px;
  1136. white-space: nowrap;
  1137. overflow: hidden;
  1138. text-overflow: ellipsis;
  1139. }
  1140. .isCType {
  1141. color: #6282c2;
  1142. }
  1143. .typeCss {
  1144. display: flex;
  1145. flex-direction: row;
  1146. flex-wrap: wrap;
  1147. justify-content: flex-start;
  1148. align-items: center;
  1149. }
  1150. .school {
  1151. white-space: nowrap;
  1152. overflow: hidden;
  1153. text-overflow: ellipsis;
  1154. max-width: 50%;
  1155. box-sizing: border-box;
  1156. }
  1157. .school_box {
  1158. display: flex;
  1159. align-items: center;
  1160. justify-content: space-between;
  1161. }
  1162. .FirstTypeBox {}
  1163. .FirstTypeBox+.FirstTypeBox {
  1164. margin-top: 20px;
  1165. }
  1166. .FirstTypeBox>.title {
  1167. font-size: 24px;
  1168. font-weight: 700;
  1169. }
  1170. .typeCheck {
  1171. display: flex;
  1172. align-items: center;
  1173. justify-content: flex-end;
  1174. margin-bottom: 10px;
  1175. }
  1176. .typeCheck>span {
  1177. margin-left: 10px;
  1178. }
  1179. .pType_box {
  1180. margin-top: 10px;
  1181. }
  1182. .pType_box >>> .el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner {
  1183. -webkit-box-shadow: none !important;
  1184. box-shadow: none !important;
  1185. }
  1186. </style>