index.vue 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674
  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 filterList(courseList)" :key="index">
  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. if (item.children && item.children.length > 0) {
  950. item.showStatus = !item.showStatus;
  951. return;
  952. }
  953. this.$request
  954. .reSectionList({
  955. chapterId: type === 1 ? item.menuId : item.chapterId,
  956. gradeId: item.gradeId,
  957. courseId: item.courseId,
  958. moduleId: item.moduleId || 0,
  959. orderGoodsId: this.goodsData.orderGoodsId,
  960. })
  961. .then((res) => {
  962. let newArr = res.data.filter((item) => {
  963. return item.type != 2;
  964. });
  965. let canLearn = newArr.every((item) => {
  966. if (item.learning == 1) {
  967. return true;
  968. } else {
  969. return false;
  970. }
  971. });
  972. res.data.forEach((section) => {
  973. section.canLearn = canLearn;
  974. });
  975. if (type === 1) {
  976. this.$set(
  977. this.courseList[courseIndex].children[index],
  978. "children",
  979. res.data
  980. );
  981. }
  982. if (type === 2) {
  983. this.$set(
  984. this.courseList[courseIndex].children[index].children[indexs],
  985. "children",
  986. res.data
  987. );
  988. }
  989. item.showStatus = !item.showStatus;
  990. resolve();
  991. });
  992. });
  993. },
  994. async studyFunc(courseItem, items) {
  995. this.sysTime = this.$tools.timest();
  996. let item = this.goodsData;
  997. console.log(item, "学习服务期");
  998. if (item.interfaceAccountId > 0) {
  999. //学习账号已开通
  1000. if (item.learnStatus == 1) {
  1001. //跳转第三方h5
  1002. this.$router.push({
  1003. path: `/my-course-detail/${item.goodsId}`,
  1004. query: {
  1005. gradeId: item.gradeId,
  1006. orderGoodsId: item.orderGoodsId,
  1007. isOther: 1,
  1008. },
  1009. });
  1010. return;
  1011. } else {
  1012. this.$message({
  1013. type: "warning",
  1014. message:
  1015. "您的学习账号未开通,请稍后再尝试,有疑问,请联系020-87085982!",
  1016. });
  1017. return;
  1018. }
  1019. }
  1020. if (
  1021. (item.serviceStartTime && this.sysTime <= item.serviceStartTime) ||
  1022. (item.serviceEndTime && this.sysTime >= item.serviceEndTime)
  1023. ) {
  1024. this.$message({
  1025. type: "warning",
  1026. message: "不在学习服务期,不能进入学习",
  1027. });
  1028. return;
  1029. }
  1030. if (
  1031. (item.classStartTime && this.sysTime <= item.classStartTime) ||
  1032. (item.classEndTime && this.sysTime >= item.classEndTime)
  1033. ) {
  1034. this.$message({
  1035. type: "warning",
  1036. message: "不在班级有效期,不能进入学习",
  1037. });
  1038. return;
  1039. }
  1040. if (item.learningStatus == 2) {
  1041. this.$message({
  1042. type: "warning",
  1043. message: "开放学习时间待定,不能进入学习",
  1044. });
  1045. return;
  1046. }
  1047. if (item.classStatus == 0) {
  1048. this.$message({
  1049. type: "warning",
  1050. message: "尚未开班,不能进入学习",
  1051. });
  1052. return;
  1053. }
  1054. if (item.learningStatus == 3 && this.sysTime < item.learningTimeStart) {
  1055. this.$message({
  1056. type: "warning",
  1057. message: "不在开放学习时间,不能进入学习",
  1058. });
  1059. return;
  1060. }
  1061. var confirmDetail = true;
  1062. if (item.educationName == "继续教育") {
  1063. if (
  1064. item.officialName &&
  1065. item.businessName == "二级" &&
  1066. item.projectName == "建造师"
  1067. ) {
  1068. confirmDetail = await this.userConfirmInfoDetail();
  1069. }
  1070. }
  1071. // //内部系统
  1072. // if (item.interfacePushId > 0 && item.officialStatus != 1) {
  1073. // this.$message({
  1074. // type: "warning",
  1075. // message: "机构正在为您报名中,请耐心等待,有疑问请联系020-87085982!",
  1076. // });
  1077. // return;
  1078. // }
  1079. if (!confirmDetail) {
  1080. return;
  1081. }
  1082. let rebuildStatus = await this.courseGoodsRebuildStatus(
  1083. item.goodsId,
  1084. item.gradeId
  1085. );
  1086. if (rebuildStatus == 0) {
  1087. this.$refs.rebuildModal.showModal(item);
  1088. return;
  1089. }
  1090. // if (item.educationName == "继续教育") {
  1091. this.$request
  1092. .lockLockStatus({
  1093. action: "jxjy",
  1094. uuid: sessionStorage.getItem("uuid"),
  1095. })
  1096. .then((res) => {
  1097. //有其他端在操作,不能学习
  1098. this.$message({
  1099. type: "warning",
  1100. message: res.msg,
  1101. });
  1102. })
  1103. .catch((err) => {
  1104. //可以学习
  1105. this.$request
  1106. .courseCourseList({
  1107. pageNum: 1,
  1108. pageSize: 1,
  1109. goodsId: item.goodsId,
  1110. gradeId: item.gradeId,
  1111. })
  1112. .then(async (res) => {
  1113. //学习次数是否上限---start
  1114. let learnNum = await this.goodsTodayStudySectionNum(courseItem);
  1115. let hasLearn = await this.gradeCheckGoodsStudy(courseItem, items);
  1116. console.log(learnNum, hasLearn);
  1117. if (this.goodsData.sectionMaxNum > 0) {
  1118. if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
  1119. this.clickLock = false;
  1120. this.$message({
  1121. type: "warning",
  1122. message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
  1123. });
  1124. return;
  1125. }
  1126. }
  1127. //学习次数是否上限---end
  1128. if (res.rows.length) {
  1129. // this.$emit("backData", item);
  1130. // this.dialogVisible = false;
  1131. this.comeStyle(courseItem, items);
  1132. // this.$router.push({
  1133. // path: `/my-course-detail/${item.goodsId}`,
  1134. // query: {
  1135. // gradeId: item.gradeId,
  1136. // orderGoodsId: item.orderGoodsId,
  1137. // courseId: res.rows[0].courseId || "",
  1138. // },
  1139. // });
  1140. // }
  1141. } else {
  1142. this.$message({
  1143. type: "warning",
  1144. message: "课程内暂无可以学习的科目",
  1145. });
  1146. }
  1147. });
  1148. });
  1149. },
  1150. async getResource(courseLists, section) {
  1151. console.log(section);
  1152. if (section.type == 2) {
  1153. //试卷
  1154. console.log("试卷");
  1155. console.log(courseLists, section, this.goodsData);
  1156. let learnNum = await this.goodsTodayStudySectionNum(section);
  1157. let hasLearn = await this.gradeCheckGoodsStudy(courseLists, section);
  1158. if (this.goodsData.sectionMaxNum > 0) {
  1159. if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
  1160. this.$message({
  1161. type: "warning",
  1162. message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
  1163. });
  1164. return;
  1165. }
  1166. }
  1167. if (this.businessData.goodsLearningOrder == 1) {
  1168. if (section.canLearn) {
  1169. let num = await this.bankRecordDoNum(courseLists, section);
  1170. //有次数限制
  1171. if (section.answerNum - num > 0 && section.answerNum > 0) {
  1172. // this.$set(this.list[index],'doNum',(item.doNum+1))
  1173. this.$router.push({
  1174. path: "/course-exam/" + this.goodsData.goodsId,
  1175. query: {
  1176. courseId: courseLists.courseId,
  1177. gradeId: this.goodsData.gradeId,
  1178. moduleId: section.moduleId || 0,
  1179. examId: section.typeId,
  1180. chapterId: section.chapterId || 0,
  1181. orderGoodsId: this.goodsData.orderGoodsId,
  1182. },
  1183. });
  1184. //没有答题次数限制
  1185. } else if (section.answerNum == 0) {
  1186. this.$router.push({
  1187. path: "/course-exam/" + this.goodsData.goodsId,
  1188. query: {
  1189. courseId: courseLists.courseId,
  1190. gradeId: this.goodsData.gradeId,
  1191. moduleId: section.moduleId || 0,
  1192. examId: section.typeId,
  1193. chapterId: section.chapterId || 0,
  1194. orderGoodsId: this.goodsData.orderGoodsId,
  1195. },
  1196. });
  1197. } else {
  1198. this.$message({
  1199. type: "warning",
  1200. message: "该试卷只能答题" + section.answerNum + "次",
  1201. });
  1202. return;
  1203. }
  1204. this.studyLog(
  1205. (section.moduleId = 0),
  1206. (section.chapterId = 0),
  1207. section.typeId,
  1208. courseLists
  1209. );
  1210. } else {
  1211. this.$message({
  1212. type: "warning",
  1213. message: "请按顺序学完视频课程再进行练习和测试",
  1214. });
  1215. }
  1216. } else if (
  1217. this.businessData.goodsLearningOrder == 2 &&
  1218. !section.rebuild
  1219. ) {
  1220. let rows = await this.studyRecordMenuAllList(courseLists);
  1221. let isStop = false;
  1222. let newRows = [];
  1223. for (let i = 0; i < rows.length; i++) {
  1224. let moduleTrue = rows[i].moduleId == section.moduleId;
  1225. let chapterTrue = rows[i].chapterId == section.chapterId;
  1226. if (moduleTrue && chapterTrue) {
  1227. isStop = true;
  1228. if (rows[i].sectionType != 2) {
  1229. //忽略直播
  1230. newRows.push(rows[i]);
  1231. }
  1232. } else {
  1233. if (!isStop) {
  1234. if (rows[i].sectionType != 2) {
  1235. //忽略直播
  1236. newRows.push(rows[i]);
  1237. }
  1238. } else {
  1239. break;
  1240. }
  1241. }
  1242. }
  1243. console.log(newRows);
  1244. let isAllLearn = newRows.every((item) => {
  1245. return item.studyStatus == 1;
  1246. });
  1247. if (isAllLearn) {
  1248. //之前的都学完了
  1249. // if(canLearn) { //视频的上一节学完
  1250. let num = await this.bankRecordDoNum(courseLists, section);
  1251. //有次数限制
  1252. if (section.answerNum - num > 0 && section.answerNum > 0) {
  1253. console.log(this.list[index]);
  1254. this.$router.push({
  1255. path: "/course-exam/" + this.goodsData.goodsId,
  1256. query: {
  1257. courseId: courseLists.courseId,
  1258. gradeId: this.goodsData.gradeId,
  1259. moduleId: section.moduleId || 0,
  1260. examId: section.typeId,
  1261. chapterId: section.chapterId || 0,
  1262. orderGoodsId: this.goodsData.orderGoodsId,
  1263. },
  1264. });
  1265. //没有答题次数限制
  1266. } else if (section.answerNum == 0) {
  1267. this.$router.push({
  1268. path: "/course-exam/" + this.goodsData.goodsId,
  1269. query: {
  1270. courseId: courseLists.courseId,
  1271. gradeId: this.goodsData.gradeId,
  1272. moduleId: section.moduleId || 0,
  1273. examId: section.typeId,
  1274. chapterId: section.chapterId || 0,
  1275. orderGoodsId: this.goodsData.orderGoodsId,
  1276. },
  1277. });
  1278. } else {
  1279. this.$message({
  1280. type: "warning",
  1281. message: "该试卷只能答题" + section.answerNum + "次",
  1282. });
  1283. return;
  1284. }
  1285. this.studyLog(
  1286. (section.moduleId = 0),
  1287. (section.chapterId = 0),
  1288. section.typeId,
  1289. courseLists
  1290. );
  1291. } else {
  1292. this.$message({
  1293. type: "warning",
  1294. message: "请学完视频课程再进行练习和测试",
  1295. });
  1296. }
  1297. } else {
  1298. let num = await this.bankRecordDoNum(courseLists, section);
  1299. //有次数限制
  1300. if (section.answerNum - section.doNum > 0 && section.answerNum > 0) {
  1301. // this.$set(this.list[index],'doNum',(item.doNum+1))
  1302. this.$router.push({
  1303. path: "/course-exam/" + this.goodsData.goodsId,
  1304. query: {
  1305. courseId: courseLists.courseId,
  1306. gradeId: this.goodsData.gradeId,
  1307. moduleId: section.moduleId || 0,
  1308. examId: section.typeId,
  1309. chapterId: section.chapterId || 0,
  1310. orderGoodsId: this.goodsData.orderGoodsId,
  1311. },
  1312. });
  1313. //没有答题次数限制
  1314. } else if (section.answerNum == 0) {
  1315. this.$router.push({
  1316. path: "/course-exam/" + this.goodsData.goodsId,
  1317. query: {
  1318. courseId: courseLists.courseId,
  1319. gradeId: this.goodsData.gradeId,
  1320. moduleId: section.moduleId || 0,
  1321. examId: section.typeId,
  1322. chapterId: section.chapterId || 0,
  1323. orderGoodsId: this.goodsData.orderGoodsId,
  1324. },
  1325. });
  1326. } else {
  1327. this.$message({
  1328. type: "warning",
  1329. message: "该试卷只能答题" + section.answerNum + "次",
  1330. });
  1331. return;
  1332. }
  1333. this.studyLog(
  1334. (section.moduleId = 0),
  1335. (section.chapterId = 0),
  1336. section.typeId,
  1337. courseLists
  1338. );
  1339. }
  1340. return;
  1341. }
  1342. },
  1343. // 新增用户视频学习日志
  1344. studyLog(moduleId, chapterId, sectionId, courseLists) {
  1345. this.$axios({
  1346. url: "/user/study/log",
  1347. method: "post",
  1348. data: {
  1349. goodsId: this.goodsData.goodsId,
  1350. courseId: courseLists.courseId,
  1351. moduleId: moduleId || 0,
  1352. chapterId: chapterId || 0,
  1353. sectionId: sectionId || 0,
  1354. fromPlat: 2, //来源平台 1小程序 2PC网站
  1355. goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  1356. orderGoodsId: this.goodsData.orderGoodsId,
  1357. },
  1358. }).then((res) => {
  1359. console.log("直播的用户学习日志:", res);
  1360. });
  1361. },
  1362. /**
  1363. * 获取培训项目详情
  1364. */
  1365. courseBusiness() {
  1366. this.$request.courseBusiness(this.goodsData.businessId).then((res) => {
  1367. this.businessData = res.data;
  1368. });
  1369. },
  1370. bankRecordDoNum(courseLists, section) {
  1371. return new Promise((resolve) => {
  1372. this.$request
  1373. .bankRecordDoNum({
  1374. goodsId: this.goodsData.goodsId,
  1375. gradeId: this.goodsData.gradeId,
  1376. chapterId: section.chapterId,
  1377. courseId: courseLists.courseId,
  1378. moduleId: 0,
  1379. examId: section.typeId,
  1380. })
  1381. .then((res) => {
  1382. resolve(res.data);
  1383. });
  1384. });
  1385. },
  1386. studyRecordMenuAllList(courseLists) {
  1387. return new Promise((resolve) => {
  1388. this.$request
  1389. .studyRecordMenuAllList({
  1390. courseId: courseLists.courseId,
  1391. gradeId: this.goodsData.gradeId,
  1392. goodsId: this.goodsData.goodsId,
  1393. })
  1394. .then((res) => {
  1395. resolve(res.data);
  1396. });
  1397. });
  1398. },
  1399. gradeCheckGoodsStudy(courseItem, option) {
  1400. return new Promise((resolve) => {
  1401. this.$request
  1402. .gradeCheckGoodsStudy({
  1403. goodsId: this.goodsData.goodsId,
  1404. gradeId: courseItem.gradeId,
  1405. moduleId: option.moduleId || 0,
  1406. chapterId: option.chapterId || 0,
  1407. sectionId: option.sectionId || option.menuId,
  1408. })
  1409. .then((res) => {
  1410. resolve(res.data);
  1411. });
  1412. });
  1413. },
  1414. goodsTodayStudySectionNum(option) {
  1415. return new Promise((resolve) => {
  1416. this.$request
  1417. .goodsTodayStudySectionNum({
  1418. goodsId: this.goodsData.goodsId,
  1419. gradeId: option.gradeId,
  1420. })
  1421. .then((res) => {
  1422. resolve(res.data);
  1423. });
  1424. });
  1425. },
  1426. userConfirmInfoDetail() {
  1427. return new Promise((resolve) => {
  1428. this.$request
  1429. .userConfirmInfoDetail({
  1430. orderGoodsId: this.goodsData.orderGoodsId,
  1431. })
  1432. .then((res) => {
  1433. if (!res.data) {
  1434. clearInterval(this.confirmTimer);
  1435. this.confirmCount = 10;
  1436. this.showConfirm = true;
  1437. this.confirmTimer = setInterval(() => {
  1438. if (this.confirmCount > 0) {
  1439. this.confirmCount--;
  1440. } else {
  1441. clearInterval(this.confirmTimer);
  1442. }
  1443. }, 1000);
  1444. } else {
  1445. if (res.data.pushInfo) {
  1446. resolve(true);
  1447. } else {
  1448. this.$confirm(
  1449. "开通信息推送不成功,无法进入学习,请联系020-87085982!",
  1450. "提示",
  1451. {
  1452. confirmButtonText: "确定",
  1453. closeOnClickModal: false,
  1454. closeOnPressEscape: false,
  1455. distinguishCancelAndClose: false,
  1456. showClose: false,
  1457. showCancelButton: false,
  1458. }
  1459. )
  1460. .then((_) => {})
  1461. .catch((_) => {});
  1462. resolve(false);
  1463. }
  1464. }
  1465. });
  1466. });
  1467. },
  1468. confirmUser() {
  1469. if (!this.confirmChecked) {
  1470. this.$message.warning("请勾选确认个人信息无误");
  1471. return;
  1472. }
  1473. this.confirmLoading = true;
  1474. let infoJson = {
  1475. realname: this.userInfo.realname,
  1476. idCard: this.userInfo.idCard,
  1477. telphone: this.userInfo.telphone,
  1478. };
  1479. this.$request
  1480. .userConfirminfo({
  1481. infoJson: JSON.stringify(infoJson),
  1482. orderGoodsId: this.goodsData.orderGoodsId,
  1483. })
  1484. .then((res) => {
  1485. if (res.data.pushInfo) {
  1486. this.$message.success("提交成功");
  1487. } else {
  1488. this.$confirm(
  1489. "开通信息推送不成功,无法进入学习,请联系020-87085982!",
  1490. "提示",
  1491. {
  1492. confirmButtonText: "确定",
  1493. closeOnClickModal: false,
  1494. closeOnPressEscape: false,
  1495. distinguishCancelAndClose: false,
  1496. showClose: false,
  1497. showCancelButton: false,
  1498. }
  1499. )
  1500. .then((_) => {})
  1501. .catch((_) => {});
  1502. }
  1503. this.showConfirm = false;
  1504. this.confirmLoading = false;
  1505. });
  1506. },
  1507. /**
  1508. * @param {Object} goodsId 商品id
  1509. * 查询商品重修状态
  1510. */
  1511. courseGoodsRebuildStatus(goodsId, gradeId) {
  1512. return new Promise((resolve) => {
  1513. this.$request
  1514. .courseGoodsRebuildStatus({
  1515. goodsId: goodsId,
  1516. gradeId: gradeId,
  1517. })
  1518. .then((res) => {
  1519. resolve(res.data);
  1520. });
  1521. });
  1522. },
  1523. rebuildSubmit(item) {
  1524. this.$router.push({
  1525. path: `/my-course-detail/${item.goodsId}`,
  1526. query: {
  1527. gradeId: item.gradeId,
  1528. orderGoodsId: item.orderGoodsId,
  1529. rebuild: 1,
  1530. },
  1531. });
  1532. },
  1533. },
  1534. };
  1535. </script>
  1536. <!-- Add "scoped" attribute to limit CSS to this component only -->
  1537. <style scoped lang="scss">
  1538. .headerTitle {
  1539. color: #222;
  1540. font-weight: bold;
  1541. font-size: 24px;
  1542. padding: 28px 0px;
  1543. border-bottom: 1px solid #eee;
  1544. }
  1545. .firstTop {
  1546. padding: 24px 0px;
  1547. // margin: 24px 0px;
  1548. .iconStyle {
  1549. background-color: #3f8dfd;
  1550. color: #fff;
  1551. margin-right: 8px;
  1552. padding: 0px 4px;
  1553. border-radius: 4px;
  1554. font-size: 12px;
  1555. vertical-align: text-top;
  1556. }
  1557. .titles {
  1558. font-weight: bold;
  1559. color: #333;
  1560. font-size: 18px;
  1561. }
  1562. .showHide {
  1563. cursor: pointer;
  1564. user-select: none;
  1565. float: right;
  1566. color: #99a0a7;
  1567. }
  1568. }
  1569. .moduleStyle {
  1570. padding: 17px;
  1571. background-color: #f8f8f9;
  1572. font-weight: bold;
  1573. color: #222;
  1574. margin-bottom: 16px;
  1575. .showHide {
  1576. cursor: pointer;
  1577. user-select: none;
  1578. float: right;
  1579. color: #99a0a7;
  1580. }
  1581. }
  1582. .chapterStyle {
  1583. font-weight: 400;
  1584. .iconStyle {
  1585. background-color: #fff;
  1586. color: #3f8dfd;
  1587. margin-right: 8px;
  1588. padding: 0px 2px;
  1589. border-radius: 2px;
  1590. border: 1px solid #3f8dfd;
  1591. font-size: 10px;
  1592. vertical-align: text-top;
  1593. }
  1594. .showHide {
  1595. cursor: pointer;
  1596. user-select: none;
  1597. float: right;
  1598. color: #99a0a7;
  1599. }
  1600. margin-bottom: 16px;
  1601. padding: 17px;
  1602. border-bottom: 1px solid #eee;
  1603. }
  1604. .sectionStyle {
  1605. color: #99a0a7;
  1606. padding: 10px;
  1607. .iconStyles {
  1608. color: #99a0a7;
  1609. margin-right: 8px;
  1610. padding: 0px 2px;
  1611. }
  1612. }
  1613. .upStudyStyle {
  1614. background-color: #f2f7ff;
  1615. border: 1px solid #3f8dfd;
  1616. color: #3f8dfd;
  1617. padding: 3px 4px;
  1618. border-radius: 4px;
  1619. }
  1620. .sizeStyle {
  1621. background-color: #fff !important;
  1622. border-color: #979ea5 !important;
  1623. color: #979ea5 !important;
  1624. padding: 2px 3px !important;
  1625. }
  1626. .hoverStyle {
  1627. cursor: pointer;
  1628. transition: all 0.2s;
  1629. &:hover {
  1630. background-color: #eaf3ff;
  1631. }
  1632. }
  1633. .hoverStyleSection {
  1634. transition: all 0.2s;
  1635. &:hover {
  1636. background-color: #eaf3ff;
  1637. }
  1638. }
  1639. .span_style {
  1640. max-width: 400px;
  1641. display: inline-block;
  1642. vertical-align: middle;
  1643. }
  1644. </style>