index.vue 55 KB

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