detail.vue 146 KB

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