detail.vue 142 KB

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