detail.vue 144 KB

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