index.vue 50 KB

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