index.vue 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473
  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. async onLoad(options) {
  717. uni.hideTabBar();
  718. this.leftDays = 1668873600 - parseInt(curTime / 1000);
  719. this.sysTime = +this.$method.timest();
  720. if (options.skipPort) {
  721. await this.$method.skipLogin(options.skipPort);
  722. }
  723. if (this.$method.isLogin()) {
  724. !this.userInfo && this.$api.refreshUserInfo();
  725. }
  726. },
  727. onShow() {
  728. uni.pageScrollTo({
  729. duration: 0,
  730. scrollTop: 0, // number number number!
  731. });
  732. this.getCourseLiveQues();
  733. },
  734. onPullDownRefresh() {
  735. this.getCourseLiveQues();
  736. },
  737. onReachBottom() {
  738. if (this.courseLists.length < this.total) {
  739. this.paramC.pageNum++;
  740. this.getCourseList();
  741. }
  742. },
  743. methods: {
  744. ...mapActions(["getUserInfo"]),
  745. bgShow(liveTime, watchStatus) {
  746. let value = liveTime * 1000;
  747. if (curTime > value) {
  748. // 判断当前时间和直播开始时间
  749. return watchStatus == "live" ? true : false;
  750. }
  751. },
  752. lookTimeStatus(liveTime, watchStatus) {
  753. if (liveTime) {
  754. let value = new Date(liveTime * 1000);
  755. var Y = value.getFullYear();
  756. var M =
  757. value.getMonth() + 1 < 10
  758. ? "0" + (value.getMonth() + 1)
  759. : value.getMonth() + 1;
  760. var D = value.getDate() < 10 ? "0" + value.getDate() : value.getDate();
  761. var valZ = Y + "/" + M + "/" + D;
  762. let curZeroTime = new Date(valZ).getTime(); // 获取开始直播时间当天的零点时间戳
  763. if (curTime > value) {
  764. // 判断当前时间和直播开始时间
  765. if (watchStatus == "live") {
  766. //
  767. return 1;
  768. } else {
  769. return 2;
  770. }
  771. } else {
  772. if (curZeroTime <= curTime && curTime <= value) {
  773. //当天
  774. return 3;
  775. } else {
  776. return 4;
  777. }
  778. }
  779. }
  780. },
  781. curTimeTamp(liveTime) {
  782. let min = liveTime - parseInt(curTime / 1000);
  783. return min;
  784. },
  785. toChoose() {
  786. uni.switchTab({
  787. url: "/pages/course/index",
  788. });
  789. },
  790. // 查询直播课
  791. getCourseLiveQues() {
  792. if (!this.$method.isLogin()) {
  793. return;
  794. }
  795. this.allLoading = true;
  796. this.paramC.pageNum = 1;
  797. let arrs = [
  798. this.$api.listUserVideoLive(this.paramC), // 查询用户拥有视频+直播商品 /goods/listUserVideoLive
  799. this.$api.getgoodsLiveList({
  800. pageNum: 1,
  801. pageSize: 3, // 默认3条
  802. }),
  803. ];
  804. wx.stopPullDownRefresh();
  805. Promise.all(arrs)
  806. .then((res) => {
  807. // if (res.data.code == 200) {
  808. const [{ data: res1 }, { data: res2 }] = res;
  809. if (res1.code == 200) {
  810. this.total = res1.total;
  811. this.courseLists = res1.rows || [];
  812. const goods = this.courseLists.find(
  813. (e) => e.subscribeSign == 1 || e.subscribeSign == 3
  814. );
  815. if (goods) {
  816. let { goodsName, subscribeSign } = goods;
  817. let text =
  818. `您七大员新考【${goodsName}】课程` +
  819. (subscribeSign == 1
  820. ? "已学完,可以预约考试了!"
  821. : "课程考试未通过,请重新预约考试!");
  822. uni.showModal({
  823. title: "提示",
  824. content: text,
  825. success: (res) => {
  826. if (res.confirm) {
  827. this.appointment(goods);
  828. }
  829. },
  830. });
  831. }
  832. }
  833. if (res2.code == 200) {
  834. this.livingLists = res2.rows || [];
  835. } else {
  836. this.$u.toast(res2.msg);
  837. }
  838. this.allLoading = false;
  839. this.sysTime = +this.$method.timest();
  840. // }
  841. uni.hideLoading();
  842. })
  843. .catch((err) => {
  844. uni.hideLoading();
  845. this.allLoading = false;
  846. });
  847. },
  848. getCourseList() {
  849. this.$api
  850. .listUserVideoLive(this.paramC)
  851. .then((res) => {
  852. this.courseLists.push(...res.data.rows);
  853. })
  854. .finally((e) => {
  855. uni.hideLoading();
  856. });
  857. },
  858. // 看直播
  859. toLiveLook(item) {
  860. let moduleId = item.moduleId || 0;
  861. let chapterId = item.chapterId || 0;
  862. let sectionId = item.sectionId || item.menuId;
  863. let uuid = new Date().valueOf() + "";
  864. // buyCourse 是否购买课程:1是 0否
  865. let encode = encodeURIComponent(
  866. this.config.hostLive +
  867. "/pages/live/index?token=" +
  868. uni.getStorageSync("token") +
  869. "&userInfo=" +
  870. (JSON.stringify(this.userInfo) || "") +
  871. "&channelId=" +
  872. item.liveUrl +
  873. "&gradeId=" +
  874. 0 +
  875. "&courseId=" +
  876. item.courseId +
  877. "&goodsId=" +
  878. item.goodsId +
  879. "&orderGoodsId=" +
  880. item.orderGoodsId +
  881. "&sectionId=" +
  882. sectionId +
  883. "&chapterId=" +
  884. chapterId +
  885. "&moduleId=" +
  886. moduleId +
  887. "&buyCourse=1" +
  888. "&ident=" +
  889. uuid +
  890. "&sectionType=2"
  891. );
  892. uni.navigateTo({
  893. url: `../../pages/webview/index?url=` + encode,
  894. });
  895. },
  896. toLive(item) {
  897. this.$api
  898. .courseCourseList({
  899. pageNum: 1,
  900. pageSize: 1,
  901. goodsId: item.goodsId,
  902. gradeId: 0,
  903. orderGoodsId: item.orderGoodsId,
  904. })
  905. .then((res) => {
  906. if (res.data.code == 200) {
  907. if (res.data.total > 1) {
  908. // uni.navigateTo({
  909. // url:'/pages5/liveDetail/course?orderGoodsId='+item.orderGoodsId+'&goodsId='+item.goodsId+'&gradeId=0'
  910. // })
  911. uni.navigateTo({
  912. url:
  913. "/pages3/live/detail?orderGoodsId=" +
  914. item.orderGoodsId +
  915. "&goodsId=" +
  916. item.goodsId +
  917. '&gradeId=0&courseId=""',
  918. });
  919. } else if (res.data.total == 1) {
  920. uni.navigateTo({
  921. url:
  922. "/pages3/live/detail?orderGoodsId=" +
  923. item.orderGoodsId +
  924. "&goodsId=" +
  925. item.goodsId +
  926. "&gradeId=0&courseId=" +
  927. res.data.rows[0].courseId,
  928. });
  929. } else {
  930. uni.showToast({
  931. icon: "none",
  932. title: "暂无可观看的直播课程",
  933. });
  934. }
  935. }
  936. });
  937. },
  938. async studyIn(v, i, item, index) {
  939. if (item.externalLinkStatus) {
  940. this.$method.toLink(item.externalLink);
  941. return;
  942. }
  943. if (item.goodsType == 6) {
  944. // 进入直播课
  945. this.toLive(item);
  946. return;
  947. }
  948. // 进入视频课
  949. this.activeItem = item;
  950. if (item.interfaceAccountId > 0) {
  951. //学习账号已开通
  952. if (item.learnStatus > 0) {
  953. //跳转第三方h5
  954. uni.navigateTo({
  955. url: `/pages3/polyv/detail?goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}&isOther=1`,
  956. });
  957. return;
  958. } else {
  959. const text = this.eduPhone ? ",有疑问,请联系" + this.eduPhone : "";
  960. uni.showModal({
  961. showCancel: false,
  962. content: "您的学习账号未开通,请稍后再尝试" + text,
  963. });
  964. return;
  965. }
  966. return;
  967. }
  968. if (
  969. item.serviceStartTime &&
  970. (this.sysTime <= item.serviceStartTime ||
  971. this.sysTime >= item.serviceEndTime)
  972. ) {
  973. uni.showToast({
  974. icon: "none",
  975. title: "不在学习服务期,不能进入学习",
  976. });
  977. return;
  978. }
  979. if (
  980. (item.classStartTime && this.sysTime <= item.classStartTime) ||
  981. (item.classEndTime && this.sysTime >= item.classEndTime)
  982. ) {
  983. uni.showToast({
  984. icon: "none",
  985. title: "不在班级有效期,不能进入学习",
  986. });
  987. return;
  988. }
  989. // learningStatus: 1即刻,2待定,3不在日期内
  990. if (item.learningStatus == 2) {
  991. uni.showToast({
  992. icon: "none",
  993. title: "开放学习时间待定,不能进入学习",
  994. });
  995. return;
  996. }
  997. if (item.classStatus == 0) {
  998. uni.showToast({
  999. icon: "none",
  1000. title: "尚未开班,不能进入学习",
  1001. });
  1002. return;
  1003. }
  1004. if (item.learningStatus == 3 && this.sysTime < item.learningTimeStart) {
  1005. uni.showToast({
  1006. icon: "none",
  1007. title: "不在开放学习时间,不能进入学习",
  1008. });
  1009. return;
  1010. }
  1011. uni.showLoading({
  1012. title: "拼命加载中...",
  1013. mask: true,
  1014. });
  1015. // var confirmDetail = true;
  1016. // if (item.educationName == "继续教育") {
  1017. // if (
  1018. // item.officialName &&
  1019. // item.businessName == "二级" &&
  1020. // item.projectName == "建造师"
  1021. // ) {
  1022. // confirmDetail = await this.userConfirmInfoDetail();
  1023. // }
  1024. // }
  1025. // if (!confirmDetail) {
  1026. // return;
  1027. // }
  1028. this.itemIndex = index;
  1029. if (
  1030. item.gradeStatus == 1 &&
  1031. item.status == 1 &&
  1032. item.serviceEndTime > this.sysTime &&
  1033. item.classEndTime &&
  1034. item.classEndTime < this.sysTime &&
  1035. (item.periodStatus == 0 || item.periodStatus == -1) &&
  1036. item.studyCount > 0
  1037. ) {
  1038. this.selectClass(item, index, "loading");
  1039. return;
  1040. }
  1041. // /course/goodsRebuildStatus查询用户商品重修状态
  1042. let rebuildStatus = await this.courseGoodsRebuildStatus(
  1043. item.goodsId,
  1044. item.gradeId
  1045. );
  1046. if (rebuildStatus == 0) {
  1047. uni.hideLoading();
  1048. this.$navTo.togo("/pages2/learn/details", {
  1049. gradeId: item.gradeId,
  1050. goodsId: item.goodsId,
  1051. orderGoodsId: item.orderGoodsId,
  1052. });
  1053. return;
  1054. }
  1055. this.$method.checkLock().then(() => {
  1056. this.$http({
  1057. url: "/course/courseList",
  1058. method: "get",
  1059. data: {
  1060. pageNum: 1,
  1061. pageSize: 100,
  1062. goodsId: item.goodsId,
  1063. gradeId: item.gradeId,
  1064. orderGoodsId: item.orderGoodsId,
  1065. },
  1066. noLoading: true,
  1067. }).then((res) => {
  1068. if (res.data.code == 200) {
  1069. if (res.data.total > 1) {
  1070. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  1071. uni.navigateTo({
  1072. url: `/pages3/polyv/detail?id=''&goodsId=${
  1073. item.goodsId
  1074. }&orderGoodsId=${item.orderGoodsId}&gradeId=${
  1075. item.gradeId
  1076. }&periodWaitTime=${item.periodWaitTime ? 1 : ""}&isQ=${
  1077. item.orderYear ? 1 : ""
  1078. }`,
  1079. });
  1080. } else if (res.data.total == 1) {
  1081. uni.navigateTo({
  1082. url: `/pages3/polyv/detail?id=${
  1083. res.data.rows[0].courseId
  1084. }&goodsId=${item.goodsId}&orderGoodsId=${
  1085. item.orderGoodsId
  1086. }&gradeId=${item.gradeId}&periodWaitTime=${
  1087. item.periodWaitTime ? "" : 1
  1088. }&isQ=${item.orderYear ? 1 : ""}`,
  1089. });
  1090. } else {
  1091. uni.showToast({
  1092. icon: "none",
  1093. title: "暂无可观看的视频课程",
  1094. });
  1095. }
  1096. }
  1097. });
  1098. });
  1099. },
  1100. toDetail() {
  1101. this.$http({
  1102. url: "/course/courseList",
  1103. method: "get",
  1104. data: {
  1105. pageNum: 1,
  1106. pageSize: 100,
  1107. goodsId: item.goodsId,
  1108. gradeId: item.gradeId,
  1109. orderGoodsId: item.orderGoodsId,
  1110. },
  1111. noLoading: true,
  1112. }).then((res) => {
  1113. if (res.data.code == 200) {
  1114. if (res.data.total > 1) {
  1115. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  1116. uni.navigateTo({
  1117. url: `/pages3/polyv/detail?id=''&goodsId=${
  1118. item.goodsId
  1119. }&orderGoodsId=${item.orderGoodsId}&gradeId=${
  1120. item.gradeId
  1121. }&periodWaitTime=${item.periodWaitTime ? 1 : ""}`,
  1122. });
  1123. } else if (res.data.total == 1) {
  1124. uni.navigateTo({
  1125. url: `/pages3/polyv/detail?id=${
  1126. res.data.rows[0].courseId
  1127. }&goodsId=${item.goodsId}&orderGoodsId=${
  1128. item.orderGoodsId
  1129. }&gradeId=${item.gradeId}&periodWaitTime=${
  1130. item.periodWaitTime ? "" : 1
  1131. }`,
  1132. });
  1133. } else {
  1134. uni.showToast({
  1135. icon: "none",
  1136. title: "暂无可观看的视频课程",
  1137. });
  1138. }
  1139. }
  1140. });
  1141. },
  1142. toInput(item) {
  1143. this.$navTo.togo("/pages2/verify/input", {
  1144. id: item.goodsId,
  1145. orderGoodsId: item.orderGoodsId,
  1146. gradeId: item.gradeId,
  1147. type: 1,
  1148. });
  1149. },
  1150. /**
  1151. * @param {Object} goodsId 商品id
  1152. * 查询商品重修状态
  1153. */
  1154. courseGoodsRebuildStatus(goodsId, gradeId) {
  1155. return new Promise((resolve) => {
  1156. this.$http({
  1157. url: "/course/goodsRebuildStatus",
  1158. method: "get",
  1159. data: {
  1160. goodsId: goodsId,
  1161. gradeId: gradeId,
  1162. },
  1163. noLoading: true,
  1164. compleLoading: true, // 请求成功是否还要继续显示加载中
  1165. }).then((res) => {
  1166. resolve(res.data.data);
  1167. });
  1168. });
  1169. },
  1170. userConfirmInfoDetail() {
  1171. return new Promise((resolve) => {
  1172. this.$http({
  1173. url: "/user/confirm/info/detail",
  1174. method: "get",
  1175. data: { orderGoodsId: this.activeItem.orderGoodsId },
  1176. noLoading: true,
  1177. }).then((res) => {
  1178. if (!res.data.data) {
  1179. clearInterval(this.confirmTimer);
  1180. this.confirmCount = 10;
  1181. this.showUserConfirmInfo = true;
  1182. this.confirmTimer = setInterval(() => {
  1183. if (this.confirmCount > 0) {
  1184. this.confirmCount--;
  1185. } else {
  1186. clearInterval(this.confirmTimer);
  1187. }
  1188. }, 1000);
  1189. } else {
  1190. if (res.data.data.pushInfo) {
  1191. resolve(true);
  1192. } else {
  1193. const text = this.eduPhone
  1194. ? ",有疑问,请联系" + this.eduPhone
  1195. : "";
  1196. uni.showModal({
  1197. showCancel: false,
  1198. title: "提示",
  1199. content: "开通信息推送不成功,无法进入学习" + text,
  1200. });
  1201. resolve(false);
  1202. }
  1203. }
  1204. });
  1205. });
  1206. },
  1207. selectClass(item, index, load) {
  1208. this.itemIndex = index;
  1209. this.selectItem = item;
  1210. this.selectClassModal = true;
  1211. this.goodsGradeList(item.goodsId, load);
  1212. },
  1213. goodsGradeList(id, load) {
  1214. this.$http({
  1215. url: "/grade/grade/list",
  1216. method: "get",
  1217. data: { goodsId: id },
  1218. noLoading: load ? true : false,
  1219. }).then((res) => {
  1220. if (res.data.code == 200) {
  1221. this.gradeList = res.data.rows;
  1222. if (this.gradeList.length == 0) {
  1223. let item = {
  1224. className: "系统分班",
  1225. gradeId: 0,
  1226. };
  1227. this.gradeList.push(item);
  1228. } else {
  1229. let isGradeFull = this.gradeList.every(
  1230. (item) =>
  1231. item.studentNum > 0 && item.studentNum == item.studentUpper
  1232. );
  1233. //所有班级都满了
  1234. if (isGradeFull) {
  1235. let item = {
  1236. className: "系统分班",
  1237. gradeId: 0,
  1238. };
  1239. this.gradeList.unshift(item);
  1240. }
  1241. }
  1242. }
  1243. });
  1244. },
  1245. radioGroupChange(e) {
  1246. // console.log(e)
  1247. },
  1248. okPopup() {
  1249. if (this.gradeValue == -1) {
  1250. uni.showToast({
  1251. icon: "none",
  1252. title: "请选择班级",
  1253. });
  1254. return;
  1255. }
  1256. this.$api
  1257. .changeGrade({
  1258. goodsId: this.selectItem.goodsId,
  1259. gradeId: this.gradeValue,
  1260. oldGradeId: this.selectItem.gradeId,
  1261. orderGoodsId: this.selectItem.orderGoodsId,
  1262. userId: this.selectItem.userId,
  1263. })
  1264. .then((res) => {
  1265. if (res.data.code == 200) {
  1266. if (this.itemIndex !== "") {
  1267. this.refreshByIndex();
  1268. }
  1269. this.selectClassModal = false;
  1270. uni.showToast({
  1271. title: "选班成功",
  1272. });
  1273. } else {
  1274. uni.showToast({
  1275. icon: "none",
  1276. title: res.data.msg,
  1277. });
  1278. }
  1279. });
  1280. },
  1281. /**
  1282. * 返回刷新之前进入的课程数据
  1283. */
  1284. refreshByIndex() {
  1285. this.$api
  1286. .listUserVideoLive({
  1287. pageNum: this.itemIndex + 1,
  1288. pageSize: 1,
  1289. })
  1290. .then((res) => {
  1291. if (res.data.code == 200) {
  1292. this.$set(this.courseLists, this.itemIndex, res.data.rows[0]);
  1293. }
  1294. });
  1295. },
  1296. confirmUserConfirm() {
  1297. this.$refs.uModal.clearLoading();
  1298. if (this.confirmCount <= 0) {
  1299. if (this.confirmChecked) {
  1300. let infoJson = {
  1301. realname: this.userInfo.realname,
  1302. idCard: this.userInfo.idCard,
  1303. telphone: this.userInfo.telphone,
  1304. };
  1305. this.$api
  1306. .userConfirminfo({
  1307. orderGoodsId: this.activeItem.orderGoodsId,
  1308. infoJson: JSON.stringify(infoJson),
  1309. })
  1310. .then((res) => {
  1311. if (res.data.code != 200) {
  1312. this.showUserConfirmInfo = false;
  1313. uni.showToast({
  1314. icon: "none",
  1315. title: res.data.msg,
  1316. });
  1317. return;
  1318. }
  1319. if (res.data.data.pushInfo) {
  1320. uni.showToast({
  1321. icon: "none",
  1322. title: "提交成功",
  1323. });
  1324. } else {
  1325. const text = this.eduPhone
  1326. ? ",有疑问,请联系" + this.eduPhone
  1327. : "";
  1328. uni.showModal({
  1329. showCancel: false,
  1330. title: "提示",
  1331. content: "开通信息推送不成功,无法进入学!" + text,
  1332. });
  1333. }
  1334. this.showUserConfirmInfo = false;
  1335. });
  1336. } else {
  1337. uni.showToast({
  1338. icon: "none",
  1339. title: "请勾选确认个人信息无误",
  1340. });
  1341. }
  1342. } else {
  1343. return;
  1344. }
  1345. },
  1346. cancelUserConfirm() {
  1347. clearInterval(this.confirmTimer);
  1348. },
  1349. call() {
  1350. // #ifdef MP-WEIXIN
  1351. uni.makePhoneCall({
  1352. phoneNumber: "020-87085982", //仅为示例
  1353. });
  1354. // #endif
  1355. },
  1356. closePop() {
  1357. this.appointTestShow = false;
  1358. },
  1359. jumpTest(appoint) {
  1360. this.$api
  1361. .getExamTip()
  1362. .then((res) => {
  1363. this.nodesCcontent = res.data.data.value;
  1364. this.appoint = appoint;
  1365. this.showTip = true;
  1366. })
  1367. .catch(() => {
  1368. this.appoint_an(appoint);
  1369. this.appointTestShow = false;
  1370. });
  1371. },
  1372. confirmTip() {
  1373. this.showTip = false;
  1374. this.appointTestShow = false;
  1375. this.appoint_an(this.appoint);
  1376. },
  1377. toBuyQuestionBank(item) {
  1378. this.$api.goodsDetail(item.questionGoodsId).then((res) => {
  1379. this.$store.commit("setShoppingCartList", {
  1380. shoppingCartList: [
  1381. { relevanceId: item.orderGoodsId, ...res.data.data },
  1382. ],
  1383. });
  1384. this.$navTo.togo("/pages2/order/confirm_pay");
  1385. });
  1386. },
  1387. appointment(item) {
  1388. this.appointItemIndex = item;
  1389. this.appointTestList = item.examApplyGoodsList;
  1390. this.appointTestShow = true;
  1391. // if (item.examApplyGoodsList.length > 1) {
  1392. // // 多个考试预约
  1393. // this.appointTestList = item.examApplyGoodsList;
  1394. // this.appointTestShow = true;
  1395. // return;
  1396. // }
  1397. // let appoint_item = item.examApplyGoodsList[0];
  1398. // this.appoint_an(item, appoint_item);
  1399. },
  1400. appoint_an(appoint) {
  1401. const { goodsId, gradeId, orderGoodsId } = this.appointItemIndex;
  1402. var data = {
  1403. goodsId,
  1404. gradeId,
  1405. applyId: appoint.applyId,
  1406. orderGoodsId,
  1407. };
  1408. this.$api.getApplysubscribe(data).then((res) => {
  1409. if (res.data.code === 500) {
  1410. uni.showModal({
  1411. showCancel: false,
  1412. content: res.data.msg,
  1413. });
  1414. }
  1415. if (res.data.code === 200) {
  1416. this.$navTo.togo("/pages2/appointment/index", {
  1417. goodsId,
  1418. gradeId,
  1419. orderGoodsId,
  1420. applyId: appoint.applyId,
  1421. });
  1422. }
  1423. });
  1424. },
  1425. // 进入刷题,调整小程序
  1426. appBeforeAddress(goodsId, item) {
  1427. this.$api
  1428. .appBeforeAddress({
  1429. orderGoodsId: item.orderGoodsId,
  1430. })
  1431. .then((res) => {
  1432. if (res.data.code == 200) {
  1433. uni.navigateToMiniProgram({
  1434. appId: res.data.data.url,
  1435. success(res) {
  1436. // 打开成功
  1437. },
  1438. });
  1439. } else {
  1440. uni.showModal({
  1441. title: "提示",
  1442. content: res.data.msg,
  1443. showCancel: false,
  1444. });
  1445. }
  1446. });
  1447. },
  1448. },
  1449. };
  1450. </script>
  1451. <style>
  1452. page {
  1453. background: #eaeef1;
  1454. }
  1455. </style>
  1456. <style lang="scss" scoped>
  1457. @import "./index.scss";
  1458. @import "./quill.core";
  1459. </style>