detail.vue 148 KB

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