detail.vue 135 KB

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