class.vue 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244
  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. },
  547. total: 0,
  548. sysTime: 0,
  549. itemIndex: "",
  550. selectItem: {},
  551. };
  552. },
  553. onLoad(option) {
  554. // this.sysTime = +this.$method.timest();
  555. this.courseGoodsList();
  556. },
  557. async onShow() {
  558. this.getUserInfo();
  559. if (this.itemIndex !== "") {
  560. this.refreshByIndex();
  561. }
  562. await this.commonSystemTime();
  563. this.sysTime = +this.$method.timest();
  564. },
  565. onReachBottom() {
  566. if (this.goodsList.length < this.total) {
  567. this.param.pageNum++;
  568. this.courseGoodsList();
  569. }
  570. },
  571. methods: {
  572. ...mapActions(["getUserInfo"]),
  573. /**
  574. * 复制网址
  575. */
  576. markConfirm() {
  577. uni.setClipboardData({
  578. data: this.markContent,
  579. success: function () {
  580. console.log("success");
  581. },
  582. });
  583. },
  584. /**
  585. * 返回刷新之前进入的课程数据
  586. */
  587. refreshByIndex() {
  588. let self = this;
  589. this.$api
  590. .courseGoodsList({
  591. pageNum: this.itemIndex + 1,
  592. pageSize: 1,
  593. })
  594. .then((res) => {
  595. if (res.data.code == 200) {
  596. this.$set(this.goodsList, this.itemIndex, res.data.rows[0]);
  597. }
  598. });
  599. },
  600. commonSystemTime() {
  601. return new Promise((resolve) => {
  602. this.$api.commonSystemTime().then((res) => {
  603. this.sysTime = res.data.data;
  604. });
  605. });
  606. },
  607. selectClass(item, index) {
  608. console.log(item);
  609. this.itemIndex = index;
  610. this.selectItem = item;
  611. this.selectClassModal = true;
  612. this.goodsGradeList(item.goodsId);
  613. },
  614. radioGroupChange(e) {
  615. console.log(e);
  616. },
  617. userConfirmInfoDetail() {
  618. return new Promise((resolve) => {
  619. this.$api
  620. .userConfirmInfoDetail({
  621. orderGoodsId: this.activeItem.orderGoodsId,
  622. })
  623. .then((res) => {
  624. if (!res.data.data) {
  625. clearInterval(this.confirmTimer);
  626. this.confirmCount = 10;
  627. this.showUserConfirmInfo = true;
  628. this.confirmTimer = setInterval(() => {
  629. if (this.confirmCount > 0) {
  630. this.confirmCount--;
  631. } else {
  632. clearInterval(this.confirmTimer);
  633. }
  634. }, 1000);
  635. } else {
  636. if (res.data.data.pushInfo) {
  637. resolve(true);
  638. } else {
  639. uni.showModal({
  640. showCancel: false,
  641. title: "提示",
  642. content:
  643. "开通信息推送不成功,无法进入学习,请联系020-87085982!",
  644. });
  645. resolve(false);
  646. }
  647. }
  648. });
  649. });
  650. },
  651. confirmUserConfirm() {
  652. this.$refs.uModal.clearLoading();
  653. if (this.confirmCount <= 0) {
  654. if (this.confirmChecked) {
  655. let infoJson = {
  656. realname: this.userInfo.realname,
  657. idCard: this.userInfo.idCard,
  658. telphone: this.userInfo.telphone,
  659. };
  660. this.$api
  661. .userConfirminfo({
  662. orderGoodsId: this.activeItem.orderGoodsId,
  663. infoJson: JSON.stringify(infoJson),
  664. })
  665. .then((res) => {
  666. if (res.data.data.pushInfo) {
  667. uni.showToast({
  668. icon: "none",
  669. title: "提交成功",
  670. });
  671. } else {
  672. uni.showModal({
  673. showCancel: false,
  674. title: "提示",
  675. content:
  676. "开通信息推送不成功,无法进入学习,请联系020-87085982!",
  677. });
  678. }
  679. this.showUserConfirmInfo = false;
  680. });
  681. } else {
  682. uni.showToast({
  683. icon: "none",
  684. title: "请勾选确认个人信息无误",
  685. });
  686. }
  687. } else {
  688. return;
  689. }
  690. },
  691. cancelUserConfirm() {
  692. clearInterval(this.confirmTimer);
  693. },
  694. goodsGradeList(id) {
  695. let self = this;
  696. this.$api
  697. .goodsGradeList({
  698. goodsId: id,
  699. })
  700. .then((res) => {
  701. if (res.data.code == 200) {
  702. self.gradeList = res.data.rows;
  703. if (self.gradeList.length == 0) {
  704. let item = {
  705. className: "系统分班",
  706. gradeId: 0,
  707. };
  708. self.gradeList.push(item);
  709. } else {
  710. let isGradeFull = self.gradeList.every(
  711. (item) =>
  712. item.studentNum > 0 && item.studentNum == item.studentUpper
  713. );
  714. //所有班级都满了
  715. if (isGradeFull) {
  716. let item = {
  717. className: "系统分班",
  718. gradeId: 0,
  719. };
  720. self.gradeList.unshift(item);
  721. }
  722. }
  723. }
  724. });
  725. },
  726. appBeforeAddress(goodsId, item) {
  727. this.$api
  728. .appBeforeAddress({
  729. // goodsId,
  730. orderGoodsId: item.orderGoodsId,
  731. })
  732. .then((res) => {
  733. if (res.data.code == 200) {
  734. uni.navigateToMiniProgram({
  735. appId: res.data.data.url,
  736. success(res) {
  737. // 打开成功
  738. },
  739. });
  740. } else {
  741. uni.showModal({
  742. title: "提示",
  743. content: res.data.msg,
  744. showCancel: false,
  745. });
  746. }
  747. });
  748. },
  749. courseGoodsList() {
  750. let self = this;
  751. this.$api.courseGoodsList(this.param).then((res) => {
  752. if (res.data.code == 200) {
  753. self.goodsList.push.apply(self.goodsList, res.data.rows);
  754. self.total = res.data.total;
  755. }
  756. });
  757. },
  758. async studyIn(v, i, item, index) {
  759. this.activeItem = item;
  760. if (item.interfaceAccountId > 0) {
  761. //学习账号已开通
  762. if (item.learnStatus == 1) {
  763. //跳转第三方h5
  764. // this.showMark = true;
  765. uni.navigateTo({
  766. url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&isOther=1`,
  767. });
  768. return;
  769. // uni.navigateTo({
  770. // url:'/pages/webview/index?url='+item.officialLearningUrl
  771. // })
  772. // return;
  773. } else {
  774. uni.showModal({
  775. showCancel: false,
  776. content:
  777. "您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!",
  778. });
  779. return;
  780. }
  781. return;
  782. }
  783. if (
  784. item.serviceStartTime &&
  785. (this.sysTime <= item.serviceStartTime ||
  786. this.sysTime >= item.serviceEndTime)
  787. ) {
  788. uni.showToast({
  789. icon: "none",
  790. title: "不在学习服务期,不能进入学习",
  791. });
  792. return;
  793. }
  794. if (
  795. (item.classStartTime && this.sysTime <= item.classStartTime) ||
  796. (item.classEndTime && this.sysTime >= item.classEndTime)
  797. ) {
  798. uni.showToast({
  799. icon: "none",
  800. title: "不在班级有效期,不能进入学习",
  801. });
  802. return;
  803. }
  804. if (item.learningStatus == 2) {
  805. uni.showToast({
  806. icon: "none",
  807. title: "开放学习时间待定,不能进入学习",
  808. });
  809. return;
  810. }
  811. if (item.classStatus == 0) {
  812. uni.showToast({
  813. icon: "none",
  814. title: "尚未开班,不能进入学习",
  815. });
  816. return;
  817. }
  818. console.log(this.sysTime, item.learningTimeStart);
  819. console.log(this.sysTime < item.learningTimeStart);
  820. if (item.learningStatus == 3 && this.sysTime < item.learningTimeStart) {
  821. uni.showToast({
  822. icon: "none",
  823. title: "不在开放学习时间,不能进入学习",
  824. });
  825. return;
  826. }
  827. var confirmDetail = true;
  828. if (item.educationName == "继续教育") {
  829. if (
  830. item.officialName &&
  831. item.businessName == "二级" &&
  832. item.projectName == "建造师"
  833. ) {
  834. confirmDetail = await this.userConfirmInfoDetail();
  835. }
  836. }
  837. if (!confirmDetail) {
  838. return;
  839. }
  840. // //内部系统
  841. // if (item.interfacePushId > 0 && item.officialStatus != 1) {
  842. // uni.showModal({
  843. // showCancel: false,
  844. // content: '机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!'
  845. // });
  846. // return;
  847. // }
  848. this.itemIndex = index;
  849. if (
  850. item.gradeStatus == 1 &&
  851. item.status == 1 &&
  852. item.serviceEndTime > this.sysTime &&
  853. item.classEndTime &&
  854. item.classEndTime < this.sysTime &&
  855. (item.periodStatus == 0 || item.periodStatus == -1) &&
  856. item.studyCount > 0
  857. ) {
  858. this.selectClass(item, index);
  859. return;
  860. }
  861. let rebuildStatus = await this.courseGoodsRebuildStatus(
  862. item.goodsId,
  863. item.gradeId
  864. );
  865. if (rebuildStatus == 0) {
  866. this.$navTo.togo("/pages2/learn/details", {
  867. gradeId: item.gradeId,
  868. goodsId: item.goodsId,
  869. orderGoodsId: item.orderGoodsId,
  870. });
  871. return;
  872. }
  873. // if (item.educationName == '继续教育') {
  874. this.$api
  875. .lockLockStatus({
  876. action: "jxjy",
  877. uuid: this.$method.getUuid(),
  878. })
  879. .then((res) => {
  880. if (res.data.code == 200) {
  881. //有其他端在操作,不能学习
  882. uni.showToast({
  883. icon: "none",
  884. title: res.data.msg,
  885. mask: true,
  886. duration: 3000,
  887. });
  888. } else if (res.data.code == 500) {
  889. //可以学习
  890. if (item.courseNum == 1) {
  891. this.$api
  892. .courseCourseList({
  893. pageNum: 1,
  894. pageSize: 1,
  895. goodsId: item.goodsId,
  896. gradeId: item.gradeId,
  897. orderGoodsId: item.orderGoodsId,
  898. })
  899. .then((res) => {
  900. if (res.data.code == 200) {
  901. // if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') {
  902. // this.userConfirmInfoDetail().then(() => {
  903. // uni.navigateTo({
  904. // url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`
  905. // })
  906. // })
  907. // } else {
  908. uni.navigateTo({
  909. url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`,
  910. });
  911. // }
  912. }
  913. });
  914. return;
  915. }
  916. // if(item.officialName && item.businessName == '二级' && item.projectName == '建造师') {
  917. // // this.userConfirmInfoDetail().then(() => {
  918. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  919. // // })
  920. // } else {
  921. this.$navTo.togo(
  922. `/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`
  923. );
  924. // }
  925. }
  926. });
  927. // } else {
  928. // if (item.courseNum == 1) {
  929. // this.$api.courseCourseList({
  930. // pageNum: 1,
  931. // pageSize: 1,
  932. // goodsId: item.goodsId,
  933. // gradeId: item.gradeId,
  934. // orderGoodsId: item.orderGoodsId,
  935. // }).then(res => {
  936. // if (res.data.code == 200) {
  937. // uni.navigateTo({
  938. // url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`
  939. // })
  940. // }
  941. // });
  942. // return;
  943. // }
  944. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  945. // }
  946. },
  947. /**
  948. * @param {Object} goodsId 商品id
  949. * 查询商品重修状态
  950. */
  951. courseGoodsRebuildStatus(goodsId, gradeId) {
  952. return new Promise((resolve) => {
  953. this.$api
  954. .courseGoodsRebuildStatus({
  955. goodsId: goodsId,
  956. gradeId: gradeId,
  957. })
  958. .then((res) => {
  959. resolve(res.data.data);
  960. });
  961. });
  962. },
  963. appointment(item, appoint) {
  964. var data = {
  965. goodsId: item.goodsId,
  966. gradeId: item.gradeId,
  967. applyId: appoint.applyId,
  968. orderGoodsId: item.orderGoodsId,
  969. };
  970. this.$api.getApplysubscribe(data).then((res) => {
  971. if (res.data.code === 500) {
  972. uni.showModal({
  973. showCancel: false,
  974. content: res.data.msg,
  975. });
  976. }
  977. if (res.data.code === 200) {
  978. this.$navTo.togo("/pages2/appointment/index", {
  979. goodsId: item.goodsId,
  980. gradeId: item.gradeId,
  981. orderGoodsId: item.orderGoodsId,
  982. applyId: appoint.applyId,
  983. });
  984. }
  985. });
  986. },
  987. okPopup() {
  988. if (this.gradeValue == -1) {
  989. uni.showToast({
  990. icon: "none",
  991. title: "请选择班级",
  992. });
  993. return;
  994. }
  995. this.$api
  996. .changeGrade({
  997. goodsId: this.selectItem.goodsId,
  998. gradeId: this.gradeValue,
  999. oldGradeId: this.selectItem.gradeId,
  1000. orderGoodsId: this.selectItem.orderGoodsId,
  1001. userId: this.selectItem.userId,
  1002. })
  1003. .then((res) => {
  1004. if (res.data.code == 200) {
  1005. if (this.itemIndex !== "") {
  1006. this.refreshByIndex();
  1007. }
  1008. this.selectClassModal = false;
  1009. uni.showToast({
  1010. title: "选班成功",
  1011. });
  1012. } else {
  1013. uni.showToast({
  1014. icon: "none",
  1015. title: res.data.msg,
  1016. });
  1017. }
  1018. });
  1019. },
  1020. call() {
  1021. uni.makePhoneCall({
  1022. phoneNumber: "020-87085982", //仅为示例
  1023. });
  1024. },
  1025. },
  1026. };
  1027. </script>
  1028. <style>
  1029. page {
  1030. background: #eaeef1;
  1031. }
  1032. </style>
  1033. <style scope lang="scss">
  1034. .box_progress {
  1035. display: flex;
  1036. justify-content: space-between;
  1037. align-items: center;
  1038. margin-top: 20rpx;
  1039. .disabled {
  1040. opacity: 0.6;
  1041. }
  1042. }
  1043. .bottomBox {
  1044. background: #ffffff;
  1045. width: 94%;
  1046. border-bottom-left-radius: 24rpx;
  1047. border-bottom-right-radius: 24rpx;
  1048. margin: 0 auto;
  1049. padding: 20rpx;
  1050. .restart {
  1051. margin: 0 auto;
  1052. text-align: center;
  1053. line-height: 80rpx;
  1054. color: #fff;
  1055. font-size: 30rpx;
  1056. width: 440rpx;
  1057. height: 80rpx;
  1058. background: #ff0000;
  1059. border-radius: 40rpx 40rpx 40rpx 40rpx;
  1060. }
  1061. }
  1062. .content_box {
  1063. font-size: 24rpx;
  1064. display: flex;
  1065. align-items: center;
  1066. color: #999999;
  1067. margin-top: 8rpx;
  1068. }
  1069. .content {
  1070. color: #000000;
  1071. margin: 0 8rpx;
  1072. }
  1073. .wk_icon {
  1074. width: 24rpx;
  1075. height: 24rpx;
  1076. margin-right: 8rpx;
  1077. }
  1078. .class {
  1079. margin-bottom: 30rpx;
  1080. .class_item {
  1081. width: 100%;
  1082. background: #ffffff;
  1083. box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
  1084. border-radius: 24rpx;
  1085. padding: 20rpx;
  1086. z-index: 999;
  1087. position: relative;
  1088. .class_img {
  1089. height: 367rpx;
  1090. width: 100%;
  1091. border-radius: 24rpx;
  1092. }
  1093. .class_text {
  1094. padding: 0 20rpx;
  1095. .class_title {
  1096. color: #333333;
  1097. font-weight: bold;
  1098. font-size: 32rpx;
  1099. }
  1100. }
  1101. .class-warm {
  1102. padding: 10rpx 20rpx;
  1103. display: flex;
  1104. align-items: flex-start;
  1105. &__icon {
  1106. margin-right: 10rpx;
  1107. }
  1108. &__text {
  1109. .date {
  1110. font-size: 24rpx;
  1111. font-weight: bold;
  1112. color: #ff3b30;
  1113. }
  1114. .state {
  1115. margin-top: 15rpx;
  1116. font-size: 24rpx;
  1117. font-weight: bold;
  1118. color: #ff3b30;
  1119. }
  1120. }
  1121. }
  1122. }
  1123. }
  1124. .popup_box {
  1125. height: 700rpx;
  1126. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  1127. border-radius: 32rpx 32rpx 0rpx 0rpx;
  1128. .line1 {
  1129. width: 80rpx;
  1130. height: 8rpx;
  1131. background: #999999;
  1132. border-radius: 4rpx;
  1133. margin: 0 auto;
  1134. margin-top: 15rpx;
  1135. }
  1136. .grade {
  1137. height: 23rpx;
  1138. font-size: 24rpx;
  1139. color: #999999;
  1140. margin: 0 auto;
  1141. margin-top: 15rpx;
  1142. text-align: center;
  1143. }
  1144. .confrim-btn {
  1145. height: 98rpx;
  1146. width: 100%;
  1147. display: flex;
  1148. align-items: center;
  1149. justify-content: center;
  1150. .okBtn {
  1151. width: 200rpx;
  1152. height: 64rpx;
  1153. background: linear-gradient(0deg, #015eea, #00c0fa);
  1154. border-radius: 32rpx;
  1155. color: #ffffff;
  1156. text-align: center;
  1157. line-height: 64rpx;
  1158. }
  1159. }
  1160. }
  1161. .slot-content {
  1162. padding: 0 20rpx;
  1163. }
  1164. .confirm-modal {
  1165. .slot-content {
  1166. padding: 0 20rpx;
  1167. .content {
  1168. color: red;
  1169. .msg-list {
  1170. .item {
  1171. padding: 20rpx 0;
  1172. &__left {
  1173. color: #666;
  1174. margin-right: 20rpx;
  1175. }
  1176. &__right {
  1177. color: #333;
  1178. }
  1179. }
  1180. }
  1181. }
  1182. }
  1183. }
  1184. </style>