detail.vue 114 KB

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