index.vue 157 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183
  1. <template>
  2. <div class="course-detail">
  3. <Header></Header>
  4. <section class="section">
  5. <div class="container">
  6. <div class="section__header">
  7. <div class="container">
  8. <el-breadcrumb separator="/">
  9. <el-breadcrumb-item :to="{ path: '/index' }"
  10. >首页</el-breadcrumb-item
  11. >
  12. <el-breadcrumb-item>课程详情</el-breadcrumb-item>
  13. </el-breadcrumb>
  14. </div>
  15. </div>
  16. <div class="section__body">
  17. <div class="container">
  18. <div class="course-info">
  19. <div class="course-info__header clearfix">
  20. <div
  21. class="left-box"
  22. :style="{
  23. backgroundImage: `url(${$tools.splitImgHost(
  24. goodsData.coverUrl,
  25. true
  26. )})`,
  27. }"
  28. >
  29. <div v-show="vid" id="player"></div>
  30. <div v-show="vidzb" id="playerzb"></div>
  31. </div>
  32. <div class="right-box">
  33. <div class="right-box__header">
  34. <div class="title">
  35. <el-select
  36. class="select"
  37. v-model="courseId"
  38. @change="courseChange"
  39. >
  40. <el-option
  41. :label="item.courseName"
  42. :value="item.courseId"
  43. v-for="(item, index) in courseList"
  44. :key="index"
  45. ></el-option>
  46. </el-select>
  47. </div>
  48. <div class="tabs">
  49. <el-tabs v-model="courseTabIndex">
  50. <el-tab-pane
  51. :name="tab.name"
  52. v-for="(tab, index) in menuTab"
  53. :key="index"
  54. >
  55. <div slot="label">
  56. <span class="label">{{ tab.label }}</span>
  57. </div>
  58. <template v-if="tab.name == '1'">
  59. <div class="right-box__body">
  60. <div
  61. class="item"
  62. v-for="(menu, index) in menuList"
  63. :key="index"
  64. >
  65. <template v-if="menu.type == 1">
  66. <div
  67. class="item__title"
  68. @click="openModule(menu)"
  69. >
  70. <i
  71. :class="{
  72. 'el-icon-caret-right': !menu.showList,
  73. 'el-icon-caret-bottom': menu.showList,
  74. }"
  75. ></i>
  76. {{ menu.menuName }}
  77. </div>
  78. <div class="item__content">
  79. <div
  80. class="bank-chapter"
  81. v-if="menu.showList"
  82. >
  83. <div
  84. class="bank-chapter__item"
  85. v-for="(
  86. chapter, chapterIndex
  87. ) in menu.list"
  88. :key="chapterIndex"
  89. >
  90. <div
  91. class="bank-chapter__item__text"
  92. @click="openChapter(chapter)"
  93. >
  94. <i
  95. :class="{
  96. 'el-icon-caret-right':
  97. !chapter.showList,
  98. 'el-icon-caret-bottom':
  99. chapter.showList,
  100. }"
  101. ></i
  102. >{{ chapter.name }}
  103. </div>
  104. <div
  105. class="bank-section"
  106. v-if="chapter.showList"
  107. >
  108. <div
  109. class="bank-section__item"
  110. :class="{
  111. active: isActive(section),
  112. }"
  113. v-for="(
  114. section, sectionIndex
  115. ) in chapter.list"
  116. :key="sectionIndex"
  117. @click="getResource(section)"
  118. >
  119. <template v-if="section.type != 2">
  120. <template>
  121. <div
  122. class="note note--blue"
  123. v-if="
  124. section.sectionType == 1
  125. "
  126. >
  127. 录播
  128. </div>
  129. <div
  130. class="note"
  131. v-if="
  132. section.sectionType == 2
  133. "
  134. >
  135. 直播
  136. </div>
  137. <div
  138. class="note note--yellow"
  139. v-if="
  140. section.sectionType == 3
  141. "
  142. >
  143. 回放
  144. </div>
  145. <div
  146. class="
  147. bank-section__item__text
  148. "
  149. >
  150. {{ section.name }}
  151. </div>
  152. </template>
  153. <template
  154. v-if="section.durationTime > 0"
  155. >
  156. <div class="during">
  157. {{
  158. $tools.secondToDate(
  159. section.durationTime
  160. )
  161. }}
  162. </div>
  163. </template>
  164. <template>
  165. <div
  166. class="btn"
  167. v-if="section.rebuild > 0"
  168. >
  169. 待重修
  170. </div>
  171. <template v-else>
  172. <div
  173. class="btn btn--green"
  174. v-if="section.learning == 1"
  175. >
  176. 已看完
  177. </div>
  178. </template>
  179. </template>
  180. <template
  181. v-if="
  182. section.liveStartTime &&
  183. section.sectionType != 3
  184. "
  185. >
  186. <div
  187. class="
  188. live-btn live-btn--blue
  189. "
  190. v-if="
  191. section.liveStartTime >
  192. nowTime
  193. "
  194. >
  195. 待开播
  196. </div>
  197. <div
  198. class="
  199. live-btn live-btn--yellow
  200. "
  201. v-if="
  202. section.liveStartTime <=
  203. nowTime &&
  204. section.liveEndTime >
  205. nowTime
  206. "
  207. >
  208. 直播中
  209. </div>
  210. <div
  211. class="live-btn"
  212. v-if="
  213. section.liveStartTime <
  214. nowTime
  215. "
  216. >
  217. 已结束
  218. </div>
  219. </template>
  220. </template>
  221. <template v-if="section.type == 2">
  222. <template>
  223. <div
  224. class="test-btn"
  225. v-if="section.doType == 1"
  226. >
  227. 练习
  228. </div>
  229. <div
  230. class="test-btn"
  231. v-if="section.doType != 1"
  232. >
  233. 考试
  234. </div>
  235. </template>
  236. <div
  237. class="bank-section__item__text"
  238. >
  239. {{ section.name }}
  240. </div>
  241. <template>
  242. <div
  243. class="btn"
  244. v-if="section.rebuild > 0"
  245. >
  246. 待重修
  247. </div>
  248. <template v-else>
  249. <div
  250. class="btn btn--green"
  251. v-if="section.learning == 1"
  252. >
  253. 合格
  254. </div>
  255. <div
  256. class="btn btn--red"
  257. v-if="section.learning == 0"
  258. >
  259. 不合格
  260. </div>
  261. <div
  262. class="btn btn--green"
  263. v-if="section.rebuild > 0"
  264. >
  265. 待重测
  266. </div>
  267. </template>
  268. </template>
  269. </template>
  270. </div>
  271. </div>
  272. </div>
  273. </div>
  274. </div>
  275. </template>
  276. <template v-if="menu.type == 2">
  277. <div class="item__content">
  278. <div class="bank-chapter">
  279. <div class="bank-chapter__item">
  280. <div
  281. class="bank-chapter__item__text"
  282. @click="openChapter(menu)"
  283. >
  284. <i
  285. :class="{
  286. 'el-icon-caret-right':
  287. !menu.showList,
  288. 'el-icon-caret-bottom':
  289. menu.showList,
  290. }"
  291. ></i
  292. >{{ menu.menuName }}
  293. </div>
  294. <div
  295. class="bank-section"
  296. v-if="menu.showList"
  297. >
  298. <div
  299. class="bank-section__item"
  300. :class="{
  301. active: isActive(section),
  302. }"
  303. v-for="(
  304. section, sectionIndex
  305. ) in menu.list"
  306. :key="sectionIndex"
  307. @click="getResource(section)"
  308. >
  309. <template v-if="section.type != 2">
  310. <template>
  311. <div
  312. class="note note--blue"
  313. v-if="
  314. section.sectionType == 1
  315. "
  316. >
  317. 录播
  318. </div>
  319. <div
  320. class="note"
  321. v-if="
  322. section.sectionType == 2
  323. "
  324. >
  325. 直播
  326. </div>
  327. <div
  328. class="note note--yellow"
  329. v-if="
  330. section.sectionType == 3
  331. "
  332. >
  333. 回放
  334. </div>
  335. </template>
  336. <div
  337. class="bank-section__item__text"
  338. >
  339. {{ section.name }}
  340. </div>
  341. <template
  342. v-if="section.durationTime > 0"
  343. >
  344. <div class="during">
  345. {{
  346. $tools.secondToDate(
  347. section.durationTime
  348. )
  349. }}
  350. </div>
  351. </template>
  352. <template>
  353. <div
  354. class="btn"
  355. v-if="section.rebuild > 0"
  356. >
  357. 待重修
  358. </div>
  359. <template v-else>
  360. <div
  361. class="btn btn--green"
  362. v-if="section.learning == 1"
  363. >
  364. 已看完
  365. </div>
  366. </template>
  367. </template>
  368. <template
  369. v-if="
  370. section.liveStartTime &&
  371. section.sectionType != 3
  372. "
  373. >
  374. <div
  375. class="
  376. live-btn live-btn--blue
  377. "
  378. v-if="
  379. section.liveStartTime >
  380. nowTime
  381. "
  382. >
  383. 待开播
  384. </div>
  385. <div
  386. class="
  387. live-btn live-btn--yellow
  388. "
  389. v-if="
  390. section.liveStartTime <=
  391. nowTime &&
  392. section.liveEndTime >
  393. nowTime
  394. "
  395. >
  396. 直播中
  397. </div>
  398. <div
  399. class="live-btn"
  400. v-if="
  401. section.liveStartTime <
  402. nowTime
  403. "
  404. >
  405. 已结束
  406. </div>
  407. </template>
  408. </template>
  409. <template v-if="section.type == 2">
  410. <template>
  411. <div
  412. class="test-btn"
  413. v-if="section.doType == 1"
  414. >
  415. 练习
  416. </div>
  417. <div
  418. class="test-btn"
  419. v-if="section.doType != 1"
  420. >
  421. 考试
  422. </div>
  423. </template>
  424. <div
  425. class="bank-section__item__text"
  426. >
  427. {{ section.name }}
  428. </div>
  429. <template>
  430. <div
  431. class="btn"
  432. v-if="section.rebuild > 0"
  433. >
  434. 待重修
  435. </div>
  436. <template v-else>
  437. <div
  438. class="btn btn--green"
  439. v-if="section.learning == 1"
  440. >
  441. 合格
  442. </div>
  443. <div
  444. class="btn btn--red"
  445. v-if="section.learning == 0"
  446. >
  447. 不合格
  448. </div>
  449. <div
  450. class="btn btn--green"
  451. v-if="section.rebuild > 0"
  452. >
  453. 待重测
  454. </div>
  455. </template>
  456. </template>
  457. </template>
  458. </div>
  459. </div>
  460. </div>
  461. </div>
  462. </div>
  463. </template>
  464. <template v-if="menu.type == 3">
  465. <div class="item__content">
  466. <div class="bank-section">
  467. <div
  468. class="bank-section__item"
  469. :class="{
  470. active: isActive(menu),
  471. }"
  472. @click="getResource(menu)"
  473. >
  474. <template>
  475. <div
  476. class="note note--blue"
  477. v-if="menu.sectionType == 1"
  478. >
  479. 录播
  480. </div>
  481. <div
  482. class="note"
  483. v-if="menu.sectionType == 2"
  484. >
  485. 直播
  486. </div>
  487. <div
  488. class="note note--yellow"
  489. v-if="menu.sectionType == 3"
  490. >
  491. 回放
  492. </div>
  493. <div class="bank-section__item__text">
  494. {{ menu.name }}
  495. </div>
  496. </template>
  497. <template v-if="menu.durationTime > 0">
  498. <div class="during">
  499. {{
  500. $tools.secondToDate(
  501. menu.durationTime
  502. )
  503. }}
  504. </div>
  505. </template>
  506. <template>
  507. <div
  508. class="btn"
  509. v-if="menu.rebuild > 0"
  510. >
  511. 待重修
  512. </div>
  513. <template v-else>
  514. <div
  515. class="btn btn--green"
  516. v-if="menu.learning == 1"
  517. >
  518. 已看完
  519. </div>
  520. </template>
  521. </template>
  522. <template
  523. v-if="
  524. menu.liveStartTime &&
  525. menu.sectionType != 3
  526. "
  527. >
  528. <div
  529. class="live-btn live-btn--blue"
  530. v-if="menu.liveStartTime > nowTime"
  531. >
  532. 待开播
  533. </div>
  534. <div
  535. class="live-btn live-btn--yellow"
  536. v-if="
  537. menu.liveStartTime <= nowTime &&
  538. menu.liveEndTime > nowTime
  539. "
  540. >
  541. 直播中
  542. </div>
  543. <div
  544. class="live-btn"
  545. v-if="menu.liveStartTime < nowTime"
  546. >
  547. 已结束
  548. </div>
  549. </template>
  550. </div>
  551. </div>
  552. </div>
  553. </template>
  554. </div>
  555. </div>
  556. </template>
  557. <template v-if="tab.name == '2'">
  558. <div class="right-box__body">
  559. <div
  560. class="item"
  561. v-for="(menu, index) in reMenuList"
  562. :key="index"
  563. >
  564. <template v-if="menu.type == 1">
  565. <div
  566. class="item__title"
  567. @click="openModule(menu)"
  568. >
  569. <i
  570. :class="{
  571. 'el-icon-caret-right': !menu.showList,
  572. 'el-icon-caret-bottom': menu.showList,
  573. }"
  574. ></i>
  575. {{ menu.menuName }}
  576. </div>
  577. <div class="item__content">
  578. <div
  579. class="bank-chapter"
  580. v-if="menu.showList"
  581. >
  582. <div
  583. class="bank-chapter__item"
  584. v-for="(
  585. chapter, chapterIndex
  586. ) in menu.list"
  587. :key="chapterIndex"
  588. >
  589. <div
  590. class="bank-chapter__item__text"
  591. @click="openChapter(chapter)"
  592. >
  593. <i
  594. :class="{
  595. 'el-icon-caret-right':
  596. !chapter.showList,
  597. 'el-icon-caret-bottom':
  598. chapter.showList,
  599. }"
  600. ></i
  601. >{{ chapter.name }}
  602. </div>
  603. <div
  604. class="bank-section"
  605. v-if="chapter.showList"
  606. >
  607. <div
  608. class="bank-section__item"
  609. :class="{
  610. active: isActive(section),
  611. }"
  612. v-for="(
  613. section, sectionIndex
  614. ) in chapter.list"
  615. :key="sectionIndex"
  616. @click="getResource(section)"
  617. >
  618. <template v-if="section.type != 2">
  619. <template>
  620. <div
  621. class="note note--blue"
  622. v-if="
  623. section.sectionType == 1
  624. "
  625. >
  626. 录播
  627. </div>
  628. <div
  629. class="note"
  630. v-if="
  631. section.sectionType == 2
  632. "
  633. >
  634. 直播
  635. </div>
  636. <div
  637. class="note note--yellow"
  638. v-if="
  639. section.sectionType == 3
  640. "
  641. >
  642. 回放
  643. </div>
  644. <div
  645. class="
  646. bank-section__item__text
  647. "
  648. >
  649. {{ section.name }}
  650. </div>
  651. </template>
  652. <template
  653. v-if="section.durationTime > 0"
  654. >
  655. <div class="during">
  656. {{
  657. $tools.secondToDate(
  658. section.durationTime
  659. )
  660. }}
  661. </div>
  662. </template>
  663. <template>
  664. <div
  665. class="btn"
  666. v-if="section.rebuild > 0"
  667. >
  668. 待重修
  669. </div>
  670. <template v-else>
  671. <div
  672. class="btn btn--green"
  673. v-if="section.learning == 1"
  674. >
  675. 已看完
  676. </div>
  677. </template>
  678. </template>
  679. <template
  680. v-if="
  681. section.liveStartTime &&
  682. section.sectionType != 3
  683. "
  684. >
  685. <div
  686. class="
  687. live-btn live-btn--blue
  688. "
  689. v-if="
  690. section.liveStartTime >
  691. nowTime
  692. "
  693. >
  694. 待开播
  695. </div>
  696. <div
  697. class="
  698. live-btn live-btn--yellow
  699. "
  700. v-if="
  701. section.liveStartTime <=
  702. nowTime &&
  703. section.liveEndTime >
  704. nowTime
  705. "
  706. >
  707. 直播中
  708. </div>
  709. <div
  710. class="live-btn"
  711. v-if="
  712. section.liveStartTime <
  713. nowTime
  714. "
  715. >
  716. 已结束
  717. </div>
  718. </template>
  719. </template>
  720. <template v-if="section.type == 2">
  721. <template>
  722. <div
  723. class="test-btn"
  724. v-if="section.doType == 1"
  725. >
  726. 练习
  727. </div>
  728. <div
  729. class="test-btn"
  730. v-if="section.doType != 1"
  731. >
  732. 考试
  733. </div>
  734. </template>
  735. <div
  736. class="bank-section__item__text"
  737. >
  738. {{ section.name }}
  739. </div>
  740. <template>
  741. <div
  742. class="btn"
  743. v-if="section.rebuild > 0"
  744. >
  745. 待重修
  746. </div>
  747. <template v-else>
  748. <div
  749. class="btn btn--green"
  750. v-if="section.learning == 1"
  751. >
  752. 合格
  753. </div>
  754. <div
  755. class="btn btn--red"
  756. v-if="section.learning == 0"
  757. >
  758. 不合格
  759. </div>
  760. <div
  761. class="btn btn--green"
  762. v-if="section.rebuild > 0"
  763. >
  764. 待重测
  765. </div>
  766. </template>
  767. </template>
  768. </template>
  769. </div>
  770. </div>
  771. </div>
  772. </div>
  773. </div>
  774. </template>
  775. <template v-if="menu.type == 2">
  776. <div class="item__content">
  777. <div class="bank-chapter">
  778. <div class="bank-chapter__item">
  779. <div
  780. class="bank-chapter__item__text"
  781. @click="openChapter(menu)"
  782. >
  783. <i
  784. :class="{
  785. 'el-icon-caret-right':
  786. !menu.showList,
  787. 'el-icon-caret-bottom':
  788. menu.showList,
  789. }"
  790. ></i
  791. >{{ menu.menuName }}
  792. </div>
  793. <div
  794. class="bank-section"
  795. v-if="menu.showList"
  796. >
  797. <div
  798. class="bank-section__item"
  799. :class="{
  800. active: isActive(section),
  801. }"
  802. v-for="(
  803. section, sectionIndex
  804. ) in menu.list"
  805. :key="sectionIndex"
  806. @click="getResource(section)"
  807. >
  808. <template v-if="section.type != 2">
  809. <template>
  810. <div
  811. class="note note--blue"
  812. v-if="
  813. section.sectionType == 1
  814. "
  815. >
  816. 录播
  817. </div>
  818. <div
  819. class="note"
  820. v-if="
  821. section.sectionType == 2
  822. "
  823. >
  824. 直播
  825. </div>
  826. <div
  827. class="note note--yellow"
  828. v-if="
  829. section.sectionType == 3
  830. "
  831. >
  832. 回放
  833. </div>
  834. </template>
  835. <div
  836. class="bank-section__item__text"
  837. >
  838. {{ section.name }}
  839. </div>
  840. <template
  841. v-if="section.durationTime > 0"
  842. >
  843. <div class="during">
  844. {{
  845. $tools.secondToDate(
  846. section.durationTime
  847. )
  848. }}
  849. </div>
  850. </template>
  851. <template>
  852. <div
  853. class="btn"
  854. v-if="section.rebuild > 0"
  855. >
  856. 待重修
  857. </div>
  858. <template v-else>
  859. <div
  860. class="btn btn--green"
  861. v-if="section.learning == 1"
  862. >
  863. 已看完
  864. </div>
  865. </template>
  866. </template>
  867. <template
  868. v-if="
  869. section.liveStartTime &&
  870. section.sectionType != 3
  871. "
  872. >
  873. <div
  874. class="
  875. live-btn live-btn--blue
  876. "
  877. v-if="
  878. section.liveStartTime >
  879. nowTime
  880. "
  881. >
  882. 待开播
  883. </div>
  884. <div
  885. class="
  886. live-btn live-btn--yellow
  887. "
  888. v-if="
  889. section.liveStartTime <=
  890. nowTime &&
  891. section.liveEndTime >
  892. nowTime
  893. "
  894. >
  895. 直播中
  896. </div>
  897. <div
  898. class="live-btn"
  899. v-if="
  900. section.liveStartTime <
  901. nowTime
  902. "
  903. >
  904. 已结束
  905. </div>
  906. </template>
  907. </template>
  908. <template v-if="section.type == 2">
  909. <template>
  910. <div
  911. class="test-btn"
  912. v-if="section.doType == 1"
  913. >
  914. 练习
  915. </div>
  916. <div
  917. class="test-btn"
  918. v-if="section.doType != 1"
  919. >
  920. 考试
  921. </div>
  922. </template>
  923. <div
  924. class="bank-section__item__text"
  925. >
  926. {{ section.name }}
  927. </div>
  928. <template>
  929. <div
  930. class="btn"
  931. v-if="section.rebuild > 0"
  932. >
  933. 待重修
  934. </div>
  935. <template v-else>
  936. <div
  937. class="btn btn--green"
  938. v-if="section.learning == 1"
  939. >
  940. 合格
  941. </div>
  942. <div
  943. class="btn btn--red"
  944. v-if="section.learning == 0"
  945. >
  946. 不合格
  947. </div>
  948. <div
  949. class="btn btn--green"
  950. v-if="section.rebuild > 0"
  951. >
  952. 待重测
  953. </div>
  954. </template>
  955. </template>
  956. </template>
  957. </div>
  958. </div>
  959. </div>
  960. </div>
  961. </div>
  962. </template>
  963. <template v-if="menu.type == 3">
  964. <div class="item__content">
  965. <div class="bank-section">
  966. <div
  967. class="bank-section__item"
  968. :class="{
  969. active: isActive(menu),
  970. }"
  971. @click="getResource(menu)"
  972. >
  973. <template>
  974. <div
  975. class="note note--blue"
  976. v-if="menu.sectionType == 1"
  977. >
  978. 录播
  979. </div>
  980. <div
  981. class="note"
  982. v-if="menu.sectionType == 2"
  983. >
  984. 直播
  985. </div>
  986. <div
  987. class="note note--yellow"
  988. v-if="menu.sectionType == 3"
  989. >
  990. 回放
  991. </div>
  992. <div class="bank-section__item__text">
  993. {{ menu.name }}
  994. </div>
  995. </template>
  996. <template v-if="menu.durationTime > 0">
  997. <div class="during">
  998. {{
  999. $tools.secondToDate(
  1000. menu.durationTime
  1001. )
  1002. }}
  1003. </div>
  1004. </template>
  1005. <template>
  1006. <div
  1007. class="btn"
  1008. v-if="menu.rebuild > 0"
  1009. >
  1010. 待重修
  1011. </div>
  1012. <template v-else>
  1013. <div
  1014. class="btn btn--green"
  1015. v-if="menu.learning == 1"
  1016. >
  1017. 已看完
  1018. </div>
  1019. </template>
  1020. </template>
  1021. <template
  1022. v-if="
  1023. menu.liveStartTime &&
  1024. menu.sectionType != 3
  1025. "
  1026. >
  1027. <div
  1028. class="live-btn live-btn--blue"
  1029. v-if="menu.liveStartTime > nowTime"
  1030. >
  1031. 待开播
  1032. </div>
  1033. <div
  1034. class="live-btn live-btn--yellow"
  1035. v-if="
  1036. menu.liveStartTime <= nowTime &&
  1037. menu.liveEndTime > nowTime
  1038. "
  1039. >
  1040. 直播中
  1041. </div>
  1042. <div
  1043. class="live-btn"
  1044. v-if="menu.liveStartTime < nowTime"
  1045. >
  1046. 已结束
  1047. </div>
  1048. </template>
  1049. </div>
  1050. </div>
  1051. </div>
  1052. </template>
  1053. </div>
  1054. </div>
  1055. </template>
  1056. </el-tab-pane>
  1057. </el-tabs>
  1058. </div>
  1059. </div>
  1060. </div>
  1061. </div>
  1062. <div class="course-info__body">
  1063. <el-tabs v-model="activeName">
  1064. <el-tab-pane
  1065. v-for="(item, index) in tabList"
  1066. :key="index"
  1067. :name="item.name"
  1068. :label="item.label"
  1069. >
  1070. <template v-if="item.label == '学员须知'">
  1071. <div class="course-menu clearfix">
  1072. <div class="left-box">
  1073. <div class="left-box__body">
  1074. {{ goodsData.buyNote }}
  1075. </div>
  1076. </div>
  1077. <div class="right-box">
  1078. <div class="title">
  1079. 推荐题库
  1080. <span class="more">更多></span>
  1081. </div>
  1082. <ul class="list">
  1083. <li
  1084. class="course-item"
  1085. v-for="(item, index) in 4"
  1086. :key="index"
  1087. @click="courseDetail()"
  1088. >
  1089. <div class="course-item__img">
  1090. <div class="note">2022</div>
  1091. </div>
  1092. <div class="course-item__title">
  1093. 2022年二建建设工程法规及相关知识(黄金基础班)
  1094. </div>
  1095. <div class="course-item__desc">
  1096. <div class="price">¥100</div>
  1097. <a class="add">加购物车</a>
  1098. </div>
  1099. </li>
  1100. </ul>
  1101. </div>
  1102. </div>
  1103. </template>
  1104. <template v-if="item.label == '课程答疑'">
  1105. <div class="answer-question">
  1106. <div class="answer-question__header clearfix">
  1107. <div class="textarea-wrap">
  1108. <el-input
  1109. class="textarea"
  1110. v-model="textarea"
  1111. rows="3"
  1112. type="textarea"
  1113. placeholder=""
  1114. ></el-input>
  1115. </div>
  1116. <el-button type="primary" class="submit"
  1117. >提出疑问</el-button
  1118. >
  1119. </div>
  1120. <div class="answer-question__body">
  1121. <div class="question-list">
  1122. <div
  1123. v-if="answerList.length == 0"
  1124. style="text-align: center"
  1125. >
  1126. 暂无记录
  1127. </div>
  1128. <div
  1129. class="question-list__item"
  1130. v-for="(item, index) in answerList"
  1131. :key="index"
  1132. >
  1133. <div class="question-list__item__avatar">
  1134. <img
  1135. v-if="item.assignRealname"
  1136. :src="$tools.splitImgHost(item.assignAvatar)"
  1137. alt=""
  1138. />
  1139. <img
  1140. v-else
  1141. :src="$tools.splitImgHost(item.avatar)"
  1142. alt=""
  1143. />
  1144. </div>
  1145. <div class="question-list__item__content">
  1146. <div class="nickname">
  1147. <template v-if="item.assignRealname">
  1148. {{ item.assignRealname }}
  1149. </template>
  1150. <template v-else>
  1151. {{
  1152. item.assignUserId > 0 && !item.realname
  1153. ? "祥粤老师"
  1154. : item.realname
  1155. }}
  1156. </template>
  1157. </div>
  1158. <div class="desc">
  1159. <template v-if="item.assignRealname"
  1160. >我猜这堂课没人听了不会做美梦吧。</template
  1161. >
  1162. <template v-else>
  1163. {{ item.answerText }}
  1164. </template>
  1165. </div>
  1166. <div class="time">
  1167. {{
  1168. $tools.timestampToTime(
  1169. item.createTime,
  1170. false
  1171. )
  1172. }}
  1173. <div
  1174. class="del"
  1175. @click="del(item)"
  1176. v-if="item.userId != userInfo.userId"
  1177. >
  1178. 删除
  1179. </div>
  1180. </div>
  1181. <div
  1182. class="reply-list"
  1183. v-if="item.assignRealname"
  1184. >
  1185. <div class="reply-list__item">
  1186. <div class="reply-list__item__avatar">
  1187. <img
  1188. :src="$tools.splitImgHost(item.avatar)"
  1189. alt=""
  1190. />
  1191. </div>
  1192. <div class="reply-list__item__content">
  1193. <div class="nickname">
  1194. {{
  1195. item.assignUserId > 0 &&
  1196. !item.realname
  1197. ? "祥粤老师"
  1198. : item.realname
  1199. }}
  1200. </div>
  1201. <div class="desc">
  1202. {{ item.answerText }}
  1203. </div>
  1204. <div class="time">
  1205. {{
  1206. $tools.timestampToTime(
  1207. item.createTime,
  1208. false
  1209. )
  1210. }}
  1211. <!-- <div class="del" v-if="index % 2 == 0">
  1212. 删除
  1213. </div>
  1214. <div class="reply" v-else>回复</div> -->
  1215. </div>
  1216. </div>
  1217. </div>
  1218. </div>
  1219. </div>
  1220. </div>
  1221. </div>
  1222. </div>
  1223. </div>
  1224. </template>
  1225. <template v-if="item.label == '笔记讲义'">
  1226. <div class="lecture-notes">
  1227. <div class="lecture-notes__content clearfix">
  1228. <div class="left-box">
  1229. <div class="textarea clearfix">
  1230. <el-input
  1231. resize="none"
  1232. rows="3"
  1233. v-model="textareaNote"
  1234. type="textarea"
  1235. placeholder="觉得重要的就记下来吧~"
  1236. ></el-input>
  1237. <el-button
  1238. type="primary"
  1239. class="submit"
  1240. @click="noteSubmit"
  1241. >
  1242. 提交笔记
  1243. </el-button>
  1244. </div>
  1245. <div class="note-list">
  1246. <div
  1247. v-if="noteList.length == 0"
  1248. style="text-align: center"
  1249. >
  1250. 暂无笔记
  1251. </div>
  1252. <div
  1253. class="note-list__content"
  1254. v-for="(item, index) in noteList"
  1255. :key="index"
  1256. >
  1257. <div class="note-list__content__title">
  1258. {{ $tools.timestampToTime(item.dateNote) }}
  1259. </div>
  1260. <div
  1261. class="note-list__item"
  1262. v-for="(note, index) in item.userNotes"
  1263. :key="index"
  1264. >
  1265. <i
  1266. class="el-icon-video-play"
  1267. @click="noteClick(note)"
  1268. ></i>
  1269. <div class="note-list__item__content">
  1270. <div class="title" @click="noteClick(note)">
  1271. {{ $tools.secondToDate(note.noteSecond) }}
  1272. </div>
  1273. <div class="desc">
  1274. {{ note.sectionName }}
  1275. </div>
  1276. <div class="time">{{ note.noteText }}</div>
  1277. </div>
  1278. </div>
  1279. </div>
  1280. </div>
  1281. <div class="pagination">
  1282. <el-pagination
  1283. background
  1284. layout="prev, pager, next"
  1285. :total="noteTotal"
  1286. :page-size="noteParams.pageSize"
  1287. >
  1288. </el-pagination>
  1289. </div>
  1290. </div>
  1291. <div class="right-box" v-if="courseHandoutsData">
  1292. <div class="lecture-list">
  1293. <div class="lecture-list__header">
  1294. 讲义
  1295. <div
  1296. class="slide-btn"
  1297. @click="lectureShow = !lectureShow"
  1298. >
  1299. 收起
  1300. </div>
  1301. </div>
  1302. <div
  1303. class="lecture-list__body"
  1304. v-if="lectureShow"
  1305. >
  1306. <div class="list">
  1307. <div class="list__item">
  1308. <div class="title">
  1309. {{ courseHandoutsData.handoutsName }}
  1310. </div>
  1311. <div class="btns">
  1312. <div
  1313. class="btn"
  1314. @click="
  1315. previvew(
  1316. $tools.splitImgHost(
  1317. courseHandoutsData.handoutsUrl
  1318. )
  1319. )
  1320. "
  1321. >
  1322. 预览
  1323. </div>
  1324. <!-- <div class="btn">打印</div> -->
  1325. <div
  1326. class="btn"
  1327. @click="
  1328. download(
  1329. $tools.splitImgHost(
  1330. courseHandoutsData.handoutsUrl
  1331. ),
  1332. courseHandoutsData.urlName
  1333. )
  1334. "
  1335. >
  1336. 下载
  1337. </div>
  1338. </div>
  1339. </div>
  1340. </div>
  1341. </div>
  1342. </div>
  1343. <div class="lecture-list__footer">
  1344. <div class="lecture-scan">
  1345. <div class="lecture-scan__header">
  1346. {{ courseHandoutsData.urlName }}
  1347. </div>
  1348. <div class="lecture-scan__body">
  1349. <iframe
  1350. class="iframe"
  1351. :src="
  1352. $tools.splitImgHost(
  1353. courseHandoutsData.handoutsUrl
  1354. )
  1355. "
  1356. frameborder="0"
  1357. ></iframe>
  1358. <!-- <img src="@/assets/banner.png" alt="" /> -->
  1359. </div>
  1360. </div>
  1361. </div>
  1362. </div>
  1363. </div>
  1364. </div>
  1365. </template>
  1366. </el-tab-pane>
  1367. </el-tabs>
  1368. </div>
  1369. </div>
  1370. </div>
  1371. </div>
  1372. </div>
  1373. </section>
  1374. <el-dialog
  1375. width="800px"
  1376. class="take-photo"
  1377. :visible.sync="takePhotoModal"
  1378. :close-on-click-modal="false"
  1379. :close-on-press-escape="false"
  1380. :show-close="false"
  1381. >
  1382. <div class="take-photo__content">
  1383. <!-- <div class="take-photo__close" @click="takePhotoModal = false">X</div> -->
  1384. <div class="take-photo__header">人脸验证</div>
  1385. <div class="take-photo__body clearfix">
  1386. <div class="left-box">
  1387. <div class="title">重要提示:</div>
  1388. <div class="content">
  1389. <p>1、请保证摄像头正对自己,避免头像偏左或者偏右。</p>
  1390. <p>
  1391. 2、请保证拍照环境光线充足(照片太暗或曝光会降低验证通过率)。
  1392. </p>
  1393. <p>
  1394. 3、请保证整个头像在人脸识别区域内,脸部无遮挡装饰物(佩戴眼镜会降低通过率)。
  1395. </p>
  1396. <p>
  1397. 4、如果下面视频中出现黑屏,摄像头可能被其他进程占用,请关闭其他调用摄像头的程序,重新刷新当前页面重新拍照识别。
  1398. </p>
  1399. </div>
  1400. </div>
  1401. <div class="right-box">
  1402. <img v-show="!isTaking" :src="faceUrl" alt="" />
  1403. <video v-show="isTaking" id="video" :src="stream"></video>
  1404. </div>
  1405. </div>
  1406. <div class="take-photo__footer">
  1407. <el-button
  1408. type="primary"
  1409. v-if="isTaking"
  1410. class="take"
  1411. @click="onPhoto"
  1412. >拍照</el-button
  1413. >
  1414. <el-button
  1415. type="primary"
  1416. v-if="!isTaking"
  1417. class="take"
  1418. @click="reTake"
  1419. >重拍</el-button
  1420. >
  1421. <el-button
  1422. type="primary"
  1423. v-if="!isTaking"
  1424. class="take"
  1425. @click="takeOk"
  1426. >确认</el-button
  1427. >
  1428. </div>
  1429. </div>
  1430. </el-dialog>
  1431. <ToolBar></ToolBar>
  1432. <Footer></Footer>
  1433. </div>
  1434. </template>
  1435. <script>
  1436. import Footer from "@/components/footer/index";
  1437. import Header from "@/components/header/index";
  1438. import ToolBar from "@/components/toolbar/index";
  1439. import { mapGetters } from "vuex";
  1440. export default {
  1441. name: "CourseDetail",
  1442. components: {
  1443. Footer,
  1444. Header,
  1445. ToolBar,
  1446. },
  1447. data() {
  1448. return {
  1449. recordObj: {},
  1450. isTaking: true, //是否正在拍照
  1451. photoConfig: false,
  1452. stream: null,
  1453. photoNum: 0,
  1454. playSectionId: 0,
  1455. photoIndex: 0, //当前位于拍照的区间下标 从0开始
  1456. photoHistoryList: [], //已拍照历史的下标点
  1457. moduleId: 0,
  1458. chapterId: 0,
  1459. menuTab: [],
  1460. lectureShow: true,
  1461. textarea: "",
  1462. textareaNote: "",
  1463. takePhotoModal: false,
  1464. activeName: "1",
  1465. courseId: "",
  1466. courseTabIndex: "1",
  1467. goodsId: "",
  1468. gradeId: "",
  1469. sectionItem: {},
  1470. playTime: 0, //页面播放时长,不含暂停
  1471. param: {
  1472. pageNum: 1,
  1473. pageSize: 100,
  1474. total: 0,
  1475. },
  1476. lockTimer: null,
  1477. courseList: [],
  1478. businessData: {},
  1479. courseHandoutsData: "",
  1480. menuList: [],
  1481. goodsData: {},
  1482. tabList: [],
  1483. vid: "",
  1484. vidzb: "",
  1485. player: "",
  1486. playerzb: "",
  1487. activeId: "", //当前选中ID
  1488. vodPlayerJs: "https://player.polyv.net/script/player.js",
  1489. playerJs:
  1490. "https://player.polyv.net/resp/live-h5-player/latest/liveplayer.min.js",
  1491. uidzb: "egsxlptzdq",
  1492. menuList: [],
  1493. reMenuList: [],
  1494. answerList: [],
  1495. noteList: [],
  1496. photoList: [],
  1497. noteTotal: 0,
  1498. duration: 0,
  1499. noteParams: {
  1500. pageNum: 1,
  1501. pageSize: 4,
  1502. },
  1503. ossAvatarUrl: "", //照片地址
  1504. nowTime: 0,
  1505. faceUrl: "",
  1506. loading: null,
  1507. };
  1508. },
  1509. computed: {
  1510. ...mapGetters(["userInfo"]),
  1511. },
  1512. mounted() {
  1513. this.courseId = +this.$route.query.courseId || "";
  1514. this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  1515. this.goodsId = this.$route.params.goodsId;
  1516. this.orderGoodsId = this.$route.query.orderGoodsId;
  1517. this.gradeId = this.$route.query.gradeId;
  1518. this.courseCourseList();
  1519. },
  1520. beforeDestroy() {
  1521. try {
  1522. this.$msgbox.close();
  1523. } catch (err) {}
  1524. },
  1525. methods: {
  1526. async takeOk() {
  1527. this.loading = this.$loading({
  1528. lock: true,
  1529. text: "上传中",
  1530. spinner: "el-icon-loading",
  1531. background: "rgba(0, 0, 0, 0.1)",
  1532. target: document.querySelector(".section__body"),
  1533. });
  1534. let compareFaceData = await this.faceRecognition();
  1535. if (compareFaceData >= 80) {
  1536. const waitYS = await this.imageInfos();
  1537. this.postCoursePhotoRecord()
  1538. .then((res) => {
  1539. this.photoHistoryList.push(this.photoIndex);
  1540. this.postStudyRecord(); //提交记录
  1541. //恢复播放
  1542. this.loading.close();
  1543. this.$message({
  1544. type: "success",
  1545. message: "拍照成功",
  1546. });
  1547. this.takePhotoModal = false;
  1548. this.isTaking = false;
  1549. var polyvPlayerContext = this.player;
  1550. if (polyvPlayerContext) {
  1551. polyvPlayerContext.j2s_resumeVideo();
  1552. }
  1553. })
  1554. .catch((err) => {
  1555. this.loading.close();
  1556. console.log(err, "err");
  1557. this.$message({
  1558. type: "warning",
  1559. message: "上传接口报错,请重新拍照上传",
  1560. });
  1561. this.reTake();
  1562. });
  1563. } else {
  1564. this.$message({
  1565. type: "warning",
  1566. message: "人脸匹配不通过,请重新拍照上传",
  1567. });
  1568. setTimeout(() => {
  1569. this.loading.close();
  1570. this.reTake();
  1571. }, 2000);
  1572. return;
  1573. }
  1574. },
  1575. imageInfos() {
  1576. var self = this;
  1577. return new Promise(async (resolve, reject) => {
  1578. const waitUpload = await self.uploadFile(self.faceUrl, 0);
  1579. resolve(waitUpload);
  1580. });
  1581. },
  1582. uploadFile(options, int) {
  1583. var self = this;
  1584. return new Promise((resolve, reject) => {
  1585. var data = {
  1586. imageStatus: int,
  1587. gradeId: this.gradeId,
  1588. };
  1589. self.$request
  1590. .getPolicy(data)
  1591. .then((res) => {
  1592. var ossToken = res.data.resultContent;
  1593. if (ossToken.host == null || ossToken.host == undefined) {
  1594. this.$message({
  1595. type: "warning",
  1596. message: "上传路径报错" + JSON.stringify(res.data),
  1597. });
  1598. return;
  1599. }
  1600. let data = this.$tools.convertBase64UrlToBlob(this.faceUrl);
  1601. this.$upload
  1602. .upload(data, 0)
  1603. .then((res) => {
  1604. this.ossAvatarUrl = res;
  1605. resolve(res);
  1606. })
  1607. .catch((err) => {
  1608. this.$message({
  1609. type: "warning",
  1610. message: "上传接口报错,请重新拍照上传",
  1611. });
  1612. this.reTake();
  1613. });
  1614. })
  1615. .catch((err) => {
  1616. this.$message({
  1617. type: "warning",
  1618. message: "签名错误" + JSON.stringify(err.data),
  1619. });
  1620. return;
  1621. });
  1622. });
  1623. },
  1624. faceRecognition() {
  1625. return new Promise((resolve) => {
  1626. this.$request
  1627. .faceCertificationCompareFace({
  1628. imageA: this.faceUrl,
  1629. orderGoodsId: this.orderGoodsId,
  1630. gradeId: this.gradeId,
  1631. })
  1632. .then((res) => {
  1633. console.log(res, "res");
  1634. resolve(res.data);
  1635. })
  1636. .catch((err) => {
  1637. this.loading.close();
  1638. this.$message({
  1639. type: "warning",
  1640. message: err.msg,
  1641. });
  1642. });
  1643. });
  1644. },
  1645. /**
  1646. * 点击重拍
  1647. */
  1648. reTake() {
  1649. this.faceUrl = "";
  1650. this.isTaking = true;
  1651. this.getUserMedia({
  1652. video: {
  1653. width: 400,
  1654. height: 300,
  1655. },
  1656. });
  1657. },
  1658. // 点击拍照按钮
  1659. onPhoto() {
  1660. // if (this.isIE) {
  1661. // window.webcam.capture();
  1662. // } else {
  1663. const canvas = document.createElement("canvas");
  1664. canvas.width = 400;
  1665. canvas.height = 300;
  1666. const context = canvas.getContext("2d");
  1667. const video = document.getElementById("video");
  1668. context.drawImage(video, 0, 0, 400, 300);
  1669. this.faceUrl = canvas.toDataURL("image/png");
  1670. this.isTaking = false;
  1671. // }
  1672. },
  1673. getUserMedia(constraints, success, error) {
  1674. if (window.navigator.mediaDevices.getUserMedia) {
  1675. // 最新的标准API
  1676. window.navigator.mediaDevices
  1677. .getUserMedia(constraints)
  1678. .then(success)
  1679. .catch(error);
  1680. } else if (window.navigator.webkitGetUserMedia) {
  1681. // webkit核心浏览器
  1682. window.navigator.webkitGetUserMedia(constraints, success, error);
  1683. } else if (window.navigator.mozGetUserMedia) {
  1684. // firfox浏览器
  1685. window.navigator.mozGetUserMedia(constraints, success, error);
  1686. } else if (window.navigator.getUserMedia) {
  1687. // 旧版API
  1688. window.navigator.getUserMedia(constraints, success, error);
  1689. }
  1690. },
  1691. photographSuccess(stream) {
  1692. // 兼容webkit核心浏览器
  1693. this.isTaking = true;
  1694. this.takePhotoModal = true;
  1695. this.$nextTick(() => {
  1696. const video = document.getElementById("video");
  1697. // 将视频流设置为video元素的源
  1698. console.dir(video);
  1699. video.srcObject = stream;
  1700. this.mediaStreamTrack =
  1701. typeof stream.stop === "function" ? stream : stream.getTracks()[0];
  1702. video.play();
  1703. });
  1704. },
  1705. photographError(err) {
  1706. this.$confirm(
  1707. "课程学习需要开启摄像头进行拍照,经检测您的设备无摄像头可使用,请检测环境是否支持。",
  1708. "提示",
  1709. {
  1710. showConfirmButton: false,
  1711. closeOnClickModal: false,
  1712. showCancelButton: false,
  1713. closeOnPressEscape: false,
  1714. distinguishCancelAndClose: false,
  1715. showClose: false,
  1716. }
  1717. );
  1718. },
  1719. /**
  1720. * 切换科目
  1721. */
  1722. courseChange() {
  1723. this.noteParams = {
  1724. pageNum: 1,
  1725. pageSize: 4,
  1726. };
  1727. this.duration = 0;
  1728. this.playSectionId = 0;
  1729. this.vid = "";
  1730. this.vidzb = "";
  1731. this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  1732. this.courseDetail(); //课程详情
  1733. this.getGoodsDetail(); //商品详情
  1734. this.getAnswerList(); //答疑列表
  1735. this.getMenuList(); //学习目录
  1736. this.getReMenuList(); //获取重修目录
  1737. this.getNoteList(); //获取节笔记
  1738. },
  1739. courseDetail() {
  1740. let self = this;
  1741. this.$request.courseDetail(this.courseId).then((res) => {
  1742. if (res.data.educationName == "继续教育") {
  1743. this.$request
  1744. .lockLockAction({
  1745. action: "jxjy",
  1746. })
  1747. .then((res) => {});
  1748. // this.lockTimer = setInterval(() => {
  1749. // this.$request
  1750. // .lockLockAction({
  1751. // action: "jxjy",
  1752. // })
  1753. // .then((res) => {});
  1754. // }, 10000);
  1755. }
  1756. self.detail = res.data;
  1757. });
  1758. },
  1759. openModule(menuItem) {
  1760. //重修目录点击
  1761. console.log(menuItem.list);
  1762. menuItem.showList = !menuItem.showList;
  1763. if (!menuItem.list.length) {
  1764. if (menuItem.isRebuild) {
  1765. this.getReChapterList(menuItem.id, menuItem.courseId, menuItem);
  1766. } else {
  1767. this.getBuyChapterList(menuItem.id, menuItem.courseId, menuItem);
  1768. }
  1769. }
  1770. },
  1771. getReChapterList(moduleId, courseId, menuItem) {
  1772. this.$request
  1773. .reChapterList({
  1774. moduleId: moduleId,
  1775. gradeId: this.gradeId,
  1776. courseId: courseId,
  1777. rebuild: 1,
  1778. })
  1779. .then((res) => {
  1780. for (let i = 0; i < res.data.length; i++) {
  1781. let item = res.data[i];
  1782. item.id = item.chapterId;
  1783. item.showList = false;
  1784. item.list = [];
  1785. item.parent = menuItem;
  1786. item.isRebuild = 1;
  1787. }
  1788. menuItem.list = res.data;
  1789. });
  1790. },
  1791. getBuyChapterList(moduleId, courseId, menuItem) {
  1792. this.$request
  1793. .reChapterList({
  1794. moduleId: moduleId,
  1795. gradeId: this.gradeId,
  1796. courseId: courseId,
  1797. })
  1798. .then((res) => {
  1799. for (let i = 0; i < res.data.length; i++) {
  1800. let item = res.data[i];
  1801. item.id = item.chapterId;
  1802. item.menuType = 2;
  1803. item.showList = false;
  1804. item.list = [];
  1805. item.parent = menuItem;
  1806. }
  1807. menuItem.list = res.data;
  1808. });
  1809. },
  1810. openChapter(chapter) {
  1811. console.log(chapter, "chapter");
  1812. chapter.showList = !chapter.showList;
  1813. if (!chapter.list.length) {
  1814. if (chapter.isRebuild) {
  1815. this.getReSectionList(
  1816. chapter.id,
  1817. chapter.courseId,
  1818. chapter.moduleId || 0,
  1819. chapter
  1820. );
  1821. } else {
  1822. this.getBuySectionList(
  1823. chapter.id,
  1824. chapter.courseId,
  1825. chapter.moduleId || 0,
  1826. chapter
  1827. );
  1828. }
  1829. }
  1830. },
  1831. getReSectionList(chapterId, courseId, moduleId, chapter) {
  1832. this.$request
  1833. .reSectionList({
  1834. chapterId: chapterId,
  1835. gradeId: this.gradeId,
  1836. courseId: courseId,
  1837. rebuild: 1,
  1838. moduleId: moduleId,
  1839. })
  1840. .then((res) => {
  1841. let newArr = res.data.filter((item) => {
  1842. return item.type != 2;
  1843. });
  1844. chapter.canLearn = newArr.every((item) => {
  1845. if (item.learning == 1) {
  1846. return true;
  1847. } else {
  1848. return false;
  1849. }
  1850. });
  1851. res.data.forEach((section) => {
  1852. section.parent = chapter;
  1853. });
  1854. chapter.list = res.data;
  1855. });
  1856. },
  1857. getBuySectionList(chapterId, courseId, moduleId = 0, chapter) {
  1858. this.$request
  1859. .reSectionList({
  1860. chapterId: chapterId,
  1861. gradeId: this.gradeId,
  1862. courseId: courseId,
  1863. moduleId: moduleId,
  1864. })
  1865. .then((res) => {
  1866. let newArr = res.data.filter((item) => {
  1867. return item.type != 2;
  1868. });
  1869. chapter.canLearn = newArr.every((item) => {
  1870. if (item.learning == 1) {
  1871. return true;
  1872. } else {
  1873. return false;
  1874. }
  1875. });
  1876. res.data.forEach((section) => {
  1877. section.parent = chapter;
  1878. });
  1879. chapter.list = res.data;
  1880. });
  1881. },
  1882. getGoodsDetail() {
  1883. let self = this;
  1884. this.$request.goodsDetail(this.goodsId).then((res) => {
  1885. self.goodsData = res.data;
  1886. self.gradeId = self.goodsData.gradeId;
  1887. if (this.goodsData.buyNote) {
  1888. this.tabList = [
  1889. { name: "1", label: "学员须知" },
  1890. { name: "2", label: "课程答疑" },
  1891. { name: "3", label: "笔记讲义" },
  1892. ];
  1893. } else {
  1894. this.tabList = [
  1895. { name: "1", label: "课程答疑" },
  1896. { name: "2", label: "笔记讲义" },
  1897. ];
  1898. }
  1899. this.courseBusiness();
  1900. this.courseHandouts();
  1901. if (self.goodsData.goodsPlayConfig) {
  1902. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  1903. if (self.goodsPlayConfig.autoPlay > 0) {
  1904. self.autoplay = true;
  1905. }
  1906. if (self.goodsPlayConfig.drag > 0) {
  1907. self.isAllowSeek = "yes";
  1908. }
  1909. if (self.goodsPlayConfig.speed > 0) {
  1910. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  1911. }
  1912. }
  1913. if (self.goodsData.goodsPhotographConfig) {
  1914. self.goodsPhotographConfig = JSON.parse(
  1915. self.goodsData.goodsPhotographConfig
  1916. );
  1917. if (self.goodsPhotographConfig.photoNum > 0) {
  1918. self.photoNum = self.goodsPhotographConfig.photoNum;
  1919. }
  1920. }
  1921. });
  1922. },
  1923. /**
  1924. * 点击节
  1925. */
  1926. async getResource(section) {
  1927. //逻辑
  1928. if (section.type == 2) {
  1929. //试卷
  1930. console.log("试卷");
  1931. console.log(section);
  1932. let learnNum = await this.goodsTodayStudySectionNum();
  1933. let hasLearn = await this.gradeCheckGoodsStudy(section.typeId);
  1934. if (this.goodsData.sectionMaxNum > 0) {
  1935. if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
  1936. this.$message({
  1937. type: "warning",
  1938. message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
  1939. });
  1940. return;
  1941. }
  1942. }
  1943. if (this.businessData.goodsLearningOrder == 1) {
  1944. if (section.parent.canLearn) {
  1945. let num = await this.bankRecordDoNum(section);
  1946. //有次数限制
  1947. if (section.answerNum - num > 0 && section.answerNum > 0) {
  1948. // this.$set(this.list[index],'doNum',(item.doNum+1))
  1949. this.$router.push({
  1950. path: "/course-exam/" + this.goodsId,
  1951. query: {
  1952. courseId: this.courseId,
  1953. gradeId: this.gradeId,
  1954. moduleId: section.moduleId || 0,
  1955. examId: section.typeId,
  1956. chapterId: section.chapterId || 0,
  1957. orderGoodsId: this.orderGoodsId,
  1958. },
  1959. });
  1960. //没有答题次数限制
  1961. } else if (section.answerNum == 0) {
  1962. this.$router.push({
  1963. path: "/course-exam/" + this.goodsId,
  1964. query: {
  1965. courseId: this.courseId,
  1966. gradeId: this.gradeId,
  1967. moduleId: section.moduleId || 0,
  1968. examId: section.typeId,
  1969. chapterId: section.chapterId || 0,
  1970. orderGoodsId: this.orderGoodsId,
  1971. },
  1972. });
  1973. } else {
  1974. this.$message({
  1975. type: "warning",
  1976. message: "该试卷只能答题" + section.answerNum + "次",
  1977. });
  1978. return;
  1979. }
  1980. } else {
  1981. this.$message({
  1982. type: "warning",
  1983. message: "请按顺序学完视频课程再进行练习和测试",
  1984. });
  1985. }
  1986. } else if (
  1987. this.businessData.goodsLearningOrder == 2 &&
  1988. !section.rebuild
  1989. ) {
  1990. let rows = await this.studyRecordMenuAllList();
  1991. let isStop = false;
  1992. let newRows = [];
  1993. for (let i = 0; i < rows.length; i++) {
  1994. let moduleTrue = rows[i].moduleId == section.moduleId;
  1995. let chapterTrue = rows[i].chapterId == section.chapterId;
  1996. if (moduleTrue && chapterTrue) {
  1997. isStop = true;
  1998. if (rows[i].sectionType != 2) {
  1999. //忽略直播
  2000. newRows.push(rows[i]);
  2001. }
  2002. } else {
  2003. if (!isStop) {
  2004. if (rows[i].sectionType != 2) {
  2005. //忽略直播
  2006. newRows.push(rows[i]);
  2007. }
  2008. } else {
  2009. break;
  2010. }
  2011. }
  2012. }
  2013. console.log(newRows);
  2014. let isAllLearn = newRows.every((item) => {
  2015. return item.studyStatus == 1;
  2016. });
  2017. if (isAllLearn) {
  2018. //之前的都学完了
  2019. // if(canLearn) { //视频的上一节学完
  2020. let num = await this.bankRecordDoNum(section.typeId);
  2021. //有次数限制
  2022. if (section.answerNum - num > 0 && section.answerNum > 0) {
  2023. console.log(this.list[index]);
  2024. this.$router.push({
  2025. path: "/course-exam/" + this.goodsId,
  2026. query: {
  2027. courseId: this.courseId,
  2028. gradeId: this.gradeId,
  2029. moduleId: section.moduleId || 0,
  2030. examId: section.typeId,
  2031. chapterId: section.chapterId || 0,
  2032. orderGoodsId: this.orderGoodsId,
  2033. },
  2034. });
  2035. //没有答题次数限制
  2036. } else if (section.answerNum == 0) {
  2037. this.$router.push({
  2038. path: "/course-exam/" + this.goodsId,
  2039. query: {
  2040. courseId: this.courseId,
  2041. gradeId: this.gradeId,
  2042. moduleId: section.moduleId || 0,
  2043. examId: section.typeId,
  2044. chapterId: section.chapterId || 0,
  2045. orderGoodsId: this.orderGoodsId,
  2046. },
  2047. });
  2048. } else {
  2049. this.$message({
  2050. type: "warning",
  2051. message: "该试卷只能答题" + section.answerNum + "次",
  2052. });
  2053. return;
  2054. }
  2055. } else {
  2056. this.$message({
  2057. type: "warning",
  2058. message: "请学完视频课程再进行练习和测试",
  2059. });
  2060. }
  2061. } else {
  2062. let num = await this.bankRecordDoNum(section.typeId);
  2063. //有次数限制
  2064. if (section.answerNum - section.doNum > 0 && section.answerNum > 0) {
  2065. // this.$set(this.list[index],'doNum',(item.doNum+1))
  2066. this.$router.push({
  2067. path: "/course-exam/" + this.goodsId,
  2068. query: {
  2069. courseId: this.courseId,
  2070. gradeId: this.gradeId,
  2071. moduleId: section.moduleId || 0,
  2072. examId: section.typeId,
  2073. chapterId: section.chapterId || 0,
  2074. orderGoodsId: this.orderGoodsId,
  2075. },
  2076. });
  2077. //没有答题次数限制
  2078. } else if (section.answerNum == 0) {
  2079. this.$router.push({
  2080. path: "/course-exam/" + this.goodsId,
  2081. query: {
  2082. courseId: this.courseId,
  2083. gradeId: this.gradeId,
  2084. moduleId: section.moduleId || 0,
  2085. examId: section.typeId,
  2086. chapterId: section.chapterId || 0,
  2087. orderGoodsId: this.orderGoodsId,
  2088. },
  2089. });
  2090. } else {
  2091. this.$message({
  2092. type: "warning",
  2093. message: "该试卷只能答题" + section.answerNum + "次",
  2094. });
  2095. return;
  2096. }
  2097. }
  2098. return;
  2099. }
  2100. if (section.type != 2) {
  2101. if (
  2102. this.playSectionId &&
  2103. (this.playSectionId == section.sectionId ||
  2104. this.playSectionId == section.menuId) &&
  2105. this.moduleId == (section.moduleId || 0) &&
  2106. this.chapterId == (section.chapterId || 0)
  2107. ) {
  2108. //切换为同一频道不作为
  2109. return;
  2110. }
  2111. //提交保存观看历史
  2112. if (this.playSectionId) {
  2113. this.postStudyRecord(0, this.playSectionId);
  2114. }
  2115. this.player &&
  2116. this.player.HTML5.video.removeEventListener(
  2117. "timeupdate",
  2118. this.timeEvent
  2119. );
  2120. //播放视频
  2121. this.sectionItem = section;
  2122. this.moduleId = section.moduleId || 0;
  2123. this.chapterId = section.chapterId || 0;
  2124. this.playSectionId = section.sectionId || section.menuId;
  2125. console.log(this.moduleId, this.chapterId, this.playSectionId);
  2126. await this.getPhotoLastRecord();
  2127. this.recordObj = await this.getRecordLast();
  2128. this.getNoteList();
  2129. this.initVideo(section);
  2130. }
  2131. },
  2132. bankRecordDoNum(section) {
  2133. return new Promise((resolve) => {
  2134. this.$request
  2135. .bankRecordDoNum({
  2136. goodsId: this.goodsId,
  2137. gradeId: this.gradeId,
  2138. chapterId: section.chapterId,
  2139. courseId: this.courseId,
  2140. moduleId: 0,
  2141. examId: section.typeId,
  2142. })
  2143. .then((res) => {
  2144. resolve(res.data);
  2145. });
  2146. });
  2147. },
  2148. /**
  2149. * 是否有上一章节
  2150. */
  2151. hasPreItem(rows, option) {
  2152. let moduleId = option.moduleId;
  2153. let chapterId = option.chapterId;
  2154. let sectionId = option.sectionId;
  2155. let index = 0;
  2156. for (let i = 0; i < rows.length; i++) {
  2157. if (
  2158. rows[i].moduleId == moduleId &&
  2159. rows[i].chapterId == chapterId &&
  2160. rows[i].sectionId == sectionId
  2161. ) {
  2162. index = i;
  2163. break;
  2164. }
  2165. }
  2166. if (i == 0) {
  2167. return false;
  2168. } else {
  2169. return true;
  2170. }
  2171. },
  2172. async initVideo(option) {
  2173. if (this.businessData.goodsLearningOrder == 2 && !option.isRebuild) {
  2174. //要按从头到尾顺序学习, 且不是重修课程
  2175. let rows = await this.studyRecordMenuAllList();
  2176. if (!this.hasPreItem(rows, option)) {
  2177. //判断是否有上一节
  2178. let newRows = [];
  2179. for (let i = 0; i < rows.length; i++) {
  2180. let moduleTrue =
  2181. rows[i].moduleId == option.moduleId || rows[i].moduleId == 0;
  2182. let chapterTrue =
  2183. rows[i].chapterId == option.chapterId || rows[i].chapterId == 0;
  2184. let sectionTrue =
  2185. rows[i].sectionId == option.sectionId ||
  2186. rows[i].sectionId == option.menuId;
  2187. if (moduleTrue && chapterTrue && sectionTrue) {
  2188. break;
  2189. } else {
  2190. if (rows[i].sectionType != 2) {
  2191. newRows.push(rows[i]);
  2192. }
  2193. }
  2194. }
  2195. let isAllLearn = newRows.every((item) => {
  2196. return item.studyStatus == 1;
  2197. });
  2198. if (isAllLearn) {
  2199. this.playVideo(option);
  2200. } else {
  2201. this.$message({
  2202. type: "warning",
  2203. message: "请按顺序学习视频课程",
  2204. });
  2205. }
  2206. } else {
  2207. //第一章第一节
  2208. this.playVideo(option);
  2209. }
  2210. } else {
  2211. this.playVideo(option);
  2212. }
  2213. return;
  2214. },
  2215. /**
  2216. * 判断是否是当前播放的节
  2217. */
  2218. isActive(section) {
  2219. let moduleId = section.moduleId || 0;
  2220. let chapterId = section.chapterId || 0;
  2221. let sectionId = section.sectionId || section.menuId;
  2222. if (
  2223. moduleId == this.moduleId &&
  2224. chapterId == this.chapterId &&
  2225. sectionId == this.playSectionId
  2226. ) {
  2227. return true;
  2228. } else {
  2229. return false;
  2230. }
  2231. },
  2232. async playVideo(option) {
  2233. if (option.sectionType == 1 || option.sectionType == 3) {
  2234. //录播
  2235. let learnNum = await this.goodsTodayStudySectionNum(option);
  2236. let hasLearn = await this.gradeCheckGoodsStudy(option);
  2237. console.log(hasLearn, "hasLearn");
  2238. console.log(learnNum, "learnNum");
  2239. if (this.goodsData.sectionMaxNum > 0) {
  2240. if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
  2241. this.$message({
  2242. type: "warning",
  2243. message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
  2244. });
  2245. return;
  2246. }
  2247. }
  2248. if (!option.recordingUrl) {
  2249. this.$message({
  2250. type: "warning",
  2251. message: `暂无播放地址数据`,
  2252. });
  2253. return;
  2254. }
  2255. if (this.playSectionId > 0) {
  2256. //切换视频
  2257. // let oldSectionId = this.playSectionId;
  2258. // uni.$emit("changeSection", oldSectionId);
  2259. }
  2260. //设置播放的节ID
  2261. await this.clears();
  2262. this.vid = option.recordingUrl;
  2263. this.loadPlayerScript(this.loadPlayer);
  2264. // uni.$emit("levelId", this.levelId);
  2265. // uni.$emit("getSection", this.menuItem);
  2266. // uni.$emit("isRebuild", this.isRebuild);
  2267. }
  2268. if (option.sectionType == 2) {
  2269. //直播
  2270. let learnNum = await this.goodsTodayStudySectionNum(option);
  2271. let hasLearn = await this.gradeCheckGoodsStudy(option);
  2272. if (this.goodsData.sectionMaxNum > 0) {
  2273. if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
  2274. this.$message({
  2275. type: "warning",
  2276. message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
  2277. });
  2278. return;
  2279. }
  2280. }
  2281. if (!option.liveUrl) {
  2282. this.$message({
  2283. type: "warning",
  2284. message: `暂无直播地址数据`,
  2285. });
  2286. }
  2287. //设置播放的节ID
  2288. await this.clears();
  2289. this.vidzb = option.liveUrl;
  2290. this.loadPlayerScriptzb(this.loadPlayerzb);
  2291. // uni.$emit("levelId", this.levelId);
  2292. // uni.$emit("getChannel", this.menuItem);
  2293. // uni.$emit("isRebuild", this.isRebuild);
  2294. // console.log(this.menuItem, "menuItem");
  2295. }
  2296. },
  2297. gradeCheckGoodsStudy(option) {
  2298. return new Promise((resolve) => {
  2299. this.$request
  2300. .gradeCheckGoodsStudy({
  2301. goodsId: this.goodsId,
  2302. gradeId: this.gradeId,
  2303. moduleId: option.moduleId || 0,
  2304. chapterId: option.chapterId || 0,
  2305. sectionId: option.sectionId || option.menuId,
  2306. })
  2307. .then((res) => {
  2308. resolve(res.data);
  2309. });
  2310. });
  2311. },
  2312. goodsTodayStudySectionNum(option) {
  2313. return new Promise((resolve) => {
  2314. this.$request
  2315. .goodsTodayStudySectionNum({
  2316. goodsId: this.goodsId,
  2317. gradeId: this.gradeId,
  2318. })
  2319. .then((res) => {
  2320. resolve(res.data);
  2321. });
  2322. });
  2323. },
  2324. studyRecordMenuAllList() {
  2325. return new Promise((resolve) => {
  2326. this.$request
  2327. .studyRecordMenuAllList({
  2328. courseId: this.courseId,
  2329. gradeId: this.gradeId,
  2330. goodsId: this.goodsId,
  2331. })
  2332. .then((res) => {
  2333. resolve(res.data);
  2334. });
  2335. });
  2336. },
  2337. loadPlayerzb() {
  2338. const polyvLivePlayer = window.polyvLivePlayer;
  2339. this.playerzb = polyvLivePlayer({
  2340. wrap: "#playerzb",
  2341. width: 810,
  2342. height: 455,
  2343. uid: this.uidzb,
  2344. vid: this.vidzb,
  2345. });
  2346. },
  2347. loadPlayer() {
  2348. var self = this;
  2349. const polyvPlayer = window.polyvPlayer;
  2350. self.$request.obtainpolyvvideosign(self.vid).then((res) => {
  2351. self.player = polyvPlayer({
  2352. wrap: "#player",
  2353. width: 810,
  2354. height: 455,
  2355. speed: 2,
  2356. vid: self.vid,
  2357. watchStartTime: this.recordObj.videoCurrentTime,
  2358. autoplay: true,
  2359. teaser_show: 0,
  2360. ts: res.data.ts,
  2361. sign: res.data.sign,
  2362. adMatter: [
  2363. {
  2364. // 广告参数详细配置
  2365. location: 1, //广告位置: 1 片头广告,2 暂停广告,3 片尾广告,4 弹窗广告
  2366. adtype: 2, //广告资源类型: 1 图片广告,2 视频广告,3 swf广告(flash播放器生效)
  2367. matterurl: "https://www.runoob.com/try/demo_source/movie.mp4", //广告资源URL
  2368. timesize: 5, //广告时长,单位:秒
  2369. skipenabled: false, //是否显示跳过按钮
  2370. },
  2371. {
  2372. // 广告参数详细配置
  2373. location: 3, //广告位置: 1 片头广告,2 暂停广告,3 片尾广告,4 弹窗广告
  2374. adtype: 2, //广告资源类型: 1 图片广告,2 视频广告,3 swf广告(flash播放器生效)
  2375. matterurl: "https://www.runoob.com/try/demo_source/movie.mp4", //广告资源URL
  2376. timesize: 5, //广告时长,单位:秒
  2377. skipenabled: false, //是否显示跳过按钮
  2378. },
  2379. ],
  2380. playsafe: function (vid, next) {
  2381. next();
  2382. },
  2383. });
  2384. this.player.HTML5.video.addEventListener("timeupdate", self.timeEvent);
  2385. this.player.on("s2j_onPlayStart", () => {
  2386. if (!this.recordObj.videoCurrentTime) {
  2387. //新视频直接提交一条观看记录
  2388. this.postStudyRecord(0);
  2389. }
  2390. });
  2391. this.player.on("s2j_onPlayOver", () => {
  2392. this.$message({
  2393. type: "success",
  2394. message: "播放完毕",
  2395. });
  2396. this.postStudyRecord(1);
  2397. });
  2398. });
  2399. },
  2400. timeEvent() {
  2401. let self = this;
  2402. var polyvPlayerContext = this.player;
  2403. if (polyvPlayerContext) {
  2404. this.playTime = polyvPlayerContext.j2s_getCurrentTime(); //播放时刻
  2405. // console.log(this.playTime,789,this.photoHistoryList)
  2406. //判断是否需要拍照
  2407. if (this.photoNum > 0) {
  2408. this.configPhoto();
  2409. let photoTime = 0; //获取拍照秒数
  2410. for (let i = 0; i < this.photoList.length; i++) {
  2411. photoTime = Number(this.photoList[i]); //获取拍照秒数
  2412. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  2413. //3秒区间内才触发拍照,避免拉动滚动条
  2414. if (
  2415. this.photoHistoryList.indexOf(i) < 0 &&
  2416. this.sectionItem.learning != 1
  2417. ) {
  2418. //不存在拍照历史,没有重修过,没有学过,则拍照
  2419. //启动拍照
  2420. //暂停
  2421. polyvPlayerContext.j2s_pauseVideo();
  2422. this.photoIndex = i;
  2423. this.openPhoto();
  2424. } else {
  2425. }
  2426. }
  2427. }
  2428. }
  2429. }
  2430. },
  2431. getPhotoLastRecord() {
  2432. return new Promise((resolve) => {
  2433. let self = this;
  2434. let data = {
  2435. sectionId: parseInt(self.playSectionId),
  2436. goodsId: parseInt(self.goodsId),
  2437. courseId: parseInt(self.courseId),
  2438. gradeId: parseInt(self.gradeId),
  2439. chapterId: parseInt(self.chapterId),
  2440. moduleId: parseInt(self.moduleId),
  2441. };
  2442. this.$request.getPhotoLastRecord(data).then((res) => {
  2443. //清空历史数据
  2444. self.photoHistoryList = [];
  2445. this.photoIndex = 0;
  2446. self.photoList = [];
  2447. for (let i = 0; i < res.data.length; i++) {
  2448. //-2存储随机拍照数组
  2449. if (res.data[i].photoIndex == -2) {
  2450. self.photoList = res.data[i].timeInterval.split(",");
  2451. } else {
  2452. self.photoHistoryList.push(res.data[i].photoIndex);
  2453. }
  2454. }
  2455. resolve();
  2456. });
  2457. });
  2458. },
  2459. //拍照
  2460. openPhoto() {
  2461. var polyvPlayerContext = this.player;
  2462. if (polyvPlayerContext) {
  2463. if (this.isFullScreen()) {
  2464. this.exitFullscreen();
  2465. }
  2466. }
  2467. this.$nextTick(() => {
  2468. if (
  2469. (window.navigator.mediaDevices &&
  2470. window.navigator.mediaDevices.getUserMedia) ||
  2471. window.navigator.getUserMedia ||
  2472. window.navigator.webkitGetUserMedia ||
  2473. window.navigator.mozGetUserMedia
  2474. ) {
  2475. console.log(this.getUserMedia, "getUserMedia");
  2476. // 调用用户媒体设备, 访问摄像头
  2477. this.getUserMedia(
  2478. {
  2479. video: {
  2480. width: 400,
  2481. height: 300,
  2482. },
  2483. },
  2484. this.photographSuccess,
  2485. this.photographError
  2486. );
  2487. } else {
  2488. this.photographError();
  2489. }
  2490. });
  2491. },
  2492. /**
  2493. * 退出全屏
  2494. */
  2495. exitFullscreen() {
  2496. try {
  2497. var de = document;
  2498. console.log(de);
  2499. if (de.exitFullscreen) {
  2500. de.exitFullscreen();
  2501. } else if (de.mozCancelFullScreen) {
  2502. de.mozCancelFullScreen();
  2503. } else if (de.webkitCancelFullScreen) {
  2504. de.webkitCancelFullScreen();
  2505. }
  2506. } catch (err) {}
  2507. },
  2508. fullele() {
  2509. return (
  2510. document.fullscreenElement ||
  2511. document.webkitFullscreenElement ||
  2512. document.msFullscreenElement ||
  2513. document.mozFullScreenElement ||
  2514. null
  2515. );
  2516. },
  2517. //判断是否全屏
  2518. isFullScreen() {
  2519. return !!(document.webkitIsFullScreen || this.fullele());
  2520. },
  2521. //配置随机拍照时间
  2522. configPhoto() {
  2523. var polyvPlayerContext = this.player;
  2524. let totalVideoTime = polyvPlayerContext.j2s_getDuration();
  2525. let duration = polyvPlayerContext.j2s_getCurrentTime();
  2526. let photoNum = this.photoNum;
  2527. if (!this.photoConfig) {
  2528. this.photoConfig = true;
  2529. //没有历史拍照间隔数据
  2530. if (this.photoList.length == 0) {
  2531. if (totalVideoTime >= 900) {
  2532. //大于15分钟
  2533. if (photoNum == 1) {
  2534. //开头拍1张
  2535. this.photoList.push(1);
  2536. } else if (photoNum == 3) {
  2537. //拍3张
  2538. this.photoList.push(0); //开头拍一张
  2539. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  2540. let centerMinTime = centerTime - 300; //前后5分钟
  2541. let centerMaxTime = centerTime + 300;
  2542. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  2543. this.photoList.push(centerTakeTime); //中间拍一张
  2544. let endMaxTime = totalVideoTime - 60;
  2545. let endMinTime = totalVideoTime - 300;
  2546. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  2547. this.photoList.push(endTakeTime); //最后拍一张
  2548. }
  2549. } else {
  2550. //小于15分钟,只拍前后各一张
  2551. if (photoNum == 1) {
  2552. //开头拍1张
  2553. this.photoList.push(1);
  2554. } else if (photoNum == 3) {
  2555. //拍2张
  2556. if (totalVideoTime <= 300) {
  2557. //小于5分钟
  2558. this.photoList.push(1); //开头拍一张
  2559. let endTakeTime = this.randomNum(10, totalVideoTime); //中间随机取一张
  2560. this.photoList.push(endTakeTime);
  2561. } else {
  2562. this.photoList.push(1); //开头拍一张
  2563. let endMaxTime = totalVideoTime - 60;
  2564. let endMinTime = totalVideoTime - 300;
  2565. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  2566. this.photoList.push(endTakeTime); //最后1-5分钟拍一张
  2567. }
  2568. }
  2569. }
  2570. console.log(this.photoList, "随机拍照时间数组11", photoNum);
  2571. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  2572. }
  2573. console.log(this.photoList, "随机拍照时间数组");
  2574. //兼容已有观看历史
  2575. for (let i = 0; i < this.photoList.length - 1; i++) {
  2576. if (
  2577. this.photoList[i] < duration &&
  2578. this.photoList[i + 1] > duration
  2579. ) {
  2580. this.photoIndex = i + 1;
  2581. // console.log("我的修改了photoIndex")
  2582. break;
  2583. }
  2584. if (duration > this.photoList[this.photoList.length - 1]) {
  2585. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  2586. // console.log("我的修改了photoIndex")
  2587. break;
  2588. }
  2589. }
  2590. }
  2591. },
  2592. randomNum(minNum, maxNum) {
  2593. switch (arguments.length) {
  2594. case 1:
  2595. return parseInt(Math.random() * minNum + 1, 10);
  2596. break;
  2597. case 2:
  2598. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  2599. break;
  2600. default:
  2601. return 0;
  2602. break;
  2603. }
  2604. },
  2605. //postTime 只提交随机时间
  2606. postCoursePhotoRecord(postTime = false) {
  2607. return new Promise((resolve, reject) => {
  2608. let currentTime = 0;
  2609. var polyvPlayerContext = this.player;
  2610. if (polyvPlayerContext) {
  2611. currentTime = polyvPlayerContext.j2s_getCurrentTime();
  2612. }
  2613. let self = this;
  2614. let photoIndex = self.photoIndex;
  2615. let data = {
  2616. photo: self.ossAvatarUrl,
  2617. sectionId: parseInt(self.playSectionId),
  2618. goodsId: parseInt(self.goodsId),
  2619. courseId: parseInt(self.courseId),
  2620. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  2621. gradeId: parseInt(self.gradeId),
  2622. photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
  2623. photoNum: parseInt(self.photoNum),
  2624. chapterId: parseInt(self.chapterId),
  2625. moduleId: parseInt(self.moduleId),
  2626. timeInterval: postTime ? self.photoList.join(",") : "",
  2627. };
  2628. console.log("提交接口", data);
  2629. this.$request
  2630. .coursePhotoRecord(data)
  2631. .then((res) => {
  2632. console.log(res, "res");
  2633. resolve();
  2634. })
  2635. .catch((err) => {
  2636. console.log(err, "err");
  2637. reject();
  2638. });
  2639. });
  2640. },
  2641. /**
  2642. * @param {String} 直播预览
  2643. */
  2644. loadPlayerScriptzb(callback) {
  2645. if (!window.polyvLivePlayer) {
  2646. const myScript = document.createElement("script");
  2647. myScript.setAttribute("src", this.playerJs);
  2648. myScript.onload = callback;
  2649. document.body.appendChild(myScript);
  2650. } else {
  2651. callback();
  2652. }
  2653. },
  2654. loadPlayerScript(callback) {
  2655. if (!window.polyvPlayer) {
  2656. const myScript = document.createElement("script");
  2657. myScript.setAttribute("src", this.vodPlayerJs);
  2658. myScript.onload = callback;
  2659. document.body.appendChild(myScript);
  2660. } else {
  2661. callback();
  2662. }
  2663. },
  2664. clears() {
  2665. return new Promise((resolve, reject) => {
  2666. this.vid = "";
  2667. this.vidzb = "";
  2668. if (this.player) {
  2669. this.player.destroy();
  2670. }
  2671. if (this.playerzb) {
  2672. this.playerzb.destroy();
  2673. }
  2674. resolve();
  2675. });
  2676. },
  2677. /**
  2678. * 提交观看记录
  2679. */
  2680. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  2681. let currentTime = 0;
  2682. let PlayDuration = 0;
  2683. var polyvPlayerContext = this.player;
  2684. if (polyvPlayerContext) {
  2685. currentTime = polyvPlayerContext.j2s_getCurrentTime(); //当前视频播放时刻
  2686. PlayDuration = polyvPlayerContext.j2s_realPlayVideoTime(); //本次看的时长
  2687. }
  2688. if (this.vidzb) {
  2689. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  2690. }
  2691. let self = this;
  2692. console.log(this);
  2693. let data = {
  2694. photo: self.ossAvatarUrl,
  2695. sectionId: parseInt(this.playSectionId),
  2696. goodsId: parseInt(this.goodsId),
  2697. courseId: parseInt(this.courseId),
  2698. studyDuration: parseInt(PlayDuration > 0 ? PlayDuration : 0),
  2699. gradeId: parseInt(this.gradeId),
  2700. chapterId: parseInt(this.chapterId),
  2701. moduleId: parseInt(this.moduleId),
  2702. videoCurrentTime: parseInt(currentTime > 0 ? currentTime : 0),
  2703. };
  2704. if (status > 0) {
  2705. data.status = status;
  2706. }
  2707. this.$request
  2708. .studyRecord(data)
  2709. .then((res) => {
  2710. if (status > 0) {
  2711. //看完视频刷新父级列表
  2712. let rebuildObj = this.getSameObj(this.sectionItem);
  2713. this.refreshParentList(this.sectionItem, rebuildObj);
  2714. }
  2715. self.ossAvatarUrl = "";
  2716. })
  2717. .catch((err) => {
  2718. console.log(err);
  2719. this.$message({
  2720. type: "warning",
  2721. message: err.msg,
  2722. });
  2723. });
  2724. },
  2725. /**
  2726. * 获取重修列表中是否有相同对象
  2727. */
  2728. getSameObj(metaObj) {
  2729. let newObj = false;
  2730. if (this.reMenuList.length) {
  2731. console.log(this.reMenuList, "this.reMenuList");
  2732. this.reMenuList.forEach((menu) => {
  2733. if (menu.type == 3) {
  2734. let isSame = this.contrast(metaObj, menu);
  2735. if (isSame) {
  2736. newObj = isSame;
  2737. }
  2738. } else {
  2739. if (menu.list && menu.list.length) {
  2740. menu.list.forEach((menuItem) => {
  2741. if (menuItem.type == 1) {
  2742. console.log(menuItem, metaObj);
  2743. let isSame = this.contrast(metaObj, menuItem);
  2744. if (isSame) {
  2745. newObj = isSame;
  2746. }
  2747. } else {
  2748. if (menuItem.list && menuItem.list.length) {
  2749. menuItem.list.forEach((menuChild) => {
  2750. if (menuChild.type == 1) {
  2751. let isSame = this.contrast(metaObj, menuChild);
  2752. if (isSame) {
  2753. newObj = isSame;
  2754. }
  2755. }
  2756. });
  2757. }
  2758. }
  2759. });
  2760. }
  2761. }
  2762. });
  2763. return newObj;
  2764. } else {
  2765. return false;
  2766. }
  2767. },
  2768. contrast(obj1, obj2) {
  2769. let moduleId1 = obj1.moduleId || 0;
  2770. let chapterId1 = obj1.chapterId || 0;
  2771. let sectionId1 = obj1.sectionId || obj1.menuId;
  2772. let moduleId2 = obj2.moduleId || 0;
  2773. let chapterId2 = obj2.chapterId || 0;
  2774. let sectionId2 = obj2.sectionId || obj2.menuId;
  2775. //转字符串后对比是否一致
  2776. return moduleId1 == moduleId2 &&
  2777. chapterId1 == chapterId2 &&
  2778. sectionId1 == sectionId2
  2779. ? obj2
  2780. : false;
  2781. },
  2782. /**
  2783. * 刷新父级列表
  2784. */
  2785. refreshParentList(sectionItem, rebuildObj) {
  2786. console.log(sectionItem, "sectionItem");
  2787. console.log(rebuildObj, "rebuildObj");
  2788. if (sectionItem.menuId) {
  2789. //最外层节有menuid
  2790. //普通章节目录
  2791. let self = this;
  2792. this.$request
  2793. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId })
  2794. .then((res) => {
  2795. for (let i = 0; i < res.rows.length; i++) {
  2796. let item = res.rows[i];
  2797. if (item.type == 3) {
  2798. self.menuList[i].learning = item.learning;
  2799. self.menuList[i].rebuild = item.rebuild;
  2800. }
  2801. }
  2802. });
  2803. if (this.menuTab.length > 1) {
  2804. //有重修目录
  2805. this.$request
  2806. .reMenuList({
  2807. courseId: this.courseId,
  2808. gradeId: this.gradeId,
  2809. rebuild: 1,
  2810. })
  2811. .then((res) => {
  2812. for (let i = 0; i < res.rows.length; i++) {
  2813. let item = res.rows[i];
  2814. item.id = item.menuId;
  2815. item.name = item.menuName;
  2816. item.menuType = item.type;
  2817. item.showList = false;
  2818. item.list = [];
  2819. item.isRebuild = 1;
  2820. }
  2821. self.reMenuList = self.reMenuList.filter((reMenu) => {
  2822. //筛选剩下的选项
  2823. return res.rows.find((row) => row.menuId == reMenu.menuId);
  2824. });
  2825. });
  2826. }
  2827. } else if (!sectionItem.moduleId) {
  2828. //第二层节没有moduleid
  2829. this.$request
  2830. .reSectionList({
  2831. chapterId: sectionItem.chapterId,
  2832. gradeId: this.gradeId,
  2833. courseId: this.courseId,
  2834. moduleId: 0,
  2835. })
  2836. .then((res) => {
  2837. let newArr = res.data.filter((item) => {
  2838. return item.type != 2;
  2839. });
  2840. sectionItem.parent.canLearn = newArr.every((item) => {
  2841. if (item.learning == 1) {
  2842. return true;
  2843. } else {
  2844. return false;
  2845. }
  2846. });
  2847. res.data.forEach((section) => {
  2848. section.isRebuild = 1;
  2849. section.parent = sectionItem.parent;
  2850. });
  2851. this.menuList.forEach((menu) => {
  2852. if (menu.menuId == sectionItem.chapterId) {
  2853. menu.list = res.data;
  2854. }
  2855. });
  2856. });
  2857. if (this.menuTab.length > 1 && rebuildObj) {
  2858. this.$request
  2859. .reSectionList({
  2860. chapterId: rebuildObj.chapterId,
  2861. gradeId: this.gradeId,
  2862. courseId: this.courseId,
  2863. moduleId: 0,
  2864. rebuild: 1,
  2865. })
  2866. .then((res) => {
  2867. let newArr = res.data.filter((item) => {
  2868. return item.type != 2;
  2869. });
  2870. rebuildObj.parent.canLearn = newArr.every((item) => {
  2871. if (item.learning == 1) {
  2872. return true;
  2873. } else {
  2874. return false;
  2875. }
  2876. });
  2877. res.data.forEach((section) => {
  2878. section.parent = rebuildObj.parent;
  2879. });
  2880. this.reMenuList.forEach((menu) => {
  2881. if (menu.menuId == rebuildObj.chapterId) {
  2882. menu.list = res.data;
  2883. }
  2884. });
  2885. });
  2886. }
  2887. } else {
  2888. //第三层节有moduleid和chapterid都有
  2889. this.$request
  2890. .reSectionList({
  2891. chapterId: sectionItem.chapterId,
  2892. gradeId: this.gradeId,
  2893. courseId: this.courseId,
  2894. moduleId: sectionItem.moduleId,
  2895. })
  2896. .then((res) => {
  2897. let newArr = res.data.filter((item) => {
  2898. return item.type != 2;
  2899. });
  2900. sectionItem.parent.canLearn = newArr.every((item) => {
  2901. if (item.learning == 1) {
  2902. return true;
  2903. } else {
  2904. return false;
  2905. }
  2906. });
  2907. res.data.forEach((section) => {
  2908. section.parent = sectionItem.parent;
  2909. });
  2910. this.menuList.forEach((menu) => {
  2911. if (menu.list && menu.list.length) {
  2912. menu.list.forEach((chapter) => {
  2913. if (
  2914. chapter.moduleId == sectionItem.moduleId &&
  2915. chapter.chapterId == sectionItem.chapterId
  2916. ) {
  2917. console.log(res.data, "res.data");
  2918. console.log(chapter.list, "chapter.list");
  2919. chapter.list = res.data;
  2920. }
  2921. });
  2922. }
  2923. });
  2924. });
  2925. if (this.menuTab.length > 1 && rebuildObj) {
  2926. this.$request
  2927. .reSectionList({
  2928. chapterId: rebuildObj.chapterId,
  2929. gradeId: this.gradeId,
  2930. courseId: this.courseId,
  2931. moduleId: rebuildObj.moduleId,
  2932. rebuild: 1,
  2933. })
  2934. .then((res) => {
  2935. let newArr = res.data.filter((item) => {
  2936. return item.type != 2;
  2937. });
  2938. rebuildObj.parent.canLearn = newArr.every((item) => {
  2939. if (item.learning == 1) {
  2940. return true;
  2941. } else {
  2942. return false;
  2943. }
  2944. });
  2945. res.data.forEach((section) => {
  2946. section.parent = rebuildObj.parent;
  2947. });
  2948. this.reMenuList.forEach((menu) => {
  2949. if (menu.list && menu.list.length) {
  2950. menu.list.forEach((chapter) => {
  2951. if (
  2952. chapter.moduleId == rebuildObj.moduleId &&
  2953. chapter.chapterId == rebuildObj.chapterId
  2954. ) {
  2955. chapter.list = res.data;
  2956. }
  2957. });
  2958. }
  2959. });
  2960. });
  2961. }
  2962. }
  2963. },
  2964. getRecordLast() {
  2965. let self = this;
  2966. return new Promise((resolve) => {
  2967. let data = {
  2968. gradeId: Number(self.gradeId),
  2969. goodsId: Number(self.goodsId),
  2970. sectionId: Number(self.playSectionId),
  2971. courseId: Number(self.courseId),
  2972. chapterId: parseInt(self.chapterId),
  2973. moduleId: parseInt(self.moduleId),
  2974. };
  2975. self.$request.recordLast(data).then((res) => {
  2976. resolve(res.data);
  2977. });
  2978. });
  2979. },
  2980. /**
  2981. * 获取笔记列表
  2982. */
  2983. getNoteList() {
  2984. let self = this;
  2985. self.noteList = [];
  2986. let data = {
  2987. courseId: this.courseId,
  2988. gradeId: this.gradeId,
  2989. goodsId: this.goodsId,
  2990. pageNum: this.noteParams.pageNum,
  2991. pageSize: this.noteParams.pageSize,
  2992. };
  2993. if (this.playSectionId > 0) {
  2994. data.sectionId = this.playSectionId;
  2995. }
  2996. this.$request.noteList(data).then((res) => {
  2997. self.noteList = res.rows;
  2998. self.noteTotal = res.total;
  2999. });
  3000. },
  3001. noteClick(note) {
  3002. if (this.vid) {
  3003. //切换视频
  3004. var polyvPlayerContext = this.player;
  3005. polyvPlayerContext.changeVid(note.recordingUrl);
  3006. } else {
  3007. this.vid = note.recordingUrl;
  3008. note.sectionType = 3;
  3009. this.initVideo(note);
  3010. }
  3011. this.recordObj = { videoCurrentTime: note.noteSecond };
  3012. },
  3013. getMenuList() {
  3014. let self = this;
  3015. this.$request
  3016. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId })
  3017. .then((res) => {
  3018. for (let i = 0; i < res.rows.length; i++) {
  3019. let item = res.rows[i];
  3020. item.id = item.menuId;
  3021. item.name = item.menuName;
  3022. item.menuType = item.type;
  3023. item.showList = false;
  3024. item.list = [];
  3025. item.parent = this.menuList;
  3026. }
  3027. self.menuList = res.rows;
  3028. });
  3029. },
  3030. getReMenuList() {
  3031. let self = this;
  3032. this.$request
  3033. .reMenuList({
  3034. courseId: this.courseId,
  3035. rebuild: 1,
  3036. gradeId: this.gradeId,
  3037. })
  3038. .then((res) => {
  3039. for (let i = 0; i < res.rows.length; i++) {
  3040. let item = res.rows[i];
  3041. item.id = item.menuId;
  3042. item.name = item.menuName;
  3043. item.menuType = item.type;
  3044. item.showList = false;
  3045. item.list = [];
  3046. item.parent = this.reMenuList;
  3047. item.isRebuild = 1;
  3048. }
  3049. self.reMenuList = res.rows;
  3050. if (self.reMenuList.length > 0) {
  3051. this.menuTab = [
  3052. {
  3053. name: "1",
  3054. label: "章节目录",
  3055. },
  3056. {
  3057. name: "2",
  3058. label: "重修目录",
  3059. },
  3060. ];
  3061. this.courseTabIndex = "1";
  3062. } else {
  3063. this.menuTab = [
  3064. {
  3065. name: "1",
  3066. label: "章节目录",
  3067. },
  3068. ];
  3069. this.courseTabIndex = "1";
  3070. }
  3071. });
  3072. },
  3073. /**
  3074. * 获取讲义权限
  3075. */
  3076. courseHandouts() {
  3077. this.$request
  3078. .courseHandouts(this.goodsData.handoutsId)
  3079. .then((res) => {
  3080. this.courseHandoutsData = res.data;
  3081. })
  3082. .catch((err) => {});
  3083. },
  3084. /**
  3085. * 获取业务层次详情
  3086. */
  3087. courseBusiness() {
  3088. this.$request.courseBusiness(this.goodsData.businessId).then((res) => {
  3089. this.businessData = res.data;
  3090. });
  3091. },
  3092. getAnswerList() {
  3093. let self = this;
  3094. this.$request
  3095. .answerList({ courseId: this.courseId, goodsId: this.goodsId })
  3096. .then((res) => {
  3097. self.answerList = res.rows;
  3098. });
  3099. },
  3100. courseCourseList() {
  3101. this.param.goodsId = this.goodsId;
  3102. this.param.gradeId = this.gradeId;
  3103. this.$request.courseCourseList(this.param).then((res) => {
  3104. this.courseList.push(...res.rows);
  3105. if (!this.courseId) {
  3106. this.courseId = this.courseList[0].courseId;
  3107. }
  3108. this.param.total = res.total;
  3109. this.courseChange();
  3110. });
  3111. },
  3112. download(url, fileName) {
  3113. var a = document.createElement("a");
  3114. var event = new MouseEvent("click");
  3115. a.download = fileName;
  3116. a.href = url;
  3117. a.dispatchEvent(event);
  3118. },
  3119. previvew(url) {
  3120. window.open(url, "_blank");
  3121. },
  3122. noteSubmit() {
  3123. let self = this;
  3124. if (!(this.playSectionId > 0)) {
  3125. this.$message({
  3126. message: "目前无播放视频",
  3127. type: "warning",
  3128. });
  3129. return;
  3130. }
  3131. if (!this.textareaNote) {
  3132. this.$message({
  3133. message: "请输入内容",
  3134. type: "warning",
  3135. });
  3136. return;
  3137. }
  3138. if (!this.gradeId) {
  3139. this.$message({
  3140. message: "暂无班级数据",
  3141. type: "warning",
  3142. });
  3143. return;
  3144. }
  3145. var polyvPlayerContext = this.player;
  3146. let noteDate = this.$tools.getZeroTime();
  3147. let noteSecond = polyvPlayerContext.j2s_getCurrentTime();
  3148. if (!noteSecond) {
  3149. if (noteSecond == 0) {
  3150. //播放结束
  3151. noteSecond = polyvPlayerContext.j2s_getDuration();
  3152. console.log(noteSecond, 63398);
  3153. }
  3154. if (!noteSecond) {
  3155. this.$message({
  3156. message: "视频暂未开始",
  3157. type: "warning",
  3158. });
  3159. return;
  3160. }
  3161. }
  3162. let data = {
  3163. gradeId: this.gradeId,
  3164. goodsId: this.goodsId,
  3165. sectionId: this.playSectionId,
  3166. courseId: this.courseId,
  3167. noteText: this.textareaNote,
  3168. noteDate: noteDate,
  3169. noteSecond: noteSecond,
  3170. };
  3171. this.$request.postNote(data).then((res) => {
  3172. this.$message({
  3173. message: "发布成功",
  3174. type: "success",
  3175. });
  3176. self.getNoteList();
  3177. this.textareaNote = "";
  3178. });
  3179. },
  3180. del(item) {
  3181. console.log(item);
  3182. let data = { answerId: item.answerId, status: -1 };
  3183. this.$request.delAnswer(data).then((res) => {
  3184. this.$message({
  3185. message: "删除成功",
  3186. type: "success",
  3187. });
  3188. this.getAnswerList();
  3189. });
  3190. },
  3191. },
  3192. };
  3193. </script>
  3194. <!-- Add "scoped" attribute to limit CSS to this component only -->
  3195. <style scoped lang="scss">
  3196. .course-detail {
  3197. .section {
  3198. padding-bottom: 30px;
  3199. &__header {
  3200. height: 40px;
  3201. display: flex;
  3202. align-items: center;
  3203. padding: 0 20px;
  3204. }
  3205. &__body {
  3206. .course-info {
  3207. &__header {
  3208. .left-box {
  3209. width: 810px;
  3210. height: 455px;
  3211. float: left;
  3212. background-size: cover;
  3213. background-position: center center;
  3214. background-repeat: no-repeat;
  3215. .video {
  3216. width: 100%;
  3217. height: 100%;
  3218. }
  3219. }
  3220. .right-box {
  3221. width: 462px;
  3222. height: 455px;
  3223. background: #060e1a;
  3224. border-radius: 0px;
  3225. float: right;
  3226. &__header {
  3227. .tabs {
  3228. /deep/.el-tabs__nav-wrap::after {
  3229. background-color: #999;
  3230. }
  3231. /deep/ .el-tabs__header {
  3232. margin: 0;
  3233. }
  3234. .label {
  3235. color: #fff;
  3236. height: 40px;
  3237. line-height: 40px;
  3238. padding: 0 20px;
  3239. }
  3240. .item {
  3241. &__title {
  3242. padding-left: 12px;
  3243. height: 40px;
  3244. line-height: 40px;
  3245. cursor: pointer;
  3246. font-size: 14px;
  3247. font-family: Microsoft YaHei;
  3248. font-weight: bold;
  3249. color: #fff;
  3250. .el-icon-caret-right,
  3251. .el-icon-caret-bottom {
  3252. color: #999;
  3253. }
  3254. }
  3255. &__content {
  3256. .bank-chapter {
  3257. &__item {
  3258. color: #fff;
  3259. font-size: 14px;
  3260. &__text {
  3261. height: 40px;
  3262. line-height: 40px;
  3263. padding-left: 24px;
  3264. cursor: pointer;
  3265. flex: 1;
  3266. .el-icon-caret-right,
  3267. .el-icon-caret-bottom {
  3268. color: #999;
  3269. }
  3270. }
  3271. }
  3272. }
  3273. .bank-section {
  3274. &__item {
  3275. color: #fff;
  3276. font-size: 14px;
  3277. display: flex;
  3278. align-items: center;
  3279. &.active {
  3280. background: #132b4d;
  3281. font-size: 14px;
  3282. font-family: Microsoft YaHei;
  3283. font-weight: bold;
  3284. color: #3f8dfd;
  3285. }
  3286. &__text {
  3287. padding-left: 12px;
  3288. flex: 1;
  3289. height: 40px;
  3290. line-height: 40px;
  3291. cursor: pointer;
  3292. .el-icon-caret-right,
  3293. .el-icon-caret-bottom {
  3294. color: #999;
  3295. }
  3296. }
  3297. .test-btn {
  3298. margin-left: 10px;
  3299. width: 32px;
  3300. height: 20px;
  3301. background: #007aff;
  3302. border-radius: 4px;
  3303. line-height: 18px;
  3304. color: #fff;
  3305. text-align: center;
  3306. }
  3307. .note {
  3308. margin-left: 10px;
  3309. width: 32px;
  3310. height: 20px;
  3311. border: 1px solid #ff3b30;
  3312. border-radius: 4px;
  3313. line-height: 18px;
  3314. color: #ff3b30;
  3315. text-align: center;
  3316. &--yellow {
  3317. border-color: #ff9500;
  3318. color: #ff9500;
  3319. }
  3320. &--blue {
  3321. border-color: #3f8dfd;
  3322. color: #3f8dfd;
  3323. }
  3324. }
  3325. .during {
  3326. color: #999;
  3327. margin-right: 10px;
  3328. }
  3329. .btn {
  3330. margin-right: 12px;
  3331. width: 48px;
  3332. height: 20px;
  3333. border: 1px solid #ff3b30;
  3334. background: #ff3b30;
  3335. border-radius: 4px;
  3336. line-height: 18px;
  3337. color: #fff;
  3338. text-align: center;
  3339. &--green {
  3340. border: 1px solid #34c759;
  3341. background: #34c759;
  3342. }
  3343. }
  3344. .live-btn {
  3345. margin-left: 20px;
  3346. width: 32px;
  3347. height: 20px;
  3348. border-radius: 4px;
  3349. background: #eeeeee;
  3350. line-height: 18px;
  3351. color: #666666;
  3352. text-align: center;
  3353. &--yellow {
  3354. background: #fff7eb;
  3355. color: #ff9500;
  3356. }
  3357. &--blue {
  3358. border-color: #ebf4ff;
  3359. color: #007aff;
  3360. }
  3361. }
  3362. }
  3363. }
  3364. }
  3365. }
  3366. }
  3367. .title {
  3368. height: 40px;
  3369. border-bottom: 1px solid #999;
  3370. color: #fff;
  3371. .select {
  3372. width: 100%;
  3373. }
  3374. /deep/ .el-input__icon {
  3375. width: 20px;
  3376. height: 20px;
  3377. border: 1px solid #fff;
  3378. border-radius: 4px;
  3379. margin-top: 10px;
  3380. line-height: 20px;
  3381. }
  3382. /deep/ .el-input__inner {
  3383. color: #fff;
  3384. font-size: 16px;
  3385. background: none;
  3386. border: 0;
  3387. }
  3388. }
  3389. }
  3390. &__body {
  3391. height: 374px;
  3392. overflow-y: scroll;
  3393. &::-webkit-scrollbar {
  3394. width: 6px;
  3395. }
  3396. &::-webkit-scrollbar-track {
  3397. background-color: #060e1a;
  3398. -webkit-border-radius: 2em;
  3399. -moz-border-radius: 2em;
  3400. border-radius: 2em;
  3401. }
  3402. &::-webkit-scrollbar-thumb {
  3403. background-color: #eeeeee;
  3404. -webkit-border-radius: 2em;
  3405. -moz-border-radius: 2em;
  3406. border-radius: 2em;
  3407. }
  3408. }
  3409. }
  3410. }
  3411. &__body {
  3412. /deep/ .el-tabs__item {
  3413. padding: 0 20px !important;
  3414. height: 80px;
  3415. line-height: 80px;
  3416. }
  3417. .course-img {
  3418. width: 100%;
  3419. }
  3420. .course-menu {
  3421. margin-top: 25px;
  3422. .left-box {
  3423. width: 948px;
  3424. float: left;
  3425. &__header {
  3426. padding-right: 50px;
  3427. position: relative;
  3428. .item {
  3429. width: auto;
  3430. margin-right: 24px;
  3431. font-size: 16px;
  3432. font-family: Microsoft YaHei;
  3433. font-weight: 400;
  3434. color: #333333;
  3435. background: #eeeeee;
  3436. border-radius: 8px;
  3437. padding: 12px;
  3438. position: relative;
  3439. &.canlearn {
  3440. background: #3f8dfd;
  3441. color: #fff;
  3442. }
  3443. }
  3444. }
  3445. &__body {
  3446. .item {
  3447. margin-top: 24px;
  3448. padding: 16px;
  3449. background: #eee;
  3450. border-radius: 10px;
  3451. &__title {
  3452. font-size: 16px;
  3453. font-family: Microsoft YaHei;
  3454. font-weight: bold;
  3455. color: #333333;
  3456. .note {
  3457. display: inline-block;
  3458. margin-left: 20px;
  3459. width: 40px;
  3460. height: 24px;
  3461. border: 1px solid #ff3b30;
  3462. border-radius: 8px;
  3463. line-height: 22px;
  3464. color: #ff3b30;
  3465. text-align: center;
  3466. }
  3467. }
  3468. &__content {
  3469. margin-top: 12px;
  3470. background: #f5f7fa;
  3471. }
  3472. }
  3473. }
  3474. }
  3475. .right-box {
  3476. width: 323px;
  3477. float: right;
  3478. .title {
  3479. font-size: 16px;
  3480. font-family: Microsoft YaHei;
  3481. font-weight: 400;
  3482. color: #333333;
  3483. text-shadow: 0px 6px 6px rgba(85, 158, 255, 0.08);
  3484. position: relative;
  3485. .more {
  3486. font-size: 16px;
  3487. font-family: Microsoft YaHei;
  3488. font-weight: 400;
  3489. color: #999999;
  3490. position: absolute;
  3491. right: 0;
  3492. top: 10px;
  3493. }
  3494. }
  3495. .list {
  3496. .course-item {
  3497. margin: 110px 9px 0;
  3498. width: 300px;
  3499. height: 178px;
  3500. background: #ffffff;
  3501. box-shadow: 0px 10px 13px 3px rgba(63, 141, 253, 0.1);
  3502. border-radius: 10px;
  3503. position: relative;
  3504. background: #fff;
  3505. padding-top: 100px;
  3506. &__img {
  3507. width: 280px;
  3508. height: 178px;
  3509. background: #ffffff;
  3510. box-shadow: 0px 0px 9px 1px rgba(0, 0, 0, 0.08);
  3511. border-radius: 10px;
  3512. position: absolute;
  3513. left: 10px;
  3514. top: -78px;
  3515. background: rgba(122, 136, 246, 1);
  3516. overflow: hidden;
  3517. .note {
  3518. width: 80px;
  3519. height: 24px;
  3520. background: #d94404;
  3521. box-shadow: 0px 1px 1px 0px rgba(248, 78, 5, 0.4);
  3522. border-radius: 10px 0px 20px 0px;
  3523. text-align: center;
  3524. line-height: 24px;
  3525. color: #fff;
  3526. }
  3527. }
  3528. &__title {
  3529. margin: 0 8px;
  3530. font-size: 14px;
  3531. font-family: Microsoft YaHei;
  3532. font-weight: 400;
  3533. color: #333333;
  3534. line-height: 24px;
  3535. }
  3536. &__desc {
  3537. height: 32px;
  3538. position: absolute;
  3539. left: 0;
  3540. right: 0;
  3541. bottom: 0;
  3542. margin-left: 8px;
  3543. display: flex;
  3544. justify-content: space-between;
  3545. .price {
  3546. font-size: 18px;
  3547. font-family: Microsoft YaHei;
  3548. font-weight: bold;
  3549. color: #ff2d55;
  3550. line-height: 32px;
  3551. }
  3552. .add {
  3553. display: block;
  3554. width: 118px;
  3555. height: 32px;
  3556. line-height: 30px;
  3557. background: #f2f4f7;
  3558. border-radius: 10px 0px 10px 0px;
  3559. font-size: 16px;
  3560. color: #3f8dfd;
  3561. text-align: center;
  3562. &:hover {
  3563. background: #3f8dfd;
  3564. color: #f2f4f7;
  3565. }
  3566. }
  3567. }
  3568. }
  3569. }
  3570. }
  3571. }
  3572. .answer-question {
  3573. &__header {
  3574. border-bottom: 1px solid #eee;
  3575. .textarea-wrap {
  3576. background: #f9f9f9;
  3577. border: 1px solid #eeeeee;
  3578. border-radius: 8px;
  3579. .textarea {
  3580. height: 100%;
  3581. }
  3582. }
  3583. .submit {
  3584. padding: 10px 20px;
  3585. border-radius: 20px;
  3586. text-align: center;
  3587. font-size: 16px;
  3588. margin: 10px 0;
  3589. float: right;
  3590. }
  3591. }
  3592. &__body {
  3593. .question-list {
  3594. &__item {
  3595. padding: 20px 0;
  3596. display: flex;
  3597. &__avatar {
  3598. width: 40px;
  3599. height: 40px;
  3600. display: table-cell;
  3601. border-radius: 50%;
  3602. text-align: center;
  3603. img {
  3604. display: inline-block;
  3605. vertical-align: middle;
  3606. max-width: 100%;
  3607. max-height: 100%;
  3608. }
  3609. }
  3610. &__content {
  3611. flex: 1;
  3612. border-bottom: 1px solid #ccc;
  3613. margin-left: 10px;
  3614. .nickname {
  3615. font-size: 14px;
  3616. font-family: Microsoft YaHei;
  3617. font-weight: bold;
  3618. color: #333333;
  3619. line-height: 24px;
  3620. }
  3621. .desc {
  3622. font-size: 14px;
  3623. font-family: Microsoft YaHei;
  3624. font-weight: 400;
  3625. color: #666666;
  3626. line-height: 24px;
  3627. }
  3628. .time {
  3629. font-size: 14px;
  3630. font-family: Microsoft YaHei;
  3631. font-weight: 400;
  3632. color: #999999;
  3633. line-height: 24px;
  3634. .replay {
  3635. float: right;
  3636. font-size: 14px;
  3637. font-family: Microsoft YaHei;
  3638. font-weight: 400;
  3639. color: #3f8dfd;
  3640. line-height: 24px;
  3641. margin-right: 20px;
  3642. }
  3643. .del {
  3644. float: right;
  3645. cursor: pointer;
  3646. font-size: 14px;
  3647. font-family: Microsoft YaHei;
  3648. font-weight: 400;
  3649. color: #ff3b30;
  3650. line-height: 24px;
  3651. margin-right: 20px;
  3652. }
  3653. }
  3654. .reply-list {
  3655. margin: 20px 0;
  3656. width: 100%;
  3657. background: #f9f9f9;
  3658. border-radius: 8px;
  3659. padding: 0 0 0 20px;
  3660. &__item {
  3661. padding: 20px 0;
  3662. display: flex;
  3663. border-bottom: 1px solid #ccc;
  3664. &:nth-last-of-type(1) {
  3665. border: 0;
  3666. }
  3667. &__avatar {
  3668. width: 40px;
  3669. height: 40px;
  3670. display: table-cell;
  3671. border-radius: 50%;
  3672. text-align: center;
  3673. img {
  3674. display: inline-block;
  3675. vertical-align: middle;
  3676. max-width: 100%;
  3677. max-height: 100%;
  3678. }
  3679. }
  3680. &__content {
  3681. border-radius: 8px;
  3682. flex: 1;
  3683. margin-left: 10px;
  3684. .nickname {
  3685. font-size: 14px;
  3686. font-family: Microsoft YaHei;
  3687. font-weight: bold;
  3688. color: #333333;
  3689. line-height: 24px;
  3690. }
  3691. .desc {
  3692. font-size: 14px;
  3693. font-family: Microsoft YaHei;
  3694. font-weight: 400;
  3695. color: #666666;
  3696. line-height: 24px;
  3697. }
  3698. .time {
  3699. font-size: 14px;
  3700. font-family: Microsoft YaHei;
  3701. font-weight: 400;
  3702. color: #999999;
  3703. line-height: 24px;
  3704. .reply {
  3705. float: right;
  3706. font-size: 14px;
  3707. font-family: Microsoft YaHei;
  3708. font-weight: 400;
  3709. color: #3f8dfd;
  3710. line-height: 24px;
  3711. margin-right: 20px;
  3712. }
  3713. .del {
  3714. cursor: pointer;
  3715. margin-right: 20px;
  3716. float: right;
  3717. font-size: 14px;
  3718. font-family: Microsoft YaHei;
  3719. font-weight: 400;
  3720. color: #ff3b30;
  3721. line-height: 24px;
  3722. }
  3723. }
  3724. }
  3725. }
  3726. }
  3727. }
  3728. }
  3729. }
  3730. }
  3731. }
  3732. .lecture-notes {
  3733. &__content {
  3734. .left-box {
  3735. float: left;
  3736. width: 462px;
  3737. .textarea {
  3738. border-bottom: 1px solid #eee;
  3739. .submit {
  3740. float: right;
  3741. width: 138px;
  3742. padding: 10px 0;
  3743. margin: 10px 0 25px 0;
  3744. border-radius: 20px;
  3745. text-align: center;
  3746. font-size: 16px;
  3747. }
  3748. }
  3749. .note-list {
  3750. &__content {
  3751. border-bottom: 1px solid #eee;
  3752. &__title {
  3753. width: 216px;
  3754. height: 24px;
  3755. background: #ccc;
  3756. border-radius: 24px;
  3757. font-size: 14px;
  3758. color: #666666;
  3759. text-align: center;
  3760. line-height: 24px;
  3761. margin: 20px 0;
  3762. }
  3763. }
  3764. &__item {
  3765. display: flex;
  3766. padding: 15px;
  3767. .el-icon-video-play {
  3768. cursor: pointer;
  3769. font-size: 20px;
  3770. color: #3f8dfd;
  3771. }
  3772. &__content {
  3773. flex: 1;
  3774. margin-left: 10px;
  3775. .title {
  3776. cursor: pointer;
  3777. font-size: 14px;
  3778. font-family: Microsoft YaHei;
  3779. font-weight: bold;
  3780. color: #3f8dfd;
  3781. line-height: 24px;
  3782. }
  3783. .desc {
  3784. font-size: 14px;
  3785. font-family: Microsoft YaHei;
  3786. font-weight: 400;
  3787. color: #666666;
  3788. line-height: 24px;
  3789. }
  3790. .time {
  3791. font-size: 14px;
  3792. font-family: Microsoft YaHei;
  3793. font-weight: 400;
  3794. color: #999999;
  3795. line-height: 24px;
  3796. }
  3797. }
  3798. }
  3799. }
  3800. .pagination {
  3801. margin-top: 30px;
  3802. text-align: center;
  3803. }
  3804. }
  3805. .right-box {
  3806. width: 786px;
  3807. float: right;
  3808. .lecture-list {
  3809. background: #f5f7fa;
  3810. border-radius: 8px;
  3811. &__header {
  3812. padding: 0 16px;
  3813. height: 40px;
  3814. line-height: 40px;
  3815. font-size: 18px;
  3816. font-family: Microsoft YaHei;
  3817. font-weight: bold;
  3818. color: #333333;
  3819. .slide-btn {
  3820. cursor: pointer;
  3821. float: right;
  3822. font-size: 14px;
  3823. font-family: Microsoft YaHei;
  3824. font-weight: 400;
  3825. color: #999999;
  3826. }
  3827. }
  3828. &__body {
  3829. .list {
  3830. &__item {
  3831. border-top: 1px solid #fff;
  3832. padding: 0 8px 0 16px;
  3833. height: 56px;
  3834. line-height: 55px;
  3835. display: flex;
  3836. align-items: center;
  3837. .title {
  3838. flex: 1;
  3839. font-size: 16px;
  3840. font-family: Microsoft YaHei;
  3841. font-weight: 400;
  3842. color: #333333;
  3843. }
  3844. .btns {
  3845. .btn {
  3846. cursor: pointer;
  3847. display: inline-block;
  3848. vertical-align: middle;
  3849. width: 80px;
  3850. height: 32px;
  3851. background: #ffffff;
  3852. border: 1px solid #3f8dfd;
  3853. border-radius: 16px;
  3854. text-align: center;
  3855. line-height: 30px;
  3856. color: #3f8dfd;
  3857. margin: 0 8px;
  3858. }
  3859. }
  3860. }
  3861. }
  3862. }
  3863. &__footer {
  3864. margin-top: 24px;
  3865. .lecture-scan {
  3866. background: #f5f7fa;
  3867. border-radius: 8px;
  3868. overflow: hidden;
  3869. &__header {
  3870. height: 40px;
  3871. line-height: 40px;
  3872. padding: 0 16px;
  3873. font-size: 16px;
  3874. font-family: Microsoft YaHei;
  3875. font-weight: bold;
  3876. color: #333333;
  3877. }
  3878. &__body {
  3879. height: 800px;
  3880. .iframe {
  3881. width: 100%;
  3882. height: 100%;
  3883. }
  3884. }
  3885. }
  3886. }
  3887. }
  3888. }
  3889. }
  3890. }
  3891. }
  3892. }
  3893. }
  3894. }
  3895. .take-photo {
  3896. /deep/ .el-dialog__header {
  3897. display: none;
  3898. }
  3899. /deep/ .el-dialog__body {
  3900. padding: 0;
  3901. overflow: unset;
  3902. }
  3903. &__close {
  3904. cursor: pointer;
  3905. position: absolute;
  3906. right: 0;
  3907. top: -28px;
  3908. width: 24px;
  3909. height: 24px;
  3910. line-height: 24px;
  3911. text-align: center;
  3912. color: #eee;
  3913. border: 1px solid #eee;
  3914. border-radius: 50%;
  3915. }
  3916. &__header {
  3917. height: 40px;
  3918. border-bottom: 1px solid #eee;
  3919. line-height: 40px;
  3920. font-size: 16px;
  3921. font-family: Microsoft YaHei;
  3922. font-weight: bold;
  3923. color: #333333;
  3924. padding-left: 24px;
  3925. }
  3926. &__body {
  3927. height: 400px;
  3928. padding: 40px 24px;
  3929. .left-box {
  3930. width: 336px;
  3931. float: left;
  3932. .title {
  3933. font-size: 16px;
  3934. font-family: Microsoft YaHei;
  3935. font-weight: bold;
  3936. color: #ff3b30;
  3937. line-height: 24px;
  3938. }
  3939. .content {
  3940. font-size: 14px;
  3941. font-family: Microsoft YaHei;
  3942. font-weight: 400;
  3943. color: #333333;
  3944. line-height: 28px;
  3945. margin-top: 32px;
  3946. }
  3947. }
  3948. .right-box {
  3949. float: right;
  3950. width: 400px;
  3951. height: 300px;
  3952. video {
  3953. width: 100%;
  3954. height: 100%;
  3955. }
  3956. }
  3957. }
  3958. &__footer {
  3959. height: 90px;
  3960. border-top: 1px solid #eee;
  3961. text-align: center;
  3962. .take {
  3963. display: inline-block;
  3964. width: 200px;
  3965. height: 40px;
  3966. padding: 0;
  3967. border-radius: 20px;
  3968. text-align: center;
  3969. line-height: 40px;
  3970. margin: 24px auto;
  3971. }
  3972. }
  3973. }
  3974. }
  3975. </style>