index.vue 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018
  1. <template>
  2. <div class="my-course">
  3. <div>
  4. <h4 class="headerTitle">
  5. <span v-if="goodsData.subjectNames" style="font-size: 20px"
  6. >【{{ goodsData.subjectNames }}】</span
  7. >{{ goodsData.goodsName
  8. }}<el-button
  9. size="mini"
  10. type="primary"
  11. plain
  12. icon="el-icon-sort"
  13. style="margin-left: 14px"
  14. @click="changeCourse"
  15. >切换科目</el-button
  16. >
  17. </h4>
  18. <div v-for="(item, index) in courseList" :key="index">
  19. <p class="firstTop" @click="changeStatus(item)">
  20. <span class="iconStyle">课</span
  21. ><span class="titles">{{ item.courseName }}</span
  22. ><span class="showHide"
  23. ><span v-if="item.showStatus">收起∧</span
  24. ><span v-else>展开∨</span></span
  25. >
  26. </p>
  27. <div
  28. v-if="item.children && item.children.length > 0 && item.showStatus"
  29. >
  30. <template v-for="(items, indexs) in item.children">
  31. <div v-if="items.type === 1" :key="indexs">
  32. <p
  33. class="moduleStyle"
  34. @click="changeModuleStatus(items, index, indexs)"
  35. >
  36. {{ items.menuName }}
  37. <span class="showHide"
  38. ><i v-if="items.showStatus" class="el-icon-arrow-up"></i>
  39. <i v-else class="el-icon-arrow-down"></i
  40. ></span>
  41. </p>
  42. <template
  43. v-if="
  44. items.showStatus &&
  45. items.children &&
  46. items.children.length > 0
  47. "
  48. >
  49. <div
  50. v-for="(i, k) in items.children"
  51. :key="k"
  52. style="padding-left: 20px"
  53. >
  54. <div
  55. class="chapterStyle"
  56. @click="changeChapterStatus(2, i, index, indexs, k)"
  57. >
  58. <span class="iconStyle">章</span>
  59. {{ i.name }}
  60. <span class="showHide"
  61. ><i v-if="i.showStatus" class="el-icon-arrow-up"></i>
  62. <i v-else class="el-icon-arrow-down"></i
  63. ></span>
  64. </div>
  65. <template v-if="i.showStatus && i.children.length > 0">
  66. <div
  67. v-for="(is, ks) in i.children"
  68. class="sectionStyle"
  69. :key="ks"
  70. style="padding-left: 20px"
  71. >
  72. <el-row style="display: flex; align-items: center">
  73. <el-col :span="12">
  74. <span class="iconStyles">•</span>
  75. {{ is.name }}
  76. <span v-if="is.recordStatus" class="upStudyStyle"
  77. >上次学到</span
  78. >
  79. </el-col>
  80. <el-col :span="4">
  81. <span v-show="is.teacherName"
  82. >已选讲师:{{ is.teacherName }}</span
  83. >
  84. </el-col>
  85. <el-col :span="3">
  86. <el-progress
  87. v-if="is.studyDuration && is.durationTime"
  88. :show-text="false"
  89. :percentage="
  90. (is.studyDuration / is.durationTime) * 100
  91. "
  92. ></el-progress>
  93. </el-col>
  94. <el-col :span="2">
  95. <span v-show="is.studyDuration">
  96. {{
  97. $tools.secondToDate(is.studyDuration) +
  98. "/" +
  99. $tools.secondToDate(is.durationTime)
  100. }}
  101. </span>
  102. </el-col>
  103. <el-col :span="2" :offset="1">
  104. <el-button
  105. size="mini"
  106. type="text"
  107. v-if="
  108. is.studyDuration > 0 &&
  109. is.durationTime > 0 &&
  110. is.studyDuration == is.durationTime
  111. "
  112. @click="studyFunc(item, is)"
  113. >再次学习</el-button
  114. >
  115. <el-button
  116. type="primary"
  117. size="mini"
  118. v-else-if="
  119. is.studyDuration > 0 &&
  120. is.durationTime > 0 &&
  121. is.studyDuration != is.durationTime
  122. "
  123. @click="studyFunc(item, is)"
  124. >继续学习</el-button
  125. >
  126. <el-button
  127. size="mini"
  128. type="primary"
  129. plain
  130. v-else-if="
  131. is.studyDuration == 0 && is.durationTime > 0
  132. "
  133. @click="studyFunc(item, is)"
  134. >未开始</el-button
  135. >
  136. </el-col>
  137. </el-row>
  138. </div>
  139. </template>
  140. </div>
  141. </template>
  142. </div>
  143. <div v-if="items.type === 2" :key="indexs">
  144. <div
  145. class="chapterStyle"
  146. @click="changeChapterStatus(1, items, index, indexs)"
  147. >
  148. <span class="iconStyle">章</span>
  149. {{ items.menuName }}
  150. <span class="showHide"
  151. ><i v-if="items.showStatus" class="el-icon-arrow-up"></i>
  152. <i v-else class="el-icon-arrow-down"></i
  153. ></span>
  154. </div>
  155. <template v-if="items.showStatus && items.children.length > 0">
  156. <div
  157. v-for="(i, k) in items.children"
  158. class="sectionStyle"
  159. :key="k"
  160. style="padding-left: 20px"
  161. >
  162. <el-row style="display: flex; align-items: center">
  163. <el-col :span="12">
  164. <span class="iconStyles">•</span>
  165. {{ i.name }}
  166. <span v-if="i.recordStatus" class="upStudyStyle"
  167. >上次学到</span
  168. >
  169. </el-col>
  170. <el-col :span="4">
  171. <span v-show="i.teacherName"
  172. >已选讲师:{{ i.teacherName }}</span
  173. >
  174. </el-col>
  175. <el-col :span="3">
  176. <el-progress
  177. v-if="i.studyDuration && i.durationTime"
  178. :show-text="false"
  179. :percentage="(i.studyDuration / i.durationTime) * 100"
  180. ></el-progress>
  181. </el-col>
  182. <el-col :span="2">
  183. <span v-show="i.studyDuration">
  184. {{
  185. $tools.secondToDate(i.studyDuration) +
  186. "/" +
  187. $tools.secondToDate(i.durationTime)
  188. }}
  189. </span>
  190. </el-col>
  191. <el-col :span="2" :offset="1">
  192. <el-button
  193. size="mini"
  194. type="text"
  195. v-if="
  196. i.studyDuration > 0 &&
  197. i.durationTime > 0 &&
  198. i.studyDuration == i.durationTime
  199. "
  200. @click="studyFunc(item, i)"
  201. >再次学习</el-button
  202. >
  203. <el-button
  204. type="primary"
  205. size="mini"
  206. v-else-if="
  207. i.studyDuration > 0 &&
  208. i.durationTime > 0 &&
  209. i.studyDuration != i.durationTime
  210. "
  211. @click="studyFunc(item, i)"
  212. >继续学习</el-button
  213. >
  214. <el-button
  215. size="mini"
  216. plain
  217. type="primary"
  218. v-else-if="i.studyDuration == 0 && i.durationTime > 0"
  219. @click="studyFunc(item, i)"
  220. >未开始</el-button
  221. >
  222. </el-col>
  223. </el-row>
  224. </div>
  225. </template>
  226. </div>
  227. <div v-if="items.type === 3" :key="indexs" class="sectionStyle">
  228. <el-row style="display: flex; align-items: center">
  229. <el-col :span="12">
  230. <span class="iconStyles">•</span>
  231. {{ items.menuName }}
  232. <span v-if="items.recordStatus" class="upStudyStyle"
  233. >上次学到</span
  234. >
  235. </el-col>
  236. <el-col :span="4">
  237. <span v-show="items.teacherName"
  238. >已选讲师:{{ items.teacherName }}</span
  239. >
  240. </el-col>
  241. <el-col :span="3">
  242. <el-progress
  243. v-if="items.studyDuration && items.durationTime"
  244. :show-text="false"
  245. :percentage="
  246. (items.studyDuration / items.durationTime) * 100
  247. "
  248. ></el-progress>
  249. </el-col>
  250. <el-col :span="2">
  251. <span v-show="items.studyDuration">
  252. {{
  253. $tools.secondToDate(items.studyDuration) +
  254. "/" +
  255. $tools.secondToDate(items.durationTime)
  256. }}
  257. </span>
  258. </el-col>
  259. <el-col :span="2" :offset="1">
  260. <el-button
  261. size="mini"
  262. type="text"
  263. v-if="
  264. items.studyDuration > 0 &&
  265. items.durationTime > 0 &&
  266. items.studyDuration == items.durationTime
  267. "
  268. @click="studyFunc(item, items)"
  269. >再次学习</el-button
  270. >
  271. <el-button
  272. type="primary"
  273. size="mini"
  274. v-else-if="
  275. items.studyDuration > 0 &&
  276. items.durationTime > 0 &&
  277. items.studyDuration != items.durationTime
  278. "
  279. @click="studyFunc(item, items)"
  280. >继续学习</el-button
  281. >
  282. <el-button
  283. plain
  284. size="mini"
  285. type="primary"
  286. v-else-if="
  287. items.studyDuration == 0 && items.durationTime > 0
  288. "
  289. @click="studyFunc(item, items)"
  290. >未开始</el-button
  291. >
  292. </el-col>
  293. </el-row>
  294. </div>
  295. </template>
  296. </div>
  297. </div>
  298. </div>
  299. <courseData ref="courseData" @backData="backData" />
  300. <el-dialog
  301. title="实名验证确认"
  302. :visible.sync="showConfirm"
  303. width="600px"
  304. class="showconfirm"
  305. :close-on-click-modal="false"
  306. :close-on-press-escape="false"
  307. :show-close="false"
  308. >
  309. <div class="showconfirm__content">
  310. <div class="text">
  311. 为避免个人信息不正确导致您的学习时长无效,请认真核对以下信息是否正确,如信息有误请取消当前操作,立刻联系020-38946666
  312. </div>
  313. <el-descriptions :column="1">
  314. <el-descriptions-item label="姓名">{{
  315. userInfo && userInfo.realname
  316. }}</el-descriptions-item>
  317. <el-descriptions-item label="手机号">{{
  318. userInfo && userInfo.telphone
  319. }}</el-descriptions-item>
  320. <el-descriptions-item label="身份证号">{{
  321. userInfo && userInfo.idCard
  322. }}</el-descriptions-item>
  323. </el-descriptions>
  324. <div class="">
  325. <el-checkbox v-model="confirmChecked">确认个人信息无误</el-checkbox>
  326. </div>
  327. </div>
  328. <span slot="footer" class="dialog-footer">
  329. <el-button @click="showConfirm = false">取 消</el-button>
  330. <el-button
  331. type="primary"
  332. @click="confirmUser"
  333. :disabled="confirmCount > 0"
  334. :loading="confirmLoading"
  335. >{{
  336. confirmCount > 0 ? "确 定(" + confirmCount + ")" : "确 定"
  337. }}</el-button
  338. >
  339. </span>
  340. </el-dialog>
  341. <RebuildModal
  342. ref="rebuildModal"
  343. @rebuildSubmit="rebuildSubmit($event)"
  344. ></RebuildModal>
  345. </div>
  346. </template>
  347. <script>
  348. import { mapGetters, mapActions } from "vuex";
  349. import courseData from "./courseData.vue";
  350. import RebuildModal from "@/components/rebuildModal";
  351. export default {
  352. name: "MyCourse",
  353. components: { courseData, RebuildModal },
  354. data() {
  355. return {
  356. goodsData: {},
  357. courseList: [],
  358. sysTime: 0,
  359. showConfirm: false,
  360. confirmCount: 10,
  361. confirmChecked: false,
  362. confirmTimer: null,
  363. confirmLoading: false,
  364. };
  365. },
  366. computed: {
  367. ...mapGetters(["userInfo"]),
  368. },
  369. mounted() {
  370. this.getRecord();
  371. this.sysTime = this.$tools.timest();
  372. },
  373. methods: {
  374. comeStyle(courseItem, item) {
  375. this.$router.push({
  376. path: `/my-course-detail/${this.goodsData.goodsId}`,
  377. query: {
  378. gradeId: courseItem.gradeId,
  379. orderGoodsId: this.goodsData.orderGoodsId,
  380. courseId: courseItem.courseId,
  381. chapterId: item.chapterId,
  382. moduleId: item.moduleId,
  383. sectionId: item.sectionId || item.menuId,
  384. recordingUrl: item.recordingUrl,
  385. sectionType: item.sectionType,
  386. },
  387. });
  388. },
  389. changeCourse() {
  390. this.$refs.courseData.openBoxs(this.goodsData);
  391. },
  392. backData(item) {
  393. this.goodsData = item;
  394. this.getGoodsCourseList(item);
  395. },
  396. /**
  397. * 获取课程列表
  398. */
  399. getGoodsCourseList(item) {
  400. return new Promise((resolve, reject) => {
  401. this.$request
  402. .courseCourseList({
  403. goodsId: item.goodsId,
  404. gradeId: item.gradeId,
  405. })
  406. .then((res) => {
  407. res.rows.forEach((element) => {
  408. element.showStatus = false;
  409. element.children = [];
  410. });
  411. this.courseList = res.rows;
  412. resolve();
  413. // if (res.rows && res.rows.length > 0) {
  414. // this.getRecord(res.rows[0]);
  415. // }
  416. });
  417. });
  418. },
  419. getGoodsData(res) {
  420. return new Promise((resolve, reject) => {
  421. this.$request
  422. .courseGoodsList({ orderGoodsId: res.data.orderGoodsId })
  423. .then(async (result) => {
  424. if(result.rows.length == 0){
  425. this.resultCourseGoodsList()
  426. }else{
  427. let array = result.rows[0];
  428. array.orderGoodsId = res.data.orderGoodsId;
  429. this.goodsData = array;
  430. await this.getGoodsCourseList(array);
  431. resolve();
  432. }
  433. });
  434. });
  435. },
  436. /**
  437. * 获取学习记录
  438. */
  439. getRecord(item) {
  440. this.$request.studyrecordgetUserWatchLast().then(async (res) => {
  441. if (res.data && res.data.sectionId) {
  442. await this.getGoodsData(res);
  443. var stop = false;
  444. for (let i = 0; i < this.courseList.length; i++) {
  445. if (stop) {
  446. break;
  447. }
  448. if (this.courseList[i].courseId == res.data.courseId) {
  449. await this.changeStatus(this.courseList[i]);
  450. for (let k = 0; k < this.courseList[i].children.length; k++) {
  451. if (res.data.moduleId) {
  452. console.log(1);
  453. if (
  454. this.courseList[i].children[k].menuId == res.data.moduleId
  455. ) {
  456. await this.changeModuleStatus(
  457. this.courseList[i].children[k],
  458. i,
  459. k
  460. );
  461. for (
  462. let j = 0;
  463. j < this.courseList[i].children[k].children.length;
  464. j++
  465. ) {
  466. if (
  467. this.courseList[i].children[k].children[j].chapterId ==
  468. res.data.chapterId
  469. ) {
  470. await this.changeChapterStatus(
  471. 2,
  472. this.courseList[i].children[k].children[j],
  473. i,
  474. k,
  475. j
  476. );
  477. for (
  478. let m = 0;
  479. m <
  480. this.courseList[i].children[k].children[j].children
  481. .length;
  482. m++
  483. ) {
  484. if (
  485. this.courseList[i].children[k].children[j].children[
  486. m
  487. ].sectionId == res.data.sectionId
  488. ) {
  489. this.$set(
  490. this.courseList[i].children[k].children[j]
  491. .children[m],
  492. "recordStatus",
  493. true
  494. );
  495. stop = true;
  496. break;
  497. }
  498. }
  499. }
  500. }
  501. }
  502. } else if (res.data.chapterId) {
  503. console.log(2);
  504. if (
  505. this.courseList[i].children[k].menuId == res.data.chapterId
  506. ) {
  507. await this.changeChapterStatus(
  508. 1,
  509. this.courseList[i].children[k],
  510. i,
  511. k
  512. );
  513. for (
  514. let j = 0;
  515. j < this.courseList[i].children[k].children.length;
  516. j++
  517. ) {
  518. if (
  519. this.courseList[i].children[k].children[j].sectionId ==
  520. res.data.sectionId
  521. ) {
  522. this.$set(
  523. this.courseList[i].children[k].children[j],
  524. "recordStatus",
  525. true
  526. );
  527. stop = true;
  528. break;
  529. }
  530. }
  531. }
  532. } else {
  533. console.log(3);
  534. if (
  535. this.courseList[i].children[k].menuId == res.data.sectionId
  536. ) {
  537. this.$set(
  538. this.courseList[i].children[k],
  539. "recordStatus",
  540. true
  541. );
  542. stop = true;
  543. break;
  544. }
  545. }
  546. }
  547. }
  548. }
  549. } else {
  550. this.resultCourseGoodsList()
  551. }
  552. });
  553. },
  554. resultCourseGoodsList(){
  555. this.$request
  556. .courseGoodsList({ pageNum: 1, pageSize: 1 })
  557. .then((res) => {
  558. if (res.rows && res.rows.length > 0) {
  559. this.backData(res.rows[0]);
  560. }
  561. });
  562. },
  563. /**
  564. * 展开获取课程详情列表
  565. */
  566. changeStatus(item) {
  567. return new Promise((resolve, reject) => {
  568. console.log(item);
  569. if (item.children.length > 0) {
  570. item.showStatus = !item.showStatus;
  571. return;
  572. }
  573. this.$request
  574. .reMenuList({
  575. courseId: item.courseId,
  576. gradeId: item.gradeId,
  577. orderGoodsId: this.goodsData.orderGoodsId,
  578. })
  579. .then((res) => {
  580. res.rows.forEach((items) => {
  581. if (items.type != 3) {
  582. items.showStatus = false;
  583. items.children = [];
  584. }
  585. });
  586. for (let i = 0; i < this.courseList.length; i++) {
  587. if (this.courseList[i].courseId == item.courseId) {
  588. this.$set(this.courseList[i], "children", res.rows);
  589. this.$set(
  590. this.courseList[i],
  591. "showStatus",
  592. !this.courseList[i].showStatus
  593. );
  594. break;
  595. }
  596. }
  597. resolve();
  598. });
  599. });
  600. },
  601. /**
  602. * 模块详情列表
  603. */
  604. changeModuleStatus(item, index, indexs) {
  605. return new Promise((resolve, reject) => {
  606. if (item.children && item.children.length > 0) {
  607. item.showStatus = !item.showStatus;
  608. return;
  609. }
  610. this.$request
  611. .reChapterList({
  612. moduleId: item.menuId,
  613. gradeId: item.gradeId,
  614. courseId: item.courseId,
  615. })
  616. .then((res) => {
  617. res.data.forEach((items) => {
  618. items.children = [];
  619. items.showStatus = false;
  620. });
  621. this.$set(
  622. this.courseList[index].children[indexs],
  623. "children",
  624. res.data
  625. );
  626. item.showStatus = !item.showStatus;
  627. resolve();
  628. });
  629. });
  630. },
  631. /**
  632. * 章详情列表 type = 1 父级章 type = 2 父级模块
  633. */
  634. changeChapterStatus(type, item, courseIndex, index, indexs) {
  635. return new Promise((resolve, reject) => {
  636. console.log("rrr");
  637. if (item.children && item.children.length > 0) {
  638. item.showStatus = !item.showStatus;
  639. return;
  640. }
  641. this.$request
  642. .reSectionList({
  643. chapterId: type === 1 ? item.menuId : item.chapterId,
  644. gradeId: item.gradeId,
  645. courseId: item.courseId,
  646. moduleId: item.moduleId,
  647. orderGoodsId: this.goodsData.orderGoodsId,
  648. })
  649. .then((res) => {
  650. if (type === 1) {
  651. this.$set(
  652. this.courseList[courseIndex].children[index],
  653. "children",
  654. res.data
  655. );
  656. }
  657. if (type === 2) {
  658. this.$set(
  659. this.courseList[courseIndex].children[index].children[indexs],
  660. "children",
  661. res.data
  662. );
  663. }
  664. item.showStatus = !item.showStatus;
  665. resolve();
  666. });
  667. });
  668. },
  669. async studyFunc(courseItem, items) {
  670. this.sysTime = this.$tools.timest();
  671. let item = this.goodsData;
  672. if (item.interfaceAccountId > 0) {
  673. //学习账号已开通
  674. if (item.learnStatus == 1) {
  675. //跳转第三方h5
  676. this.$router.push({
  677. path: `/my-course-detail/${item.goodsId}`,
  678. query: {
  679. gradeId: item.gradeId,
  680. orderGoodsId: item.orderGoodsId,
  681. isOther: 1,
  682. },
  683. });
  684. return;
  685. } else {
  686. this.$message({
  687. type: "warning",
  688. message:
  689. "您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!",
  690. });
  691. return;
  692. }
  693. }
  694. if (
  695. (item.serviceStartTime && this.sysTime <= item.serviceStartTime) ||
  696. (item.serviceEndTime && this.sysTime >= item.serviceEndTime)
  697. ) {
  698. this.$message({
  699. type: "warning",
  700. message: "不在学习服务期,不能进入学习",
  701. });
  702. return;
  703. }
  704. if (
  705. (item.classStartTime && this.sysTime <= item.classStartTime) ||
  706. (item.classEndTime && this.sysTime >= item.classEndTime)
  707. ) {
  708. this.$message({
  709. type: "warning",
  710. message: "不在班级有效期,不能进入学习",
  711. });
  712. return;
  713. }
  714. if (item.learningStatus == 2) {
  715. this.$message({
  716. type: "warning",
  717. message: "开放学习时间待定,不能进入学习",
  718. });
  719. return;
  720. }
  721. if (item.classStatus == 0) {
  722. this.$message({
  723. type: "warning",
  724. message: "尚未开班,不能进入学习",
  725. });
  726. return;
  727. }
  728. if (item.learningStatus == 3 && this.sysTime < item.learningTimeStart) {
  729. this.$message({
  730. type: "warning",
  731. message: "不在开放学习时间,不能进入学习",
  732. });
  733. return;
  734. }
  735. var confirmDetail = true;
  736. if (item.educationName == "继续教育") {
  737. if (
  738. item.officialName &&
  739. item.businessName == "二级" &&
  740. item.projectName == "建造师"
  741. ) {
  742. confirmDetail = await this.userConfirmInfoDetail();
  743. }
  744. }
  745. // //内部系统
  746. // if (item.interfacePushId > 0 && item.officialStatus != 1) {
  747. // this.$message({
  748. // type: "warning",
  749. // message: "机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!",
  750. // });
  751. // return;
  752. // }
  753. if (!confirmDetail) {
  754. return;
  755. }
  756. let rebuildStatus = await this.courseGoodsRebuildStatus(
  757. item.goodsId,
  758. item.gradeId
  759. );
  760. if (rebuildStatus == 0) {
  761. this.$refs.rebuildModal.showModal(item);
  762. return;
  763. }
  764. // if (item.educationName == "继续教育") {
  765. this.$request
  766. .lockLockStatus({
  767. action: "jxjy",
  768. uuid: sessionStorage.getItem("uuid"),
  769. })
  770. .then((res) => {
  771. //有其他端在操作,不能学习
  772. this.$message({
  773. type: "warning",
  774. message: res.msg,
  775. });
  776. })
  777. .catch((err) => {
  778. //可以学习
  779. this.$request
  780. .courseCourseList({
  781. pageNum: 1,
  782. pageSize: 1,
  783. goodsId: item.goodsId,
  784. gradeId: item.gradeId,
  785. })
  786. .then((res) => {
  787. if (res.rows.length) {
  788. // this.$emit("backData", item);
  789. // this.dialogVisible = false;
  790. this.comeStyle(courseItem, items);
  791. // this.$router.push({
  792. // path: `/my-course-detail/${item.goodsId}`,
  793. // query: {
  794. // gradeId: item.gradeId,
  795. // orderGoodsId: item.orderGoodsId,
  796. // courseId: res.rows[0].courseId || "",
  797. // },
  798. // });
  799. // }
  800. } else {
  801. this.$message({
  802. type: "warning",
  803. message: "课程内暂无可以学习的科目",
  804. });
  805. }
  806. });
  807. });
  808. },
  809. userConfirmInfoDetail() {
  810. return new Promise((resolve) => {
  811. this.$request
  812. .userConfirmInfoDetail({
  813. orderGoodsId: this.goodsData.orderGoodsId,
  814. })
  815. .then((res) => {
  816. if (!res.data) {
  817. clearInterval(this.confirmTimer);
  818. this.confirmCount = 10;
  819. this.showConfirm = true;
  820. this.confirmTimer = setInterval(() => {
  821. if (this.confirmCount > 0) {
  822. this.confirmCount--;
  823. } else {
  824. clearInterval(this.confirmTimer);
  825. }
  826. }, 1000);
  827. } else {
  828. if (res.data.pushInfo) {
  829. resolve(true);
  830. } else {
  831. this.$confirm(
  832. "开通信息推送不成功,无法进入学习,请联系020-87085982!",
  833. "提示",
  834. {
  835. confirmButtonText: "确定",
  836. closeOnClickModal: false,
  837. closeOnPressEscape: false,
  838. distinguishCancelAndClose: false,
  839. showClose: false,
  840. showCancelButton: false,
  841. }
  842. )
  843. .then((_) => {})
  844. .catch((_) => {});
  845. resolve(false);
  846. }
  847. }
  848. });
  849. });
  850. },
  851. confirmUser() {
  852. if (!this.confirmChecked) {
  853. this.$message.warning("请勾选确认个人信息无误");
  854. return;
  855. }
  856. this.confirmLoading = true;
  857. let infoJson = {
  858. realname: this.userInfo.realname,
  859. idCard: this.userInfo.idCard,
  860. telphone: this.userInfo.telphone,
  861. };
  862. this.$request
  863. .userConfirminfo({
  864. infoJson: JSON.stringify(infoJson),
  865. orderGoodsId: this.goodsData.orderGoodsId,
  866. })
  867. .then((res) => {
  868. if (res.data.pushInfo) {
  869. this.$message.success("提交成功");
  870. } else {
  871. this.$confirm(
  872. "开通信息推送不成功,无法进入学习,请联系020-87085982!",
  873. "提示",
  874. {
  875. confirmButtonText: "确定",
  876. closeOnClickModal: false,
  877. closeOnPressEscape: false,
  878. distinguishCancelAndClose: false,
  879. showClose: false,
  880. showCancelButton: false,
  881. }
  882. )
  883. .then((_) => {})
  884. .catch((_) => {});
  885. }
  886. this.showConfirm = false;
  887. this.confirmLoading = false;
  888. });
  889. },
  890. /**
  891. * @param {Object} goodsId 商品id
  892. * 查询商品重修状态
  893. */
  894. courseGoodsRebuildStatus(goodsId, gradeId) {
  895. return new Promise((resolve) => {
  896. this.$request
  897. .courseGoodsRebuildStatus({
  898. goodsId: goodsId,
  899. gradeId: gradeId,
  900. })
  901. .then((res) => {
  902. resolve(res.data);
  903. });
  904. });
  905. },
  906. rebuildSubmit(item) {
  907. this.$router.push({
  908. path: `/my-course-detail/${item.goodsId}`,
  909. query: {
  910. gradeId: item.gradeId,
  911. orderGoodsId: item.orderGoodsId,
  912. rebuild: 1,
  913. },
  914. });
  915. },
  916. },
  917. };
  918. </script>
  919. <!-- Add "scoped" attribute to limit CSS to this component only -->
  920. <style scoped lang="scss">
  921. .headerTitle {
  922. color: #222;
  923. font-weight: bold;
  924. font-size: 24px;
  925. padding: 28px 0px;
  926. border-bottom: 1px solid #eee;
  927. }
  928. .firstTop {
  929. margin: 24px 0px;
  930. .iconStyle {
  931. background-color: #3f8dfd;
  932. color: #fff;
  933. margin-right: 8px;
  934. padding: 0px 4px;
  935. border-radius: 4px;
  936. font-size: 12px;
  937. vertical-align: text-top;
  938. }
  939. .titles {
  940. font-weight: bold;
  941. color: #333;
  942. font-size: 18px;
  943. }
  944. .showHide {
  945. cursor: pointer;
  946. user-select: none;
  947. float: right;
  948. color: #99a0a7;
  949. }
  950. }
  951. .moduleStyle {
  952. padding: 17px;
  953. background-color: #f8f8f9;
  954. font-weight: bold;
  955. color: #222;
  956. margin-bottom: 16px;
  957. .showHide {
  958. cursor: pointer;
  959. user-select: none;
  960. float: right;
  961. color: #99a0a7;
  962. }
  963. }
  964. .chapterStyle {
  965. font-weight: 400;
  966. .iconStyle {
  967. background-color: #fff;
  968. color: #3f8dfd;
  969. margin-right: 8px;
  970. padding: 0px 2px;
  971. border-radius: 2px;
  972. border: 1px solid #3f8dfd;
  973. font-size: 10px;
  974. vertical-align: text-top;
  975. }
  976. .showHide {
  977. cursor: pointer;
  978. user-select: none;
  979. float: right;
  980. color: #99a0a7;
  981. }
  982. margin-bottom: 16px;
  983. padding: 17px;
  984. border-bottom: 1px solid #eee;
  985. }
  986. .sectionStyle {
  987. color: #99a0a7;
  988. padding: 10px;
  989. .iconStyles {
  990. color: #99a0a7;
  991. margin-right: 8px;
  992. padding: 0px 2px;
  993. }
  994. }
  995. .upStudyStyle {
  996. background-color: #f2f7ff;
  997. border: 1px solid #3f8dfd;
  998. color: #3f8dfd;
  999. padding: 3px 4px;
  1000. border-radius: 4px;
  1001. }
  1002. </style>