detail.vue 144 KB

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