detail.vue 115 KB

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