detail.vue 124 KB

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