class.vue 37 KB

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