index.vue 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325
  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. window.open("http://admin.zhujianpeixun.com/", "_blank");
  592. return;
  593. } else {
  594. this.$message({
  595. type: "warning",
  596. message:
  597. "您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!",
  598. });
  599. return;
  600. }
  601. }
  602. //内部系统
  603. if (item.interfacePushId > 0 && item.officialStatus != 1) {
  604. this.$message({
  605. type: "warning",
  606. message: "机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!",
  607. });
  608. return;
  609. }
  610. if (
  611. this.sysTime <= item.serviceStartTime ||
  612. this.sysTime >= item.serviceEndTime
  613. ) {
  614. this.$message({
  615. type: "warning",
  616. message: "不在学习服务期,不能进入学习",
  617. });
  618. return;
  619. }
  620. if (
  621. (item.classStartTime && this.sysTime <= item.classStartTime) ||
  622. (item.classEndTime && this.sysTime >= item.classEndTime)
  623. ) {
  624. this.$message({
  625. type: "warning",
  626. message: "不在班级有效期,不能进入学习",
  627. });
  628. return;
  629. }
  630. if (item.learningStatus == 2) {
  631. this.$message({
  632. type: "warning",
  633. message: "开放学习时间待定,不能进入学习",
  634. });
  635. return;
  636. }
  637. if (item.classStatus == 0) {
  638. this.$message({
  639. type: "warning",
  640. message: "尚未开班,不能进入学习",
  641. });
  642. return;
  643. }
  644. if (item.learningStatus == 3 && this.sysTime < item.learningTimeStart) {
  645. this.$message({
  646. type: "warning",
  647. message: "不在开放学习时间,不能进入学习",
  648. });
  649. return;
  650. }
  651. let rebuildStatus = await this.courseGoodsRebuildStatus(
  652. item.goodsId,
  653. item.gradeId
  654. );
  655. if (rebuildStatus == 0) {
  656. this.rebuildItem = item;
  657. this.$request
  658. .getcourseperiodcheat({
  659. goodsId: item.goodsId,
  660. gradeId: item.gradeId,
  661. })
  662. .then((res) => {
  663. this.rebuildItems = res.rows;
  664. });
  665. this.showRebuildDetailModal = true;
  666. return;
  667. }
  668. if (item.educationName == "继续教育") {
  669. this.$request
  670. .lockLockStatus({
  671. action: "jxjy",
  672. })
  673. .then((res) => {
  674. //有其他端在操作,不能学习
  675. this.$message({
  676. type: "warning",
  677. message: res.msg,
  678. });
  679. })
  680. .catch((err) => {
  681. //可以学习
  682. this.$request
  683. .courseCourseList({
  684. pageNum: 1,
  685. pageSize: 1,
  686. goodsId: item.goodsId,
  687. gradeId: item.gradeId,
  688. })
  689. .then((res) => {
  690. if (res.rows.length) {
  691. this.$router.push({
  692. path: `/my-course-detail/${item.goodsId}`,
  693. query: {
  694. gradeId: item.gradeId,
  695. orderGoodsId: item.orderGoodsId,
  696. courseId: res.rows[0].courseId || "",
  697. },
  698. });
  699. } else {
  700. this.$message({
  701. type: "warning",
  702. message: "课程内暂无可以学习的科目",
  703. });
  704. }
  705. });
  706. });
  707. } else {
  708. this.$request
  709. .courseCourseList({
  710. pageNum: 1,
  711. pageSize: 1,
  712. goodsId: item.goodsId,
  713. gradeId: item.gradeId,
  714. })
  715. .then((res) => {
  716. if (res.rows.length) {
  717. this.$router.push({
  718. path: `/my-course-detail/${item.goodsId}`,
  719. query: {
  720. gradeId: item.gradeId,
  721. orderGoodsId: item.orderGoodsId,
  722. courseId: res.rows[0].courseId || "",
  723. },
  724. });
  725. } else {
  726. this.$message({
  727. type: "warning",
  728. message: "课程内暂无可以学习的科目",
  729. });
  730. }
  731. });
  732. }
  733. },
  734. appBeforeAddress(item) {
  735. this.$request
  736. .appBeforeAddress({
  737. // goodsId,
  738. orderGoodsId: item.orderGoodsId,
  739. })
  740. .then((res) => {
  741. this.showExercisesModal = true;
  742. })
  743. .catch((err) => {
  744. this.$message.warning(err.msg);
  745. });
  746. },
  747. rebuildSubmit() {
  748. this.$confirm(
  749. "如对审核结果有异议,请勿点击确认重学。致电020-87085982咨询",
  750. "注意",
  751. {
  752. confirmButtonText: "确认重学",
  753. cancelButtonText: "取消",
  754. closeOnClickModal: false,
  755. closeOnPressEscape: false,
  756. distinguishCancelAndClose: false,
  757. showClose: false,
  758. }
  759. )
  760. .then((_) => {
  761. this.$request
  762. .courseperiodrebuild({
  763. goodsId: this.rebuildItem.goodsId,
  764. gradeId: this.rebuildItem.gradeId,
  765. })
  766. .then((res) => {
  767. this.showRebuildDetailModal = false;
  768. this.$router.push({
  769. path: `/my-course-detail/${this.rebuildItem.goodsId}`,
  770. query: {
  771. gradeId: this.rebuildItem.gradeId,
  772. orderGoodsId: this.rebuildItem.orderGoodsId,
  773. },
  774. });
  775. });
  776. })
  777. .catch((_) => {});
  778. },
  779. selectClass(item) {
  780. this.selectClassModal = true;
  781. this.selectItem = item;
  782. this.gradeValue = -1;
  783. this.goodsGradeList(item.goodsId);
  784. },
  785. goodsGradeList(id) {
  786. let self = this;
  787. this.$request
  788. .goodsGradeList({
  789. goodsId: id,
  790. })
  791. .then((res) => {
  792. self.gradeList = res.rows;
  793. if (self.gradeList.length == 0) {
  794. let item = {
  795. className: "系统分班",
  796. gradeId: 0,
  797. };
  798. self.gradeList.push(item);
  799. } else {
  800. let isGradeFull = self.gradeList.every(
  801. (item) =>
  802. item.studentNum > 0 && item.studentNum == item.studentUpper
  803. );
  804. //所有班级都满了
  805. if (isGradeFull) {
  806. let item = {
  807. className: "系统分班",
  808. gradeId: 0,
  809. };
  810. self.gradeList.unshift(item);
  811. }
  812. }
  813. });
  814. },
  815. selectClassOk() {
  816. if (this.gradeValue == -1) {
  817. this.$message({
  818. type: "success",
  819. message: "请选择班级",
  820. });
  821. return;
  822. }
  823. this.$request
  824. .changeGrade({
  825. goodsId: this.selectItem.goodsId,
  826. gradeId: this.gradeValue,
  827. oldGradeId: this.selectItem.gradeId,
  828. orderGoodsId: this.selectItem.orderGoodsId,
  829. userId: this.selectItem.userId,
  830. })
  831. .then((res) => {
  832. this.courseGoodsList();
  833. this.selectClassModal = false;
  834. this.$message({
  835. type: "success",
  836. message: "选班成功",
  837. });
  838. })
  839. .catch((err) => {
  840. this.$message({
  841. type: "warning",
  842. message: err.msg,
  843. });
  844. });
  845. },
  846. /**
  847. * @param {Object} goodsId 商品id
  848. * 查询商品重修状态
  849. */
  850. courseGoodsRebuildStatus(goodsId, gradeId) {
  851. return new Promise((resolve) => {
  852. this.$request
  853. .courseGoodsRebuildStatus({
  854. goodsId: goodsId,
  855. gradeId: gradeId,
  856. })
  857. .then((res) => {
  858. resolve(res.data);
  859. });
  860. });
  861. },
  862. courseGoodsList() {
  863. let param = JSON.parse(JSON.stringify(this.param));
  864. if (this.activeName == "-1") {
  865. param.educationTypeId = "";
  866. } else {
  867. param.educationTypeId = this.activeName;
  868. }
  869. this.$request.courseGoodsList(param).then((res) => {
  870. this.courseList = res.rows;
  871. this.total = res.total;
  872. });
  873. },
  874. progressText(item) {
  875. return () => {
  876. return (
  877. item.stuAllNum +
  878. item.recordNum +
  879. "/" +
  880. (item.secAllNum + item.examNum)
  881. );
  882. };
  883. },
  884. appointment(item) {
  885. var data = {
  886. goodsId: item.goodsId,
  887. gradeId: item.gradeId,
  888. };
  889. this.$request
  890. .getApplysubscribe(data)
  891. .then((res) => {
  892. this.$router.push({
  893. path: "/person-center/my-classhour/appointment",
  894. query: {
  895. goodsId: item.goodsId,
  896. gradeId: item.gradeId,
  897. orderGoodsId: item.orderGoodsId,
  898. },
  899. });
  900. })
  901. .catch((err) => {
  902. this.$message({
  903. type: "warning",
  904. message: err.msg,
  905. });
  906. });
  907. },
  908. },
  909. };
  910. </script>
  911. <!-- Add "scoped" attribute to limit CSS to this component only -->
  912. <style scoped lang="scss">
  913. .my-course {
  914. &__header {
  915. /deep/ .el-tabs__header {
  916. margin-bottom: 0;
  917. }
  918. }
  919. &__body {
  920. .list {
  921. .course-item {
  922. margin-top: 24px;
  923. background: #fafbfc;
  924. border-radius: 8px;
  925. overflow: hidden;
  926. &__header {
  927. height: 40px;
  928. border-bottom: 1px solid #eee;
  929. padding: 0 18px;
  930. .state {
  931. margin-top: 8px;
  932. float: left;
  933. font-size: 14px;
  934. font-family: Microsoft YaHei;
  935. font-weight: 400;
  936. color: #666666;
  937. .red {
  938. color: #ff3b30;
  939. }
  940. .note {
  941. vertical-align: middle;
  942. display: inline-block;
  943. padding: 0 10px;
  944. height: 24px;
  945. background: #ffeceb;
  946. border: 1px solid #ff3b30;
  947. border-radius: 12px;
  948. font-size: 14px;
  949. font-family: Microsoft YaHei;
  950. font-weight: 400;
  951. color: #ff3b30;
  952. text-align: center;
  953. line-height: 24px;
  954. margin-right: 10px;
  955. &--yellow {
  956. border-color: #ffb001;
  957. color: #ffb001;
  958. background: #fff8e8;
  959. }
  960. &--green {
  961. border-color: #56dc68;
  962. color: #56dc68;
  963. background: #e6feea;
  964. }
  965. }
  966. }
  967. .time {
  968. float: right;
  969. line-height: 40px;
  970. text-align: right;
  971. font-size: 12px;
  972. font-family: Microsoft YaHei;
  973. font-weight: 400;
  974. color: #666666;
  975. &--red {
  976. color: #ff3b30;
  977. }
  978. }
  979. }
  980. &__body {
  981. .img {
  982. float: left;
  983. width: 160px;
  984. height: 90px;
  985. img {
  986. max-width: 100%;
  987. max-height: 100%;
  988. }
  989. }
  990. .text {
  991. float: left;
  992. margin-left: 12px;
  993. .title {
  994. margin-top: 10px;
  995. font-size: 16px;
  996. font-family: Microsoft YaHei;
  997. font-weight: bold;
  998. color: #333333;
  999. .note {
  1000. display: inline-block;
  1001. vertical-align: middle;
  1002. border: 1px solid #333333;
  1003. border-radius: 4px;
  1004. font-size: 12px;
  1005. font-family: Microsoft YaHei;
  1006. font-weight: 400;
  1007. color: #333333;
  1008. padding: 2px 5px;
  1009. margin-left: 12px;
  1010. }
  1011. }
  1012. .progress {
  1013. margin-top: 30px;
  1014. font-size: 14px;
  1015. font-family: Microsoft YaHei;
  1016. font-weight: 400;
  1017. color: #333333;
  1018. &-line {
  1019. width: 220px;
  1020. display: inline-block;
  1021. }
  1022. /deep/ .el-progress-bar {
  1023. padding-right: 70px;
  1024. margin-right: -70px;
  1025. }
  1026. }
  1027. }
  1028. .btns-wrap {
  1029. display: table;
  1030. float: right;
  1031. height: 90px;
  1032. width: 130px;
  1033. .btns {
  1034. display: table-cell;
  1035. vertical-align: middle;
  1036. text-align: center;
  1037. .btn {
  1038. cursor: pointer;
  1039. margin: 2px 0;
  1040. width: 122px;
  1041. height: 32px;
  1042. padding: 0;
  1043. border-radius: 16px;
  1044. display: inline-block;
  1045. text-align: center;
  1046. line-height: 32px;
  1047. color: #fff;
  1048. &--normal {
  1049. &.disabled {
  1050. background: rgb(101, 164, 253);
  1051. border-color: rgb(101, 164, 253);
  1052. }
  1053. }
  1054. &--warm {
  1055. background: #ff3b30;
  1056. &:hover {
  1057. background: #f56c6c;
  1058. }
  1059. }
  1060. }
  1061. }
  1062. }
  1063. }
  1064. &__footer {
  1065. padding: 20px 18px;
  1066. font-size: 14px;
  1067. color: #333;
  1068. .text {
  1069. margin-right: 20px;
  1070. &--red {
  1071. color: #ff3b30;
  1072. }
  1073. }
  1074. }
  1075. }
  1076. }
  1077. .pagination {
  1078. padding: 30px 0;
  1079. text-align: center;
  1080. }
  1081. }
  1082. .select-modal {
  1083. .radio {
  1084. cursor: pointer;
  1085. margin-right: 24px;
  1086. padding: 0 24px;
  1087. display: flex;
  1088. align-items: center;
  1089. margin-top: 2px;
  1090. min-height: 40px;
  1091. padding-top: 10px;
  1092. padding-bottom: 10px;
  1093. background: #f5f9ff;
  1094. border-radius: 8px;
  1095. box-sizing: border-box;
  1096. &.right {
  1097. background: #37c65b;
  1098. }
  1099. &.wrong {
  1100. background: #ff3a30;
  1101. }
  1102. }
  1103. }
  1104. .rebuild {
  1105. /deep/ .el-dialog__header {
  1106. display: none;
  1107. }
  1108. /deep/ .el-dialog__body {
  1109. padding: 0;
  1110. overflow: unset;
  1111. }
  1112. &__close {
  1113. cursor: pointer;
  1114. position: absolute;
  1115. right: 0;
  1116. top: -28px;
  1117. width: 24px;
  1118. height: 24px;
  1119. line-height: 24px;
  1120. text-align: center;
  1121. color: #eee;
  1122. border: 1px solid #eee;
  1123. border-radius: 50%;
  1124. }
  1125. &__header {
  1126. height: 40px;
  1127. border-bottom: 1px solid #eee;
  1128. line-height: 40px;
  1129. font-size: 16px;
  1130. font-family: Microsoft YaHei;
  1131. font-weight: bold;
  1132. color: #333333;
  1133. padding-left: 24px;
  1134. }
  1135. &__body {
  1136. height: 400px;
  1137. padding: 0 24px;
  1138. .content {
  1139. height: 100%;
  1140. overflow-y: auto;
  1141. &__header {
  1142. padding: 16px 0;
  1143. border-bottom: 1px solid #eee;
  1144. .title {
  1145. font-size: 16px;
  1146. font-family: Microsoft YaHei;
  1147. font-weight: bold;
  1148. color: #ff3b30;
  1149. line-height: 24px;
  1150. }
  1151. .desc {
  1152. margin-top: 10px;
  1153. font-size: 16px;
  1154. font-family: Microsoft YaHei;
  1155. font-weight: 400;
  1156. color: #ff3b30;
  1157. line-height: 24px;
  1158. }
  1159. }
  1160. &__body {
  1161. .list {
  1162. &__item {
  1163. padding: 16px 0;
  1164. border-bottom: 1px solid #eee;
  1165. .title {
  1166. font-size: 14px;
  1167. font-family: Microsoft YaHei;
  1168. font-weight: 400;
  1169. color: #333333;
  1170. .note {
  1171. display: inline-block;
  1172. text-align: center;
  1173. line-height: 18px;
  1174. width: 32px;
  1175. height: 20px;
  1176. border: 1px solid #3f8dfd;
  1177. border-radius: 4px;
  1178. color: #3f8dfd;
  1179. font-size: 12px;
  1180. &--yellow {
  1181. border: 1px solid #ff9500;
  1182. color: #ff9500;
  1183. }
  1184. }
  1185. }
  1186. .desc {
  1187. margin-top: 10px;
  1188. font-size: 14px;
  1189. font-family: Microsoft YaHei;
  1190. font-weight: 400;
  1191. color: #333333;
  1192. .note {
  1193. color: #ff3b30;
  1194. line-height: 20px;
  1195. }
  1196. .img {
  1197. width: 100px;
  1198. height: 100px;
  1199. display: inline-block;
  1200. text-align: center;
  1201. img {
  1202. max-width: 100%;
  1203. max-height: 100%;
  1204. }
  1205. }
  1206. }
  1207. }
  1208. }
  1209. }
  1210. }
  1211. }
  1212. &__footer {
  1213. height: 90px;
  1214. border-top: 1px solid #eee;
  1215. text-align: center;
  1216. .confirm {
  1217. width: 200px;
  1218. height: 40px;
  1219. padding: 0;
  1220. border-radius: 20px;
  1221. text-align: center;
  1222. line-height: 40px;
  1223. color: #fff;
  1224. margin: 24px auto;
  1225. }
  1226. }
  1227. }
  1228. .exercises-modal {
  1229. &__content {
  1230. > div {
  1231. font-size: 16px;
  1232. line-height: 30px;
  1233. text-align: center;
  1234. img {
  1235. display: inline;
  1236. }
  1237. }
  1238. }
  1239. }
  1240. }
  1241. </style>