courseChapter.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829
  1. <template>
  2. <view>
  3. <view class="title" @click="openChapter(menuItem)">
  4. <view>
  5. <u-icon name="arrow-down" color="#999" size="24" v-if="!down"></u-icon>
  6. <u-icon name="arrow-right" color="#999" size="24" v-if="down"></u-icon>
  7. <text class="menu_name">{{ menuItem.name }}</text>
  8. </view>
  9. <view
  10. class="title_status"
  11. :class="['grey', 'blue', 'gre'][learnStatus + 1]"
  12. >
  13. {{ ["待学习", "学习中", "已学完"][learnStatus + 1] }}
  14. </view>
  15. </view>
  16. <view v-show="!down">
  17. <view v-for="(itemM, indexM) in list" :key="indexM">
  18. <view v-if="itemM.type != 2">
  19. <courseSection
  20. ref="ChapterSection"
  21. :isLive="isLive"
  22. :orderGoodsId="orderGoodsId"
  23. :sectionMaxNum="sectionMaxNum"
  24. :preItem="list[indexM - 1] || preItem"
  25. :learningOrder="learningOrder"
  26. :courseId="courseId"
  27. @playEnd="refreshList($event)"
  28. :goodsId="goodsId"
  29. :isBuy="isBuy"
  30. :nextMenuItem="findNextSection(indexM)"
  31. :isRebuild="isRebuild"
  32. :gradeId="gradeId"
  33. :menuItem="itemM"
  34. :levelId="levelId + '-' + itemM.sectionId"
  35. :testType="2"
  36. :ChapterSectionExam="sectionExam"
  37. :menuAllList="menuAllList"
  38. ></courseSection>
  39. <!-- @togoBack='togoBack()' -->
  40. <u-line v-if="indexM < list.length - 1"></u-line>
  41. </view>
  42. <!-- 章卷 -->
  43. <view v-if="itemM.type == 2">
  44. <u-line></u-line>
  45. <view
  46. class="examBox"
  47. @click="
  48. toDo(
  49. itemM.typeId,
  50. goodsId,
  51. itemM.moduleId,
  52. itemM.chapterId,
  53. itemM,
  54. indexM
  55. )
  56. "
  57. >
  58. <view class="exam">
  59. <view class="eTag">
  60. {{ itemM.doType == 1 ? "练习" : "考试" }}
  61. </view>
  62. <view style="margin-left: 15rpx; flex: 1">{{ itemM.name }}</view>
  63. </view>
  64. <view v-if="isRebuild || itemM.rebuild > 0" class="tagRe"
  65. >待重修</view
  66. >
  67. <view v-else>
  68. <view
  69. :class="{
  70. tagGreen: itemM.learning == 1,
  71. tagRe: itemM.learning == 0 || itemM.rebuild > 0,
  72. }"
  73. >
  74. <text v-if="itemM.rebuild > 0">待重测</text>
  75. <text v-else-if="itemM.learning == 1">合格</text>
  76. <text v-else-if="itemM.learning == 0">不及格(需重考)</text>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </template>
  85. <script>
  86. import { mapGetters, mapMutations } from "vuex";
  87. import courseSection from "@/components/course/courseSection.vue";
  88. export default {
  89. name: "courseChapter",
  90. props: {
  91. isLive: false,
  92. orderGoodsId: {
  93. default: 0,
  94. },
  95. preItem: {
  96. default: undefined,
  97. },
  98. learningOrder: {
  99. //是否设置学习顺序 1 章节顺序 0不设置 2从头学到尾顺序
  100. type: Number,
  101. default: 0,
  102. },
  103. needOpen: {
  104. //是否默认展开
  105. type: Boolean,
  106. default: false,
  107. },
  108. menuItem: {
  109. type: Object,
  110. default: {},
  111. },
  112. isBuy: {
  113. type: Boolean,
  114. default: false,
  115. },
  116. levelId: {
  117. type: String,
  118. default: "",
  119. },
  120. goodsId: {
  121. type: Number,
  122. default: 0,
  123. },
  124. courseId: {
  125. type: Number,
  126. default: 0,
  127. },
  128. isRebuild: {
  129. type: Boolean,
  130. default: false,
  131. },
  132. gradeId: {
  133. type: Number,
  134. default: 0,
  135. },
  136. sectionMaxNum: {
  137. default: undefined,
  138. },
  139. // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  140. goodsType: {
  141. type: [Number, String],
  142. default: 0,
  143. },
  144. menuAllList: {
  145. // 课程所有子目录结构列表
  146. type: Array,
  147. default: () => [],
  148. },
  149. sectionItem: {
  150. // 用户最后一次看的录播的信息
  151. type: Object,
  152. default: () => {},
  153. },
  154. },
  155. components: {
  156. courseSection,
  157. },
  158. data() {
  159. return {
  160. down: true,
  161. list: [],
  162. examList: {},
  163. canLearn: false, //是否全部视频看完才可以练习、测试
  164. sectionExam: [],
  165. };
  166. },
  167. onLoad() {},
  168. created() {},
  169. mounted() {
  170. if (this.needOpen && this.chapterOpen) {
  171. this.updateChapterOpen(false);
  172. this.openChapter(this.menuItem);
  173. }
  174. },
  175. onPageShow() {
  176. if (this.isBuy) {
  177. this.refreshList({ isRebuild: this.isRebuild });
  178. }
  179. },
  180. methods: {
  181. ...mapMutations(["updateChapterOpen"]),
  182. // 调用节的方法
  183. // togoBack(value) {
  184. // this.$refs.ChapterSection[0].ChapterExam()
  185. // },
  186. goodsTodayStudySectionNum() {
  187. return new Promise((resolve) => {
  188. this.$api
  189. .goodsTodayStudySectionNum({
  190. goodsId: this.goodsId,
  191. gradeId: this.gradeId,
  192. })
  193. .then((res) => {
  194. if (res.data.code == 200) {
  195. resolve(res.data.data);
  196. }
  197. });
  198. });
  199. },
  200. async refreshList(isRebuild) {
  201. // console.log('节的播放结束');
  202. let moduleId = this.menuItem.moduleId ? this.menuItem.moduleId : 0;
  203. if (this.isRebuild) {
  204. this.getReSectionList(
  205. this.menuItem.id,
  206. this.menuItem.courseId,
  207. moduleId
  208. );
  209. } else {
  210. // console.log('重新请求');
  211. this.getBuySectionList(
  212. this.menuItem.id,
  213. this.menuItem.courseId,
  214. moduleId
  215. );
  216. // this.getMenuExamList(item.id,item.courseId,moduleId)
  217. }
  218. this.$emit("playEnd", { isRebuild: isRebuild.isRebuild });
  219. // this.newMenuAllList = await this.studyRecordMenuAllList()
  220. // console.log('播放器节:', this.newMenuAllList);
  221. },
  222. findNextSection(index) {
  223. for (let i = index + 1; i < this.list.length; i++) {
  224. return this.list[i];
  225. }
  226. return {};
  227. },
  228. // /study/record/menuAllList - 查询课程所有子目录结构列表
  229. studyRecordMenuAllList() {
  230. return new Promise((resolve) => {
  231. this.$api
  232. .studyRecordMenuAllList({
  233. courseId: this.courseId,
  234. gradeId: this.gradeId,
  235. goodsId: this.goodsId,
  236. })
  237. .then((res) => {
  238. if (res.data.code == 200) {
  239. resolve(res.data.data);
  240. }
  241. });
  242. });
  243. },
  244. gradeCheckGoodsStudy(id) {
  245. let moduleId = this.menuItem.moduleId || 0;
  246. let chapterId = this.menuItem.chapterId || 0;
  247. let sectionId = this.menuItem.sectionId || this.menuItem.menuId;
  248. return new Promise((resolve) => {
  249. this.$api
  250. .gradeCheckGoodsStudy({
  251. goodsId: this.goodsId,
  252. gradeId: this.gradeId,
  253. moduleId: this.menuItem.moduleId || 0,
  254. chapterId: this.menuItem.chapterId || 0,
  255. examId: id,
  256. })
  257. .then((res) => {
  258. resolve(res.data.data);
  259. });
  260. });
  261. },
  262. // 新增用户视频学习日志
  263. studyLog() {
  264. this.$http({
  265. url: "/user/study/log",
  266. method: "post",
  267. data: {
  268. goodsId: this.goodsId,
  269. courseId: this.courseId,
  270. moduleId: this.menuItem.moduleId || 0,
  271. chapterId: this.menuItem.chapterId || 0,
  272. sectionId: this.menuItem.sectionId || this.menuItem.menuId,
  273. fromPlat: 1, //来源平台 1小程序 2PC网站
  274. goodsType: this.goodsType, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  275. orderGoodsId: this.orderGoodsId,
  276. },
  277. }).then((res) => {
  278. console.log("考试的用户学习日志:", res);
  279. });
  280. },
  281. /**
  282. * 去做题
  283. */
  284. async toDo(id, goodsId = 0, moduleId = 0, chapterId = 0, item, index) {
  285. if (item.doType === 2 && item.learning == 1) {
  286. return;
  287. }
  288. // 查询用户商品今天学习节数- /goods/todayStudySectionNum
  289. let learnNum = await this.goodsTodayStudySectionNum();
  290. // 检查用户是否学习过节 - /grade/grade/checkGoodsStudy
  291. let hasLearn = await this.gradeCheckGoodsStudy(id);
  292. if (this.sectionMaxNum > 0) {
  293. if (learnNum >= this.sectionMaxNum && !hasLearn) {
  294. uni.showToast({
  295. icon: "none",
  296. title: `每天最多学习${this.sectionMaxNum}节`,
  297. });
  298. return;
  299. }
  300. }
  301. if (this.learningOrder == 1) {
  302. if (this.canLearn) {
  303. let num = await this.bankRecordDoNum(item.typeId);
  304. //有次数限制
  305. if (item.answerNum - num > 0 && item.answerNum > 0) {
  306. // this.$set(this.list[index],'doNum',(item.doNum+1))
  307. // console.log(this.list[index]);
  308. uni.navigateTo({
  309. url:
  310. "/pages2/class/questionBank?courseId=" +
  311. this.courseId +
  312. "&gradeId=" +
  313. this.gradeId +
  314. "&isFromVideo=1&id=" +
  315. id +
  316. "&goodsid=" +
  317. goodsId +
  318. "&moduleId=" +
  319. moduleId +
  320. "&chapterId=" +
  321. chapterId +
  322. "&orderGoodsId=" +
  323. this.orderGoodsId +
  324. "&type=1" +
  325. "&learning=" +
  326. item.learning +
  327. "&isBackVideo=" +
  328. 1,
  329. });
  330. this.studyLog();
  331. //没有答题次数限制
  332. } else if (item.answerNum == 0) {
  333. uni.navigateTo({
  334. url:
  335. "/pages2/class/questionBank?courseId=" +
  336. this.courseId +
  337. "&gradeId=" +
  338. this.gradeId +
  339. "&isFromVideo=1&id=" +
  340. id +
  341. "&goodsid=" +
  342. goodsId +
  343. "&moduleId=" +
  344. moduleId +
  345. "&chapterId=" +
  346. chapterId +
  347. "&orderGoodsId=" +
  348. this.orderGoodsId +
  349. "&type=1" +
  350. "&learning=" +
  351. item.learning +
  352. "&isBackVideo=" +
  353. 1,
  354. });
  355. this.studyLog();
  356. } else {
  357. uni.showToast({
  358. icon: "none",
  359. title: "该试卷只能答题" + item.answerNum + "次",
  360. });
  361. return;
  362. }
  363. } else {
  364. uni.showToast({
  365. icon: "none",
  366. title: "请按顺序学完视频课程再进行练习和测试",
  367. });
  368. }
  369. } else if (this.learningOrder == 2) {
  370. // !item.rebuild
  371. let rows = this.menuAllList;
  372. const index = this.menuAllList.findIndex((e) => {
  373. let i_sectionId = e.sectionId || 0;
  374. let i_chapterId = e.chapterId || 0;
  375. let i_moduleId = e.moduleId || 0;
  376. return (
  377. i_sectionId == item.sectionId &&
  378. i_chapterId == item.chapterId &&
  379. i_moduleId == item.moduleId
  380. );
  381. });
  382. let isStop = false;
  383. let newRows = [];
  384. for (let i = 0; i < index; i++) {
  385. let moduleTrue = rows[i].moduleId == moduleId;
  386. let chapterTrue = rows[i].chapterId == chapterId;
  387. if (moduleTrue && chapterTrue) {
  388. isStop = true;
  389. if (rows[i].sectionType != 2) {
  390. //忽略直播
  391. newRows.push(rows[i]);
  392. }
  393. } else {
  394. if (!isStop) {
  395. if (rows[i].sectionType != 2) {
  396. //忽略直播
  397. newRows.push(rows[i]);
  398. }
  399. } else {
  400. break;
  401. }
  402. }
  403. }
  404. let isAllLearn = newRows.every((item) => {
  405. return item.studyStatus == 1;
  406. });
  407. if (isAllLearn) {
  408. //之前的都学完了
  409. // if(canLearn) { //视频的上一节学完
  410. let num = await this.bankRecordDoNum(item.typeId);
  411. //有次数限制
  412. if (item.answerNum - num > 0 && item.answerNum > 0) {
  413. // this.$set(this.list[index],'doNum',(item.doNum+1))
  414. // console.log(this.list[index]);
  415. uni.navigateTo({
  416. url:
  417. "/pages2/class/questionBank?courseId=" +
  418. this.courseId +
  419. "&gradeId=" +
  420. this.gradeId +
  421. "&isFromVideo=1&id=" +
  422. id +
  423. "&goodsid=" +
  424. goodsId +
  425. "&moduleId=" +
  426. moduleId +
  427. "&chapterId=" +
  428. chapterId +
  429. "&orderGoodsId=" +
  430. this.orderGoodsId +
  431. "&type=1" +
  432. "&learning=" +
  433. item.learning +
  434. "&isBackVideo=" +
  435. 1,
  436. });
  437. this.studyLog();
  438. //没有答题次数限制
  439. } else if (item.answerNum == 0) {
  440. uni.navigateTo({
  441. url:
  442. "/pages2/class/questionBank?courseId=" +
  443. this.courseId +
  444. "&gradeId=" +
  445. this.gradeId +
  446. "&isFromVideo=1&id=" +
  447. id +
  448. "&goodsid=" +
  449. goodsId +
  450. "&moduleId=" +
  451. moduleId +
  452. "&chapterId=" +
  453. chapterId +
  454. "&orderGoodsId=" +
  455. this.orderGoodsId +
  456. "&type=1" +
  457. "&learning=" +
  458. item.learning +
  459. "&isBackVideo=" +
  460. 1,
  461. });
  462. this.studyLog();
  463. } else {
  464. uni.showToast({
  465. icon: "none",
  466. title: "该试卷只能答题" + item.answerNum + "次",
  467. });
  468. return;
  469. }
  470. } else {
  471. uni.showToast({
  472. icon: "none",
  473. title: "请学完视频课程再进行练习和测试",
  474. });
  475. }
  476. } else {
  477. let num = await this.bankRecordDoNum(item.typeId);
  478. //有次数限制
  479. if (item.answerNum - item.doNum > 0 && item.answerNum > 0) {
  480. // this.$set(this.list[index],'doNum',(item.doNum+1))
  481. // console.log(this.list[index]);
  482. uni.navigateTo({
  483. url:
  484. "/pages2/class/questionBank?courseId=" +
  485. this.courseId +
  486. "&gradeId=" +
  487. this.gradeId +
  488. "&isFromVideo=1&id=" +
  489. id +
  490. "&goodsid=" +
  491. goodsId +
  492. "&moduleId=" +
  493. moduleId +
  494. "&chapterId=" +
  495. chapterId +
  496. "&orderGoodsId=" +
  497. this.orderGoodsId +
  498. "&type=1" +
  499. "&learning=" +
  500. item.learning +
  501. "&isBackVideo=" +
  502. 1,
  503. });
  504. this.studyLog();
  505. //没有答题次数限制
  506. } else if (item.answerNum == 0) {
  507. uni.navigateTo({
  508. url:
  509. "/pages2/class/questionBank?courseId=" +
  510. this.courseId +
  511. "&gradeId=" +
  512. this.gradeId +
  513. "&isFromVideo=1&id=" +
  514. id +
  515. "&goodsid=" +
  516. goodsId +
  517. "&moduleId=" +
  518. moduleId +
  519. "&chapterId=" +
  520. chapterId +
  521. "&orderGoodsId=" +
  522. this.orderGoodsId +
  523. "&type=1" +
  524. "&learning=" +
  525. item.learning +
  526. "&isBackVideo=" +
  527. 1,
  528. });
  529. this.studyLog();
  530. } else {
  531. uni.showToast({
  532. icon: "none",
  533. title: "该试卷只能答题" + item.answerNum + "次",
  534. });
  535. return;
  536. }
  537. }
  538. },
  539. bankRecordDoNum(examId) {
  540. return new Promise((resolve) => {
  541. this.$api
  542. .bankRecordDoNum({
  543. goodsId: this.goodsId,
  544. gradeId: this.gradeId,
  545. chapterId: this.menuItem.id,
  546. courseId: this.courseId,
  547. moduleId: 0,
  548. examId: examId,
  549. })
  550. .then((res) => {
  551. resolve(res.data.data);
  552. });
  553. });
  554. },
  555. async openChapter(item) {
  556. // console.log('---zhang',this.menuItem, this.down, item.courseId, item.moduleId);
  557. this.down = !this.down;
  558. if (!this.down && this.list.length == 0) {
  559. // console.log(item.id, 69);
  560. //获取章下面所有节试卷列表-course/sectionExamList
  561. this.$method.isLogin() &&
  562. (await this.$api
  563. .reSectionExamList({
  564. chapterId: item.chapterId || item.menuId,
  565. courseId: item.courseId,
  566. gradeId: item.gradeId,
  567. })
  568. .then((res) => {
  569. if (res.data.code == 200) {
  570. this.sectionExam = res.data.data || [];
  571. }
  572. }));
  573. if (this.isBuy) {
  574. let moduleId = item.moduleId ? item.moduleId : 0;
  575. let chapterId = item.chapterId || item.id;
  576. if (this.isRebuild) {
  577. this.getReSectionList(chapterId, item.courseId, moduleId);
  578. } else {
  579. this.getBuySectionList(chapterId, item.courseId, moduleId);
  580. // this.getMenuExamList(item.id,item.courseId,moduleId)
  581. }
  582. } else {
  583. this.getSectionList(item.chapterId);
  584. }
  585. }
  586. },
  587. getMenuExamList(chapterId, courseId, moduleId) {
  588. let self = this;
  589. this.$api
  590. .menuExamList({
  591. chapterId: chapterId,
  592. courseId: courseId,
  593. moduleId: moduleId,
  594. })
  595. .then((res) => {
  596. if (res.data.code == 200) {
  597. self.examList = res.data.rows;
  598. }
  599. });
  600. },
  601. getSectionList(chapterId) {
  602. let self = this;
  603. // url: '/app/common/course/sectionList/'+data,
  604. this.$api.sectionList(chapterId).then((res) => {
  605. if (res.data.code == 200) {
  606. for (let i = 0; i < res.data.data.length; i++) {
  607. let item = res.data.data[i];
  608. item.id = item.sectionId;
  609. item.menuType = 3;
  610. //判断是否试听
  611. item.tryListen = false;
  612. if (self.goodsAuditionConfigIdList.indexOf(item.id) !== -1) {
  613. item.tryListen = true;
  614. }
  615. }
  616. let newArr = res.data.data.filter((item) => {
  617. return item.type != 2;
  618. });
  619. this.canLearn = newArr.every((item) => {
  620. if (item.learning == 1) {
  621. return true;
  622. } else {
  623. return false;
  624. }
  625. });
  626. self.list = res.data.data;
  627. }
  628. });
  629. },
  630. getReSectionList(chapterId, courseId, moduleId) {
  631. let self = this;
  632. this.$api
  633. .reSectionList({
  634. chapterId: chapterId,
  635. gradeId: this.gradeId,
  636. courseId: courseId,
  637. rebuild: 1,
  638. moduleId: moduleId,
  639. })
  640. .then((res) => {
  641. if (res.data.code == 200) {
  642. for (let i = 0; i < res.data.data.length; i++) {
  643. let item = res.data.data[i];
  644. item.id = item.sectionId;
  645. item.courseId = courseId;
  646. item.menuType = 3;
  647. //判断是否试听
  648. item.tryListen = false;
  649. if (self.goodsAuditionConfigIdList.indexOf(item.id) !== -1) {
  650. item.tryListen = true;
  651. }
  652. }
  653. let newArr = res.data.data.filter((item) => {
  654. return item.type != 2;
  655. });
  656. this.canLearn = newArr.every((item) => {
  657. if (item.learning == 1) {
  658. return true;
  659. } else {
  660. return false;
  661. }
  662. });
  663. self.list = res.data.data;
  664. }
  665. });
  666. },
  667. getBuySectionList(chapterId, courseId, moduleId) {
  668. let self = this;
  669. // /course/sectionList
  670. this.$api
  671. .reSectionList({
  672. chapterId: chapterId,
  673. gradeId: this.gradeId,
  674. courseId: courseId,
  675. moduleId: moduleId,
  676. })
  677. .then((res) => {
  678. if (res.data.code == 200) {
  679. for (let i = 0; i < res.data.data.length; i++) {
  680. let item = res.data.data[i];
  681. item.courseId = courseId;
  682. item.id = item.sectionId;
  683. item.menuType = 3;
  684. //判断是否试听
  685. item.tryListen = false;
  686. if (self.goodsAuditionConfigIdList.indexOf(item.id) !== -1) {
  687. item.tryListen = true;
  688. }
  689. }
  690. let newArr = res.data.data.filter((item) => {
  691. return item.type != 2;
  692. });
  693. this.canLearn = newArr.every((item) => {
  694. if (item.learning == 1) {
  695. return true;
  696. } else {
  697. return false;
  698. }
  699. });
  700. self.list = res.data.data;
  701. // console.log('=======节列表==', this.list);
  702. }
  703. });
  704. },
  705. },
  706. computed: {
  707. ...mapGetters(["goodsAuditionConfigIdList", "chapterOpen"]),
  708. learnStatus() {
  709. if (!this.isBuy) {
  710. return 0;
  711. }
  712. let { id, courseId, moduleId } = this.menuItem;
  713. if (
  714. this.sectionItem.courseId == courseId &&
  715. this.sectionItem.moduleId == (moduleId || 0) &&
  716. this.sectionItem.chapterId == id
  717. ) {
  718. return 0;
  719. }
  720. const list = this.menuAllList.filter(
  721. (e) =>
  722. e.courseId == courseId &&
  723. e.moduleId == (moduleId || 0) &&
  724. e.chapterId == id
  725. );
  726. const isAllLearn = list.every((item) => {
  727. return item.studyStatus == 1;
  728. });
  729. return isAllLearn ? 1 : -1;
  730. },
  731. },
  732. };
  733. </script>
  734. <style lang="scss" scoped>
  735. .tagRe {
  736. // width: 80rpx;
  737. line-height: 28rpx;
  738. padding: 0 8rpx;
  739. height: 28rpx;
  740. background: #ff3b30;
  741. border-radius: 8rpx;
  742. font-size: 20rpx;
  743. color: #ffffff;
  744. text-align: center;
  745. }
  746. .tagGreen {
  747. width: 80rpx;
  748. height: 28rpx;
  749. background: #34c759;
  750. border-radius: 8rpx;
  751. font-size: 20rpx;
  752. color: #ffffff;
  753. text-align: center;
  754. }
  755. .eTag {
  756. width: 64rpx;
  757. height: 36rpx;
  758. text-align: center;
  759. line-height: 36rpx;
  760. font-size: 20rpx;
  761. background: #007aff;
  762. border-radius: 8rpx;
  763. color: #ffffff;
  764. }
  765. .examBox {
  766. display: flex;
  767. align-items: center;
  768. justify-content: space-between;
  769. }
  770. .exam {
  771. font-size: 30rpx;
  772. display: flex;
  773. align-items: center;
  774. margin: 20rpx 0;
  775. }
  776. .icon_up {
  777. width: 24rpx;
  778. height: 24rpx;
  779. }
  780. .title {
  781. // margin-bottom: 30rpx;
  782. height: 78rpx;
  783. display: flex;
  784. justify-content: space-between;
  785. align-items: center;
  786. border-bottom: 1rpx solid #eeeeee;
  787. .menu_name {
  788. font-size: 24rpx;
  789. font-family: PingFang SC;
  790. font-weight: bold;
  791. color: #333;
  792. white-space: nowrap;
  793. overflow: hidden;
  794. text-overflow: ellipsis;
  795. margin-left: 8rpx;
  796. }
  797. .title_status {
  798. width: 80rpx;
  799. height: 28rpx;
  800. border-radius: 8rpx;
  801. font-size: 20rpx;
  802. color: #ffffff;
  803. text-align: center;
  804. }
  805. .gre {
  806. background: #34c759;
  807. }
  808. .blue {
  809. background: #409eff;
  810. }
  811. .grey {
  812. background: #909399;
  813. }
  814. }
  815. </style>