detail.vue 147 KB

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