detail.vue 130 KB

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