class.vue 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255
  1. <template>
  2. <view style="padding: 0 30rpx 30rpx">
  3. <nav-bar title="我的网课"></nav-bar>
  4. <view class="class" v-for="(item, index) in goodsList" :key="index">
  5. <view
  6. class="class_item"
  7. @click.stop="studyIn(item.goodsId, item.gradeId, item, index)"
  8. >
  9. <image
  10. :src="$method.splitImgHost(item.coverUrl, true)"
  11. class="class_img"
  12. ></image>
  13. <view class="class_text">
  14. <view class="class_title">{{ item.goodsName }}</view>
  15. <view class="content_box">
  16. <image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
  17. <text class="content">{{ item.courseNum }}</text>
  18. 课程
  19. <text class="content">{{ item.secAllNum + item.examNum }}</text>
  20. <text class="content">{{ item.classHours || "-" }}</text>
  21. 学时
  22. </view>
  23. <view
  24. class="content_box"
  25. v-if="item.serviceStartTime && item.serviceEndTime"
  26. >
  27. <image src="/static/icon/wk_icon2.png" class="wk_icon"></image>
  28. 学习服务期:
  29. <text class="content">
  30. {{
  31. $method.timestampToTime(item.serviceStartTime, true, true)
  32. }}-{{ $method.timestampToTime(item.serviceEndTime, true, true) }}
  33. </text>
  34. </view>
  35. </view>
  36. <!-- 不在学习服务期 -->
  37. <template
  38. v-if="
  39. item.serviceStartTime &&
  40. (sysTime < item.serviceStartTime || sysTime > item.serviceEndTime)
  41. "
  42. >
  43. <view
  44. class="class-warm"
  45. v-if="item.gradeId != 0 && item.gradeStatus == 1"
  46. >
  47. <view class="class-warm__text">
  48. <view class="date"> 不在学习服务期,不可以学习了哦 </view>
  49. </view>
  50. </view>
  51. </template>
  52. <template v-else>
  53. <!-- 班级有效期过了 -->
  54. <template v-if="item.classEndTime && item.classEndTime < sysTime">
  55. <view class="class-warm">
  56. <u-icon
  57. class="class-warm__icon"
  58. size="30"
  59. color="#FF3B30"
  60. name="error-circle-fill"
  61. >
  62. </u-icon>
  63. <view class="class-warm__text">
  64. <view class="date"
  65. >班级有效期:{{
  66. $method.timestampToTime(item.classStartTime, true, true)
  67. }}
  68. -
  69. {{
  70. $method.timestampToTime(item.classEndTime, true, true)
  71. }}</view
  72. >
  73. <view class="state"
  74. >班级状态:已过期,有疑问请联系
  75. <text @click="call">020-87085982</text></view
  76. >
  77. </view>
  78. </view>
  79. </template>
  80. <!-- 班级有效期之前 -->
  81. <template
  82. v-else-if="item.classStartTime && item.classStartTime > sysTime"
  83. >
  84. <view class="class-warm">
  85. <u-icon
  86. class="class-warm__icon"
  87. size="30"
  88. color="#FF3B30"
  89. name="error-circle-fill"
  90. >
  91. </u-icon>
  92. <view class="class-warm__text">
  93. <view class="date"
  94. >班级有效期:{{
  95. $method.timestampToTime(item.classStartTime, true, true)
  96. }}
  97. -
  98. {{
  99. $method.timestampToTime(item.classEndTime, true, true)
  100. }}</view
  101. >
  102. <view class="state"
  103. >班级状态:未到学习时间,有疑问请联系
  104. <text @click="call">020-87085982</text></view
  105. >
  106. </view>
  107. </view>
  108. </template>
  109. <!-- 在班级有效期之间或者没有班级有效期 -->
  110. <template v-else>
  111. <view
  112. class="class-warm"
  113. v-if="
  114. item.gradeId != 0 &&
  115. item.gradeStatus == 1 &&
  116. item.classStatus != null
  117. "
  118. >
  119. <view class="class-warm__text">
  120. <view class="date">
  121. 班级状态:
  122. <text v-if="item.classStatus == 1">已开班</text>
  123. <text v-if="item.classStatus == 0">未开班</text>
  124. </view>
  125. <view class="state" v-if="item.classStatus == 0"
  126. >教务处正在为您开通班级,请耐心等待</view
  127. >
  128. <view
  129. class="state"
  130. v-if="
  131. item.classStatus == 1 &&
  132. item.classStartTime &&
  133. item.classEndTime
  134. "
  135. >
  136. 班级有效期:{{
  137. $method.timestampToTime(item.classStartTime, true, true)
  138. }}-{{
  139. $method.timestampToTime(item.classEndTime, true, true)
  140. }}
  141. </view>
  142. </view>
  143. </view>
  144. <!-- 学时审核状态不可审核 -->
  145. <template v-if="item.periodStatus == -1 || item.periodStatus == 2">
  146. <view
  147. class="class-warm"
  148. v-if="item.classStatus == 1 || item.classStatus === null"
  149. >
  150. <view class="class-warm__text">
  151. <view class="date">
  152. <template
  153. v-if="
  154. sysTime >= item.serviceStartTime &&
  155. sysTime <= item.serviceEndTime
  156. "
  157. >
  158. 学习状态:
  159. <text v-if="item.stuAllNum + item.recordNum == 0"
  160. >未学习</text
  161. >
  162. <text
  163. v-else-if="
  164. item.stuAllNum + item.recordNum > 0 &&
  165. item.stuAllNum + item.recordNum <
  166. item.secAllNum + item.examNum
  167. "
  168. >学习中</text
  169. >
  170. <text
  171. v-else-if="
  172. item.stuAllNum + item.recordNum >=
  173. item.secAllNum + item.examNum
  174. "
  175. >已学完</text
  176. >
  177. </template>
  178. <template v-else>
  179. <template v-if="item.serviceStartTime"
  180. >已过学习服务期,不可以学习了哦!</template
  181. >
  182. </template>
  183. </view>
  184. </view>
  185. </view>
  186. </template>
  187. <!-- 学时审核状态可以审核 -->
  188. <template v-if="item.periodStatus != -1">
  189. <view class="class-warm">
  190. <view class="class-warm__text">
  191. <view class="date">
  192. <text v-if="item.periodStatus == 0"
  193. >机构审核:学时审核不通过</text
  194. >
  195. <!-- <text v-else-if="item.periodStatus == 2">学时待审核</text> -->
  196. <text v-else-if="item.periodStatus == 3">学时审核中</text>
  197. <text v-else-if="item.periodStatus == 1">
  198. <text v-if="item.periodPlush > 0"
  199. >学时已上报注册中心</text
  200. >
  201. <text v-else>机构审核:学时审核通过</text>
  202. </text>
  203. </view>
  204. </view>
  205. </view>
  206. <view
  207. class="class-warm"
  208. v-if="item.subscribeId != null && item.periodStatus == 1"
  209. >
  210. <view class="class-warm__text">
  211. <view class="date">
  212. <view v-if="item.subExamStatus === null">待预约考试</view>
  213. <view
  214. v-else-if="
  215. item.subExamStatus === 0 &&
  216. sysTime <
  217. $method.TimeTotimestamp(
  218. $method.timestampToTime(
  219. item.subApplySiteExamTime,
  220. true
  221. ) +
  222. ' ' +
  223. item.subApplySiteStartTime
  224. )
  225. "
  226. >
  227. 待考试,考试时间:
  228. {{
  229. $method.timestampToTime(
  230. item.subApplySiteExamTime,
  231. true
  232. ) +
  233. " " +
  234. item.subApplySiteStartTime
  235. }}
  236. -
  237. {{
  238. $method.timestampToTime(
  239. item.subApplySiteExamTime,
  240. true
  241. ) +
  242. " " +
  243. item.subApplySiteEndTime
  244. }}
  245. </view>
  246. <view v-else-if="item.subExamStatus === 0"
  247. >待出考试结果</view
  248. >
  249. <view v-else-if="item.subExamStatus === 1">
  250. <text v-if="item.subResult === null">待出考试结果</text>
  251. <text v-if="item.subResult === 0"
  252. >考试结果:不通过,需补考</text
  253. >
  254. <text v-else-if="item.subResult === 1"
  255. >考试结果:通过,考试成绩为{{
  256. item.subPerformance
  257. }}</text
  258. >
  259. </view>
  260. <view v-else-if="item.subExamStatus === 2"
  261. >缺考,无成绩,需补考</view
  262. >
  263. <view v-else-if="item.subExamStatus === 3"
  264. >作弊,无成绩,需补考</view
  265. >
  266. <view v-else-if="item.subExamStatus === 4"
  267. >替考,无成绩,需补考</view
  268. >
  269. </view>
  270. </view>
  271. </view>
  272. </template>
  273. </template>
  274. </template>
  275. </view>
  276. <view class="bottomBox">
  277. <template
  278. v-if="
  279. item.gradeStatus == 1 &&
  280. item.status == 1 &&
  281. item.serviceEndTime > sysTime &&
  282. item.serviceStartTime < sysTime &&
  283. item.classEndTime &&
  284. item.classEndTime < sysTime &&
  285. (item.periodStatus == 0 || item.periodStatus == -1) &&
  286. item.studyCount > 0
  287. "
  288. >
  289. <view class="restart" @click.stop="selectClass(item, index)">
  290. 选班重学
  291. </view>
  292. </template>
  293. <template v-else>
  294. <view class="content_box">
  295. <image src="/static/icon/wk_icon3.png" class="wk_icon"></image>
  296. 学习进度:{{ item.stuAllNum + item.recordNum }}/{{
  297. item.secAllNum + item.examNum
  298. }}
  299. </view>
  300. <view class="box_progress">
  301. <view style="width: 60%">
  302. <u-line-progress
  303. :showText="false"
  304. height="22"
  305. active-color="#ff9900"
  306. :show-percent="false"
  307. :percent="
  308. ((item.stuAllNum + item.recordNum) /
  309. (item.secAllNum + item.examNum)) *
  310. 100
  311. "
  312. ></u-line-progress>
  313. </view>
  314. <view>
  315. <u-button
  316. :class="{
  317. disabled:
  318. (item.serviceStartTime &&
  319. (sysTime <= item.serviceStartTime ||
  320. sysTime >= item.serviceEndTime)) ||
  321. (item.classStartTime && sysTime <= item.classStartTime) ||
  322. (item.classEndTime && sysTime >= item.classEndTime) ||
  323. item.learningStatus == 2 ||
  324. item.classStatus == 0 ||
  325. (item.learningStatus == 3 &&
  326. sysTime < item.learningTimeStart),
  327. }"
  328. type="warning"
  329. size="mini"
  330. @click.stop="studyIn(item.goodsId, item.gradeId, item, index)"
  331. >
  332. 进入学习</u-button
  333. >
  334. </view>
  335. </view>
  336. <template v-for="(appoint, appointIndex) in item.examApplyGoodsList">
  337. <view
  338. class="box_progress"
  339. :key="appointIndex"
  340. v-if="
  341. item.applyStatus === 1 &&
  342. !(
  343. sysTime <= item.serviceStartTime ||
  344. sysTime >= item.serviceEndTime ||
  345. (item.classStartTime && sysTime <= item.classStartTime) ||
  346. (item.classEndTime && sysTime >= item.classEndTime) ||
  347. item.learningStatus == 2 ||
  348. item.classStatus == 0 ||
  349. (item.learningStatus == 3 && sysTime < item.learningTimeStart)
  350. )
  351. "
  352. >
  353. <view style="flex: 1; margin-right: 10rpx">
  354. <text style="color: #333333">{{ appoint.applyName }}</text>
  355. </view>
  356. <view>
  357. <u-button
  358. :plain="true"
  359. type="primary"
  360. size="mini"
  361. @click.stop="appointment(item, appoint)"
  362. >预约考试
  363. </u-button>
  364. </view>
  365. </view>
  366. </template>
  367. <view
  368. class="box_progress"
  369. v-if="
  370. item.beforeStatus === 1 &&
  371. !(
  372. sysTime <= item.serviceStartTime ||
  373. sysTime >= item.serviceEndTime ||
  374. (item.classStartTime && sysTime <= item.classStartTime) ||
  375. (item.classEndTime && sysTime >= item.classEndTime) ||
  376. item.learningStatus == 2 ||
  377. item.classStatus == 0 ||
  378. (item.learningStatus == 3 && sysTime < item.learningTimeStart)
  379. )
  380. "
  381. >
  382. <view style="flex: 1; margin-right: 10rpx">
  383. <text style="color: #2979ff">{{ item.beforeName }}</text>
  384. </view>
  385. <view>
  386. <u-button
  387. type="primary"
  388. size="mini"
  389. @click="appBeforeAddress(item.goodsId, item)"
  390. >进入刷题</u-button
  391. >
  392. </view>
  393. </view>
  394. </template>
  395. </view>
  396. </view>
  397. <view v-if="goodsList.length == 0">
  398. <u-empty text="暂无网课" margin-top="500" mode="list"></u-empty>
  399. </view>
  400. <u-popup
  401. v-model="selectClassModal"
  402. @close="gradeValue = -1"
  403. mode="bottom"
  404. border-radius="40"
  405. >
  406. <view class="popup_box">
  407. <view style="margin-bottom: 20rpx">
  408. <view class="line1"></view>
  409. <view class="grade">选择班级</view>
  410. </view>
  411. <u-line color="#D6D6DB" />
  412. <view>
  413. <scroll-view scroll-y="true" style="height: 500rpx">
  414. <view>
  415. <u-radio-group v-model="gradeValue" @change="radioGroupChange">
  416. <view v-for="(item, index) in gradeList" :key="index">
  417. <view
  418. style="display: flex; align-items: center; padding: 20rpx"
  419. >
  420. <view>
  421. <u-radio
  422. shape="circle"
  423. :name="index"
  424. :disabled="
  425. item.studentNum > 0 &&
  426. item.studentNum == item.studentUpper
  427. "
  428. >
  429. <view
  430. :class="
  431. item.checked ? 'white-box blue-box' : 'white-box'
  432. "
  433. >
  434. <view>
  435. <view class="blackTxt">{{ item.className }}</view>
  436. <view class="redTxt" v-if="item.classEndTime">
  437. 有效期至:{{
  438. $method.timestampToTime(
  439. item.classEndTime,
  440. true,
  441. true
  442. )
  443. }}
  444. </view>
  445. <view class="redTxt" v-if="item.classEndTime">
  446. 本班还剩{{
  447. $method.GetRTime(item.classEndTime)
  448. }}天将结束学习</view
  449. >
  450. </view>
  451. </view>
  452. </u-radio>
  453. </view>
  454. </view>
  455. </view>
  456. </u-radio-group>
  457. </view>
  458. </scroll-view>
  459. </view>
  460. <view class="confrim-btn">
  461. <view class="okBtn" @click="okPopup()">确定</view>
  462. </view>
  463. </view>
  464. </u-popup>
  465. <u-modal
  466. v-model="showMark"
  467. title="提示"
  468. @confirm="markConfirm"
  469. confirm-text="复制学习网址"
  470. :show-cancel-button="true"
  471. cancel-text="关闭"
  472. >
  473. <view class="slot-content">
  474. <view>您的学习账号已经开通,请按照步骤操作,进行学习。</view>
  475. <view>1.复制学习地址:{{ markContent }}</view>
  476. <view>2.在【浏览器中】打开复制的学习网址</view>
  477. <view>3.打开学习网址后,选择【个人用户】进行登录</view>
  478. <view>(1)账号:您个人的身份证号码</view>
  479. <view>(2)密码:身份证号码,再加111111</view>
  480. </view>
  481. </u-modal>
  482. <u-modal
  483. v-model="showUserConfirmInfo"
  484. @confirm="confirmUserConfirm"
  485. ref="uModal"
  486. :async-close="true"
  487. @cancel="cancelUserConfirm"
  488. :confirm-text="
  489. '确认' + (confirmCount > 0 ? '(' + confirmCount + ')' : '')
  490. "
  491. :confirm-color="confirmCount > 0 ? '#999' : '#2979ff'"
  492. class="confirm-modal"
  493. title="实名验证确认"
  494. cancel="取消"
  495. :show-cancel-button="true"
  496. >
  497. <view class="slot-content">
  498. <view class="content">
  499. 为避免个人信息不正确导致您的学习时长无效,请认真核对以下信息是否正确,如信息有误请取消当前操作,立刻联系020-38946666
  500. <view class="msg-list">
  501. <view class="item">
  502. <text class="item__left">姓名:</text>
  503. <text class="item__right">{{ userInfo.realname }}</text>
  504. </view>
  505. <view class="item">
  506. <text class="item__left">手机号:</text>
  507. <text class="item__right">{{ userInfo.telphone }}</text>
  508. </view>
  509. <view class="item">
  510. <text class="item__left">身份号:</text>
  511. <text class="item__right">{{ userInfo.idCard }}</text>
  512. </view>
  513. <view class="item">
  514. <u-checkbox v-model="confirmChecked" :label-disabled="false"
  515. >确认个人信息无误</u-checkbox
  516. >
  517. </view>
  518. </view>
  519. </view>
  520. </view>
  521. </u-modal>
  522. </view>
  523. </template>
  524. <script>
  525. import { mapGetters, mapActions } from "vuex";
  526. export default {
  527. computed: {
  528. ...mapGetters(["userInfo"]),
  529. },
  530. data() {
  531. return {
  532. activeItem: {},
  533. confirmTimer: null,
  534. confirmCount: 10,
  535. confirmChecked: false,
  536. showUserConfirmInfo: false,
  537. showMark: false,
  538. list: [1, 2, 3],
  539. goodsList: [],
  540. selectClassModal: false,
  541. gradeList: [],
  542. gradeValue: -1,
  543. param: {
  544. pageNum: 1,
  545. pageSize: 10,
  546. businessId:'',
  547. educationTypeId:'',
  548. projectId:'',
  549. },
  550. total: 0,
  551. sysTime: 0,
  552. itemIndex: "",
  553. selectItem: {},
  554. };
  555. },
  556. onLoad(option) {
  557. // this.sysTime = +this.$method.timest();
  558. this.param.businessId = option.businessId || ''
  559. this.param.educationTypeId = option.educationId || ''
  560. this.param.projectId = option.projectId || '';
  561. this.courseGoodsList();
  562. },
  563. async onShow() {
  564. this.getUserInfo();
  565. if (this.itemIndex !== "") {
  566. this.refreshByIndex();
  567. }
  568. await this.commonSystemTime();
  569. this.sysTime = +this.$method.timest();
  570. },
  571. onReachBottom() {
  572. if (this.goodsList.length < this.total) {
  573. this.param.pageNum++;
  574. this.courseGoodsList();
  575. }
  576. },
  577. methods: {
  578. ...mapActions(["getUserInfo"]),
  579. /**
  580. * 复制网址
  581. */
  582. markConfirm() {
  583. uni.setClipboardData({
  584. data: this.markContent,
  585. success: function () {
  586. console.log("success");
  587. },
  588. });
  589. },
  590. /**
  591. * 返回刷新之前进入的课程数据
  592. */
  593. refreshByIndex() {
  594. let self = this;
  595. this.$api
  596. .courseGoodsList({
  597. pageNum: this.itemIndex + 1,
  598. pageSize: 1,
  599. businessId:this.param.businessId,
  600. educationTypeId:this.param.educationTypeId,
  601. projectId:this.param.projectId
  602. })
  603. .then((res) => {
  604. if (res.data.code == 200) {
  605. this.$set(this.goodsList, this.itemIndex, res.data.rows[0]);
  606. }
  607. });
  608. },
  609. commonSystemTime() {
  610. return new Promise((resolve) => {
  611. this.$api.commonSystemTime().then((res) => {
  612. this.sysTime = res.data.data;
  613. });
  614. });
  615. },
  616. selectClass(item, index) {
  617. console.log(item);
  618. this.itemIndex = index;
  619. this.selectItem = item;
  620. this.selectClassModal = true;
  621. this.goodsGradeList(item.goodsId);
  622. },
  623. radioGroupChange(e) {
  624. console.log(e);
  625. },
  626. userConfirmInfoDetail() {
  627. return new Promise((resolve) => {
  628. this.$api
  629. .userConfirmInfoDetail({
  630. orderGoodsId: this.activeItem.orderGoodsId,
  631. })
  632. .then((res) => {
  633. if (!res.data.data) {
  634. clearInterval(this.confirmTimer);
  635. this.confirmCount = 10;
  636. this.showUserConfirmInfo = true;
  637. this.confirmTimer = setInterval(() => {
  638. if (this.confirmCount > 0) {
  639. this.confirmCount--;
  640. } else {
  641. clearInterval(this.confirmTimer);
  642. }
  643. }, 1000);
  644. } else {
  645. if (res.data.data.pushInfo) {
  646. resolve(true);
  647. } else {
  648. uni.showModal({
  649. showCancel: false,
  650. title: "提示",
  651. content:
  652. "开通信息推送不成功,无法进入学习,请联系020-87085982!",
  653. });
  654. resolve(false);
  655. }
  656. }
  657. });
  658. });
  659. },
  660. confirmUserConfirm() {
  661. this.$refs.uModal.clearLoading();
  662. if (this.confirmCount <= 0) {
  663. if (this.confirmChecked) {
  664. let infoJson = {
  665. realname: this.userInfo.realname,
  666. idCard: this.userInfo.idCard,
  667. telphone: this.userInfo.telphone,
  668. };
  669. this.$api
  670. .userConfirminfo({
  671. orderGoodsId: this.activeItem.orderGoodsId,
  672. infoJson: JSON.stringify(infoJson),
  673. })
  674. .then((res) => {
  675. if (res.data.data.pushInfo) {
  676. uni.showToast({
  677. icon: "none",
  678. title: "提交成功",
  679. });
  680. } else {
  681. uni.showModal({
  682. showCancel: false,
  683. title: "提示",
  684. content:
  685. "开通信息推送不成功,无法进入学习,请联系020-87085982!",
  686. });
  687. }
  688. this.showUserConfirmInfo = false;
  689. });
  690. } else {
  691. uni.showToast({
  692. icon: "none",
  693. title: "请勾选确认个人信息无误",
  694. });
  695. }
  696. } else {
  697. return;
  698. }
  699. },
  700. cancelUserConfirm() {
  701. clearInterval(this.confirmTimer);
  702. },
  703. goodsGradeList(id) {
  704. let self = this;
  705. this.$api
  706. .goodsGradeList({
  707. goodsId: id,
  708. })
  709. .then((res) => {
  710. if (res.data.code == 200) {
  711. self.gradeList = res.data.rows;
  712. if (self.gradeList.length == 0) {
  713. let item = {
  714. className: "系统分班",
  715. gradeId: 0,
  716. };
  717. self.gradeList.push(item);
  718. } else {
  719. let isGradeFull = self.gradeList.every(
  720. (item) =>
  721. item.studentNum > 0 && item.studentNum == item.studentUpper
  722. );
  723. //所有班级都满了
  724. if (isGradeFull) {
  725. let item = {
  726. className: "系统分班",
  727. gradeId: 0,
  728. };
  729. self.gradeList.unshift(item);
  730. }
  731. }
  732. }
  733. });
  734. },
  735. appBeforeAddress(goodsId, item) {
  736. this.$api
  737. .appBeforeAddress({
  738. // goodsId,
  739. orderGoodsId: item.orderGoodsId,
  740. })
  741. .then((res) => {
  742. if (res.data.code == 200) {
  743. uni.navigateToMiniProgram({
  744. appId: res.data.data.url,
  745. success(res) {
  746. // 打开成功
  747. },
  748. });
  749. } else {
  750. uni.showModal({
  751. title: "提示",
  752. content: res.data.msg,
  753. showCancel: false,
  754. });
  755. }
  756. });
  757. },
  758. courseGoodsList() {
  759. let self = this;
  760. this.$api.courseGoodsList(this.param).then((res) => {
  761. if (res.data.code == 200) {
  762. self.goodsList.push.apply(self.goodsList, res.data.rows);
  763. self.total = res.data.total;
  764. }
  765. });
  766. },
  767. async studyIn(v, i, item, index) {
  768. this.activeItem = item;
  769. if (item.interfaceAccountId > 0) {
  770. //学习账号已开通
  771. if (item.learnStatus == 1) {
  772. //跳转第三方h5
  773. // this.showMark = true;
  774. uni.navigateTo({
  775. url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&isOther=1`,
  776. });
  777. return;
  778. // uni.navigateTo({
  779. // url:'/pages/webview/index?url='+item.officialLearningUrl
  780. // })
  781. // return;
  782. } else {
  783. uni.showModal({
  784. showCancel: false,
  785. content:
  786. "您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!",
  787. });
  788. return;
  789. }
  790. return;
  791. }
  792. if (
  793. item.serviceStartTime &&
  794. (this.sysTime <= item.serviceStartTime ||
  795. this.sysTime >= item.serviceEndTime)
  796. ) {
  797. uni.showToast({
  798. icon: "none",
  799. title: "不在学习服务期,不能进入学习",
  800. });
  801. return;
  802. }
  803. if (
  804. (item.classStartTime && this.sysTime <= item.classStartTime) ||
  805. (item.classEndTime && this.sysTime >= item.classEndTime)
  806. ) {
  807. uni.showToast({
  808. icon: "none",
  809. title: "不在班级有效期,不能进入学习",
  810. });
  811. return;
  812. }
  813. if (item.learningStatus == 2) {
  814. uni.showToast({
  815. icon: "none",
  816. title: "开放学习时间待定,不能进入学习",
  817. });
  818. return;
  819. }
  820. if (item.classStatus == 0) {
  821. uni.showToast({
  822. icon: "none",
  823. title: "尚未开班,不能进入学习",
  824. });
  825. return;
  826. }
  827. console.log(this.sysTime, item.learningTimeStart);
  828. console.log(this.sysTime < item.learningTimeStart);
  829. if (item.learningStatus == 3 && this.sysTime < item.learningTimeStart) {
  830. uni.showToast({
  831. icon: "none",
  832. title: "不在开放学习时间,不能进入学习",
  833. });
  834. return;
  835. }
  836. var confirmDetail = true;
  837. if (item.educationName == "继续教育") {
  838. if (
  839. item.officialName &&
  840. item.businessName == "二级" &&
  841. item.projectName == "建造师"
  842. ) {
  843. confirmDetail = await this.userConfirmInfoDetail();
  844. }
  845. }
  846. if (!confirmDetail) {
  847. return;
  848. }
  849. // //内部系统
  850. // if (item.interfacePushId > 0 && item.officialStatus != 1) {
  851. // uni.showModal({
  852. // showCancel: false,
  853. // content: '机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!'
  854. // });
  855. // return;
  856. // }
  857. this.itemIndex = index;
  858. if (
  859. item.gradeStatus == 1 &&
  860. item.status == 1 &&
  861. item.serviceEndTime > this.sysTime &&
  862. item.classEndTime &&
  863. item.classEndTime < this.sysTime &&
  864. (item.periodStatus == 0 || item.periodStatus == -1) &&
  865. item.studyCount > 0
  866. ) {
  867. this.selectClass(item, index);
  868. return;
  869. }
  870. let rebuildStatus = await this.courseGoodsRebuildStatus(
  871. item.goodsId,
  872. item.gradeId
  873. );
  874. if (rebuildStatus == 0) {
  875. this.$navTo.togo("/pages2/learn/details", {
  876. gradeId: item.gradeId,
  877. goodsId: item.goodsId,
  878. orderGoodsId: item.orderGoodsId,
  879. });
  880. return;
  881. }
  882. // if (item.educationName == '继续教育') {
  883. this.$api
  884. .lockLockStatus({
  885. action: "jxjy",
  886. uuid: this.$method.getUuid(),
  887. })
  888. .then((res) => {
  889. if (res.data.code == 200) {
  890. //有其他端在操作,不能学习
  891. uni.showToast({
  892. icon: "none",
  893. title: res.data.msg,
  894. mask: true,
  895. duration: 3000,
  896. });
  897. } else if (res.data.code == 500) {
  898. //可以学习
  899. // if (item.courseNum == 1) {
  900. // this.$api
  901. // .courseCourseList({
  902. // pageNum: 1,
  903. // pageSize: 1,
  904. // goodsId: item.goodsId,
  905. // gradeId: item.gradeId,
  906. // orderGoodsId: item.orderGoodsId,
  907. // })
  908. // .then((res) => {
  909. // if (res.data.code == 200) {
  910. // // if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') {
  911. // // this.userConfirmInfoDetail().then(() => {
  912. // // uni.navigateTo({
  913. // // url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`
  914. // // })
  915. // // })
  916. // // } else {
  917. // uni.navigateTo({
  918. // url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`,
  919. // });
  920. // // }
  921. // }
  922. // });
  923. // return;
  924. // }
  925. // if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') {
  926. // // this.userConfirmInfoDetail().then(() => {
  927. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  928. // // })
  929. // } else {
  930. this.$navTo.togo(
  931. `/pages3/polyv/detail?goodsId=${item.goodsId}&gid=${i}&orderGoodsId=${item.orderGoodsId}`
  932. );
  933. // }
  934. }
  935. });
  936. // } else {
  937. // if (item.courseNum == 1) {
  938. // this.$api.courseCourseList({
  939. // pageNum: 1,
  940. // pageSize: 1,
  941. // goodsId: item.goodsId,
  942. // gradeId: item.gradeId,
  943. // orderGoodsId: item.orderGoodsId,
  944. // }).then(res => {
  945. // if (res.data.code == 200) {
  946. // uni.navigateTo({
  947. // url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`
  948. // })
  949. // }
  950. // });
  951. // return;
  952. // }
  953. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  954. // }
  955. },
  956. /**
  957. * @param {Object} goodsId 商品id
  958. * 查询商品重修状态
  959. */
  960. courseGoodsRebuildStatus(goodsId, gradeId) {
  961. return new Promise((resolve) => {
  962. this.$api
  963. .courseGoodsRebuildStatus({
  964. goodsId: goodsId,
  965. gradeId: gradeId,
  966. })
  967. .then((res) => {
  968. resolve(res.data.data);
  969. });
  970. });
  971. },
  972. appointment(item, appoint) {
  973. var data = {
  974. goodsId: item.goodsId,
  975. gradeId: item.gradeId,
  976. applyId: appoint.applyId,
  977. orderGoodsId: item.orderGoodsId,
  978. };
  979. this.$api.getApplysubscribe(data).then((res) => {
  980. if (res.data.code === 500) {
  981. uni.showModal({
  982. showCancel: false,
  983. content: res.data.msg,
  984. });
  985. }
  986. if (res.data.code === 200) {
  987. this.$navTo.togo("/pages2/appointment/index", {
  988. goodsId: item.goodsId,
  989. gradeId: item.gradeId,
  990. orderGoodsId: item.orderGoodsId,
  991. applyId: appoint.applyId,
  992. });
  993. }
  994. });
  995. },
  996. okPopup() {
  997. if (this.gradeValue == -1) {
  998. uni.showToast({
  999. icon: "none",
  1000. title: "请选择班级",
  1001. });
  1002. return;
  1003. }
  1004. this.$api
  1005. .changeGrade({
  1006. goodsId: this.selectItem.goodsId,
  1007. gradeId: this.gradeValue,
  1008. oldGradeId: this.selectItem.gradeId,
  1009. orderGoodsId: this.selectItem.orderGoodsId,
  1010. userId: this.selectItem.userId,
  1011. })
  1012. .then((res) => {
  1013. if (res.data.code == 200) {
  1014. if (this.itemIndex !== "") {
  1015. this.refreshByIndex();
  1016. }
  1017. this.selectClassModal = false;
  1018. uni.showToast({
  1019. title: "选班成功",
  1020. });
  1021. } else {
  1022. uni.showToast({
  1023. icon: "none",
  1024. title: res.data.msg,
  1025. });
  1026. }
  1027. });
  1028. },
  1029. call() {
  1030. uni.makePhoneCall({
  1031. phoneNumber: "020-87085982", //仅为示例
  1032. });
  1033. },
  1034. },
  1035. };
  1036. </script>
  1037. <style>
  1038. page {
  1039. background: #eaeef1;
  1040. }
  1041. </style>
  1042. <style scope lang="scss">
  1043. .box_progress {
  1044. display: flex;
  1045. justify-content: space-between;
  1046. align-items: center;
  1047. margin-top: 20rpx;
  1048. .disabled {
  1049. opacity: 0.6;
  1050. }
  1051. }
  1052. .bottomBox {
  1053. background: #ffffff;
  1054. width: 94%;
  1055. border-bottom-left-radius: 24rpx;
  1056. border-bottom-right-radius: 24rpx;
  1057. margin: 0 auto;
  1058. padding: 20rpx;
  1059. .restart {
  1060. margin: 0 auto;
  1061. text-align: center;
  1062. line-height: 80rpx;
  1063. color: #fff;
  1064. font-size: 30rpx;
  1065. width: 440rpx;
  1066. height: 80rpx;
  1067. background: #ff0000;
  1068. border-radius: 40rpx 40rpx 40rpx 40rpx;
  1069. }
  1070. }
  1071. .content_box {
  1072. font-size: 24rpx;
  1073. display: flex;
  1074. align-items: center;
  1075. color: #999999;
  1076. margin-top: 8rpx;
  1077. }
  1078. .content {
  1079. color: #000000;
  1080. margin: 0 8rpx;
  1081. }
  1082. .wk_icon {
  1083. width: 24rpx;
  1084. height: 24rpx;
  1085. margin-right: 8rpx;
  1086. }
  1087. .class {
  1088. margin-bottom: 30rpx;
  1089. .class_item {
  1090. width: 100%;
  1091. background: #ffffff;
  1092. box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
  1093. border-radius: 24rpx;
  1094. padding: 20rpx;
  1095. z-index: 999;
  1096. position: relative;
  1097. .class_img {
  1098. height: 367rpx;
  1099. width: 100%;
  1100. border-radius: 24rpx;
  1101. }
  1102. .class_text {
  1103. padding: 0 20rpx;
  1104. .class_title {
  1105. color: #333333;
  1106. font-weight: bold;
  1107. font-size: 32rpx;
  1108. }
  1109. }
  1110. .class-warm {
  1111. padding: 10rpx 20rpx;
  1112. display: flex;
  1113. align-items: flex-start;
  1114. &__icon {
  1115. margin-right: 10rpx;
  1116. }
  1117. &__text {
  1118. .date {
  1119. font-size: 24rpx;
  1120. font-weight: bold;
  1121. color: #ff3b30;
  1122. }
  1123. .state {
  1124. margin-top: 15rpx;
  1125. font-size: 24rpx;
  1126. font-weight: bold;
  1127. color: #ff3b30;
  1128. }
  1129. }
  1130. }
  1131. }
  1132. }
  1133. .popup_box {
  1134. height: 700rpx;
  1135. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  1136. border-radius: 32rpx 32rpx 0rpx 0rpx;
  1137. .line1 {
  1138. width: 80rpx;
  1139. height: 8rpx;
  1140. background: #999999;
  1141. border-radius: 4rpx;
  1142. margin: 0 auto;
  1143. margin-top: 15rpx;
  1144. }
  1145. .grade {
  1146. height: 23rpx;
  1147. font-size: 24rpx;
  1148. color: #999999;
  1149. margin: 0 auto;
  1150. margin-top: 15rpx;
  1151. text-align: center;
  1152. }
  1153. .confrim-btn {
  1154. height: 98rpx;
  1155. width: 100%;
  1156. display: flex;
  1157. align-items: center;
  1158. justify-content: center;
  1159. .okBtn {
  1160. width: 200rpx;
  1161. height: 64rpx;
  1162. background: linear-gradient(0deg, #015eea, #00c0fa);
  1163. border-radius: 32rpx;
  1164. color: #ffffff;
  1165. text-align: center;
  1166. line-height: 64rpx;
  1167. }
  1168. }
  1169. }
  1170. .slot-content {
  1171. padding: 0 20rpx;
  1172. }
  1173. .confirm-modal {
  1174. .slot-content {
  1175. padding: 0 20rpx;
  1176. .content {
  1177. color: red;
  1178. .msg-list {
  1179. .item {
  1180. padding: 20rpx 0;
  1181. &__left {
  1182. color: #666;
  1183. margin-right: 20rpx;
  1184. }
  1185. &__right {
  1186. color: #333;
  1187. }
  1188. }
  1189. }
  1190. }
  1191. }
  1192. }
  1193. </style>