courseChapter.vue 23 KB

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