index.vue 48 KB

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