detail.vue 142 KB

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