detail.vue 130 KB

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