detail.vue 145 KB

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