detail.vue 145 KB

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