detail.vue 146 KB

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