detail.vue 125 KB

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