detail.vue 113 KB

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