detail.vue 147 KB

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