courseData.vue 38 KB

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