index.vue 47 KB

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