index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678
  1. <template>
  2. <div class="bank-report">
  3. <Header></Header>
  4. <section class="section">
  5. <div class="container">
  6. <div class="re_back">
  7. <el-button
  8. type="primary"
  9. plain
  10. round
  11. size="mini"
  12. class="back-btn"
  13. @click="$router.back(-1)"
  14. >返回</el-button
  15. >
  16. </div>
  17. <div
  18. class="section__header section__header--warm"
  19. v-if="!reportdata.reportStatus"
  20. >
  21. <div class="title">
  22. <span class="icon">X</span>
  23. 测试未通过
  24. </div>
  25. </div>
  26. <div
  27. class="section__header section__header--success"
  28. v-if="reportdata.reportStatus"
  29. >
  30. <div class="title">
  31. <span class="icon">✔</span>
  32. 测试通过
  33. </div>
  34. </div>
  35. <div class="section__body">
  36. <div class="section__body__content">
  37. <div class="right-box">
  38. <div class="right-box__in">
  39. <div class="title">
  40. 试卷得分
  41. <span class="note">(客观题)</span>
  42. </div>
  43. <div class="desc">{{ reportdata.performance }}</div>
  44. <div class="other">满分{{ reportdata.totalScore }}</div>
  45. </div>
  46. <div class="right-box__in right-box__in--bottom">
  47. <div class="child">
  48. <div class="child__title child__title--success">
  49. {{ reportdata.rightQuestionNum }}
  50. </div>
  51. <div class="child__desc">正确题数</div>
  52. </div>
  53. <div class="child">
  54. <div class="child__title child__title--yellow">
  55. {{ reportdata.lessQuestionNum }}
  56. </div>
  57. <div class="child__desc">少选题数</div>
  58. </div>
  59. <div class="child child---right">
  60. <div class="child__title child__title--warm">
  61. {{ doWrongQuestionNum }}
  62. </div>
  63. <div class="child__desc">错误题数</div>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. <div class="section__footer">
  70. <el-button type="primary" class="btn" @click="backList()"
  71. >返回列表</el-button
  72. >
  73. <el-button
  74. type="primary"
  75. class="btn"
  76. @click="doRepeat(reportdata)"
  77. v-if="reportdata.doMode != 3 && !reportdata.reportStatus"
  78. >重新做题</el-button
  79. >
  80. <el-button
  81. type="primary"
  82. class="btn"
  83. @click="wrongExplain(reportdata)"
  84. v-if="doWrongQuestionNum"
  85. >错题解析</el-button
  86. >
  87. <el-button type="primary" class="btn" @click="allExplain(reportdata)"
  88. >全部解析</el-button
  89. >
  90. </div>
  91. <div v-if="courseList.length" class="course_list">
  92. <div class="course__header">
  93. <div class="title">相关推荐</div>
  94. </div>
  95. <div class="course__body">
  96. <ul class="list clearfix">
  97. <template v-for="(item, index) in courseList">
  98. <li class="course-item" :key="index">
  99. <GoodsItem :item="item"></GoodsItem>
  100. </li>
  101. </template>
  102. </ul>
  103. </div>
  104. <div class="pagination">
  105. <el-pagination
  106. @current-change="currentChangeCou"
  107. background
  108. layout="prev, pager, next"
  109. :total="total"
  110. :page-size="pageSize"
  111. >
  112. </el-pagination>
  113. </div>
  114. </div>
  115. </div>
  116. </section>
  117. <el-dialog
  118. title="提示"
  119. :close-on-click-modal="false"
  120. :close-on-press-escape="false"
  121. :visible.sync="nextDialogStatus"
  122. width="400px"
  123. >
  124. <span>是否继续学习?</span>
  125. <span slot="footer" class="dialog-footer">
  126. <el-button type="primary" @click="nextDialogStatus = false"
  127. >取消</el-button
  128. ><el-button type="primary" @click="nextJump">确定</el-button>
  129. </span>
  130. </el-dialog>
  131. <ToolBar></ToolBar>
  132. <Footer></Footer>
  133. </div>
  134. </template>
  135. <script>
  136. import Footer from "@/components/footer/index";
  137. import Header from "@/components/header/index";
  138. import ToolBar from "@/components/toolbar/index";
  139. import GoodsItem from "@/components/goodsItem/index";
  140. import { mapGetters } from "vuex";
  141. export default {
  142. name: "BankExplain",
  143. components: {
  144. Footer,
  145. Header,
  146. ToolBar,
  147. GoodsItem
  148. },
  149. data() {
  150. return {
  151. nextDialogStatus: false,
  152. examId: "",
  153. courseList: [],
  154. pageNum: 1,
  155. pageSize: 10,
  156. total: 0,
  157. recordId: "",
  158. type: 0, //type:1章卷,2节卷,3模考卷
  159. reportdata: {},
  160. studyItem: {}
  161. };
  162. },
  163. computed: {
  164. ...mapGetters(["examResult"]),
  165. doWrongQuestionNum() {
  166. let value =
  167. this.reportdata.totalQuestionNum -
  168. this.reportdata.rightQuestionNum -
  169. this.reportdata.lessQuestionNum;
  170. return value > 0 ? value : 0;
  171. }
  172. },
  173. created() {
  174. const { examId, recordId, type } = this.$route.query;
  175. this.examId = examId;
  176. this.recordId = recordId;
  177. this.type = type;
  178. this.getcourList();
  179. this.bankReport();
  180. },
  181. methods: {
  182. studyRecordMenuAllList(item) {
  183. return new Promise(resolve => {
  184. this.$request
  185. .studyRecordMenuAllListWithExam({
  186. courseId: item.courseId,
  187. gradeId: item.gradeId,
  188. goodsId: item.goodsId,
  189. orderGoodsId: item.orderGoodsId
  190. })
  191. .then(res => {
  192. res.data = res.data.filter(
  193. e => e.sectionType != 2 && e.doType != 1
  194. );
  195. resolve(res.data);
  196. });
  197. });
  198. },
  199. checkListDontStudy(list) {
  200. if (list.length === 0) {
  201. this.$message.warning("该课程无学习内容");
  202. return false;
  203. }
  204. const index = list.findIndex(
  205. i => i.studyStatus == -1 || i.studyStatus == 0
  206. );
  207. if (index != -1) {
  208. return list[index];
  209. } else {
  210. this.$message.success("该课程内容已全部学完");
  211. return false;
  212. }
  213. },
  214. // 新增用户视频学习日志
  215. studyLog(item, studyItem) {
  216. this.$axios({
  217. url: "/user/study/log",
  218. method: "post",
  219. data: {
  220. goodsId: item.goodsId,
  221. courseId: studyItem.courseId,
  222. moduleId: studyItem.moduleId || 0,
  223. chapterId: studyItem.chapterId || 0,
  224. sectionId: studyItem.sectionId || 0,
  225. fromPlat: 2, //来源平台 1小程序 2PC网站
  226. goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  227. orderGoodsId: item.orderGoodsId
  228. }
  229. }).then(res => {
  230. console.log("直播的用户学习日志:", res);
  231. });
  232. },
  233. async nextJump() {
  234. var item = this.reportdata;
  235. var studyItem = this.studyItem;
  236. if (studyItem.sectionId) {
  237. //返回节
  238. this.$router.replace({
  239. path: `/my-course-detail/${item.goodsId}`,
  240. query: {
  241. gradeId: item.gradeId,
  242. orderGoodsId: item.orderGoodsId,
  243. courseId: studyItem.courseId,
  244. chapterId: studyItem.chapterId,
  245. moduleId: studyItem.moduleId,
  246. sectionId: studyItem.sectionId,
  247. recordingUrl: studyItem.recordingUrl,
  248. liveUrl: studyItem.liveUrl,
  249. sectionType: studyItem.sectionType,
  250. liveStartTime: studyItem.liveStartTime,
  251. liveEndTime: studyItem.liveEndTime
  252. }
  253. });
  254. }
  255. if (studyItem.examId) {
  256. this.$router.replace({
  257. path: "/course-exam/" + item.goodsId,
  258. query: {
  259. courseId: studyItem.courseId,
  260. gradeId: item.gradeId,
  261. moduleId: studyItem.moduleId || 0,
  262. sectionId: studyItem.sectionId || 0,
  263. examId: studyItem.examId,
  264. learning: studyItem.studyStatus,
  265. type: studyItem.examType, //题卷类型 1章卷 2节卷 3模块卷,
  266. chapterId: studyItem.chapterId || 0,
  267. orderGoodsId: item.orderGoodsId,
  268. nextStatus: "next" //是否继续播放课程
  269. }
  270. });
  271. }
  272. this.nextDialogStatus = false;
  273. },
  274. async GetNext() {
  275. var item = this.reportdata;
  276. this.$message.success("进入学习页");
  277. console.log("进入学习页");
  278. //获取当前课程所有节和试卷
  279. let list = await this.studyRecordMenuAllList(item);
  280. //返回第一个没学习的节或试卷
  281. this.studyItem = this.checkListDontStudy(list);
  282. this.nextDialogStatus = true;
  283. },
  284. getcourList() {
  285. this.$axios({
  286. url: "/apply/recommend/goodsList",
  287. method: "post",
  288. data: {
  289. examId: this.examId,
  290. pageNum: this.pageNum,
  291. pageSize: this.pageSize,
  292. platform: 2
  293. }
  294. }).then(res => {
  295. if (res.code == 200) {
  296. this.courseList = res.rows || [];
  297. this.total = res.total;
  298. }
  299. });
  300. },
  301. bankReport() {
  302. this.$request.bankReportData(this.recordId).then(res => {
  303. this.reportdata = res.data;
  304. if (
  305. this.$route.query.nextStatus == "next" &&
  306. this.reportdata.reportStatus
  307. ) {
  308. this.GetNext();
  309. }
  310. console.log("reportdata:", this.reportdata);
  311. });
  312. },
  313. currentChangeCou(val) {
  314. this.pageNum = val;
  315. this.getcourList();
  316. },
  317. backList() {
  318. this.$router.go(-1);
  319. },
  320. /**
  321. * 去做题
  322. */
  323. async doRepeat(reportdata) {
  324. // answerNum==0没有答题次数限制
  325. this.$router.replace({
  326. path: "/course-exam/" + this.reportdata.goodsId,
  327. query: {
  328. courseId: this.reportdata.courseId,
  329. gradeId: this.reportdata.gradeId || 0,
  330. moduleId: this.reportdata.moduleId || 0,
  331. sectionId: this.reportdata.sectionId || 0,
  332. examId: this.reportdata.examId,
  333. type: this.type,
  334. chapterId: this.reportdata.chapterId || 0,
  335. orderGoodsId: this.reportdata.orderGoodsId
  336. }
  337. });
  338. },
  339. wrongExplain(reportdata) {
  340. this.$router.push({
  341. path: "/bank-exam-wrong-explain/" + reportdata.recordId,
  342. query: {
  343. examId: reportdata.examId,
  344. moduleId: reportdata.moduleId || 0,
  345. chapterId: reportdata.chapterId || 0,
  346. goodsId: reportdata.goodsId,
  347. orderGoodsId: reportdata.orderGoodsId,
  348. courseType: 2
  349. }
  350. });
  351. },
  352. allExplain(reportdata) {
  353. this.$router.push({
  354. path: "/bank-exam-all-explain/" + reportdata.recordId,
  355. query: {
  356. simulateStatus: reportdata.doMode === 3 ? 1 : 0,
  357. examId: reportdata.examId,
  358. moduleId: reportdata.moduleId || 0,
  359. chapterId: reportdata.chapterId || 0,
  360. goodsId: reportdata.goodsId,
  361. courseType: 2
  362. }
  363. });
  364. }
  365. }
  366. };
  367. </script>
  368. <!-- Add "scoped" attribute to limit CSS to this component only -->
  369. <style scoped lang="scss">
  370. .bank-report {
  371. .re_back {
  372. text-align: right;
  373. margin: 10px 0px;
  374. .back-btn {
  375. width: 100px;
  376. }
  377. }
  378. .section {
  379. &__header {
  380. height: 120px;
  381. border-radius: 0px;
  382. padding-top: 10px;
  383. &--warm {
  384. background: #fff3f5;
  385. .title {
  386. text-align: center;
  387. font-size: 18px;
  388. font-family: Microsoft YaHei;
  389. font-weight: bold;
  390. color: #ff3b30;
  391. .icon {
  392. vertical-align: middle;
  393. display: inline-block;
  394. width: 48px;
  395. height: 58px;
  396. text-align: center;
  397. line-height: 58px;
  398. background: #ff3b30;
  399. color: #fff;
  400. font-size: 30px;
  401. }
  402. }
  403. }
  404. &--success {
  405. background: #f8fef9;
  406. .title {
  407. text-align: center;
  408. font-size: 18px;
  409. font-family: Microsoft YaHei;
  410. font-weight: bold;
  411. color: #34c759;
  412. .icon {
  413. vertical-align: middle;
  414. display: inline-block;
  415. width: 48px;
  416. height: 58px;
  417. text-align: center;
  418. line-height: 58px;
  419. background: #34c759;
  420. color: #fff;
  421. font-size: 30px;
  422. }
  423. }
  424. }
  425. .desc {
  426. margin-top: 20px;
  427. text-align: center;
  428. font-size: 14px;
  429. font-family: Microsoft YaHei;
  430. font-weight: 400;
  431. color: #333333;
  432. .note {
  433. font-size: 14px;
  434. font-family: Microsoft YaHei;
  435. font-weight: 400;
  436. color: #999999;
  437. }
  438. }
  439. }
  440. &__body {
  441. width: 100%;
  442. height: 305px;
  443. border-bottom: 1px solid #eee;
  444. &__content {
  445. width: 100%;
  446. height: 100%;
  447. display: flex;
  448. align-items: center;
  449. justify-content: center;
  450. .left-box {
  451. width: 300px;
  452. height: 240px;
  453. background: #ffffff;
  454. border: 1px solid #eeeeee;
  455. border-radius: 8px;
  456. display: flex;
  457. flex-direction: column;
  458. margin: 0 10px;
  459. &__in {
  460. flex: 1;
  461. border-bottom: 1px solid #eee;
  462. padding: 5px 18px;
  463. .title {
  464. font-size: 14px;
  465. font-family: Microsoft YaHei;
  466. font-weight: 400;
  467. color: #333333;
  468. line-height: 24px;
  469. .note {
  470. color: #999;
  471. }
  472. }
  473. .desc {
  474. margin-top: 20px;
  475. font-size: 48px;
  476. font-family: Microsoft YaHei;
  477. font-weight: 400;
  478. color: #333333;
  479. line-height: 24px;
  480. text-align: center;
  481. }
  482. .other {
  483. margin-top: 14px;
  484. font-size: 14px;
  485. font-family: Microsoft YaHei;
  486. font-weight: 400;
  487. color: #999999;
  488. line-height: 24px;
  489. text-align: center;
  490. }
  491. &--bottom {
  492. border: 0;
  493. }
  494. }
  495. }
  496. .right-box {
  497. margin: 0 10px;
  498. display: flex;
  499. width: 300px;
  500. height: 240px;
  501. background: #ffffff;
  502. border: 1px solid #eeeeee;
  503. border-radius: 8px;
  504. flex-direction: column;
  505. &__in {
  506. flex: 1;
  507. border-bottom: 1px solid #eee;
  508. padding: 5px 18px;
  509. .title {
  510. font-size: 14px;
  511. font-family: Microsoft YaHei;
  512. font-weight: 400;
  513. color: #333333;
  514. line-height: 24px;
  515. .note {
  516. color: #999;
  517. }
  518. }
  519. .desc {
  520. margin-top: 20px;
  521. font-size: 48px;
  522. font-family: Microsoft YaHei;
  523. font-weight: 400;
  524. color: #333333;
  525. line-height: 24px;
  526. text-align: center;
  527. }
  528. .other {
  529. margin-top: 14px;
  530. font-size: 14px;
  531. font-family: Microsoft YaHei;
  532. font-weight: 400;
  533. color: #999999;
  534. line-height: 24px;
  535. text-align: center;
  536. }
  537. &--bottom {
  538. padding: 0;
  539. border: 0;
  540. height: 100%;
  541. display: flex;
  542. .child {
  543. flex: 1;
  544. height: 100%;
  545. border-right: 1px solid #eee;
  546. padding: 5px 18px;
  547. &--right {
  548. border: 0;
  549. }
  550. &__title {
  551. margin-top: 20px;
  552. font-size: 36px;
  553. font-family: Microsoft YaHei;
  554. font-weight: 400;
  555. color: #34c759;
  556. line-height: 24px;
  557. text-align: center;
  558. &--success {
  559. color: #34c759;
  560. }
  561. &--warm {
  562. color: #ff3b30;
  563. }
  564. &--yellow {
  565. color: #ffc53d;
  566. }
  567. }
  568. &__desc {
  569. margin-top: 10px;
  570. font-size: 14px;
  571. font-family: Microsoft YaHei;
  572. font-weight: 400;
  573. color: #999999;
  574. line-height: 24px;
  575. text-align: center;
  576. }
  577. }
  578. }
  579. }
  580. }
  581. }
  582. }
  583. &__footer {
  584. display: flex;
  585. align-items: center;
  586. justify-content: center;
  587. padding: 40px 0;
  588. .btn {
  589. cursor: pointer;
  590. width: 140px;
  591. height: 32px;
  592. padding: 0;
  593. border-radius: 16px;
  594. text-align: center;
  595. line-height: 30px;
  596. font-size: 12px;
  597. margin: 0 4px;
  598. }
  599. }
  600. }
  601. .course_list {
  602. .course {
  603. background: #f5f7fa;
  604. padding-top: 40px;
  605. &__header {
  606. display: flex;
  607. align-items: center;
  608. justify-content: space-between;
  609. .title {
  610. background: url("~@/assets/video.png") no-repeat left center;
  611. padding-left: 36px;
  612. font-size: 24px;
  613. font-family: YouSheBiaoTiHei;
  614. font-weight: 400;
  615. color: #333333;
  616. text-shadow: 0px 6px 6px rgba(249, 113, 13, 0.08);
  617. }
  618. }
  619. &__body {
  620. .list {
  621. width: 100%;
  622. .course-item {
  623. float: left;
  624. }
  625. }
  626. }
  627. }
  628. .pagination {
  629. display: flex;
  630. align-items: center;
  631. justify-content: center;
  632. margin: 20px 0px;
  633. }
  634. }
  635. }
  636. </style>