detail.vue 133 KB

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