detail.vue 116 KB

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