detail.vue 142 KB

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