detail.vue 114 KB

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