detail.vue 124 KB

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