detail.vue 118 KB

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