index.vue 47 KB

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