detail.vue 126 KB

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