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