index.vue 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485
  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: 10,
  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. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  1079. uni.navigateTo({
  1080. url: `/pages3/polyv/detail?id=''&goodsId=${
  1081. item.goodsId
  1082. }&orderGoodsId=${item.orderGoodsId}&gradeId=${
  1083. item.gradeId
  1084. }&periodWaitTime=${item.periodWaitTime ? 1 : ""}&isQ=${
  1085. item.orderYear ? 1 : ""
  1086. }`,
  1087. });
  1088. } else if (res.data.total == 1) {
  1089. uni.navigateTo({
  1090. url: `/pages3/polyv/detail?id=${
  1091. res.data.rows[0].courseId
  1092. }&goodsId=${item.goodsId}&orderGoodsId=${
  1093. item.orderGoodsId
  1094. }&gradeId=${item.gradeId}&periodWaitTime=${
  1095. item.periodWaitTime ? "" : 1
  1096. }&isQ=${item.orderYear ? 1 : ""}`,
  1097. });
  1098. } else {
  1099. uni.showToast({
  1100. icon: "none",
  1101. title: "暂无可观看的视频课程",
  1102. });
  1103. }
  1104. }
  1105. });
  1106. });
  1107. },
  1108. toDetail() {
  1109. this.$http({
  1110. url: "/course/courseList",
  1111. method: "get",
  1112. data: {
  1113. pageNum: 1,
  1114. pageSize: 100,
  1115. goodsId: item.goodsId,
  1116. gradeId: item.gradeId,
  1117. orderGoodsId: item.orderGoodsId,
  1118. },
  1119. noLoading: true,
  1120. }).then((res) => {
  1121. if (res.data.code == 200) {
  1122. if (res.data.total > 1) {
  1123. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  1124. uni.navigateTo({
  1125. url: `/pages3/polyv/detail?id=''&goodsId=${
  1126. item.goodsId
  1127. }&orderGoodsId=${item.orderGoodsId}&gradeId=${
  1128. item.gradeId
  1129. }&periodWaitTime=${item.periodWaitTime ? 1 : ""}`,
  1130. });
  1131. } else if (res.data.total == 1) {
  1132. uni.navigateTo({
  1133. url: `/pages3/polyv/detail?id=${
  1134. res.data.rows[0].courseId
  1135. }&goodsId=${item.goodsId}&orderGoodsId=${
  1136. item.orderGoodsId
  1137. }&gradeId=${item.gradeId}&periodWaitTime=${
  1138. item.periodWaitTime ? "" : 1
  1139. }`,
  1140. });
  1141. } else {
  1142. uni.showToast({
  1143. icon: "none",
  1144. title: "暂无可观看的视频课程",
  1145. });
  1146. }
  1147. }
  1148. });
  1149. },
  1150. toInput(item) {
  1151. this.$navTo.togo("/pages2/verify/input", {
  1152. id: item.goodsId,
  1153. orderGoodsId: item.orderGoodsId,
  1154. gradeId: item.gradeId,
  1155. type: 1,
  1156. });
  1157. },
  1158. /**
  1159. * @param {Object} goodsId 商品id
  1160. * 查询商品重修状态
  1161. */
  1162. courseGoodsRebuildStatus(goodsId, gradeId) {
  1163. return new Promise((resolve) => {
  1164. this.$http({
  1165. url: "/course/goodsRebuildStatus",
  1166. method: "get",
  1167. data: {
  1168. goodsId: goodsId,
  1169. gradeId: gradeId,
  1170. },
  1171. noLoading: true,
  1172. compleLoading: true, // 请求成功是否还要继续显示加载中
  1173. }).then((res) => {
  1174. resolve(res.data.data);
  1175. });
  1176. });
  1177. },
  1178. userConfirmInfoDetail() {
  1179. return new Promise((resolve) => {
  1180. this.$http({
  1181. url: "/user/confirm/info/detail",
  1182. method: "get",
  1183. data: { orderGoodsId: this.activeItem.orderGoodsId },
  1184. noLoading: true,
  1185. }).then((res) => {
  1186. if (!res.data.data) {
  1187. clearInterval(this.confirmTimer);
  1188. this.confirmCount = 10;
  1189. this.showUserConfirmInfo = true;
  1190. this.confirmTimer = setInterval(() => {
  1191. if (this.confirmCount > 0) {
  1192. this.confirmCount--;
  1193. } else {
  1194. clearInterval(this.confirmTimer);
  1195. }
  1196. }, 1000);
  1197. } else {
  1198. if (res.data.data.pushInfo) {
  1199. resolve(true);
  1200. } else {
  1201. const text = this.eduPhone
  1202. ? ",有疑问,请联系" + this.eduPhone
  1203. : "";
  1204. uni.showModal({
  1205. showCancel: false,
  1206. title: "提示",
  1207. content: "开通信息推送不成功,无法进入学习" + text,
  1208. });
  1209. resolve(false);
  1210. }
  1211. }
  1212. });
  1213. });
  1214. },
  1215. selectClass(item, index, load) {
  1216. this.itemIndex = index;
  1217. this.selectItem = item;
  1218. this.selectClassModal = true;
  1219. this.goodsGradeList(item.goodsId, load);
  1220. },
  1221. goodsGradeList(id, load) {
  1222. this.$http({
  1223. url: "/grade/grade/list",
  1224. method: "get",
  1225. data: { goodsId: id },
  1226. noLoading: load ? true : false,
  1227. }).then((res) => {
  1228. if (res.data.code == 200) {
  1229. this.gradeList = res.data.rows;
  1230. if (this.gradeList.length == 0) {
  1231. let item = {
  1232. className: "系统分班",
  1233. gradeId: 0,
  1234. };
  1235. this.gradeList.push(item);
  1236. } else {
  1237. let isGradeFull = this.gradeList.every(
  1238. (item) =>
  1239. item.studentNum > 0 && item.studentNum == item.studentUpper
  1240. );
  1241. //所有班级都满了
  1242. if (isGradeFull) {
  1243. let item = {
  1244. className: "系统分班",
  1245. gradeId: 0,
  1246. };
  1247. this.gradeList.unshift(item);
  1248. }
  1249. }
  1250. }
  1251. });
  1252. },
  1253. radioGroupChange(e) {
  1254. // console.log(e)
  1255. },
  1256. okPopup() {
  1257. if (this.gradeValue == -1) {
  1258. uni.showToast({
  1259. icon: "none",
  1260. title: "请选择班级",
  1261. });
  1262. return;
  1263. }
  1264. this.$api
  1265. .changeGrade({
  1266. goodsId: this.selectItem.goodsId,
  1267. gradeId: this.gradeValue,
  1268. oldGradeId: this.selectItem.gradeId,
  1269. orderGoodsId: this.selectItem.orderGoodsId,
  1270. userId: this.selectItem.userId,
  1271. })
  1272. .then((res) => {
  1273. if (res.data.code == 200) {
  1274. if (this.itemIndex !== "") {
  1275. this.refreshByIndex();
  1276. }
  1277. this.selectClassModal = false;
  1278. uni.showToast({
  1279. title: "选班成功",
  1280. });
  1281. } else {
  1282. uni.showToast({
  1283. icon: "none",
  1284. title: res.data.msg,
  1285. });
  1286. }
  1287. });
  1288. },
  1289. /**
  1290. * 返回刷新之前进入的课程数据
  1291. */
  1292. refreshByIndex() {
  1293. this.$api
  1294. .listUserVideoLive({
  1295. pageNum: this.itemIndex + 1,
  1296. pageSize: 1,
  1297. })
  1298. .then((res) => {
  1299. if (res.data.code == 200) {
  1300. this.$set(this.courseLists, this.itemIndex, res.data.rows[0]);
  1301. }
  1302. });
  1303. },
  1304. confirmUserConfirm() {
  1305. this.$refs.uModal.clearLoading();
  1306. if (this.confirmCount <= 0) {
  1307. if (this.confirmChecked) {
  1308. let infoJson = {
  1309. realname: this.userInfo.realname,
  1310. idCard: this.userInfo.idCard,
  1311. telphone: this.userInfo.telphone,
  1312. };
  1313. this.$api
  1314. .userConfirminfo({
  1315. orderGoodsId: this.activeItem.orderGoodsId,
  1316. infoJson: JSON.stringify(infoJson),
  1317. })
  1318. .then((res) => {
  1319. if (res.data.code != 200) {
  1320. this.showUserConfirmInfo = false;
  1321. uni.showToast({
  1322. icon: "none",
  1323. title: res.data.msg,
  1324. });
  1325. return;
  1326. }
  1327. if (res.data.data.pushInfo) {
  1328. uni.showToast({
  1329. icon: "none",
  1330. title: "提交成功",
  1331. });
  1332. } else {
  1333. const text = this.eduPhone
  1334. ? ",有疑问,请联系" + this.eduPhone
  1335. : "";
  1336. uni.showModal({
  1337. showCancel: false,
  1338. title: "提示",
  1339. content: "开通信息推送不成功,无法进入学!" + text,
  1340. });
  1341. }
  1342. this.showUserConfirmInfo = false;
  1343. });
  1344. } else {
  1345. uni.showToast({
  1346. icon: "none",
  1347. title: "请勾选确认个人信息无误",
  1348. });
  1349. }
  1350. } else {
  1351. return;
  1352. }
  1353. },
  1354. cancelUserConfirm() {
  1355. clearInterval(this.confirmTimer);
  1356. },
  1357. call() {
  1358. // #ifdef MP-WEIXIN
  1359. uni.makePhoneCall({
  1360. phoneNumber: "020-87085982", //仅为示例
  1361. });
  1362. // #endif
  1363. },
  1364. closePop() {
  1365. this.appointTestShow = false;
  1366. },
  1367. jumpTest(appoint) {
  1368. this.$api
  1369. .getExamTip()
  1370. .then((res) => {
  1371. this.nodesCcontent = res.data.data.value;
  1372. this.appoint = appoint;
  1373. this.showTip = true;
  1374. })
  1375. .catch(() => {
  1376. this.appoint_an(appoint);
  1377. this.appointTestShow = false;
  1378. });
  1379. },
  1380. confirmTip() {
  1381. this.showTip = false;
  1382. this.appointTestShow = false;
  1383. this.appoint_an(this.appoint);
  1384. },
  1385. toBuyQuestionBank(item) {
  1386. this.$api.goodsDetail(item.questionGoodsId).then((res) => {
  1387. this.$store.commit("setShoppingCartList", {
  1388. shoppingCartList: [
  1389. { relevanceId: item.orderGoodsId, ...res.data.data },
  1390. ],
  1391. });
  1392. this.$navTo.togo("/pages2/order/confirm_pay");
  1393. });
  1394. },
  1395. appointment(item) {
  1396. if (item.subscribeSign == 4) {
  1397. this.$navTo.togo("/pages2/exam/exam_appointment");
  1398. return;
  1399. }
  1400. this.appointItemIndex = item;
  1401. this.appointTestList = item.examApplyGoodsList;
  1402. this.appointTestShow = true;
  1403. // if (item.examApplyGoodsList.length > 1) {
  1404. // // 多个考试预约
  1405. // this.appointTestList = item.examApplyGoodsList;
  1406. // this.appointTestShow = true;
  1407. // return;
  1408. // }
  1409. // let appoint_item = item.examApplyGoodsList[0];
  1410. // this.appoint_an(item, appoint_item);
  1411. },
  1412. appoint_an(appoint) {
  1413. const { goodsId, gradeId, orderGoodsId } = this.appointItemIndex;
  1414. var data = {
  1415. goodsId,
  1416. gradeId,
  1417. applyId: appoint.applyId,
  1418. orderGoodsId,
  1419. };
  1420. this.$api.getApplysubscribe(data).then((res) => {
  1421. if (res.data.code === 500) {
  1422. uni.showModal({
  1423. showCancel: false,
  1424. content: res.data.msg,
  1425. });
  1426. }
  1427. if (res.data.code === 200) {
  1428. this.$navTo.togo("/pages2/appointment/index", {
  1429. goodsId,
  1430. gradeId,
  1431. orderGoodsId,
  1432. applyId: appoint.applyId,
  1433. });
  1434. }
  1435. });
  1436. },
  1437. // 进入刷题,调整小程序
  1438. appBeforeAddress(goodsId, item) {
  1439. this.$api
  1440. .appBeforeAddress({
  1441. orderGoodsId: item.orderGoodsId,
  1442. })
  1443. .then((res) => {
  1444. if (res.data.code == 200) {
  1445. uni.navigateToMiniProgram({
  1446. appId: res.data.data.url,
  1447. success(res) {
  1448. // 打开成功
  1449. },
  1450. });
  1451. } else {
  1452. uni.showModal({
  1453. title: "提示",
  1454. content: res.data.msg,
  1455. showCancel: false,
  1456. });
  1457. }
  1458. });
  1459. },
  1460. },
  1461. };
  1462. </script>
  1463. <style>
  1464. page {
  1465. background: #eaeef1;
  1466. }
  1467. </style>
  1468. <style lang="scss" scoped>
  1469. @import "./index.scss";
  1470. @import "./quill.core";
  1471. </style>