detail.vue 142 KB

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