index.vue 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171
  1. <template>
  2. <div class="my-course">
  3. <div class="my-course__header">
  4. <el-tabs :value="activeName" @tab-click="tabChange">
  5. <el-tab-pane
  6. v-for="(tab, tabIndex) in tabList"
  7. :key="tabIndex"
  8. :label="tab.educationName"
  9. :name="tab.id"
  10. ></el-tab-pane>
  11. </el-tabs>
  12. </div>
  13. <div class="my-course__body">
  14. <div class="list">
  15. <div
  16. class="course-item"
  17. v-for="(item, index) in courseList"
  18. :key="index"
  19. >
  20. <div class="course-item__header">
  21. <div
  22. class="time"
  23. v-if="item.serviceStartTime && item.serviceEndTime"
  24. >
  25. 学习服务期:{{
  26. $tools.timestampToTime(item.serviceStartTime, false)
  27. }}
  28. {{ $tools.timestampToTime(item.serviceEndTime, false) }}
  29. </div>
  30. <div class="state">
  31. <template
  32. v-if="
  33. item.serviceStartTime &&
  34. (sysTime < item.serviceStartTime ||
  35. sysTime > item.serviceEndTime)
  36. "
  37. >
  38. <div class="red">不在学习服务期,不可以学习了哦</div>
  39. </template>
  40. <template v-else>
  41. <template
  42. v-if="
  43. !(item.classEndTime && item.classEndTime < sysTime) &&
  44. !(item.classStartTime && item.classStartTime > sysTime)
  45. "
  46. >
  47. <template
  48. v-if="item.periodStatus == -1 || item.periodStatus == 2"
  49. >
  50. <template
  51. v-if="item.classStatus == 1 || item.classStatus === null"
  52. >
  53. <template
  54. v-if="
  55. sysTime >= item.serviceStartTime &&
  56. sysTime <= item.serviceEndTime
  57. "
  58. >
  59. 学习状态:
  60. <div
  61. class="note"
  62. v-if="item.stuAllNum + item.recordNum == 0"
  63. >
  64. 未学习
  65. </div>
  66. <div
  67. class="note note--yellow"
  68. v-else-if="
  69. item.stuAllNum + item.recordNum > 0 &&
  70. item.stuAllNum + item.recordNum <
  71. item.secAllNum + item.examNum
  72. "
  73. >
  74. 学习中
  75. </div>
  76. <div
  77. class="note note--green"
  78. v-else-if="
  79. item.stuAllNum + item.recordNum >=
  80. item.secAllNum + item.examNum
  81. "
  82. >
  83. 已学完
  84. </div>
  85. </template>
  86. <template v-else>
  87. <span class="red" v-if="item.serviceStartTime">
  88. 已过学习服务期,不可以学习了哦!</span
  89. >
  90. </template>
  91. </template>
  92. <!-- <template v-if="item.profileTpStatus == 1">
  93. 资料审核状态:
  94. <div class="note" v-if="item.profileStatus == null">
  95. 未提交资料
  96. </div>
  97. <div
  98. class="note note--green"
  99. v-else-if="item.profileStatus == 1"
  100. >
  101. 已通过
  102. </div>
  103. <div
  104. class="note note--yellow"
  105. v-else-if="item.profileStatus == 2"
  106. >
  107. 审核中
  108. </div>
  109. <div
  110. class="note note--yellow"
  111. v-else-if="item.profileStatus == 3"
  112. >
  113. 待完善
  114. </div>
  115. </template> -->
  116. </template>
  117. <!-- 学时审核状态可以审核 -->
  118. <template v-if="item.periodStatus != -1">
  119. <template v-if="item.periodStatus == 0"
  120. >机构审核:
  121. <div class="note">学时审核不通过</div>
  122. </template>
  123. <!-- <template v-else-if="item.periodStatus == 2"
  124. >机构审核:
  125. <div class="note note--yellow">学时待审核</div></template
  126. > -->
  127. <template v-else-if="item.periodStatus == 1">
  128. <template v-if="item.periodPlush > 0"
  129. ><div class="note note--green">
  130. 学时已上报注册中心
  131. </div></template
  132. >
  133. <template v-else
  134. >机构审核:
  135. <div class="note note--green">
  136. 学时审核通过
  137. </div></template
  138. >
  139. </template>
  140. <template
  141. v-if="item.subscribeId != null && item.periodStatus == 1"
  142. >
  143. <template v-if="item.subExamStatus === null">
  144. 待预约考试
  145. </template>
  146. <template
  147. v-else-if="
  148. item.subExamStatus === 0 &&
  149. sysTime <
  150. $tools.TimeTotimestamp(
  151. $tools.timestampToTime(
  152. item.subApplySiteExamTime,
  153. true
  154. ) +
  155. ' ' +
  156. item.subApplySiteStartTime
  157. )
  158. "
  159. >
  160. 待考试,考试时间:{{
  161. $tools.timestampToTime(
  162. item.subApplySiteExamTime,
  163. true
  164. ) +
  165. " " +
  166. item.subApplySiteStartTime
  167. }}
  168. -
  169. {{
  170. $tools.timestampToTime(
  171. item.subApplySiteExamTime,
  172. true
  173. ) +
  174. " " +
  175. item.subApplySiteEndTime
  176. }}
  177. </template>
  178. <template v-else-if="item.subExamStatus === 0"
  179. >待出考试结果</template
  180. >
  181. <template v-else-if="item.subExamStatus === 1">
  182. <span v-if="item.subResult === null">待出考试结果</span>
  183. <span v-if="item.subResult === 0"
  184. >考试结果:不通过,需补考</span
  185. >
  186. <span v-else-if="item.subResult === 1"
  187. >考试结果:通过,考试成绩为{{
  188. item.subPerformance
  189. }}</span
  190. >
  191. </template>
  192. <template v-else-if="item.subExamStatus === 2">
  193. 缺考,无成绩,需补考
  194. </template>
  195. <template v-else-if="item.subExamStatus === 3">
  196. 作弊,无成绩,需补考
  197. </template>
  198. <template v-else-if="item.subExamStatus === 4">
  199. 替考,无成绩,需补考
  200. </template>
  201. </template>
  202. </template>
  203. </template>
  204. </template>
  205. </div>
  206. </div>
  207. <div class="course-item__body clearfix">
  208. <div class="img">
  209. <img :src="$tools.splitImgHost(item.coverUrl, true)" alt="" />
  210. </div>
  211. <div class="text">
  212. <div class="title">
  213. {{ item.goodsName }}
  214. <div class="note">
  215. {{ item.courseNum }}课程 {{ item.secAllNum + item.examNum }}节
  216. {{ item.classHours }}学时
  217. </div>
  218. </div>
  219. <div class="progress">
  220. 学习进度
  221. <el-progress
  222. class="progress-line"
  223. :stroke-width="16"
  224. :format="progressText(item)"
  225. :percentage="
  226. ((item.stuAllNum + item.recordNum) /
  227. (item.secAllNum + item.examNum) || 0) * 100
  228. "
  229. ></el-progress>
  230. </div>
  231. </div>
  232. <div class="btns-wrap">
  233. <div class="btns">
  234. <el-button
  235. type="primary"
  236. class="btn btn--normal"
  237. :class="{
  238. disabled:
  239. (item.serviceStartTime &&
  240. (sysTime <= item.serviceStartTime ||
  241. sysTime >= item.serviceEndTime)) ||
  242. (item.classStartTime && sysTime <= item.classStartTime) ||
  243. (item.classEndTime && sysTime >= item.classEndTime) ||
  244. item.learningStatus == 2 ||
  245. item.classStatus == 0 ||
  246. (item.learningStatus == 3 &&
  247. sysTime < item.learningTimeStart),
  248. }"
  249. @click="goCourseDetail(item)"
  250. >进入学习</el-button
  251. >
  252. <el-button
  253. type="primary"
  254. class="btn"
  255. @click="appointment(item)"
  256. v-if="
  257. item.applyStatus === 1 &&
  258. !(
  259. sysTime <= item.serviceStartTime ||
  260. sysTime >= item.serviceEndTime ||
  261. (item.classStartTime && sysTime <= item.classStartTime) ||
  262. (item.classEndTime && sysTime >= item.classEndTime) ||
  263. item.learningStatus == 2 ||
  264. item.classStatus == 0 ||
  265. (item.learningStatus == 3 &&
  266. sysTime < item.learningTimeStart)
  267. )
  268. "
  269. >预约考试</el-button
  270. >
  271. <el-button
  272. type="danger"
  273. class="btn btn--warm"
  274. @click="selectClass(item)"
  275. v-if="
  276. item.gradeStatus == 1 &&
  277. item.status == 1 &&
  278. item.serviceEndTime > sysTime &&
  279. item.serviceStartTime < sysTime &&
  280. item.classEndTime &&
  281. item.classEndTime < sysTime &&
  282. (item.periodStatus == 0 || item.periodStatus == -1) &&
  283. item.studyCount > 0
  284. "
  285. >
  286. 选班重学
  287. </el-button>
  288. <el-button
  289. type="primary"
  290. class="btn"
  291. v-if="
  292. item.beforeStatus === 1 &&
  293. !(
  294. sysTime <= item.serviceStartTime ||
  295. sysTime >= item.serviceEndTime ||
  296. (item.classStartTime && sysTime <= item.classStartTime) ||
  297. (item.classEndTime && sysTime >= item.classEndTime) ||
  298. item.learningStatus == 2 ||
  299. item.classStatus == 0 ||
  300. (item.learningStatus == 3 &&
  301. sysTime < item.learningTimeStart)
  302. )
  303. "
  304. @click="appBeforeAddress(item)"
  305. >进入刷题</el-button
  306. >
  307. </div>
  308. </div>
  309. </div>
  310. <template
  311. v-if="
  312. !(
  313. sysTime < item.serviceStartTime || sysTime > item.serviceEndTime
  314. )
  315. "
  316. >
  317. <div
  318. class="course-item__footer"
  319. v-if="item.classEndTime && item.classEndTime < sysTime"
  320. >
  321. <span class="text"
  322. >班级有效期:{{
  323. $tools.timestampToTime(item.classStartTime, true, true)
  324. }}
  325. -
  326. {{
  327. $tools.timestampToTime(item.classEndTime, true, true)
  328. }}</span
  329. >
  330. <span class="text text--red"
  331. >班级状态:已过期,有疑问请联系020-87085982</span
  332. >
  333. </div>
  334. <div
  335. class="course-item__footer"
  336. v-else-if="item.classStartTime && item.classStartTime > sysTime"
  337. >
  338. <span class="text"
  339. >班级有效期:{{
  340. $tools.timestampToTime(item.classStartTime, true, true)
  341. }}
  342. -
  343. {{
  344. $tools.timestampToTime(item.classEndTime, true, true)
  345. }}</span
  346. >
  347. <span class="text"
  348. >班级状态:未到学习时间,有疑问请联系 020-87085982</span
  349. >
  350. </div>
  351. <template v-else>
  352. <div
  353. class="course-item__footer"
  354. v-if="
  355. item.gradeId != 0 &&
  356. item.gradeStatus == 1 &&
  357. item.classStatus != null
  358. "
  359. >
  360. <span class="text"
  361. >班级状态:
  362. {{
  363. item.classStatus == 1
  364. ? "已开班"
  365. : item.classStatus == 0
  366. ? "未开班"
  367. : ""
  368. }}
  369. </span>
  370. <span class="text"
  371. >班级有效期:{{
  372. $tools.timestampToTime(item.classStartTime, true, true)
  373. }}-{{
  374. $tools.timestampToTime(item.classEndTime, true, true)
  375. }}</span
  376. >
  377. </div>
  378. <div class="course-item__footer" v-if="item.classStatus == 0">
  379. <span class="text">教务处正在为您开通班级,请耐心等待</span>
  380. </div>
  381. </template>
  382. </template>
  383. </div>
  384. </div>
  385. <div class="pagination">
  386. <el-pagination
  387. @current-change="currentChange"
  388. background
  389. layout="prev, pager, next"
  390. :total="total"
  391. :pager-count="5"
  392. :page-size="param.pageSize"
  393. >
  394. </el-pagination>
  395. </div>
  396. </div>
  397. <el-dialog
  398. title="实名验证确认"
  399. :visible.sync="showConfirm"
  400. width="600px"
  401. class="showconfirm"
  402. :close-on-click-modal="false"
  403. :close-on-press-escape="false"
  404. :show-close="false"
  405. >
  406. <div class="showconfirm__content">
  407. <div class="text">
  408. 为避免个人信息不正确导致您的学习时长无效,请认真核对以下信息是否正确,如信息有误请取消当前操作,立刻联系020-38946666
  409. </div>
  410. <el-descriptions :column="1">
  411. <el-descriptions-item label="姓名">{{
  412. userInfo && userInfo.realname
  413. }}</el-descriptions-item>
  414. <el-descriptions-item label="手机号">{{
  415. userInfo && userInfo.telphone
  416. }}</el-descriptions-item>
  417. <el-descriptions-item label="身份证号">{{
  418. userInfo && userInfo.idCard
  419. }}</el-descriptions-item>
  420. </el-descriptions>
  421. <div class="">
  422. <el-checkbox v-model="confirmChecked">确认个人信息无误</el-checkbox>
  423. </div>
  424. </div>
  425. <span slot="footer" class="dialog-footer">
  426. <el-button @click="showConfirm = false">取 消</el-button>
  427. <el-button
  428. type="primary"
  429. @click="confirmUser"
  430. :disabled="confirmCount > 0"
  431. :loading="confirmLoading"
  432. >{{
  433. confirmCount > 0 ? "确 定(" + confirmCount + ")" : "确 定"
  434. }}</el-button
  435. >
  436. </span>
  437. </el-dialog>
  438. <el-dialog
  439. title="预约考试"
  440. :visible.sync="appointModal"
  441. width="600px"
  442. class="appoint-modal"
  443. :close-on-click-modal="false"
  444. :close-on-press-escape="false"
  445. >
  446. <div class="appoint-modal__content">
  447. <el-radio
  448. v-for="(appointChild, appointIndex) in appointItem.examApplyGoodsList"
  449. v-model="applyId"
  450. :key="appointIndex"
  451. :label="appointChild.applyId"
  452. >{{ appointChild.applyName }}</el-radio
  453. >
  454. </div>
  455. <span slot="footer" class="dialog-footer">
  456. <el-button @click="appointModal = false">取 消</el-button>
  457. <el-button type="primary" @click="confirmAppoint">立即预约</el-button>
  458. </span>
  459. </el-dialog>
  460. <SelectClassModal
  461. ref="selectClassModal"
  462. @selectClassOk="selectClassOk"
  463. ></SelectClassModal>
  464. <RebuildModal
  465. ref="rebuildModal"
  466. @rebuildSubmit="rebuildSubmit($event)"
  467. ></RebuildModal>
  468. <ExercisesModal ref="exercisesModal"></ExercisesModal>
  469. </div>
  470. </template>
  471. <script>
  472. import { mapGetters, mapActions } from "vuex";
  473. import SelectClassModal from "@/components/selectClassModal";
  474. import RebuildModal from "@/components/rebuildModal";
  475. import ExercisesModal from "@/components/exercisesModal";
  476. import * as baseUrls from "@/axios.js";
  477. export default {
  478. name: "MyCourse",
  479. components: {
  480. SelectClassModal,
  481. RebuildModal,
  482. ExercisesModal,
  483. },
  484. data() {
  485. return {
  486. appointItem: {},
  487. applyId: "",
  488. appointModal: false,
  489. activeItem: {},
  490. confirmChecked: false,
  491. confirmTimer: null,
  492. confirmLoading: false,
  493. confirmCount: 10,
  494. showConfirm: false,
  495. tabList: [],
  496. sysTime: 0,
  497. activeName: "-1",
  498. param: {
  499. pageNum: 1,
  500. pageSize: 10,
  501. },
  502. total: 0,
  503. courseList: [],
  504. loading: null,
  505. showExercisesModal: false,
  506. };
  507. },
  508. computed: {
  509. ...mapGetters(["userInfo"]),
  510. },
  511. async mounted() {
  512. this.getUserInfo();
  513. this.sysTime = this.$tools.timest();
  514. await this.orderUserEduList();
  515. this.courseGoodsList();
  516. },
  517. methods: {
  518. ...mapActions(["getUserInfo"]),
  519. tabChange(e) {
  520. if (this.activeName == e.name) {
  521. return;
  522. }
  523. this.activeName = e.name;
  524. this.courseGoodsList();
  525. },
  526. confirmUser() {
  527. if (!this.confirmChecked) {
  528. this.$message.warning("请勾选确认个人信息无误");
  529. return;
  530. }
  531. this.confirmLoading = true;
  532. let infoJson = {
  533. realname: this.userInfo.realname,
  534. idCard: this.userInfo.idCard,
  535. telphone: this.userInfo.telphone,
  536. };
  537. this.$request
  538. .userConfirminfo({
  539. infoJson: JSON.stringify(infoJson),
  540. orderGoodsId: this.activeItem.orderGoodsId,
  541. })
  542. .then((res) => {
  543. if (res.data.pushInfo) {
  544. this.$message.success("提交成功");
  545. } else {
  546. this.$confirm(
  547. "开通信息推送不成功,无法进入学习,请联系020-87085982!",
  548. "提示",
  549. {
  550. confirmButtonText: "确定",
  551. closeOnClickModal: false,
  552. closeOnPressEscape: false,
  553. distinguishCancelAndClose: false,
  554. showClose: false,
  555. showCancelButton: false,
  556. }
  557. )
  558. .then((_) => {})
  559. .catch((_) => {});
  560. }
  561. this.showConfirm = false;
  562. this.confirmLoading = false;
  563. });
  564. },
  565. orderUserEduList() {
  566. return new Promise((resolve) => {
  567. this.$request
  568. .orderUserEduList({
  569. goodsType: 1,
  570. })
  571. .then((res) => {
  572. res.rows.forEach((row) => {
  573. row.id = row.id + "";
  574. });
  575. this.tabList.push(
  576. {
  577. educationName: "全部课程",
  578. id: "-1",
  579. },
  580. ...res.rows
  581. );
  582. resolve();
  583. });
  584. });
  585. },
  586. currentChange(e) {
  587. this.param.pageNum = e;
  588. this.courseGoodsList();
  589. },
  590. async goCourseDetail(item) {
  591. this.activeItem = item;
  592. if (item.interfaceAccountId > 0) {
  593. //学习账号已开通
  594. if (item.learnStatus == 1) {
  595. //跳转第三方h5
  596. this.$router.push({
  597. path: `/my-course-detail/${item.goodsId}`,
  598. query: {
  599. gradeId: item.gradeId,
  600. orderGoodsId: item.orderGoodsId,
  601. isOther: 1,
  602. },
  603. });
  604. return;
  605. } else {
  606. this.$message({
  607. type: "warning",
  608. message:
  609. "您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!",
  610. });
  611. return;
  612. }
  613. }
  614. if (
  615. (item.serviceStartTime && this.sysTime <= item.serviceStartTime) ||
  616. (item.serviceEndTime && this.sysTime >= item.serviceEndTime)
  617. ) {
  618. this.$message({
  619. type: "warning",
  620. message: "不在学习服务期,不能进入学习",
  621. });
  622. return;
  623. }
  624. if (
  625. (item.classStartTime && this.sysTime <= item.classStartTime) ||
  626. (item.classEndTime && this.sysTime >= item.classEndTime)
  627. ) {
  628. this.$message({
  629. type: "warning",
  630. message: "不在班级有效期,不能进入学习",
  631. });
  632. return;
  633. }
  634. if (item.learningStatus == 2) {
  635. this.$message({
  636. type: "warning",
  637. message: "开放学习时间待定,不能进入学习",
  638. });
  639. return;
  640. }
  641. if (item.classStatus == 0) {
  642. this.$message({
  643. type: "warning",
  644. message: "尚未开班,不能进入学习",
  645. });
  646. return;
  647. }
  648. if (item.learningStatus == 3 && this.sysTime < item.learningTimeStart) {
  649. this.$message({
  650. type: "warning",
  651. message: "不在开放学习时间,不能进入学习",
  652. });
  653. return;
  654. }
  655. var confirmDetail = true;
  656. if (item.educationName == "继续教育") {
  657. if (
  658. item.officialName &&
  659. item.businessName == "二级" &&
  660. item.projectName == "建造师"
  661. ) {
  662. confirmDetail = await this.userConfirmInfoDetail();
  663. }
  664. }
  665. // //内部系统
  666. // if (item.interfacePushId > 0 && item.officialStatus != 1) {
  667. // this.$message({
  668. // type: "warning",
  669. // message: "机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!",
  670. // });
  671. // return;
  672. // }
  673. if (!confirmDetail) {
  674. return;
  675. }
  676. let rebuildStatus = await this.courseGoodsRebuildStatus(
  677. item.goodsId,
  678. item.gradeId
  679. );
  680. if (rebuildStatus == 0) {
  681. this.$refs.rebuildModal.showModal(item);
  682. return;
  683. }
  684. // if (item.educationName == "继续教育") {
  685. this.$request
  686. .lockLockStatus({
  687. action: "jxjy",
  688. uuid: sessionStorage.getItem("uuid"),
  689. })
  690. .then((res) => {
  691. //有其他端在操作,不能学习
  692. this.$message({
  693. type: "warning",
  694. message: res.msg,
  695. });
  696. })
  697. .catch((err) => {
  698. //可以学习
  699. this.$request
  700. .courseCourseList({
  701. pageNum: 1,
  702. pageSize: 1,
  703. goodsId: item.goodsId,
  704. gradeId: item.gradeId,
  705. })
  706. .then((res) => {
  707. if (res.rows.length) {
  708. // if (
  709. // item.officialName &&
  710. // item.businessName == "二级" &&
  711. // item.projectName == "建造师"
  712. // ) {
  713. // this.userConfirmInfoDetail().then((res) => {
  714. // this.$router.push({
  715. // path: `/my-course-detail/${item.goodsId}`,
  716. // query: {
  717. // gradeId: item.gradeId,
  718. // orderGoodsId: item.orderGoodsId,
  719. // courseId: res.rows[0].courseId || "",
  720. // },
  721. // });
  722. // });
  723. // } else {
  724. this.$router.push({
  725. path: `/my-course-detail/${item.goodsId}`,
  726. query: {
  727. gradeId: item.gradeId,
  728. orderGoodsId: item.orderGoodsId,
  729. courseId: res.rows[0].courseId || "",
  730. },
  731. });
  732. // }
  733. } else {
  734. this.$message({
  735. type: "warning",
  736. message: "课程内暂无可以学习的科目",
  737. });
  738. }
  739. });
  740. });
  741. // } else {
  742. // this.$request
  743. // .courseCourseList({
  744. // pageNum: 1,
  745. // pageSize: 1,
  746. // goodsId: item.goodsId,
  747. // gradeId: item.gradeId,
  748. // })
  749. // .then((res) => {
  750. // if (res.rows.length) {
  751. // this.$router.push({
  752. // path: `/my-course-detail/${item.goodsId}`,
  753. // query: {
  754. // gradeId: item.gradeId,
  755. // orderGoodsId: item.orderGoodsId,
  756. // courseId: res.rows[0].courseId || "",
  757. // },
  758. // });
  759. // } else {
  760. // this.$message({
  761. // type: "warning",
  762. // message: "课程内暂无可以学习的科目",
  763. // });
  764. // }
  765. // });
  766. // }
  767. },
  768. userConfirmInfoDetail() {
  769. return new Promise((resolve) => {
  770. this.$request
  771. .userConfirmInfoDetail({
  772. orderGoodsId: this.activeItem.orderGoodsId,
  773. })
  774. .then((res) => {
  775. if (!res.data) {
  776. clearInterval(this.confirmTimer);
  777. this.confirmCount = 10;
  778. this.showConfirm = true;
  779. this.confirmTimer = setInterval(() => {
  780. if (this.confirmCount > 0) {
  781. this.confirmCount--;
  782. } else {
  783. clearInterval(this.confirmTimer);
  784. }
  785. }, 1000);
  786. } else {
  787. if (res.data.pushInfo) {
  788. resolve(true);
  789. } else {
  790. this.$confirm(
  791. "开通信息推送不成功,无法进入学习,请联系020-87085982!",
  792. "提示",
  793. {
  794. confirmButtonText: "确定",
  795. closeOnClickModal: false,
  796. closeOnPressEscape: false,
  797. distinguishCancelAndClose: false,
  798. showClose: false,
  799. showCancelButton: false,
  800. }
  801. )
  802. .then((_) => {})
  803. .catch((_) => {});
  804. resolve(false);
  805. }
  806. }
  807. });
  808. });
  809. },
  810. appBeforeAddress(item) {
  811. this.$refs.exercisesModal.showModal(item);
  812. },
  813. rebuildSubmit(item) {
  814. this.$router.push({
  815. path: `/my-course-detail/${item.goodsId}`,
  816. query: {
  817. gradeId: item.gradeId,
  818. orderGoodsId: item.orderGoodsId,
  819. rebuild: 1,
  820. },
  821. });
  822. },
  823. selectClass(item) {
  824. this.$refs.selectClassModal.showModal(item);
  825. },
  826. selectClassOk() {
  827. this.courseGoodsList();
  828. },
  829. /**
  830. * @param {Object} goodsId 商品id
  831. * 查询商品重修状态
  832. */
  833. courseGoodsRebuildStatus(goodsId, gradeId) {
  834. return new Promise((resolve) => {
  835. this.$request
  836. .courseGoodsRebuildStatus({
  837. goodsId: goodsId,
  838. gradeId: gradeId,
  839. })
  840. .then((res) => {
  841. resolve(res.data);
  842. });
  843. });
  844. },
  845. courseGoodsList() {
  846. let param = JSON.parse(JSON.stringify(this.param));
  847. if (this.activeName == "-1") {
  848. param.educationTypeId = "";
  849. } else {
  850. param.educationTypeId = this.activeName;
  851. }
  852. this.$request.courseGoodsList(param).then((res) => {
  853. this.courseList = res.rows;
  854. this.total = res.total;
  855. });
  856. },
  857. progressText(item) {
  858. return () => {
  859. return (
  860. item.stuAllNum +
  861. item.recordNum +
  862. "/" +
  863. (item.secAllNum + item.examNum)
  864. );
  865. };
  866. },
  867. appointment(item) {
  868. this.applyId = "";
  869. this.appointItem = item;
  870. this.appointModal = true;
  871. },
  872. confirmAppoint() {
  873. if (!this.applyId) {
  874. this.$message.warning("请选择要预约的考试");
  875. return;
  876. }
  877. var data = {
  878. goodsId: this.appointItem.goodsId,
  879. gradeId: this.appointItem.gradeId,
  880. applyId: this.applyId,
  881. orderGoodsId: this.appointItem.orderGoodsId,
  882. };
  883. this.$request
  884. .getApplysubscribe(data)
  885. .then((res) => {
  886. this.$router.push({
  887. path: "/person-center/my-classhour/appointment",
  888. query: {
  889. goodsId: this.appointItem.goodsId,
  890. gradeId: this.appointItem.gradeId,
  891. orderGoodsId: this.appointItem.orderGoodsId,
  892. applyId: this.applyId,
  893. },
  894. });
  895. })
  896. .catch((err) => {
  897. this.$message({
  898. type: "warning",
  899. message: err.msg,
  900. });
  901. });
  902. },
  903. },
  904. };
  905. </script>
  906. <!-- Add "scoped" attribute to limit CSS to this component only -->
  907. <style scoped lang="scss">
  908. .my-course {
  909. &__header {
  910. /deep/ .el-tabs__header {
  911. margin-bottom: 0;
  912. }
  913. }
  914. &__body {
  915. .list {
  916. .course-item {
  917. margin-top: 24px;
  918. background: #fafbfc;
  919. border-radius: 8px;
  920. overflow: hidden;
  921. &__header {
  922. height: 40px;
  923. border-bottom: 1px solid #eee;
  924. padding: 0 18px;
  925. .state {
  926. margin-top: 8px;
  927. float: left;
  928. font-size: 14px;
  929. font-family: Microsoft YaHei;
  930. font-weight: 400;
  931. color: #666666;
  932. .red {
  933. color: #ff3b30;
  934. }
  935. .note {
  936. vertical-align: middle;
  937. display: inline-block;
  938. padding: 0 10px;
  939. height: 24px;
  940. background: #ffeceb;
  941. border: 1px solid #ff3b30;
  942. border-radius: 12px;
  943. font-size: 14px;
  944. font-family: Microsoft YaHei;
  945. font-weight: 400;
  946. color: #ff3b30;
  947. text-align: center;
  948. line-height: 24px;
  949. margin-right: 10px;
  950. &--yellow {
  951. border-color: #ffb001;
  952. color: #ffb001;
  953. background: #fff8e8;
  954. }
  955. &--green {
  956. border-color: #56dc68;
  957. color: #56dc68;
  958. background: #e6feea;
  959. }
  960. }
  961. }
  962. .time {
  963. float: right;
  964. line-height: 40px;
  965. text-align: right;
  966. font-size: 12px;
  967. font-family: Microsoft YaHei;
  968. font-weight: 400;
  969. color: #666666;
  970. &--red {
  971. color: #ff3b30;
  972. }
  973. }
  974. }
  975. &__body {
  976. .img {
  977. float: left;
  978. width: 160px;
  979. height: 90px;
  980. img {
  981. max-width: 100%;
  982. max-height: 100%;
  983. }
  984. }
  985. .text {
  986. float: left;
  987. margin-left: 12px;
  988. .title {
  989. margin-top: 10px;
  990. font-size: 16px;
  991. font-family: Microsoft YaHei;
  992. font-weight: bold;
  993. color: #333333;
  994. .note {
  995. display: inline-block;
  996. vertical-align: middle;
  997. border: 1px solid #333333;
  998. border-radius: 4px;
  999. font-size: 12px;
  1000. font-family: Microsoft YaHei;
  1001. font-weight: 400;
  1002. color: #333333;
  1003. padding: 2px 5px;
  1004. margin-left: 12px;
  1005. }
  1006. }
  1007. .progress {
  1008. margin-top: 30px;
  1009. font-size: 14px;
  1010. font-family: Microsoft YaHei;
  1011. font-weight: 400;
  1012. color: #333333;
  1013. &-line {
  1014. width: 220px;
  1015. display: inline-block;
  1016. }
  1017. /deep/ .el-progress-bar {
  1018. padding-right: 70px;
  1019. margin-right: -70px;
  1020. }
  1021. }
  1022. }
  1023. .btns-wrap {
  1024. display: table;
  1025. float: right;
  1026. height: 90px;
  1027. width: 130px;
  1028. .btns {
  1029. display: table-cell;
  1030. vertical-align: middle;
  1031. text-align: center;
  1032. .btn {
  1033. cursor: pointer;
  1034. margin: 2px 0;
  1035. width: 122px;
  1036. height: 32px;
  1037. padding: 0;
  1038. border-radius: 16px;
  1039. display: inline-block;
  1040. text-align: center;
  1041. line-height: 32px;
  1042. color: #fff;
  1043. &--normal {
  1044. &.disabled {
  1045. background: rgb(101, 164, 253);
  1046. border-color: rgb(101, 164, 253);
  1047. }
  1048. }
  1049. &--warm {
  1050. background: #ff3b30;
  1051. &:hover {
  1052. background: #f56c6c;
  1053. }
  1054. }
  1055. }
  1056. }
  1057. }
  1058. }
  1059. &__footer {
  1060. padding: 20px 18px;
  1061. font-size: 14px;
  1062. color: #333;
  1063. .text {
  1064. margin-right: 20px;
  1065. &--red {
  1066. color: #ff3b30;
  1067. }
  1068. }
  1069. }
  1070. }
  1071. }
  1072. .pagination {
  1073. padding: 30px 0;
  1074. text-align: center;
  1075. }
  1076. }
  1077. .exercises-modal {
  1078. &__content {
  1079. > div {
  1080. font-size: 16px;
  1081. line-height: 30px;
  1082. text-align: center;
  1083. img {
  1084. display: inline;
  1085. }
  1086. }
  1087. }
  1088. }
  1089. .appoint-modal {
  1090. &__content {
  1091. .el-radio {
  1092. display: block;
  1093. margin: 10px 30px 10px 0;
  1094. }
  1095. }
  1096. }
  1097. }
  1098. </style>