index.vue 48 KB

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