detail.vue 147 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915
  1. <template>
  2. <view class="polyv_detail">
  3. <!-- <nav-bar
  4. :title="detail.courseName || '课程详情'"
  5. v-show="navShow"
  6. ></nav-bar> -->
  7. <uni-nav-bar
  8. left-icon="back"
  9. :statusBar="true"
  10. fixed="true"
  11. :title="detail.courseName || '课程详情'"
  12. @clickLeft="clickLeft"
  13. ></uni-nav-bar>
  14. <view id="top">
  15. <view class="video_box" v-if="!startStatus">
  16. <image
  17. :src="$method.splitImgHost(goodsData.coverUrl)"
  18. mode="widthFix"
  19. style="width: 100%; height: 421rpx"
  20. ></image>
  21. <image
  22. v-if="false"
  23. class="video_play"
  24. src="/static/play.png"
  25. @click="startVideo"
  26. ></image>
  27. </view>
  28. <view v-else>
  29. <!-- v-if="playVID" -->
  30. <!-- #ifdef MP-WEIXIN -->
  31. <view class="video_box" style="width: 100%; height: 421rpx">
  32. <polyv-player
  33. v-if="playVID"
  34. id="playerVideo"
  35. playerId="playerVideo"
  36. height="421rpx"
  37. :vid="vid"
  38. :showSettingBtn="true"
  39. :enablePlayGesture="true"
  40. :custom-cache="false"
  41. :object-fit="'contain'"
  42. @statechange="onStateChange"
  43. @fullscreenchange="fullscreenchange"
  44. @error="playError"
  45. :autoplay="autoplay"
  46. :page-gesture="true"
  47. :vslide-gesture="true"
  48. :vslide-gesture-in-fullscreen="true"
  49. :isAllowSeek="isAllowSeek"
  50. :playbackRate="playbackRate"
  51. :enableAutoRotation="enableAutoRotation"
  52. @loadedmetadata="loadedmetadata"
  53. ></polyv-player>
  54. <!-- :startTime="startTime" -->
  55. <cover-view
  56. class="video-toast__close"
  57. v-if="videoToastShow"
  58. @click="closeToast()"
  59. >X</cover-view
  60. >
  61. <cover-view class="video-toast" v-if="videoToastShow">
  62. <cover-view class="video-toast__text"
  63. >您上次看到 {{ seekTime }},正在自动续播</cover-view
  64. >
  65. <cover-view class="video-toast__btn" @click="restart()"
  66. >从头播放</cover-view
  67. >
  68. </cover-view>
  69. </view>
  70. <!-- #endif -->
  71. <!-- #ifdef H5 -->
  72. <view class="video_box" style="width: 100%; height: 421rpx">
  73. <view v-show="vid" id="player"></view>
  74. <cover-view
  75. class="video-toast__close"
  76. v-if="videoToastShow"
  77. @click="closeToast()"
  78. >X</cover-view
  79. >
  80. <cover-view class="video-toast" v-if="videoToastShow">
  81. <cover-view class="video-toast__text"
  82. >您上次看到 {{ seekTime }},正在自动续播</cover-view
  83. >
  84. <cover-view class="video-toast__btn" @click="restart()"
  85. >从头播放</cover-view
  86. >
  87. </cover-view>
  88. </view>
  89. <!-- #endif -->
  90. <view
  91. class="video_box"
  92. style="width: 100%; height: 421rpx"
  93. v-if="playChannelId > 0"
  94. >
  95. <player
  96. class="plv-mp-demo-player"
  97. :videoOption="videoOption"
  98. :page-gesture="true"
  99. :vslide-gesture="true"
  100. :vslide-gesture-in-fullscreen="true"
  101. @onLiveStatusChange="playerLiveStatusChange"
  102. />
  103. </view>
  104. </view>
  105. <view class="course_name">
  106. <view class="course_titles">
  107. <view class="video_t1" :class="{ one: !goodsData.buyNote }">{{
  108. detail.courseName
  109. }}</view>
  110. <view class="notice_wrap" v-if="goodsData.buyNote">
  111. <view class="video_t1_t" @click="studyNotice"> 学员须知 </view>
  112. </view>
  113. <view
  114. class="toggle_course"
  115. v-if="goodsTeacher.length > 1"
  116. @click="changeCourses()"
  117. >
  118. <image
  119. class="img"
  120. src="/pages3/static/imgs/toggle.png"
  121. mode="widthFix"
  122. ></image>
  123. <view class="toggle_name">切换课程</view>
  124. <!-- courseTotal -->
  125. <view class="numbers">共{{ goodsTeacher.length }}门</view>
  126. </view>
  127. </view>
  128. </view>
  129. <u-line color="#D6D6DB" />
  130. <view>
  131. <view>
  132. <u-tabs
  133. :item-width="itemWidth()"
  134. :list="list"
  135. font-size="32"
  136. bar-width="24"
  137. :current="current"
  138. @change="change"
  139. active-color="#007AFF"
  140. ></u-tabs>
  141. </view>
  142. </view>
  143. <u-line color="#D6D6DB" />
  144. </view>
  145. <view class="box" :class="{ first_ml: current == 0 }">
  146. <scroll-view class="box_in" scroll-y="true">
  147. <!--目录 -->
  148. <view v-show="current == 0">
  149. <view
  150. class="top__header"
  151. v-if="livingItem"
  152. @click="goLive(livingItem)"
  153. >
  154. <image
  155. class="img"
  156. src="/pages3/static/imgs/live.png"
  157. mode="widthFix"
  158. ></image>
  159. <view class="note">正在直播中</view>
  160. <view class="title">{{ livingItem.sectionName }}</view>
  161. </view>
  162. <view
  163. v-if="teacherList && teacherList.length > 0"
  164. class="teacher_names"
  165. >
  166. <view
  167. v-for="(tea, index) in teacherList"
  168. :key="index"
  169. class="names"
  170. :class="{ nactive: teacherIndex == index }"
  171. @click="activeFunc(tea, index)"
  172. >
  173. {{ tea.aliasName }}
  174. </view>
  175. </view>
  176. <view
  177. class="menuBox onessss"
  178. v-for="(item, index) in menuList"
  179. :key="index"
  180. >
  181. <!--模块 -->
  182. <view v-if="item.type == 1"
  183. ><courseModule
  184. v-if="reStart"
  185. :orderGoodsId="orderGoodsId"
  186. :sectionMaxNum="goodsData.sectionMaxNum"
  187. :needOpen="menuIndex[0] === index ? true : false"
  188. :courseId="courseId"
  189. :preItem="menuList[index - 1]"
  190. :learningOrder="businessData.goodsLearningOrder"
  191. :goodsId="goodsId"
  192. :gradeId="gradeId"
  193. :isBuy="true"
  194. :menuItem="item"
  195. :levelId="item.menuId"
  196. :goodsType="1"
  197. :menuAllList="menuAllList"
  198. :sectionItem="sectionItem"
  199. ></courseModule
  200. ></view>
  201. <!--章 -->
  202. <view v-if="item.type == 2"
  203. ><courseChapter
  204. v-if="reStart"
  205. :orderGoodsId="orderGoodsId"
  206. :sectionMaxNum="goodsData.sectionMaxNum"
  207. :needOpen="menuIndex[0] === index ? true : false"
  208. :courseId="courseId"
  209. :preItem="menuList[index - 1]"
  210. @playEnd="sectionPlayEnd($event, index)"
  211. :learningOrder="businessData.goodsLearningOrder"
  212. :goodsId="goodsId"
  213. :gradeId="gradeId"
  214. :isBuy="true"
  215. :menuItem="item"
  216. :levelId="'0-' + item.menuId"
  217. :goodsType="1"
  218. :menuAllList="menuAllList"
  219. ></courseChapter
  220. ></view>
  221. <!--节 -->
  222. <view v-if="item.type == 3"
  223. ><courseSection
  224. ref="MoudleSection"
  225. v-if="reStart"
  226. :orderGoodsId="orderGoodsId"
  227. :sectionMaxNum="goodsData.sectionMaxNum"
  228. @playEnd="sectionPlayEnd($event, index)"
  229. :courseId="courseId"
  230. :preItem="menuList[index - 1]"
  231. :learningOrder="businessData.goodsLearningOrder"
  232. :goodsId="goodsId"
  233. :gradeId="gradeId"
  234. :isBuy="true"
  235. :menuItem="item"
  236. :levelId="'0-0-' + item.menuId"
  237. :goodsType="1"
  238. :testType="3"
  239. :menuAllList="menuAllList"
  240. ></courseSection
  241. ></view>
  242. <!-- @togoBack="togoBack($event)" -->
  243. </view>
  244. </view>
  245. <!--讲义 -->
  246. <view v-show="current == 1">
  247. <handouts-box
  248. :handoutsId="goodsData.handoutsId"
  249. v-if="goodsData.handoutsId"
  250. ></handouts-box>
  251. </view>
  252. <!--笔记 -->
  253. <view v-show="current == 2">
  254. <view v-if="noteList.length == 0" style="text-align: center"
  255. >暂无笔记</view
  256. >
  257. <view v-for="(item, index) in noteList" :key="index">
  258. <view class="dateBox">{{
  259. $method.timestampToTime(item.dateNote)
  260. }}</view>
  261. <view class="noteBox">
  262. <view
  263. v-for="(item1, index1) in item.userNotes"
  264. :key="index1"
  265. style="margin-top: 30rpx"
  266. @click="jumpNote(item1)"
  267. >
  268. <view style="display: flex">
  269. <view class="left_ti">
  270. <view>
  271. <image
  272. src="/static/icon/note2.png"
  273. v-if="noteId != item1.noteId"
  274. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  275. ></image>
  276. <image
  277. src="/static/icon/note1.png"
  278. v-if="noteId == item1.noteId"
  279. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  280. ></image>
  281. </view>
  282. <view
  283. class="title"
  284. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  285. >{{ $method.secondToDate(item1.noteSecond) }}</view
  286. >
  287. </view>
  288. <view style="margin-left: 10rpx">
  289. <view class="t2Content leftPadding">{{
  290. item1.sectionName
  291. }}</view>
  292. <view class="tBox2">{{ item1.noteText }}</view>
  293. </view>
  294. </view>
  295. </view>
  296. </view>
  297. </view>
  298. </view>
  299. <!--答疑 -->
  300. <view v-show="current == 3" class="Answering">
  301. <view
  302. v-for="(item, index) in answerList"
  303. :key="index"
  304. style="background-color: #ffffff"
  305. class="answer_item"
  306. >
  307. <view class="chat_box" @click.stop="clearCtx">
  308. <view style="display: flex; flex: 1">
  309. <view
  310. ><image
  311. :src="
  312. item.assignUserId > 0 && !item.realname
  313. ? '/static/logo_xcx.png'
  314. : $method.splitImgHost(item.avatar)
  315. "
  316. style="width: 64rpx; height: 64rpx"
  317. ></image
  318. ></view>
  319. <view style="margin-left: 15rpx">
  320. <view class="chat1">{{
  321. item.assignUserId > 0 && !item.realname
  322. ? "祥粤老师"
  323. : item.realname
  324. }}</view>
  325. <view class="chat2">{{
  326. $method.timestampToTime(item.createTime, false)
  327. }}</view>
  328. <view class="chat3">
  329. <text v-if="item.assignUserId > 0">回复</text>
  330. <text v-if="item.assignUserId > 0" style="color: #007aff"
  331. >@{{ item.assignRealname }}</text
  332. >
  333. <view style="word-break: break-all">{{
  334. item.answerText
  335. }}</view>
  336. </view>
  337. </view>
  338. </view>
  339. <view
  340. class="btnReply"
  341. @click.stop="replyContent(item)"
  342. v-if="item.userId != userInfo.userId"
  343. >回复</view
  344. >
  345. <view v-else class="btnDel" @click.stop="delContent(item)"
  346. >删除</view
  347. >
  348. </view>
  349. <u-line color="#D6D6DB" />
  350. </view>
  351. <view v-if="answerList.length == 0" style="text-align: center"
  352. >暂无记录</view
  353. >
  354. </view>
  355. <!--目录 -->
  356. <view v-show="current == 4">
  357. <view
  358. class="menuBox"
  359. v-for="(item, index) in reMenuList"
  360. :key="index"
  361. >
  362. <!--模块 -->
  363. <view v-if="item.type == 1"
  364. ><courseModule
  365. :orderGoodsId="orderGoodsId"
  366. :sectionMaxNum="goodsData.sectionMaxNum"
  367. :courseId="courseId"
  368. :learningOrder="businessData.goodsLearningOrder"
  369. :goodsId="goodsId"
  370. :gradeId="gradeId"
  371. :isRebuild="true"
  372. :isBuy="true"
  373. :menuItem="item"
  374. :levelId="item.menuId"
  375. :goodsType="1"
  376. :menuAllList="menuAllList"
  377. :sectionItem="sectionItem"
  378. ></courseModule
  379. ></view>
  380. <!--章 -->
  381. <view v-if="item.type == 2">
  382. <courseChapter
  383. :orderGoodsId="orderGoodsId"
  384. :courseId="courseId"
  385. :learningOrder="businessData.goodsLearningOrder"
  386. :sectionMaxNum="goodsData.sectionMaxNum"
  387. @playEnd="sectionPlayEnd($event, index)"
  388. :gradeId="gradeId"
  389. :goodsId="goodsId"
  390. :isRebuild="true"
  391. :isBuy="true"
  392. :menuItem="item"
  393. :levelId="'0-' + item.menuId"
  394. :goodsType="1"
  395. :menuAllList="menuAllList"
  396. ></courseChapter>
  397. </view>
  398. <!--节 -->
  399. <view v-if="item.type == 3">
  400. <courseSection
  401. :orderGoodsId="orderGoodsId"
  402. :courseId="courseId"
  403. :learningOrder="businessData.goodsLearningOrder"
  404. :sectionMaxNum="goodsData.sectionMaxNum"
  405. @playEnd="sectionPlayEnd($event, index)"
  406. :gradeId="gradeId"
  407. :goodsId="goodsId"
  408. :isRebuild="true"
  409. :isBuy="true"
  410. :nextMenuItem="findMenuNextSection(index)"
  411. :menuItem="item"
  412. :levelId="'0-0-' + item.menuId"
  413. :goodsType="1"
  414. :testType="3"
  415. :menuAllList="menuAllList"
  416. ></courseSection>
  417. </view>
  418. </view>
  419. </view>
  420. </scroll-view>
  421. <!-- 底部固定按钮 -->
  422. <!-- 笔记的输入框 -->
  423. <template v-if="current == 2">
  424. <view
  425. class="inputBottom"
  426. v-if="!(isPlayRebuild > 0) && playChannelId == 0"
  427. :style="{ bottom: bottomHeight + 'px' }"
  428. >
  429. <view style="width: 10%"
  430. ><image
  431. src="/static/icon/note3.png"
  432. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  433. ></image
  434. ></view>
  435. <view style="width: 73%; height: 100%; padding: 10rpx 0">
  436. <input
  437. v-model="noteValue"
  438. height="60"
  439. fixed="true"
  440. placeholder="您可以在这里输入笔记内容"
  441. type="text"
  442. :custom-style="inputStyle"
  443. :adjust-position="false"
  444. class="input"
  445. @focus="focusNote"
  446. @blur="blurNote"
  447. />
  448. </view>
  449. <view
  450. style="
  451. color: #007aff;
  452. font-size: 30rpx;
  453. font-weight: bold;
  454. width: 15%;
  455. text-align: center;
  456. "
  457. @click="postNote"
  458. >提交</view
  459. >
  460. </view>
  461. </template>
  462. <!-- 答疑的输入框 -->
  463. <view
  464. v-if="current == 3"
  465. class="inputBottom"
  466. :style="{ bottom: bottomHeight + 'px' }"
  467. >
  468. <view class="flex_auto">
  469. <input
  470. v-model="ctxValue"
  471. height="60"
  472. fixed="true"
  473. :focus="isFocus"
  474. :placeholder="placeholder"
  475. type="text"
  476. :custom-style="inputStyle"
  477. :adjust-position="false"
  478. class="input"
  479. @focus="focusNote"
  480. @blur="blur"
  481. />
  482. </view>
  483. <view class="btn" @click="postContent">提交</view>
  484. </view>
  485. </view>
  486. <!-- 播放前拍照end -->
  487. <u-popup
  488. v-model="showSet"
  489. :mask-close-able="false"
  490. mode="center"
  491. border-radius="24"
  492. >
  493. <view
  494. style="
  495. align-items: center;
  496. padding: 0 40rpx;
  497. display: flex;
  498. flex-direction: column;
  499. justify-content: center;
  500. "
  501. >
  502. <view
  503. style="
  504. font-weight: bold;
  505. color: #333333;
  506. font-size: 30rpx;
  507. margin-top: 30rpx;
  508. "
  509. >温馨提示</view
  510. >
  511. <view
  512. style="
  513. width: 457rpx;
  514. color: #666666;
  515. font-size: 30rpx;
  516. margin-top: 30rpx;
  517. "
  518. >学习过程中需要拍照验证学员身份, 拍照功能需要使用您的相机。
  519. 是否授权使用?</view
  520. >
  521. <view style="margin: 40rpx 0">
  522. <button
  523. open-type="openSetting"
  524. @bindopensetting="openSetting"
  525. class="btnSet"
  526. >
  527. 去授权
  528. </button>
  529. </view>
  530. </view>
  531. </u-popup>
  532. <u-popup
  533. v-model="photoPopup"
  534. mode="bottom"
  535. border-radius="40"
  536. :mask-close-able="false"
  537. >
  538. <!-- 播放前拍照start -->
  539. <!-- :mask-close-able="false" -->
  540. <!-- style="bottom: 0; position: fixed; width: 100%; z-index: 999" -->
  541. <view v-if="photoPopup">
  542. <view class="photoBox">
  543. <view class="photoTop">
  544. <view class="sqzz" v-if="false"
  545. ><u-icon
  546. name="close"
  547. color="#333333"
  548. size="30"
  549. @click="closePhoto"
  550. ></u-icon
  551. ></view>
  552. <view class="centersq">请正视手机屏幕</view>
  553. <view class="sqzz"></view>
  554. </view>
  555. <view class="photoCenter">
  556. <view class="center_camera" v-if="photoPopup && isTaking">
  557. <!-- #ifdef MP-WEIXIN -->
  558. <camera
  559. device-position="front"
  560. flash="off"
  561. @error="error"
  562. style="width: 100%; height: 100%"
  563. >
  564. <!-- 加人脸框 -->
  565. <cover-view class="head_take">
  566. <cover-view class="headTake_up color"></cover-view>
  567. <cover-view class="headTake_minddle">
  568. <cover-view class="min_left color"></cover-view>
  569. <cover-view class="min_img"></cover-view>
  570. <cover-view class="min_right color"></cover-view>
  571. </cover-view>
  572. <cover-view class="headTake_down color"></cover-view>
  573. </cover-view>
  574. </camera>
  575. <!-- #endif -->
  576. <!-- #ifdef H5 -->
  577. <video
  578. :controls="false"
  579. id="video"
  580. width="400"
  581. height="300"
  582. class="photo_v"
  583. ></video>
  584. <view class="mask"></view>
  585. <!-- #endif -->
  586. </view>
  587. <view class="custom" v-if="!isTaking">
  588. <!-- #ifdef MP-WEIXIN -->
  589. <image :src="avatarUrl" mode=""></image>
  590. <!-- #endif -->
  591. <!-- #ifdef H5 -->
  592. <image :src="faceUrl" mode=""></image>
  593. <!-- #endif -->
  594. </view>
  595. </view>
  596. <view class="btns">
  597. <!-- <view class="btnResult" v-if="isTaking" @click="takePhoto"
  598. >拍照</view
  599. > -->
  600. <view v-if="isTaking" class="takePhoto_btn">
  601. <view style="width: 100rpx; height: 2rpx"></view>
  602. <view class="middle_btn" @click="takePhoto">
  603. <view class="square"></view>
  604. </view>
  605. <view class="rights" @click="takePhTips()">
  606. <text>拍照提示</text>
  607. <u-icon name="arrow-right" color="#FFFFFF" size="30"></u-icon>
  608. </view>
  609. </view>
  610. <view class="btnResult" v-if="!isTaking" @click="reTake">重拍</view>
  611. <view class="btnResult" v-if="!isTaking" @click="submit">确认</view>
  612. </view>
  613. </view>
  614. </view>
  615. </u-popup>
  616. <u-popup
  617. v-model="noticeShow"
  618. class="notice_modal"
  619. mode="center"
  620. border-radius="28"
  621. width="650rpx"
  622. height="622rpx"
  623. :mask-close-able="false"
  624. @close="closeNotice"
  625. >
  626. <view class="content">
  627. <view class="title">学员须知</view>
  628. <scroll-view scroll-y="true">
  629. <view
  630. class="text"
  631. v-html="
  632. goodsData.buyNote && goodsData.buyNote.replace(/\n|\r\n/g, '<br>')
  633. "
  634. >
  635. </view>
  636. </scroll-view>
  637. <view
  638. class="had_read"
  639. :class="{ gray: CountTo >= 0 }"
  640. @click="noticeConfirm()"
  641. >
  642. <text v-if="CountTo >= 0">请阅读学员须知,30s后可关闭</text>
  643. <text v-else>我已阅读学员须知</text>
  644. <text v-if="CountTo >= 0">{{ " " + CountTo + "s" }}</text>
  645. </view>
  646. </view>
  647. </u-popup>
  648. <u-modal
  649. v-model="showMark"
  650. title="提示"
  651. @confirm="markConfirm"
  652. @cancel="markCancel"
  653. confirm-text="复制学习网址"
  654. :show-cancel-button="true"
  655. cancel-text="关闭"
  656. >
  657. <view class="slot-content">
  658. <view>您的学习账号已经开通,请按照步骤操作,进行学习。</view>
  659. <view>1.复制学习地址:{{ markContent }}</view>
  660. <view>2.在【浏览器中】打开复制的学习网址</view>
  661. <view>3.打开学习网址后,选择【个人用户】进行登录</view>
  662. <view>(1)账号:您个人的身份证号码</view>
  663. <view>(2)密码:身份证号码,再加111111</view>
  664. </view>
  665. </u-modal>
  666. <!-- 切换课程弹窗 -->
  667. <u-popup
  668. v-model="toggleCourseShow"
  669. mode="bottom"
  670. border-radius="40"
  671. :mask-close-able="false"
  672. >
  673. <view class="popup_box">
  674. <view class="check_head">
  675. <view class="headers">
  676. <view class="grade">切换课程</view>
  677. <u-icon
  678. name="close"
  679. color="#9C9C9C"
  680. size="40"
  681. @click="closePop()"
  682. ></u-icon>
  683. </view>
  684. <view class="coruse_num">共{{ goodsTeacher.length }}门</view>
  685. <view class="menuSel">
  686. <scroll-view class="sub_sliper" scroll-x="true">
  687. <view
  688. v-for="(item, index) in subList"
  689. :key="index"
  690. style="margin-right: 50rpx; display: inline-block"
  691. >
  692. <view
  693. class="r_t1"
  694. :class="{ nactive: subIndex == index }"
  695. @click="cMenu(item, index)"
  696. >
  697. {{ item.subjectName }}
  698. </view>
  699. </view>
  700. </scroll-view>
  701. </view>
  702. </view>
  703. <view class="check_con">
  704. <scroll-view scroll-y="true" style="height: 700rpx">
  705. <view v-for="(courseItem, gTindex) in goodsTeacher" :key="gTindex">
  706. <view
  707. v-for="(item, index) in courseItem.courseList"
  708. :key="index"
  709. v-show="
  710. item.subjectId === newActiveSubjectId || !newActiveSubjectId
  711. "
  712. >
  713. <view class="course_items" v-if="item.show && item.show == 1">
  714. <view class="course_lefts">
  715. <view class="course_title">
  716. {{ item.courseName }}
  717. </view>
  718. <view
  719. v-if="courseItem.teaList && courseItem.teaList.length > 0"
  720. class="teacher_names"
  721. >
  722. <view
  723. v-for="(tea, tindex) in courseItem.teaList"
  724. :key="tindex"
  725. class="names"
  726. >{{ tea.aliasName }}</view
  727. >
  728. </view>
  729. <view class="course_pros">
  730. 学习进度
  731. <text>
  732. {{ item.stuAllNum + item.recordNum }}/{{
  733. item.secAllNum + item.examNum
  734. }}</text
  735. >
  736. </view>
  737. </view>
  738. <view
  739. class="course_rights"
  740. @click="jump(item, gTindex, 'jump')"
  741. >
  742. <view class="cicles">
  743. <u-icon
  744. name="arrow-right"
  745. color="#498AFE"
  746. size="20"
  747. ></u-icon>
  748. </view>
  749. <view class="intoStudy">进入学习</view>
  750. </view>
  751. </view>
  752. </view>
  753. </view>
  754. </scroll-view>
  755. </view>
  756. </view>
  757. </u-popup>
  758. <!-- 拍照提示 -->
  759. <popup-photo
  760. :popupPhotoShow.sync="popupPhotoShow"
  761. @takePhoto="toTakePhoto()"
  762. ></popup-photo>
  763. </view>
  764. </template>
  765. <script>
  766. import plv from "../static/polyv-sdk/index";
  767. import courseModule from "@/components/course/courseModule.vue";
  768. import courseChapter from "@/components/course/courseChapter.vue";
  769. import courseSection from "@/components/course/courseSection.vue";
  770. import handoutsBox from "@/components/course/handoutsBox.vue";
  771. import PopupPhoto from "@/components/popup/index.vue";
  772. import { mapGetters, mapMutations } from "vuex";
  773. var polyvPlayerContext = null;
  774. export default {
  775. components: {
  776. courseModule,
  777. courseChapter,
  778. courseSection,
  779. PopupPhoto,
  780. handoutsBox,
  781. },
  782. data() {
  783. return {
  784. markContent: "http://admin.zhujianpeixun.com/",
  785. showMark: false,
  786. hasStart: false,
  787. channelItem: null,
  788. lockTimer: null,
  789. orderGoodsId: 0,
  790. noticeShow: false,
  791. navShow: true,
  792. enableAutoRotation: true,
  793. seekTime: "",
  794. toastTimer: null,
  795. videoToastShow: false,
  796. initLiveOk: false,
  797. livePlay: false, //是否正在播放直播,不含暂停
  798. liveDuration: 0, //直播观看时长
  799. videoOption: {
  800. mode: "live",
  801. uid: "",
  802. cid: "",
  803. openId: "",
  804. isAutoChange: false,
  805. forceVideo: false,
  806. },
  807. liveDetail: {},
  808. showSet: false,
  809. startStatus: false,
  810. detail: {},
  811. courseId: 0,
  812. placeholder:
  813. "您可以在这里输入笔记内容\n还可以点击左侧图标为笔记加上时间标记",
  814. inputStyle: {
  815. background: "rgba(244, 244, 244, 0.98)",
  816. borderRadius: "24rpx",
  817. padding: "8rpx",
  818. marginBottom: "10rpx",
  819. },
  820. list: [],
  821. menuList: [],
  822. current: 0,
  823. vid: "",
  824. goodsId: 0,
  825. goodsData: {},
  826. photoPopup: false,
  827. goodsPlayConfig: null,
  828. autoplay: false,
  829. isAllowSeek: "no",
  830. playbackRate: [1.0],
  831. timer: null,
  832. goodsPhotographConfig: null,
  833. intervalTimeList: [], // 间隔拍照时长
  834. intervalTimeIndex: 0, //当前处于哪个时间段拍照
  835. playTime: 0, //页面播放时长,不含暂停
  836. currentTime: 0,
  837. avatarUrl: "",
  838. ossAvatarUrl: "",
  839. studyDuration: 0, // 当前视频时长
  840. gradeId: 0,
  841. chapterId: 0,
  842. moduleId: 0,
  843. reMenuList: [],
  844. answerList: [],
  845. assignUserId: 0,
  846. placeholder: "您可以在这里输入答疑内容",
  847. ctxValue: "",
  848. noteList: [],
  849. noteValue: "",
  850. noteId: 0,
  851. recordObj: 0,
  852. gradeDetail: {},
  853. isTaking: true, //是否正在拍照
  854. needSeek: false, //第一次播放是否需要跳转
  855. needProfileModal: false, //是否需要资料审核弹框
  856. liveObj: {},
  857. photoNum: 0,
  858. photoList: [], //拍照的时间点
  859. photoConfig: false, //是否配置好拍照次数
  860. photoIndex: 0, //当前位于拍照的区间下标 从0开始
  861. photoHistoryList: [], //已拍照历史的下标点
  862. sectionItem: {},
  863. businessData: {},
  864. showNotes: true,
  865. menuIndex: [],
  866. uploadLock: false, //上传图片
  867. isPlayRebuild: false, //是否正在播放重修视频
  868. isRebuild: false, //视频是否从重修目录点击
  869. isFocus: false,
  870. clearTimer: null,
  871. livingItem: "",
  872. option: null,
  873. muluStyle: false, //显示和隐藏目录样式
  874. bottomHeight: 0,
  875. toggleCourseShow: false, // 切换课程弹窗
  876. courseList: [], // 课程列表
  877. reStart: false, // 是否显示模块/章/节
  878. subList: [],
  879. subIndex: 0,
  880. goodsTeacher: [],
  881. teacherList: [],
  882. teacherIndex: 0,
  883. newActiveSubjectId: "", //当前选中ID
  884. compareFaceData: 0, // 拍照匹配相似度
  885. prendreAutoCarme: false, // 是否发起授权相机
  886. studyTimer: null, // 学习记录定时器
  887. CountTo: 30, // 倒计时
  888. handoutTipLength: 0,
  889. menuAllList: [],
  890. popupPhotoShow: false,
  891. curPlayIndex: 0, // 正在播放的节的下标
  892. // h5
  893. vodPlayerJs: "https://player.polyv.net/resp/vod-player/latest/player.js",
  894. player: "",
  895. H5isAllowSeek: "on",
  896. // stream: null,
  897. faceUrl: "",
  898. erJianErZao: false,
  899. pauseTime: 0,
  900. pauseTimer: null,
  901. barTimer: null,
  902. isReach: false,
  903. };
  904. },
  905. computed: {
  906. ...mapGetters([
  907. "userInfo",
  908. "playSectionId",
  909. "playChannelId",
  910. "playVID",
  911. "config",
  912. ]),
  913. playSecIsLearn() {
  914. return this.sectionItem.learning != 1;
  915. },
  916. },
  917. watch: {
  918. showSet(n) {
  919. if (n) {
  920. // var polyvPlayerContext = this.selectComponent("#playerVideo")
  921. if (polyvPlayerContext) {
  922. // #ifdef MP-WEIXIN
  923. polyvPlayerContext.pause();
  924. // #endif
  925. // #ifdef H5
  926. polyvPlayerContext.j2s_pauseVideo(); // 暂停播放视频
  927. // #endif
  928. }
  929. }
  930. },
  931. photoPopup(n) {
  932. if (n) {
  933. if (this.prendreAutoCarme) {
  934. this.photoPopup = false;
  935. }
  936. this.showSet && (this.photoPopup = false);
  937. }
  938. },
  939. },
  940. onLoad(option) {
  941. if (option.isOther) {
  942. this.showMark = true;
  943. return;
  944. }
  945. !this.userInfo && this.$api.refreshUserInfo();
  946. this.courseId = Number(option.id) || "";
  947. this.goodsId = Number(option.goodsId);
  948. this.orderGoodsId = Number(option.orderGoodsId) || "";
  949. this.gradeId = option.gradeId;
  950. this.option = option;
  951. // 公众号模板消息的数据埋点
  952. option.informId && this.clickOfficial(option.informId);
  953. },
  954. async onShow() {
  955. if (uni.getStorageSync("nofresh")) {
  956. uni.removeStorageSync("nofresh");
  957. return;
  958. }
  959. if (this.option.skipPort) {
  960. await this.$method.skipLogin(this.option.skipPort);
  961. }
  962. if (this.$method.isGoLogin()) {
  963. return;
  964. }
  965. this.courseCourseList();
  966. },
  967. onUnload() {
  968. console.log("onUnloadonUnloadonUnloadonUnload");
  969. this.originUnload();
  970. this.clears();
  971. },
  972. onHide() {
  973. this.originUnload();
  974. },
  975. mounted() {},
  976. methods: {
  977. ...mapMutations(["updateChapterOpen", "updateLiveLast"]),
  978. // 新增微信公众号模板消息点击数据
  979. clickOfficial(informId) {
  980. this.$http({
  981. url: "/data/click",
  982. method: "post",
  983. data: { informId },
  984. });
  985. },
  986. // 点击课程目录
  987. cMenu(item, index) {
  988. this.subIndex = index;
  989. this.newActiveSubjectId = item.subjectId;
  990. },
  991. courseCourseList() {
  992. // /course/courseList查询商品下的课程列表
  993. this.courseList = [];
  994. this.menuList = [];
  995. this.photoConfig = false;
  996. this.$api
  997. .courseCourseList({
  998. pageNum: 1,
  999. pageSize: 200,
  1000. goodsId: this.goodsId,
  1001. gradeId: this.gradeId,
  1002. orderGoodsId: this.orderGoodsId,
  1003. })
  1004. .then((res) => {
  1005. if (res.data.code == 200) {
  1006. this.courseList.push.apply(this.courseList, res.data.rows);
  1007. // 科目
  1008. let allItem = [{ subjectId: 0, subjectName: "所有" }];
  1009. let ids = [];
  1010. const newArr = [];
  1011. this.courseList.forEach((item) => {
  1012. if (ids.indexOf(item.subjectId) == -1) {
  1013. ids.push(item.subjectId);
  1014. newArr.push(item);
  1015. }
  1016. });
  1017. this.subList = [...allItem, ...newArr];
  1018. if (res.data.rows.length) {
  1019. this.courseBusiness(res.data.rows[0].businessId);
  1020. }
  1021. if (res.data.total > 1) {
  1022. this.getUserWatchLast();
  1023. // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
  1024. } else if (res.data.total == 1) {
  1025. this.originOnShow();
  1026. this.originMounted();
  1027. }
  1028. }
  1029. });
  1030. },
  1031. /**
  1032. * 获取业务层次详情
  1033. */
  1034. courseBusiness(businessId) {
  1035. // '/app/common/course/business/'+data,
  1036. this.$api.courseBusiness(businessId).then((res) => {
  1037. this.businessData = res.data.data;
  1038. });
  1039. },
  1040. // 查询用户最后一次看的录播的信息
  1041. getUserWatchLast() {
  1042. this.$http({
  1043. url: "/study/record/getUserWatchLast",
  1044. method: "get",
  1045. data: {
  1046. orderGoodsId: this.orderGoodsId,
  1047. },
  1048. }).then((res) => {
  1049. if (res.data.code == 200) {
  1050. this.sectionItem = res.data.data || {};
  1051. if (res.data.data && Object.keys(res.data.data).length) {
  1052. //有最后一次看的录播的信息
  1053. this.courseId = res.data.data.courseId;
  1054. // console.log('查询用户最后一次看的录播的信息', res.data, this.courseId)
  1055. } else {
  1056. this.courseId = this.courseList[0].courseId; // 没有观看记录默认一个课程
  1057. // this.toggleCourseShow = true
  1058. }
  1059. } else {
  1060. this.courseId = this.courseList[0].courseId; // 没有观看记录默认一个课程
  1061. }
  1062. this.originOnShow();
  1063. this.originMounted();
  1064. //获取商品双师资模板
  1065. this.getCourseTeacher(this.courseList);
  1066. });
  1067. },
  1068. getCourseTeacher(rows) {
  1069. this.goodsTeacher = [];
  1070. //获取商品双师资模板
  1071. this.$api
  1072. .courseTeacherList({
  1073. goodsId: this.goodsId,
  1074. })
  1075. .then((res1) => {
  1076. if (res1.data.data && res1.data.data.length > 0) {
  1077. //课程老师模板
  1078. let teacherTel = res1.data.data;
  1079. //商品课程
  1080. let courses = rows;
  1081. teacherTel.forEach((tea) => {
  1082. let dataList = [];
  1083. let teacherList = [];
  1084. courses.forEach((item) => {
  1085. let data = tea.courseList.filter(
  1086. (x) => x.courseId == item.courseId
  1087. );
  1088. if (data && data.length > 0) {
  1089. dataList.push(item);
  1090. teacherList = tea.courseList;
  1091. }
  1092. });
  1093. let result = {
  1094. teaList: teacherList,
  1095. courseList: dataList,
  1096. };
  1097. this.goodsTeacher.push(result);
  1098. });
  1099. if (this.goodsTeacher && this.goodsTeacher.length > 0) {
  1100. let courseIds = [];
  1101. this.goodsTeacher.forEach((item) => {
  1102. item.courseList.forEach((course) => {
  1103. courseIds.push(course.courseId);
  1104. });
  1105. });
  1106. if (courseIds.length > 0) {
  1107. courses.forEach((item) => {
  1108. if (!courseIds.includes(item.courseId)) {
  1109. let data = {
  1110. teaList: [],
  1111. courseList: [],
  1112. };
  1113. data.courseList.push(item);
  1114. this.goodsTeacher.push(data);
  1115. }
  1116. });
  1117. }
  1118. this.goodsTeacher.forEach((item) => {
  1119. if (item.courseList && item.courseList.length > 0) {
  1120. item.courseList[0].show = 1;
  1121. }
  1122. });
  1123. }
  1124. } else {
  1125. //没有双师资模板
  1126. rows.forEach((item) => {
  1127. item.show = 1;
  1128. let data = {
  1129. teaList: [],
  1130. courseList: [],
  1131. };
  1132. data.courseList.push(item);
  1133. this.goodsTeacher.push(data);
  1134. });
  1135. }
  1136. // console.log(this.goodsTeacher,'this.goodsTeacher', this.courseId);
  1137. this.goodsTeacher.forEach((item) => {
  1138. if (item.courseList.some((x) => x.courseId == this.courseId)) {
  1139. this.teacherList = item.teaList;
  1140. }
  1141. });
  1142. });
  1143. },
  1144. erJianErZaoPauseTip() {
  1145. if (this.playSecIsLearn && this.erJianErZao) {
  1146. if (this.pauseTimer) {
  1147. return;
  1148. }
  1149. this.pauseTime = Date.now();
  1150. console.log("开启定时器");
  1151. this.pauseTimer = setInterval(() => {
  1152. console.log("暂停时间", Date.now() - this.pauseTime, this.pauseTime);
  1153. if (Date.now() - this.pauseTime > 5 * 60 * 1000) {
  1154. // 5 * 60 * 1000
  1155. let text = this.photoPopup ? "拍照停留" : "暂停";
  1156. this.photoPopup = false;
  1157. uni.showModal({
  1158. title: "提示",
  1159. showCancel: false,
  1160. content: `检测${text}时间过长,刷新当前页面`,
  1161. cancelText: "取消",
  1162. confirmText: "确定",
  1163. success: (res) => {
  1164. if (res.confirm) {
  1165. // #ifdef H5
  1166. location.reload();
  1167. // #endif
  1168. // #ifdef MP-WEIXIN
  1169. this.courseCourseList();
  1170. // #endif
  1171. }
  1172. },
  1173. });
  1174. this.clearPauseTimer();
  1175. }
  1176. }, 5000);
  1177. }
  1178. },
  1179. // 原来onshow里面的内容
  1180. originOnShow() {
  1181. this.getbaseprofiletplists().then(async (res) => {
  1182. this.courseDetail();
  1183. this.getGoodsDetail();
  1184. this.getAnswerList();
  1185. await this.studyRecordMenuAllList();
  1186. // this.answerTimer = setInterval(() => {
  1187. // this.getAnswerList();
  1188. // }, 5000);
  1189. let noteSecond = Number(this.option.noteSecond);
  1190. // console.log('noteSecondnoteSecond:', noteSecond, this.option)
  1191. if (noteSecond > 0) {
  1192. //我的消息跳过来,播放节
  1193. let item = {
  1194. sectionId: Number(this.option.sectionId),
  1195. recordingUrl: this.option.recordingUrl,
  1196. noteSecond: noteSecond,
  1197. studyDuration: noteSecond,
  1198. };
  1199. let playNextId = `moduleId${this.option.moduleId}chapterId${
  1200. this.option.chapterId
  1201. }sectionId${this.option.sectionId}${
  1202. this.option.isRebuild ? "isRebuild" : ""
  1203. }`;
  1204. this.$store.commit("setPlaySectionId", {
  1205. playSectionId: item.sectionId || item.menuId,
  1206. });
  1207. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  1208. this.$store.commit("updatePlayNextId", playNextId);
  1209. this.playNoteVideo(item);
  1210. } else {
  1211. this.studyRecordQueryLiveLast();
  1212. }
  1213. });
  1214. },
  1215. // 原来的mouted内容
  1216. originMounted() {
  1217. uni.$on("changeSection", (oldSectionId) => {
  1218. console.log(
  1219. "切换课程-originMounted->playVID:",
  1220. this.playVID,
  1221. oldSectionId
  1222. );
  1223. this.studyTimer && clearInterval(this.studyTimer); // 清除定时器
  1224. this.clearPauseTimer();
  1225. this.hasStart = false;
  1226. this.photoConfig = false;
  1227. this.photoIndex = 0;
  1228. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  1229. if (polyvPlayerContext) {
  1230. //解决同个节视频切换问题
  1231. // #ifdef MP-WEIXIN
  1232. polyvPlayerContext.seek(0);
  1233. polyvPlayerContext.pause();
  1234. // #endif
  1235. // #ifdef H5
  1236. polyvPlayerContext.j2s_seekVideo(0);
  1237. polyvPlayerContext.j2s_pauseVideo(); // 暂停播放视频
  1238. // #endif
  1239. }
  1240. //清除直播
  1241. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  1242. this.postStudyRecord(0, oldSectionId);
  1243. });
  1244. uni.$on("getSection", (item) => {
  1245. //清除直播
  1246. this.studyTimer && clearInterval(this.studyTimer);
  1247. this.hasStart = false;
  1248. this.isPlayRebuild = item.rebuild;
  1249. this.photoConfig = false;
  1250. this.photoIndex = 0;
  1251. this.sectionItem = item;
  1252. this.moduleId = item.moduleId || null;
  1253. this.chapterId = item.chapterId || null;
  1254. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  1255. this.$store.commit("setPlaySectionId", {
  1256. playSectionId: item.sectionId || item.menuId,
  1257. });
  1258. //获取拍照历史
  1259. this.getPhotoLastRecord();
  1260. this.playVideo(item);
  1261. });
  1262. uni.$on("levelId", (item) => {
  1263. let arr = item.split("-");
  1264. //点击节获取的各层级ID
  1265. this.moduleId = arr[0];
  1266. this.chapterId = arr[1];
  1267. });
  1268. uni.$on("getChannel", (item) => {
  1269. //清除录播
  1270. this.studyTimer && clearInterval(this.studyTimer);
  1271. this.hasStart = false;
  1272. this.$store.commit("setPlayVID", { playVID: null });
  1273. this.moduleId = item.moduleId;
  1274. this.chapterId = item.chapterId;
  1275. this.$store.commit("setPlaySectionId", {
  1276. playSectionId: item.sectionId || item.menuId,
  1277. });
  1278. this.getPhotoLastRecord();
  1279. this.playChannel(item);
  1280. this.channelItem = item;
  1281. });
  1282. uni.$on("isRebuild", (item) => {
  1283. this.isRebuild = item;
  1284. });
  1285. this.updateChapterOpen(true);
  1286. },
  1287. clearPauseTimer() {
  1288. if (this.pauseTimer) {
  1289. this.pauseTime = 0;
  1290. clearInterval(this.pauseTimer);
  1291. this.pauseTimer = null;
  1292. }
  1293. },
  1294. clearBarTimer() {
  1295. if (this.barTimer) {
  1296. clearInterval(this.barTimer);
  1297. this.barTimer = null;
  1298. }
  1299. },
  1300. // 原来onUnload里面的内容
  1301. originUnload() {
  1302. if (this.playSectionId > 0 && this.hasStart) {
  1303. //退出提交记录
  1304. this.postStudyRecord();
  1305. }
  1306. //清除正在播放的节ID
  1307. // this.$store.commit('setPlayObj',null)
  1308. this.$store.commit("setPlaySectionId", { playSectionId: 0 });
  1309. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  1310. this.$store.commit("setPlayVID", { playVID: null });
  1311. this.closePlv();
  1312. //移除所有的事件监听器
  1313. uni.$off();
  1314. this.clearTimer && clearTimeout(this.clearTimer);
  1315. this.toastTimer && clearTimeout(this.toastTimer);
  1316. if (this.studyTimer) {
  1317. clearInterval(this.studyTimer);
  1318. this.hasStart = false;
  1319. }
  1320. this.clearPauseTimer();
  1321. this.clearBarTimer();
  1322. this.timer && clearInterval(this.timer);
  1323. if (this.lockTimer) {
  1324. clearInterval(this.lockTimer);
  1325. this.$api
  1326. .lockDelLock({
  1327. action: "jxjy",
  1328. uuid: this.$method.getUuid(),
  1329. })
  1330. .then((res) => {
  1331. uni.hideLoading();
  1332. });
  1333. }
  1334. },
  1335. changeCourses() {
  1336. this.toggleCourseShow = true;
  1337. },
  1338. closePop() {
  1339. this.toggleCourseShow = false;
  1340. },
  1341. async activeFunc(item, index) {
  1342. this.teacherIndex = index;
  1343. let findResult = "";
  1344. this.goodsTeacher.forEach((citem, index) => {
  1345. citem.courseList.forEach((e, e_index) => {
  1346. if (e.courseId == item.courseId) {
  1347. findResult = e;
  1348. }
  1349. });
  1350. });
  1351. this.jump(findResult, 1);
  1352. },
  1353. // 进入学习
  1354. async jump(item, index, type) {
  1355. // console.log('item------>', index,item,this.goodsTeacher)
  1356. if (index == 0) {
  1357. await this.nextCourses(item, type);
  1358. if (item.rebuild === 0) {
  1359. //未重修
  1360. this.$navTo.togo("/pages2/learn/details", {
  1361. id: item.courseId,
  1362. gradeId: item.gradeId,
  1363. goodsId: this.goodsId,
  1364. orderGoodsId: this.orderGoodsId,
  1365. });
  1366. return;
  1367. }
  1368. this.$api.courseDetail(item.courseId).then((res) => {
  1369. if (res.data.code == 200) {
  1370. // if (res.data.data.educationName == "继续教育") {
  1371. this.$api
  1372. .lockLockStatus({
  1373. action: "jxjy",
  1374. uuid: this.$method.getUuid(),
  1375. })
  1376. .then((res) => {
  1377. if (res.data.code == 200) {
  1378. //有其他端在操作,不能学习
  1379. uni.showToast({
  1380. icon: "none",
  1381. title: res.data.msg,
  1382. mask: true,
  1383. duration: 3000,
  1384. });
  1385. } else if (res.data.code == 500) {
  1386. //可以学习
  1387. // this.$navTo.togo("/pages3/polyv/detail", {
  1388. // id: item.courseId,
  1389. // goodsId: this.goodsId,
  1390. // orderGoodsId: this.orderGoodsId,
  1391. // });
  1392. this.courseId = item.courseId;
  1393. this.originOnShow();
  1394. this.originMounted();
  1395. }
  1396. });
  1397. }
  1398. });
  1399. } else {
  1400. if (this.businessData.goodsLearningOrder == 2) {
  1401. //学习顺序是从头到尾学习,没学完上一课不能学习下一课
  1402. let prevItem = this.courseList[index - 1]; //上一课
  1403. if (prevItem.stuAllNum == prevItem.secAllNum) {
  1404. await this.nextCourses(item, type);
  1405. if (item.rebuild === 0) {
  1406. //未重修
  1407. this.$navTo.togo("/pages2/learn/details", {
  1408. id: item.courseId,
  1409. gradeId: item.gradeId,
  1410. goodsId: this.goodsId,
  1411. orderGoodsId: this.orderGoodsId,
  1412. });
  1413. return;
  1414. }
  1415. this.$api.courseDetail(item.courseId).then((res) => {
  1416. if (res.data.code == 200) {
  1417. // if (res.data.data.educationName == "继续教育") {
  1418. this.$api
  1419. .lockLockStatus({
  1420. action: "jxjy",
  1421. uuid: this.$method.getUuid(),
  1422. })
  1423. .then((res) => {
  1424. if (res.data.code == 200) {
  1425. //有其他端在操作,不能学习
  1426. uni.showToast({
  1427. icon: "none",
  1428. title: res.data.msg,
  1429. duration: 2000,
  1430. });
  1431. } else if (res.data.code == 500) {
  1432. //可以学习
  1433. // this.$navTo.togo("/pages3/polyv/detail", {
  1434. // id: item.courseId,
  1435. // goodsId: this.goodsId,
  1436. // orderGoodsId: this.orderGoodsId,
  1437. // });
  1438. this.courseId = item.courseId;
  1439. this.originOnShow();
  1440. this.originMounted();
  1441. }
  1442. });
  1443. }
  1444. });
  1445. } else {
  1446. uni.showToast({
  1447. icon: "none",
  1448. title: "请按顺序学完上一课再学习这一课",
  1449. });
  1450. }
  1451. } else {
  1452. await this.nextCourses(item, type);
  1453. if (item.rebuild === 0) {
  1454. //未重修
  1455. this.$navTo.togo("/pages2/learn/details", {
  1456. id: item.courseId,
  1457. gradeId: item.gradeId,
  1458. goodsId: this.goodsId,
  1459. orderGoodsId: this.orderGoodsId,
  1460. });
  1461. return;
  1462. }
  1463. this.$api.courseDetail(item.courseId).then((res) => {
  1464. if (res.data.code == 200) {
  1465. // if (res.data.data.educationName == "继续教育") {
  1466. this.$api
  1467. .lockLockStatus({
  1468. action: "jxjy",
  1469. uuid: this.$method.getUuid(),
  1470. })
  1471. .then((res) => {
  1472. if (res.data.code == 200) {
  1473. //有其他端在操作,不能学习
  1474. uni.showToast({
  1475. icon: "none",
  1476. title: res.data.msg,
  1477. duration: 2000,
  1478. });
  1479. } else if (res.data.code == 500) {
  1480. //可以学习
  1481. // this.$navTo.togo("/pages3/polyv/detail", {
  1482. // id: item.courseId,
  1483. // goodsId: this.goodsId,
  1484. // orderGoodsId: this.orderGoodsId,
  1485. // });
  1486. this.courseId = item.courseId;
  1487. this.originOnShow();
  1488. this.originMounted();
  1489. }
  1490. });
  1491. }
  1492. });
  1493. }
  1494. }
  1495. },
  1496. async nextCourses(item, type) {
  1497. this.vid = "";
  1498. this.hasStart = true;
  1499. await this.originUnload();
  1500. if (type) {
  1501. this.teacherIndex = 0;
  1502. this.goodsTeacher.forEach((citem) => {
  1503. if (citem.courseList.some((x) => x.courseId == item.courseId)) {
  1504. this.teacherList = citem.teaList;
  1505. }
  1506. });
  1507. }
  1508. this.reStart = false;
  1509. this.courseId = item.courseId;
  1510. this.gradeId = item.gradeId;
  1511. this.toggleCourseShow = false;
  1512. },
  1513. clickLeft() {
  1514. // uni.navigateBack()
  1515. uni.switchTab({
  1516. url: "/pages/learn/index",
  1517. });
  1518. },
  1519. markCancel() {
  1520. uni.navigateBack({
  1521. delta: 1,
  1522. });
  1523. },
  1524. markConfirm() {
  1525. uni.setClipboardData({
  1526. data: this.markContent,
  1527. success: function () {
  1528. setTimeout(() => {
  1529. uni.navigateBack({
  1530. delta: 1,
  1531. });
  1532. }, 1000);
  1533. },
  1534. });
  1535. },
  1536. closeNotice() {
  1537. this.$api
  1538. .baseHandoutTip({
  1539. orderGoodsId: this.orderGoodsId,
  1540. })
  1541. .then((res) => {});
  1542. },
  1543. noticeConfirm() {
  1544. if (this.CountTo < 0) {
  1545. this.noticeShow = false;
  1546. if (this.handoutTipLength == 0 && this.goodsPlayConfig.autoPlay > 0) {
  1547. this.autoplay = true;
  1548. // var polyvPlayerContext = this.selectComponent("#playerVideo")
  1549. // #ifdef MP-WEIXIN
  1550. polyvPlayerContext.play();
  1551. // #endif
  1552. // #ifdef H5
  1553. polyvPlayerContext.j2s_resumeVideo();
  1554. // #endif
  1555. }
  1556. }
  1557. },
  1558. baseHandoutTipList() {
  1559. this.$api
  1560. .baseHandoutTipList({
  1561. orderGoodsId: this.orderGoodsId,
  1562. })
  1563. .then((res) => {
  1564. this.handoutTipLength = res.data.rows.length;
  1565. if (res.data.rows.length == 0) {
  1566. this.noticeShow = true;
  1567. if (this.CountTo == 30) {
  1568. var timer = setInterval(() => {
  1569. this.CountTo--;
  1570. if (this.CountTo < 0) {
  1571. clearInterval(timer);
  1572. }
  1573. }, 1000);
  1574. }
  1575. } else {
  1576. this.CountTo = -1;
  1577. if (this.goodsPlayConfig && this.goodsPlayConfig.autoPlay > 0) {
  1578. // #ifdef MP-WEIXIN
  1579. this.autoplay = true;
  1580. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1581. polyvPlayerContext.play();
  1582. // #endif
  1583. // #ifdef H5
  1584. // polyvPlayerContext.j2s_resumeVideo()
  1585. // #endif
  1586. }
  1587. }
  1588. });
  1589. },
  1590. /**
  1591. * 获取上次观看的直播
  1592. */
  1593. studyRecordGetLastLive() {
  1594. this.$api
  1595. .studyRecordGetLastLive({
  1596. orderGoodsId: this.orderGoodsId,
  1597. courseId: this.courseId,
  1598. })
  1599. .then((res) => {
  1600. this.updateLiveLast(res.data.data);
  1601. });
  1602. },
  1603. async initPlayVideo(sectionItem) {
  1604. this.moduleId = sectionItem.moduleId;
  1605. this.chapterId = sectionItem.chapterId;
  1606. if (sectionItem.sectionType == 1) {
  1607. //录播
  1608. this.$store.commit("setPlaySectionId", {
  1609. playSectionId: sectionItem.sectionId,
  1610. });
  1611. this.$store.commit("setPlayVID", {
  1612. playVID: sectionItem.recordingUrl,
  1613. });
  1614. this.sectionItem = sectionItem;
  1615. await this.getPhotoLastRecord(); // 获取拍照历史
  1616. this.playVideo(sectionItem);
  1617. } else if (sectionItem.sectionType == 2) {
  1618. //直播
  1619. this.studyRecordGetLastLive();
  1620. } else if (sectionItem.sectionType == 3) {
  1621. //回放
  1622. this.$store.commit("setPlaySectionId", {
  1623. playSectionId: sectionItem.sectionId,
  1624. });
  1625. this.$store.commit("setPlayVID", {
  1626. playVID: sectionItem.recordingUrl,
  1627. });
  1628. this.sectionItem = sectionItem;
  1629. this.playVideo(sectionItem);
  1630. } else if (sectionItem.doType == 2) {
  1631. uni.showModal({
  1632. title: "温馨提示",
  1633. content: "当前节视频已学完,即将进入考试?",
  1634. showCancel: false,
  1635. success: (res) => {
  1636. if (res.confirm) {
  1637. this.toQuestionBank(sectionItem);
  1638. }
  1639. },
  1640. });
  1641. return;
  1642. }
  1643. },
  1644. toQuestionBank(sectionItem) {
  1645. uni.navigateTo({
  1646. url:
  1647. "/pages2/class/questionBank?courseId=" +
  1648. this.courseId +
  1649. "&gradeId=" +
  1650. this.gradeId +
  1651. "&isFromVideo=1&id=" +
  1652. sectionItem.id +
  1653. "&goodsid=" +
  1654. this.goodsId +
  1655. "&moduleId=" +
  1656. (sectionItem.moduleId || 0) +
  1657. "&chapterId=" +
  1658. (sectionItem.chapterId || 0) +
  1659. "&orderGoodsId=" +
  1660. this.orderGoodsId +
  1661. "&type=" +
  1662. (sectionItem.type == 4 ? 1 : 3) +
  1663. "&learning=" +
  1664. sectionItem.studyStatus +
  1665. "&isBackVideo=" +
  1666. 1,
  1667. });
  1668. },
  1669. studyRecordQueryLiveLast() {
  1670. // /study/record/queryLiveLast
  1671. this.$api
  1672. .studyRecordQueryLiveLast({
  1673. gradeId: this.gradeId,
  1674. orderGoodsId: this.orderGoodsId,
  1675. courseId: this.courseId,
  1676. })
  1677. .then((res) => {
  1678. let { data } = res.data;
  1679. if (!data.sectionId) {
  1680. data = this.menuAllList[0];
  1681. } else {
  1682. if (
  1683. data.learning == 1 &&
  1684. this.businessData.goodsLearningOrder == 2
  1685. ) {
  1686. let next = this.menuAllList.find((e) => e.studyStatus != 1);
  1687. next && (data = next);
  1688. }
  1689. }
  1690. this.initPlayVideo(data);
  1691. // if (res.data.data) {
  1692. // this.moduleId = res.data.data.moduleId;
  1693. // this.chapterId = res.data.data.chapterId;
  1694. // if (res.data.data.sectionType == 1) {
  1695. // //录播
  1696. // this.$store.commit("setPlaySectionId", {
  1697. // playSectionId: res.data.data.sectionId,
  1698. // });
  1699. // this.$store.commit("setPlayVID", {
  1700. // playVID: res.data.data.recordingUrl,
  1701. // });
  1702. // this.sectionItem = res.data.data;
  1703. // await this.getPhotoLastRecord(); // 获取拍照历史
  1704. // this.playVideo(res.data.data);
  1705. // } else if (res.data.data.sectionType == 2) {
  1706. // //直播
  1707. // this.studyRecordGetLastLive();
  1708. // } else if (res.data.data.sectionType == 3) {
  1709. // //回放
  1710. // this.$store.commit("setPlaySectionId", {
  1711. // playSectionId: res.data.data.sectionId,
  1712. // });
  1713. // this.$store.commit("setPlayVID", {
  1714. // playVID: res.data.data.recordingUrl,
  1715. // });
  1716. // this.sectionItem = res.data.data;
  1717. // this.playVideo(res.data.data);
  1718. // }
  1719. // // 查询用户最后一次看的录播的信息
  1720. // this.$http({
  1721. // url: "/study/record/getUserWatchLast",
  1722. // method: "get",
  1723. // data: {
  1724. // orderGoodsId: this.orderGoodsId,
  1725. // },
  1726. // }).then((res) => {
  1727. // if (res.data.code == 200) {
  1728. // let { data } = res.data;
  1729. // if (!data) {
  1730. // const sectionItem = this.menuAllList[0];
  1731. // sectionItem.sectionType == 1 && (data = sectionItem);
  1732. // // initPlayVideo
  1733. // }
  1734. // this.sectionItem = data;
  1735. // }
  1736. // });
  1737. // }
  1738. });
  1739. },
  1740. /**
  1741. * 模块大节播放完毕,刷新列表
  1742. */
  1743. sectionPlayEnd(isRebuild, index) {
  1744. if (this.reMenuList.length > 0) {
  1745. //有重修目录
  1746. if (isRebuild.isRebuild) {
  1747. //从重修点击
  1748. this.$api
  1749. .reMenuList({
  1750. orderGoodsId: this.orderGoodsId,
  1751. courseId: this.courseId,
  1752. rebuild: 1,
  1753. gradeId: this.gradeId,
  1754. })
  1755. .then((res) => {
  1756. if (res.data.code == 200) {
  1757. if (res.data.rows.length) {
  1758. res.data.rows[index].name = res.data.rows[index].menuName;
  1759. this.$set(this.reMenuList, index, res.data.rows[index]);
  1760. for (let i = 0; i < res.data.rows.length; i++) {
  1761. let item = res.data.rows[i];
  1762. item.down = true;
  1763. item.id = item.menuId;
  1764. item.name = item.menuName;
  1765. }
  1766. this.reMenuList = [];
  1767. this.$nextTick(() => {
  1768. this.reMenuList = res.data.rows;
  1769. // console.log(this.reMenuList,'this.reMenuList1')
  1770. });
  1771. } else {
  1772. this.reMenuList = [];
  1773. }
  1774. this.$nextTick(() => {
  1775. if (this.reMenuList.length > 0) {
  1776. this.list = [
  1777. {
  1778. name: "目录",
  1779. },
  1780. {
  1781. name: "讲义",
  1782. },
  1783. {
  1784. name: "笔记",
  1785. },
  1786. {
  1787. name: "答疑",
  1788. },
  1789. { name: "重修目录" },
  1790. ];
  1791. } else {
  1792. this.list = [
  1793. {
  1794. name: "目录",
  1795. },
  1796. {
  1797. name: "讲义",
  1798. },
  1799. {
  1800. name: "笔记",
  1801. },
  1802. {
  1803. name: "答疑",
  1804. },
  1805. ];
  1806. if (this.current == 4) {
  1807. this.current = 0;
  1808. }
  1809. }
  1810. });
  1811. }
  1812. });
  1813. this.$api
  1814. .reMenuList({
  1815. courseId: this.courseId,
  1816. gradeId: this.gradeId,
  1817. orderGoodsId: this.orderGoodsId,
  1818. })
  1819. .then((res) => {
  1820. if (res.data.code == 200) {
  1821. for (let i = 0; i < res.data.rows.length; i++) {
  1822. let item = res.data.rows[i];
  1823. item.down = true;
  1824. item.id = item.menuId;
  1825. item.name = item.menuName;
  1826. item.menuType = item.type;
  1827. }
  1828. this.menuList = [];
  1829. this.$nextTick(() => {
  1830. this.menuList = res.data.rows;
  1831. });
  1832. }
  1833. });
  1834. } else {
  1835. //从普通目录点击
  1836. this.$api
  1837. .reMenuList({
  1838. courseId: this.courseId,
  1839. gradeId: this.gradeId,
  1840. orderGoodsId: this.orderGoodsId,
  1841. })
  1842. .then((res) => {
  1843. if (res.data.code == 200) {
  1844. res.data.rows[index].name = res.data.rows[index].menuName;
  1845. res.data.rows[index].id = res.data.rows[index].menuId;
  1846. this.$set(this.menuList, index, res.data.rows[index]);
  1847. }
  1848. });
  1849. this.$api
  1850. .reMenuList({
  1851. orderGoodsId: this.orderGoodsId,
  1852. courseId: this.courseId,
  1853. rebuild: 1,
  1854. gradeId: this.gradeId,
  1855. })
  1856. .then((res) => {
  1857. if (res.data.code == 200) {
  1858. if (res.data.rows.length) {
  1859. // for (let i = 0; i < res.data.rows.length; i++) {
  1860. // let item = res.data.rows[i];
  1861. // item.down = true;
  1862. // item.id = item.menuId;
  1863. // item.name = item.menuName;
  1864. // }
  1865. // this.reMenuList = res.data.rows;
  1866. } else {
  1867. this.reMenuList = [];
  1868. }
  1869. this.$nextTick(() => {
  1870. if (this.reMenuList.length > 0) {
  1871. this.list = [
  1872. {
  1873. name: "目录",
  1874. },
  1875. {
  1876. name: "讲义",
  1877. },
  1878. {
  1879. name: "笔记",
  1880. },
  1881. {
  1882. name: "答疑",
  1883. },
  1884. { name: "重修目录" },
  1885. ];
  1886. } else {
  1887. this.list = [
  1888. {
  1889. name: "目录",
  1890. },
  1891. {
  1892. name: "讲义",
  1893. },
  1894. {
  1895. name: "笔记",
  1896. },
  1897. {
  1898. name: "答疑",
  1899. },
  1900. ];
  1901. if (this.current == 4) {
  1902. this.current = 0;
  1903. }
  1904. }
  1905. });
  1906. }
  1907. });
  1908. }
  1909. } else {
  1910. console.log("--模块大节播放完毕,刷新列表-");
  1911. //没有重修目录
  1912. this.$api
  1913. .reMenuList({
  1914. courseId: this.courseId,
  1915. gradeId: this.gradeId,
  1916. orderGoodsId: this.orderGoodsId,
  1917. })
  1918. .then((res) => {
  1919. if (res.data.code == 200) {
  1920. res.data.rows[index].name = res.data.rows[index].menuName;
  1921. res.data.rows[index].id = res.data.rows[index].menuId;
  1922. this.$set(this.menuList, index, res.data.rows[index]);
  1923. }
  1924. });
  1925. }
  1926. },
  1927. goLive(item) {
  1928. let moduleId = item.moduleId || 0;
  1929. let chapterId = item.chapterId || 0;
  1930. let sectionId = item.sectionId || item.menuId;
  1931. let uuid = new Date().valueOf() + "";
  1932. // buyCourse 是否购买课程:1是 0否
  1933. let encode = encodeURIComponent(
  1934. this.config.hostLive +
  1935. "/pages/live/index?token=" +
  1936. uni.getStorageSync("token") +
  1937. "&userInfo=" +
  1938. JSON.stringify(this.userInfo) +
  1939. "&channelId=" +
  1940. item.liveUrl +
  1941. "&gradeId=" +
  1942. this.gradeId +
  1943. "&courseId=" +
  1944. this.courseId +
  1945. "&goodsId=" +
  1946. this.goodsId +
  1947. "&orderGoodsId=" +
  1948. this.orderGoodsId +
  1949. "&sectionId=" +
  1950. sectionId +
  1951. "&chapterId=" +
  1952. chapterId +
  1953. "&moduleId=" +
  1954. moduleId +
  1955. "&buyCourse=1" +
  1956. "&ident=" +
  1957. uuid
  1958. );
  1959. uni.navigateTo({
  1960. url: `../../pages/webview/index?url=` + encode,
  1961. });
  1962. },
  1963. studyRecordMenuAllList() {
  1964. // study/record/menuAllList
  1965. return this.$api
  1966. .studMenuAllList({
  1967. courseId: this.courseId,
  1968. gradeId: this.gradeId,
  1969. goodsId: this.goodsId,
  1970. })
  1971. .then((res) => {
  1972. let nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  1973. if (res.data.data) {
  1974. this.menuAllList = res.data.data.filter(
  1975. (e) => e.doType != 1 || (e.doType == 2 && e.studyStatus == 1)
  1976. );
  1977. this.livingItem = res.data.data.find(
  1978. (item) =>
  1979. item.liveStartTime <= nowTime && item.liveEndTime > nowTime
  1980. );
  1981. }
  1982. return Promise.resolve();
  1983. });
  1984. },
  1985. async getbaseprofiletplists() {
  1986. // #ifdef MP-WEIXIN
  1987. this.getCameraSetting();
  1988. // #endif
  1989. let {
  1990. data: { code, rows },
  1991. } = await this.$api.getbaseprofiletplists({
  1992. goodsId: this.goodsId,
  1993. orderGoodsId: this.orderGoodsId,
  1994. });
  1995. if (code === 200 && rows.length && rows[0].keyValue) {
  1996. let baseRes = await this.$api.getbaseprofiletpId(this.goodsId);
  1997. if (baseRes.data.code === 200 && baseRes.data.data) {
  1998. let {
  1999. data: { code, data },
  2000. } = await this.$api.getbaseprofiletpgetInfo({
  2001. goodsId: this.goodsId,
  2002. orderGoodsId: this.orderGoodsId,
  2003. });
  2004. if (
  2005. code === 200 &&
  2006. (!data || (data.status === 3 && data.changeStatus === 1))
  2007. ) {
  2008. this.needProfileModal = true;
  2009. uni.showModal({
  2010. content: !data
  2011. ? "请前往填写资料"
  2012. : "资料审核不通过,请前往重新填写",
  2013. cancelText: "返回",
  2014. success: (resultst) => {
  2015. if (resultst.confirm) {
  2016. this.$navTo.togo("/pages2/verify/input", {
  2017. id: this.goodsId,
  2018. orderGoodsId: this.orderGoodsId,
  2019. });
  2020. }
  2021. if (resultst.cancel) {
  2022. uni.navigateBack();
  2023. }
  2024. },
  2025. });
  2026. return Promise.reject();
  2027. } else if (data.status === 1 && JSON.parse(rows[0].keyValue2)[0]) {
  2028. let {
  2029. data: { code, data },
  2030. } = await this.$api.getbaseprofileStampgetInfo({
  2031. goodsId: this.goodsId,
  2032. orderGoodsId: this.orderGoodsId,
  2033. });
  2034. if (
  2035. code === 200 &&
  2036. (!data || (data.status === 3 && data.changeStatus === 1))
  2037. ) {
  2038. this.needProfileModal = true;
  2039. uni.showModal({
  2040. content: !data
  2041. ? "请前往填写盖章资料"
  2042. : "资料盖章审核不通过,请前往重新填写",
  2043. cancelText: "返回",
  2044. success: (resultst) => {
  2045. if (resultst.confirm) {
  2046. this.$navTo.togo("/pages2/verify/input2", {
  2047. id: this.goodsId,
  2048. orderGoodsId: this.orderGoodsId,
  2049. });
  2050. }
  2051. if (resultst.cancel) {
  2052. uni.navigateBack();
  2053. }
  2054. },
  2055. });
  2056. return Promise.reject();
  2057. }
  2058. }
  2059. }
  2060. }
  2061. let detail = await this.$api.goodsDetail(this.goodsId);
  2062. if (detail.data.data.erJianErZao) {
  2063. let info = await this.$api.userConfirmInfoDetail({
  2064. orderGoodsId: this.orderGoodsId,
  2065. });
  2066. if (!info.data.data || info.data.data.pushInfo !== 1) {
  2067. uni.showModal({
  2068. showCancel: false,
  2069. title: "提示",
  2070. content: "开通信息推送不成功,无法进入学习!",
  2071. success: (resultst) => {
  2072. uni.navigateBack();
  2073. },
  2074. });
  2075. return Promise.reject();
  2076. }
  2077. }
  2078. return Promise.resolve();
  2079. },
  2080. getbaseprofiletplists1() {
  2081. return new Promise((resolve) => {
  2082. let self = this;
  2083. // #ifdef MP-WEIXIN
  2084. this.getCameraSetting();
  2085. // #endif
  2086. this.$api
  2087. .getbaseprofiletplists({
  2088. goodsId: self.goodsId,
  2089. orderGoodsId: this.orderGoodsId,
  2090. })
  2091. .then((res) => {
  2092. if (res.data.code === 200 && res.data.rows.length) {
  2093. console.log(res.data.rows[0], 987);
  2094. if (res.data.rows[0].keyValue) {
  2095. self.$api.getbaseprofiletpId(self.goodsId).then((baseRes) => {
  2096. if (baseRes.data.code === 200) {
  2097. if (baseRes.data.data) {
  2098. // base/profile/tp/getInfo
  2099. self.$api
  2100. .getbaseprofiletpgetInfo({
  2101. goodsId: self.goodsId,
  2102. orderGoodsId: self.orderGoodsId,
  2103. })
  2104. .then((result) => {
  2105. if (result.data.code === 200) {
  2106. // status 1通过 2是待审 3是不通过
  2107. if (
  2108. !result.data.data ||
  2109. (result.data.data.status === 3 &&
  2110. result.data.data.changeStatus === 1)
  2111. ) {
  2112. if (!result.data.data) {
  2113. self.needProfileModal = true;
  2114. uni.showModal({
  2115. content: "请前往填写资料",
  2116. cancelText: "返回",
  2117. success: function (resultst) {
  2118. if (resultst.confirm) {
  2119. self.$navTo.togo("/pages2/verify/input", {
  2120. id: self.goodsId,
  2121. orderGoodsId: self.orderGoodsId,
  2122. });
  2123. }
  2124. if (resultst.cancel) {
  2125. uni.navigateBack();
  2126. }
  2127. },
  2128. });
  2129. } else {
  2130. self.needProfileModal = true;
  2131. uni.showModal({
  2132. content: "资料审核不通过,请前往重新填写",
  2133. cancelText: "返回",
  2134. success: function (resultst) {
  2135. if (resultst.confirm) {
  2136. self.$navTo.togo("/pages2/verify/input", {
  2137. id: self.goodsId,
  2138. orderGoodsId: self.orderGoodsId,
  2139. });
  2140. }
  2141. if (resultst.cancel) {
  2142. uni.navigateBack();
  2143. }
  2144. },
  2145. });
  2146. }
  2147. } else if (
  2148. result.data.data.status === 1 &&
  2149. JSON.parse(res.data.rows[0].keyValue2)[0]
  2150. ) {
  2151. self.$api
  2152. .getbaseprofileStampgetInfo({
  2153. goodsId: self.goodsId,
  2154. orderGoodsId: self.orderGoodsId,
  2155. })
  2156. .then((k) => {
  2157. if (k.data.code === 200) {
  2158. if (
  2159. !k.data.data ||
  2160. (k.data.data.status === 3 &&
  2161. k.data.data.changeStatus === 1)
  2162. ) {
  2163. if (!k.data.data) {
  2164. self.needProfileModal = true;
  2165. uni.showModal({
  2166. cancelText: "返回",
  2167. content: "请前往填写盖章资料",
  2168. success: function (resultst) {
  2169. if (resultst.confirm) {
  2170. self.$navTo.togo(
  2171. "/pages2/verify/input2",
  2172. {
  2173. id: self.goodsId,
  2174. orderGoodsId:
  2175. self.orderGoodsId,
  2176. }
  2177. );
  2178. }
  2179. if (resultst.cancel) {
  2180. uni.navigateBack();
  2181. }
  2182. },
  2183. });
  2184. } else {
  2185. self.needProfileModal = true;
  2186. uni.showModal({
  2187. cancelText: "返回",
  2188. content:
  2189. "资料盖章审核不通过,请前往重新填写",
  2190. success: function (resultst) {
  2191. if (resultst.confirm) {
  2192. self.$navTo.togo(
  2193. "/pages2/verify/input2",
  2194. {
  2195. id: self.goodsId,
  2196. orderGoodsId:
  2197. self.orderGoodsId,
  2198. }
  2199. );
  2200. }
  2201. if (resultst.cancel) {
  2202. uni.navigateBack();
  2203. }
  2204. },
  2205. });
  2206. }
  2207. } else {
  2208. resolve();
  2209. }
  2210. }
  2211. });
  2212. } else {
  2213. resolve();
  2214. }
  2215. }
  2216. });
  2217. } else {
  2218. resolve();
  2219. }
  2220. }
  2221. });
  2222. } else {
  2223. resolve();
  2224. }
  2225. } else {
  2226. // 调用推送是否成功
  2227. resolve();
  2228. }
  2229. });
  2230. if (this.gradeId > 0) {
  2231. //提交完资料返回判断是否已开班
  2232. this.getGradeInfo();
  2233. }
  2234. });
  2235. },
  2236. /**
  2237. * 计算tabs宽度
  2238. */
  2239. itemWidth() {
  2240. return 100 / this.list.length + "%";
  2241. },
  2242. findMenuNextSection(index) {
  2243. for (let i = index + 1; i < this.reMenuList.length; i++) {
  2244. let item = this.reMenuList[i];
  2245. if (item.type == 3) {
  2246. return item;
  2247. }
  2248. }
  2249. return {};
  2250. },
  2251. loadedmetadata(event) {
  2252. if (this.hasStart) {
  2253. // 防止loadedmetadata事件第二次触发
  2254. return;
  2255. }
  2256. // #ifdef MP-WEIXIN
  2257. polyvPlayerContext = this.selectComponent("#playerVideo");
  2258. // #endif
  2259. this.hasStart = true;
  2260. uni.$off("playPause");
  2261. uni.$on("playPause", () => {
  2262. // #ifdef MP-WEIXIN
  2263. polyvPlayerContext.pause();
  2264. // #endif
  2265. // #ifdef H5
  2266. polyvPlayerContext.j2s_pauseVideo(); // 暂停播放视频
  2267. // #endif
  2268. });
  2269. if (!this.recordObj.videoCurrentTime) {
  2270. //新视频直接提交一条观看记录
  2271. this.postStudyRecord(0);
  2272. }
  2273. this.studyTimer && clearInterval(this.studyTimer);
  2274. this.studyTimer = setInterval(() => {
  2275. this.postStudyRecord(0);
  2276. }, 15000);
  2277. },
  2278. getPhotoLastRecord() {
  2279. if (this.erJianErZao) {
  2280. return;
  2281. }
  2282. let self = this;
  2283. let data = {
  2284. sectionId: parseInt(self.playSectionId),
  2285. goodsId: parseInt(self.goodsId),
  2286. courseId: parseInt(self.courseId),
  2287. gradeId: parseInt(self.gradeId),
  2288. chapterId: parseInt(self.chapterId),
  2289. moduleId: parseInt(self.moduleId),
  2290. orderGoodsId: this.orderGoodsId,
  2291. };
  2292. // /course/photo/log/getLastInfo'
  2293. this.$api.getPhotoLastRecord(data).then((res) => {
  2294. if (res.data.code == 200) {
  2295. //清空历史数据
  2296. self.photoHistoryList = [];
  2297. this.photoIndex = 0;
  2298. self.photoList = [];
  2299. for (let i = 0; i < res.data.data.length; i++) {
  2300. //-2存储随机拍照数组
  2301. if (res.data.data[i].photoIndex == -2) {
  2302. self.photoList =
  2303. res.data.data[i].timeInterval &&
  2304. res.data.data[i].timeInterval.split(",");
  2305. } else {
  2306. self.photoHistoryList.push(res.data.data[i].photoIndex);
  2307. }
  2308. }
  2309. // console.log('7777', this.photoHistoryList, this.photoList);
  2310. }
  2311. });
  2312. },
  2313. //postTime 只提交随机时间
  2314. postCoursePhotoRecord(postTime = false) {
  2315. return new Promise((resolve, reject) => {
  2316. let currentTime = 0;
  2317. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2318. if (polyvPlayerContext) {
  2319. // #ifdef MP-WEIXIN
  2320. currentTime = polyvPlayerContext.getCurrentTime();
  2321. // #endif
  2322. // #ifdef H5
  2323. currentTime = polyvPlayerContext.j2s_getCurrentTime();
  2324. // #endif
  2325. }
  2326. let self = this;
  2327. let photoIndex = self.photoIndex;
  2328. let data = {
  2329. photo: self.ossAvatarUrl,
  2330. sectionId: parseInt(self.playSectionId),
  2331. goodsId: parseInt(self.goodsId),
  2332. courseId: parseInt(self.courseId),
  2333. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  2334. gradeId: parseInt(self.gradeId),
  2335. photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
  2336. photoNum: parseInt(self.photoNum),
  2337. chapterId: parseInt(self.chapterId),
  2338. moduleId: parseInt(self.moduleId),
  2339. timeInterval: postTime ? self.photoList.join(",") : "",
  2340. orderGoodsId: this.orderGoodsId,
  2341. };
  2342. // console.log("提交接口", data);
  2343. this.$api
  2344. .coursePhotoRecord(data)
  2345. .then((res) => {
  2346. if (res.data.code == 200) {
  2347. resolve();
  2348. } else {
  2349. reject();
  2350. }
  2351. })
  2352. .catch((err) => {
  2353. reject();
  2354. });
  2355. });
  2356. },
  2357. randomNum(minNum, maxNum) {
  2358. switch (arguments.length) {
  2359. case 1:
  2360. return parseInt(Math.random() * minNum + 1, 10);
  2361. break;
  2362. case 2:
  2363. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  2364. break;
  2365. default:
  2366. return 0;
  2367. break;
  2368. }
  2369. },
  2370. //配置随机拍照时间
  2371. configPhoto() {
  2372. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2373. let totalVideoTime = 0;
  2374. let duration = 0;
  2375. // #ifdef MP-WEIXIN
  2376. totalVideoTime = polyvPlayerContext.getDuration();
  2377. duration = polyvPlayerContext.getCurrentTime();
  2378. // #endif
  2379. // #ifdef H5
  2380. totalVideoTime = polyvPlayerContext.j2s_getDuration();
  2381. duration = polyvPlayerContext.j2s_getCurrentTime();
  2382. // #endif
  2383. let photoNum = this.photoNum;
  2384. if (!this.photoConfig) {
  2385. this.photoConfig = true;
  2386. if (this.erJianErZao) {
  2387. this.photoList = this.randomConfig(totalVideoTime, duration);
  2388. return;
  2389. }
  2390. //没有历史拍照间隔数据
  2391. if (this.photoList.length == 0) {
  2392. if (totalVideoTime >= 900) {
  2393. //大于15分钟
  2394. if (photoNum == 1) {
  2395. //开头拍1张
  2396. this.photoList.push(0);
  2397. } else if (photoNum == 3) {
  2398. //拍3张
  2399. this.photoList.push(0); //开头拍一张
  2400. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  2401. let centerMinTime = centerTime - 300; //前后5分钟
  2402. let centerMaxTime = centerTime + 300;
  2403. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  2404. this.photoList.push(centerTakeTime); //中间拍一张
  2405. let endMaxTime = totalVideoTime - 60;
  2406. let endMinTime = totalVideoTime - 300;
  2407. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  2408. this.photoList.push(endTakeTime); //最后拍一张
  2409. }
  2410. } else {
  2411. //小于15分钟,只拍前后各一张
  2412. if (photoNum == 1) {
  2413. //开头拍1张
  2414. this.photoList.push(0);
  2415. } else if (photoNum == 3) {
  2416. this.photoList.push(1);
  2417. let centerTime = this.randomNum(
  2418. (1 / 3) * totalVideoTime,
  2419. (2 / 3) * totalVideoTime
  2420. );
  2421. this.photoList.push(centerTime);
  2422. let endTakeTime = this.randomNum(
  2423. (2 / 3) * totalVideoTime,
  2424. totalVideoTime
  2425. );
  2426. this.photoList.push(endTakeTime);
  2427. }
  2428. }
  2429. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  2430. }
  2431. //兼容已有观看历史
  2432. for (let i = 0; i < this.photoList.length - 1; i++) {
  2433. if (
  2434. this.photoList[i] < duration &&
  2435. this.photoList[i + 1] > duration
  2436. ) {
  2437. this.photoIndex = i + 1;
  2438. break;
  2439. }
  2440. if (duration > this.photoList[this.photoList.length - 1]) {
  2441. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  2442. break;
  2443. }
  2444. }
  2445. }
  2446. },
  2447. // 随机拍摄时间
  2448. randomConfig(totalVideoTime, duration) {
  2449. this.photoHistoryList = [];
  2450. let photoList = [duration];
  2451. let pre = duration;
  2452. if (totalVideoTime > 300) {
  2453. while (pre <= totalVideoTime) {
  2454. pre += this.randomNum(780, 900);
  2455. pre <= totalVideoTime && photoList.push(pre);
  2456. }
  2457. if (totalVideoTime - 300 > photoList.slice(-1)[0]) {
  2458. photoList.push(this.randomNum(totalVideoTime - 180, totalVideoTime));
  2459. }
  2460. }
  2461. return photoList;
  2462. },
  2463. getLiveUid(channelId) {
  2464. let self = this;
  2465. return new Promise((resolve) => {
  2466. let data = {
  2467. channelId: channelId,
  2468. orderGoodsId: this.orderGoodsId,
  2469. };
  2470. self.$api.polyvSign(data).then((res) => {
  2471. resolve(res.data.data);
  2472. });
  2473. });
  2474. },
  2475. timeEventLiving() {
  2476. if (plv != null) {
  2477. if (this.livePlay) {
  2478. this.liveDuration = this.liveDuration + 1; //每隔1秒
  2479. if (this.liveDuration == 2) {
  2480. //直播第2秒拍照
  2481. if (
  2482. this.goodsPhotographConfig &&
  2483. this.goodsPhotographConfig.livephotograph == 1 &&
  2484. this.channelItem.learning != 1 &&
  2485. this.photoHistoryList.length == 0
  2486. ) {
  2487. //开启直播拍照
  2488. this.openPhoto();
  2489. } else {
  2490. this.postStudyRecord(0);
  2491. }
  2492. }
  2493. }
  2494. }
  2495. },
  2496. playerLiveStatusChange(e) {
  2497. const status = e.detail.status;
  2498. if (status === "live") {
  2499. //开始播放
  2500. if (this.timer) {
  2501. clearInterval(this.timer);
  2502. }
  2503. this.livePlay = true;
  2504. this.timer = setInterval(this.timeEventLiving, 1000); //定时器
  2505. }
  2506. if (status === "end") {
  2507. this.hasStart = false;
  2508. if (this.livePlay) {
  2509. //只有播放过的结束才提交,避免未开播触发结束
  2510. this.postStudyRecord(1);
  2511. }
  2512. this.livePlay = false;
  2513. // 未开始
  2514. }
  2515. },
  2516. closePlv() {
  2517. if (plv) {
  2518. plv.destroy();
  2519. }
  2520. },
  2521. playChannel(item) {
  2522. if (this.timer) {
  2523. clearInterval(this.timer);
  2524. }
  2525. this.startStatus = true;
  2526. this.initLive();
  2527. },
  2528. setLiveOption(status) {
  2529. const { userId, channelId, recordFileSimpleModel, playbackEnabled } =
  2530. this.detail;
  2531. const playRecordFile =
  2532. playbackEnabled && recordFileSimpleModel && status === "end";
  2533. this.videoOption = {
  2534. mode: "live",
  2535. uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
  2536. cid: this.playChannelId,
  2537. openId: this.userInfo.userAccount,
  2538. isAutoChange: false,
  2539. forceVideo: false,
  2540. };
  2541. },
  2542. async initLive() {
  2543. this.liveObj = await this.getLiveUid(this.playChannelId);
  2544. this.initLiveOk = true;
  2545. let optionsData = {};
  2546. optionsData.mode = "live";
  2547. optionsData.forceVideo = false;
  2548. optionsData.channelId = this.playChannelId; // 频道ID '2553128'
  2549. optionsData.openId = this.userInfo.userAccount; // 用户openId this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
  2550. optionsData.userId = this.liveObj.uid; // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq'
  2551. let self = this;
  2552. this.closePlv();
  2553. plv.init(optionsData).then(({ detail, chat }) => {
  2554. self.liveDetail = detail;
  2555. // 设置mode为live的videoOption
  2556. this.setLiveOption();
  2557. if (detail.isPPT) {
  2558. chat.on(chat.events.SLICESTART, () => {
  2559. // 开始直播
  2560. });
  2561. } else {
  2562. plv.api.getOrdinaryLiveStatus(detail.stream);
  2563. }
  2564. });
  2565. },
  2566. openSetting(res) {
  2567. console.log(res, 98);
  2568. },
  2569. getCameraSetting() {
  2570. const self = this;
  2571. // 不支持h5
  2572. wx.getSetting({
  2573. success: (res) => {
  2574. if (res.authSetting["scope.camera"]) {
  2575. // 用户已经授权
  2576. self.showSet = false;
  2577. this.prendreAutoCarme = false;
  2578. } else {
  2579. this.prendreAutoCarme = true;
  2580. // 用户还没有授权,向用户发起授权请求
  2581. wx.authorize({
  2582. scope: "scope.camera",
  2583. success: () => {
  2584. // 用户同意授权
  2585. self.showSet = false;
  2586. this.prendreAutoCarme = false;
  2587. },
  2588. fail: () => {
  2589. // 用户不同意授权
  2590. self.showSet = true;
  2591. },
  2592. });
  2593. }
  2594. },
  2595. fail: (res) => {},
  2596. });
  2597. },
  2598. studyNotice() {
  2599. this.noticeShow = true;
  2600. },
  2601. //播放笔记视频
  2602. async playNoteVideo(item) {
  2603. if (this.timer) {
  2604. clearInterval(this.timer);
  2605. }
  2606. if (this.vid) {
  2607. //切换视频
  2608. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2609. polyvPlayerContext.changeVid(item.recordingUrl);
  2610. } else {
  2611. this.vid = item.recordingUrl;
  2612. }
  2613. this.recordObj = { videoCurrentTime: item.noteSecond };
  2614. if (this.recordObj.videoCurrentTime) {
  2615. this.needSeek = true; //需要跳转到播放记录
  2616. }
  2617. this.startStatus = true;
  2618. //获取节笔记
  2619. this.getNoteList();
  2620. },
  2621. //正常播放视频
  2622. async playVideo(item) {
  2623. if (this.timer) {
  2624. clearInterval(this.timer);
  2625. }
  2626. // #ifdef H5
  2627. await this.clears();
  2628. // #endif
  2629. if (this.vid) {
  2630. //切换视频
  2631. polyvPlayerContext && polyvPlayerContext.changeVid(item.recordingUrl);
  2632. } else {
  2633. this.vid = item.recordingUrl;
  2634. }
  2635. this.recordObj = null;
  2636. this.recordObj = await this.getRecordLast();
  2637. this.needSeek = true; //跳转到播放记录
  2638. this.startStatus = true;
  2639. // #ifdef H5
  2640. await this.loadPlayerScript(this.loadPlayer);
  2641. // #endif
  2642. // 提交学习记录
  2643. // #ifdef MP-WEIXIN
  2644. this.postStudyRecord(0);
  2645. // #endif
  2646. //获取节笔记
  2647. this.getNoteList();
  2648. },
  2649. getRecordLast() {
  2650. return new Promise((resolve) => {
  2651. let data = {
  2652. gradeId:
  2653. this.gradeId || this.gradeId == 0 ? Number(this.gradeId) : null,
  2654. goodsId:
  2655. this.goodsId || this.goodsId == 0 ? Number(this.goodsId) : null,
  2656. sectionId: this.playSectionId || 0,
  2657. courseId:
  2658. this.courseId || this.courseId == 0 ? Number(this.courseId) : null,
  2659. chapterId: this.chapterId || 0,
  2660. moduleId: this.moduleId || 0,
  2661. orderGoodsId: this.orderGoodsId,
  2662. };
  2663. this.$api.recordLast(data).then((res) => {
  2664. resolve(res.data.data);
  2665. });
  2666. });
  2667. },
  2668. jumpNote(item) {
  2669. this.noteId = item.noteId;
  2670. //没视频播放
  2671. if (this.playSectionId == 0) {
  2672. this.$u.toast("即将跳到笔记位置");
  2673. this.$store.commit("setPlaySectionId", {
  2674. playSectionId: item.sectionId || item.menuId,
  2675. });
  2676. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  2677. this.playNoteVideo(item);
  2678. } else {
  2679. //正在看当前笔记视频
  2680. this.$u.toast("即将跳到笔记位置");
  2681. //跳到笔记时刻
  2682. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2683. // #ifdef MP-WEIXIN
  2684. polyvPlayerContext.seek(item.noteSecond);
  2685. polyvPlayerContext.play();
  2686. // #endif
  2687. // #ifdef H5
  2688. polyvPlayerContext.j2s_seekVideo(0);
  2689. polyvPlayerContext.j2s_resumeVideo();
  2690. // #endif
  2691. }
  2692. },
  2693. postNote() {
  2694. let self = this;
  2695. if (!(this.playSectionId > 0)) {
  2696. this.$u.toast("目前无播放视频");
  2697. return;
  2698. }
  2699. if (!this.noteValue) {
  2700. this.$u.toast("请输入内容");
  2701. return;
  2702. }
  2703. if (!this.gradeId) {
  2704. this.$u.toast("暂无班级数据");
  2705. return;
  2706. }
  2707. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2708. let noteDate = this.$method.getZeroTime();
  2709. let noteSecond = 0;
  2710. // #ifdef MP-WEIXIN
  2711. noteSecond = polyvPlayerContext.getCurrentTime();
  2712. // #endif
  2713. // #ifdef H5
  2714. noteSecond = polyvPlayerContext.j2s_getCurrentTime();
  2715. // #endif
  2716. if (!noteSecond) {
  2717. if (noteSecond == 0) {
  2718. //播放结束
  2719. // #ifdef MP-WEIXIN
  2720. noteSecond = polyvPlayerContext.getDuration();
  2721. // #endif
  2722. // #ifdef H5
  2723. noteSecond = polyvPlayerContext.j2s_getCurrentTime();
  2724. // #endif
  2725. }
  2726. if (!noteSecond) {
  2727. this.$u.toast("视频暂未开始");
  2728. return;
  2729. }
  2730. }
  2731. let data = {
  2732. gradeId: this.gradeId,
  2733. goodsId: this.goodsId,
  2734. sectionId: this.playSectionId,
  2735. courseId: this.courseId,
  2736. noteText: this.noteValue,
  2737. noteDate: noteDate,
  2738. noteSecond: noteSecond,
  2739. orderGoodsId: this.orderGoodsId,
  2740. };
  2741. this.$api.postNote(data).then((res) => {
  2742. if (res.data.code == 200) {
  2743. this.$u.toast("发布成功");
  2744. self.getNoteList();
  2745. this.noteValue = "";
  2746. }
  2747. });
  2748. },
  2749. getGradeInfo() {
  2750. let self = this;
  2751. this.$store.state.allowLoading = false;
  2752. this.$api.goodsGradeInfo(this.gradeId).then((res) => {
  2753. if (res.data.code == 200) {
  2754. self.gradeDetail = res.data.data;
  2755. if (self.needProfileModal) {
  2756. return;
  2757. }
  2758. if (self.gradeDetail.learningStatus == 2) {
  2759. uni.showModal({
  2760. showCancel: false,
  2761. confirmText: "确定",
  2762. content:
  2763. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  2764. success: function (resultst) {
  2765. uni.navigateBack();
  2766. },
  2767. });
  2768. }
  2769. if (
  2770. self.gradeDetail.learningStatus == 3 &&
  2771. Number(self.gradeDetail.learningTimeStart) >
  2772. Number(new Date() / 1000)
  2773. ) {
  2774. uni.showModal({
  2775. showCancel: false,
  2776. cancelText: "返回",
  2777. content:
  2778. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  2779. success: function (resultst) {
  2780. uni.navigateBack();
  2781. },
  2782. });
  2783. }
  2784. }
  2785. });
  2786. this.$store.state.allowLoading = true;
  2787. },
  2788. getNoteList() {
  2789. let self = this;
  2790. self.noteList = [];
  2791. let data = {
  2792. courseId: this.courseId,
  2793. gradeId: this.gradeId,
  2794. goodsId: this.goodsId,
  2795. orderGoodsId: this.orderGoodsId,
  2796. };
  2797. if (this.playSectionId > 0) {
  2798. data.sectionId = this.playSectionId;
  2799. }
  2800. this.$api.noteList(data).then((res) => {
  2801. if (res.data.code == 200) {
  2802. self.noteList = res.data.rows;
  2803. }
  2804. });
  2805. },
  2806. delAnswer(answerId) {
  2807. let self = this;
  2808. let data = {
  2809. answerId: answerId,
  2810. status: -1,
  2811. orderGoodsId: this.orderGoodsId,
  2812. };
  2813. this.$api.delAnswer(data).then((res) => {
  2814. if (res.data.code == 200) {
  2815. self.getAnswerList();
  2816. }
  2817. });
  2818. },
  2819. clearCtx() {
  2820. this.placeholder = "您可以在这里输入答疑内容";
  2821. this.ctxValue = "";
  2822. this.assignUserId = 0;
  2823. },
  2824. focusNote(event) {
  2825. this.bottomHeight = event.detail.height;
  2826. },
  2827. blurNote() {
  2828. this.bottomHeight = 0;
  2829. },
  2830. blur() {
  2831. this.bottomHeight = 0;
  2832. this.clearTimer = setTimeout(() => {
  2833. this.ctxValue = "";
  2834. this.isFocus = false;
  2835. this.assignUserId = 0;
  2836. this.placeholder = "您可以在这里输入答疑内容";
  2837. }, 2000);
  2838. },
  2839. replyContent(item) {
  2840. this.isFocus = true;
  2841. this.assignUserId = item.userId;
  2842. this.placeholder = "@" + item.realname;
  2843. },
  2844. delContent(item) {
  2845. this.delAnswer(item.answerId);
  2846. },
  2847. postAnswer() {
  2848. let self = this;
  2849. let data = {
  2850. courseId: this.courseId,
  2851. answerText: this.ctxValue,
  2852. goodsId: this.goodsId,
  2853. orderGoodsId: this.orderGoodsId,
  2854. };
  2855. if (this.assignUserId > 0) {
  2856. data.assignUserId = this.assignUserId;
  2857. }
  2858. this.$api.postAnswer(data).then((res) => {
  2859. if (res.data.code == 200) {
  2860. this.$u.toast("发布成功");
  2861. self.getAnswerList();
  2862. this.isFocus = false;
  2863. this.placeholder = "您可以在这里输入答疑内容";
  2864. this.ctxValue = "";
  2865. this.assignUserId = 0;
  2866. }
  2867. });
  2868. },
  2869. postContent() {
  2870. if (!this.ctxValue || this.ctxValue == "") {
  2871. this.$u.toast("请输入内容");
  2872. return;
  2873. }
  2874. this.postAnswer();
  2875. },
  2876. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  2877. let currentTime = 0;
  2878. let PlayDuration = 0;
  2879. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2880. if (polyvPlayerContext) {
  2881. // #ifdef MP-WEIXIN
  2882. currentTime = polyvPlayerContext.getCurrentTime(); //获取视频当前的播放时刻
  2883. PlayDuration = polyvPlayerContext.getVideoPlayDuration(); //本次看的时长
  2884. // #endif
  2885. // #ifdef H5
  2886. currentTime = polyvPlayerContext.j2s_getCurrentTime(); //当前视频播放时刻
  2887. PlayDuration = polyvPlayerContext.j2s_realPlayVideoTime(); //本次看的时长
  2888. // #endif
  2889. }
  2890. if (currentTime < 15) {
  2891. return;
  2892. }
  2893. if (this.playChannelId > 0) {
  2894. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  2895. }
  2896. let self = this;
  2897. let data = {
  2898. fromPlat: 1, //来源平台 1小程序 2网站
  2899. photo: self.ossAvatarUrl,
  2900. sectionId: sectionId || 0,
  2901. goodsId: parseInt(self.goodsId),
  2902. courseId: parseInt(self.courseId),
  2903. orderGoodsId: this.orderGoodsId,
  2904. studyDuration: parseInt(
  2905. PlayDuration > 0 ? PlayDuration : self.studyDuration
  2906. ),
  2907. gradeId: parseInt(self.gradeId),
  2908. chapterId: this.chapterId || 0,
  2909. moduleId: this.moduleId || 0,
  2910. videoCurrentTime: parseInt(
  2911. currentTime > 0 ? currentTime : self.studyDuration
  2912. ),
  2913. erJianErZao: this.erJianErZao,
  2914. };
  2915. if (this.ossAvatarUrl) {
  2916. data.similarity = this.compareFaceData; // 相似度
  2917. }
  2918. if (status > 0) {
  2919. data.status = status;
  2920. }
  2921. console.log(data, "记录参数");
  2922. return new Promise((resolve, reject) => {
  2923. this.$api
  2924. .studyRecord(data)
  2925. .then((res) => {
  2926. console.log(res, "记录返回");
  2927. let { code } = res.data;
  2928. if (code == 200) {
  2929. if (status > 0) {
  2930. this.studyRecordMenuAllList();
  2931. let moduleId = this.moduleId || 0;
  2932. let chapterId = this.chapterId || 0;
  2933. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  2934. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  2935. uni.$emit("playNext" + playNextIdisRebuild, {
  2936. fromRebuild: this.isRebuild,
  2937. }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  2938. uni.$emit("playNext" + playNextId); //通知播放结束
  2939. }
  2940. self.ossAvatarUrl = "";
  2941. } else if (code == 600) {
  2942. uni.showModal({
  2943. showCancel: false,
  2944. title: "提示",
  2945. content: res.data.msg,
  2946. success: (resultst) => {
  2947. uni.navigateBack();
  2948. },
  2949. });
  2950. } else {
  2951. this.uploadLock = false;
  2952. uni.showToast({
  2953. icon: "none",
  2954. title: res.data.msg,
  2955. duration: 2000,
  2956. });
  2957. if (this.erJianErZao && code == 559) {
  2958. this.isReach = true;
  2959. this.openPhoto();
  2960. }
  2961. if (code == 559 || code == 588) {
  2962. reject("中断执行");
  2963. }
  2964. }
  2965. resolve();
  2966. })
  2967. .catch((err) => {
  2968. this.studyRecordMenuAllList();
  2969. });
  2970. });
  2971. },
  2972. uploadFile(options, int) {
  2973. var self = this;
  2974. return new Promise((resolve, reject) => {
  2975. var data = {
  2976. imageStatus: int,
  2977. gradeId: this.gradeId,
  2978. orderGoodsId: this.orderGoodsId,
  2979. };
  2980. self.$api.aliyunpolicy(data).then((res) => {
  2981. if (res.data.code != 200) {
  2982. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  2983. return;
  2984. }
  2985. var ossToken = res.data.data.resultContent;
  2986. if (ossToken.host == null || ossToken.host == undefined) {
  2987. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  2988. return;
  2989. }
  2990. let filePath = "";
  2991. // #ifdef H5
  2992. var localData = options; //dataUrl为base64位
  2993. let base = atob(localData.substring(localData.indexOf(",") + 1)); // base是将base64编码解码,去掉data:image/png;base64部分
  2994. let length = base.length;
  2995. let url = new Uint8Array(length);
  2996. while (length--) {
  2997. url[length] = base.charCodeAt(length);
  2998. }
  2999. filePath = new File([url], "a.jpg", {
  3000. type: "image/jpg",
  3001. });
  3002. uni.uploadFile({
  3003. url: ossToken.host,
  3004. name: "file",
  3005. file: filePath,
  3006. fileType: "image",
  3007. header: {
  3008. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  3009. },
  3010. formData: {
  3011. key: ossToken.dir,
  3012. OSSAccessKeyId: ossToken.accessid,
  3013. policy: ossToken.policy,
  3014. Signature: ossToken.signature,
  3015. callback: ossToken.callback,
  3016. success_action_status: 200,
  3017. },
  3018. success: (result) => {
  3019. this.$u.toast("上传成功");
  3020. self.ossAvatarUrl = ossToken.dir;
  3021. resolve();
  3022. },
  3023. fail: (error) => {
  3024. uni.showToast({
  3025. title: "上传接口报错,请重新拍照上传" + error,
  3026. icon: "none",
  3027. });
  3028. this.openPhoto();
  3029. return;
  3030. },
  3031. });
  3032. // #endif
  3033. // #ifdef MP-WEIXIN
  3034. uni.uploadFile({
  3035. url: ossToken.host,
  3036. name: "file",
  3037. filePath: options,
  3038. fileType: "image",
  3039. header: {
  3040. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  3041. },
  3042. formData: {
  3043. key: ossToken.dir,
  3044. OSSAccessKeyId: ossToken.accessid,
  3045. policy: ossToken.policy,
  3046. Signature: ossToken.signature,
  3047. callback: ossToken.callback,
  3048. success_action_status: 200,
  3049. },
  3050. success: (result) => {
  3051. // if (result.statusCode === 200) {
  3052. this.$u.toast("上传成功");
  3053. self.ossAvatarUrl = ossToken.dir;
  3054. resolve();
  3055. },
  3056. fail: (error) => {
  3057. uni.showToast({
  3058. title: "上传接口报错,请重新拍照上传" + error,
  3059. icon: "none",
  3060. });
  3061. this.openPhoto();
  3062. return;
  3063. },
  3064. });
  3065. // #endif
  3066. });
  3067. });
  3068. },
  3069. imageInfos() {
  3070. var self = this;
  3071. return new Promise(async (resolve, reject) => {
  3072. // #ifdef MP-WEIXIN
  3073. uni.getImageInfo({
  3074. src: self.avatarUrl,
  3075. success: async (res) => {
  3076. let canvasWidth = res.width; //图片原始长宽
  3077. let canvasHeight = res.height;
  3078. if (canvasWidth > 2000 || canvasHeight > 2000) {
  3079. // h5不支持
  3080. uni.compressImage({
  3081. src: self.avatarUrl,
  3082. quality: 75,
  3083. width: "35%",
  3084. height: "35%",
  3085. success: async (rest) => {
  3086. const waitUpload = await self.uploadFile(
  3087. rest.tempFilePath,
  3088. 0
  3089. );
  3090. resolve(waitUpload);
  3091. },
  3092. });
  3093. } else if (canvasWidth > 1000 || canvasHeight > 1000) {
  3094. uni.compressImage({
  3095. src: self.avatarUrl,
  3096. quality: 75,
  3097. width: "50%",
  3098. height: "50%",
  3099. success: async (rest) => {
  3100. const waitUpload = await self.uploadFile(
  3101. rest.tempFilePath,
  3102. 0
  3103. );
  3104. resolve(waitUpload);
  3105. },
  3106. });
  3107. } else {
  3108. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  3109. resolve(waitUpload);
  3110. }
  3111. },
  3112. fail: (err) => {
  3113. this.$u.toast("图片上传失败");
  3114. },
  3115. });
  3116. // #endif
  3117. // #ifdef H5
  3118. const waitUpload = await this.uploadFile(this.faceUrl, 0);
  3119. resolve(waitUpload);
  3120. // #endif
  3121. });
  3122. },
  3123. timeEvent() {
  3124. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3125. if (polyvPlayerContext != null) {
  3126. // #ifdef MP-WEIXIN
  3127. this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
  3128. // #endif
  3129. // #ifdef H5
  3130. this.playTime = polyvPlayerContext.j2s_getCurrentTime();
  3131. // #endif
  3132. this.configPhoto();
  3133. console.info(this.photoList, "photoList");
  3134. let photoTime = 0; //获取拍照秒数
  3135. for (let i = 0; i < this.photoList.length; i++) {
  3136. photoTime = Number(this.photoList[i]); //获取拍照秒数
  3137. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  3138. //3秒区间内才触发拍照,避免拉动滚动条
  3139. if (this.photoHistoryList.indexOf(i) < 0) {
  3140. //不存在拍照历史,没有重修过,没有学过,则拍照
  3141. //启动拍照
  3142. //暂停
  3143. console.log("去拍照");
  3144. // #ifdef MP-WEIXIN
  3145. polyvPlayerContext.exitFullScreen();
  3146. polyvPlayerContext.pause();
  3147. // #endif
  3148. // #ifdef H5
  3149. polyvPlayerContext.j2s_pauseVideo();
  3150. polyvPlayerContext.toggleFullscreen();
  3151. // #endif
  3152. this.photoIndex = i;
  3153. if (
  3154. uni.getStorageSync(`tabkePhotoShow${this.goodsId}`) ==
  3155. this.goodsId
  3156. ) {
  3157. this.openPhoto();
  3158. } else {
  3159. this.popupPhotoShow = true;
  3160. uni.setStorageSync(
  3161. `tabkePhotoShow${this.goodsId}`,
  3162. this.goodsId
  3163. ); // 本地缓存用来判断是否已经弹出过弹窗
  3164. }
  3165. }
  3166. }
  3167. }
  3168. }
  3169. },
  3170. closeToast() {
  3171. clearTimeout(this.toastTimer);
  3172. this.videoToastShow = false;
  3173. },
  3174. restart() {
  3175. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3176. // #ifdef MP-WEIXIN
  3177. polyvPlayerContext.seek(0);
  3178. // #endif
  3179. // #ifdef H5
  3180. polyvPlayerContext.j2s_seekVideo(0);
  3181. // #endif
  3182. clearTimeout(this.toastTimer);
  3183. this.videoToastShow = false;
  3184. },
  3185. // 新增用户视频学习日志
  3186. studyLog() {
  3187. this.$http({
  3188. url: "/user/study/log",
  3189. method: "post",
  3190. data: {
  3191. goodsId: this.goodsId,
  3192. courseId: this.courseId,
  3193. moduleId: this.moduleId || 0,
  3194. chapterId: this.chapterId || 0,
  3195. sectionId: this.playSectionId || 0,
  3196. fromPlat: 1, //来源平台 1小程序 2PC网站
  3197. goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  3198. orderGoodsId: this.orderGoodsId,
  3199. },
  3200. }).then((res) => {});
  3201. },
  3202. async onStateChange(newstate, oldstate) {
  3203. polyvPlayerContext = this.selectComponent("#playerVideo");
  3204. if (newstate.detail.newstate == "playing") {
  3205. console.log("播放");
  3206. if (this.needSeek) {
  3207. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3208. if (this.recordObj.videoCurrentTime) {
  3209. polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
  3210. this.seekTime = this.$method.secondToDate(
  3211. this.recordObj.videoCurrentTime
  3212. );
  3213. this.videoToastShow = true;
  3214. this.toastTimer = setTimeout(() => {
  3215. this.videoToastShow = false;
  3216. }, 3000);
  3217. } else {
  3218. polyvPlayerContext.seek(1); //避免相同节继续播放
  3219. }
  3220. polyvPlayerContext.play();
  3221. this.needSeek = false;
  3222. // 新增用户视频学习日志
  3223. this.studyLog();
  3224. // 提交学习记录
  3225. }
  3226. //开始播放
  3227. this.timer && clearInterval(this.timer);
  3228. if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
  3229. this.clearPauseTimer();
  3230. this.isReach = false;
  3231. this.timer = setInterval(this.timeEvent, 1000); //定时器
  3232. }
  3233. }
  3234. if (newstate.detail.newstate == "pause") {
  3235. console.log("暂停");
  3236. this.erJianErZaoPauseTip();
  3237. clearInterval(this.timer);
  3238. //暂停提交记录
  3239. }
  3240. if (newstate.detail.newstate == "ended") {
  3241. clearInterval(this.timer);
  3242. uni.showToast({
  3243. icon: "none",
  3244. title: "播放完毕",
  3245. });
  3246. this.hasStart = false;
  3247. await this.postStudyRecord(1);
  3248. this.nextSection();
  3249. }
  3250. },
  3251. //播放下一节
  3252. nextSection() {
  3253. console.log("播放下一节");
  3254. if (!this.menuAllList.length) {
  3255. return;
  3256. }
  3257. this.curPlayIndex = this.menuAllList.findIndex((item) => {
  3258. let i_sectionId = item.sectionId || 0;
  3259. let i_chapterId = item.chapterId || 0;
  3260. let i_moduleId = item.moduleId || 0;
  3261. return (
  3262. i_sectionId == this.playSectionId &&
  3263. i_chapterId == this.chapterId &&
  3264. i_moduleId == this.moduleId
  3265. );
  3266. });
  3267. let data = this.menuAllList[this.curPlayIndex + 1];
  3268. if (!data) {
  3269. //第二个弹窗
  3270. uni.showModal({
  3271. title: "温馨提示",
  3272. content: "当前最后一节视频已学完 请检查所有章节是否学习完成?",
  3273. showCancel: false,
  3274. success: (res) => {
  3275. if (res.confirm) {
  3276. }
  3277. },
  3278. });
  3279. } else {
  3280. if (data.doType == 2) {
  3281. uni.showModal({
  3282. title: "温馨提示",
  3283. content: "当前节视频已学完,是否进入考试?",
  3284. success: (res) => {
  3285. if (res.confirm) {
  3286. this.toQuestionBank(data);
  3287. }
  3288. },
  3289. });
  3290. return;
  3291. }
  3292. uni.showModal({
  3293. title: "温馨提示",
  3294. content: "当前节视频已学完,继续学习下一节?",
  3295. success: async (res) => {
  3296. if (res.confirm) {
  3297. this.moduleId = data.moduleId;
  3298. this.chapterId = data.chapterId;
  3299. this.sectionId = data.sectionId;
  3300. if (data.sectionType == 1) {
  3301. //录播
  3302. this.$store.commit("setPlaySectionId", {
  3303. playSectionId: data.sectionId,
  3304. });
  3305. this.$store.commit("setPlayVID", {
  3306. playVID: data.recordingUrl,
  3307. });
  3308. this.hasStart = false;
  3309. this.photoConfig = false;
  3310. this.photoIndex = 0;
  3311. this.sectionItem = data;
  3312. await this.getPhotoLastRecord(); // 获取拍照历史
  3313. this.playVideo(data);
  3314. } else if (data.sectionType == 2) {
  3315. //直播
  3316. this.studyRecordGetLastLive();
  3317. } else if (data.sectionType == 3) {
  3318. //回放
  3319. this.$store.commit("setPlaySectionId", {
  3320. playSectionId: data.sectionId,
  3321. });
  3322. this.$store.commit("setPlayVID", {
  3323. playVID: data.recordingUrl,
  3324. });
  3325. this.sectionItem = data;
  3326. this.playVideo(data);
  3327. }
  3328. let playNextId = `moduleId${data.moduleId}chapterId${data.chapterId}sectionId${data.sectionId}`;
  3329. this.$store.commit("updatePlayNextId", playNextId);
  3330. this.updateChapterOpen(true);
  3331. this.reStart = false;
  3332. this.getMenuList();
  3333. }
  3334. },
  3335. });
  3336. }
  3337. },
  3338. //拍照
  3339. openPhoto() {
  3340. if (polyvPlayerContext) {
  3341. // #ifdef MP-WEIXIN
  3342. polyvPlayerContext.exitFullScreen();
  3343. // #endif
  3344. // #ifdef H5
  3345. if (this.isFullScreen()) {
  3346. this.exitFullscreen();
  3347. }
  3348. // #endif
  3349. }
  3350. // #ifdef MP-WEIXIN
  3351. this.enableAutoRotation = false;
  3352. this.photoPopup = true;
  3353. this.isTaking = true;
  3354. uni.setKeepScreenOn({
  3355. keepScreenOn: true,
  3356. });
  3357. uni.authorize({
  3358. scope: "scope.camera",
  3359. success() {},
  3360. });
  3361. // #endif
  3362. // #ifdef H5
  3363. if (
  3364. (window.navigator.mediaDevices &&
  3365. window.navigator.mediaDevices.getUserMedia) ||
  3366. window.navigator.getUserMedia ||
  3367. window.navigator.webkitGetUserMedia ||
  3368. window.navigator.mozGetUserMedia
  3369. ) {
  3370. console.log("getUserMedia----");
  3371. // 调用用户媒体设备, 访问摄像头
  3372. this.getUserMedia(
  3373. {
  3374. video: {
  3375. width: 400,
  3376. height: 300,
  3377. },
  3378. },
  3379. this.photographSuccess,
  3380. this.photographError
  3381. );
  3382. } else {
  3383. console.log("1111没有摄像");
  3384. this.photographError();
  3385. }
  3386. // #endif
  3387. },
  3388. /**
  3389. * 人脸匹配
  3390. */
  3391. faceRecognition() {
  3392. return new Promise((resolve) => {
  3393. // #ifdef MP-WEIXIN
  3394. let fileSystem = uni.getFileSystemManager();
  3395. fileSystem.readFile({
  3396. filePath: `${this.avatarUrl}`,
  3397. encoding: "base64",
  3398. position: 0,
  3399. success: (res) => {
  3400. let base64 = "data:image/jpg;base64," + res.data;
  3401. // console.log('base64Data人脸识别参数:', {
  3402. // imageA: base64,
  3403. // orderGoodsId: this.orderGoodsId,
  3404. // gradeId: this.gradeId,
  3405. // })
  3406. this.CompareFace(base64, resolve);
  3407. },
  3408. fail(err) {
  3409. // this.$u.toast('人脸识别错误!')
  3410. console.error(err, "err-----人脸识别错误");
  3411. },
  3412. });
  3413. // #endif
  3414. // #ifdef H5
  3415. this.CompareFace(this.faceUrl, resolve);
  3416. // #endif
  3417. });
  3418. },
  3419. CompareFace(url, resolve) {
  3420. let timer = setTimeout(() => {
  3421. uni.showToast({
  3422. icon: "none",
  3423. title: "拍照超时,请重新拍照",
  3424. duration: 2000,
  3425. success: () => {
  3426. setTimeout(() => {
  3427. uni.navigateBack();
  3428. }, 1000);
  3429. },
  3430. });
  3431. }, 10 * 1000);
  3432. this.$api
  3433. .faceCertificationCompareFace({
  3434. imageA: url,
  3435. orderGoodsId: this.orderGoodsId,
  3436. gradeId: this.gradeId,
  3437. })
  3438. .then((res) => {
  3439. clearTimeout(timer);
  3440. console.log(res, "人脸识别成功res");
  3441. resolve(res.data.data);
  3442. })
  3443. .catch((err) => {
  3444. clearTimeout(timer);
  3445. // 当前网络延迟,
  3446. console.log("人脸识别错误:", err);
  3447. uni.showModal({
  3448. content: "当前网络延迟",
  3449. showCancel: false,
  3450. success: (resultst) => {
  3451. if (resultst.confirm) {
  3452. uni.navigateBack();
  3453. }
  3454. },
  3455. });
  3456. });
  3457. },
  3458. // 确定拍照
  3459. async submit() {
  3460. if (this.uploadLock) {
  3461. return;
  3462. }
  3463. this.uploadLock = true;
  3464. let compareFaceData = await this.faceRecognition();
  3465. console.log(compareFaceData, "compareFaceData");
  3466. this.compareFaceData = compareFaceData;
  3467. if (compareFaceData >= 80) {
  3468. const waitYS = await this.imageInfos();
  3469. this.postCoursePhotoRecord()
  3470. .then(async (res) => {
  3471. this.photoHistoryList.push(this.photoIndex);
  3472. // console.log('拍照确定提交', this.photoHistoryList);
  3473. this.postStudyRecord(); //提交记录
  3474. if (this.erJianErZao && this.isReach) {
  3475. console.log("1校验");
  3476. await this.postStudyRecord(1);
  3477. this.photoPopup = false;
  3478. this.uploadLock = false;
  3479. this.enableAutoRotation = true;
  3480. this.nextSection();
  3481. return;
  3482. }
  3483. //恢复播放
  3484. // #ifdef MP-WEIXIN
  3485. uni.setKeepScreenOn({
  3486. keepScreenOn: false,
  3487. });
  3488. // #endif
  3489. this.photoPopup = false;
  3490. this.uploadLock = false;
  3491. this.enableAutoRotation = true;
  3492. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3493. if (polyvPlayerContext != null) {
  3494. // #ifdef MP-WEIXIN
  3495. polyvPlayerContext.play();
  3496. // #endif
  3497. // #ifdef H5
  3498. polyvPlayerContext.j2s_resumeVideo();
  3499. // #endif
  3500. }
  3501. })
  3502. .catch((err) => {
  3503. console.log("拍照记录接口的err", err);
  3504. uni.showToast({
  3505. title: "上传接口报错,请重新拍照上传" + err,
  3506. icon: "none",
  3507. });
  3508. this.uploadLock = false;
  3509. this.openPhoto();
  3510. });
  3511. } else {
  3512. uni.showToast({
  3513. title: "人脸匹配不通过,请重新拍照上传",
  3514. icon: "none",
  3515. duration: 2000,
  3516. });
  3517. setTimeout(() => {
  3518. this.uploadLock = false;
  3519. this.openPhoto();
  3520. }, 2000);
  3521. }
  3522. },
  3523. reTake() {
  3524. this.isTaking = true;
  3525. // #ifdef H5
  3526. this.faceUrl = "";
  3527. this.getUserMedia(
  3528. {
  3529. video: {
  3530. width: 400,
  3531. height: 300,
  3532. },
  3533. },
  3534. this.photographSuccess,
  3535. this.photographError
  3536. );
  3537. // #endif
  3538. },
  3539. toTakePhoto() {
  3540. this.popupPhotoShow = false;
  3541. this.openPhoto();
  3542. },
  3543. takePhTips() {
  3544. this.popupPhotoShow = true;
  3545. this.isTaking = false;
  3546. this.photoPopup = false;
  3547. this.enableAutoRotation = false;
  3548. },
  3549. //确认拍照
  3550. takePhoto() {
  3551. // #ifdef MP-WEIXIN
  3552. const ctx = uni.createCameraContext();
  3553. ctx.takePhoto({
  3554. quality: "high",
  3555. success: (res) => {
  3556. this.avatarUrl = res.tempImagePath;
  3557. console.log("开始拍照this.avatarUrl:", this.avatarUrl);
  3558. this.isTaking = false;
  3559. },
  3560. fail: (err) => {},
  3561. });
  3562. // #endif
  3563. // #ifdef H5
  3564. const canvas = document.createElement("canvas");
  3565. canvas.width = 400;
  3566. canvas.height = 400;
  3567. const context = canvas.getContext("2d");
  3568. const video = document.querySelector("video");
  3569. context.drawImage(video, 0, 0, 400, 400);
  3570. this.faceUrl = canvas.toDataURL("image/png");
  3571. this.isTaking = false;
  3572. // #endif
  3573. },
  3574. playError(e) {
  3575. console.log(e);
  3576. },
  3577. //拍照报错
  3578. error(e) {
  3579. console.log(e.detail);
  3580. },
  3581. //关闭相机
  3582. closePhoto() {
  3583. this.photoPopup = false;
  3584. self.enableAutoRotation = true;
  3585. },
  3586. /**
  3587. * 进入全屏
  3588. */
  3589. fullscreenchange(event) {
  3590. if (event.detail.direction == "vertical") {
  3591. this.navShow = true;
  3592. } else if (event.detail.direction == "horizontal") {
  3593. this.navShow = false;
  3594. }
  3595. },
  3596. checkFinishRequiredCourse() {
  3597. return this.$api
  3598. .checkFinishRequiredCourse({
  3599. businessId: this.goodsData.businessId,
  3600. goodsId: this.goodsId,
  3601. })
  3602. .then((res) => {
  3603. if (res.data.data > 0) {
  3604. uni.showModal({
  3605. showCancel: false,
  3606. confirmText: "确定",
  3607. content: "该业务层次下有未学完的商品,无法学习新商品!",
  3608. success: function (resultst) {
  3609. uni.navigateBack();
  3610. },
  3611. });
  3612. return Promise.reject();
  3613. }
  3614. return Promise.resolve();
  3615. });
  3616. },
  3617. getGoodsDetail() {
  3618. let self = this;
  3619. // '/goods/'+ data,
  3620. this.$api.goodsDetail(this.goodsId).then(async (res) => {
  3621. this.goodsData = res.data.data;
  3622. // await this.checkFinishRequiredCourse();
  3623. if (self.goodsData.buyNote) {
  3624. this.baseHandoutTipList();
  3625. }
  3626. self.gradeId = self.goodsData.gradeId;
  3627. self.erJianErZao = self.goodsData.erJianErZao;
  3628. this.courseBusiness(this.goodsData.businessId);
  3629. self.getMenuList();
  3630. self.getReMenuList(); //获取重修目录
  3631. setTimeout(function () {
  3632. if (!self.needProfileModal) {
  3633. self.getGradeInfo();
  3634. }
  3635. }, 500);
  3636. //获取节笔记
  3637. this.getNoteList();
  3638. if (self.goodsData.goodsPlayConfig) {
  3639. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  3640. if (self.goodsPlayConfig.autoPlay > 0) {
  3641. // #ifdef H5
  3642. self.autoplay = true;
  3643. // #endif
  3644. }
  3645. if (self.goodsPlayConfig.drag > 0 && !self.erJianErZao) {
  3646. // #ifdef MP-WEIXIN
  3647. self.isAllowSeek = "yes";
  3648. // #endif
  3649. // #ifdef H5
  3650. self.H5isAllowSeek = "off";
  3651. // #endif
  3652. }
  3653. if (self.goodsPlayConfig.speed > 0) {
  3654. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  3655. }
  3656. }
  3657. if (self.goodsData.goodsPhotographConfig) {
  3658. self.goodsPhotographConfig = JSON.parse(
  3659. self.goodsData.goodsPhotographConfig
  3660. );
  3661. if (self.goodsPhotographConfig.photoNum > 0) {
  3662. self.photoNum = self.goodsPhotographConfig.photoNum;
  3663. }
  3664. }
  3665. });
  3666. },
  3667. startVideo() {
  3668. this.startStatus = true;
  3669. },
  3670. getAnswerList() {
  3671. let self = this;
  3672. this.$api
  3673. .answerList({
  3674. courseId: this.courseId,
  3675. goodsId: this.goodsId,
  3676. orderGoodsId: this.orderGoodsId,
  3677. })
  3678. .then((res) => {
  3679. if (res.data.code == 200) {
  3680. self.answerList = res.data.rows;
  3681. }
  3682. });
  3683. },
  3684. getReMenuList() {
  3685. // console.log('重修的目录');
  3686. let self = this;
  3687. this.$api
  3688. .reMenuList({
  3689. orderGoodsId: this.orderGoodsId,
  3690. courseId: this.courseId,
  3691. rebuild: 1,
  3692. gradeId: this.gradeId,
  3693. })
  3694. .then((res) => {
  3695. if (res.data.code == 200) {
  3696. for (let i = 0; i < res.data.rows.length; i++) {
  3697. let item = res.data.rows[i];
  3698. item.down = true;
  3699. item.id = item.menuId;
  3700. item.name = item.menuName;
  3701. }
  3702. self.reMenuList = res.data.rows;
  3703. if (self.reMenuList.length > 0) {
  3704. this.showNotes = false;
  3705. self.list = [
  3706. {
  3707. name: "目录",
  3708. },
  3709. {
  3710. name: "讲义",
  3711. },
  3712. {
  3713. name: "笔记",
  3714. },
  3715. {
  3716. name: "答疑",
  3717. },
  3718. { name: "重修目录" },
  3719. ];
  3720. this.current = 0;
  3721. if (Object.keys(this.sectionItem).length) {
  3722. let playNextIdisRebuild = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}isRebuild`;
  3723. this.$store.commit("updatePlayNextId", playNextIdisRebuild);
  3724. }
  3725. } else {
  3726. if (Object.keys(this.sectionItem).length) {
  3727. let playNextId = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}`;
  3728. this.$store.commit("updatePlayNextId", playNextId);
  3729. }
  3730. self.list = [
  3731. {
  3732. name: "目录",
  3733. },
  3734. {
  3735. name: "讲义",
  3736. },
  3737. {
  3738. name: "笔记",
  3739. },
  3740. {
  3741. name: "答疑",
  3742. },
  3743. ];
  3744. this.current = 0;
  3745. }
  3746. }
  3747. });
  3748. },
  3749. getMenuList() {
  3750. // console.log('menuList的目录');
  3751. let self = this;
  3752. // /course/menuList 查询课程目录结构列表
  3753. this.$api
  3754. .reMenuList({
  3755. courseId: this.courseId,
  3756. gradeId: this.gradeId,
  3757. orderGoodsId: this.orderGoodsId,
  3758. })
  3759. .then((res) => {
  3760. if (res.data.code == 200) {
  3761. for (let i = 0; i < res.data.rows.length; i++) {
  3762. let item = res.data.rows[i];
  3763. item.down = true;
  3764. item.id = item.menuId;
  3765. item.name = item.menuName;
  3766. item.menuType = item.type;
  3767. }
  3768. self.menuList = res.data.rows;
  3769. this.reStart = true;
  3770. for (let i = 0; i < res.data.rows.length; i++) {
  3771. if (res.data.rows[i].type == 1) {
  3772. // 模块
  3773. if (Object.keys(this.sectionItem).length) {
  3774. if (res.data.rows[i].menuId == this.sectionItem.moduleId) {
  3775. this.menuIndex = [i];
  3776. break;
  3777. }
  3778. } else {
  3779. this.menuIndex = [i];
  3780. break;
  3781. }
  3782. } else if (res.data.rows[i].type == 2) {
  3783. // 章
  3784. if (Object.keys(this.sectionItem).length) {
  3785. if (
  3786. res.data.rows[i].menuId == this.sectionItem.chapterId &&
  3787. (!this.sectionItem.moduleId ||
  3788. this.sectionItem.moduleId == 0)
  3789. ) {
  3790. this.menuIndex = [i];
  3791. break;
  3792. }
  3793. } else {
  3794. this.menuIndex = [i];
  3795. break;
  3796. }
  3797. }
  3798. }
  3799. // console.log('menuList: ---', this.menuList, 'menuIndex:', this.menuIndex);
  3800. }
  3801. });
  3802. },
  3803. courseDetail() {
  3804. let self = this;
  3805. // '/course/'+data,
  3806. this.$api.courseDetail(this.courseId).then((res) => {
  3807. if (res.data.code == 200) {
  3808. // if (res.data.data.educationName == "继续教育") {
  3809. this.$api
  3810. .lockLockAction({
  3811. action: "jxjy",
  3812. uuid: this.$method.getUuid(),
  3813. })
  3814. .then((res) => {});
  3815. this.lockTimer = setInterval(() => {
  3816. this.$api
  3817. .lockLockAction({
  3818. action: "jxjy",
  3819. uuid: this.$method.getUuid(),
  3820. })
  3821. .then((res) => {});
  3822. }, 10000);
  3823. // websocket.sendMsg("doCourse");
  3824. // }
  3825. self.detail = res.data.data;
  3826. }
  3827. });
  3828. },
  3829. open(item) {
  3830. item.showChildren = !item.showChildren;
  3831. },
  3832. change(index) {
  3833. this.current = index;
  3834. },
  3835. clickMulu() {
  3836. this.muluStyle = !this.muluStyle;
  3837. },
  3838. loadPlayerScript(callback) {
  3839. if (!window.polyvPlayer) {
  3840. const myScript = document.createElement("script");
  3841. myScript.setAttribute("src", this.vodPlayerJs);
  3842. myScript.onload = callback;
  3843. document.body.appendChild(myScript);
  3844. } else {
  3845. callback();
  3846. }
  3847. },
  3848. // 播放视频
  3849. loadPlayer() {
  3850. const polyvPlayer = window.polyvPlayer;
  3851. this.$api.polyvVideoSign(this.vid).then(async (res) => {
  3852. this.player = await polyvPlayer({
  3853. wrap: "#player",
  3854. width: "100%",
  3855. showLine: "off",
  3856. height: 218,
  3857. ban_history_time: "on",
  3858. vid: this.vid,
  3859. forceH5: true,
  3860. autoplay: this.autoplay, // 自动播放
  3861. ban_seek: this.H5isAllowSeek, // 是否禁止拖拽进度条
  3862. speed: this.playbackRate, // 倍数
  3863. teaser_show: 1,
  3864. tail_show: 1,
  3865. hideSwitchPlayer: true,
  3866. watchStartTime: this.recordObj.videoCurrentTime, // 播放开始时间,表示视频从第几秒开始播放,参数值需小于视频时长
  3867. ts: res.data.data.ts, // 移动播放加密视频需传入的时间戳。
  3868. sign: res.data.data.sign, // 移动端播放加密视频所需的签名
  3869. });
  3870. polyvPlayerContext = this.player;
  3871. this.player.on("s2j_onPlayStart", async (vid) => {
  3872. // 视频初次播放时触发
  3873. console.log("视频初次播放时触发:");
  3874. // #ifdef H5
  3875. // h5禁止拖动进度条
  3876. if (!this.$method.isWeixin()) {
  3877. this.clearBarTimer();
  3878. let originTime = this.recordObj.videoCurrentTime || 0;
  3879. if (this.H5isAllowSeek == "on") {
  3880. this.barTimer = setInterval(() => {
  3881. const currentTime = polyvPlayerContext.j2s_getCurrentTime();
  3882. // console.log(currentTime, originTime, 789);
  3883. if (
  3884. currentTime - originTime > 15 ||
  3885. currentTime - originTime < 0
  3886. ) {
  3887. polyvPlayerContext.j2s_seekVideo(originTime);
  3888. } else {
  3889. originTime = currentTime;
  3890. }
  3891. }, 2000);
  3892. }
  3893. }
  3894. // #endif
  3895. this.loadedmetadata();
  3896. this.postStudyRecord(0);
  3897. });
  3898. this.player.on("s2j_onVideoPause", () => {
  3899. // 视频暂停时触发
  3900. console.log("视频暂停时触发", this.vid);
  3901. this.erJianErZaoPauseTip();
  3902. this.clearBarTimer();
  3903. clearInterval(this.studyTimer);
  3904. clearInterval(this.timer);
  3905. });
  3906. this.player.on("s2j_onVideoPlay", () => {
  3907. // 视频初次播放或由暂停恢复播放时触发
  3908. console.log("视频初次播放或由暂停恢复播放时触发");
  3909. if (this.needSeek) {
  3910. if (this.recordObj.videoCurrentTime) {
  3911. this.seekTime = this.$method.secondToDate(
  3912. this.recordObj.videoCurrentTime
  3913. );
  3914. this.videoToastShow = true;
  3915. this.toastTimer = setTimeout(() => {
  3916. this.videoToastShow = false;
  3917. }, 3000);
  3918. }
  3919. this.needSeek = false;
  3920. // 新增用户视频学习日志
  3921. this.studyLog();
  3922. }
  3923. //开始播放
  3924. this.timer && clearInterval(this.timer);
  3925. if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
  3926. this.clearPauseTimer();
  3927. this.isReach = false;
  3928. this.timer = setInterval(this.timeEvent, 1000); //定时器
  3929. }
  3930. this.studyTimer && clearInterval(this.studyTimer);
  3931. this.studyTimer = setInterval(() => {
  3932. this.postStudyRecord(0, this.playSectionId);
  3933. }, 15000);
  3934. });
  3935. this.player.on("s2j_onPlayOver", async () => {
  3936. // 当前视频播放完毕时触发
  3937. this.hasStart = false;
  3938. this.clearBarTimer();
  3939. clearInterval(this.studyTimer);
  3940. clearInterval(this.timer);
  3941. uni.showToast({
  3942. icon: "none",
  3943. title: "播放完毕",
  3944. });
  3945. await this.postStudyRecord(1);
  3946. this.nextSection(); // 播放下一节
  3947. });
  3948. });
  3949. },
  3950. clears() {
  3951. return new Promise((resolve, reject) => {
  3952. this.vid = "";
  3953. this.player && this.player.destroy();
  3954. resolve();
  3955. });
  3956. },
  3957. /**
  3958. * 退出全屏
  3959. */
  3960. exitFullscreen() {
  3961. try {
  3962. var de = document;
  3963. if (de.exitFullscreen) {
  3964. de.exitFullscreen();
  3965. } else if (de.mozCancelFullScreen) {
  3966. de.mozCancelFullScreen();
  3967. } else if (de.webkitCancelFullScreen) {
  3968. de.webkitCancelFullScreen();
  3969. }
  3970. } catch (err) {}
  3971. },
  3972. fullele() {
  3973. return (
  3974. document.fullscreenElement ||
  3975. document.webkitFullscreenElement ||
  3976. document.msFullscreenElement ||
  3977. document.mozFullScreenElement ||
  3978. null
  3979. );
  3980. },
  3981. //判断是否全屏
  3982. isFullScreen() {
  3983. return !!(document.webkitIsFullScreen || this.fullele());
  3984. },
  3985. getUserMedia(constraints, success, error) {
  3986. console.log("getUserMedia===", constraints, "success:", success);
  3987. if (window.navigator.mediaDevices.getUserMedia) {
  3988. // 最新的标准API
  3989. window.navigator.mediaDevices
  3990. .getUserMedia(constraints)
  3991. .then(success)
  3992. .catch(error);
  3993. } else if (window.navigator.webkitGetUserMedia) {
  3994. // webkit核心浏览器
  3995. window.navigator.webkitGetUserMedia(constraints, success, error);
  3996. } else if (window.navigator.mozGetUserMedia) {
  3997. // firfox浏览器
  3998. window.navigator.mozGetUserMedia(constraints, success, error);
  3999. } else if (window.navigator.getUserMedia) {
  4000. // 旧版API
  4001. window.navigator.getUserMedia(constraints, success, error);
  4002. }
  4003. },
  4004. photographSuccess(stream) {
  4005. console.log("有摄像头---", stream);
  4006. this.photoPopup = true;
  4007. this.isTaking = true;
  4008. this.enableAutoRotation = false;
  4009. this.$nextTick(() => {
  4010. const video = document.querySelector("video");
  4011. console.log("video:", video);
  4012. video.srcObject = stream;
  4013. video.play();
  4014. });
  4015. },
  4016. photographError(err) {
  4017. console.log("没有摄像头:", err);
  4018. uni.showModal({
  4019. title: "提示",
  4020. content:
  4021. "课程学习需要开启摄像头进行拍照,经检测您的设备无摄像头可使用,请检测环境是否支持。",
  4022. cancelText: "取消",
  4023. confirmText: "确定",
  4024. success: (res) => {
  4025. if (res.confirm) {
  4026. uni.navigateBack();
  4027. } else if (res.cancel) {
  4028. }
  4029. },
  4030. });
  4031. },
  4032. },
  4033. };
  4034. </script>
  4035. <style lang="scss" scope>
  4036. @import "./css/detail.scss";
  4037. .top {
  4038. &__header {
  4039. position: relative;
  4040. width: 100%;
  4041. height: 150rpx;
  4042. padding: 24rpx 150rpx 24rpx 24rpx;
  4043. .img {
  4044. position: absolute;
  4045. left: 0;
  4046. top: 0;
  4047. width: 100%;
  4048. }
  4049. .note {
  4050. position: relative;
  4051. z-index: 10;
  4052. font-size: 24rpx;
  4053. font-family: PingFang SC;
  4054. font-weight: bold;
  4055. color: #efdbff;
  4056. }
  4057. .title {
  4058. position: relative;
  4059. z-index: 10;
  4060. font-size: 26rpx;
  4061. font-family: PingFang SC;
  4062. font-weight: bold;
  4063. color: #ffffff;
  4064. }
  4065. }
  4066. }
  4067. #top {
  4068. position: relative;
  4069. z-index: 99;
  4070. }
  4071. .polyv_detail {
  4072. display: flex;
  4073. flex-direction: column;
  4074. height: 100vh;
  4075. position: relative;
  4076. top: 0;
  4077. left: 0;
  4078. .pops {
  4079. position: absolute;
  4080. top: 0;
  4081. left: 0;
  4082. background: #ccc;
  4083. opacity: 0.5;
  4084. width: 100%;
  4085. height: 300rpx;
  4086. z-index: 9999;
  4087. }
  4088. .box {
  4089. flex: 1;
  4090. overflow: hidden;
  4091. margin: 16rpx 16rpx 100rpx 16rpx;
  4092. .box_in {
  4093. height: 100%;
  4094. }
  4095. }
  4096. .first_ml {
  4097. margin: 16rpx 16rpx 16rpx 16rpx;
  4098. }
  4099. }
  4100. .btnSet {
  4101. width: 440rpx;
  4102. height: 80rpx;
  4103. background: #007aff;
  4104. border-radius: 40rpx;
  4105. color: #ffffff;
  4106. font-size: 28rpx;
  4107. line-height: 80rpx;
  4108. }
  4109. .btnReply {
  4110. width: 80rpx;
  4111. height: 40rpx;
  4112. background: #e3f0ff;
  4113. border-radius: 16rpx;
  4114. text-align: center;
  4115. color: #007aff;
  4116. }
  4117. .btnDel {
  4118. width: 80rpx;
  4119. height: 40rpx;
  4120. background: #ffedf0;
  4121. border-radius: 16rpx;
  4122. text-align: center;
  4123. color: #ff2d55;
  4124. }
  4125. .btnReply {
  4126. width: 80rpx;
  4127. height: 40rpx;
  4128. background: #e3f0ff;
  4129. border-radius: 16rpx;
  4130. font-size: 24rpx;
  4131. }
  4132. .lecture-content {
  4133. background: #fff;
  4134. margin-top: 10rpx;
  4135. padding: 10rpx;
  4136. border-radius: 16rpx;
  4137. }
  4138. .photoBox {
  4139. width: 100%;
  4140. // background-color: #ffffff;
  4141. // border-radius: 24px 24px 0px 0px;
  4142. .photoTop {
  4143. width: 100%;
  4144. height: 74rpx;
  4145. border-radius: 20px 20px 0px 0px;
  4146. background-color: #ffffff;
  4147. display: flex;
  4148. align-items: center;
  4149. justify-content: center;
  4150. padding: 0rpx 38rpx;
  4151. .sqzz {
  4152. width: 28rpx;
  4153. height: 28rpx;
  4154. display: flex;
  4155. align-items: center;
  4156. justify-content: center;
  4157. }
  4158. .centersq {
  4159. color: #333;
  4160. font-size: 30rpx;
  4161. font-weight: 500;
  4162. }
  4163. }
  4164. .photoCenter {
  4165. width: 750rpx;
  4166. height: 75vh;
  4167. position: relative;
  4168. .center_camera {
  4169. width: 100%;
  4170. height: 75vh;
  4171. position: fixed;
  4172. .head_take {
  4173. width: 100%;
  4174. height: 75vh;
  4175. display: flex;
  4176. flex-direction: column;
  4177. }
  4178. .headTake_up {
  4179. width: 100%;
  4180. height: 100rpx;
  4181. }
  4182. .headTake_minddle {
  4183. display: flex;
  4184. .min_img {
  4185. width: 500rpx;
  4186. height: 550rpx;
  4187. }
  4188. .min_left,
  4189. .min_right {
  4190. flex: 1;
  4191. height: 550rpx;
  4192. }
  4193. }
  4194. .headTake_down {
  4195. width: 100%;
  4196. flex: 1;
  4197. }
  4198. .color {
  4199. background-color: #333;
  4200. opacity: 0.5;
  4201. }
  4202. .photo_v {
  4203. width: 100%;
  4204. height: 100%;
  4205. }
  4206. .mask {
  4207. width: 500rpx;
  4208. height: 550rpx;
  4209. position: absolute;
  4210. top: 100rpx;
  4211. left: 0;
  4212. right: 0;
  4213. bottom: 0;
  4214. margin: 0 auto;
  4215. box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.4);
  4216. }
  4217. }
  4218. .custom {
  4219. width: 750rpx;
  4220. height: 75vh;
  4221. position: absolute;
  4222. z-index: 1000;
  4223. top: 0;
  4224. left: 0;
  4225. image {
  4226. width: 100%;
  4227. height: 100%;
  4228. }
  4229. }
  4230. }
  4231. .btns {
  4232. display: flex;
  4233. .takePhoto_btn {
  4234. width: 100%;
  4235. display: flex;
  4236. align-items: center;
  4237. justify-content: space-between;
  4238. background: #a9a7a9;
  4239. padding: 40rpx 26rpx;
  4240. .middle_btn {
  4241. width: 120rpx;
  4242. height: 120rpx;
  4243. border-radius: 40rpx;
  4244. border: 4rpx solid #ffffff;
  4245. display: flex;
  4246. align-items: center;
  4247. justify-content: center;
  4248. }
  4249. .square {
  4250. width: 96rpx;
  4251. height: 96rpx;
  4252. background: #ffffff;
  4253. border-radius: 28rpx;
  4254. }
  4255. .rights {
  4256. font-size: 32rpx;
  4257. font-weight: 500;
  4258. color: #ffffff;
  4259. }
  4260. }
  4261. .btnResult {
  4262. height: 100rpx;
  4263. flex: 1;
  4264. background-color: #07c160;
  4265. text-align: center;
  4266. line-height: 100rpx;
  4267. color: #fff;
  4268. font-size: 32rpx;
  4269. font-weight: bold;
  4270. }
  4271. }
  4272. }
  4273. .chat_box {
  4274. display: flex;
  4275. padding: 20rpx;
  4276. justify-content: space-between;
  4277. }
  4278. .chat3 {
  4279. font-size: 30rpx;
  4280. font-family: PingFang SC;
  4281. font-weight: 500;
  4282. color: #666666;
  4283. margin-top: 10rpx;
  4284. }
  4285. .chat2 {
  4286. font-size: 20rpx;
  4287. font-family: PingFang SC;
  4288. font-weight: 500;
  4289. color: #999999;
  4290. margin-top: 10rpx;
  4291. }
  4292. .chat1 {
  4293. font-size: 24rpx;
  4294. font-family: PingFang SC;
  4295. font-weight: 500;
  4296. color: #333333;
  4297. }
  4298. .leftPadding {
  4299. margin-left: 8rpx;
  4300. }
  4301. .t2Content {
  4302. font-size: 24rpx;
  4303. font-family: PingFang SC;
  4304. font-weight: bold;
  4305. color: #999999;
  4306. line-height: 48rpx;
  4307. }
  4308. .tBox2 {
  4309. display: flex;
  4310. padding-top: 10rpx;
  4311. color: #333333;
  4312. font-size: 30rpx;
  4313. font-weight: 400;
  4314. }
  4315. .tBox {
  4316. display: flex;
  4317. align-items: center;
  4318. padding-top: 10rpx;
  4319. }
  4320. .title {
  4321. font-size: 24rpx;
  4322. color: #999999;
  4323. }
  4324. .Answering {
  4325. .answer_item {
  4326. &:nth-child(2) {
  4327. border-radius: 16rpx 16rpx 0rpx 0rpx;
  4328. }
  4329. &:nth-last-child(1) {
  4330. border-radius: 0rpx 0rpx 16rpx 16rpx;
  4331. }
  4332. }
  4333. }
  4334. .inputBottom {
  4335. position: fixed;
  4336. left: 0;
  4337. bottom: 0;
  4338. background: #ffffff;
  4339. height: 98rpx;
  4340. display: flex;
  4341. align-items: center;
  4342. width: 100%;
  4343. .flex_auto {
  4344. flex: 1;
  4345. margin-left: 10%;
  4346. word-break: break-all;
  4347. // .input {
  4348. // height: 60rpx;
  4349. // }
  4350. }
  4351. .btn {
  4352. color: #007aff;
  4353. font-size: 30rpx;
  4354. font-weight: bold;
  4355. width: 15%;
  4356. text-align: center;
  4357. }
  4358. .input {
  4359. background: rgba(244, 244, 244, 0.98);
  4360. height: 60rpx;
  4361. border-radius: 24rpx;
  4362. margin-top: 12rpx;
  4363. }
  4364. }
  4365. .noteBox {
  4366. width: 100%;
  4367. background: #ffffff;
  4368. padding: 0rpx 10rpx 20rpx;
  4369. border-radius: 16rpx;
  4370. overflow: hidden;
  4371. .left_ti {
  4372. padding-top: 14rpx;
  4373. }
  4374. }
  4375. .dateBox {
  4376. width: 216rpx;
  4377. height: 48rpx;
  4378. background: #ffffff;
  4379. border-radius: 24rpx;
  4380. font-size: 24rpx;
  4381. color: #666666;
  4382. text-align: center;
  4383. line-height: 48rpx;
  4384. margin: 16rpx 0rpx 8rpx;
  4385. }
  4386. .t_content1 {
  4387. color: #007aff;
  4388. margin-left: 10rpx;
  4389. }
  4390. .tag1 {
  4391. border: 2rpx solid #007aff;
  4392. border-radius: 8rpx;
  4393. font-size: 20rpx;
  4394. color: #007aff;
  4395. padding: 5rpx;
  4396. }
  4397. .b_title {
  4398. color: #333333;
  4399. font-size: 30rpx;
  4400. font-weight: bold;
  4401. }
  4402. page {
  4403. background: #eaeef1;
  4404. }
  4405. .menuBox {
  4406. width: 100%;
  4407. background: #ffffff;
  4408. border-radius: 16rpx;
  4409. padding: 0rpx 20rpx;
  4410. margin-bottom: 20rpx;
  4411. }
  4412. .btnspric {
  4413. border-top: 1rpx solid #eee;
  4414. display: flex;
  4415. align-items: center;
  4416. justify-content: space-between;
  4417. height: 108rpx;
  4418. padding-left: 43rpx;
  4419. padding-right: 32rpx;
  4420. }
  4421. .btnspric > .lefprL {
  4422. font-size: 36rpx;
  4423. color: #0c141f;
  4424. font-weight: bold;
  4425. }
  4426. .btnspric > .lefprR {
  4427. padding: 0rpx 24rpx;
  4428. height: 60rpx;
  4429. line-height: 60rpx;
  4430. text-align: center;
  4431. color: #fff;
  4432. background: #32467b;
  4433. border-radius: 24rpx;
  4434. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  4435. }
  4436. .yhj,
  4437. .hdyhj {
  4438. padding: 24rpx 29rpx 24rpx 34rpx;
  4439. }
  4440. .yhj {
  4441. border-bottom: 16rpx solid #f9f9f9;
  4442. }
  4443. .yhjtit {
  4444. font-size: 30rpx;
  4445. color: #0c141f;
  4446. font-weight: 500;
  4447. margin-bottom: 14rpx;
  4448. }
  4449. .yhjList {
  4450. display: flex;
  4451. align-items: center;
  4452. justify-content: space-between;
  4453. margin-bottom: 14rpx;
  4454. }
  4455. .yhjList > .yhjLefts {
  4456. display: flex;
  4457. align-items: center;
  4458. }
  4459. .yhjLefts > .yhl {
  4460. color: #32467b;
  4461. font-size: 30rpx;
  4462. margin-right: 31rpx;
  4463. }
  4464. .yhjLefts > .yhbq {
  4465. font-size: 24rpx;
  4466. color: #ff9500;
  4467. border-radius: 18rpx;
  4468. background-color: rgba(255, 149, 0, 0.2);
  4469. border: 2rpx solid #ff9500;
  4470. height: 38rpx;
  4471. line-height: 38rpx;
  4472. padding: 0rpx 16rpx;
  4473. }
  4474. .ts {
  4475. font-size: 24rpx;
  4476. color: #999;
  4477. margin: 14rpx 0rpx;
  4478. padding-right: 29rpx;
  4479. padding-left: 34rpx;
  4480. }
  4481. .yh {
  4482. padding-top: 20rpx;
  4483. }
  4484. .yh > .yhtitle {
  4485. display: flex;
  4486. align-items: center;
  4487. justify-content: space-between;
  4488. padding-right: 29rpx;
  4489. padding-left: 34rpx;
  4490. }
  4491. .priceBxs {
  4492. display: flex;
  4493. align-items: center;
  4494. }
  4495. .priceBxs > .pricleft {
  4496. border-radius: 24rpx;
  4497. border: 1rpx solid #e91313;
  4498. background-color: rgba(233, 19, 19, 0.1);
  4499. padding: 0rpx 18rpx;
  4500. height: 49rpx;
  4501. line-height: 49rpx;
  4502. text-align: center;
  4503. font-size: 30rpx;
  4504. font-weight: 500;
  4505. color: #e91313;
  4506. margin-right: 13rpx;
  4507. }
  4508. .topBox {
  4509. padding: 32rpx 32rpx 24rpx;
  4510. border-bottom: 1rpx solid #eeeeee;
  4511. }
  4512. .topBox > .boldFonstType {
  4513. font-weight: 500;
  4514. font-size: 30rpx;
  4515. margin: 16rpx 0rpx 23rpx;
  4516. }
  4517. .topBox > .firstTopL {
  4518. display: flex;
  4519. align-items: center;
  4520. }
  4521. .topBox > .firstTopL > .imageBs {
  4522. width: 331rpx;
  4523. height: 160rpx;
  4524. border-radius: 6rpx;
  4525. overflow: hidden;
  4526. margin-right: 8rpx;
  4527. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  4528. }
  4529. .topBox > .firstTopL > .imageBs > image {
  4530. width: 100%;
  4531. height: 100%;
  4532. }
  4533. .topBox > .firstTopL > .textBs {
  4534. font-size: 30rpx;
  4535. font-weight: bold;
  4536. color: #0c141f;
  4537. }
  4538. .content {
  4539. padding: 24rpx;
  4540. text-align: left;
  4541. }
  4542. .catalogBox {
  4543. display: flex;
  4544. align-items: center;
  4545. flex-wrap: nowrap;
  4546. overflow-x: auto;
  4547. padding-left: 38rpx;
  4548. max-height: 305rpx;
  4549. overflow-y: auto;
  4550. transition: all 0.4s;
  4551. }
  4552. .catalogBox > .catalogA {
  4553. min-width: 200rpx;
  4554. height: 48rpx;
  4555. line-height: 48rpx;
  4556. // text-align: center;
  4557. border: 2rpx solid transparent;
  4558. white-space: nowrap;
  4559. text-overflow: ellipsis;
  4560. overflow: hidden;
  4561. word-break: break-all;
  4562. border-radius: 10rpx;
  4563. background: rgba(22, 119, 255, 0.05);
  4564. padding-left: 19rpx;
  4565. box-sizing: border-box;
  4566. padding-right: 15rpx;
  4567. margin-right: 16rpx;
  4568. margin-bottom: 20rpx;
  4569. margin-top: 15rpx;
  4570. font-size: 24rpx;
  4571. color: #666;
  4572. }
  4573. .catalogBox > .activesq {
  4574. border-color: #1677ff;
  4575. }
  4576. .changeCatalogBox {
  4577. display: block;
  4578. }
  4579. .catalogBox::-webkit-scrollbar {
  4580. display: none; /* Chrome Safari */
  4581. }
  4582. .price_t2 {
  4583. font-size: 18rpx;
  4584. font-family: PingFang SC;
  4585. font-weight: 500;
  4586. text-decoration: line-through;
  4587. color: #999999;
  4588. }
  4589. .price_t1 {
  4590. font-size: 33rpx;
  4591. font-family: PingFang SC;
  4592. font-weight: bold;
  4593. color: #e91313;
  4594. }
  4595. .sc_t {
  4596. font-size: 22rpx;
  4597. color: #000000;
  4598. }
  4599. .sc {
  4600. width: 29rpx;
  4601. height: 29rpx;
  4602. }
  4603. .buy {
  4604. width: 138rpx;
  4605. height: 48rpx;
  4606. line-height: 48rpx;
  4607. background: #32467b;
  4608. border-radius: 10rpx;
  4609. color: #ffffff;
  4610. font-size: 28rpx;
  4611. text-align: center;
  4612. vertical-align: middle;
  4613. position: absolute;
  4614. right: 30rpx;
  4615. }
  4616. .video_body {
  4617. padding-bottom: 96rpx;
  4618. }
  4619. .footer_tab {
  4620. position: fixed;
  4621. bottom: 0;
  4622. height: 96rpx;
  4623. width: 100%;
  4624. background-color: #ffffff;
  4625. }
  4626. .tj_box {
  4627. width: 50%;
  4628. display: inline-block;
  4629. text-align: center;
  4630. margin: 10rpx 0;
  4631. }
  4632. .teacher_t {
  4633. font-size: 24rpx;
  4634. font-family: PingFang SC;
  4635. font-weight: 400;
  4636. color: #666666;
  4637. line-height: 36rpx;
  4638. margin-left: 15rpx;
  4639. }
  4640. .teacher_img {
  4641. width: 87rpx;
  4642. height: 129rpx;
  4643. }
  4644. .t2 {
  4645. font-size: 24rpx;
  4646. font-family: PingFang SC;
  4647. color: #666666;
  4648. line-height: 36rpx;
  4649. margin: 15rpx;
  4650. }
  4651. .r_t2 {
  4652. width: 201rpx;
  4653. height: 49rpx;
  4654. background: rgba(22, 119, 255, 0.05);
  4655. border: 1rpx solid #32467b;
  4656. border-radius: 16rpx;
  4657. color: #666666;
  4658. font-size: 23rpx;
  4659. text-align: center;
  4660. display: flex;
  4661. align-items: center;
  4662. padding: 5rpx;
  4663. }
  4664. .scroll_box {
  4665. width: 100%;
  4666. height: 60rpx;
  4667. background: #ffffff;
  4668. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  4669. white-space: nowrap;
  4670. overflow: hidden;
  4671. margin: 15rpx 0;
  4672. }
  4673. .r_sliper {
  4674. padding: 0 20rpx;
  4675. }
  4676. .top_line {
  4677. width: 6rpx;
  4678. height: 22rpx;
  4679. background: #32467b;
  4680. margin-right: 10rpx;
  4681. }
  4682. .video_t2 {
  4683. font-size: 24rpx;
  4684. font-family: PingFang SC;
  4685. font-weight: 500;
  4686. color: #666666;
  4687. }
  4688. .video_play {
  4689. position: absolute;
  4690. width: 95rpx;
  4691. height: 95rpx;
  4692. top: 0;
  4693. left: 0;
  4694. right: 0;
  4695. bottom: 0;
  4696. margin: auto;
  4697. }
  4698. .video_box {
  4699. position: relative;
  4700. #playerVideo {
  4701. position: relative;
  4702. z-index: 99;
  4703. }
  4704. .video-toast {
  4705. position: absolute;
  4706. width: 686rpx;
  4707. height: 80rpx;
  4708. background: rgba(0, 0, 0, 0.6);
  4709. border-radius: 24rpx;
  4710. bottom: 100rpx;
  4711. left: 50%;
  4712. transform: translateX(-50%);
  4713. color: #fff;
  4714. display: flex;
  4715. font-size: 26rpx;
  4716. align-items: center;
  4717. overflow: visible;
  4718. z-index: 999;
  4719. &__text {
  4720. flex: 1;
  4721. margin-left: 40rpx;
  4722. }
  4723. &__btn {
  4724. width: 180rpx;
  4725. text-align: center;
  4726. border-left: 1rpx solid #fff;
  4727. }
  4728. }
  4729. .video-toast__close {
  4730. position: absolute;
  4731. right: 32rpx;
  4732. bottom: 184rpx;
  4733. width: 40rpx;
  4734. height: 40rpx;
  4735. line-height: 40rpx;
  4736. text-align: center;
  4737. background: rgba(0, 0, 0, 0.6);
  4738. border-radius: 50%;
  4739. color: rgba(255, 255, 255, 0.3);
  4740. }
  4741. }
  4742. .rotoct {
  4743. transform: rotate(90deg);
  4744. }
  4745. .slot-content {
  4746. padding: 0 20rpx;
  4747. }
  4748. .notice_modal {
  4749. .content {
  4750. width: 100%;
  4751. height: 100%;
  4752. padding: 56rpx 56rpx 56rpx 64rpx;
  4753. .title {
  4754. color: #222;
  4755. line-height: 40rpx;
  4756. font-size: 36rpx;
  4757. text-align: center;
  4758. font-weight: bold;
  4759. margin-bottom: 24rpx;
  4760. }
  4761. .text {
  4762. height: 340rpx;
  4763. line-height: 40rpx;
  4764. text-indent: 2em;
  4765. font-size: 32rpx;
  4766. color: #222;
  4767. }
  4768. .had_read {
  4769. width: 100%;
  4770. height: 88rpx;
  4771. line-height: 88rpx;
  4772. text-align: center;
  4773. background: #3577e8;
  4774. border-radius: 240rpx;
  4775. font-size: 32rpx;
  4776. font-weight: 500;
  4777. color: #fff;
  4778. margin-top: 20rpx;
  4779. &.gray {
  4780. background: #bbbec5;
  4781. }
  4782. }
  4783. }
  4784. }
  4785. .full_mulu {
  4786. position: absolute;
  4787. top: 100rpx;
  4788. right: 20rpx;
  4789. width: 700rpx;
  4790. height: 515rpx;
  4791. color: #333;
  4792. display: flex;
  4793. align-items: center;
  4794. justify-content: space-between;
  4795. z-index: 99999;
  4796. .mulus {
  4797. width: 623rpx;
  4798. // height: 515rpx;
  4799. height: 400rpx;
  4800. overflow-y: scroll;
  4801. // overflow: scroll;
  4802. }
  4803. .mulu_box_in {
  4804. background-color: #b7b7b7;
  4805. border-radius: 16rpx;
  4806. // transition: all 0.5s;
  4807. &::after {
  4808. content: "";
  4809. width: 0;
  4810. height: 0;
  4811. position: absolute;
  4812. top: 235rpx;
  4813. right: 27px;
  4814. border-top: 16rpx solid transparent;
  4815. border-right: 16rpx solid transparent;
  4816. border-left: 16rpx solid #b7b7b7;
  4817. border-bottom: 16rpx solid transparent;
  4818. }
  4819. }
  4820. .mulu_box_out {
  4821. // visibility: hidden;
  4822. display: none;
  4823. }
  4824. .menuBox_mulu {
  4825. // width: 100%;
  4826. background: #ffffff;
  4827. border-radius: 16rpx;
  4828. padding: 0rpx 20rpx;
  4829. margin-bottom: 20rpx;
  4830. }
  4831. .ml_img {
  4832. position: absolute;
  4833. right: 0;
  4834. top: 100rpx;
  4835. }
  4836. .items {
  4837. width: 620rpx;
  4838. height: 100rpx;
  4839. border: 1rpx solid red;
  4840. }
  4841. }
  4842. </style>