index.vue 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322
  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. >
  402. <div>
  403. {{ item.className }}
  404. <span v-if="item.classEndTime">
  405. 有效期至:{{
  406. $tools.timestampToTime(item.classEndTime, true, true)
  407. }}</span
  408. >
  409. <span v-if="item.classEndTime"
  410. >本班还剩{{
  411. $tools.GetRTime(item.classEndTime)
  412. }}天将结束学习</span
  413. >
  414. </div>
  415. <div></div
  416. ></el-radio>
  417. </div>
  418. <span slot="footer" class="dialog-footer">
  419. <el-button type="primary" @click="selectClassOk">确 定</el-button>
  420. </span>
  421. </el-dialog>
  422. <el-dialog
  423. width="800px"
  424. class="rebuild"
  425. :visible.sync="showRebuildDetailModal"
  426. :close-on-click-modal="false"
  427. :close-on-press-escape="false"
  428. :show-close="false"
  429. >
  430. <div class="rebuild__content">
  431. <div class="rebuild__close" @click="showRebuildDetailModal = false">
  432. X
  433. </div>
  434. <div class="rebuild__header">审核详情</div>
  435. <div class="rebuild__body">
  436. <div class="content">
  437. <div class="content__header">
  438. <div class="title">重要提示:</div>
  439. <div class="desc">
  440. 您的学时审核不通过,不通过原因如下,请查阅,并重学不通过的课程内容。
  441. </div>
  442. </div>
  443. <div class="content__body">
  444. <div class="list">
  445. <div
  446. class="list__item"
  447. v-for="(item, index) in rebuildItems"
  448. :key="index"
  449. >
  450. <div class="title">
  451. <span class="note" v-if="item.type == 0"> 测试 </span>
  452. <span class="note note--yellow" v-if="item.type == 1"
  453. >录播</span
  454. >
  455. <span class="note note--yellow" v-if="item.type == 2"
  456. >直播</span
  457. >
  458. <span class="note note--yellow" v-if="item.type == 3"
  459. >回放</span
  460. >
  461. {{ index + 1 }}、{{ item.name }}
  462. </div>
  463. <div class="desc">
  464. <!-- <div class="imgs">
  465. <div
  466. class="img"
  467. v-for="(items, indexs) in item.userStudyRecordPhoto"
  468. :key="indexs"
  469. >
  470. <img :src="$tools.splitImgHost(items.photo)" />
  471. <div class="note">
  472. {{ $tools.timestampToTime(items.createTime, false) }}
  473. </div>
  474. </div>
  475. </div> -->
  476. </div>
  477. <div class="desc">
  478. 原因:
  479. <span class="note">{{ item.auditReason }}</span>
  480. </div>
  481. </div>
  482. </div>
  483. </div>
  484. </div>
  485. </div>
  486. <div class="rebuild__footer">
  487. <el-button class="confirm" @click="rebuildSubmit" type="primary"
  488. >确认已阅读</el-button
  489. >
  490. </div>
  491. </div>
  492. </el-dialog>
  493. <el-dialog
  494. title="提示"
  495. class="exercises-modal"
  496. :visible.sync="showExercisesModal"
  497. width="800px"
  498. >
  499. <div class="exercises-modal__content">
  500. <div>1.不支持网页端刷题</div>
  501. <div>2.请使用手机扫码,进入【祥粤云学堂】小程序环境,进行刷题</div>
  502. <div>
  503. <img src="@/assets/xcxqrcode.jpg" alt="" />
  504. </div>
  505. </div>
  506. <span slot="footer" class="dialog-footer">
  507. <el-button type="primary" @click="showExercisesModal = false"
  508. >确 定</el-button
  509. >
  510. </span>
  511. </el-dialog>
  512. </div>
  513. </template>
  514. <script>
  515. import { mapGetters } from "vuex";
  516. import * as baseUrls from "@/axios.js";
  517. export default {
  518. name: "MyCourse",
  519. data() {
  520. return {
  521. showRebuildDetailModal: false,
  522. gradeList: [],
  523. tabList: [],
  524. gradeValue: -1,
  525. sysTime: 0,
  526. activeName: "-1",
  527. param: {
  528. pageNum: 1,
  529. pageSize: 10,
  530. },
  531. rebuildItems: [],
  532. rebuildItem: {},
  533. selectClassModal: false,
  534. total: 0,
  535. courseList: [],
  536. selectItem: {},
  537. loading: null,
  538. showExercisesModal: false,
  539. };
  540. },
  541. computed: {
  542. ...mapGetters(["userInfo"]),
  543. },
  544. async mounted() {
  545. this.sysTime = this.$tools.timest();
  546. await this.orderUserEduList();
  547. this.courseGoodsList();
  548. },
  549. methods: {
  550. tabChange(e) {
  551. if (this.activeName == e.name) {
  552. return;
  553. }
  554. console.log(e.name);
  555. this.activeName = e.name;
  556. this.courseGoodsList();
  557. },
  558. orderUserEduList() {
  559. return new Promise((resolve) => {
  560. this.$request
  561. .orderUserEduList({
  562. goodsType: 1,
  563. })
  564. .then((res) => {
  565. res.rows.forEach((row) => {
  566. row.id = row.id + "";
  567. });
  568. this.tabList.push(
  569. {
  570. educationName: "全部课程",
  571. id: "-1",
  572. },
  573. ...res.rows
  574. );
  575. resolve();
  576. });
  577. });
  578. },
  579. currentChange(e) {
  580. this.param.pageNum = e;
  581. this.courseGoodsList();
  582. },
  583. async goCourseDetail(item) {
  584. if (item.interfaceAccountId > 0) {
  585. //学习账号已开通
  586. if (item.learnStatus == 1) {
  587. //跳转第三方h5
  588. window.open("http://admin.zhujianpeixun.com/", "_blank");
  589. return;
  590. } else {
  591. this.$message({
  592. type: "warning",
  593. message:
  594. "您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!",
  595. });
  596. return;
  597. }
  598. }
  599. //内部系统
  600. if (item.interfacePushId > 0 && item.officialStatus != 1) {
  601. this.$message({
  602. type: "warning",
  603. message: "机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!",
  604. });
  605. return;
  606. }
  607. if (
  608. this.sysTime <= item.serviceStartTime ||
  609. this.sysTime >= item.serviceEndTime
  610. ) {
  611. this.$message({
  612. type: "warning",
  613. message: "不在学习服务期,不能进入学习",
  614. });
  615. return;
  616. }
  617. if (
  618. (item.classStartTime && this.sysTime <= item.classStartTime) ||
  619. (item.classEndTime && this.sysTime >= item.classEndTime)
  620. ) {
  621. this.$message({
  622. type: "warning",
  623. message: "不在班级有效期,不能进入学习",
  624. });
  625. return;
  626. }
  627. if (item.learningStatus == 2) {
  628. this.$message({
  629. type: "warning",
  630. message: "开放学习时间待定,不能进入学习",
  631. });
  632. return;
  633. }
  634. if (item.classStatus == 0) {
  635. this.$message({
  636. type: "warning",
  637. message: "尚未开班,不能进入学习",
  638. });
  639. return;
  640. }
  641. if (item.learningStatus == 3 && this.sysTime < item.learningTimeStart) {
  642. this.$message({
  643. type: "warning",
  644. message: "不在开放学习时间,不能进入学习",
  645. });
  646. return;
  647. }
  648. let rebuildStatus = await this.courseGoodsRebuildStatus(
  649. item.goodsId,
  650. item.gradeId
  651. );
  652. if (rebuildStatus == 0) {
  653. this.rebuildItem = item;
  654. this.$request
  655. .getcourseperiodcheat({
  656. goodsId: item.goodsId,
  657. gradeId: item.gradeId,
  658. })
  659. .then((res) => {
  660. this.rebuildItems = res.rows;
  661. });
  662. this.showRebuildDetailModal = true;
  663. return;
  664. }
  665. if (item.educationName == "继续教育") {
  666. this.$request
  667. .lockLockStatus({
  668. action: "jxjy",
  669. })
  670. .then((res) => {
  671. //有其他端在操作,不能学习
  672. this.$message({
  673. type: "warning",
  674. message: res.msg,
  675. });
  676. })
  677. .catch((err) => {
  678. //可以学习
  679. this.$request
  680. .courseCourseList({
  681. pageNum: 1,
  682. pageSize: 1,
  683. goodsId: item.goodsId,
  684. gradeId: item.gradeId,
  685. })
  686. .then((res) => {
  687. if (res.rows.length) {
  688. this.$router.push({
  689. path: `/my-course-detail/${item.goodsId}`,
  690. query: {
  691. gradeId: item.gradeId,
  692. orderGoodsId: item.orderGoodsId,
  693. courseId: res.rows[0].courseId || "",
  694. },
  695. });
  696. } else {
  697. this.$message({
  698. type: "warning",
  699. message: "课程内暂无可以学习的科目",
  700. });
  701. }
  702. });
  703. });
  704. } else {
  705. this.$request
  706. .courseCourseList({
  707. pageNum: 1,
  708. pageSize: 1,
  709. goodsId: item.goodsId,
  710. gradeId: item.gradeId,
  711. })
  712. .then((res) => {
  713. if (res.rows.length) {
  714. this.$router.push({
  715. path: `/my-course-detail/${item.goodsId}`,
  716. query: {
  717. gradeId: item.gradeId,
  718. orderGoodsId: item.orderGoodsId,
  719. courseId: res.rows[0].courseId || "",
  720. },
  721. });
  722. } else {
  723. this.$message({
  724. type: "warning",
  725. message: "课程内暂无可以学习的科目",
  726. });
  727. }
  728. });
  729. }
  730. },
  731. appBeforeAddress(item) {
  732. this.$request
  733. .appBeforeAddress({
  734. // goodsId,
  735. orderGoodsId: item.orderGoodsId,
  736. })
  737. .then((res) => {
  738. this.showExercisesModal = true;
  739. })
  740. .catch((err) => {
  741. this.$message.warning(err.msg);
  742. });
  743. },
  744. rebuildSubmit() {
  745. this.$confirm(
  746. "如对审核结果有异议,请勿点击确认重学。致电020-87085982咨询",
  747. "注意",
  748. {
  749. confirmButtonText: "确认重学",
  750. cancelButtonText: "取消",
  751. closeOnClickModal: false,
  752. closeOnPressEscape: false,
  753. distinguishCancelAndClose: false,
  754. showClose: false,
  755. }
  756. )
  757. .then((_) => {
  758. this.$request
  759. .courseperiodrebuild({
  760. goodsId: this.rebuildItem.goodsId,
  761. gradeId: this.rebuildItem.gradeId,
  762. })
  763. .then((res) => {
  764. this.showRebuildDetailModal = false;
  765. this.$router.push({
  766. path: `/my-course-detail/${this.rebuildItem.goodsId}`,
  767. query: {
  768. gradeId: this.rebuildItem.gradeId,
  769. orderGoodsId: this.rebuildItem.orderGoodsId,
  770. },
  771. });
  772. });
  773. })
  774. .catch((_) => {});
  775. },
  776. selectClass(item) {
  777. this.selectClassModal = true;
  778. this.selectItem = item;
  779. this.gradeValue = -1;
  780. this.goodsGradeList(item.goodsId);
  781. },
  782. goodsGradeList(id) {
  783. let self = this;
  784. this.$request
  785. .goodsGradeList({
  786. goodsId: id,
  787. })
  788. .then((res) => {
  789. self.gradeList = res.rows;
  790. if (self.gradeList.length == 0) {
  791. let item = {
  792. className: "系统分班",
  793. gradeId: 0,
  794. };
  795. self.gradeList.push(item);
  796. } else {
  797. let isGradeFull = self.gradeList.every(
  798. (item) =>
  799. item.studentNum > 0 && item.studentNum == item.studentUpper
  800. );
  801. //所有班级都满了
  802. if (isGradeFull) {
  803. let item = {
  804. className: "系统分班",
  805. gradeId: 0,
  806. };
  807. self.gradeList.unshift(item);
  808. }
  809. }
  810. });
  811. },
  812. selectClassOk() {
  813. if (this.gradeValue == -1) {
  814. this.$message({
  815. type: "success",
  816. message: "请选择班级",
  817. });
  818. return;
  819. }
  820. this.$request
  821. .changeGrade({
  822. goodsId: this.selectItem.goodsId,
  823. gradeId: this.gradeValue,
  824. oldGradeId: this.selectItem.gradeId,
  825. orderGoodsId: this.selectItem.orderGoodsId,
  826. userId: this.selectItem.userId,
  827. })
  828. .then((res) => {
  829. this.courseGoodsList();
  830. this.selectClassModal = false;
  831. this.$message({
  832. type: "success",
  833. message: "选班成功",
  834. });
  835. })
  836. .catch((err) => {
  837. this.$message({
  838. type: "success",
  839. message: res.msg,
  840. });
  841. });
  842. },
  843. /**
  844. * @param {Object} goodsId 商品id
  845. * 查询商品重修状态
  846. */
  847. courseGoodsRebuildStatus(goodsId, gradeId) {
  848. return new Promise((resolve) => {
  849. this.$request
  850. .courseGoodsRebuildStatus({
  851. goodsId: goodsId,
  852. gradeId: gradeId,
  853. })
  854. .then((res) => {
  855. resolve(res.data);
  856. });
  857. });
  858. },
  859. courseGoodsList() {
  860. let param = JSON.parse(JSON.stringify(this.param));
  861. if (this.activeName == "-1") {
  862. param.educationTypeId = "";
  863. } else {
  864. param.educationTypeId = this.activeName;
  865. }
  866. this.$request.courseGoodsList(param).then((res) => {
  867. this.courseList = res.rows;
  868. this.total = res.total;
  869. });
  870. },
  871. progressText(item) {
  872. return () => {
  873. return (
  874. item.stuAllNum +
  875. item.recordNum +
  876. "/" +
  877. (item.secAllNum + item.examNum)
  878. );
  879. };
  880. },
  881. appointment(item) {
  882. var data = {
  883. goodsId: item.goodsId,
  884. gradeId: item.gradeId,
  885. };
  886. this.$request
  887. .getApplysubscribe(data)
  888. .then((res) => {
  889. this.$router.push({
  890. path: "/person-center/my-classhour/appointment",
  891. query: {
  892. goodsId: item.goodsId,
  893. gradeId: item.gradeId,
  894. orderGoodsId: item.orderGoodsId,
  895. },
  896. });
  897. })
  898. .catch((err) => {
  899. this.$message({
  900. type: "success",
  901. message: err.msg,
  902. });
  903. });
  904. },
  905. },
  906. };
  907. </script>
  908. <!-- Add "scoped" attribute to limit CSS to this component only -->
  909. <style scoped lang="scss">
  910. .my-course {
  911. &__header {
  912. /deep/ .el-tabs__header {
  913. margin-bottom: 0;
  914. }
  915. }
  916. &__body {
  917. .list {
  918. .course-item {
  919. margin-top: 24px;
  920. background: #fafbfc;
  921. border-radius: 8px;
  922. overflow: hidden;
  923. &__header {
  924. height: 40px;
  925. border-bottom: 1px solid #eee;
  926. padding: 0 18px;
  927. .state {
  928. margin-top: 8px;
  929. float: left;
  930. font-size: 14px;
  931. font-family: Microsoft YaHei;
  932. font-weight: 400;
  933. color: #666666;
  934. .red {
  935. color: #ff3b30;
  936. }
  937. .note {
  938. vertical-align: middle;
  939. display: inline-block;
  940. padding: 0 10px;
  941. height: 24px;
  942. background: #ffeceb;
  943. border: 1px solid #ff3b30;
  944. border-radius: 12px;
  945. font-size: 14px;
  946. font-family: Microsoft YaHei;
  947. font-weight: 400;
  948. color: #ff3b30;
  949. text-align: center;
  950. line-height: 24px;
  951. margin-right: 10px;
  952. &--yellow {
  953. border-color: #ffb001;
  954. color: #ffb001;
  955. background: #fff8e8;
  956. }
  957. &--green {
  958. border-color: #56dc68;
  959. color: #56dc68;
  960. background: #e6feea;
  961. }
  962. }
  963. }
  964. .time {
  965. float: right;
  966. line-height: 40px;
  967. text-align: right;
  968. font-size: 12px;
  969. font-family: Microsoft YaHei;
  970. font-weight: 400;
  971. color: #666666;
  972. &--red {
  973. color: #ff3b30;
  974. }
  975. }
  976. }
  977. &__body {
  978. .img {
  979. float: left;
  980. width: 160px;
  981. height: 90px;
  982. img {
  983. max-width: 100%;
  984. max-height: 100%;
  985. }
  986. }
  987. .text {
  988. float: left;
  989. margin-left: 12px;
  990. .title {
  991. margin-top: 10px;
  992. font-size: 16px;
  993. font-family: Microsoft YaHei;
  994. font-weight: bold;
  995. color: #333333;
  996. .note {
  997. display: inline-block;
  998. vertical-align: middle;
  999. border: 1px solid #333333;
  1000. border-radius: 4px;
  1001. font-size: 12px;
  1002. font-family: Microsoft YaHei;
  1003. font-weight: 400;
  1004. color: #333333;
  1005. padding: 2px 5px;
  1006. margin-left: 12px;
  1007. }
  1008. }
  1009. .progress {
  1010. margin-top: 30px;
  1011. font-size: 14px;
  1012. font-family: Microsoft YaHei;
  1013. font-weight: 400;
  1014. color: #333333;
  1015. &-line {
  1016. width: 220px;
  1017. display: inline-block;
  1018. }
  1019. /deep/ .el-progress-bar {
  1020. padding-right: 70px;
  1021. margin-right: -70px;
  1022. }
  1023. }
  1024. }
  1025. .btns-wrap {
  1026. display: table;
  1027. float: right;
  1028. height: 90px;
  1029. width: 130px;
  1030. .btns {
  1031. display: table-cell;
  1032. vertical-align: middle;
  1033. text-align: center;
  1034. .btn {
  1035. cursor: pointer;
  1036. margin: 2px 0;
  1037. width: 122px;
  1038. height: 32px;
  1039. padding: 0;
  1040. border-radius: 16px;
  1041. display: inline-block;
  1042. text-align: center;
  1043. line-height: 32px;
  1044. color: #fff;
  1045. &--normal {
  1046. &.disabled {
  1047. background: rgb(101, 164, 253);
  1048. border-color: rgb(101, 164, 253);
  1049. }
  1050. }
  1051. &--warm {
  1052. background: #ff3b30;
  1053. &:hover {
  1054. background: #f56c6c;
  1055. }
  1056. }
  1057. }
  1058. }
  1059. }
  1060. }
  1061. &__footer {
  1062. padding: 20px 18px;
  1063. font-size: 14px;
  1064. color: #333;
  1065. .text {
  1066. margin-right: 20px;
  1067. &--red {
  1068. color: #ff3b30;
  1069. }
  1070. }
  1071. }
  1072. }
  1073. }
  1074. .pagination {
  1075. padding: 30px 0;
  1076. text-align: center;
  1077. }
  1078. }
  1079. .select-modal {
  1080. .radio {
  1081. cursor: pointer;
  1082. margin-right: 24px;
  1083. padding: 0 24px;
  1084. display: flex;
  1085. align-items: center;
  1086. margin-top: 2px;
  1087. min-height: 40px;
  1088. padding-top: 10px;
  1089. padding-bottom: 10px;
  1090. background: #f5f9ff;
  1091. border-radius: 8px;
  1092. box-sizing: border-box;
  1093. &.right {
  1094. background: #37c65b;
  1095. }
  1096. &.wrong {
  1097. background: #ff3a30;
  1098. }
  1099. }
  1100. }
  1101. .rebuild {
  1102. /deep/ .el-dialog__header {
  1103. display: none;
  1104. }
  1105. /deep/ .el-dialog__body {
  1106. padding: 0;
  1107. overflow: unset;
  1108. }
  1109. &__close {
  1110. cursor: pointer;
  1111. position: absolute;
  1112. right: 0;
  1113. top: -28px;
  1114. width: 24px;
  1115. height: 24px;
  1116. line-height: 24px;
  1117. text-align: center;
  1118. color: #eee;
  1119. border: 1px solid #eee;
  1120. border-radius: 50%;
  1121. }
  1122. &__header {
  1123. height: 40px;
  1124. border-bottom: 1px solid #eee;
  1125. line-height: 40px;
  1126. font-size: 16px;
  1127. font-family: Microsoft YaHei;
  1128. font-weight: bold;
  1129. color: #333333;
  1130. padding-left: 24px;
  1131. }
  1132. &__body {
  1133. height: 400px;
  1134. padding: 0 24px;
  1135. .content {
  1136. height: 100%;
  1137. overflow-y: auto;
  1138. &__header {
  1139. padding: 16px 0;
  1140. border-bottom: 1px solid #eee;
  1141. .title {
  1142. font-size: 16px;
  1143. font-family: Microsoft YaHei;
  1144. font-weight: bold;
  1145. color: #ff3b30;
  1146. line-height: 24px;
  1147. }
  1148. .desc {
  1149. margin-top: 10px;
  1150. font-size: 16px;
  1151. font-family: Microsoft YaHei;
  1152. font-weight: 400;
  1153. color: #ff3b30;
  1154. line-height: 24px;
  1155. }
  1156. }
  1157. &__body {
  1158. .list {
  1159. &__item {
  1160. padding: 16px 0;
  1161. border-bottom: 1px solid #eee;
  1162. .title {
  1163. font-size: 14px;
  1164. font-family: Microsoft YaHei;
  1165. font-weight: 400;
  1166. color: #333333;
  1167. .note {
  1168. display: inline-block;
  1169. text-align: center;
  1170. line-height: 18px;
  1171. width: 32px;
  1172. height: 20px;
  1173. border: 1px solid #3f8dfd;
  1174. border-radius: 4px;
  1175. color: #3f8dfd;
  1176. font-size: 12px;
  1177. &--yellow {
  1178. border: 1px solid #ff9500;
  1179. color: #ff9500;
  1180. }
  1181. }
  1182. }
  1183. .desc {
  1184. margin-top: 10px;
  1185. font-size: 14px;
  1186. font-family: Microsoft YaHei;
  1187. font-weight: 400;
  1188. color: #333333;
  1189. .note {
  1190. color: #ff3b30;
  1191. line-height: 20px;
  1192. }
  1193. .img {
  1194. width: 100px;
  1195. height: 100px;
  1196. display: inline-block;
  1197. text-align: center;
  1198. img {
  1199. max-width: 100%;
  1200. max-height: 100%;
  1201. }
  1202. }
  1203. }
  1204. }
  1205. }
  1206. }
  1207. }
  1208. }
  1209. &__footer {
  1210. height: 90px;
  1211. border-top: 1px solid #eee;
  1212. text-align: center;
  1213. .confirm {
  1214. width: 200px;
  1215. height: 40px;
  1216. padding: 0;
  1217. border-radius: 20px;
  1218. text-align: center;
  1219. line-height: 40px;
  1220. color: #fff;
  1221. margin: 24px auto;
  1222. }
  1223. }
  1224. }
  1225. .exercises-modal {
  1226. &__content {
  1227. > div {
  1228. font-size: 16px;
  1229. line-height: 30px;
  1230. text-align: center;
  1231. img {
  1232. display: inline;
  1233. }
  1234. }
  1235. }
  1236. }
  1237. }
  1238. </style>