detail.vue 130 KB

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