index.vue 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289
  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 (typeName == "主题") {
  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. stand: "cn"
  707. };
  708. this.ajax
  709. .get(this.$store.state.api + "selectAllTypeStand", params)
  710. .then((res) => {
  711. if(this.oid == "69893dca-1d47-11ed-8c78-005056b86db5"){
  712. res.data[0] = [...res.data[0],...res.data[4]]
  713. }
  714. this.CourseTypeJson = {};
  715. this.CourseType = res.data;
  716. this.CourseType3 = [
  717. { name: "智见课程", id: [] },
  718. { name: "智行课程", id: [] },
  719. { name: "智创课程", id: [] },
  720. ];
  721. for (var cti = 0; cti < res.data[0].length; cti++) {
  722. if (
  723. res.data[0][cti].id == "34628934-d02f-11ec-8c78-005056b86db5" ||
  724. res.data[0][cti].id == "34629907-d02f-11ec-8c78-005056b86db5"
  725. ) {
  726. this.CourseType3[0].id.push(res.data[0][cti].id);
  727. }else if(res.data[0][cti].id == "34628934-d02f-11ec-8c78-005056b86ac5" ||
  728. res.data[0][cti].id == "34629907-d02f-11ec-8c78-005056b86ac5"){
  729. this.CourseType3[1].id.push(res.data[0][cti].id);
  730. } else if (res.data[0][cti].id == "34629bcc-d02f-11ec-8c78-005056b86db5") {
  731. this.CourseType3[2].id.push(res.data[0][cti].id);
  732. }
  733. if(res.data[0][cti].id == "34628934-d02f-11ec-8c78-005056b86db5" || res.data[0][cti].id == "34628934-d02f-11ec-8c78-005056b86ac5"){
  734. res.data[0][cti].name = "年级";
  735. }else if(res.data[0][cti].id == "34629907-d02f-11ec-8c78-005056b86db5" || res.data[0][cti].id == "34629907-d02f-11ec-8c78-005056b86ac5"){
  736. res.data[0][cti].name = "学科";
  737. }else if(res.data[0][cti].id == "34629bcc-d02f-11ec-8c78-005056b86db5"){
  738. res.data[0][cti].name = "主题";
  739. }
  740. }
  741. for (var i = 0; i < res.data[0].length; i++) {
  742. if (!this.cid) {
  743. this.courseTypeId[res.data[0][i].id] = "";
  744. }
  745. if (!this.CourseTypeJson[res.data[0][i].id]) {
  746. this.CourseTypeJson[res.data[0][i].id] = [];
  747. }
  748. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  749. if (res.data[0][i].name == "栏目") {
  750. this.CourseType[0][i].name = "主题";
  751. }
  752. }
  753. if (res.data[2].length == 0 && res.data[3].length == 0) {
  754. for (var j = 0; j < res.data[1].length; j++) {
  755. if (res.data[0][i].id == res.data[1][j].pid) {
  756. if (!this.CourseTypeJson[res.data[0][i].id]) {
  757. this.CourseTypeJson[res.data[0][i].id] = [];
  758. }
  759. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); // 去除公共分类
  760. }
  761. }
  762. } else {
  763. if (res.data[2].length > 0) {
  764. for (var j = 0; j < res.data[2].length; j++) {
  765. if (res.data[0][i].id == res.data[2][j].pid) {
  766. this.CourseTypeJson[res.data[0][i].id].push(res.data[2][j]); // 去除公共分类
  767. }
  768. }
  769. }
  770. if (res.data[3].length > 0) {
  771. for (var j = 0; j < res.data[3].length; j++) {
  772. if (res.data[0][i].id == res.data[3][j].pid) {
  773. this.CourseTypeJson[res.data[0][i].id].push(res.data[3][j]); // 去除公共分类
  774. }
  775. }
  776. }
  777. }
  778. }
  779. if (this.typeCheck) {
  780. this.selectAll();
  781. } else {
  782. this.selectAll2();
  783. }
  784. this.$forceUpdate();
  785. })
  786. .catch((err) => {
  787. console.error(err);
  788. });
  789. },
  790. selectType(res) {
  791. // this.ajax
  792. // .get(this.$store.state.api + "selectType")
  793. // .then((res) => {
  794. this.CourseTypeJson = {};
  795. this.CourseType = res.data;
  796. for (var i = 0; i < res.data[0].length; i++) {
  797. if (!this.cid) {
  798. this.courseTypeId[res.data[0][i].id] = "";
  799. }
  800. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  801. if (res.data[0][i].name == "栏目") {
  802. this.CourseType[0][i].name = "主题";
  803. }
  804. }
  805. for (var j = 0; j < res.data[1].length; j++) {
  806. if (res.data[0][i].id == res.data[1][j].pid) {
  807. if (!this.CourseTypeJson[res.data[0][i].id]) {
  808. this.CourseTypeJson[res.data[0][i].id] = [];
  809. }
  810. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); // 去除公共分类
  811. }
  812. }
  813. }
  814. this.selectTypeByOid({ data: [res.data[0], res.data[2]] });
  815. this.selectTypeByOrg({ data: [res.data[0], res.data[3]] });
  816. // })
  817. // .catch((err) => {
  818. // console.error(err);
  819. // });
  820. },
  821. selectTypeByOid(res) {
  822. // let params = {
  823. // oid: this.oid,
  824. // };
  825. // this.ajax
  826. // .get(this.$store.state.api + "selectTypeByOid", params)
  827. // .then((res) => {
  828. for (var i = 0; i < res.data[0].length; i++) {
  829. for (var j = 0; j < res.data[1].length; j++) {
  830. if (res.data[0][i].id == res.data[1][j].pid) {
  831. if (!this.CourseTypeJson[res.data[0][i].id]) {
  832. this.CourseTypeJson[res.data[0][i].id] = [];
  833. }
  834. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
  835. }
  836. }
  837. }
  838. this.$forceUpdate();
  839. // })
  840. // .catch((err) => {
  841. // console.error(err);
  842. // });
  843. },
  844. selectTypeByOrg(res) {
  845. // let params = {
  846. // oid: this.org,
  847. // };
  848. // this.ajax
  849. // .get(this.$store.state.api + "selectTypeByOrg", params)
  850. // .then((res) => {
  851. for (var i = 0; i < res.data[0].length; i++) {
  852. for (var j = 0; j < res.data[1].length; j++) {
  853. if (res.data[0][i].id == res.data[1][j].pid) {
  854. if (!this.CourseTypeJson[res.data[0][i].id]) {
  855. this.CourseTypeJson[res.data[0][i].id] = [];
  856. }
  857. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
  858. }
  859. }
  860. }
  861. this.$forceUpdate();
  862. // })
  863. // .catch((err) => {
  864. // console.error(err);
  865. // });
  866. },
  867. },
  868. beforeDestroy() {
  869. clearInterval(this.timer);
  870. this.timer = null;
  871. },
  872. created() {
  873. let typea = this.$route.query.typea
  874. let typeb = this.$route.query.typeb
  875. let typed = this.$route.query.typed
  876. if(typea || typeb || typed){
  877. this.typea = typea ? typea : ''
  878. this.typeb = typeb ? typeb : ''
  879. this.typed = typed ? typed : ''
  880. }
  881. this.loading = true;
  882. // this.selectType();
  883. this.selectAllType();
  884. // this.getBanner();
  885. this.timer = setInterval(() => {
  886. this.selectAllType();
  887. // this.getBanner();
  888. }, 60000);
  889. document.scrollingElement.scrollTop = 0;
  890. },
  891. };
  892. </script>
  893. <style scoped>
  894. @media screen and (max-width: 1024px) {
  895. .box_course {
  896. margin: 0px 5px 20px 5px !important;
  897. }
  898. }
  899. .student_head .imgS {
  900. width: 100%;
  901. height: 100%;
  902. cursor: pointer;
  903. object-fit: cover;
  904. }
  905. .top {
  906. padding: 20px 30px 20px 1%;
  907. box-sizing: border-box;
  908. display: flex;
  909. align-items: center;
  910. }
  911. .top div {
  912. cursor: pointer;
  913. box-sizing: border-box;
  914. height: 35px;
  915. line-height: 35px;
  916. margin: 0 10px 0 0;
  917. padding-bottom: 5px;
  918. width: 80px;
  919. text-align: center;
  920. }
  921. .top .active {
  922. border-bottom: 3px solid #0e71e6;
  923. }
  924. .isactive {
  925. border-bottom: 3px solid #0e71e6;
  926. }
  927. .box_fk {
  928. width: 8px;
  929. height: 21px;
  930. background: #0e71e6;
  931. margin-right: 5px;
  932. }
  933. .wheel {
  934. width: 100%;
  935. height: 140px;
  936. }
  937. .man {
  938. width: 16px;
  939. height: 16px;
  940. }
  941. .wheel>img,
  942. .man>img {
  943. width: 100%;
  944. height: 100%;
  945. object-fit: cover;
  946. }
  947. .box_course {
  948. display: flex;
  949. flex-direction: column;
  950. flex-wrap: nowrap;
  951. /* margin: 0px 1% 20px; */
  952. margin: 0 15px 20px 0;
  953. width: 300px;
  954. /* height: 260px; */
  955. /*border: 1px solid #cecece; */
  956. border-radius: 10px;
  957. overflow: hidden;
  958. box-shadow: 0px 1px 3px 0px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%),
  959. 0px 2px 1px -1px rgb(0 0 0 / 12%);
  960. justify-content: space-between;
  961. cursor: pointer;
  962. }
  963. .middle_white {
  964. font-size: 14px;
  965. margin: 5px 10px 10px;
  966. }
  967. .people {
  968. display: flex;
  969. align-items: center;
  970. }
  971. .people>div:nth-child(2) {
  972. margin-left: 10px;
  973. }
  974. .now_study {
  975. width: 100%;
  976. height: 40px;
  977. color: #fff;
  978. background: #4a9eed;
  979. text-align: center;
  980. line-height: 40px;
  981. font-size: 13px;
  982. cursor: pointer;
  983. display: none;
  984. }
  985. .now_study:hover {
  986. background: #205cc6;
  987. }
  988. .main_box {
  989. width: 100%;
  990. /* display: flex; */
  991. /* flex-direction: row; */
  992. /* flex-wrap: wrap; */
  993. /* justify-content: flex-start; */
  994. margin: 0 auto;
  995. }
  996. .right_bottom_flex {
  997. width: 219px;
  998. height: 144px;
  999. margin: auto 0;
  1000. }
  1001. .right_bottom_flex>img {
  1002. width: 100%;
  1003. height: 100%;
  1004. }
  1005. .body_student {
  1006. margin: 0 auto;
  1007. width: 90%;
  1008. height: 100%;
  1009. }
  1010. .student_head {
  1011. width: 100%;
  1012. /* height: 30%; */
  1013. }
  1014. .textOverflow {
  1015. padding: 0 5px 0 0px;
  1016. width: 100%;
  1017. display: flex;
  1018. align-items: center;
  1019. justify-content: space-between;
  1020. font-size: 16px;
  1021. }
  1022. .textOverflow > .utitle{
  1023. max-width: calc(100% - 100px);
  1024. overflow: hidden;
  1025. white-space: nowrap;
  1026. text-overflow: ellipsis;
  1027. font-weight: bold;
  1028. display: block;
  1029. }
  1030. .textOverflow > .uname{
  1031. max-width: 90px;
  1032. overflow: hidden;
  1033. white-space: nowrap;
  1034. text-overflow: ellipsis;
  1035. display: block;
  1036. }
  1037. .student_page {
  1038. margin-top: 10px;
  1039. }
  1040. .course_empty {
  1041. width: 100%;
  1042. height: 200px;
  1043. display: flex;
  1044. align-items: center;
  1045. justify-content: center;
  1046. }
  1047. .choose {
  1048. display: flex;
  1049. flex-direction: column;
  1050. flex-wrap: nowrap;
  1051. height: 100%;
  1052. justify-content: space-evenly;
  1053. align-items: flex-start;
  1054. padding: 10px 0;
  1055. }
  1056. .all_choose {
  1057. display: flex;
  1058. flex-direction: row;
  1059. align-items: baseline;
  1060. /* margin: 2px 0; */
  1061. width: 100%;
  1062. }
  1063. .all_choose>span {
  1064. min-width: 85px;
  1065. display: block;
  1066. letter-spacing: 14px;
  1067. }
  1068. .all_choose>span:nth-child(1) {
  1069. font-weight: bold;
  1070. }
  1071. .all_choose>>>.el-checkbox-group {
  1072. display: flex;
  1073. flex-direction: row;
  1074. width: 820px;
  1075. flex-wrap: wrap;
  1076. align-content: center;
  1077. justify-content: flex-start;
  1078. align-items: center;
  1079. margin-top: 3px;
  1080. }
  1081. .all_choose>.el-checkbox-group>>>.el-checkbox {
  1082. margin-bottom: 10px;
  1083. display: flex;
  1084. flex-direction: row;
  1085. align-items: center;
  1086. }
  1087. .all_choose>.el-checkbox-group>.el-checkbox>>>.el-checkbox__label {
  1088. min-width: 80px;
  1089. overflow: hidden;
  1090. width: 80px;
  1091. text-overflow: ellipsis;
  1092. white-space: nowrap;
  1093. }
  1094. .all_choose>.el-checkbox-group>.el-checkbox>>>.el-checkbox__label:hover {
  1095. width: auto;
  1096. }
  1097. .cName {
  1098. cursor: pointer;
  1099. margin: 0 10px 10px 0;
  1100. color: #b9b6b9;
  1101. min-width: 80px;
  1102. width: 80px;
  1103. white-space: nowrap;
  1104. overflow: hidden;
  1105. text-overflow: ellipsis;
  1106. }
  1107. .reBox {
  1108. position: relative;
  1109. top: -25px;
  1110. z-index: 999;
  1111. /* left: auto; */
  1112. /* right: auto; */
  1113. background: #fff;
  1114. width: 90%;
  1115. border-radius: 5px;
  1116. padding-left: 20px;
  1117. margin: 0 auto;
  1118. box-sizing: border-box;
  1119. }
  1120. .reTop {
  1121. padding: 20px 0 0 0;
  1122. border-bottom: 1px solid #eee;
  1123. width: 98%;
  1124. display: flex;
  1125. flex-direction: row;
  1126. flex-wrap: nowrap;
  1127. align-items: center;
  1128. justify-content: space-between;
  1129. }
  1130. .reTop>div:nth-child(1) {
  1131. font-weight: bold;
  1132. width: 40px;
  1133. border-bottom: 1px solid #205cc6;
  1134. padding-bottom: 20px;
  1135. color: #205cc6;
  1136. font-size: 20px;
  1137. }
  1138. .reTop>div:nth-child(2) {
  1139. display: flex;
  1140. flex-direction: row;
  1141. align-items: center;
  1142. border: 1px solid #ccced3;
  1143. width: 300px;
  1144. border-radius: 8px;
  1145. padding: 5px 0;
  1146. margin-bottom: 10px;
  1147. }
  1148. .search {
  1149. width: 20px;
  1150. padding: 0 5px;
  1151. }
  1152. .search>img {
  1153. width: 100%;
  1154. height: 100%;
  1155. }
  1156. .sInput {
  1157. border: none;
  1158. width: 85%;
  1159. }
  1160. .sInput:focus-visible {
  1161. outline: none;
  1162. }
  1163. .nameAndLength {
  1164. display: flex;
  1165. flex-direction: row;
  1166. flex-wrap: nowrap;
  1167. align-items: center;
  1168. justify-content: space-between;
  1169. margin: 5px 0;
  1170. }
  1171. .typeN {
  1172. width: 200px;
  1173. white-space: nowrap;
  1174. overflow: hidden;
  1175. text-overflow: ellipsis;
  1176. }
  1177. .isCType {
  1178. color: #6282c2;
  1179. }
  1180. .typeCss {
  1181. display: flex;
  1182. flex-direction: row;
  1183. flex-wrap: wrap;
  1184. justify-content: flex-start;
  1185. align-items: center;
  1186. }
  1187. .school {
  1188. white-space: nowrap;
  1189. overflow: hidden;
  1190. text-overflow: ellipsis;
  1191. max-width: 50%;
  1192. box-sizing: border-box;
  1193. }
  1194. .school_box {
  1195. display: flex;
  1196. align-items: center;
  1197. justify-content: space-between;
  1198. }
  1199. .FirstTypeBox {}
  1200. .FirstTypeBox+.FirstTypeBox {
  1201. margin-top: 20px;
  1202. }
  1203. .FirstTypeBox>.title {
  1204. font-size: 24px;
  1205. font-weight: 700;
  1206. }
  1207. .typeCheck {
  1208. display: flex;
  1209. align-items: center;
  1210. justify-content: flex-end;
  1211. margin-bottom: 10px;
  1212. }
  1213. .typeCheck>span {
  1214. margin-left: 10px;
  1215. }
  1216. .pType_box {
  1217. margin-top: 10px;
  1218. }
  1219. .pType_box >>> .el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner {
  1220. -webkit-box-shadow: none !important;
  1221. box-shadow: none !important;
  1222. }
  1223. </style>