detail.vue 144 KB

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