detail.vue 145 KB

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