detail.vue 130 KB

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