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