index.vue 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350
  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. })
  696. .then((res) => {
  697. //有其他端在操作,不能学习
  698. this.$message({
  699. type: "warning",
  700. message: res.msg,
  701. });
  702. })
  703. .catch((err) => {
  704. //可以学习
  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. } else {
  731. this.$request
  732. .courseCourseList({
  733. pageNum: 1,
  734. pageSize: 1,
  735. goodsId: item.goodsId,
  736. gradeId: item.gradeId,
  737. })
  738. .then((res) => {
  739. if (res.rows.length) {
  740. this.$router.push({
  741. path: `/my-course-detail/${item.goodsId}`,
  742. query: {
  743. gradeId: item.gradeId,
  744. orderGoodsId: item.orderGoodsId,
  745. courseId: res.rows[0].courseId || "",
  746. },
  747. });
  748. } else {
  749. this.$message({
  750. type: "warning",
  751. message: "课程内暂无可以学习的科目",
  752. });
  753. }
  754. });
  755. }
  756. },
  757. appBeforeAddress(item) {
  758. this.$request
  759. .appBeforeAddress({
  760. // goodsId,
  761. orderGoodsId: item.orderGoodsId,
  762. })
  763. .then((res) => {
  764. this.showExercisesModal = true;
  765. })
  766. .catch((err) => {
  767. this.$message.warning(err.msg);
  768. });
  769. },
  770. rebuildSubmit() {
  771. this.$confirm(
  772. "如对审核结果有异议,请勿点击确认重学。致电020-87085982咨询",
  773. "注意",
  774. {
  775. confirmButtonText: "确认重学",
  776. cancelButtonText: "取消",
  777. closeOnClickModal: false,
  778. closeOnPressEscape: false,
  779. distinguishCancelAndClose: false,
  780. showClose: false,
  781. }
  782. )
  783. .then((_) => {
  784. this.$request
  785. .courseperiodrebuild({
  786. goodsId: this.rebuildItem.goodsId,
  787. gradeId: this.rebuildItem.gradeId,
  788. })
  789. .then((res) => {
  790. this.showRebuildDetailModal = false;
  791. this.$router.push({
  792. path: `/my-course-detail/${this.rebuildItem.goodsId}`,
  793. query: {
  794. gradeId: this.rebuildItem.gradeId,
  795. orderGoodsId: this.rebuildItem.orderGoodsId,
  796. },
  797. });
  798. });
  799. })
  800. .catch((_) => {});
  801. },
  802. selectClass(item) {
  803. this.selectClassModal = true;
  804. this.selectItem = item;
  805. this.gradeValue = -1;
  806. this.goodsGradeList(item.goodsId);
  807. },
  808. goodsGradeList(id) {
  809. let self = this;
  810. this.$request
  811. .goodsGradeList({
  812. goodsId: id,
  813. })
  814. .then((res) => {
  815. self.gradeList = res.rows;
  816. if (self.gradeList.length == 0) {
  817. let item = {
  818. className: "系统分班",
  819. gradeId: 0,
  820. };
  821. self.gradeList.push(item);
  822. } else {
  823. let isGradeFull = self.gradeList.every(
  824. (item) =>
  825. item.studentNum > 0 && item.studentNum == item.studentUpper
  826. );
  827. //所有班级都满了
  828. if (isGradeFull) {
  829. let item = {
  830. className: "系统分班",
  831. gradeId: 0,
  832. };
  833. self.gradeList.unshift(item);
  834. }
  835. }
  836. });
  837. },
  838. selectClassOk() {
  839. if (this.gradeValue == -1) {
  840. this.$message({
  841. type: "success",
  842. message: "请选择班级",
  843. });
  844. return;
  845. }
  846. this.$request
  847. .changeGrade({
  848. goodsId: this.selectItem.goodsId,
  849. gradeId: this.gradeValue,
  850. oldGradeId: this.selectItem.gradeId,
  851. orderGoodsId: this.selectItem.orderGoodsId,
  852. userId: this.selectItem.userId,
  853. })
  854. .then((res) => {
  855. this.courseGoodsList();
  856. this.selectClassModal = false;
  857. this.$message({
  858. type: "success",
  859. message: "选班成功",
  860. });
  861. })
  862. .catch((err) => {
  863. this.$message({
  864. type: "warning",
  865. message: err.msg,
  866. });
  867. });
  868. },
  869. /**
  870. * @param {Object} goodsId 商品id
  871. * 查询商品重修状态
  872. */
  873. courseGoodsRebuildStatus(goodsId, gradeId) {
  874. return new Promise((resolve) => {
  875. this.$request
  876. .courseGoodsRebuildStatus({
  877. goodsId: goodsId,
  878. gradeId: gradeId,
  879. })
  880. .then((res) => {
  881. resolve(res.data);
  882. });
  883. });
  884. },
  885. courseGoodsList() {
  886. let param = JSON.parse(JSON.stringify(this.param));
  887. if (this.activeName == "-1") {
  888. param.educationTypeId = "";
  889. } else {
  890. param.educationTypeId = this.activeName;
  891. }
  892. this.$request.courseGoodsList(param).then((res) => {
  893. this.courseList = res.rows;
  894. this.total = res.total;
  895. });
  896. },
  897. progressText(item) {
  898. return () => {
  899. return (
  900. item.stuAllNum +
  901. item.recordNum +
  902. "/" +
  903. (item.secAllNum + item.examNum)
  904. );
  905. };
  906. },
  907. appointment(item) {
  908. var data = {
  909. goodsId: item.goodsId,
  910. gradeId: item.gradeId,
  911. };
  912. this.$request
  913. .getApplysubscribe(data)
  914. .then((res) => {
  915. this.$router.push({
  916. path: "/person-center/my-classhour/appointment",
  917. query: {
  918. goodsId: item.goodsId,
  919. gradeId: item.gradeId,
  920. orderGoodsId: item.orderGoodsId,
  921. },
  922. });
  923. })
  924. .catch((err) => {
  925. this.$message({
  926. type: "warning",
  927. message: err.msg,
  928. });
  929. });
  930. },
  931. },
  932. };
  933. </script>
  934. <!-- Add "scoped" attribute to limit CSS to this component only -->
  935. <style scoped lang="scss">
  936. .my-course {
  937. &__header {
  938. /deep/ .el-tabs__header {
  939. margin-bottom: 0;
  940. }
  941. }
  942. &__body {
  943. .list {
  944. .course-item {
  945. margin-top: 24px;
  946. background: #fafbfc;
  947. border-radius: 8px;
  948. overflow: hidden;
  949. &__header {
  950. height: 40px;
  951. border-bottom: 1px solid #eee;
  952. padding: 0 18px;
  953. .state {
  954. margin-top: 8px;
  955. float: left;
  956. font-size: 14px;
  957. font-family: Microsoft YaHei;
  958. font-weight: 400;
  959. color: #666666;
  960. .red {
  961. color: #ff3b30;
  962. }
  963. .note {
  964. vertical-align: middle;
  965. display: inline-block;
  966. padding: 0 10px;
  967. height: 24px;
  968. background: #ffeceb;
  969. border: 1px solid #ff3b30;
  970. border-radius: 12px;
  971. font-size: 14px;
  972. font-family: Microsoft YaHei;
  973. font-weight: 400;
  974. color: #ff3b30;
  975. text-align: center;
  976. line-height: 24px;
  977. margin-right: 10px;
  978. &--yellow {
  979. border-color: #ffb001;
  980. color: #ffb001;
  981. background: #fff8e8;
  982. }
  983. &--green {
  984. border-color: #56dc68;
  985. color: #56dc68;
  986. background: #e6feea;
  987. }
  988. }
  989. }
  990. .time {
  991. float: right;
  992. line-height: 40px;
  993. text-align: right;
  994. font-size: 12px;
  995. font-family: Microsoft YaHei;
  996. font-weight: 400;
  997. color: #666666;
  998. &--red {
  999. color: #ff3b30;
  1000. }
  1001. }
  1002. }
  1003. &__body {
  1004. .img {
  1005. float: left;
  1006. width: 160px;
  1007. height: 90px;
  1008. img {
  1009. max-width: 100%;
  1010. max-height: 100%;
  1011. }
  1012. }
  1013. .text {
  1014. float: left;
  1015. margin-left: 12px;
  1016. .title {
  1017. margin-top: 10px;
  1018. font-size: 16px;
  1019. font-family: Microsoft YaHei;
  1020. font-weight: bold;
  1021. color: #333333;
  1022. .note {
  1023. display: inline-block;
  1024. vertical-align: middle;
  1025. border: 1px solid #333333;
  1026. border-radius: 4px;
  1027. font-size: 12px;
  1028. font-family: Microsoft YaHei;
  1029. font-weight: 400;
  1030. color: #333333;
  1031. padding: 2px 5px;
  1032. margin-left: 12px;
  1033. }
  1034. }
  1035. .progress {
  1036. margin-top: 30px;
  1037. font-size: 14px;
  1038. font-family: Microsoft YaHei;
  1039. font-weight: 400;
  1040. color: #333333;
  1041. &-line {
  1042. width: 220px;
  1043. display: inline-block;
  1044. }
  1045. /deep/ .el-progress-bar {
  1046. padding-right: 70px;
  1047. margin-right: -70px;
  1048. }
  1049. }
  1050. }
  1051. .btns-wrap {
  1052. display: table;
  1053. float: right;
  1054. height: 90px;
  1055. width: 130px;
  1056. .btns {
  1057. display: table-cell;
  1058. vertical-align: middle;
  1059. text-align: center;
  1060. .btn {
  1061. cursor: pointer;
  1062. margin: 2px 0;
  1063. width: 122px;
  1064. height: 32px;
  1065. padding: 0;
  1066. border-radius: 16px;
  1067. display: inline-block;
  1068. text-align: center;
  1069. line-height: 32px;
  1070. color: #fff;
  1071. &--normal {
  1072. &.disabled {
  1073. background: rgb(101, 164, 253);
  1074. border-color: rgb(101, 164, 253);
  1075. }
  1076. }
  1077. &--warm {
  1078. background: #ff3b30;
  1079. &:hover {
  1080. background: #f56c6c;
  1081. }
  1082. }
  1083. }
  1084. }
  1085. }
  1086. }
  1087. &__footer {
  1088. padding: 20px 18px;
  1089. font-size: 14px;
  1090. color: #333;
  1091. .text {
  1092. margin-right: 20px;
  1093. &--red {
  1094. color: #ff3b30;
  1095. }
  1096. }
  1097. }
  1098. }
  1099. }
  1100. .pagination {
  1101. padding: 30px 0;
  1102. text-align: center;
  1103. }
  1104. }
  1105. .select-modal {
  1106. .radio {
  1107. cursor: pointer;
  1108. margin-right: 24px;
  1109. padding: 0 24px;
  1110. display: flex;
  1111. align-items: center;
  1112. margin-top: 2px;
  1113. min-height: 40px;
  1114. padding-top: 10px;
  1115. padding-bottom: 10px;
  1116. background: #f5f9ff;
  1117. border-radius: 8px;
  1118. box-sizing: border-box;
  1119. &.right {
  1120. background: #37c65b;
  1121. }
  1122. &.wrong {
  1123. background: #ff3a30;
  1124. }
  1125. }
  1126. }
  1127. .rebuild {
  1128. /deep/ .el-dialog__header {
  1129. display: none;
  1130. }
  1131. /deep/ .el-dialog__body {
  1132. padding: 0;
  1133. overflow: unset;
  1134. }
  1135. &__close {
  1136. cursor: pointer;
  1137. position: absolute;
  1138. right: 0;
  1139. top: -28px;
  1140. width: 24px;
  1141. height: 24px;
  1142. line-height: 24px;
  1143. text-align: center;
  1144. color: #eee;
  1145. border: 1px solid #eee;
  1146. border-radius: 50%;
  1147. }
  1148. &__header {
  1149. height: 40px;
  1150. border-bottom: 1px solid #eee;
  1151. line-height: 40px;
  1152. font-size: 16px;
  1153. font-family: Microsoft YaHei;
  1154. font-weight: bold;
  1155. color: #333333;
  1156. padding-left: 24px;
  1157. }
  1158. &__body {
  1159. height: 400px;
  1160. padding: 0 24px;
  1161. .content {
  1162. height: 100%;
  1163. overflow-y: auto;
  1164. &__header {
  1165. padding: 16px 0;
  1166. border-bottom: 1px solid #eee;
  1167. .title {
  1168. font-size: 16px;
  1169. font-family: Microsoft YaHei;
  1170. font-weight: bold;
  1171. color: #ff3b30;
  1172. line-height: 24px;
  1173. }
  1174. .desc {
  1175. margin-top: 10px;
  1176. font-size: 16px;
  1177. font-family: Microsoft YaHei;
  1178. font-weight: 400;
  1179. color: #ff3b30;
  1180. line-height: 24px;
  1181. }
  1182. }
  1183. &__body {
  1184. .list {
  1185. &__item {
  1186. padding: 16px 0;
  1187. border-bottom: 1px solid #eee;
  1188. .title {
  1189. font-size: 14px;
  1190. font-family: Microsoft YaHei;
  1191. font-weight: 400;
  1192. color: #333333;
  1193. .note {
  1194. display: inline-block;
  1195. text-align: center;
  1196. line-height: 18px;
  1197. width: 32px;
  1198. height: 20px;
  1199. border: 1px solid #3f8dfd;
  1200. border-radius: 4px;
  1201. color: #3f8dfd;
  1202. font-size: 12px;
  1203. &--yellow {
  1204. border: 1px solid #ff9500;
  1205. color: #ff9500;
  1206. }
  1207. }
  1208. }
  1209. .desc {
  1210. margin-top: 10px;
  1211. font-size: 14px;
  1212. font-family: Microsoft YaHei;
  1213. font-weight: 400;
  1214. color: #333333;
  1215. .note {
  1216. color: #ff3b30;
  1217. line-height: 20px;
  1218. }
  1219. .img {
  1220. width: 100px;
  1221. height: 100px;
  1222. display: inline-block;
  1223. text-align: center;
  1224. img {
  1225. max-width: 100%;
  1226. max-height: 100%;
  1227. }
  1228. }
  1229. }
  1230. }
  1231. }
  1232. }
  1233. }
  1234. }
  1235. &__footer {
  1236. height: 90px;
  1237. border-top: 1px solid #eee;
  1238. text-align: center;
  1239. .confirm {
  1240. width: 200px;
  1241. height: 40px;
  1242. padding: 0;
  1243. border-radius: 20px;
  1244. text-align: center;
  1245. line-height: 40px;
  1246. color: #fff;
  1247. margin: 24px auto;
  1248. }
  1249. }
  1250. }
  1251. .exercises-modal {
  1252. &__content {
  1253. > div {
  1254. font-size: 16px;
  1255. line-height: 30px;
  1256. text-align: center;
  1257. img {
  1258. display: inline;
  1259. }
  1260. }
  1261. }
  1262. }
  1263. }
  1264. </style>