index.vue 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448
  1. <template>
  2. <view class="learnings">
  3. <u-navbar
  4. :is-back="false"
  5. title="学习中心"
  6. :border-bottom="false"
  7. title-color="#333333"
  8. back-icon-color="#ffffff"
  9. >
  10. <view class="slot-wrap">
  11. <image
  12. :src="logo"
  13. style="width: 178rpx; height: 31rpx; margin-left: 30rpx"
  14. ></image>
  15. </view>
  16. </u-navbar>
  17. <u-line color="#D6D6DB" />
  18. <view class="contents">
  19. <!-- <view class="diatance">
  20. <image class="clock" src="/static/learn/clock.png" mode=""></image>
  21. <text>
  22. 一级建造师,距离考试还有
  23. </text>
  24. <u-count-down :timestamp="leftDays" :show-days="true" separator="zh"
  25. :show-hours="false" :show-minutes="false" :show-seconds="false" font-size="28"
  26. bg-color="#007AFF" separator-color="#fff" color="#fff" separator-size="28">
  27. </u-count-down>
  28. </view> -->
  29. <!-- 有学习的课程 -->
  30. <view v-if="allCourse" class="had_courses">
  31. <!-- 直播 -->
  32. <view v-if="livingLists.length" class="lives">
  33. <view
  34. v-for="(live, l_index) in livingLists"
  35. :key="l_index"
  36. class="live_item"
  37. @click="toLiveLook(live)"
  38. >
  39. <view class="live_con">
  40. <view class="live_status">
  41. <image
  42. v-if="bgShow(live.liveStartTime, live.watchStatus)"
  43. src="/static/learn/living.png"
  44. class="liv_icon"
  45. ></image>
  46. <image
  47. v-else
  48. src="/static/learn/wlive.png"
  49. class="liv_icon"
  50. ></image>
  51. <text class="status_s">{{
  52. live.liveStartTime | liveStatus(live.watchStatus)
  53. }}</text>
  54. <view
  55. class="look_bt"
  56. :class="{
  57. living:
  58. lookTimeStatus(live.liveStartTime, live.watchStatus) == 1,
  59. futuring:
  60. lookTimeStatus(live.liveStartTime, live.watchStatus) == 4,
  61. curring: [2, 3].includes(
  62. lookTimeStatus(live.liveStartTime, live.watchStatus)
  63. ),
  64. }"
  65. >
  66. <text
  67. v-if="
  68. lookTimeStatus(live.liveStartTime, live.watchStatus) == 1
  69. "
  70. >点击观看</text
  71. >
  72. <text
  73. v-if="
  74. lookTimeStatus(live.liveStartTime, live.watchStatus) == 2
  75. "
  76. >即将开播</text
  77. >
  78. <template
  79. v-if="
  80. lookTimeStatus(live.liveStartTime, live.watchStatus) == 3
  81. "
  82. >
  83. 剩余:
  84. <u-count-down
  85. :timestamp="curTimeTamp(live.liveStartTime)"
  86. :show-days="false"
  87. color="#fff"
  88. separator-color="#fff"
  89. font-size="24"
  90. separator-size="24"
  91. bg-color="#FFB102"
  92. >
  93. </u-count-down>
  94. </template>
  95. <template
  96. v-if="
  97. lookTimeStatus(live.liveStartTime, live.watchStatus) == 4
  98. "
  99. >
  100. 剩余:
  101. <u-count-down
  102. :timestamp="curTimeTamp(live.liveStartTime)"
  103. :show-days="true"
  104. separator="zh"
  105. color="#fff"
  106. separator-color="#fff"
  107. bg-color="#007AFF"
  108. :show-hours="false"
  109. :show-minutes="false"
  110. :show-seconds="false"
  111. font-size="24"
  112. separator-size="24"
  113. >
  114. </u-count-down>
  115. <u-count-down
  116. :timestamp="curTimeTamp(live.liveStartTime)"
  117. :show-days="false"
  118. color="#fff"
  119. separator-color="#fff"
  120. bg-color="#007AFF"
  121. font-size="24"
  122. separator-size="24"
  123. >
  124. </u-count-down>
  125. </template>
  126. </view>
  127. </view>
  128. <view class="liv_time">
  129. <text class="timeR">{{
  130. live.liveStartTime | formate("mm月dd日")
  131. }}</text>
  132. <text>{{ live.liveStartTime | formate("hh:mm") }}</text>
  133. </view>
  134. <view class="liv_title">{{ live.name }}</view>
  135. </view>
  136. <image
  137. v-if="bgShow(live.liveStartTime, live.watchStatus)"
  138. src="/static/learn/living_bg.png"
  139. class="my_bg"
  140. ></image>
  141. <image
  142. v-else
  143. src="/static/learn/wlive_bg.png"
  144. class="my_bg"
  145. ></image>
  146. </view>
  147. </view>
  148. <!-- 我的课程 -->
  149. <view v-if="courseLists.length" class="my_courses">
  150. <text class="titles">我的课程</text>
  151. <view
  152. v-for="(item, index) in courseLists"
  153. :key="index"
  154. class="course_item"
  155. >
  156. <view
  157. class="titlews"
  158. @click="studyIn(item.goodsId, item.gradeId, item, index)"
  159. >
  160. <view class="cou_titles">{{ item.goodsName }}</view>
  161. <view
  162. v-if="item.serviceStartTime && item.serviceEndTime"
  163. class="learn_ranges"
  164. >
  165. <image
  166. class="l_range"
  167. src="/static/learn/learn_range.png"
  168. ></image>
  169. 学习周期:
  170. <text class="l_time">{{ item.serviceStartTime | formate("yyyy.mm.dd") }}-{{ item.serviceEndTime | formate("yyyy.mm.dd") }}</text>
  171. </view>
  172. </view>
  173. <!-- 状态 -->
  174. <view
  175. v-if="item.goodsType == 1"
  176. class="all_status"
  177. @click="studyIn(item.goodsId, item.gradeId, item, index)"
  178. >
  179. <!-- 不在学习服务期 -->
  180. <template
  181. v-if="
  182. item.serviceStartTime &&
  183. (sysTime < item.serviceStartTime ||
  184. sysTime > item.serviceEndTime)
  185. "
  186. >
  187. <view
  188. class="class-warm"
  189. v-if="item.gradeId != 0 && item.gradeStatus == 1"
  190. >
  191. <view class="class-warm__text">
  192. <view class="date"> 不在学习服务期,不可以学习了哦 </view>
  193. </view>
  194. </view>
  195. </template>
  196. <template v-else>
  197. <!-- 班级有效期过了 -->
  198. <template
  199. v-if="item.classEndTime && item.classEndTime < sysTime"
  200. >
  201. <view class="class-warm">
  202. <u-icon
  203. class="class-warm__icon"
  204. size="30"
  205. color="#FF3B30"
  206. name="error-circle-fill"
  207. >
  208. </u-icon>
  209. <view class="class-warm__text">
  210. <view class="date"
  211. >班级有效期:{{
  212. $method.timestampToTime(
  213. item.classStartTime,
  214. true,
  215. true
  216. )
  217. }}
  218. -
  219. {{
  220. $method.timestampToTime(item.classEndTime, true, true)
  221. }}</view
  222. >
  223. <view class="date"
  224. >班级状态:已过期,有疑问请联系
  225. <text @click="call()">020-87085982</text></view
  226. >
  227. </view>
  228. </view>
  229. </template>
  230. <!-- 班级有效期之前 -->
  231. <template
  232. v-else-if="
  233. item.classStartTime && item.classStartTime > sysTime
  234. "
  235. >
  236. <view class="class-warm">
  237. <u-icon
  238. class="class-warm__icon"
  239. size="30"
  240. color="#FF3B30"
  241. name="error-circle-fill"
  242. >
  243. </u-icon>
  244. <view class="class-warm__text">
  245. <view class="date"
  246. >班级有效期:{{
  247. $method.timestampToTime(
  248. item.classStartTime,
  249. true,
  250. true
  251. )
  252. }}
  253. -
  254. {{
  255. $method.timestampToTime(item.classEndTime, true, true)
  256. }}</view
  257. >
  258. <view class="date"
  259. >班级状态:未到学习时间,有疑问请联系
  260. <text @click="call()">020-87085982</text></view
  261. >
  262. </view>
  263. </view>
  264. </template>
  265. <!-- 在班级有效期之间或者没有班级有效期 -->
  266. <template v-else>
  267. <view
  268. class="class-warm"
  269. v-if="
  270. item.gradeId != 0 &&
  271. item.gradeStatus == 1 &&
  272. item.classStatus != null
  273. "
  274. >
  275. <view class="class-warm__text">
  276. <view class="date">
  277. 班级状态:
  278. <text v-if="item.classStatus == 1">已开班</text>
  279. <text v-if="item.classStatus == 0">未开班</text>
  280. </view>
  281. <view class="date" v-if="item.classStatus == 0"
  282. >教务处正在为您开通班级,请耐心等待</view
  283. >
  284. <view
  285. class="date"
  286. v-if="
  287. item.classStatus == 1 &&
  288. item.classStartTime &&
  289. item.classEndTime
  290. "
  291. >
  292. 班级有效期:{{
  293. $method.timestampToTime(
  294. item.classStartTime,
  295. true,
  296. true
  297. )
  298. }}-{{
  299. $method.timestampToTime(item.classEndTime, true, true)
  300. }}
  301. </view>
  302. </view>
  303. </view>
  304. <!-- 学时审核状态不可审核 -->
  305. <template
  306. v-if="item.periodStatus == -1 || item.periodStatus == 2"
  307. >
  308. <view
  309. class="class-warm"
  310. v-if="item.classStatus == 1 || item.classStatus === null"
  311. >
  312. <view class="class-warm__text">
  313. <view class="date">
  314. <template
  315. v-if="
  316. sysTime >= item.serviceStartTime &&
  317. sysTime <= item.serviceEndTime
  318. "
  319. >
  320. 学习状态:
  321. <text v-if="item.stuAllNum + item.recordNum == 0"
  322. >未学习</text
  323. >
  324. <text
  325. v-else-if="
  326. item.stuAllNum + item.recordNum > 0 &&
  327. item.stuAllNum + item.recordNum <
  328. item.secAllNum + item.examNum
  329. "
  330. >学习中</text
  331. >
  332. <text
  333. v-else-if="
  334. item.stuAllNum + item.recordNum >=
  335. item.secAllNum + item.examNum
  336. "
  337. >已学完</text
  338. >
  339. </template>
  340. <template v-else>
  341. <template v-if="item.serviceStartTime"
  342. >已过学习服务期,不可以学习了哦!</template
  343. >
  344. </template>
  345. </view>
  346. </view>
  347. </view>
  348. </template>
  349. <!-- 学时审核状态可以审核 -->
  350. <template v-if="item.periodStatus != -1">
  351. <view class="class-warm">
  352. <view class="class-warm__text">
  353. <view class="date">
  354. <text v-if="item.periodStatus == 0"
  355. >机构审核:学时审核不通过</text
  356. >
  357. <!-- <text v-else-if="item.periodStatus == 2">学时待审核</text> -->
  358. <text v-else-if="item.periodStatus == 3"
  359. >学时审核中</text
  360. >
  361. <text v-else-if="item.periodStatus == 1">
  362. <text v-if="item.periodPlush > 0"
  363. >学时已上报注册中心</text
  364. >
  365. <text v-else>机构审核:学时审核通过</text>
  366. </text>
  367. </view>
  368. </view>
  369. </view>
  370. <view
  371. class="class-warm"
  372. v-if="item.subscribeId != null && item.periodStatus == 1"
  373. >
  374. <view class="class-warm__text">
  375. <view class="date">
  376. <view v-if="item.subExamStatus === null"
  377. >待预约考试</view
  378. >
  379. <view
  380. v-else-if="
  381. item.subExamStatus === 0 &&
  382. sysTime <
  383. $method.TimeTotimestamp(
  384. $method.timestampToTime(
  385. item.subApplySiteExamTime,
  386. true
  387. ) +
  388. ' ' +
  389. item.subApplySiteStartTime
  390. )
  391. "
  392. >
  393. 待考试,考试时间:
  394. {{
  395. $method.timestampToTime(
  396. item.subApplySiteExamTime,
  397. true
  398. ) +
  399. " " +
  400. item.subApplySiteStartTime
  401. }}
  402. -
  403. {{
  404. $method.timestampToTime(
  405. item.subApplySiteExamTime,
  406. true
  407. ) +
  408. " " +
  409. item.subApplySiteEndTime
  410. }}
  411. </view>
  412. <view v-else-if="item.subExamStatus === 0"
  413. >待出考试结果</view
  414. >
  415. <view v-else-if="item.subExamStatus === 1">
  416. <text v-if="item.subResult === null"
  417. >待出考试结果</text
  418. >
  419. <text v-if="item.subResult === 0"
  420. >考试结果:不通过,需补考</text
  421. >
  422. <text v-else-if="item.subResult === 1"
  423. >考试结果:通过,考试成绩为{{
  424. item.subPerformance
  425. }}</text
  426. >
  427. </view>
  428. <view v-else-if="item.subExamStatus === 2"
  429. >缺考,无成绩,需补考</view
  430. >
  431. <view v-else-if="item.subExamStatus === 3"
  432. >作弊,无成绩,需补考</view
  433. >
  434. <view v-else-if="item.subExamStatus === 4"
  435. >替考,无成绩,需补考</view
  436. >
  437. </view>
  438. </view>
  439. </view>
  440. </template>
  441. </template>
  442. </template>
  443. </view>
  444. <view
  445. class="c_downs"
  446. @click="studyIn(item.goodsId, item.gradeId, item, index)"
  447. >
  448. <view class="lefts">
  449. <image
  450. class="lefet_img"
  451. :src="$method.splitImgHost(item.coverUrl, true)"
  452. mode=""
  453. ></image>
  454. <view v-if="item.goodsType == 6" class="live_icon">直播</view>
  455. </view>
  456. <view class="rights">
  457. <template
  458. v-if="
  459. item.gradeStatus == 1 &&
  460. item.status == 1 &&
  461. item.serviceEndTime > sysTime &&
  462. item.serviceStartTime < sysTime &&
  463. item.classEndTime &&
  464. item.classEndTime < sysTime &&
  465. (item.periodStatus == 0 || item.periodStatus == -1) &&
  466. item.studyCount > 0
  467. "
  468. >
  469. </template>
  470. <view v-else class="learn_progress">
  471. <view class="progress_up">
  472. <!-- 学习进度 (已做试卷+已做节)/(试卷数+节数) -->
  473. <view class="classHour">
  474. <text
  475. >{{
  476. item.courseNum || item.courseNum == 0
  477. ? item.courseNum
  478. : "-"
  479. }}课程/</text
  480. >
  481. <text
  482. >{{
  483. item.classHours || item.classHours == 0
  484. ? item.classHours
  485. : "-"
  486. }}学时/</text
  487. >
  488. <text>{{ item.secAllNum + item.examNum || "-" }}节</text>
  489. </view>
  490. <view class="scheduling">
  491. <view class="sche_bar">
  492. 进度:{{ item.stuAllNum + item.recordNum }}/{{
  493. item.secAllNum + item.examNum
  494. }}
  495. </view>
  496. <view class="progress_bar">
  497. <u-line-progress
  498. :showText="false"
  499. height="22"
  500. active-color="#ff9900"
  501. :show-percent="false"
  502. :percent="
  503. ((item.stuAllNum + item.recordNum) /
  504. (item.secAllNum + item.examNum)) *
  505. 100
  506. "
  507. ></u-line-progress>
  508. </view>
  509. </view>
  510. </view>
  511. </view>
  512. </view>
  513. </view>
  514. <!-- 按钮 -->
  515. <view class="study_btns">
  516. <template
  517. v-if="
  518. item.gradeStatus == 1 &&
  519. item.status == 1 &&
  520. item.serviceEndTime > sysTime &&
  521. item.serviceStartTime < sysTime &&
  522. item.classEndTime &&
  523. item.classEndTime < sysTime &&
  524. (item.periodStatus == 0 || item.periodStatus == -1) &&
  525. item.userStudyCount > 0
  526. "
  527. >
  528. <view
  529. class="exam_word ones"
  530. @click.stop="selectClass(item, index)"
  531. >
  532. 选班重学
  533. </view>
  534. </template>
  535. <!-- examApplyGoodsList.length -是判断是否关联指定学员 -->
  536. <view v-else class="exam_btns">
  537. <view
  538. class="box_appoint"
  539. v-if="
  540. item.applyStatus === 1 &&
  541. !(
  542. sysTime <= item.serviceStartTime ||
  543. sysTime >= item.serviceEndTime ||
  544. (item.classStartTime && sysTime <= item.classStartTime) ||
  545. (item.classEndTime && sysTime >= item.classEndTime) ||
  546. item.learningStatus == 2 ||
  547. item.classStatus == 0 ||
  548. (item.learningStatus == 3 &&
  549. sysTime < item.learningTimeStart) ||
  550. !item.examApplyGoodsList.length
  551. )
  552. "
  553. @click="appointment(item, appoint)"
  554. >
  555. <view class="exam_word ones">预约考试</view>
  556. </view>
  557. <view
  558. class="box_appoint"
  559. v-if="
  560. item.beforeStatus === 1 &&
  561. !(
  562. sysTime <= item.serviceStartTime ||
  563. sysTime >= item.serviceEndTime ||
  564. (item.classStartTime && sysTime <= item.classStartTime) ||
  565. (item.classEndTime && sysTime >= item.classEndTime) ||
  566. item.learningStatus == 2 ||
  567. item.classStatus == 0 ||
  568. (item.learningStatus == 3 &&
  569. sysTime < item.learningTimeStart)
  570. )
  571. "
  572. @click="appBeforeAddress(item.goodsId, item)"
  573. >
  574. <view class="exam_word ones">进入刷题</view>
  575. </view>
  576. </view>
  577. <view
  578. class="box_appoint"
  579. @click="studyIn(item.goodsId, item.gradeId, item, index)"
  580. >
  581. <view class="exam_word intos">进入学习</view>
  582. </view>
  583. </view>
  584. </view>
  585. </view>
  586. </view>
  587. <!-- 没有学习的课程 -->
  588. <view v-if="!allLoading && !allCourse" class="no_datas">
  589. <image
  590. class="courses"
  591. src="/static/learn/no_course.png"
  592. mode=""
  593. ></image>
  594. <view class="no_learns">您目前没有可学习的课程</view>
  595. <view class="choose" @click="toChoose()">立即去选购</view>
  596. </view>
  597. </view>
  598. <!-- 弹窗 -->
  599. <u-popup
  600. v-model="selectClassModal"
  601. @close="gradeValue = -1"
  602. mode="bottom"
  603. border-radius="40"
  604. >
  605. <view class="popup_box">
  606. <view style="margin-bottom: 20rpx">
  607. <view class="line1"></view>
  608. <view class="grade">选择班级</view>
  609. </view>
  610. <u-line color="#D6D6DB" />
  611. <view>
  612. <scroll-view scroll-y="true" style="height: 500rpx">
  613. <view>
  614. <u-radio-group v-model="gradeValue" @change="radioGroupChange">
  615. <view v-for="(item, index) in gradeList" :key="index">
  616. <view
  617. style="display: flex; align-items: center; padding: 20rpx"
  618. >
  619. <view>
  620. <u-radio
  621. shape="circle"
  622. :name="index"
  623. :disabled="
  624. item.studentNum > 0 &&
  625. item.studentNum == item.studentUpper
  626. "
  627. >
  628. <view
  629. :class="
  630. item.checked ? 'white-box blue-box' : 'white-box'
  631. "
  632. >
  633. <view>
  634. <view class="blackTxt">{{ item.className }}</view>
  635. <view class="redTxt" v-if="item.classEndTime">
  636. 有效期至:{{
  637. $method.timestampToTime(
  638. item.classEndTime,
  639. true,
  640. true
  641. )
  642. }}
  643. </view>
  644. <view class="redTxt" v-if="item.classEndTime">
  645. 本班还剩{{
  646. $method.GetRTime(item.classEndTime)
  647. }}天将结束学习</view
  648. >
  649. </view>
  650. </view>
  651. </u-radio>
  652. </view>
  653. </view>
  654. </view>
  655. </u-radio-group>
  656. </view>
  657. </scroll-view>
  658. </view>
  659. <view class="confrim-btn">
  660. <view class="okBtn" @click="okPopup()">确定</view>
  661. </view>
  662. </view>
  663. </u-popup>
  664. <u-modal
  665. v-model="showUserConfirmInfo"
  666. @confirm="confirmUserConfirm"
  667. ref="uModal"
  668. :async-close="true"
  669. @cancel="cancelUserConfirm"
  670. :confirm-text="
  671. '确认' + (confirmCount > 0 ? '(' + confirmCount + ')' : '')
  672. "
  673. :confirm-color="confirmCount > 0 ? '#999' : '#2979ff'"
  674. class="confirm-modal"
  675. title="实名验证确认"
  676. cancel="取消"
  677. :show-cancel-button="true"
  678. >
  679. <view class="slot-content">
  680. <view class="content">
  681. 为避免个人信息不正确导致您的学习时长无效,请认真核对以下信息是否正确,如信息有误请取消当前操作,立刻联系020-38946666
  682. <view class="msg-list" v-if="userInfo">
  683. <view class="item">
  684. <text class="item__left">姓名:</text>
  685. <text class="item__right">{{ userInfo.realname }}</text>
  686. </view>
  687. <view class="item">
  688. <text class="item__left">手机号:</text>
  689. <text class="item__right">{{ userInfo.telphone }}</text>
  690. </view>
  691. <view class="item">
  692. <text class="item__left">身份号:</text>
  693. <text class="item__right">{{ userInfo.idCard }}</text>
  694. </view>
  695. <view class="item">
  696. <u-checkbox v-model="confirmChecked" :label-disabled="false"
  697. >确认个人信息无误</u-checkbox
  698. >
  699. </view>
  700. </view>
  701. </view>
  702. </view>
  703. </u-modal>
  704. <!-- 多个预约考试时的弹窗 -->
  705. <u-popup v-model="appointTestShow" mode="bottom" border-radius="40">
  706. <view class="popuptest_box">
  707. <view class="check_head">
  708. <view class="headers">
  709. <view class="grade">切换课程</view>
  710. <u-icon
  711. name="close"
  712. color="#9C9C9C"
  713. size="40"
  714. @click="closePop()"
  715. ></u-icon>
  716. </view>
  717. </view>
  718. <view class="check_con">
  719. <scroll-view scroll-y="true" style="height: 700rpx">
  720. <view
  721. class="course_items"
  722. v-for="(appoint, index) in appointTestList"
  723. :key="index"
  724. >
  725. <view class="course_lefts">
  726. <view class="course_title">{{ appoint.applyName }}</view>
  727. </view>
  728. <view
  729. class="course_rights"
  730. @click="jumpTest(appointItemIndex, appoint)"
  731. >
  732. <view class="intoStudy">预约</view>
  733. </view>
  734. </view>
  735. </scroll-view>
  736. </view>
  737. </view>
  738. </u-popup>
  739. </view>
  740. </template>
  741. <script>
  742. var curTime = new Date().getTime(); // 当前时间的时间戳
  743. import { mapGetters, mapActions } from "vuex";
  744. import config from "@/common/config";
  745. export default {
  746. data() {
  747. return {
  748. logo: config.TOP_LOGO,
  749. leftDays: 0,
  750. paramC: {
  751. pageNum: 1,
  752. pageSize: 10,
  753. },
  754. activeItem: {},
  755. itemIndex: "",
  756. confirmTimer: null,
  757. confirmCount: 10,
  758. confirmChecked: false,
  759. showUserConfirmInfo: false,
  760. selectItem: {},
  761. selectClassModal: false,
  762. gradeList: [],
  763. gradeValue: -1,
  764. sysTime: 0,
  765. courseLists: [], // 课程列表
  766. total: 0,
  767. livingLists: [], // 直播列表
  768. allLoading: false, // 加载样式
  769. current: 2,
  770. appointTestShow: false, //预约考试弹窗
  771. appointTestList: [],
  772. appointItemIndex: {}, // 点击了哪项课程
  773. };
  774. },
  775. filters: {
  776. liveStatus(liveTime, watchStatus) {
  777. let value = liveTime * 1000;
  778. if (curTime < value) {
  779. // 判断当前时间和直播开始时间
  780. return " 未开播";
  781. } else {
  782. return watchStatus == "live" ? "正在直播中" : "即将开播";
  783. }
  784. },
  785. },
  786. computed: {
  787. ...mapGetters(["userInfo"]),
  788. allCourse() {
  789. return this.courseLists.length || this.livingLists.length ? true : false;
  790. },
  791. },
  792. onLoad() {
  793. // 1668873600 ,2022.11.20的时间戳
  794. this.leftDays = 1668873600 - parseInt(curTime / 1000);
  795. this.sysTime = +this.$method.timest();
  796. },
  797. async onShow() {
  798. uni.pageScrollTo({
  799. duration: 0,
  800. scrollTop: 0, // number number number!
  801. });
  802. this.getCourseLiveQues();
  803. // await this.commonSystemTime()
  804. },
  805. onPullDownRefresh() {
  806. this.getCourseLiveQues();
  807. },
  808. onReachBottom() {
  809. if (this.courseLists.length <= this.total) {
  810. this.paramC.pageNum++;
  811. this.getCourseList();
  812. }
  813. },
  814. methods: {
  815. ...mapActions(["getUserInfo"]),
  816. bgShow(liveTime, watchStatus) {
  817. let value = liveTime * 1000;
  818. if (curTime > value) {
  819. // 判断当前时间和直播开始时间
  820. return watchStatus == "live" ? true : false;
  821. }
  822. },
  823. lookTimeStatus(liveTime, watchStatus) {
  824. if (liveTime) {
  825. let value = new Date(liveTime * 1000);
  826. var Y = value.getFullYear();
  827. var M =
  828. value.getMonth() + 1 < 10
  829. ? "0" + (value.getMonth() + 1)
  830. : value.getMonth() + 1;
  831. var D = value.getDate() < 10 ? "0" + value.getDate() : value.getDate();
  832. var valZ = Y + "/" + M + "/" + D;
  833. let curZeroTime = new Date(valZ).getTime(); // 获取开始直播时间当天的零点时间戳
  834. if (curTime > value) {
  835. // 判断当前时间和直播开始时间
  836. if (watchStatus == "live") {
  837. //
  838. return 1;
  839. } else {
  840. return 2;
  841. }
  842. } else {
  843. if (curZeroTime <= curTime && curTime <= value) {
  844. //当天
  845. return 3;
  846. } else {
  847. return 4;
  848. }
  849. }
  850. }
  851. },
  852. curTimeTamp(liveTime) {
  853. let min = liveTime - parseInt(curTime / 1000);
  854. return min;
  855. },
  856. toChoose() {
  857. uni.switchTab({
  858. url: "/pages/course/index",
  859. });
  860. },
  861. // 查询直播课
  862. getCourseLiveQues() {
  863. if (!this.$method.isLogin()) {
  864. return;
  865. }
  866. this.allLoading = true;
  867. this.paramC.pageNum = 1;
  868. let arrs = [
  869. this.$api.listUserVideoLive(this.paramC), // 查询用户拥有视频+直播商品 /goods/listUserVideoLive
  870. this.$api.getgoodsLiveList({
  871. pageNum: 1,
  872. pageSize: 3, // 默认3条
  873. }),
  874. ];
  875. wx.stopPullDownRefresh();
  876. Promise.all(arrs)
  877. .then((res) => {
  878. // if (res.data.code == 200) {
  879. const [{ data: res1 }, { data: res2 }] = res;
  880. if (res1.code == 200) {
  881. this.total = res1.total;
  882. this.courseLists = res1.rows || [];
  883. }
  884. // if (res2.code == 200) {
  885. // this.questionLists = res2.rows || []
  886. // }
  887. if (res2.code == 200) {
  888. this.livingLists = res2.rows || [];
  889. } else {
  890. this.$u.toast(res2.msg);
  891. }
  892. this.allLoading = false;
  893. this.sysTime = +this.$method.timest();
  894. // }
  895. uni.hideLoading();
  896. })
  897. .catch((err) => {
  898. uni.hideLoading();
  899. this.allLoading = false;
  900. });
  901. },
  902. getCourseList() {
  903. this.$api
  904. .listUserVideoLive(this.paramC)
  905. .then((res) => {
  906. this.courseLists.push(...res.data.rows);
  907. })
  908. .finally((e) => {
  909. uni.hideLoading();
  910. });
  911. },
  912. // 看直播
  913. toLiveLook(item) {
  914. let moduleId = item.moduleId || 0;
  915. let chapterId = item.chapterId || 0;
  916. let sectionId = item.sectionId || item.menuId;
  917. let uuid = new Date().valueOf() + "";
  918. // buyCourse 是否购买课程:1是 0否
  919. let encode = encodeURIComponent(
  920. config.WEBVIEW_URL +
  921. "pages/live/index?token=" +
  922. uni.getStorageSync("token") +
  923. "&userInfo=" +
  924. JSON.stringify(this.userInfo) +
  925. "&channelId=" +
  926. item.liveUrl +
  927. "&gradeId=" +
  928. 0 +
  929. "&courseId=" +
  930. item.courseId +
  931. "&goodsId=" +
  932. item.goodsId +
  933. "&orderGoodsId=" +
  934. item.orderGoodsId +
  935. "&sectionId=" +
  936. sectionId +
  937. "&chapterId=" +
  938. chapterId +
  939. "&moduleId=" +
  940. moduleId +
  941. "&buyCourse=1" +
  942. "&ident=" +
  943. uuid +
  944. "&sectionType=2"
  945. );
  946. uni.navigateTo({
  947. url: `../../pages/webview/index?url=` + encode,
  948. });
  949. },
  950. toLive(item) {
  951. this.$api
  952. .courseCourseList({
  953. pageNum: 1,
  954. pageSize: 1,
  955. goodsId: item.goodsId,
  956. gradeId: 0,
  957. orderGoodsId: item.orderGoodsId,
  958. })
  959. .then((res) => {
  960. if (res.data.code == 200) {
  961. if (res.data.total > 1) {
  962. // uni.navigateTo({
  963. // url:'/pages5/liveDetail/course?orderGoodsId='+item.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0'
  964. // })
  965. uni.navigateTo({
  966. url:
  967. "/pages3/live/detail?orderGoodsId=" +
  968. item.orderGoodsId +
  969. "&goodsId=" +
  970. item.goodsId +
  971. '&gradeId=0&courseId=""',
  972. });
  973. } else if (res.data.total == 1) {
  974. uni.navigateTo({
  975. url:
  976. "/pages3/live/detail?orderGoodsId=" +
  977. item.orderGoodsId +
  978. "&goodsId=" +
  979. item.goodsId +
  980. "&gradeId=0&courseId=" +
  981. res.data.rows[0].courseId,
  982. });
  983. } else {
  984. uni.showToast({
  985. icon: "none",
  986. title: "暂无可观看的直播课程",
  987. });
  988. }
  989. }
  990. });
  991. },
  992. async studyIn(v, i, item, index) {
  993. if (item.goodsType == 6) {
  994. // 进入直播课
  995. this.toLive(item);
  996. return;
  997. }
  998. // 进入视频课
  999. this.activeItem = item;
  1000. if (item.interfaceAccountId > 0) {
  1001. //学习账号已开通
  1002. if (item.learnStatus > 0) {
  1003. //跳转第三方h5
  1004. uni.navigateTo({
  1005. url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}&isOther=1`,
  1006. });
  1007. return;
  1008. } else {
  1009. uni.showModal({
  1010. showCancel: false,
  1011. content:
  1012. "您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!",
  1013. });
  1014. return;
  1015. }
  1016. return;
  1017. }
  1018. if (
  1019. item.serviceStartTime &&
  1020. (this.sysTime <= item.serviceStartTime ||
  1021. this.sysTime >= item.serviceEndTime)
  1022. ) {
  1023. uni.showToast({
  1024. icon: "none",
  1025. title: "不在学习服务期,不能进入学习",
  1026. });
  1027. return;
  1028. }
  1029. if (
  1030. (item.classStartTime && this.sysTime <= item.classStartTime) ||
  1031. (item.classEndTime && this.sysTime >= item.classEndTime)
  1032. ) {
  1033. uni.showToast({
  1034. icon: "none",
  1035. title: "不在班级有效期,不能进入学习",
  1036. });
  1037. return;
  1038. }
  1039. // learningStatus: 1即刻,2待定,3不在日期内
  1040. if (item.learningStatus == 2) {
  1041. uni.showToast({
  1042. icon: "none",
  1043. title: "开放学习时间待定,不能进入学习",
  1044. });
  1045. return;
  1046. }
  1047. if (item.classStatus == 0) {
  1048. uni.showToast({
  1049. icon: "none",
  1050. title: "尚未开班,不能进入学习",
  1051. });
  1052. return;
  1053. }
  1054. if (item.learningStatus == 3 && this.sysTime < item.learningTimeStart) {
  1055. uni.showToast({
  1056. icon: "none",
  1057. title: "不在开放学习时间,不能进入学习",
  1058. });
  1059. return;
  1060. }
  1061. uni.showLoading({
  1062. title: "拼命加载中...",
  1063. mask: true,
  1064. });
  1065. var confirmDetail = true;
  1066. if (item.educationName == "继续教育") {
  1067. if (
  1068. item.officialName &&
  1069. item.businessName == "二级" &&
  1070. item.projectName == "建造师"
  1071. ) {
  1072. confirmDetail = await this.userConfirmInfoDetail();
  1073. }
  1074. }
  1075. if (!confirmDetail) {
  1076. return;
  1077. }
  1078. this.itemIndex = index;
  1079. if (
  1080. item.gradeStatus == 1 &&
  1081. item.status == 1 &&
  1082. item.serviceEndTime > this.sysTime &&
  1083. item.classEndTime &&
  1084. item.classEndTime < this.sysTime &&
  1085. (item.periodStatus == 0 || item.periodStatus == -1) &&
  1086. item.studyCount > 0
  1087. ) {
  1088. this.selectClass(item, index, "loading");
  1089. return;
  1090. }
  1091. // /course/goodsRebuildStatus查询用户商品重修状态
  1092. let rebuildStatus = await this.courseGoodsRebuildStatus(
  1093. item.goodsId,
  1094. item.gradeId
  1095. );
  1096. if (rebuildStatus == 0) {
  1097. uni.hideLoading();
  1098. this.$navTo.togo("/pages2/learn/details", {
  1099. gradeId: item.gradeId,
  1100. goodsId: item.goodsId,
  1101. orderGoodsId: item.orderGoodsId,
  1102. });
  1103. return;
  1104. }
  1105. // /lock/lockStatus
  1106. this.$api
  1107. .lockLockStatus({
  1108. action: "jxjy",
  1109. uuid: this.$method.getUuid(),
  1110. })
  1111. .then((res) => {
  1112. if (res.data.code == 200) {
  1113. //有其他端在操作,不能学习
  1114. uni.showToast({
  1115. icon: "none",
  1116. title: res.data.msg,
  1117. mask: true,
  1118. duration: 3000,
  1119. });
  1120. } else if (res.data.code == 500) {
  1121. //可以学习
  1122. this.$http({
  1123. url: "/course/courseList",
  1124. method: "get",
  1125. data: {
  1126. pageNum: 1,
  1127. pageSize: 100,
  1128. goodsId: item.goodsId,
  1129. gradeId: item.gradeId,
  1130. orderGoodsId: item.orderGoodsId,
  1131. },
  1132. noLoading: true,
  1133. }).then((res) => {
  1134. if (res.data.code == 200) {
  1135. if (res.data.total > 1) {
  1136. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  1137. uni.navigateTo({
  1138. url: `/pages3/polyv/detail?id=''&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}`,
  1139. });
  1140. } else if (res.data.total == 1) {
  1141. uni.navigateTo({
  1142. url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}`,
  1143. });
  1144. } else {
  1145. uni.showToast({
  1146. icon: "none",
  1147. title: "暂无可观看的视频课程",
  1148. });
  1149. }
  1150. }
  1151. });
  1152. return;
  1153. }
  1154. });
  1155. },
  1156. /**
  1157. * @param {Object} goodsId 商品id
  1158. * 查询商品重修状态
  1159. */
  1160. courseGoodsRebuildStatus(goodsId, gradeId) {
  1161. return new Promise((resolve) => {
  1162. this.$http({
  1163. url: "/course/goodsRebuildStatus",
  1164. method: "get",
  1165. data: {
  1166. goodsId: goodsId,
  1167. gradeId: gradeId,
  1168. },
  1169. noLoading: true,
  1170. compleLoading: true, // 请求成功是否还要继续显示加载中
  1171. }).then((res) => {
  1172. resolve(res.data.data);
  1173. });
  1174. });
  1175. },
  1176. userConfirmInfoDetail() {
  1177. return new Promise((resolve) => {
  1178. this.$http({
  1179. url: "/user/confirm/info/detail",
  1180. method: "get",
  1181. data: { orderGoodsId: this.activeItem.orderGoodsId },
  1182. noLoading: true,
  1183. }).then((res) => {
  1184. if (!res.data.data) {
  1185. clearInterval(this.confirmTimer);
  1186. this.confirmCount = 10;
  1187. this.showUserConfirmInfo = true;
  1188. this.confirmTimer = setInterval(() => {
  1189. if (this.confirmCount > 0) {
  1190. this.confirmCount--;
  1191. } else {
  1192. clearInterval(this.confirmTimer);
  1193. }
  1194. }, 1000);
  1195. } else {
  1196. if (res.data.data.pushInfo) {
  1197. resolve(true);
  1198. } else {
  1199. uni.showModal({
  1200. showCancel: false,
  1201. title: "提示",
  1202. content:
  1203. "开通信息推送不成功,无法进入学习,请联系020-87085982!",
  1204. });
  1205. resolve(false);
  1206. }
  1207. }
  1208. });
  1209. });
  1210. },
  1211. selectClass(item, index, load) {
  1212. this.itemIndex = index;
  1213. this.selectItem = item;
  1214. this.selectClassModal = true;
  1215. this.goodsGradeList(item.goodsId, load);
  1216. },
  1217. goodsGradeList(id, load) {
  1218. this.$http({
  1219. url: "/grade/grade/list",
  1220. method: "get",
  1221. data: { goodsId: id },
  1222. noLoading: load ? true : false,
  1223. }).then((res) => {
  1224. if (res.data.code == 200) {
  1225. this.gradeList = res.data.rows;
  1226. if (this.gradeList.length == 0) {
  1227. let item = {
  1228. className: "系统分班",
  1229. gradeId: 0,
  1230. };
  1231. this.gradeList.push(item);
  1232. } else {
  1233. let isGradeFull = this.gradeList.every(
  1234. (item) =>
  1235. item.studentNum > 0 && item.studentNum == item.studentUpper
  1236. );
  1237. //所有班级都满了
  1238. if (isGradeFull) {
  1239. let item = {
  1240. className: "系统分班",
  1241. gradeId: 0,
  1242. };
  1243. this.gradeList.unshift(item);
  1244. }
  1245. }
  1246. }
  1247. });
  1248. },
  1249. radioGroupChange(e) {
  1250. // console.log(e)
  1251. },
  1252. okPopup() {
  1253. if (this.gradeValue == -1) {
  1254. uni.showToast({
  1255. icon: "none",
  1256. title: "请选择班级",
  1257. });
  1258. return;
  1259. }
  1260. this.$api
  1261. .changeGrade({
  1262. goodsId: this.selectItem.goodsId,
  1263. gradeId: this.gradeValue,
  1264. oldGradeId: this.selectItem.gradeId,
  1265. orderGoodsId: this.selectItem.orderGoodsId,
  1266. userId: this.selectItem.userId,
  1267. })
  1268. .then((res) => {
  1269. if (res.data.code == 200) {
  1270. if (this.itemIndex !== "") {
  1271. this.refreshByIndex();
  1272. }
  1273. this.selectClassModal = false;
  1274. uni.showToast({
  1275. title: "选班成功",
  1276. });
  1277. } else {
  1278. uni.showToast({
  1279. icon: "none",
  1280. title: res.data.msg,
  1281. });
  1282. }
  1283. });
  1284. },
  1285. /**
  1286. * 返回刷新之前进入的课程数据
  1287. */
  1288. refreshByIndex() {
  1289. this.$api
  1290. .listUserVideoLive({
  1291. pageNum: this.itemIndex + 1,
  1292. pageSize: 1,
  1293. })
  1294. .then((res) => {
  1295. if (res.data.code == 200) {
  1296. this.$set(this.courseLists, this.itemIndex, res.data.rows[0]);
  1297. }
  1298. });
  1299. },
  1300. confirmUserConfirm() {
  1301. this.$refs.uModal.clearLoading();
  1302. if (this.confirmCount <= 0) {
  1303. if (this.confirmChecked) {
  1304. let infoJson = {
  1305. realname: this.userInfo.realname,
  1306. idCard: this.userInfo.idCard,
  1307. telphone: this.userInfo.telphone,
  1308. };
  1309. this.$api
  1310. .userConfirminfo({
  1311. orderGoodsId: this.activeItem.orderGoodsId,
  1312. infoJson: JSON.stringify(infoJson),
  1313. })
  1314. .then((res) => {
  1315. if (res.data.data.pushInfo) {
  1316. uni.showToast({
  1317. icon: "none",
  1318. title: "提交成功",
  1319. });
  1320. } else {
  1321. uni.showModal({
  1322. showCancel: false,
  1323. title: "提示",
  1324. content:
  1325. "开通信息推送不成功,无法进入学习,请联系020-87085982!",
  1326. });
  1327. }
  1328. this.showUserConfirmInfo = false;
  1329. });
  1330. } else {
  1331. uni.showToast({
  1332. icon: "none",
  1333. title: "请勾选确认个人信息无误",
  1334. });
  1335. }
  1336. } else {
  1337. return;
  1338. }
  1339. },
  1340. cancelUserConfirm() {
  1341. clearInterval(this.confirmTimer);
  1342. },
  1343. call() {
  1344. uni.makePhoneCall({
  1345. phoneNumber: "020-87085982", //仅为示例
  1346. });
  1347. },
  1348. closePop() {
  1349. this.appointTestShow = false;
  1350. },
  1351. jumpTest(item, appoint) {
  1352. this.appoint_an(item, appoint);
  1353. this.appointTestShow = false;
  1354. },
  1355. appointment(item, appoint) {
  1356. this.appointItemIndex = item;
  1357. if (item.examApplyGoodsList.length > 1) {
  1358. // 多个考试预约
  1359. this.appointTestList = item.examApplyGoodsList;
  1360. this.appointTestShow = true;
  1361. return;
  1362. }
  1363. let appoint_item = item.examApplyGoodsList[0];
  1364. this.appoint_an(item, appoint_item);
  1365. },
  1366. appoint_an(item, appoint) {
  1367. var data = {
  1368. goodsId: item.goodsId,
  1369. gradeId: item.gradeId,
  1370. applyId: appoint.applyId,
  1371. orderGoodsId: item.orderGoodsId,
  1372. };
  1373. this.$api.getApplysubscribe(data).then((res) => {
  1374. if (res.data.code === 500) {
  1375. uni.showModal({
  1376. showCancel: false,
  1377. content: res.data.msg,
  1378. });
  1379. }
  1380. if (res.data.code === 200) {
  1381. this.$navTo.togo("/pages2/appointment/index", {
  1382. goodsId: item.goodsId,
  1383. gradeId: item.gradeId,
  1384. orderGoodsId: item.orderGoodsId,
  1385. applyId: appoint.applyId,
  1386. });
  1387. }
  1388. });
  1389. },
  1390. // 进入刷题,调整小程序
  1391. appBeforeAddress(goodsId, item) {
  1392. this.$api
  1393. .appBeforeAddress({
  1394. orderGoodsId: item.orderGoodsId,
  1395. })
  1396. .then((res) => {
  1397. if (res.data.code == 200) {
  1398. uni.navigateToMiniProgram({
  1399. appId: res.data.data.url,
  1400. success(res) {
  1401. // 打开成功
  1402. },
  1403. });
  1404. } else {
  1405. uni.showModal({
  1406. title: "提示",
  1407. content: res.data.msg,
  1408. showCancel: false,
  1409. });
  1410. }
  1411. });
  1412. },
  1413. },
  1414. };
  1415. </script>
  1416. <style>
  1417. page {
  1418. background: #eaeef1;
  1419. }
  1420. </style>
  1421. <style lang="scss" scoped>
  1422. @import "./index.scss";
  1423. </style>