index.vue 56 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676
  1. <template>
  2. <div class="my-course">
  3. <div>
  4. <h4 class="headerTitle">
  5. <span v-if="goodsData.subjectNames" style="font-size: 20px"
  6. >【{{ goodsData.subjectNames }}】</span
  7. >{{ goodsData.goodsName
  8. }}<el-button
  9. size="mini"
  10. type="primary"
  11. plain
  12. icon="el-icon-sort"
  13. style="margin-left: 14px"
  14. @click="changeCourse"
  15. >切换科目</el-button
  16. >
  17. <el-button
  18. v-if="
  19. goodsData.applyStatus === 1 &&
  20. !(
  21. sysTime <= goodsData.serviceStartTime ||
  22. sysTime >= goodsData.serviceEndTime ||
  23. (goodsData.classStartTime &&
  24. sysTime <= goodsData.classStartTime) ||
  25. (goodsData.classEndTime && sysTime >= goodsData.classEndTime) ||
  26. goodsData.learningStatus == 2 ||
  27. goodsData.classStatus == 0 ||
  28. (goodsData.learningStatus == 3 &&
  29. sysTime < goodsData.learningTimeStart) ||
  30. !goodsData.examApplyGoodsList.length
  31. )
  32. "
  33. size="mini"
  34. type="warning"
  35. plain
  36. style="margin-left: 14px"
  37. @click="changeTest()"
  38. >预约考试
  39. </el-button>
  40. </h4>
  41. <div style="margin: 14px 0px">
  42. <el-button
  43. size="small"
  44. v-for="(item, index) in subjectList"
  45. :type="newActiveSubjectId === item.id ? 'primary' : ''"
  46. :key="index"
  47. @click="newActiveSubjectId = item.id"
  48. >{{ item.name }}</el-button
  49. >
  50. </div>
  51. <div v-for="(item, index) in courseList" :key="index" v-show="item.subjectId === newActiveSubjectId || !newActiveSubjectId">
  52. <p class="firstTop hoverStyle" @click="changeStatus(item)">
  53. <span class="iconStyle">课</span
  54. ><span class="titles">{{ item.courseName }}</span
  55. ><span class="showHide"
  56. ><span v-if="item.showStatus">收起∧</span
  57. ><span v-else>展开∨</span></span
  58. >
  59. </p>
  60. <div
  61. v-if="item.children && item.children.length > 0 && item.showStatus"
  62. >
  63. <template v-for="(items, indexs) in item.children">
  64. <div v-if="items.type === 1" :key="indexs">
  65. <p
  66. class="moduleStyle hoverStyle"
  67. @click="changeModuleStatus(items, index, indexs)"
  68. >
  69. {{ items.menuName }}
  70. <span class="showHide"
  71. ><i v-if="items.showStatus" class="el-icon-arrow-up"></i>
  72. <i v-else class="el-icon-arrow-down"></i
  73. ></span>
  74. </p>
  75. <template
  76. v-if="
  77. items.showStatus &&
  78. items.children &&
  79. items.children.length > 0
  80. "
  81. >
  82. <div
  83. v-for="(i, k) in items.children"
  84. :key="k"
  85. style="padding-left: 20px"
  86. >
  87. <div
  88. class="chapterStyle hoverStyle"
  89. @click="changeChapterStatus(2, i, index, indexs, k)"
  90. >
  91. <!-- <span class="iconStyle">章</span> -->
  92. {{ i.name }}
  93. <span class="showHide"
  94. ><i v-if="i.showStatus" class="el-icon-arrow-up"></i>
  95. <i v-else class="el-icon-arrow-down"></i
  96. ></span>
  97. </div>
  98. <template v-if="i.showStatus && i.children.length > 0">
  99. <div
  100. v-for="(is, ks) in i.children"
  101. class="sectionStyle hoverStyleSection"
  102. :key="ks"
  103. style="padding-left: 20px"
  104. >
  105. <el-row style="display: flex; align-items: center">
  106. <el-col :span="12">
  107. <span class="iconStyles">•</span>
  108. <span class="upStudyStyle sizeStyle">{{
  109. is.sectionType === 1
  110. ? "录播"
  111. : is.sectionType === 2
  112. ? "直播"
  113. : is.sectionType === 3
  114. ? "回放"
  115. : is.doType == 1
  116. ? "练习"
  117. : is.doType != 1
  118. ? "考试"
  119. : ""
  120. }}</span>
  121. <span class="span_style">{{ is.name }}</span>
  122. <span v-if="is.recordStatus" class="upStudyStyle"
  123. >上次学到</span
  124. >
  125. </el-col>
  126. <el-col :span="4">
  127. <span v-show="is.teacherName"
  128. >已选讲师:{{ is.teacherName }}</span
  129. >
  130. </el-col>
  131. <el-col :span="3">
  132. <el-progress
  133. v-if="is.studyDuration && is.durationTime"
  134. :show-text="false"
  135. :percentage="
  136. (is.studyDuration / is.durationTime) * 100 > 100
  137. ? 100
  138. : (is.studyDuration / is.durationTime) * 100
  139. "
  140. ></el-progress>
  141. </el-col>
  142. <el-col :span="2">
  143. <span v-show="is.studyDuration">
  144. {{
  145. $tools.secondToDate(is.studyDuration) +
  146. "/" +
  147. $tools.secondToDate(is.durationTime)
  148. }}
  149. </span>
  150. </el-col>
  151. <el-col :span="2" :offset="1" v-if="!is.sectionType">
  152. <el-button
  153. size="mini"
  154. style="width: 90px !important"
  155. type="text"
  156. v-if="is.doType == 1"
  157. @click="getResource(item, is)"
  158. >进入学习</el-button
  159. ><el-button
  160. size="mini"
  161. style="width: 90px !important"
  162. type="text"
  163. v-else
  164. @click="getResource(item, is)"
  165. >进入考试</el-button
  166. >
  167. </el-col>
  168. <el-col
  169. :span="2"
  170. :offset="1"
  171. v-else-if="is.sectionType != 2"
  172. >
  173. <el-button
  174. size="mini"
  175. type="text"
  176. style="width: 90px !important"
  177. v-if="
  178. is.studyDuration > 0 &&
  179. is.durationTime > 0 &&
  180. is.studyDuration == is.durationTime
  181. "
  182. @click="studyFunc(item, is)"
  183. >再次学习</el-button
  184. >
  185. <el-button
  186. type="primary"
  187. size="mini"
  188. style="width: 90px !important"
  189. v-else-if="
  190. is.studyDuration > 0 &&
  191. is.durationTime > 0 &&
  192. is.studyDuration != is.durationTime
  193. "
  194. @click="studyFunc(item, is)"
  195. >继续学习</el-button
  196. >
  197. <el-button
  198. size="mini"
  199. type="primary"
  200. style="width: 90px !important"
  201. plain
  202. v-else-if="
  203. is.studyDuration == 0 && is.durationTime > 0
  204. "
  205. @click="studyFunc(item, is)"
  206. >未开始</el-button
  207. > </el-col
  208. ><el-col :span="2" :offset="1" v-else>
  209. <el-button
  210. size="mini"
  211. plain
  212. disabled
  213. type="success"
  214. style="width: 90px !important"
  215. v-if="is.liveStartTime > sysTime"
  216. @click="studyFunc(item, is)"
  217. >未开播</el-button
  218. >
  219. <el-button
  220. size="mini"
  221. plain
  222. disabled
  223. type="danger"
  224. style="width: 90px !important"
  225. v-else-if="is.liveEndTime < sysTime"
  226. @click="studyFunc(item, is)"
  227. >已结束</el-button
  228. >
  229. <el-button
  230. size="mini"
  231. plain
  232. type="primary"
  233. style="width: 90px !important; text-align: center"
  234. v-else-if="
  235. is.liveEndTime > sysTime &&
  236. is.liveStartTime < sysTime
  237. "
  238. @click="studyFunc(item, is)"
  239. >进入直播间</el-button
  240. >
  241. </el-col>
  242. </el-row>
  243. </div>
  244. </template>
  245. </div>
  246. </template>
  247. </div>
  248. <div v-if="items.type === 2" :key="indexs">
  249. <div
  250. class="chapterStyle hoverStyle"
  251. @click="changeChapterStatus(1, items, index, indexs)"
  252. >
  253. <!-- <span class="iconStyle">章</span> -->
  254. {{ items.menuName }}
  255. <span class="showHide"
  256. ><i v-if="items.showStatus" class="el-icon-arrow-up"></i>
  257. <i v-else class="el-icon-arrow-down"></i
  258. ></span>
  259. </div>
  260. <template v-if="items.showStatus && items.children.length > 0">
  261. <div
  262. v-for="(i, k) in items.children"
  263. class="sectionStyle hoverStyleSection"
  264. :key="k"
  265. style="padding-left: 20px"
  266. >
  267. <el-row style="display: flex; align-items: center">
  268. <el-col :span="12">
  269. <span class="iconStyles">•</span>
  270. <span class="upStudyStyle sizeStyle">{{
  271. i.sectionType === 1
  272. ? "录播"
  273. : i.sectionType === 2
  274. ? "直播"
  275. : i.sectionType === 3
  276. ? "回放"
  277. : i.doType == 1
  278. ? "练习"
  279. : i.doType != 1
  280. ? "考试"
  281. : ""
  282. }}</span>
  283. <span class="span_style">
  284. {{ i.name }}
  285. </span>
  286. <span v-if="i.recordStatus" class="upStudyStyle"
  287. >上次学到</span
  288. >
  289. </el-col>
  290. <el-col :span="4">
  291. <span v-show="i.teacherName"
  292. >已选讲师:{{ i.teacherName }}</span
  293. >
  294. </el-col>
  295. <el-col :span="3">
  296. <el-progress
  297. v-if="i.studyDuration && i.durationTime"
  298. :show-text="false"
  299. :percentage="
  300. (i.studyDuration / i.durationTime) * 100 > 100
  301. ? 100
  302. : (i.studyDuration / i.durationTime) * 100
  303. "
  304. ></el-progress>
  305. </el-col>
  306. <el-col :span="2">
  307. <span v-show="i.studyDuration">
  308. {{
  309. $tools.secondToDate(i.studyDuration) +
  310. "/" +
  311. $tools.secondToDate(i.durationTime)
  312. }}
  313. </span>
  314. </el-col>
  315. <el-col :span="2" :offset="1" v-if="!i.sectionType">
  316. <el-button
  317. size="mini"
  318. style="width: 90px !important"
  319. type="text"
  320. v-if="i.doType == 1"
  321. @click="getResource(item, i)"
  322. >进入学习</el-button
  323. ><el-button
  324. size="mini"
  325. style="width: 90px !important"
  326. type="text"
  327. v-else
  328. @click="getResource(item, i)"
  329. >进入考试</el-button
  330. >
  331. </el-col>
  332. <el-col
  333. :span="2"
  334. :offset="1"
  335. v-else-if="i.sectionType != 2"
  336. >
  337. <el-button
  338. size="mini"
  339. type="text"
  340. style="width: 90px !important"
  341. v-if="
  342. i.studyDuration > 0 &&
  343. i.durationTime > 0 &&
  344. i.studyDuration == i.durationTime
  345. "
  346. @click="studyFunc(item, i)"
  347. >再次学习</el-button
  348. >
  349. <el-button
  350. type="primary"
  351. size="mini"
  352. style="width: 90px !important"
  353. v-else-if="
  354. i.studyDuration > 0 &&
  355. i.durationTime > 0 &&
  356. i.studyDuration != i.durationTime
  357. "
  358. @click="studyFunc(item, i)"
  359. >继续学习</el-button
  360. >
  361. <el-button
  362. size="mini"
  363. plain
  364. type="primary"
  365. style="width: 90px !important"
  366. v-else-if="i.studyDuration == 0 && i.durationTime > 0"
  367. @click="studyFunc(item, i)"
  368. >未开始</el-button
  369. >
  370. </el-col>
  371. <el-col :span="2" :offset="1" v-else>
  372. <el-button
  373. size="mini"
  374. style="width: 90px !important"
  375. plain
  376. disabled
  377. type="success"
  378. v-if="i.liveStartTime > sysTime"
  379. @click="studyFunc(item, i)"
  380. >未开播</el-button
  381. >
  382. <el-button
  383. size="mini"
  384. style="width: 90px !important"
  385. plain
  386. disabled
  387. type="danger"
  388. v-else-if="i.liveEndTime < sysTime"
  389. @click="studyFunc(item, i)"
  390. >已结束</el-button
  391. >
  392. <el-button
  393. size="mini"
  394. style="width: 90px !important; text-align: center"
  395. plain
  396. type="primary"
  397. v-else-if="
  398. i.liveEndTime > sysTime && i.liveStartTime < sysTime
  399. "
  400. @click="studyFunc(item, i)"
  401. >进入直播间</el-button
  402. >
  403. </el-col>
  404. </el-row>
  405. </div>
  406. </template>
  407. </div>
  408. <div
  409. v-if="items.type === 3"
  410. :key="indexs"
  411. class="sectionStyle hoverStyle"
  412. >
  413. <el-row style="display: flex; align-items: center">
  414. <el-col :span="12">
  415. <span class="iconStyles">•</span>
  416. <span class="upStudyStyle sizeStyle">{{
  417. items.sectionType === 1
  418. ? "录播"
  419. : items.sectionType === 2
  420. ? "直播"
  421. : items.sectionType === 3
  422. ? "回放"
  423. : items.doType == 1
  424. ? "练习"
  425. : items.doType != 1
  426. ? "考试"
  427. : ""
  428. }}</span>
  429. <span class="span_style">
  430. {{ items.menuName }}
  431. </span>
  432. <span v-if="items.recordStatus" class="upStudyStyle"
  433. >上次学到</span
  434. >
  435. </el-col>
  436. <el-col :span="4">
  437. <span v-show="items.teacherName"
  438. >已选讲师:{{ items.teacherName }}</span
  439. >
  440. </el-col>
  441. <el-col :span="3">
  442. <el-progress
  443. v-if="items.studyDuration && items.durationTime"
  444. :show-text="false"
  445. :percentage="
  446. (items.studyDuration / items.durationTime) * 100 > 100
  447. ? 100
  448. : (items.studyDuration / items.durationTime) * 100
  449. "
  450. ></el-progress>
  451. </el-col>
  452. <el-col :span="2">
  453. <span v-show="items.studyDuration">
  454. {{
  455. $tools.secondToDate(items.studyDuration) +
  456. "/" +
  457. $tools.secondToDate(items.durationTime)
  458. }}
  459. </span>
  460. </el-col>
  461. <el-col :span="2" :offset="1" v-if="!items.sectionType">
  462. <el-button
  463. size="mini"
  464. style="width: 90px !important"
  465. type="text"
  466. v-if="items.doType == 1"
  467. @click="getResource(item, items)"
  468. >进入学习</el-button
  469. ><el-button
  470. size="mini"
  471. style="width: 90px !important"
  472. type="text"
  473. v-else
  474. @click="getResource(item, items)"
  475. >进入考试</el-button
  476. >
  477. </el-col>
  478. <el-col
  479. :span="2"
  480. :offset="1"
  481. v-else-if="items.sectionType != 2"
  482. >
  483. <el-button
  484. size="mini"
  485. style="width: 90px !important"
  486. type="text"
  487. v-if="
  488. items.studyDuration > 0 &&
  489. items.durationTime > 0 &&
  490. items.studyDuration == items.durationTime
  491. "
  492. @click="studyFunc(item, items)"
  493. >再次学习</el-button
  494. >
  495. <el-button
  496. type="primary"
  497. style="width: 90px !important"
  498. size="mini"
  499. v-else-if="
  500. items.studyDuration > 0 &&
  501. items.durationTime > 0 &&
  502. items.studyDuration != items.durationTime
  503. "
  504. @click="studyFunc(item, items)"
  505. >继续学习</el-button
  506. >
  507. <el-button
  508. style="width: 90px !important"
  509. plain
  510. size="mini"
  511. type="primary"
  512. v-else-if="
  513. items.studyDuration == 0 && items.durationTime > 0
  514. "
  515. @click="studyFunc(item, items)"
  516. >未开始</el-button
  517. >
  518. </el-col>
  519. <el-col :span="2" :offset="1" v-else>
  520. <el-button
  521. size="mini"
  522. style="width: 90px !important"
  523. plain
  524. disabled
  525. type="success"
  526. v-if="items.liveStartTime > sysTime"
  527. @click="studyFunc(item, items)"
  528. >未开播</el-button
  529. >
  530. <el-button
  531. size="mini"
  532. style="width: 90px !important"
  533. plain
  534. disabled
  535. type="danger"
  536. v-else-if="items.liveEndTime < sysTime"
  537. @click="studyFunc(item, items)"
  538. >已结束</el-button
  539. >
  540. <el-button
  541. size="mini"
  542. style="width: 90px !important; text-align: center"
  543. plain
  544. type="primary"
  545. v-else-if="
  546. items.liveEndTime > sysTime &&
  547. items.liveStartTime < sysTime
  548. "
  549. @click="studyFunc(item, items)"
  550. >进入直播间</el-button
  551. >
  552. </el-col>
  553. </el-row>
  554. </div>
  555. </template>
  556. </div>
  557. </div>
  558. </div>
  559. <courseData ref="courseData" @backData="backData" />
  560. <el-dialog
  561. title="实名验证确认"
  562. :visible.sync="showConfirm"
  563. width="600px"
  564. class="showconfirm"
  565. :close-on-click-modal="false"
  566. :close-on-press-escape="false"
  567. :show-close="false"
  568. >
  569. <div class="showconfirm__content">
  570. <div class="text">
  571. 为避免个人信息不正确导致您的学习时长无效,请认真核对以下信息是否正确,如信息有误请取消当前操作,立刻联系020-38946666
  572. </div>
  573. <el-descriptions :column="1">
  574. <el-descriptions-item label="姓名">{{
  575. userInfo && userInfo.realname
  576. }}</el-descriptions-item>
  577. <el-descriptions-item label="手机号">{{
  578. userInfo && userInfo.telphone
  579. }}</el-descriptions-item>
  580. <el-descriptions-item label="身份证号">{{
  581. userInfo && userInfo.idCard
  582. }}</el-descriptions-item>
  583. </el-descriptions>
  584. <div class="">
  585. <el-checkbox v-model="confirmChecked">确认个人信息无误</el-checkbox>
  586. </div>
  587. </div>
  588. <span slot="footer" class="dialog-footer">
  589. <el-button @click="showConfirm = false">取 消</el-button>
  590. <el-button
  591. type="primary"
  592. @click="confirmUser"
  593. :disabled="confirmCount > 0"
  594. :loading="confirmLoading"
  595. >{{
  596. confirmCount > 0 ? "确 定(" + confirmCount + ")" : "确 定"
  597. }}</el-button
  598. >
  599. </span>
  600. </el-dialog>
  601. <RebuildModal
  602. ref="rebuildModal"
  603. @rebuildSubmit="rebuildSubmit($event)"
  604. ></RebuildModal>
  605. <!-- 预约考试弹窗 -->
  606. <appoint-test
  607. :appointModal.sync="appointModal"
  608. :appointItem="goodsData"
  609. ></appoint-test>
  610. </div>
  611. </template>
  612. <script>
  613. import { mapGetters, mapActions } from "vuex";
  614. import courseData from "./courseData.vue";
  615. import RebuildModal from "@/components/rebuildModal";
  616. import AppointTest from "./components/AppointTest.vue";
  617. export default {
  618. name: "MyCourse",
  619. components: { courseData, RebuildModal, AppointTest },
  620. data() {
  621. return {
  622. goodsData: {},
  623. courseList: [],
  624. sysTime: 0,
  625. showConfirm: false,
  626. confirmCount: 10,
  627. confirmChecked: false,
  628. confirmTimer: null,
  629. confirmLoading: false,
  630. appointModal: false, // 预约考试弹窗
  631. subjectList: [], //当前商品课程科目汇总
  632. newActiveSubjectId: "", //当前选中ID
  633. businessData: {},
  634. };
  635. },
  636. computed: {
  637. ...mapGetters(["userInfo"]),
  638. // filterList: function () {
  639. // return function (item) {
  640. // console.log(this.newActiveSubjectId);
  641. // let array = [];
  642. // if (this.newActiveSubjectId) {
  643. // array = item.filter((items) => {
  644. // return items.subjectId === this.newActiveSubjectId;
  645. // });
  646. // } else {
  647. // return item;
  648. // }
  649. // return array;
  650. // };
  651. // },
  652. },
  653. mounted() {
  654. this.getRecord();
  655. this.sysTime = this.$tools.timest();
  656. },
  657. methods: {
  658. comeStyle(courseItem, item) {
  659. console.log(item, "itemitem");
  660. this.$router.push({
  661. path: `/my-course-detail/${this.goodsData.goodsId}`,
  662. query: {
  663. gradeId: courseItem.gradeId,
  664. orderGoodsId: this.goodsData.orderGoodsId,
  665. courseId: courseItem.courseId,
  666. chapterId: item.chapterId,
  667. moduleId: item.moduleId,
  668. sectionId: item.sectionId || item.menuId,
  669. recordingUrl: item.recordingUrl,
  670. liveUrl: item.liveUrl,
  671. sectionType: item.sectionType,
  672. liveStartTime: item.liveStartTime,
  673. liveEndTime: item.liveEndTime,
  674. },
  675. });
  676. },
  677. changeCourse() {
  678. console.log("this.goodsData", this.goodsData);
  679. this.$refs.courseData.openBoxs(this.goodsData);
  680. },
  681. changeTest() {
  682. this.appointModal = true;
  683. },
  684. backData(item) {
  685. this.goodsData = item;
  686. this.courseBusiness();
  687. this.getGoodsCourseList(item);
  688. },
  689. //数组对象去重
  690. uniqueFunc(arr, uniId) {
  691. const res = new Map();
  692. return arr.filter(
  693. (item) => !res.has(item[uniId]) && res.set(item[uniId], 1)
  694. );
  695. },
  696. /**
  697. * 获取课程列表
  698. */
  699. getGoodsCourseList(item) {
  700. return new Promise((resolve, reject) => {
  701. this.$request
  702. .courseCourseList({
  703. goodsId: item.goodsId,
  704. gradeId: item.gradeId,
  705. })
  706. .then((res) => {
  707. var array = [];
  708. res.rows.forEach((element) => {
  709. element.showStatus = false;
  710. element.children = [];
  711. array.push({
  712. id: element.subjectId,
  713. name: element.subjectName,
  714. });
  715. });
  716. this.courseList = res.rows;
  717. array = this.uniqueFunc(array, "id");
  718. array.unshift({
  719. id: "",
  720. name: "全部",
  721. });
  722. // this.subjectList = array;
  723. this.subjectList = array.filter((item) => item.name)
  724. this.newActiveSubjectId = "";
  725. resolve();
  726. // if (res.rows && res.rows.length > 0) {
  727. // this.getRecord(res.rows[0]);
  728. // }
  729. });
  730. });
  731. },
  732. getGoodsData(res) {
  733. return new Promise((resolve, reject) => {
  734. this.$request
  735. .courseGoodsList({ orderGoodsId: res.data.orderGoodsId })
  736. .then(async (result) => {
  737. if (result.rows.length == 0) {
  738. this.resultCourseGoodsList();
  739. } else {
  740. let array = result.rows[0];
  741. array.orderGoodsId = res.data.orderGoodsId;
  742. this.goodsData = array;
  743. this.courseBusiness();
  744. await this.getGoodsCourseList(array);
  745. resolve();
  746. }
  747. });
  748. });
  749. },
  750. /**
  751. * 获取学习记录
  752. */
  753. getRecord(item) {
  754. this.$request.studyrecordgetUserWatchLast().then(async (res) => {
  755. if (res.data && res.data.sectionId) {
  756. await this.getGoodsData(res);
  757. var stop = false;
  758. for (let i = 0; i < this.courseList.length; i++) {
  759. if (stop) {
  760. break;
  761. }
  762. if (this.courseList[i].courseId == res.data.courseId) {
  763. await this.changeStatus(this.courseList[i]);
  764. for (let k = 0; k < this.courseList[i].children.length; k++) {
  765. if (res.data.moduleId) {
  766. console.log(1);
  767. if (
  768. this.courseList[i].children[k].menuId == res.data.moduleId
  769. ) {
  770. await this.changeModuleStatus(
  771. this.courseList[i].children[k],
  772. i,
  773. k
  774. );
  775. for (
  776. let j = 0;
  777. j < this.courseList[i].children[k].children.length;
  778. j++
  779. ) {
  780. if (
  781. this.courseList[i].children[k].children[j].chapterId ==
  782. res.data.chapterId
  783. ) {
  784. await this.changeChapterStatus(
  785. 2,
  786. this.courseList[i].children[k].children[j],
  787. i,
  788. k,
  789. j
  790. );
  791. for (
  792. let m = 0;
  793. m <
  794. this.courseList[i].children[k].children[j].children
  795. .length;
  796. m++
  797. ) {
  798. if (
  799. this.courseList[i].children[k].children[j].children[
  800. m
  801. ].sectionId == res.data.sectionId
  802. ) {
  803. this.$set(
  804. this.courseList[i].children[k].children[j]
  805. .children[m],
  806. "recordStatus",
  807. true
  808. );
  809. stop = true;
  810. break;
  811. }
  812. }
  813. }
  814. }
  815. }
  816. } else if (res.data.chapterId) {
  817. console.log(2);
  818. if (
  819. this.courseList[i].children[k].menuId == res.data.chapterId
  820. ) {
  821. await this.changeChapterStatus(
  822. 1,
  823. this.courseList[i].children[k],
  824. i,
  825. k
  826. );
  827. for (
  828. let j = 0;
  829. j < this.courseList[i].children[k].children.length;
  830. j++
  831. ) {
  832. if (
  833. this.courseList[i].children[k].children[j].sectionId ==
  834. res.data.sectionId
  835. ) {
  836. this.$set(
  837. this.courseList[i].children[k].children[j],
  838. "recordStatus",
  839. true
  840. );
  841. stop = true;
  842. break;
  843. }
  844. }
  845. }
  846. } else {
  847. console.log(3);
  848. if (
  849. this.courseList[i].children[k].menuId == res.data.sectionId
  850. ) {
  851. this.$set(
  852. this.courseList[i].children[k],
  853. "recordStatus",
  854. true
  855. );
  856. stop = true;
  857. break;
  858. }
  859. }
  860. }
  861. }
  862. }
  863. } else {
  864. this.resultCourseGoodsList();
  865. }
  866. });
  867. },
  868. resultCourseGoodsList() {
  869. this.$request.courseGoodsList({ pageNum: 1, pageSize: 1 }).then((res) => {
  870. if (res.rows && res.rows.length > 0) {
  871. this.backData(res.rows[0]);
  872. }
  873. });
  874. },
  875. /**
  876. * 展开获取课程详情列表
  877. */
  878. changeStatus(item) {
  879. return new Promise((resolve, reject) => {
  880. console.log(item);
  881. if (item.children.length > 0) {
  882. item.showStatus = !item.showStatus;
  883. return;
  884. }
  885. this.$request
  886. .reMenuList({
  887. courseId: item.courseId,
  888. gradeId: item.gradeId,
  889. orderGoodsId: this.goodsData.orderGoodsId,
  890. })
  891. .then((res) => {
  892. res.rows.forEach((items) => {
  893. if (items.type != 3) {
  894. items.showStatus = false;
  895. items.children = [];
  896. }
  897. });
  898. for (let i = 0; i < this.courseList.length; i++) {
  899. if (this.courseList[i].courseId == item.courseId) {
  900. this.$set(this.courseList[i], "children", res.rows);
  901. this.$set(
  902. this.courseList[i],
  903. "showStatus",
  904. !this.courseList[i].showStatus
  905. );
  906. break;
  907. }
  908. }
  909. resolve();
  910. });
  911. });
  912. },
  913. /**
  914. * 模块详情列表
  915. */
  916. changeModuleStatus(item, index, indexs) {
  917. return new Promise((resolve, reject) => {
  918. if (item.children && item.children.length > 0) {
  919. item.showStatus = !item.showStatus;
  920. return;
  921. }
  922. this.$request
  923. .reChapterList({
  924. moduleId: item.menuId,
  925. gradeId: item.gradeId,
  926. courseId: item.courseId,
  927. })
  928. .then((res) => {
  929. res.data.forEach((items) => {
  930. items.children = [];
  931. items.showStatus = false;
  932. });
  933. this.$set(
  934. this.courseList[index].children[indexs],
  935. "children",
  936. res.data
  937. );
  938. item.showStatus = !item.showStatus;
  939. resolve();
  940. });
  941. });
  942. },
  943. /**
  944. * 章详情列表 type = 1 父级章 type = 2 父级模块
  945. */
  946. changeChapterStatus(type, item, courseIndex, index, indexs) {
  947. return new Promise((resolve, reject) => {
  948. console.log(item, "定位");
  949. console.log(type, item, courseIndex, index, indexs)
  950. if (item.children && item.children.length > 0) {
  951. item.showStatus = !item.showStatus;
  952. return;
  953. }
  954. this.$request
  955. .reSectionList({
  956. chapterId: type === 1 ? item.menuId : item.chapterId,
  957. gradeId: item.gradeId,
  958. courseId: item.courseId,
  959. moduleId: item.moduleId || 0,
  960. orderGoodsId: this.goodsData.orderGoodsId,
  961. })
  962. .then((res) => {
  963. let newArr = res.data.filter((item) => {
  964. return item.type != 2;
  965. });
  966. let canLearn = newArr.every((item) => {
  967. if (item.learning == 1) {
  968. return true;
  969. } else {
  970. return false;
  971. }
  972. });
  973. res.data.forEach((section) => {
  974. section.canLearn = canLearn;
  975. });
  976. if (type === 1) {
  977. this.$set(
  978. this.courseList[courseIndex].children[index],
  979. "children",
  980. res.data
  981. );
  982. }
  983. if (type === 2) {
  984. this.$set(
  985. this.courseList[courseIndex].children[index].children[indexs],
  986. "children",
  987. res.data
  988. );
  989. }
  990. item.showStatus = !item.showStatus;
  991. resolve();
  992. });
  993. });
  994. },
  995. async studyFunc(courseItem, items) {
  996. this.sysTime = this.$tools.timest();
  997. let item = this.goodsData;
  998. console.log(item, "学习服务期");
  999. if (item.interfaceAccountId > 0) {
  1000. //学习账号已开通
  1001. if (item.learnStatus == 1) {
  1002. //跳转第三方h5
  1003. this.$router.push({
  1004. path: `/my-course-detail/${item.goodsId}`,
  1005. query: {
  1006. gradeId: item.gradeId,
  1007. orderGoodsId: item.orderGoodsId,
  1008. isOther: 1,
  1009. },
  1010. });
  1011. return;
  1012. } else {
  1013. this.$message({
  1014. type: "warning",
  1015. message:
  1016. "您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!",
  1017. });
  1018. return;
  1019. }
  1020. }
  1021. if (
  1022. (item.serviceStartTime && this.sysTime <= item.serviceStartTime) ||
  1023. (item.serviceEndTime && this.sysTime >= item.serviceEndTime)
  1024. ) {
  1025. this.$message({
  1026. type: "warning",
  1027. message: "不在学习服务期,不能进入学习",
  1028. });
  1029. return;
  1030. }
  1031. if (
  1032. (item.classStartTime && this.sysTime <= item.classStartTime) ||
  1033. (item.classEndTime && this.sysTime >= item.classEndTime)
  1034. ) {
  1035. this.$message({
  1036. type: "warning",
  1037. message: "不在班级有效期,不能进入学习",
  1038. });
  1039. return;
  1040. }
  1041. if (item.learningStatus == 2) {
  1042. this.$message({
  1043. type: "warning",
  1044. message: "开放学习时间待定,不能进入学习",
  1045. });
  1046. return;
  1047. }
  1048. if (item.classStatus == 0) {
  1049. this.$message({
  1050. type: "warning",
  1051. message: "尚未开班,不能进入学习",
  1052. });
  1053. return;
  1054. }
  1055. if (item.learningStatus == 3 && this.sysTime < item.learningTimeStart) {
  1056. this.$message({
  1057. type: "warning",
  1058. message: "不在开放学习时间,不能进入学习",
  1059. });
  1060. return;
  1061. }
  1062. var confirmDetail = true;
  1063. if (item.educationName == "继续教育") {
  1064. if (
  1065. item.officialName &&
  1066. item.businessName == "二级" &&
  1067. item.projectName == "建造师"
  1068. ) {
  1069. confirmDetail = await this.userConfirmInfoDetail();
  1070. }
  1071. }
  1072. // //内部系统
  1073. // if (item.interfacePushId > 0 && item.officialStatus != 1) {
  1074. // this.$message({
  1075. // type: "warning",
  1076. // message: "机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!",
  1077. // });
  1078. // return;
  1079. // }
  1080. if (!confirmDetail) {
  1081. return;
  1082. }
  1083. let rebuildStatus = await this.courseGoodsRebuildStatus(
  1084. item.goodsId,
  1085. item.gradeId
  1086. );
  1087. if (rebuildStatus == 0) {
  1088. this.$refs.rebuildModal.showModal(item);
  1089. return;
  1090. }
  1091. // if (item.educationName == "继续教育") {
  1092. this.$request
  1093. .lockLockStatus({
  1094. action: "jxjy",
  1095. uuid: sessionStorage.getItem("uuid"),
  1096. })
  1097. .then((res) => {
  1098. //有其他端在操作,不能学习
  1099. this.$message({
  1100. type: "warning",
  1101. message: res.msg,
  1102. });
  1103. })
  1104. .catch((err) => {
  1105. //可以学习
  1106. this.$request
  1107. .courseCourseList({
  1108. pageNum: 1,
  1109. pageSize: 1,
  1110. goodsId: item.goodsId,
  1111. gradeId: item.gradeId,
  1112. })
  1113. .then(async (res) => {
  1114. //学习次数是否上限---start
  1115. let learnNum = await this.goodsTodayStudySectionNum(courseItem);
  1116. let hasLearn = await this.gradeCheckGoodsStudy(courseItem, items);
  1117. console.log(learnNum, hasLearn);
  1118. if (this.goodsData.sectionMaxNum > 0) {
  1119. if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
  1120. this.clickLock = false;
  1121. this.$message({
  1122. type: "warning",
  1123. message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
  1124. });
  1125. return;
  1126. }
  1127. }
  1128. //学习次数是否上限---end
  1129. if (res.rows.length) {
  1130. // this.$emit("backData", item);
  1131. // this.dialogVisible = false;
  1132. this.comeStyle(courseItem, items);
  1133. // this.$router.push({
  1134. // path: `/my-course-detail/${item.goodsId}`,
  1135. // query: {
  1136. // gradeId: item.gradeId,
  1137. // orderGoodsId: item.orderGoodsId,
  1138. // courseId: res.rows[0].courseId || "",
  1139. // },
  1140. // });
  1141. // }
  1142. } else {
  1143. this.$message({
  1144. type: "warning",
  1145. message: "课程内暂无可以学习的科目",
  1146. });
  1147. }
  1148. });
  1149. });
  1150. },
  1151. async getResource(courseLists, section) {
  1152. console.log(section);
  1153. if (section.type == 2) {
  1154. //试卷
  1155. console.log("试卷");
  1156. console.log(courseLists, section, this.goodsData);
  1157. let learnNum = await this.goodsTodayStudySectionNum(section);
  1158. let hasLearn = await this.gradeCheckGoodsStudy(courseLists, section);
  1159. if (this.goodsData.sectionMaxNum > 0) {
  1160. if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
  1161. this.$message({
  1162. type: "warning",
  1163. message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
  1164. });
  1165. return;
  1166. }
  1167. }
  1168. if (this.businessData.goodsLearningOrder == 1) {
  1169. if (section.canLearn) {
  1170. let num = await this.bankRecordDoNum(courseLists, section);
  1171. //有次数限制
  1172. if (section.answerNum - num > 0 && section.answerNum > 0) {
  1173. // this.$set(this.list[index],'doNum',(item.doNum+1))
  1174. this.$router.push({
  1175. path: "/course-exam/" + this.goodsData.goodsId,
  1176. query: {
  1177. courseId: courseLists.courseId,
  1178. gradeId: this.goodsData.gradeId,
  1179. moduleId: section.moduleId || 0,
  1180. examId: section.typeId,
  1181. chapterId: section.chapterId || 0,
  1182. orderGoodsId: this.goodsData.orderGoodsId,
  1183. },
  1184. });
  1185. //没有答题次数限制
  1186. } else if (section.answerNum == 0) {
  1187. this.$router.push({
  1188. path: "/course-exam/" + this.goodsData.goodsId,
  1189. query: {
  1190. courseId: courseLists.courseId,
  1191. gradeId: this.goodsData.gradeId,
  1192. moduleId: section.moduleId || 0,
  1193. examId: section.typeId,
  1194. chapterId: section.chapterId || 0,
  1195. orderGoodsId: this.goodsData.orderGoodsId,
  1196. },
  1197. });
  1198. } else {
  1199. this.$message({
  1200. type: "warning",
  1201. message: "该试卷只能答题" + section.answerNum + "次",
  1202. });
  1203. return;
  1204. }
  1205. this.studyLog(
  1206. (section.moduleId = 0),
  1207. (section.chapterId = 0),
  1208. section.typeId,
  1209. courseLists
  1210. );
  1211. } else {
  1212. this.$message({
  1213. type: "warning",
  1214. message: "请按顺序学完视频课程再进行练习和测试",
  1215. });
  1216. }
  1217. } else if (
  1218. this.businessData.goodsLearningOrder == 2 &&
  1219. !section.rebuild
  1220. ) {
  1221. let rows = await this.studyRecordMenuAllList(courseLists);
  1222. let isStop = false;
  1223. let newRows = [];
  1224. for (let i = 0; i < rows.length; i++) {
  1225. let moduleTrue = rows[i].moduleId == section.moduleId;
  1226. let chapterTrue = rows[i].chapterId == section.chapterId;
  1227. if (moduleTrue && chapterTrue) {
  1228. isStop = true;
  1229. if (rows[i].sectionType != 2) {
  1230. //忽略直播
  1231. newRows.push(rows[i]);
  1232. }
  1233. } else {
  1234. if (!isStop) {
  1235. if (rows[i].sectionType != 2) {
  1236. //忽略直播
  1237. newRows.push(rows[i]);
  1238. }
  1239. } else {
  1240. break;
  1241. }
  1242. }
  1243. }
  1244. console.log(newRows);
  1245. let isAllLearn = newRows.every((item) => {
  1246. return item.studyStatus == 1;
  1247. });
  1248. if (isAllLearn) {
  1249. //之前的都学完了
  1250. // if(canLearn) { //视频的上一节学完
  1251. let num = await this.bankRecordDoNum(courseLists, section);
  1252. //有次数限制
  1253. if (section.answerNum - num > 0 && section.answerNum > 0) {
  1254. console.log(this.list[index]);
  1255. this.$router.push({
  1256. path: "/course-exam/" + this.goodsData.goodsId,
  1257. query: {
  1258. courseId: courseLists.courseId,
  1259. gradeId: this.goodsData.gradeId,
  1260. moduleId: section.moduleId || 0,
  1261. examId: section.typeId,
  1262. chapterId: section.chapterId || 0,
  1263. orderGoodsId: this.goodsData.orderGoodsId,
  1264. },
  1265. });
  1266. //没有答题次数限制
  1267. } else if (section.answerNum == 0) {
  1268. this.$router.push({
  1269. path: "/course-exam/" + this.goodsData.goodsId,
  1270. query: {
  1271. courseId: courseLists.courseId,
  1272. gradeId: this.goodsData.gradeId,
  1273. moduleId: section.moduleId || 0,
  1274. examId: section.typeId,
  1275. chapterId: section.chapterId || 0,
  1276. orderGoodsId: this.goodsData.orderGoodsId,
  1277. },
  1278. });
  1279. } else {
  1280. this.$message({
  1281. type: "warning",
  1282. message: "该试卷只能答题" + section.answerNum + "次",
  1283. });
  1284. return;
  1285. }
  1286. this.studyLog(
  1287. (section.moduleId = 0),
  1288. (section.chapterId = 0),
  1289. section.typeId,
  1290. courseLists
  1291. );
  1292. } else {
  1293. this.$message({
  1294. type: "warning",
  1295. message: "请学完视频课程再进行练习和测试",
  1296. });
  1297. }
  1298. } else {
  1299. let num = await this.bankRecordDoNum(courseLists, section);
  1300. //有次数限制
  1301. if (section.answerNum - section.doNum > 0 && section.answerNum > 0) {
  1302. // this.$set(this.list[index],'doNum',(item.doNum+1))
  1303. this.$router.push({
  1304. path: "/course-exam/" + this.goodsData.goodsId,
  1305. query: {
  1306. courseId: courseLists.courseId,
  1307. gradeId: this.goodsData.gradeId,
  1308. moduleId: section.moduleId || 0,
  1309. examId: section.typeId,
  1310. chapterId: section.chapterId || 0,
  1311. orderGoodsId: this.goodsData.orderGoodsId,
  1312. },
  1313. });
  1314. //没有答题次数限制
  1315. } else if (section.answerNum == 0) {
  1316. this.$router.push({
  1317. path: "/course-exam/" + this.goodsData.goodsId,
  1318. query: {
  1319. courseId: courseLists.courseId,
  1320. gradeId: this.goodsData.gradeId,
  1321. moduleId: section.moduleId || 0,
  1322. examId: section.typeId,
  1323. chapterId: section.chapterId || 0,
  1324. orderGoodsId: this.goodsData.orderGoodsId,
  1325. },
  1326. });
  1327. } else {
  1328. this.$message({
  1329. type: "warning",
  1330. message: "该试卷只能答题" + section.answerNum + "次",
  1331. });
  1332. return;
  1333. }
  1334. this.studyLog(
  1335. (section.moduleId = 0),
  1336. (section.chapterId = 0),
  1337. section.typeId,
  1338. courseLists
  1339. );
  1340. }
  1341. return;
  1342. }
  1343. },
  1344. // 新增用户视频学习日志
  1345. studyLog(moduleId, chapterId, sectionId, courseLists) {
  1346. this.$axios({
  1347. url: "/user/study/log",
  1348. method: "post",
  1349. data: {
  1350. goodsId: this.goodsData.goodsId,
  1351. courseId: courseLists.courseId,
  1352. moduleId: moduleId || 0,
  1353. chapterId: chapterId || 0,
  1354. sectionId: sectionId || 0,
  1355. fromPlat: 2, //来源平台 1小程序 2PC网站
  1356. goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  1357. orderGoodsId: this.goodsData.orderGoodsId,
  1358. },
  1359. }).then((res) => {
  1360. console.log("直播的用户学习日志:", res);
  1361. });
  1362. },
  1363. /**
  1364. * 获取培训项目详情
  1365. */
  1366. courseBusiness() {
  1367. this.$request.courseBusiness(this.goodsData.businessId).then((res) => {
  1368. this.businessData = res.data;
  1369. });
  1370. },
  1371. bankRecordDoNum(courseLists, section) {
  1372. return new Promise((resolve) => {
  1373. this.$request
  1374. .bankRecordDoNum({
  1375. goodsId: this.goodsData.goodsId,
  1376. gradeId: this.goodsData.gradeId,
  1377. chapterId: section.chapterId,
  1378. courseId: courseLists.courseId,
  1379. moduleId: 0,
  1380. examId: section.typeId,
  1381. })
  1382. .then((res) => {
  1383. resolve(res.data);
  1384. });
  1385. });
  1386. },
  1387. studyRecordMenuAllList(courseLists) {
  1388. return new Promise((resolve) => {
  1389. this.$request
  1390. .studyRecordMenuAllList({
  1391. courseId: courseLists.courseId,
  1392. gradeId: this.goodsData.gradeId,
  1393. goodsId: this.goodsData.goodsId,
  1394. })
  1395. .then((res) => {
  1396. resolve(res.data);
  1397. });
  1398. });
  1399. },
  1400. gradeCheckGoodsStudy(courseItem, option) {
  1401. return new Promise((resolve) => {
  1402. this.$request
  1403. .gradeCheckGoodsStudy({
  1404. goodsId: this.goodsData.goodsId,
  1405. gradeId: courseItem.gradeId,
  1406. moduleId: option.moduleId || 0,
  1407. chapterId: option.chapterId || 0,
  1408. sectionId: option.sectionId || option.menuId,
  1409. })
  1410. .then((res) => {
  1411. resolve(res.data);
  1412. });
  1413. });
  1414. },
  1415. goodsTodayStudySectionNum(option) {
  1416. return new Promise((resolve) => {
  1417. this.$request
  1418. .goodsTodayStudySectionNum({
  1419. goodsId: this.goodsData.goodsId,
  1420. gradeId: option.gradeId,
  1421. })
  1422. .then((res) => {
  1423. resolve(res.data);
  1424. });
  1425. });
  1426. },
  1427. userConfirmInfoDetail() {
  1428. return new Promise((resolve) => {
  1429. this.$request
  1430. .userConfirmInfoDetail({
  1431. orderGoodsId: this.goodsData.orderGoodsId,
  1432. })
  1433. .then((res) => {
  1434. if (!res.data) {
  1435. clearInterval(this.confirmTimer);
  1436. this.confirmCount = 10;
  1437. this.showConfirm = true;
  1438. this.confirmTimer = setInterval(() => {
  1439. if (this.confirmCount > 0) {
  1440. this.confirmCount--;
  1441. } else {
  1442. clearInterval(this.confirmTimer);
  1443. }
  1444. }, 1000);
  1445. } else {
  1446. if (res.data.pushInfo) {
  1447. resolve(true);
  1448. } else {
  1449. this.$confirm(
  1450. "开通信息推送不成功,无法进入学习,请联系020-87085982!",
  1451. "提示",
  1452. {
  1453. confirmButtonText: "确定",
  1454. closeOnClickModal: false,
  1455. closeOnPressEscape: false,
  1456. distinguishCancelAndClose: false,
  1457. showClose: false,
  1458. showCancelButton: false,
  1459. }
  1460. )
  1461. .then((_) => {})
  1462. .catch((_) => {});
  1463. resolve(false);
  1464. }
  1465. }
  1466. });
  1467. });
  1468. },
  1469. confirmUser() {
  1470. if (!this.confirmChecked) {
  1471. this.$message.warning("请勾选确认个人信息无误");
  1472. return;
  1473. }
  1474. this.confirmLoading = true;
  1475. let infoJson = {
  1476. realname: this.userInfo.realname,
  1477. idCard: this.userInfo.idCard,
  1478. telphone: this.userInfo.telphone,
  1479. };
  1480. this.$request
  1481. .userConfirminfo({
  1482. infoJson: JSON.stringify(infoJson),
  1483. orderGoodsId: this.goodsData.orderGoodsId,
  1484. })
  1485. .then((res) => {
  1486. if (res.data.pushInfo) {
  1487. this.$message.success("提交成功");
  1488. } else {
  1489. this.$confirm(
  1490. "开通信息推送不成功,无法进入学习,请联系020-87085982!",
  1491. "提示",
  1492. {
  1493. confirmButtonText: "确定",
  1494. closeOnClickModal: false,
  1495. closeOnPressEscape: false,
  1496. distinguishCancelAndClose: false,
  1497. showClose: false,
  1498. showCancelButton: false,
  1499. }
  1500. )
  1501. .then((_) => {})
  1502. .catch((_) => {});
  1503. }
  1504. this.showConfirm = false;
  1505. this.confirmLoading = false;
  1506. });
  1507. },
  1508. /**
  1509. * @param {Object} goodsId 商品id
  1510. * 查询商品重修状态
  1511. */
  1512. courseGoodsRebuildStatus(goodsId, gradeId) {
  1513. return new Promise((resolve) => {
  1514. this.$request
  1515. .courseGoodsRebuildStatus({
  1516. goodsId: goodsId,
  1517. gradeId: gradeId,
  1518. })
  1519. .then((res) => {
  1520. resolve(res.data);
  1521. });
  1522. });
  1523. },
  1524. rebuildSubmit(item) {
  1525. this.$router.push({
  1526. path: `/my-course-detail/${item.goodsId}`,
  1527. query: {
  1528. gradeId: item.gradeId,
  1529. orderGoodsId: item.orderGoodsId,
  1530. rebuild: 1,
  1531. },
  1532. });
  1533. },
  1534. },
  1535. };
  1536. </script>
  1537. <!-- Add "scoped" attribute to limit CSS to this component only -->
  1538. <style scoped lang="scss">
  1539. .headerTitle {
  1540. color: #222;
  1541. font-weight: bold;
  1542. font-size: 24px;
  1543. padding: 28px 0px;
  1544. border-bottom: 1px solid #eee;
  1545. }
  1546. .firstTop {
  1547. padding: 24px 0px;
  1548. // margin: 24px 0px;
  1549. .iconStyle {
  1550. background-color: #3f8dfd;
  1551. color: #fff;
  1552. margin-right: 8px;
  1553. padding: 0px 4px;
  1554. border-radius: 4px;
  1555. font-size: 12px;
  1556. vertical-align: text-top;
  1557. }
  1558. .titles {
  1559. font-weight: bold;
  1560. color: #333;
  1561. font-size: 18px;
  1562. }
  1563. .showHide {
  1564. cursor: pointer;
  1565. user-select: none;
  1566. float: right;
  1567. color: #99a0a7;
  1568. }
  1569. }
  1570. .moduleStyle {
  1571. padding: 17px;
  1572. background-color: #f8f8f9;
  1573. font-weight: bold;
  1574. color: #222;
  1575. margin-bottom: 16px;
  1576. .showHide {
  1577. cursor: pointer;
  1578. user-select: none;
  1579. float: right;
  1580. color: #99a0a7;
  1581. }
  1582. }
  1583. .chapterStyle {
  1584. font-weight: 400;
  1585. .iconStyle {
  1586. background-color: #fff;
  1587. color: #3f8dfd;
  1588. margin-right: 8px;
  1589. padding: 0px 2px;
  1590. border-radius: 2px;
  1591. border: 1px solid #3f8dfd;
  1592. font-size: 10px;
  1593. vertical-align: text-top;
  1594. }
  1595. .showHide {
  1596. cursor: pointer;
  1597. user-select: none;
  1598. float: right;
  1599. color: #99a0a7;
  1600. }
  1601. margin-bottom: 16px;
  1602. padding: 17px;
  1603. border-bottom: 1px solid #eee;
  1604. }
  1605. .sectionStyle {
  1606. color: #99a0a7;
  1607. padding: 10px;
  1608. .iconStyles {
  1609. color: #99a0a7;
  1610. margin-right: 8px;
  1611. padding: 0px 2px;
  1612. }
  1613. }
  1614. .upStudyStyle {
  1615. background-color: #f2f7ff;
  1616. border: 1px solid #3f8dfd;
  1617. color: #3f8dfd;
  1618. padding: 3px 4px;
  1619. border-radius: 4px;
  1620. }
  1621. .sizeStyle {
  1622. background-color: #fff !important;
  1623. border-color: #979ea5 !important;
  1624. color: #979ea5 !important;
  1625. padding: 2px 3px !important;
  1626. }
  1627. .hoverStyle {
  1628. cursor: pointer;
  1629. transition: all 0.2s;
  1630. &:hover {
  1631. background-color: #eaf3ff;
  1632. }
  1633. }
  1634. .hoverStyleSection {
  1635. transition: all 0.2s;
  1636. &:hover {
  1637. background-color: #eaf3ff;
  1638. }
  1639. }
  1640. .span_style {
  1641. max-width: 400px;
  1642. display: inline-block;
  1643. vertical-align: middle;
  1644. }
  1645. </style>