index.vue 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351
  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. sysTime < item.serviceStartTime ||
  34. sysTime > item.serviceEndTime
  35. "
  36. >
  37. <div class="red">不在学习服务期,不可以学习了哦</div>
  38. </template>
  39. <template v-else>
  40. <template
  41. v-if="
  42. !(item.classEndTime && item.classEndTime < sysTime) &&
  43. !(item.classStartTime && item.classStartTime > sysTime)
  44. "
  45. >
  46. <template v-if="item.periodStatus == -1">
  47. <template
  48. v-if="item.classStatus == 1 || item.classStatus === null"
  49. >
  50. <template
  51. v-if="
  52. sysTime >= item.serviceStartTime &&
  53. sysTime <= item.serviceEndTime
  54. "
  55. >
  56. 学习状态:
  57. <div class="note" v-if="item.stuAllNum == 0">
  58. 未学习
  59. </div>
  60. <div
  61. class="note note--yellow"
  62. v-else-if="
  63. item.stuAllNum > 0 &&
  64. item.stuAllNum < item.secAllNum
  65. "
  66. >
  67. 学习中
  68. </div>
  69. <div
  70. class="note note--green"
  71. v-else-if="item.stuAllNum >= item.secAllNum"
  72. >
  73. 已学完
  74. </div>
  75. </template>
  76. <template v-else>
  77. <span class="red">
  78. 已过学习服务期,不可以学习了哦!</span
  79. >
  80. </template>
  81. </template>
  82. <template v-if="item.profileTpStatus == 1">
  83. 资料审核状态:
  84. <div class="note" v-if="item.profileStatus == null">
  85. 未提交资料
  86. </div>
  87. <div
  88. class="note note--green"
  89. v-else-if="item.profileStatus == 1"
  90. >
  91. 已通过
  92. </div>
  93. <div
  94. class="note note--yellow"
  95. v-else-if="item.profileStatus == 2"
  96. >
  97. 审核中
  98. </div>
  99. <div
  100. class="note note--yellow"
  101. v-else-if="item.profileStatus == 3"
  102. >
  103. 待完善
  104. </div>
  105. </template>
  106. </template>
  107. <!-- 学时审核状态可以审核 -->
  108. <template v-if="item.periodStatus != -1">
  109. <template v-if="item.periodStatus == 0"
  110. >机构审核:
  111. <div class="note">学时审核不通过</div>
  112. </template>
  113. <template v-else-if="item.periodStatus == 2"
  114. >机构审核:
  115. <div class="note note--yellow">学时待审核</div></template
  116. >
  117. <template v-else-if="item.periodStatus == 1">
  118. <template v-if="item.periodPlush > 0"
  119. ><div class="note note--green">
  120. 学时已上报注册中心
  121. </div></template
  122. >
  123. <template v-else
  124. >机构审核:
  125. <div class="note note--green">
  126. 学时审核通过
  127. </div></template
  128. >
  129. </template>
  130. <template
  131. v-if="item.subscribeId != null && item.periodStatus == 1"
  132. >
  133. <template v-if="item.subExamStatus === null">
  134. 待预约考试
  135. </template>
  136. <template
  137. v-else-if="
  138. item.subExamStatus === 0 &&
  139. sysTime <
  140. $tools.TimeTotimestamp(
  141. $tools.timestampToTime(
  142. item.subApplySiteExamTime,
  143. true
  144. ) +
  145. ' ' +
  146. item.subApplySiteStartTime
  147. )
  148. "
  149. >
  150. 待考试,考试时间:{{
  151. $tools.timestampToTime(
  152. item.subApplySiteExamTime,
  153. true
  154. ) +
  155. " " +
  156. item.subApplySiteStartTime
  157. }}
  158. -
  159. {{
  160. $tools.timestampToTime(
  161. item.subApplySiteExamTime,
  162. true
  163. ) +
  164. " " +
  165. item.subApplySiteEndTime
  166. }}
  167. </template>
  168. <template v-else-if="item.subExamStatus === 0"
  169. >待出考试结果</template
  170. >
  171. <template v-else-if="item.subExamStatus === 1">
  172. <span v-if="item.subResult === null">待出考试结果</span>
  173. <span v-if="item.subResult === 0"
  174. >考试结果:不通过,需补考</span
  175. >
  176. <span v-else-if="item.subResult === 1"
  177. >考试结果:通过,考试成绩为{{
  178. item.subPerformance
  179. }}</span
  180. >
  181. </template>
  182. <template v-else-if="item.subExamStatus === 2">
  183. 缺考,无成绩,需补考
  184. </template>
  185. <template v-else-if="item.subExamStatus === 3">
  186. 作弊,无成绩,需补考
  187. </template>
  188. <template v-else-if="item.subExamStatus === 4">
  189. 替考,无成绩,需补考
  190. </template>
  191. </template>
  192. </template>
  193. </template>
  194. </template>
  195. </div>
  196. </div>
  197. <div class="course-item__body clearfix">
  198. <div class="img">
  199. <img :src="$tools.splitImgHost(item.coverUrl, true)" alt="" />
  200. </div>
  201. <div class="text">
  202. <div class="title">
  203. {{ item.goodsName }}
  204. <div class="note">
  205. {{ item.courseNum }}课程 {{ item.secAllNum + item.examNum }}节
  206. {{ item.classHours }}学时
  207. </div>
  208. </div>
  209. <div class="progress">
  210. 学习进度
  211. <el-progress
  212. class="progress-line"
  213. :stroke-width="16"
  214. :format="progressText(item)"
  215. :percentage="
  216. ((item.stuAllNum + item.recordNum) /
  217. (item.secAllNum + item.examNum) || 0) * 100
  218. "
  219. ></el-progress>
  220. </div>
  221. </div>
  222. <div class="btns-wrap">
  223. <div class="btns">
  224. <el-button
  225. type="primary"
  226. class="btn btn--normal"
  227. :class="{
  228. disabled:
  229. (item.interfacePushId > 0 && item.officialStatus != 1) ||
  230. sysTime <= item.serviceStartTime ||
  231. sysTime >= item.serviceEndTime ||
  232. (item.classStartTime && sysTime <= item.classStartTime) ||
  233. (item.classEndTime && sysTime >= item.classEndTime) ||
  234. item.learningStatus == 2 ||
  235. item.classStatus == 0 ||
  236. (item.learningStatus == 3 &&
  237. sysTime < item.learningTimeStart),
  238. }"
  239. @click="goCourseDetail(item)"
  240. >进入学习</el-button
  241. >
  242. <el-button
  243. type="primary"
  244. class="btn"
  245. @click="appointment(item)"
  246. v-if="
  247. item.applyStatus === 1 &&
  248. !(
  249. (item.interfacePushId > 0 && item.officialStatus != 1) ||
  250. sysTime <= item.serviceStartTime ||
  251. sysTime >= item.serviceEndTime ||
  252. (item.classStartTime && 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. "
  260. >预约考试</el-button
  261. >
  262. <el-button
  263. type="danger"
  264. class="btn btn--warm"
  265. @click="selectClass(item)"
  266. v-if="
  267. item.gradeStatus == 1 &&
  268. item.status == 1 &&
  269. item.serviceEndTime > sysTime &&
  270. item.serviceStartTime < sysTime &&
  271. item.classEndTime &&
  272. item.classEndTime < sysTime &&
  273. (item.periodStatus == 0 || item.periodStatus == -1) &&
  274. item.studyCount > 0
  275. "
  276. >
  277. 选班重学
  278. </el-button>
  279. <el-button
  280. type="primary"
  281. class="btn"
  282. v-if="
  283. item.beforeStatus === 1 &&
  284. !(
  285. (item.interfacePushId > 0 && item.officialStatus != 1) ||
  286. sysTime <= item.serviceStartTime ||
  287. sysTime >= item.serviceEndTime ||
  288. (item.classStartTime && sysTime <= item.classStartTime) ||
  289. (item.classEndTime && sysTime >= item.classEndTime) ||
  290. item.learningStatus == 2 ||
  291. item.classStatus == 0 ||
  292. (item.learningStatus == 3 &&
  293. sysTime < item.learningTimeStart)
  294. )
  295. "
  296. @click="appBeforeAddress(item)"
  297. >进入刷题</el-button
  298. >
  299. </div>
  300. </div>
  301. </div>
  302. <template
  303. v-if="
  304. !(
  305. sysTime < item.serviceStartTime || sysTime > item.serviceEndTime
  306. )
  307. "
  308. >
  309. <div
  310. class="course-item__footer"
  311. v-if="item.classEndTime && item.classEndTime < sysTime"
  312. >
  313. <span class="text"
  314. >班级有效期:{{
  315. $tools.timestampToTime(item.classStartTime, true, true)
  316. }}
  317. -
  318. {{
  319. $tools.timestampToTime(item.classEndTime, true, true)
  320. }}</span
  321. >
  322. <span class="text text--red"
  323. >班级状态:已过期,有疑问请联系020-87085982</span
  324. >
  325. </div>
  326. <div
  327. class="course-item__footer"
  328. v-else-if="item.classStartTime && item.classStartTime > sysTime"
  329. >
  330. <span class="text"
  331. >班级有效期:{{
  332. $tools.timestampToTime(item.classStartTime, true, true)
  333. }}
  334. -
  335. {{
  336. $tools.timestampToTime(item.classEndTime, true, true)
  337. }}</span
  338. >
  339. <span class="text"
  340. >班级状态:未到学习时间,有疑问请联系 020-87085982</span
  341. >
  342. </div>
  343. <template v-else>
  344. <div
  345. class="course-item__footer"
  346. v-if="
  347. item.gradeId != 0 &&
  348. item.gradeStatus == 1 &&
  349. item.classStatus != null
  350. "
  351. >
  352. <span class="text"
  353. >班级状态:
  354. {{
  355. item.classStatus == 1
  356. ? "已开班"
  357. : item.classStatus == 0
  358. ? "未开班"
  359. : ""
  360. }}
  361. </span>
  362. <span class="text"
  363. >班级有效期:{{
  364. $tools.timestampToTime(item.classStartTime, true, true)
  365. }}-{{
  366. $tools.timestampToTime(item.classEndTime, true, true)
  367. }}</span
  368. >
  369. </div>
  370. <div class="course-item__footer" v-if="item.classStatus == 0">
  371. <span class="text">教务处正在为您开通班级,请耐心等待</span>
  372. </div>
  373. </template>
  374. </template>
  375. </div>
  376. </div>
  377. <div class="pagination">
  378. <el-pagination
  379. @current-change="currentChange"
  380. background
  381. layout="prev, pager, next"
  382. :total="total"
  383. :pager-count="5"
  384. :page-size="param.pageSize"
  385. >
  386. </el-pagination>
  387. </div>
  388. </div>
  389. <el-dialog
  390. title="选班重学"
  391. class="select-modal"
  392. :visible.sync="selectClassModal"
  393. width="800px"
  394. >
  395. <div>
  396. <el-radio
  397. v-for="(item, index) in gradeList"
  398. :key="index"
  399. class="radio"
  400. v-model="gradeValue"
  401. :disabled="
  402. item.studentNum > 0 && item.studentNum == item.studentUpper
  403. "
  404. >
  405. <div>
  406. {{ item.className }}
  407. <span v-if="item.classEndTime">
  408. 有效期至:{{
  409. $tools.timestampToTime(item.classEndTime, true, true)
  410. }}</span
  411. >
  412. <span v-if="item.classEndTime"
  413. >本班还剩{{
  414. $tools.GetRTime(item.classEndTime)
  415. }}天将结束学习</span
  416. >
  417. </div>
  418. <div></div
  419. ></el-radio>
  420. </div>
  421. <span slot="footer" class="dialog-footer">
  422. <el-button type="primary" @click="selectClassOk">确 定</el-button>
  423. </span>
  424. </el-dialog>
  425. <el-dialog
  426. width="800px"
  427. class="rebuild"
  428. :visible.sync="showRebuildDetailModal"
  429. :close-on-click-modal="false"
  430. :close-on-press-escape="false"
  431. :show-close="false"
  432. >
  433. <div class="rebuild__content">
  434. <div class="rebuild__close" @click="showRebuildDetailModal = false">
  435. X
  436. </div>
  437. <div class="rebuild__header">审核详情</div>
  438. <div class="rebuild__body">
  439. <div class="content">
  440. <div class="content__header">
  441. <div class="title">重要提示:</div>
  442. <div class="desc">
  443. 您的学时审核不通过,不通过原因如下,请查阅,并重学不通过的课程内容。
  444. </div>
  445. </div>
  446. <div class="content__body">
  447. <div class="list">
  448. <div
  449. class="list__item"
  450. v-for="(item, index) in rebuildItems"
  451. :key="index"
  452. >
  453. <div class="title">
  454. <span class="note" v-if="item.type == 0"> 测试 </span>
  455. <span class="note note--yellow" v-if="item.type == 1"
  456. >录播</span
  457. >
  458. <span class="note note--yellow" v-if="item.type == 2"
  459. >直播</span
  460. >
  461. <span class="note note--yellow" v-if="item.type == 3"
  462. >回放</span
  463. >
  464. {{ index + 1 }}、{{ item.name }}
  465. </div>
  466. <div class="desc">
  467. <!-- <div class="imgs">
  468. <div
  469. class="img"
  470. v-for="(items, indexs) in item.userStudyRecordPhoto"
  471. :key="indexs"
  472. >
  473. <img :src="$tools.splitImgHost(items.photo)" />
  474. <div class="note">
  475. {{ $tools.timestampToTime(items.createTime, false) }}
  476. </div>
  477. </div>
  478. </div> -->
  479. </div>
  480. <div class="desc">
  481. 原因:
  482. <span class="note">{{ item.auditReason }}</span>
  483. </div>
  484. </div>
  485. </div>
  486. </div>
  487. </div>
  488. </div>
  489. <div class="rebuild__footer">
  490. <el-button class="confirm" @click="rebuildSubmit" type="primary"
  491. >确认已阅读</el-button
  492. >
  493. </div>
  494. </div>
  495. </el-dialog>
  496. <el-dialog
  497. title="提示"
  498. class="exercises-modal"
  499. :visible.sync="showExercisesModal"
  500. width="800px"
  501. >
  502. <div class="exercises-modal__content">
  503. <div>1.不支持网页端刷题</div>
  504. <div>2.请使用手机扫码,进入【祥粤云学堂】小程序环境,进行刷题</div>
  505. <div>
  506. <img src="@/assets/xcxqrcode.jpg" alt="" />
  507. </div>
  508. </div>
  509. <span slot="footer" class="dialog-footer">
  510. <el-button type="primary" @click="showExercisesModal = false"
  511. >确 定</el-button
  512. >
  513. </span>
  514. </el-dialog>
  515. </div>
  516. </template>
  517. <script>
  518. import { mapGetters } from "vuex";
  519. import * as baseUrls from "@/axios.js";
  520. export default {
  521. name: "MyCourse",
  522. data() {
  523. return {
  524. showRebuildDetailModal: false,
  525. gradeList: [],
  526. tabList: [],
  527. gradeValue: -1,
  528. sysTime: 0,
  529. activeName: "-1",
  530. param: {
  531. pageNum: 1,
  532. pageSize: 10,
  533. },
  534. rebuildItems: [],
  535. rebuildItem: {},
  536. selectClassModal: false,
  537. total: 0,
  538. courseList: [],
  539. selectItem: {},
  540. loading: null,
  541. showExercisesModal: false,
  542. };
  543. },
  544. computed: {
  545. ...mapGetters(["userInfo"]),
  546. },
  547. async mounted() {
  548. this.sysTime = this.$tools.timest();
  549. await this.orderUserEduList();
  550. this.courseGoodsList();
  551. },
  552. methods: {
  553. tabChange(e) {
  554. if (this.activeName == e.name) {
  555. return;
  556. }
  557. console.log(e.name);
  558. this.activeName = e.name;
  559. this.courseGoodsList();
  560. },
  561. orderUserEduList() {
  562. return new Promise((resolve) => {
  563. this.$request
  564. .orderUserEduList({
  565. goodsType: 1,
  566. })
  567. .then((res) => {
  568. res.rows.forEach((row) => {
  569. row.id = row.id + "";
  570. });
  571. this.tabList.push(
  572. {
  573. educationName: "全部课程",
  574. id: "-1",
  575. },
  576. ...res.rows
  577. );
  578. resolve();
  579. });
  580. });
  581. },
  582. currentChange(e) {
  583. this.param.pageNum = e;
  584. this.courseGoodsList();
  585. },
  586. async goCourseDetail(item) {
  587. if (item.interfaceAccountId > 0) {
  588. //学习账号已开通
  589. if (item.learnStatus == 1) {
  590. //跳转第三方h5
  591. const confirmText = [
  592. "您的学习账号已经开通,请按照步骤操作,进行学习。",
  593. "1.点击【跳转学习网址】按钮",
  594. "2.打开学习网址后,选择【个人用户】进行登录",
  595. "(1)账号:您个人的身份证号码",
  596. "(2)密码:身份证号码,再加111111",
  597. ];
  598. const newDatas = [];
  599. const h = this.$createElement;
  600. for (const i in confirmText) {
  601. newDatas.push(h("p", null, confirmText[i]));
  602. }
  603. this.$confirm(h("div", null, newDatas), "温馨提示", {
  604. confirmButtonText: "跳转学习网址",
  605. cancelButtonText: "关闭",
  606. closeOnClickModal: false,
  607. closeOnPressEscape: false,
  608. distinguishCancelAndClose: false,
  609. showClose: false,
  610. })
  611. .then((_) => {
  612. window.open("http://admin.zhujianpeixun.com/", "_blank");
  613. })
  614. .catch((_) => {});
  615. return;
  616. } else {
  617. this.$message({
  618. type: "warning",
  619. message:
  620. "您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!",
  621. });
  622. return;
  623. }
  624. }
  625. //内部系统
  626. if (item.interfacePushId > 0 && item.officialStatus != 1) {
  627. this.$message({
  628. type: "warning",
  629. message: "机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!",
  630. });
  631. return;
  632. }
  633. if (
  634. this.sysTime <= item.serviceStartTime ||
  635. this.sysTime >= item.serviceEndTime
  636. ) {
  637. this.$message({
  638. type: "warning",
  639. message: "不在学习服务期,不能进入学习",
  640. });
  641. return;
  642. }
  643. if (
  644. (item.classStartTime && this.sysTime <= item.classStartTime) ||
  645. (item.classEndTime && this.sysTime >= item.classEndTime)
  646. ) {
  647. this.$message({
  648. type: "warning",
  649. message: "不在班级有效期,不能进入学习",
  650. });
  651. return;
  652. }
  653. if (item.learningStatus == 2) {
  654. this.$message({
  655. type: "warning",
  656. message: "开放学习时间待定,不能进入学习",
  657. });
  658. return;
  659. }
  660. if (item.classStatus == 0) {
  661. this.$message({
  662. type: "warning",
  663. message: "尚未开班,不能进入学习",
  664. });
  665. return;
  666. }
  667. if (item.learningStatus == 3 && this.sysTime < item.learningTimeStart) {
  668. this.$message({
  669. type: "warning",
  670. message: "不在开放学习时间,不能进入学习",
  671. });
  672. return;
  673. }
  674. let rebuildStatus = await this.courseGoodsRebuildStatus(
  675. item.goodsId,
  676. item.gradeId
  677. );
  678. if (rebuildStatus == 0) {
  679. this.rebuildItem = item;
  680. this.$request
  681. .getcourseperiodcheat({
  682. goodsId: item.goodsId,
  683. gradeId: item.gradeId,
  684. })
  685. .then((res) => {
  686. this.rebuildItems = res.rows;
  687. });
  688. this.showRebuildDetailModal = true;
  689. return;
  690. }
  691. if (item.educationName == "继续教育") {
  692. this.$request
  693. .lockLockStatus({
  694. action: "jxjy",
  695. uuid: sessionStorage.getItem("uuid"),
  696. })
  697. .then((res) => {
  698. //有其他端在操作,不能学习
  699. this.$message({
  700. type: "warning",
  701. message: res.msg,
  702. });
  703. })
  704. .catch((err) => {
  705. //可以学习
  706. this.$request
  707. .courseCourseList({
  708. pageNum: 1,
  709. pageSize: 1,
  710. goodsId: item.goodsId,
  711. gradeId: item.gradeId,
  712. })
  713. .then((res) => {
  714. if (res.rows.length) {
  715. this.$router.push({
  716. path: `/my-course-detail/${item.goodsId}`,
  717. query: {
  718. gradeId: item.gradeId,
  719. orderGoodsId: item.orderGoodsId,
  720. courseId: res.rows[0].courseId || "",
  721. },
  722. });
  723. } else {
  724. this.$message({
  725. type: "warning",
  726. message: "课程内暂无可以学习的科目",
  727. });
  728. }
  729. });
  730. });
  731. } else {
  732. this.$request
  733. .courseCourseList({
  734. pageNum: 1,
  735. pageSize: 1,
  736. goodsId: item.goodsId,
  737. gradeId: item.gradeId,
  738. })
  739. .then((res) => {
  740. if (res.rows.length) {
  741. this.$router.push({
  742. path: `/my-course-detail/${item.goodsId}`,
  743. query: {
  744. gradeId: item.gradeId,
  745. orderGoodsId: item.orderGoodsId,
  746. courseId: res.rows[0].courseId || "",
  747. },
  748. });
  749. } else {
  750. this.$message({
  751. type: "warning",
  752. message: "课程内暂无可以学习的科目",
  753. });
  754. }
  755. });
  756. }
  757. },
  758. appBeforeAddress(item) {
  759. this.$request
  760. .appBeforeAddress({
  761. // goodsId,
  762. orderGoodsId: item.orderGoodsId,
  763. })
  764. .then((res) => {
  765. this.showExercisesModal = true;
  766. })
  767. .catch((err) => {
  768. this.$message.warning(err.msg);
  769. });
  770. },
  771. rebuildSubmit() {
  772. this.$confirm(
  773. "如对审核结果有异议,请勿点击确认重学。致电020-87085982咨询",
  774. "注意",
  775. {
  776. confirmButtonText: "确认重学",
  777. cancelButtonText: "取消",
  778. closeOnClickModal: false,
  779. closeOnPressEscape: false,
  780. distinguishCancelAndClose: false,
  781. showClose: false,
  782. }
  783. )
  784. .then((_) => {
  785. this.$request
  786. .courseperiodrebuild({
  787. goodsId: this.rebuildItem.goodsId,
  788. gradeId: this.rebuildItem.gradeId,
  789. })
  790. .then((res) => {
  791. this.showRebuildDetailModal = false;
  792. this.$router.push({
  793. path: `/my-course-detail/${this.rebuildItem.goodsId}`,
  794. query: {
  795. gradeId: this.rebuildItem.gradeId,
  796. orderGoodsId: this.rebuildItem.orderGoodsId,
  797. },
  798. });
  799. });
  800. })
  801. .catch((_) => {});
  802. },
  803. selectClass(item) {
  804. this.selectClassModal = true;
  805. this.selectItem = item;
  806. this.gradeValue = -1;
  807. this.goodsGradeList(item.goodsId);
  808. },
  809. goodsGradeList(id) {
  810. let self = this;
  811. this.$request
  812. .goodsGradeList({
  813. goodsId: id,
  814. })
  815. .then((res) => {
  816. self.gradeList = res.rows;
  817. if (self.gradeList.length == 0) {
  818. let item = {
  819. className: "系统分班",
  820. gradeId: 0,
  821. };
  822. self.gradeList.push(item);
  823. } else {
  824. let isGradeFull = self.gradeList.every(
  825. (item) =>
  826. item.studentNum > 0 && item.studentNum == item.studentUpper
  827. );
  828. //所有班级都满了
  829. if (isGradeFull) {
  830. let item = {
  831. className: "系统分班",
  832. gradeId: 0,
  833. };
  834. self.gradeList.unshift(item);
  835. }
  836. }
  837. });
  838. },
  839. selectClassOk() {
  840. if (this.gradeValue == -1) {
  841. this.$message({
  842. type: "success",
  843. message: "请选择班级",
  844. });
  845. return;
  846. }
  847. this.$request
  848. .changeGrade({
  849. goodsId: this.selectItem.goodsId,
  850. gradeId: this.gradeValue,
  851. oldGradeId: this.selectItem.gradeId,
  852. orderGoodsId: this.selectItem.orderGoodsId,
  853. userId: this.selectItem.userId,
  854. })
  855. .then((res) => {
  856. this.courseGoodsList();
  857. this.selectClassModal = false;
  858. this.$message({
  859. type: "success",
  860. message: "选班成功",
  861. });
  862. })
  863. .catch((err) => {
  864. this.$message({
  865. type: "warning",
  866. message: err.msg,
  867. });
  868. });
  869. },
  870. /**
  871. * @param {Object} goodsId 商品id
  872. * 查询商品重修状态
  873. */
  874. courseGoodsRebuildStatus(goodsId, gradeId) {
  875. return new Promise((resolve) => {
  876. this.$request
  877. .courseGoodsRebuildStatus({
  878. goodsId: goodsId,
  879. gradeId: gradeId,
  880. })
  881. .then((res) => {
  882. resolve(res.data);
  883. });
  884. });
  885. },
  886. courseGoodsList() {
  887. let param = JSON.parse(JSON.stringify(this.param));
  888. if (this.activeName == "-1") {
  889. param.educationTypeId = "";
  890. } else {
  891. param.educationTypeId = this.activeName;
  892. }
  893. this.$request.courseGoodsList(param).then((res) => {
  894. this.courseList = res.rows;
  895. this.total = res.total;
  896. });
  897. },
  898. progressText(item) {
  899. return () => {
  900. return (
  901. item.stuAllNum +
  902. item.recordNum +
  903. "/" +
  904. (item.secAllNum + item.examNum)
  905. );
  906. };
  907. },
  908. appointment(item) {
  909. var data = {
  910. goodsId: item.goodsId,
  911. gradeId: item.gradeId,
  912. };
  913. this.$request
  914. .getApplysubscribe(data)
  915. .then((res) => {
  916. this.$router.push({
  917. path: "/person-center/my-classhour/appointment",
  918. query: {
  919. goodsId: item.goodsId,
  920. gradeId: item.gradeId,
  921. orderGoodsId: item.orderGoodsId,
  922. },
  923. });
  924. })
  925. .catch((err) => {
  926. this.$message({
  927. type: "warning",
  928. message: err.msg,
  929. });
  930. });
  931. },
  932. },
  933. };
  934. </script>
  935. <!-- Add "scoped" attribute to limit CSS to this component only -->
  936. <style scoped lang="scss">
  937. .my-course {
  938. &__header {
  939. /deep/ .el-tabs__header {
  940. margin-bottom: 0;
  941. }
  942. }
  943. &__body {
  944. .list {
  945. .course-item {
  946. margin-top: 24px;
  947. background: #fafbfc;
  948. border-radius: 8px;
  949. overflow: hidden;
  950. &__header {
  951. height: 40px;
  952. border-bottom: 1px solid #eee;
  953. padding: 0 18px;
  954. .state {
  955. margin-top: 8px;
  956. float: left;
  957. font-size: 14px;
  958. font-family: Microsoft YaHei;
  959. font-weight: 400;
  960. color: #666666;
  961. .red {
  962. color: #ff3b30;
  963. }
  964. .note {
  965. vertical-align: middle;
  966. display: inline-block;
  967. padding: 0 10px;
  968. height: 24px;
  969. background: #ffeceb;
  970. border: 1px solid #ff3b30;
  971. border-radius: 12px;
  972. font-size: 14px;
  973. font-family: Microsoft YaHei;
  974. font-weight: 400;
  975. color: #ff3b30;
  976. text-align: center;
  977. line-height: 24px;
  978. margin-right: 10px;
  979. &--yellow {
  980. border-color: #ffb001;
  981. color: #ffb001;
  982. background: #fff8e8;
  983. }
  984. &--green {
  985. border-color: #56dc68;
  986. color: #56dc68;
  987. background: #e6feea;
  988. }
  989. }
  990. }
  991. .time {
  992. float: right;
  993. line-height: 40px;
  994. text-align: right;
  995. font-size: 12px;
  996. font-family: Microsoft YaHei;
  997. font-weight: 400;
  998. color: #666666;
  999. &--red {
  1000. color: #ff3b30;
  1001. }
  1002. }
  1003. }
  1004. &__body {
  1005. .img {
  1006. float: left;
  1007. width: 160px;
  1008. height: 90px;
  1009. img {
  1010. max-width: 100%;
  1011. max-height: 100%;
  1012. }
  1013. }
  1014. .text {
  1015. float: left;
  1016. margin-left: 12px;
  1017. .title {
  1018. margin-top: 10px;
  1019. font-size: 16px;
  1020. font-family: Microsoft YaHei;
  1021. font-weight: bold;
  1022. color: #333333;
  1023. .note {
  1024. display: inline-block;
  1025. vertical-align: middle;
  1026. border: 1px solid #333333;
  1027. border-radius: 4px;
  1028. font-size: 12px;
  1029. font-family: Microsoft YaHei;
  1030. font-weight: 400;
  1031. color: #333333;
  1032. padding: 2px 5px;
  1033. margin-left: 12px;
  1034. }
  1035. }
  1036. .progress {
  1037. margin-top: 30px;
  1038. font-size: 14px;
  1039. font-family: Microsoft YaHei;
  1040. font-weight: 400;
  1041. color: #333333;
  1042. &-line {
  1043. width: 220px;
  1044. display: inline-block;
  1045. }
  1046. /deep/ .el-progress-bar {
  1047. padding-right: 70px;
  1048. margin-right: -70px;
  1049. }
  1050. }
  1051. }
  1052. .btns-wrap {
  1053. display: table;
  1054. float: right;
  1055. height: 90px;
  1056. width: 130px;
  1057. .btns {
  1058. display: table-cell;
  1059. vertical-align: middle;
  1060. text-align: center;
  1061. .btn {
  1062. cursor: pointer;
  1063. margin: 2px 0;
  1064. width: 122px;
  1065. height: 32px;
  1066. padding: 0;
  1067. border-radius: 16px;
  1068. display: inline-block;
  1069. text-align: center;
  1070. line-height: 32px;
  1071. color: #fff;
  1072. &--normal {
  1073. &.disabled {
  1074. background: rgb(101, 164, 253);
  1075. border-color: rgb(101, 164, 253);
  1076. }
  1077. }
  1078. &--warm {
  1079. background: #ff3b30;
  1080. &:hover {
  1081. background: #f56c6c;
  1082. }
  1083. }
  1084. }
  1085. }
  1086. }
  1087. }
  1088. &__footer {
  1089. padding: 20px 18px;
  1090. font-size: 14px;
  1091. color: #333;
  1092. .text {
  1093. margin-right: 20px;
  1094. &--red {
  1095. color: #ff3b30;
  1096. }
  1097. }
  1098. }
  1099. }
  1100. }
  1101. .pagination {
  1102. padding: 30px 0;
  1103. text-align: center;
  1104. }
  1105. }
  1106. .select-modal {
  1107. .radio {
  1108. cursor: pointer;
  1109. margin-right: 24px;
  1110. padding: 0 24px;
  1111. display: flex;
  1112. align-items: center;
  1113. margin-top: 2px;
  1114. min-height: 40px;
  1115. padding-top: 10px;
  1116. padding-bottom: 10px;
  1117. background: #f5f9ff;
  1118. border-radius: 8px;
  1119. box-sizing: border-box;
  1120. &.right {
  1121. background: #37c65b;
  1122. }
  1123. &.wrong {
  1124. background: #ff3a30;
  1125. }
  1126. }
  1127. }
  1128. .rebuild {
  1129. /deep/ .el-dialog__header {
  1130. display: none;
  1131. }
  1132. /deep/ .el-dialog__body {
  1133. padding: 0;
  1134. overflow: unset;
  1135. }
  1136. &__close {
  1137. cursor: pointer;
  1138. position: absolute;
  1139. right: 0;
  1140. top: -28px;
  1141. width: 24px;
  1142. height: 24px;
  1143. line-height: 24px;
  1144. text-align: center;
  1145. color: #eee;
  1146. border: 1px solid #eee;
  1147. border-radius: 50%;
  1148. }
  1149. &__header {
  1150. height: 40px;
  1151. border-bottom: 1px solid #eee;
  1152. line-height: 40px;
  1153. font-size: 16px;
  1154. font-family: Microsoft YaHei;
  1155. font-weight: bold;
  1156. color: #333333;
  1157. padding-left: 24px;
  1158. }
  1159. &__body {
  1160. height: 400px;
  1161. padding: 0 24px;
  1162. .content {
  1163. height: 100%;
  1164. overflow-y: auto;
  1165. &__header {
  1166. padding: 16px 0;
  1167. border-bottom: 1px solid #eee;
  1168. .title {
  1169. font-size: 16px;
  1170. font-family: Microsoft YaHei;
  1171. font-weight: bold;
  1172. color: #ff3b30;
  1173. line-height: 24px;
  1174. }
  1175. .desc {
  1176. margin-top: 10px;
  1177. font-size: 16px;
  1178. font-family: Microsoft YaHei;
  1179. font-weight: 400;
  1180. color: #ff3b30;
  1181. line-height: 24px;
  1182. }
  1183. }
  1184. &__body {
  1185. .list {
  1186. &__item {
  1187. padding: 16px 0;
  1188. border-bottom: 1px solid #eee;
  1189. .title {
  1190. font-size: 14px;
  1191. font-family: Microsoft YaHei;
  1192. font-weight: 400;
  1193. color: #333333;
  1194. .note {
  1195. display: inline-block;
  1196. text-align: center;
  1197. line-height: 18px;
  1198. width: 32px;
  1199. height: 20px;
  1200. border: 1px solid #3f8dfd;
  1201. border-radius: 4px;
  1202. color: #3f8dfd;
  1203. font-size: 12px;
  1204. &--yellow {
  1205. border: 1px solid #ff9500;
  1206. color: #ff9500;
  1207. }
  1208. }
  1209. }
  1210. .desc {
  1211. margin-top: 10px;
  1212. font-size: 14px;
  1213. font-family: Microsoft YaHei;
  1214. font-weight: 400;
  1215. color: #333333;
  1216. .note {
  1217. color: #ff3b30;
  1218. line-height: 20px;
  1219. }
  1220. .img {
  1221. width: 100px;
  1222. height: 100px;
  1223. display: inline-block;
  1224. text-align: center;
  1225. img {
  1226. max-width: 100%;
  1227. max-height: 100%;
  1228. }
  1229. }
  1230. }
  1231. }
  1232. }
  1233. }
  1234. }
  1235. }
  1236. &__footer {
  1237. height: 90px;
  1238. border-top: 1px solid #eee;
  1239. text-align: center;
  1240. .confirm {
  1241. width: 200px;
  1242. height: 40px;
  1243. padding: 0;
  1244. border-radius: 20px;
  1245. text-align: center;
  1246. line-height: 40px;
  1247. color: #fff;
  1248. margin: 24px auto;
  1249. }
  1250. }
  1251. }
  1252. .exercises-modal {
  1253. &__content {
  1254. > div {
  1255. font-size: 16px;
  1256. line-height: 30px;
  1257. text-align: center;
  1258. img {
  1259. display: inline;
  1260. }
  1261. }
  1262. }
  1263. }
  1264. }
  1265. </style>