detail.vue 142 KB

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