detail.vue 115 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839
  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: 100,
  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. //获取商品双师资模板
  892. this.$api.courseTeacherList({
  893. goodsId: this.goodsId
  894. }).then((res1) => {
  895. if(res1.data.data && res1.data.data.length > 0){
  896. //课程老师模板
  897. let teacherTel = res1.data.data;
  898. //商品课程
  899. let courses = rows;
  900. teacherTel.forEach((tea) => {
  901. let dataList = []
  902. let teacherList = []
  903. courses.forEach((item) => {
  904. let data = tea.courseList.filter(x => x.courseId == item.courseId)
  905. if(data && data.length > 0){
  906. dataList.push(item)
  907. teacherList = tea.courseList
  908. }
  909. })
  910. let result = {
  911. teaList:teacherList,
  912. courseList:dataList
  913. }
  914. this.goodsTeacher.push(result)
  915. })
  916. if(this.goodsTeacher && this.goodsTeacher.length > 0){
  917. let courseIds = []
  918. this.goodsTeacher.forEach((item) => {
  919. item.courseList.forEach((course) => {
  920. courseIds.push(course.courseId)
  921. })
  922. })
  923. if(courseIds.length > 0){
  924. courses.forEach((item) => {
  925. if(!courseIds.includes(item.courseId)){
  926. let data = {
  927. teaList:[],
  928. courseList: []
  929. }
  930. data.courseList.push(item)
  931. this.goodsTeacher.push(data)
  932. }
  933. })
  934. }
  935. this.goodsTeacher.forEach((item) => {
  936. if(item.courseList && item.courseList.length > 0){
  937. item.courseList[0].show = 1
  938. }
  939. })
  940. }
  941. } else {
  942. //没有双师资模板
  943. rows.forEach((item) => {
  944. item.show = 1
  945. let data = {
  946. teaList:[],
  947. courseList: []
  948. }
  949. data.courseList.push(item)
  950. this.goodsTeacher.push(data)
  951. })
  952. }
  953. console.log(this.goodsTeacher,'this.goodsTeacher', this.courseId);
  954. this.goodsTeacher.forEach((item) => {
  955. if(item.courseList.some(x => x.courseId == this.courseId)){
  956. this.teacherList = item.teaList
  957. }
  958. })
  959. console.log(this.teacherList,'this.teacherList');
  960. })
  961. },
  962. // 原来onshow里面的内容
  963. originOnShow() {
  964. console.log('原来onshow里面的originOnShow')
  965. if(this.isOther) {
  966. this.showMark = true;
  967. return;
  968. }
  969. this.getbaseprofiletplists().then(res => {
  970. this.courseDetail();
  971. this.getGoodsDetail();
  972. this.getAnswerList();
  973. this.studyRecordMenuAllList();
  974. this.answerTimer = setInterval(() => {
  975. this.getAnswerList();
  976. }, 5000);
  977. let noteSecond = Number(this.option.noteSecond);
  978. console.log('noteSecondnoteSecond:', noteSecond, this.option)
  979. if (noteSecond > 0) {
  980. //我的消息跳过来,播放节
  981. let item = {
  982. sectionId: Number(this.option.sectionId),
  983. recordingUrl: this.option.recordingUrl,
  984. noteSecond: noteSecond,
  985. studyDuration: noteSecond,
  986. };
  987. let playNextId = `moduleId${this.option.moduleId}chapterId${
  988. this.option.chapterId
  989. }sectionId${this.option.sectionId}${this.option.isRebuild ? "isRebuild" : ""}`;
  990. this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId || item.menuId });
  991. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  992. this.$store.commit("updatePlayNextId", playNextId);
  993. this.playNoteVideo(item)
  994. } else {
  995. this.studyRecordQueryLiveLast();
  996. }
  997. });
  998. this.current = uni.getStorageSync('current') || 0
  999. },
  1000. // 原来的mouted内容
  1001. originMounted() {
  1002. // console.log('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. console.log('清除====',item, item.recordingUrl)
  1020. //清除直播
  1021. this.hasStart = false;
  1022. this.isPlayRebuild = item.rebuild;
  1023. this.photoConfig = false;
  1024. this.photoIndex = 0;
  1025. this.sectionItem = item;
  1026. this.moduleId = item.moduleId || null
  1027. this.chapterId = item.chapterId || null
  1028. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  1029. this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId || item.menuId });
  1030. console.log('清除直播节点胡:', this.moduleId, this.chapterId, this.playSectionId )
  1031. //获取拍照历史
  1032. this.getPhotoLastRecord();
  1033. this.playVideo(item);
  1034. });
  1035. uni.$on("levelId", (item) => {
  1036. let arr = item.split("-");
  1037. //点击节获取的各层级ID
  1038. this.moduleId = arr[0];
  1039. this.chapterId = arr[1];
  1040. });
  1041. uni.$on("getChannel", (item) => {
  1042. // console.log('--->清除录播录播清除录播录播')
  1043. //清除录播
  1044. this.hasStart = false;
  1045. this.$store.commit("setPlayVID", { playVID: null });
  1046. this.moduleId = item.moduleId
  1047. this.chapterId = item.chapterId
  1048. this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId || item.menuId });
  1049. this.getPhotoLastRecord();
  1050. this.playChannel(item);
  1051. this.channelItem = item;
  1052. });
  1053. uni.$on("isRebuild", (item) => {
  1054. // console.log(item);
  1055. this.isRebuild = item;
  1056. });
  1057. this.updateChapterOpen(true);
  1058. },
  1059. // 原来onUnload里面的内容
  1060. originUnload() {
  1061. if (this.playSectionId > 0 && this.hasStart) {
  1062. //退出提交记录
  1063. this.postStudyRecord();
  1064. }
  1065. //清除正在播放的节ID
  1066. // this.$store.commit('setPlayObj',null)
  1067. this.$store.commit("setPlaySectionId", { playSectionId: 0 });
  1068. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  1069. this.$store.commit("setPlayVID", { playVID: null });
  1070. this.closePlv();
  1071. //移除所有的事件监听器
  1072. uni.$off();
  1073. clearInterval(this.answerTimer);
  1074. if (this.timer) {
  1075. clearInterval(this.timer);
  1076. }
  1077. if (this.lockTimer) {
  1078. clearInterval(this.lockTimer);
  1079. this.$api
  1080. .lockDelLock({
  1081. action: "jxjy",
  1082. uuid:this.$method.getUuid()
  1083. })
  1084. .then((res) => {});
  1085. }
  1086. uni.removeStorageSync('current')
  1087. // websocket.sendMsg("delAction");
  1088. },
  1089. changeCourses() {
  1090. this.toggleCourseShow = true
  1091. },
  1092. closePop() {
  1093. this.toggleCourseShow = false
  1094. },
  1095. async activeFunc(item, index) {
  1096. this.teacherIndex = index
  1097. let findResult = ''
  1098. this.goodsTeacher.forEach((citem,index) => {
  1099. citem.courseList.forEach((e, e_index) => {
  1100. if (e.courseId == item.courseId) {
  1101. findResult = e
  1102. }
  1103. })
  1104. })
  1105. console.log('findResult:', findResult)
  1106. this.jump(findResult, 1)
  1107. // return
  1108. // this.vid = ''
  1109. // this.hasStart = true
  1110. // await this.originUnload()
  1111. // this.reStart = false
  1112. // this.courseId = item.courseId
  1113. // this.gradeId = findResult.gradeId
  1114. // console.log('切换老师', item.courseId, item.gradeId)
  1115. // this.originOnShow()
  1116. // this.originMounted()
  1117. },
  1118. // 进入学习
  1119. async jump(item, index, type) {
  1120. // console.log('item------>', index,item,'courseId:',item.courseId, 'goodsId:', this.goodsId, 'orderGoodsId:',item.orderGoodsId)
  1121. this.vid = ''
  1122. this.hasStart = true
  1123. await this.originUnload()
  1124. if (type) {
  1125. this.teacherIndex = 0
  1126. this.goodsTeacher.forEach((citem) => {
  1127. if(citem.courseList.some(x => x.courseId == item.courseId)){
  1128. this.teacherList = citem.teaList
  1129. }
  1130. })
  1131. }
  1132. this.reStart = false
  1133. this.courseId = item.courseId
  1134. this.gradeId = item.gradeId
  1135. this.toggleCourseShow = false
  1136. if (index == 0) {
  1137. if (item.rebuild === 0) {
  1138. //未重修
  1139. this.$navTo.togo("/pages2/learn/details", {
  1140. id: item.courseId,
  1141. gradeId: item.gradeId,
  1142. goodsId: this.goodsId,
  1143. orderGoodsId: this.orderGoodsId,
  1144. });
  1145. return;
  1146. }
  1147. this.$api.courseDetail(item.courseId).then((res) => {
  1148. if (res.data.code == 200) {
  1149. // if (res.data.data.educationName == "继续教育") {
  1150. this.$api
  1151. .lockLockStatus({
  1152. action: "jxjy",
  1153. uuid: this.$method.getUuid(),
  1154. })
  1155. .then((res) => {
  1156. if (res.data.code == 200) {
  1157. //有其他端在操作,不能学习
  1158. uni.showToast({
  1159. icon: "none",
  1160. title: res.data.msg,
  1161. mask: true,
  1162. duration: 3000,
  1163. });
  1164. } else if (res.data.code == 500) {
  1165. //可以学习
  1166. // this.$navTo.togo("/pages3/polyv/detail", {
  1167. // id: item.courseId,
  1168. // goodsId: this.goodsId,
  1169. // orderGoodsId: this.orderGoodsId,
  1170. // });
  1171. this.courseId = item.courseId
  1172. this.originOnShow()
  1173. this.originMounted()
  1174. }
  1175. });
  1176. }
  1177. });
  1178. } else {
  1179. if (this.businessData.goodsLearningOrder == 2) {
  1180. //学习顺序是从头到尾学习,没学完上一课不能学习下一课
  1181. let prevItem = this.courseList[index - 1]; //上一课
  1182. if (
  1183. prevItem.stuAllNum + prevItem.recordNum ==
  1184. prevItem.secAllNum + prevItem.examNum
  1185. ) {
  1186. if (item.rebuild === 0) {
  1187. //未重修
  1188. this.$navTo.togo("/pages2/learn/details", {
  1189. id: item.courseId,
  1190. gradeId: item.gradeId,
  1191. goodsId: this.goodsId,
  1192. orderGoodsId: this.orderGoodsId,
  1193. });
  1194. return;
  1195. }
  1196. this.$api.courseDetail(item.courseId).then((res) => {
  1197. if (res.data.code == 200) {
  1198. // if (res.data.data.educationName == "继续教育") {
  1199. this.$api
  1200. .lockLockStatus({
  1201. action: "jxjy",
  1202. uuid: this.$method.getUuid(),
  1203. })
  1204. .then((res) => {
  1205. if (res.data.code == 200) {
  1206. //有其他端在操作,不能学习
  1207. uni.showToast({
  1208. icon: "none",
  1209. title: res.data.msg,
  1210. duration: 2000,
  1211. });
  1212. } else if (res.data.code == 500) {
  1213. //可以学习
  1214. // this.$navTo.togo("/pages3/polyv/detail", {
  1215. // id: item.courseId,
  1216. // goodsId: this.goodsId,
  1217. // orderGoodsId: this.orderGoodsId,
  1218. // });
  1219. this.courseId = item.courseId
  1220. this.originOnShow()
  1221. this.originMounted()
  1222. }
  1223. });
  1224. }
  1225. });
  1226. } else {
  1227. uni.showToast({
  1228. icon: "none",
  1229. title: "请按顺序学完上一课再学习这一课",
  1230. });
  1231. }
  1232. } else {
  1233. if (item.rebuild === 0) {
  1234. //未重修
  1235. this.$navTo.togo("/pages2/learn/details", {
  1236. id: item.courseId,
  1237. gradeId: item.gradeId,
  1238. goodsId: this.goodsId,
  1239. orderGoodsId: this.orderGoodsId,
  1240. });
  1241. return;
  1242. }
  1243. this.$api.courseDetail(item.courseId).then((res) => {
  1244. if (res.data.code == 200) {
  1245. // if (res.data.data.educationName == "继续教育") {
  1246. this.$api
  1247. .lockLockStatus({
  1248. action: "jxjy",
  1249. uuid: this.$method.getUuid(),
  1250. })
  1251. .then((res) => {
  1252. if (res.data.code == 200) {
  1253. //有其他端在操作,不能学习
  1254. uni.showToast({
  1255. icon: "none",
  1256. title: res.data.msg,
  1257. duration: 2000,
  1258. });
  1259. } else if (res.data.code == 500) {
  1260. //可以学习
  1261. // this.$navTo.togo("/pages3/polyv/detail", {
  1262. // id: item.courseId,
  1263. // goodsId: this.goodsId,
  1264. // orderGoodsId: this.orderGoodsId,
  1265. // });
  1266. this.courseId = item.courseId
  1267. this.originOnShow()
  1268. this.originMounted()
  1269. }
  1270. });
  1271. }
  1272. });
  1273. }
  1274. }
  1275. },
  1276. clickLeft() {
  1277. uni.navigateBack()
  1278. },
  1279. markCancel() {
  1280. uni.navigateBack({
  1281. delta:1
  1282. })
  1283. },
  1284. markConfirm() {
  1285. uni.setClipboardData({
  1286. data: this.markContent,
  1287. success: function() {
  1288. setTimeout(() => {
  1289. uni.navigateBack({
  1290. delta:1
  1291. })
  1292. },1000)
  1293. }
  1294. });
  1295. },
  1296. closeNotice() {
  1297. this.$api.baseHandoutTip({
  1298. orderGoodsId:this.orderGoodsId
  1299. }).then(res => {
  1300. })
  1301. },
  1302. baseHandoutTipList() {
  1303. this.$api.baseHandoutTipList({
  1304. orderGoodsId:this.orderGoodsId
  1305. }).then(res => {
  1306. if(res.data.rows.length == 0) {
  1307. this.noticeShow = true;
  1308. }
  1309. })
  1310. },
  1311. /**
  1312. * 获取上次观看的直播
  1313. */
  1314. studyRecordGetLastLive() {
  1315. this.$api.studyRecordGetLastLive({
  1316. orderGoodsId:this.orderGoodsId,
  1317. courseId:this.courseId
  1318. }).then(res => {
  1319. this.updateLiveLast(res.data.data)
  1320. })
  1321. },
  1322. studyRecordQueryLiveLast() {
  1323. // /study/record/queryLiveLast
  1324. this.$api.studyRecordQueryLiveLast({
  1325. orderGoodsId:this.orderGoodsId,
  1326. courseId:this.courseId
  1327. }).then(res => {
  1328. console.log(res,'couse最后一次观看的视频', this.courseId)
  1329. if(res.data.data) {
  1330. this.moduleId = res.data.data.moduleId
  1331. this.chapterId = res.data.data.chapterId
  1332. if(res.data.data.sectionType == 1) { //录播
  1333. // console.log('录播录播录播')
  1334. this.$store.commit("setPlaySectionId", { playSectionId: res.data.data.sectionId });
  1335. this.$store.commit("setPlayVID", { playVID: res.data.data.recordingUrl });
  1336. console.log('playVID:', this.playVID, 'playSectionId-', this.playSectionId, 'moduleId:', this.moduleId,'chapterId:', this.chapterId, 'courseId:', this.courseId)
  1337. this.sectionItem = res.data.data;
  1338. this.playVideo(res.data.data)
  1339. } else if(res.data.data.sectionType == 2) { //直播
  1340. this.studyRecordGetLastLive();
  1341. } else if(res.data.data.sectionType == 3) { //回放
  1342. this.$store.commit("setPlaySectionId", { playSectionId: res.data.data.sectionId });
  1343. this.$store.commit("setPlayVID", { playVID: res.data.data.recordingUrl });
  1344. this.sectionItem = res.data.data;
  1345. this.playVideo(res.data.data)
  1346. }
  1347. // 查询用户最后一次看的录播的信息
  1348. this.$http({
  1349. url: '/study/record/getUserWatchLast',
  1350. method: 'get',
  1351. data: {
  1352. orderGoodsId: this.orderGoodsId,
  1353. }
  1354. }).then((res) => {
  1355. if (res.data.code == 200) {
  1356. this.sectionItem = res.data.data
  1357. }
  1358. })
  1359. }
  1360. })
  1361. },
  1362. /**
  1363. * 模块大节播放完毕,刷新列表
  1364. */
  1365. sectionPlayEnd(isRebuild, index) {
  1366. if (this.reMenuList.length > 0) {
  1367. //有重修目录
  1368. if (isRebuild.isRebuild) {
  1369. //从重修点击
  1370. this.$api
  1371. .reMenuList({
  1372. orderGoodsId: this.orderGoodsId,
  1373. courseId: this.courseId,
  1374. rebuild: 1,
  1375. gradeId: this.gradeId,
  1376. })
  1377. .then((res) => {
  1378. if (res.data.code == 200) {
  1379. if (res.data.rows.length) {
  1380. res.data.rows[index].name = res.data.rows[index].menuName;
  1381. this.$set(this.reMenuList,index,res.data.rows[index])
  1382. for (let i = 0; i < res.data.rows.length; i++) {
  1383. let item = res.data.rows[i];
  1384. item.down = true;
  1385. item.id = item.menuId;
  1386. item.name = item.menuName;
  1387. }
  1388. this.reMenuList = []
  1389. this.$nextTick(() => {
  1390. this.reMenuList = res.data.rows;
  1391. console.log(this.reMenuList,'this.reMenuList1')
  1392. })
  1393. } else {
  1394. this.reMenuList = [];
  1395. }
  1396. this.$nextTick(() => {
  1397. if (this.reMenuList.length > 0) {
  1398. this.list = [
  1399. {
  1400. name: "目录",
  1401. },
  1402. {
  1403. name: "讲义",
  1404. },
  1405. {
  1406. name: "笔记",
  1407. },
  1408. {
  1409. name: "答疑",
  1410. },
  1411. { name: "重修目录" },
  1412. ];
  1413. } else {
  1414. this.list = [
  1415. {
  1416. name: "目录",
  1417. },
  1418. {
  1419. name: "讲义",
  1420. },
  1421. {
  1422. name: "笔记",
  1423. },
  1424. {
  1425. name: "答疑",
  1426. },
  1427. ];
  1428. if (this.current == 4) {
  1429. this.current = 0;
  1430. }
  1431. }
  1432. });
  1433. }
  1434. });
  1435. this.$api
  1436. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  1437. .then((res) => {
  1438. console.log("noRebuild1");
  1439. if (res.data.code == 200) {
  1440. for (let i = 0; i < res.data.rows.length; i++) {
  1441. let item = res.data.rows[i];
  1442. item.down = true;
  1443. item.id = item.menuId;
  1444. item.name = item.menuName;
  1445. item.menuType = item.type;
  1446. }
  1447. this.menuList = [];
  1448. this.$nextTick(() => {
  1449. this.menuList = res.data.rows;
  1450. });
  1451. }
  1452. });
  1453. } else {
  1454. //从普通目录点击
  1455. this.$api
  1456. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  1457. .then((res) => {
  1458. console.log("noRebuild2");
  1459. if (res.data.code == 200) {
  1460. res.data.rows[index].name = res.data.rows[index].menuName;
  1461. res.data.rows[index].id = res.data.rows[index].menuId;
  1462. this.$set(this.menuList, index, res.data.rows[index]);
  1463. }
  1464. });
  1465. this.$api
  1466. .reMenuList({
  1467. orderGoodsId: this.orderGoodsId,
  1468. courseId: this.courseId,
  1469. rebuild: 1,
  1470. gradeId: this.gradeId,
  1471. })
  1472. .then((res) => {
  1473. console.log("Rebuild2");
  1474. if (res.data.code == 200) {
  1475. if (res.data.rows.length) {
  1476. // for (let i = 0; i < res.data.rows.length; i++) {
  1477. // let item = res.data.rows[i];
  1478. // item.down = true;
  1479. // item.id = item.menuId;
  1480. // item.name = item.menuName;
  1481. // }
  1482. // this.reMenuList = res.data.rows;
  1483. } else {
  1484. this.reMenuList = [];
  1485. }
  1486. this.$nextTick(() => {
  1487. if (this.reMenuList.length > 0) {
  1488. this.list = [
  1489. {
  1490. name: "目录",
  1491. },
  1492. {
  1493. name: "讲义",
  1494. },
  1495. {
  1496. name: "笔记",
  1497. },
  1498. {
  1499. name: "答疑",
  1500. },
  1501. { name: "重修目录" },
  1502. ];
  1503. } else {
  1504. this.list = [
  1505. {
  1506. name: "目录",
  1507. },
  1508. {
  1509. name: "讲义",
  1510. },
  1511. {
  1512. name: "笔记",
  1513. },
  1514. {
  1515. name: "答疑",
  1516. },
  1517. ];
  1518. if (this.current == 4) {
  1519. this.current = 0;
  1520. }
  1521. }
  1522. });
  1523. }
  1524. });
  1525. }
  1526. } else {
  1527. //没有重修目录
  1528. this.$api
  1529. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId ,orderGoodsId: this.orderGoodsId,})
  1530. .then((res) => {
  1531. console.log("noRebuild3-->this.courseId:", this.courseId);
  1532. console.log("noRebuild3index", index);
  1533. if (res.data.code == 200) {
  1534. res.data.rows[index].name = res.data.rows[index].menuName;
  1535. res.data.rows[index].id = res.data.rows[index].menuId;
  1536. this.$set(this.menuList, index, res.data.rows[index]);
  1537. }
  1538. });
  1539. }
  1540. },
  1541. goLive(item) {
  1542. let moduleId = item.moduleId || 0;
  1543. let chapterId = item.chapterId || 0;
  1544. let sectionId = item.sectionId || item.menuId;
  1545. let uuid = new Date().valueOf() + ""
  1546. // buyCourse 是否购买课程:1是 0否
  1547. let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='
  1548. +item.liveUrl+'&gradeId='+this.gradeId+'&courseId='+this.courseId+'&goodsId='+this.goodsId+'&orderGoodsId='+this.orderGoodsId+'&sectionId='+sectionId+
  1549. '&chapterId='+chapterId+'&moduleId='+moduleId+'&buyCourse=1'+'&ident='+uuid)
  1550. uni.navigateTo({
  1551. url:`../../pages/webview/index?url=`+encode
  1552. })
  1553. },
  1554. studyRecordMenuAllList() {
  1555. this.$api.studyRecordMenuAllList({
  1556. courseId:this.courseId,
  1557. gradeId:this.gradeId,
  1558. goodsId:this.goodsId
  1559. }).then(res => {
  1560. let nowTime = Number(new Date().getTime()/1000).toFixed(0)
  1561. // this.livingItem = res.data.data[0]
  1562. console.log('res.data.data---', res.data.data)
  1563. if (res.data.data) {
  1564. this.livingItem = res.data.data.find(item => item.liveStartTime<=nowTime&&item.liveEndTime>nowTime);
  1565. }
  1566. })
  1567. },
  1568. getbaseprofiletplists() {
  1569. return new Promise(resolve => {
  1570. let self = this;
  1571. this.getCameraSetting();
  1572. this.$api.getbaseprofiletplists({ goodsId: self.goodsId,orderGoodsId: this.orderGoodsId, }).then((res) => {
  1573. // console.log(res, "res1");
  1574. if (res.data.code === 200 && res.data.rows.length) {
  1575. if (res.data.rows[0].keyValue) {
  1576. self.$api.getbaseprofiletpId(self.goodsId).then((baseRes) => {
  1577. if (baseRes.data.code === 200) {
  1578. if (baseRes.data.data) {
  1579. // base/profile/tp/getInfo
  1580. self.$api
  1581. .getbaseprofiletpgetInfo({
  1582. goodsId: self.goodsId,
  1583. orderGoodsId: self.orderGoodsId,
  1584. })
  1585. .then((result) => {
  1586. console.log(result, "result");
  1587. if (result.data.code === 200) {
  1588. if (
  1589. !result.data.data ||
  1590. (result.data.data.status === 3 &&
  1591. result.data.data.changeStatus === 1)
  1592. ) {
  1593. if (!result.data.data) {
  1594. self.needProfileModal = true;
  1595. uni.showModal({
  1596. content: "请前往填写资料",
  1597. cancelText: "返回",
  1598. success: function (resultst) {
  1599. if (resultst.confirm) {
  1600. self.$navTo.togo("/pages2/verify/input", {
  1601. id: self.goodsId,
  1602. orderGoodsId: self.orderGoodsId,
  1603. });
  1604. }
  1605. if (resultst.cancel) {
  1606. uni.navigateBack();
  1607. }
  1608. },
  1609. });
  1610. } else {
  1611. self.needProfileModal = true;
  1612. uni.showModal({
  1613. content: "资料审核不通过,请前往重新填写",
  1614. cancelText: "返回",
  1615. success: function (resultst) {
  1616. if (resultst.confirm) {
  1617. self.$navTo.togo("/pages2/verify/input", {
  1618. id: self.goodsId,
  1619. orderGoodsId: self.orderGoodsId,
  1620. });
  1621. }
  1622. if (resultst.cancel) {
  1623. uni.navigateBack();
  1624. }
  1625. },
  1626. });
  1627. }
  1628. }
  1629. else if (
  1630. result.data.data.status === 1 &&
  1631. JSON.parse(res.data.rows[0].keyValue2)[0]
  1632. ) {
  1633. self.$api
  1634. .getbaseprofileStampgetInfo({
  1635. goodsId: self.goodsId,
  1636. orderGoodsId: self.orderGoodsId,
  1637. })
  1638. .then((k) => {
  1639. if (k.data.code === 200) {
  1640. if (
  1641. !k.data.data ||
  1642. (k.data.data.status === 3 &&
  1643. k.data.data.changeStatus === 1)
  1644. ) {
  1645. if (!k.data.data) {
  1646. self.needProfileModal = true;
  1647. uni.showModal({
  1648. cancelText: "返回",
  1649. content: "请前往填写盖章资料",
  1650. success: function (resultst) {
  1651. if (resultst.confirm) {
  1652. self.$navTo.togo(
  1653. "/pages2/verify/input2",
  1654. {
  1655. id: self.goodsId,
  1656. orderGoodsId: self.orderGoodsId,
  1657. }
  1658. );
  1659. }
  1660. if (resultst.cancel) {
  1661. uni.navigateBack();
  1662. }
  1663. },
  1664. });
  1665. } else {
  1666. self.needProfileModal = true;
  1667. uni.showModal({
  1668. cancelText: "返回",
  1669. content:
  1670. "资料盖章审核不通过,请前往重新填写",
  1671. success: function (resultst) {
  1672. if (resultst.confirm) {
  1673. self.$navTo.togo(
  1674. "/pages2/verify/input2",
  1675. {
  1676. id: self.goodsId,
  1677. orderGoodsId: self.orderGoodsId,
  1678. }
  1679. );
  1680. }
  1681. if (resultst.cancel) {
  1682. uni.navigateBack();
  1683. }
  1684. },
  1685. });
  1686. }
  1687. } else {
  1688. resolve();
  1689. }
  1690. }
  1691. });
  1692. } else {
  1693. resolve();
  1694. }
  1695. }
  1696. });
  1697. } else {
  1698. resolve();
  1699. }
  1700. }
  1701. });
  1702. } else {
  1703. resolve();
  1704. }
  1705. } else {
  1706. resolve();
  1707. }
  1708. });
  1709. if (this.gradeId > 0) {
  1710. //提交完资料返回判断是否已开班
  1711. this.getGradeInfo();
  1712. }
  1713. })
  1714. },
  1715. // /**
  1716. // * 获取业务层次详情
  1717. // */
  1718. // courseBusiness() {
  1719. // this.$api.courseBusiness(this.goodsData.businessId).then((res) => {
  1720. // this.businessData = res.data.data;
  1721. // });
  1722. // },
  1723. /**
  1724. * 计算tabs宽度
  1725. */
  1726. itemWidth() {
  1727. return 100 / this.list.length + "%";
  1728. },
  1729. /**
  1730. * 获取讲义权限
  1731. */
  1732. courseHandouts() {
  1733. this.$api.courseHandouts(this.goodsData.handoutsId).then((res) => {
  1734. this.courseHandoutsData = res.data.data;
  1735. });
  1736. },
  1737. findMenuNextSection(index) {
  1738. for (let i = index + 1; i < this.reMenuList.length; i++) {
  1739. let item = this.reMenuList[i];
  1740. if (item.type == 3) {
  1741. return item;
  1742. }
  1743. }
  1744. return {};
  1745. },
  1746. loadedmetadata(e) {
  1747. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1748. this.hasStart = true;
  1749. uni.$off('playPause')
  1750. uni.$on('playPause',() => {
  1751. polyvPlayerContext.pause()
  1752. })
  1753. if(!this.recordObj.videoCurrentTime) { //新视频直接提交一条观看记录
  1754. this.postStudyRecord(0)
  1755. }
  1756. },
  1757. getPhotoLastRecord() {
  1758. let self = this;
  1759. let data = {
  1760. sectionId: parseInt(self.playSectionId),
  1761. goodsId: parseInt(self.goodsId),
  1762. courseId: parseInt(self.courseId),
  1763. gradeId: parseInt(self.gradeId),
  1764. chapterId: parseInt(self.chapterId),
  1765. moduleId: parseInt(self.moduleId),
  1766. orderGoodsId: this.orderGoodsId,
  1767. };
  1768. this.$api.getPhotoLastRecord(data).then((res) => {
  1769. if (res.data.code == 200) {
  1770. //清空历史数据
  1771. self.photoHistoryList = [];
  1772. this.photoIndex = 0;
  1773. self.photoList = [];
  1774. for (let i = 0; i < res.data.data.length; i++) {
  1775. //-2存储随机拍照数组
  1776. if (res.data.data[i].photoIndex == -2) {
  1777. self.photoList = res.data.data[i].timeInterval.split(",");
  1778. } else {
  1779. self.photoHistoryList.push(res.data.data[i].photoIndex);
  1780. }
  1781. }
  1782. }
  1783. });
  1784. },
  1785. //postTime 只提交随机时间
  1786. postCoursePhotoRecord(postTime = false) {
  1787. return new Promise((resolve, reject) => {
  1788. let currentTime = 0;
  1789. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1790. if (polyvPlayerContext) {
  1791. currentTime = polyvPlayerContext.getCurrentTime();
  1792. }
  1793. let self = this;
  1794. let photoIndex = self.photoIndex;
  1795. let data = {
  1796. photo: self.ossAvatarUrl,
  1797. sectionId: parseInt(self.playSectionId),
  1798. goodsId: parseInt(self.goodsId),
  1799. courseId: parseInt(self.courseId),
  1800. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  1801. gradeId: parseInt(self.gradeId),
  1802. photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
  1803. photoNum: parseInt(self.photoNum),
  1804. chapterId: parseInt(self.chapterId),
  1805. moduleId: parseInt(self.moduleId),
  1806. timeInterval: postTime ? self.photoList.join(",") : "",
  1807. orderGoodsId: this.orderGoodsId,
  1808. };
  1809. // console.log("提交接口", data);
  1810. this.$api
  1811. .coursePhotoRecord(data)
  1812. .then((res) => {
  1813. console.log(res,'postCoursePhotoRecord')
  1814. if (res.data.code == 200) {
  1815. resolve();
  1816. } else {
  1817. reject();
  1818. }
  1819. })
  1820. .catch((err) => {
  1821. reject();
  1822. });
  1823. });
  1824. },
  1825. randomNum(minNum, maxNum) {
  1826. switch (arguments.length) {
  1827. case 1:
  1828. return parseInt(Math.random() * minNum + 1, 10);
  1829. break;
  1830. case 2:
  1831. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  1832. break;
  1833. default:
  1834. return 0;
  1835. break;
  1836. }
  1837. },
  1838. //配置随机拍照时间
  1839. configPhoto() {
  1840. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1841. let totalVideoTime = polyvPlayerContext.getDuration();
  1842. // console.log('totalVideoTime总时长:', totalVideoTime, 'this.photoList:', this.photoList)
  1843. let duration = polyvPlayerContext.getCurrentTime();
  1844. // console.log('取当前播放的时间点:', duration)
  1845. let photoNum = this.photoNum;
  1846. if (!this.photoConfig) {
  1847. this.photoConfig = true;
  1848. // let spaceTime = Math.floor(totalVideoTime/photoNum) //拍照时间区间
  1849. // if(spaceTime<5){//区间小于5秒
  1850. // photoNum = Math.floor(totalVideoTime/5)
  1851. // spaceTime = 5
  1852. // }
  1853. // if(photoNum<1){
  1854. // photoNum = 1 //只要设置,至少拍一次
  1855. // spaceTime = totalVideoTime
  1856. // }
  1857. // let initSpace = 0
  1858. //没有历史拍照间隔数据
  1859. if (this.photoList.length == 0) {
  1860. if (totalVideoTime >= 900) {
  1861. //大于15分钟
  1862. if (photoNum == 1) {
  1863. //开头拍1张
  1864. this.photoList.push(0);
  1865. } else if (photoNum == 3) {
  1866. //拍3张
  1867. this.photoList.push(0); //开头拍一张
  1868. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  1869. let centerMinTime = centerTime - 300; //前后5分钟
  1870. let centerMaxTime = centerTime + 300;
  1871. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  1872. this.photoList.push(centerTakeTime); //中间拍一张
  1873. let endMaxTime = totalVideoTime - 60;
  1874. let endMinTime = totalVideoTime - 300;
  1875. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1876. this.photoList.push(endTakeTime); //最后拍一张
  1877. }
  1878. } else {
  1879. //小于15分钟,只拍前后各一张
  1880. if (photoNum == 1) {
  1881. //开头拍1张
  1882. this.photoList.push(0);
  1883. } else if (photoNum == 3) {
  1884. //拍2张
  1885. if (totalVideoTime <= 300) {
  1886. //小于5分钟
  1887. this.photoList.push(0); //开头拍一张
  1888. let endTakeTime = this.randomNum(10, totalVideoTime); //中间随机取一张
  1889. this.photoList.push(endTakeTime);
  1890. } else {
  1891. this.photoList.push(0); //开头拍一张
  1892. let endMaxTime = totalVideoTime - 60;
  1893. let endMinTime = totalVideoTime - 300;
  1894. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1895. this.photoList.push(endTakeTime); //最后1-5分钟拍一张
  1896. }
  1897. }
  1898. }
  1899. // for(let i=0;i<photoNum;i++){
  1900. // let s = this.randomNum(initSpace,initSpace+spaceTime)
  1901. // if(s>totalVideoTime){
  1902. // s = totalVideoTime-1
  1903. // }
  1904. // if(s<=5){
  1905. // s =5 //避免出现5秒内拍照时间
  1906. // }
  1907. // this.photoList.push(s)
  1908. // initSpace+=spaceTime
  1909. // }
  1910. console.log(this.photoList, "随机拍照时间数组11", photoNum);
  1911. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  1912. }
  1913. console.log(this.photoList, "随机拍照时间数组");
  1914. //兼容已有观看历史
  1915. for (let i = 0; i < this.photoList.length - 1; i++) {
  1916. if (
  1917. this.photoList[i] < duration &&
  1918. this.photoList[i + 1] > duration
  1919. ) {
  1920. this.photoIndex = i + 1;
  1921. // console.log("我的修改了photoIndex")
  1922. break;
  1923. }
  1924. if (duration > this.photoList[this.photoList.length - 1]) {
  1925. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  1926. // console.log("我的修改了photoIndex")
  1927. break;
  1928. }
  1929. }
  1930. }
  1931. },
  1932. getLiveUid(channelId) {
  1933. let self = this;
  1934. return new Promise((resolve) => {
  1935. let data = {
  1936. channelId: channelId,
  1937. orderGoodsId: this.orderGoodsId,
  1938. };
  1939. self.$api.polyvSign(data).then((res) => {
  1940. resolve(res.data.data);
  1941. });
  1942. });
  1943. },
  1944. timeEventLiving() {
  1945. if (plv != null) {
  1946. if (this.livePlay) {
  1947. this.liveDuration = this.liveDuration + 1; //每隔1秒
  1948. if (this.liveDuration == 2) {
  1949. //直播第2秒拍照
  1950. console.log(this.channelItem)
  1951. console.log(this.photoHistoryList,'this.photoHistoryList')
  1952. if (
  1953. this.goodsPhotographConfig && this.goodsPhotographConfig.livephotograph == 1 &&
  1954. this.channelItem.learning != 1 && this.photoHistoryList.length == 0
  1955. ) {
  1956. //开启直播拍照
  1957. this.openPhoto();
  1958. } else {
  1959. this.postStudyRecord(0);
  1960. }
  1961. }
  1962. }
  1963. }
  1964. },
  1965. playerLiveStatusChange(e) {
  1966. const status = e.detail.status;
  1967. console.log("直播状态", status);
  1968. if (status === "live") {
  1969. console.log("开始直播");
  1970. //开始播放
  1971. if (this.timer) {
  1972. clearInterval(this.timer);
  1973. }
  1974. this.livePlay = true;
  1975. this.timer = setInterval(this.timeEventLiving, 1000); //定时器
  1976. }
  1977. if (status === "end") {
  1978. this.hasStart = false;
  1979. if (this.livePlay) {
  1980. //只有播放过的结束才提交,避免未开播触发结束
  1981. this.postStudyRecord(1);
  1982. }
  1983. console.log("结束直播");
  1984. this.livePlay = false;
  1985. // 未开始
  1986. }
  1987. },
  1988. closePlv() {
  1989. if (plv) {
  1990. plv.destroy();
  1991. }
  1992. },
  1993. playChannel(item) {
  1994. if (this.timer) {
  1995. clearInterval(this.timer);
  1996. }
  1997. this.startStatus = true;
  1998. this.initLive();
  1999. },
  2000. setLiveOption(status) {
  2001. const { userId, channelId, recordFileSimpleModel, playbackEnabled } =
  2002. this.detail;
  2003. const playRecordFile =
  2004. playbackEnabled && recordFileSimpleModel && status === "end";
  2005. this.videoOption = {
  2006. mode: "live",
  2007. uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
  2008. cid: this.playChannelId,
  2009. openId: this.userInfo.userAccount,
  2010. isAutoChange: false,
  2011. forceVideo: false,
  2012. };
  2013. },
  2014. async initLive() {
  2015. console.log(this.playChannelId, 7111);
  2016. this.liveObj = await this.getLiveUid(this.playChannelId);
  2017. this.initLiveOk = true;
  2018. let optionsData = {};
  2019. optionsData.mode = "live";
  2020. optionsData.forceVideo = false;
  2021. optionsData.channelId = this.playChannelId; // 频道ID '2553128'
  2022. optionsData.openId = this.userInfo.userAccount; // 用户openId this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
  2023. optionsData.userId = this.liveObj.uid; // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq'
  2024. let self = this;
  2025. this.closePlv();
  2026. plv.init(optionsData).then(({ detail, chat }) => {
  2027. self.liveDetail = detail;
  2028. // 设置mode为live的videoOption
  2029. this.setLiveOption();
  2030. if (detail.isPPT) {
  2031. chat.on(chat.events.SLICESTART, () => {
  2032. // 开始直播
  2033. });
  2034. } else {
  2035. plv.api.getOrdinaryLiveStatus(detail.stream);
  2036. }
  2037. });
  2038. },
  2039. openSetting(res) {
  2040. console.log(res, 98);
  2041. },
  2042. getCameraSetting() {
  2043. const self = this;
  2044. wx.getSetting({
  2045. success: (res) => {
  2046. if (res.authSetting["scope.camera"]) {
  2047. // 用户已经授权
  2048. self.showSet = false;
  2049. this.prendreAutoCarme = false
  2050. } else {
  2051. this.prendreAutoCarme = true
  2052. // 用户还没有授权,向用户发起授权请求
  2053. wx.authorize({
  2054. scope: "scope.camera",
  2055. success:() =>{
  2056. // 用户同意授权
  2057. self.showSet = false;
  2058. this.prendreAutoCarme = false
  2059. },
  2060. fail:() => {
  2061. // 用户不同意授权
  2062. self.showSet = true;
  2063. },
  2064. });
  2065. }
  2066. },
  2067. fail: (res) => {},
  2068. });
  2069. },
  2070. studyNotice() {
  2071. this.noticeShow = true;
  2072. },
  2073. //播放笔记视频
  2074. async playNoteVideo(item) {
  2075. if (this.timer) {
  2076. clearInterval(this.timer);
  2077. }
  2078. if (this.vid) {
  2079. //切换视频
  2080. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2081. polyvPlayerContext.changeVid(item.recordingUrl);
  2082. } else {
  2083. this.vid = item.recordingUrl;
  2084. }
  2085. this.recordObj = { videoCurrentTime: item.noteSecond };
  2086. if (this.recordObj.videoCurrentTime) {
  2087. this.needSeek = true; //需要跳转到播放记录
  2088. }
  2089. this.startStatus = true;
  2090. //获取节笔记
  2091. this.getNoteList();
  2092. },
  2093. //正常播放视频
  2094. async playVideo(item) {
  2095. console.log(item.recordingUrl,'22222222', this.vid);
  2096. if (this.timer) {
  2097. clearInterval(this.timer);
  2098. }
  2099. if (this.vid) {
  2100. //切换视频
  2101. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2102. console.log('polyvPlayerContext', polyvPlayerContext)
  2103. polyvPlayerContext && polyvPlayerContext.changeVid(item.recordingUrl);
  2104. } else {
  2105. this.vid = item.recordingUrl;
  2106. }
  2107. this.recordObj = null;
  2108. this.recordObj = await this.getRecordLast();
  2109. console.log('this.recordObj:', this.recordObj)
  2110. this.needSeek = true; //跳转到播放记录
  2111. this.startStatus = true;
  2112. // 提交学习记录
  2113. this.postStudyRecord(0)
  2114. //获取节笔记
  2115. this.getNoteList();
  2116. },
  2117. getRecordLast() {
  2118. return new Promise((resolve) => {
  2119. let data = {
  2120. gradeId: this.gradeId || this.gradeId == 0 ? Number(this.gradeId) : null,
  2121. goodsId: this.goodsId || this.goodsId == 0 ? Number(this.goodsId) : null,
  2122. sectionId: this.playSectionId || 0,
  2123. courseId: this.courseId || this.courseId == 0 ? Number(this.courseId) : null,
  2124. chapterId: this.chapterId || 0,
  2125. moduleId: this.moduleId || 0,
  2126. orderGoodsId: this.orderGoodsId,
  2127. };
  2128. // if (this.playSectionId || this.playSectionId == 0) {
  2129. // data.sectionId = Number(this.playSectionId)
  2130. // }
  2131. // if (this.chapterId || this.chapterId == 0) {
  2132. // data.chapterId = parseInt(this.chapterId)
  2133. // }
  2134. // if (this.moduleId || this.moduleId == 0) {
  2135. // data.moduleId = parseInt(this.moduleId)
  2136. // }
  2137. this.$api.recordLast(data).then((res) => {
  2138. resolve(res.data.data);
  2139. });
  2140. });
  2141. },
  2142. jumpNote(item) {
  2143. this.noteId = item.noteId;
  2144. //没视频播放
  2145. if (this.playSectionId == 0) {
  2146. console.log("即将跳到笔记位置1");
  2147. this.$u.toast("即将跳到笔记位置");
  2148. this.$store.commit("setPlaySectionId", {
  2149. playSectionId: item.sectionId || item.menuId,
  2150. });
  2151. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  2152. this.playNoteVideo(item);
  2153. } else {
  2154. //正在看当前笔记视频
  2155. console.log("即将跳到笔记位置2");
  2156. this.$u.toast("即将跳到笔记位置");
  2157. //跳到笔记时刻
  2158. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2159. polyvPlayerContext.seek(item.noteSecond);
  2160. polyvPlayerContext.play();
  2161. }
  2162. },
  2163. postNote() {
  2164. let self = this;
  2165. if (!(this.playSectionId > 0)) {
  2166. this.$u.toast("目前无播放视频");
  2167. return;
  2168. }
  2169. if (!this.noteValue) {
  2170. this.$u.toast("请输入内容");
  2171. return;
  2172. }
  2173. if (!this.gradeId) {
  2174. this.$u.toast("暂无班级数据");
  2175. return;
  2176. }
  2177. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2178. let noteDate = this.$method.getZeroTime();
  2179. let noteSecond = polyvPlayerContext.getCurrentTime();
  2180. console.log(noteSecond, 698);
  2181. if (!noteSecond) {
  2182. if (noteSecond == 0) {
  2183. //播放结束
  2184. noteSecond = polyvPlayerContext.getDuration();
  2185. console.log(noteSecond, 63398);
  2186. }
  2187. if (!noteSecond) {
  2188. this.$u.toast("视频暂未开始");
  2189. return;
  2190. }
  2191. }
  2192. let data = {
  2193. gradeId: this.gradeId,
  2194. goodsId: this.goodsId,
  2195. sectionId: this.playSectionId,
  2196. courseId: this.courseId,
  2197. noteText: this.noteValue,
  2198. noteDate: noteDate,
  2199. noteSecond: noteSecond,
  2200. orderGoodsId: this.orderGoodsId,
  2201. };
  2202. this.$api.postNote(data).then((res) => {
  2203. if (res.data.code == 200) {
  2204. this.$u.toast("发布成功");
  2205. self.getNoteList();
  2206. this.noteValue = "";
  2207. }
  2208. });
  2209. },
  2210. getGradeInfo() {
  2211. let self = this;
  2212. this.$store.state.allowLoading = false;
  2213. this.$api.goodsGradeInfo(this.gradeId).then((res) => {
  2214. if (res.data.code == 200) {
  2215. self.gradeDetail = res.data.data;
  2216. if (self.needProfileModal) {
  2217. return;
  2218. }
  2219. if (self.gradeDetail.learningStatus == 2) {
  2220. uni.showModal({
  2221. showCancel: false,
  2222. confirmText: "确定",
  2223. content:
  2224. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  2225. success: function (resultst) {
  2226. uni.navigateBack();
  2227. },
  2228. });
  2229. }
  2230. if (
  2231. self.gradeDetail.learningStatus == 3 &&
  2232. Number(self.gradeDetail.learningTimeStart) >
  2233. Number(new Date() / 1000)
  2234. ) {
  2235. uni.showModal({
  2236. showCancel: false,
  2237. cancelText: "返回",
  2238. content:
  2239. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  2240. success: function (resultst) {
  2241. uni.navigateBack();
  2242. },
  2243. });
  2244. }
  2245. }
  2246. });
  2247. this.$store.state.allowLoading = true;
  2248. },
  2249. getNoteList() {
  2250. let self = this;
  2251. self.noteList = [];
  2252. let data = {
  2253. courseId: this.courseId,
  2254. gradeId: this.gradeId,
  2255. goodsId: this.goodsId,
  2256. orderGoodsId: this.orderGoodsId,
  2257. };
  2258. if (this.playSectionId > 0) {
  2259. data.sectionId = this.playSectionId;
  2260. }
  2261. this.$api.noteList(data).then((res) => {
  2262. if (res.data.code == 200) {
  2263. self.noteList = res.data.rows;
  2264. }
  2265. });
  2266. },
  2267. delAnswer(answerId) {
  2268. let self = this;
  2269. let data = { answerId: answerId, status: -1 ,orderGoodsId: this.orderGoodsId,};
  2270. this.$api.delAnswer(data).then((res) => {
  2271. if (res.data.code == 200) {
  2272. self.getAnswerList();
  2273. }
  2274. });
  2275. },
  2276. clearCtx() {
  2277. console.log(4234);
  2278. this.placeholder = "您可以在这里输入答疑内容";
  2279. this.ctxValue = "";
  2280. this.assignUserId = 0;
  2281. },
  2282. focusNote(event) {
  2283. console.log('event', event.detail.height)
  2284. this.bottomHeight = event.detail.height
  2285. },
  2286. blurNote() {
  2287. this.bottomHeight = 0
  2288. },
  2289. blur() {
  2290. this.bottomHeight = 0
  2291. this.clearTimer = setTimeout(() => {
  2292. this.ctxValue = ""
  2293. this.isFocus = false;
  2294. this.assignUserId = 0;
  2295. this.placeholder = '您可以在这里输入答疑内容';
  2296. },2000)
  2297. },
  2298. replyContent(item) {
  2299. this.isFocus = true;
  2300. this.assignUserId = item.userId;
  2301. this.placeholder = "@" + item.realname;
  2302. },
  2303. delContent(item) {
  2304. this.delAnswer(item.answerId);
  2305. },
  2306. postAnswer() {
  2307. let self = this;
  2308. let data = {
  2309. courseId: this.courseId,
  2310. answerText: this.ctxValue,
  2311. goodsId: this.goodsId,
  2312. orderGoodsId: this.orderGoodsId,
  2313. };
  2314. if (this.assignUserId > 0) {
  2315. data.assignUserId = this.assignUserId;
  2316. }
  2317. this.$api.postAnswer(data).then((res) => {
  2318. if (res.data.code == 200) {
  2319. this.$u.toast("发布成功");
  2320. self.getAnswerList();
  2321. this.isFocus = false;
  2322. this.placeholder = "您可以在这里输入答疑内容";
  2323. this.ctxValue = "";
  2324. this.assignUserId = 0;
  2325. }
  2326. });
  2327. },
  2328. postContent() {
  2329. if (!this.ctxValue || this.ctxValue == "") {
  2330. this.$u.toast("请输入内容");
  2331. return;
  2332. }
  2333. this.postAnswer();
  2334. },
  2335. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  2336. // console.log("status", status);
  2337. let currentTime = 0;
  2338. let PlayDuration = 0;
  2339. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2340. if (polyvPlayerContext) {
  2341. currentTime = polyvPlayerContext.getCurrentTime(); //总的视频播放时刻
  2342. PlayDuration = polyvPlayerContext.getVideoPlayDuration(); //本次看的时长
  2343. }
  2344. if (this.playChannelId > 0) {
  2345. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  2346. }
  2347. let self = this;
  2348. let data = {
  2349. fromPlat: 1, //来源平台 1小程序 2网站
  2350. photo: self.ossAvatarUrl,
  2351. sectionId: sectionId || 0,
  2352. goodsId: parseInt(self.goodsId),
  2353. courseId: parseInt(self.courseId),
  2354. orderGoodsId: this.orderGoodsId,
  2355. studyDuration: parseInt(
  2356. PlayDuration > 0 ? PlayDuration : self.studyDuration
  2357. ),
  2358. gradeId: parseInt(self.gradeId),
  2359. chapterId: this.chapterId || 0,
  2360. moduleId: this.moduleId || 0,
  2361. videoCurrentTime: parseInt(
  2362. currentTime > 0 ? currentTime : self.studyDuration
  2363. ),
  2364. };
  2365. if (this.ossAvatarUrl) {
  2366. data.similarity = this.compareFaceData // 相似度
  2367. }
  2368. if (status > 0) {
  2369. data.status = status;
  2370. }
  2371. console.log("提交接口:", data,'sectionId:', sectionId,'chapterId:', self.chapterId,'moduleId:', self.moduleId, 'courseId:', this.courseId);
  2372. this.$api.studyRecord(data).then((res) => {
  2373. // console.log('提交接口的结果:', res)
  2374. if (res.data.code == 200) {
  2375. if (status > 0) {
  2376. let moduleId = this.moduleId || 0;
  2377. let chapterId = this.chapterId || 0;
  2378. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  2379. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  2380. console.log(playNextId, "playNextId");
  2381. console.log(playNextIdisRebuild, "playNextIdisRebuild");
  2382. uni.$emit("playNext" + playNextIdisRebuild, {
  2383. fromRebuild: this.isRebuild,
  2384. }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  2385. uni.$emit("playNext" + playNextId); //通知播放结束
  2386. }
  2387. self.ossAvatarUrl = "";
  2388. } else {
  2389. this.uploadLock = false;
  2390. uni.showToast({
  2391. icon: "none",
  2392. title: res.data.msg,
  2393. });
  2394. }
  2395. // console.log(res, "res");
  2396. });
  2397. },
  2398. uploadFile(options, int) {
  2399. console.log(options)
  2400. var self = this;
  2401. return new Promise((resolve, reject) => {
  2402. var data = {
  2403. imageStatus: int,
  2404. gradeId: this.gradeId,
  2405. orderGoodsId: this.orderGoodsId,
  2406. };
  2407. self.$api.aliyunpolicy(data).then((res) => {
  2408. if (res.data.code != 200) {
  2409. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  2410. return;
  2411. }
  2412. var ossToken = res.data.data.resultContent;
  2413. if (ossToken.host == null || ossToken.host == undefined) {
  2414. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  2415. return;
  2416. }
  2417. uni.uploadFile({
  2418. url: ossToken.host,
  2419. name: "file",
  2420. filePath: options,
  2421. fileType: "image",
  2422. header: {
  2423. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  2424. },
  2425. formData: {
  2426. key: ossToken.dir,
  2427. OSSAccessKeyId: ossToken.accessid,
  2428. policy: ossToken.policy,
  2429. Signature: ossToken.signature,
  2430. callback: ossToken.callback,
  2431. success_action_status: 200,
  2432. },
  2433. success: (result) => {
  2434. // if (result.statusCode === 200) {
  2435. this.$u.toast('上传成功')
  2436. self.ossAvatarUrl = ossToken.dir;
  2437. resolve();
  2438. // } else {
  2439. // uni.showToast({
  2440. // title: "上传失败",
  2441. // icon: "none",
  2442. // });
  2443. // this.openPhoto();
  2444. // return;
  2445. // }
  2446. },
  2447. fail: (error) => {
  2448. uni.showToast({
  2449. title: "上传接口报错,请重新拍照上传" + error,
  2450. icon: "none",
  2451. });
  2452. this.openPhoto();
  2453. return;
  2454. },
  2455. });
  2456. });
  2457. });
  2458. },
  2459. imageInfos() {
  2460. var self = this;
  2461. return new Promise((resolve, reject) => {
  2462. uni.getImageInfo({
  2463. src: self.avatarUrl,
  2464. success: async (res) => {
  2465. let canvasWidth = res.width; //图片原始长宽
  2466. let canvasHeight = res.height;
  2467. if (canvasWidth > 2000 || canvasHeight > 2000) {
  2468. uni.compressImage({
  2469. src: self.avatarUrl,
  2470. quality: 75,
  2471. width: "35%",
  2472. height: "35%",
  2473. success: async (rest) => {
  2474. const waitUpload = await self.uploadFile(
  2475. rest.tempFilePath,
  2476. 0
  2477. );
  2478. resolve(waitUpload);
  2479. },
  2480. });
  2481. } else if (canvasWidth > 1000 || canvasHeight > 1000) {
  2482. uni.compressImage({
  2483. src: self.avatarUrl,
  2484. quality: 75,
  2485. width: "50%",
  2486. height: "50%",
  2487. success: async (rest) => {
  2488. const waitUpload = await self.uploadFile(
  2489. rest.tempFilePath,
  2490. 0
  2491. );
  2492. resolve(waitUpload);
  2493. },
  2494. });
  2495. } else {
  2496. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  2497. resolve(waitUpload);
  2498. }
  2499. },
  2500. fail: (err) => {
  2501. this.$u.toast('图片上传失败')
  2502. }
  2503. });
  2504. });
  2505. },
  2506. timeEvent() {
  2507. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2508. if (polyvPlayerContext != null) {
  2509. this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
  2510. // console.log(this.playTime, 789, this.photoHistoryList)
  2511. // console.log('photoNum:', this.photoNum, 'this.photoList:', this.photoList, 'this.sectionItem.learning:', this.sectionItem.learning)
  2512. //判断是否需要拍照
  2513. if (this.photoNum > 0) {
  2514. this.configPhoto();
  2515. let photoTime = 0; //获取拍照秒数
  2516. for (let i = 0; i < this.photoList.length; i++) {
  2517. photoTime = Number(this.photoList[i]); //获取拍照秒数
  2518. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  2519. //3秒区间内才触发拍照,避免拉动滚动条
  2520. if (
  2521. this.photoHistoryList.indexOf(i) < 0 &&
  2522. this.sectionItem.learning != 1
  2523. ) {
  2524. //不存在拍照历史,没有重修过,没有学过,则拍照
  2525. //启动拍照
  2526. //暂停
  2527. polyvPlayerContext.exitFullScreen();
  2528. polyvPlayerContext.pause();
  2529. this.photoIndex = i;
  2530. this.openPhoto();
  2531. }
  2532. }
  2533. }
  2534. }
  2535. }
  2536. },
  2537. closeToast() {
  2538. clearTimeout(this.toastTimer);
  2539. this.videoToastShow = false;
  2540. },
  2541. restart() {
  2542. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2543. polyvPlayerContext.seek(0);
  2544. clearTimeout(this.toastTimer);
  2545. this.videoToastShow = false;
  2546. },
  2547. // 新增用户视频学习日志
  2548. studyLog() {
  2549. this.$http({
  2550. url: '/user/study/log',
  2551. method: 'post',
  2552. data: {
  2553. goodsId: this.goodsId,
  2554. courseId: this.courseId,
  2555. moduleId: this.moduleId || 0,
  2556. chapterId: this.chapterId || 0,
  2557. sectionId: this.playSectionId || 0,
  2558. fromPlat: 1, //来源平台 1小程序 2PC网站
  2559. goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  2560. orderGoodsId: this.orderGoodsId,
  2561. }
  2562. }).then((res) => {
  2563. })
  2564. },
  2565. onStateChange(newstate, oldstate) {
  2566. console.log('视频的开始播放事件', newstate.detail.newstate, this.needSeek)
  2567. if (newstate.detail.newstate == "playing") {
  2568. if (this.needSeek) {
  2569. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2570. if (this.recordObj.videoCurrentTime) {
  2571. polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
  2572. this.seekTime = this.$method.secondToDate(
  2573. this.recordObj.videoCurrentTime
  2574. );
  2575. this.videoToastShow = true;
  2576. this.toastTimer = setTimeout(() => {
  2577. this.videoToastShow = false;
  2578. }, 3000);
  2579. } else {
  2580. polyvPlayerContext.seek(1); //避免相同节继续播放
  2581. }
  2582. polyvPlayerContext.play();
  2583. this.needSeek = false;
  2584. // 新增用户视频学习日志
  2585. this.studyLog()
  2586. // 提交学习记录
  2587. }
  2588. //开始播放
  2589. if (this.timer) {
  2590. clearInterval(this.timer);
  2591. }
  2592. this.timer = setInterval(this.timeEvent, 1000); //定时器
  2593. }
  2594. if (newstate.detail.newstate == "pause") {
  2595. clearInterval(this.timer);
  2596. //暂停提交记录
  2597. /* this.ossAvatarUrl = ""
  2598. this.postStudyRecord() */
  2599. }
  2600. if (newstate.detail.newstate == "ended") {
  2601. clearInterval(this.timer);
  2602. uni.showToast({
  2603. icon: "none",
  2604. title: "播放完毕",
  2605. });
  2606. this.hasStart = false;
  2607. this.postStudyRecord(1);
  2608. // uni.$emit('playNext') //播放重修下一节
  2609. }
  2610. },
  2611. //拍照
  2612. openPhoto() {
  2613. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2614. if (polyvPlayerContext) {
  2615. polyvPlayerContext.exitFullScreen();
  2616. }
  2617. this.enableAutoRotation = false;
  2618. this.photoPopup = true;
  2619. this.isTaking = true;
  2620. uni.setKeepScreenOn({
  2621. keepScreenOn: true,
  2622. });
  2623. uni.authorize({
  2624. scope: "scope.camera",
  2625. success() {},
  2626. });
  2627. },
  2628. /**
  2629. * 人脸匹配
  2630. */
  2631. faceRecognition() {
  2632. return new Promise((resolve) => {
  2633. let fileSystem = uni.getFileSystemManager();
  2634. fileSystem.readFile({
  2635. filePath: `${this.avatarUrl}`,
  2636. encoding: "base64",
  2637. position: 0,
  2638. success: (res) => {
  2639. let base64 = "data:image/jpg;base64," + res.data;
  2640. // console.log({
  2641. // imageA: base64,
  2642. // orderGoodsId: this.orderGoodsId,
  2643. // gradeId: this.gradeId,
  2644. // },'base64Data')
  2645. this.$api
  2646. .faceCertificationCompareFace({
  2647. imageA: base64,
  2648. orderGoodsId: this.orderGoodsId,
  2649. gradeId: this.gradeId,
  2650. })
  2651. .then((res) => {
  2652. console.log(res, "res");
  2653. resolve(res.data.data);
  2654. }).catch((err) => {
  2655. // 当前网络延迟,
  2656. console.log('人脸识别错误:', err)
  2657. uni.showModal({
  2658. content: "当前网络延迟",
  2659. showCancel: false,
  2660. success: (resultst) => {
  2661. if (resultst.confirm) {
  2662. uni.navigateBack()
  2663. }
  2664. },
  2665. })
  2666. })
  2667. },
  2668. fail(err) {
  2669. // this.$u.toast('人脸识别错误!')
  2670. console.error(err, "err-----人脸识别错误");
  2671. },
  2672. });
  2673. });
  2674. },
  2675. async submit() {
  2676. console.log('this.uploadLock的值:', this.uploadLock)
  2677. if (this.uploadLock) {
  2678. return;
  2679. }
  2680. this.uploadLock = true;
  2681. let compareFaceData = await this.faceRecognition();
  2682. console.log(compareFaceData,'compareFaceData')
  2683. this.compareFaceData = compareFaceData
  2684. if (compareFaceData >= 80) {
  2685. const waitYS = await this.imageInfos();
  2686. this.postCoursePhotoRecord()
  2687. .then((res) => {
  2688. this.photoHistoryList.push(this.photoIndex);
  2689. this.postStudyRecord(); //提交记录
  2690. //恢复播放
  2691. uni.setKeepScreenOn({
  2692. keepScreenOn: false,
  2693. });
  2694. this.photoPopup = false;
  2695. this.uploadLock = false;
  2696. this.enableAutoRotation = true;
  2697. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2698. if (polyvPlayerContext != null) {
  2699. polyvPlayerContext.play();
  2700. }
  2701. })
  2702. .catch((err) => {
  2703. uni.showToast({
  2704. title: "上传接口报错,请重新拍照上传" + err,
  2705. icon: "none",
  2706. });
  2707. this.uploadLock = false;
  2708. this.openPhoto();
  2709. });
  2710. } else {
  2711. uni.showToast({
  2712. title: "人脸匹配不通过,请重新拍照上传",
  2713. icon: "none",
  2714. duration: 2000,
  2715. });
  2716. setTimeout(() => {
  2717. this.uploadLock = false;
  2718. this.openPhoto();
  2719. }, 2000);
  2720. return;
  2721. }
  2722. },
  2723. reTake() {
  2724. this.isTaking = true;
  2725. },
  2726. //确认拍照
  2727. takePhoto() {
  2728. var self = this;
  2729. const ctx = uni.createCameraContext();
  2730. ctx.takePhoto({
  2731. quality: "high",
  2732. success: (res) => {
  2733. self.avatarUrl = res.tempImagePath;
  2734. this.isTaking = false;
  2735. },
  2736. fail: (err) => {
  2737. },
  2738. });
  2739. },
  2740. playError(e) {
  2741. console.log(e);
  2742. },
  2743. //拍照报错
  2744. error(e) {
  2745. console.log(e.detail);
  2746. },
  2747. //关闭相机
  2748. closePhoto() {
  2749. this.photoPopup = false;
  2750. self.enableAutoRotation = true;
  2751. },
  2752. /**
  2753. * 进入全屏
  2754. */
  2755. fullscreenchange(event) {
  2756. console.log('进入全屏',event);
  2757. if (event.detail.direction == "vertical") {
  2758. this.navShow = true;
  2759. } else if (event.detail.direction == "horizontal") {
  2760. this.navShow = false;
  2761. }
  2762. },
  2763. getGoodsDetail() {
  2764. let self = this;
  2765. this.$api.goodsDetail(this.goodsId).then((res) => {
  2766. this.goodsData = res.data.data;
  2767. if(self.goodsData.buyNote) {
  2768. this.baseHandoutTipList()
  2769. }
  2770. self.gradeId = self.goodsData.gradeId;
  2771. console.log(self.gradeId, "班级ID");
  2772. this.courseBusiness(this.goodsData.businessId);
  2773. this.courseHandouts();
  2774. self.getMenuList();
  2775. self.getReMenuList(); //获取重修目录
  2776. setTimeout(function () {
  2777. if (!self.needProfileModal) {
  2778. self.getGradeInfo();
  2779. }
  2780. }, 500);
  2781. //获取节笔记
  2782. this.getNoteList();
  2783. if (self.goodsData.goodsPlayConfig) {
  2784. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  2785. if (self.goodsPlayConfig.autoPlay > 0) {
  2786. self.autoplay = true;
  2787. }
  2788. if (self.goodsPlayConfig.drag > 0) {
  2789. self.isAllowSeek = "yes";
  2790. }
  2791. if (self.goodsPlayConfig.speed > 0) {
  2792. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  2793. }
  2794. }
  2795. if (self.goodsData.goodsPhotographConfig) {
  2796. self.goodsPhotographConfig = JSON.parse(
  2797. self.goodsData.goodsPhotographConfig
  2798. );
  2799. if (self.goodsPhotographConfig.photoNum > 0) {
  2800. self.photoNum = self.goodsPhotographConfig.photoNum;
  2801. console.log(self.photoNum, 777777);
  2802. }
  2803. }
  2804. });
  2805. },
  2806. startVideo() {
  2807. this.startStatus = true;
  2808. },
  2809. getAnswerList() {
  2810. let self = this;
  2811. this.$api
  2812. .answerList({ courseId: this.courseId, goodsId: this.goodsId,orderGoodsId: this.orderGoodsId, })
  2813. .then((res) => {
  2814. if (res.data.code == 200) {
  2815. self.answerList = res.data.rows;
  2816. }
  2817. });
  2818. },
  2819. getReMenuList() {
  2820. let self = this;
  2821. this.$api
  2822. .reMenuList({
  2823. orderGoodsId: this.orderGoodsId,
  2824. courseId: this.courseId,
  2825. rebuild: 1,
  2826. gradeId: this.gradeId,
  2827. })
  2828. .then((res) => {
  2829. if (res.data.code == 200) {
  2830. for (let i = 0; i < res.data.rows.length; i++) {
  2831. let item = res.data.rows[i];
  2832. item.down = true;
  2833. item.id = item.menuId;
  2834. item.name = item.menuName;
  2835. }
  2836. self.reMenuList = res.data.rows;
  2837. if (self.reMenuList.length > 0) {
  2838. this.showNotes = false;
  2839. self.list = [
  2840. {
  2841. name: "目录",
  2842. },
  2843. {
  2844. name: "讲义",
  2845. },
  2846. {
  2847. name: "笔记",
  2848. },
  2849. {
  2850. name: "答疑",
  2851. },
  2852. { name: "重修目录" },
  2853. ];
  2854. this.current = 0;
  2855. } else {
  2856. self.list = [
  2857. {
  2858. name: "目录",
  2859. },
  2860. {
  2861. name: "讲义",
  2862. },
  2863. {
  2864. name: "笔记",
  2865. },
  2866. {
  2867. name: "答疑",
  2868. },
  2869. ];
  2870. this.current = 0;
  2871. }
  2872. }
  2873. });
  2874. },
  2875. getMenuList() {
  2876. let self = this;
  2877. // /course/menuList 查询课程目录结构列表
  2878. this.$api
  2879. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  2880. .then((res) => {
  2881. if (res.data.code == 200) {
  2882. for (let i = 0; i < res.data.rows.length; i++) {
  2883. let item = res.data.rows[i];
  2884. item.down = true;
  2885. item.id = item.menuId;
  2886. item.name = item.menuName;
  2887. item.menuType = item.type;
  2888. }
  2889. self.menuList = res.data.rows;
  2890. console.log('======menuList', this.menuList)
  2891. this.reStart = true
  2892. for (let i = 0; i < res.data.rows.length; i++) {
  2893. if (res.data.rows[i].type == 1) {
  2894. this.menuIndex = [i];
  2895. break;
  2896. } else if (res.data.rows[i].type == 2) {
  2897. this.menuIndex = [i];
  2898. break;
  2899. }
  2900. }
  2901. }
  2902. });
  2903. },
  2904. courseDetail() {
  2905. let self = this;
  2906. this.$api.courseDetail(this.courseId).then((res) => {
  2907. if (res.data.code == 200) {
  2908. // if (res.data.data.educationName == "继续教育") {
  2909. this.$api
  2910. .lockLockAction({
  2911. action: "jxjy",
  2912. uuid:this.$method.getUuid()
  2913. })
  2914. .then((res) => {});
  2915. this.lockTimer = setInterval(() => {
  2916. this.$api
  2917. .lockLockAction({
  2918. action: "jxjy",
  2919. uuid:this.$method.getUuid()
  2920. })
  2921. .then((res) => {});
  2922. }, 10000);
  2923. // websocket.sendMsg("doCourse");
  2924. // }
  2925. self.detail = res.data.data;
  2926. }
  2927. });
  2928. },
  2929. open(item) {
  2930. item.showChildren = !item.showChildren;
  2931. },
  2932. change(index) {
  2933. this.current = index;
  2934. },
  2935. openDocument() {
  2936. this.downLoading = true
  2937. let url = this.$method.splitImgHost(this.courseHandoutsData.handoutsUrl);
  2938. uni.downloadFile({
  2939. url: url,
  2940. success: (res) => {
  2941. var filePath = res.tempFilePath;
  2942. uni.openDocument({
  2943. filePath: filePath,
  2944. showMenu: this.courseHandoutsData.canDownload == 1 ? true : false,
  2945. success: (res) => {
  2946. this.downLoading = false
  2947. uni.setStorageSync('current', this.current)
  2948. console.log(res, "打开文档成功");
  2949. },
  2950. fail: (err) => {
  2951. this.downLoading = false
  2952. console.log(err);
  2953. uni.showToast({
  2954. icon: "none",
  2955. title: "文档地址错误",
  2956. });
  2957. },
  2958. });
  2959. },
  2960. fail: (err) => {
  2961. this.downLoading = false
  2962. uni.showModal({
  2963. title: "提示",
  2964. content: "文档错误," + err.errMsg,
  2965. showCancel: false,
  2966. });
  2967. },
  2968. });
  2969. },
  2970. clickMulu() {
  2971. this.muluStyle = !this.muluStyle
  2972. }
  2973. },
  2974. };
  2975. </script>
  2976. <style lang="scss" scope>
  2977. @import './css/detail.scss';
  2978. .top {
  2979. &__header {
  2980. position:relative;
  2981. width:100%;
  2982. height:150rpx;
  2983. padding:24rpx 150rpx 24rpx 24rpx;
  2984. .img {
  2985. position:absolute;
  2986. left:0;
  2987. top:0;
  2988. width:100%;
  2989. }
  2990. .note {
  2991. position:relative;
  2992. z-index: 10;
  2993. font-size: 24rpx;
  2994. font-family: PingFang SC;
  2995. font-weight: bold;
  2996. color: #EFDBFF;
  2997. }
  2998. .title {
  2999. position:relative;
  3000. z-index: 10;
  3001. font-size: 26rpx;
  3002. font-family: PingFang SC;
  3003. font-weight: bold;
  3004. color: #FFFFFF;
  3005. }
  3006. }
  3007. }
  3008. #top {
  3009. position: relative;
  3010. z-index: 99;
  3011. }
  3012. .polyv_detail {
  3013. display: flex;
  3014. flex-direction: column;
  3015. height: 100vh;
  3016. position: relative;
  3017. top: 0;
  3018. left: 0;
  3019. .pops {
  3020. position: absolute;
  3021. top: 0;
  3022. left: 0;
  3023. background: #ccc;
  3024. opacity: 0.5;
  3025. width: 100%;
  3026. height: 300rpx;
  3027. z-index: 9999;
  3028. }
  3029. .box {
  3030. flex: 1;
  3031. overflow: hidden;
  3032. margin: 16rpx 16rpx 100rpx 16rpx;
  3033. .box_in {
  3034. height: 100%;
  3035. }
  3036. }
  3037. .first_ml {
  3038. margin: 16rpx 16rpx 16rpx 16rpx;
  3039. }
  3040. }
  3041. .btnSet {
  3042. width: 440rpx;
  3043. height: 80rpx;
  3044. background: #007aff;
  3045. border-radius: 40rpx;
  3046. color: #ffffff;
  3047. font-size: 28rpx;
  3048. line-height: 80rpx;
  3049. }
  3050. .btnReply {
  3051. width: 80rpx;
  3052. height: 40rpx;
  3053. background: #e3f0ff;
  3054. border-radius: 16rpx;
  3055. text-align: center;
  3056. color: #007aff;
  3057. }
  3058. .btnDel {
  3059. width: 80rpx;
  3060. height: 40rpx;
  3061. background: #ffedf0;
  3062. border-radius: 16rpx;
  3063. text-align: center;
  3064. color: #ff2d55;
  3065. }
  3066. .btnReply {
  3067. width: 80rpx;
  3068. height: 40rpx;
  3069. background: #e3f0ff;
  3070. border-radius: 16rpx;
  3071. font-size: 24rpx;
  3072. }
  3073. .lecture-box {
  3074. display: flex;
  3075. align-items: center;
  3076. height: 80rpx;
  3077. background: #ffffff;
  3078. border-radius: 16rpx 16rpx 16rpx 16rpx;
  3079. .title {
  3080. padding: 10rpx;
  3081. flex: 1;
  3082. overflow: hidden;
  3083. text-overflow: ellipsis;
  3084. white-space: nowrap;
  3085. color: #333;
  3086. font-weight: bold;
  3087. font-size: 32rpx;
  3088. }
  3089. .btn {
  3090. display: flex;
  3091. align-items: center;
  3092. justify-content: center;
  3093. width: 80rpx;
  3094. height: 80rpx;
  3095. background: #ffffff;
  3096. box-shadow: -4rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.1);
  3097. border-radius: 16rpx 16rpx 16rpx 16rpx;
  3098. }
  3099. @keyframes rotation{
  3100. from {-webkit-transform: rotate(0deg);}
  3101. to {-webkit-transform: rotate(360deg);}
  3102. }
  3103. .loading_down {
  3104. transform: rotate(360deg);
  3105. animation: rotation 3s linear infinite;
  3106. }
  3107. }
  3108. .lecture-content {
  3109. background: #fff;
  3110. margin-top: 10rpx;
  3111. padding: 10rpx;
  3112. border-radius: 16rpx;
  3113. }
  3114. .photoBox {
  3115. width: 100%;
  3116. // background-color: #ffffff;
  3117. // border-radius: 24px 24px 0px 0px;
  3118. .photoTop {
  3119. width: 100%;
  3120. height: 74rpx;
  3121. border-radius: 20px 20px 0px 0px;
  3122. background-color: #ffffff;
  3123. display: flex;
  3124. align-items: center;
  3125. justify-content: center;
  3126. padding: 0rpx 38rpx;
  3127. .sqzz {
  3128. width: 28rpx;
  3129. height: 28rpx;
  3130. display: flex;
  3131. align-items: center;
  3132. justify-content: center;
  3133. }
  3134. .centersq {
  3135. color: #333;
  3136. font-size: 30rpx;
  3137. font-weight: 500;
  3138. }
  3139. }
  3140. .photoCenter {
  3141. width: 750rpx;
  3142. height: 75vh;
  3143. position: relative;
  3144. .center_camera {
  3145. width: 100%;
  3146. height: 75vh;
  3147. position: fixed;
  3148. .head_take {
  3149. width: 100%;
  3150. height: 75vh;
  3151. display: flex;
  3152. flex-direction: column;
  3153. }
  3154. .headTake_up {
  3155. width: 100%;
  3156. height: 100rpx;
  3157. }
  3158. .headTake_minddle {
  3159. display: flex;
  3160. .min_img {
  3161. width: 500rpx;
  3162. height: 550rpx;
  3163. }
  3164. .min_left, .min_right {
  3165. flex: 1;
  3166. height: 550rpx;
  3167. }
  3168. }
  3169. .headTake_down {
  3170. width: 100%;
  3171. flex: 1;
  3172. }
  3173. .color {
  3174. background-color: #333;
  3175. opacity: 0.5;
  3176. }
  3177. }
  3178. .custom {
  3179. width: 750rpx;
  3180. height: 75vh;
  3181. position: absolute;
  3182. z-index: 1000;
  3183. top: 0;
  3184. left: 0;
  3185. image {
  3186. width: 100%;
  3187. height: 100%;
  3188. }
  3189. }
  3190. }
  3191. .btns {
  3192. display: flex;
  3193. .btnResult {
  3194. height: 100rpx;
  3195. flex: 1;
  3196. background-color: #07c160;
  3197. text-align: center;
  3198. line-height: 100rpx;
  3199. color: #fff;
  3200. font-size: 32rpx;
  3201. font-weight: bold;
  3202. }
  3203. }
  3204. }
  3205. .chat_box {
  3206. display: flex;
  3207. padding: 20rpx;
  3208. justify-content: space-between;
  3209. }
  3210. .chat3 {
  3211. font-size: 30rpx;
  3212. font-family: PingFang SC;
  3213. font-weight: 500;
  3214. color: #666666;
  3215. margin-top: 10rpx;
  3216. }
  3217. .chat2 {
  3218. font-size: 20rpx;
  3219. font-family: PingFang SC;
  3220. font-weight: 500;
  3221. color: #999999;
  3222. margin-top: 10rpx;
  3223. }
  3224. .chat1 {
  3225. font-size: 24rpx;
  3226. font-family: PingFang SC;
  3227. font-weight: 500;
  3228. color: #333333;
  3229. }
  3230. .leftPadding {
  3231. margin-left: 8rpx;
  3232. }
  3233. .t2Content {
  3234. font-size: 24rpx;
  3235. font-family: PingFang SC;
  3236. font-weight: bold;
  3237. color: #999999;
  3238. line-height: 48rpx;
  3239. }
  3240. .tBox2 {
  3241. display: flex;
  3242. padding-top: 10rpx;
  3243. color: #333333;
  3244. font-size: 30rpx;
  3245. font-weight: 400;
  3246. }
  3247. .tBox {
  3248. display: flex;
  3249. align-items: center;
  3250. padding-top: 10rpx;
  3251. }
  3252. .title {
  3253. font-size: 24rpx;
  3254. color: #999999;
  3255. }
  3256. .Answering {
  3257. .answer_item {
  3258. &:nth-child(2) {
  3259. border-radius: 16rpx 16rpx 0rpx 0rpx;
  3260. }
  3261. &:nth-last-child(1) {
  3262. border-radius: 0rpx 0rpx 16rpx 16rpx;
  3263. }
  3264. }
  3265. }
  3266. .inputBottom {
  3267. position: fixed;
  3268. left: 0;
  3269. bottom: 0;
  3270. background: #ffffff;
  3271. height: 98rpx;
  3272. display: flex;
  3273. align-items: center;
  3274. width: 100%;
  3275. .flex_auto {
  3276. flex: 1;
  3277. margin-left: 10%;
  3278. // .input {
  3279. // height: 60rpx;
  3280. // }
  3281. }
  3282. .btn {
  3283. color: #007aff;
  3284. font-size: 30rpx;
  3285. font-weight: bold;
  3286. width: 15%;
  3287. text-align: center;
  3288. }
  3289. .input {
  3290. background: rgba(244, 244, 244, 0.98);
  3291. height: 60rpx;
  3292. border-radius: 24rpx;
  3293. margin-top: 12rpx;
  3294. }
  3295. }
  3296. .noteBox {
  3297. width: 100%;
  3298. background: #ffffff;
  3299. padding: 0rpx 10rpx 20rpx;
  3300. border-radius: 16rpx;
  3301. overflow: hidden;
  3302. .left_ti {
  3303. padding-top: 14rpx;
  3304. }
  3305. }
  3306. .dateBox {
  3307. width: 216rpx;
  3308. height: 48rpx;
  3309. background: #ffffff;
  3310. border-radius: 24rpx;
  3311. font-size: 24rpx;
  3312. color: #666666;
  3313. text-align: center;
  3314. line-height: 48rpx;
  3315. margin: 16rpx 0rpx 8rpx;
  3316. }
  3317. .t_content1 {
  3318. color: #007aff;
  3319. margin-left: 10rpx;
  3320. }
  3321. .tag1 {
  3322. border: 2rpx solid #007aff;
  3323. border-radius: 8rpx;
  3324. font-size: 20rpx;
  3325. color: #007aff;
  3326. padding: 5rpx;
  3327. }
  3328. .b_title {
  3329. color: #333333;
  3330. font-size: 30rpx;
  3331. font-weight: bold;
  3332. }
  3333. page {
  3334. background: #eaeef1;
  3335. }
  3336. .menuBox {
  3337. width: 100%;
  3338. background: #ffffff;
  3339. border-radius: 16rpx;
  3340. padding: 0rpx 20rpx;
  3341. margin-bottom: 20rpx;
  3342. }
  3343. .btnspric {
  3344. border-top: 1rpx solid #eee;
  3345. display: flex;
  3346. align-items: center;
  3347. justify-content: space-between;
  3348. height: 108rpx;
  3349. padding-left: 43rpx;
  3350. padding-right: 32rpx;
  3351. }
  3352. .btnspric > .lefprL {
  3353. font-size: 36rpx;
  3354. color: #0c141f;
  3355. font-weight: bold;
  3356. }
  3357. .btnspric > .lefprR {
  3358. padding: 0rpx 24rpx;
  3359. height: 60rpx;
  3360. line-height: 60rpx;
  3361. text-align: center;
  3362. color: #fff;
  3363. background: #32467b;
  3364. border-radius: 24rpx;
  3365. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  3366. }
  3367. .yhj,
  3368. .hdyhj {
  3369. padding: 24rpx 29rpx 24rpx 34rpx;
  3370. }
  3371. .yhj {
  3372. border-bottom: 16rpx solid #f9f9f9;
  3373. }
  3374. .yhjtit {
  3375. font-size: 30rpx;
  3376. color: #0c141f;
  3377. font-weight: 500;
  3378. margin-bottom: 14rpx;
  3379. }
  3380. .yhjList {
  3381. display: flex;
  3382. align-items: center;
  3383. justify-content: space-between;
  3384. margin-bottom: 14rpx;
  3385. }
  3386. .yhjList > .yhjLefts {
  3387. display: flex;
  3388. align-items: center;
  3389. }
  3390. .yhjLefts > .yhl {
  3391. color: #32467b;
  3392. font-size: 30rpx;
  3393. margin-right: 31rpx;
  3394. }
  3395. .yhjLefts > .yhbq {
  3396. font-size: 24rpx;
  3397. color: #ff9500;
  3398. border-radius: 18rpx;
  3399. background-color: rgba(255, 149, 0, 0.2);
  3400. border: 2rpx solid #ff9500;
  3401. height: 38rpx;
  3402. line-height: 38rpx;
  3403. padding: 0rpx 16rpx;
  3404. }
  3405. .ts {
  3406. font-size: 24rpx;
  3407. color: #999;
  3408. margin: 14rpx 0rpx;
  3409. padding-right: 29rpx;
  3410. padding-left: 34rpx;
  3411. }
  3412. .yh {
  3413. padding-top: 20rpx;
  3414. }
  3415. .yh > .yhtitle {
  3416. display: flex;
  3417. align-items: center;
  3418. justify-content: space-between;
  3419. padding-right: 29rpx;
  3420. padding-left: 34rpx;
  3421. }
  3422. .priceBxs {
  3423. display: flex;
  3424. align-items: center;
  3425. }
  3426. .priceBxs > .pricleft {
  3427. border-radius: 24rpx;
  3428. border: 1rpx solid #e91313;
  3429. background-color: rgba(233, 19, 19, 0.1);
  3430. padding: 0rpx 18rpx;
  3431. height: 49rpx;
  3432. line-height: 49rpx;
  3433. text-align: center;
  3434. font-size: 30rpx;
  3435. font-weight: 500;
  3436. color: #e91313;
  3437. margin-right: 13rpx;
  3438. }
  3439. .topBox {
  3440. padding: 32rpx 32rpx 24rpx;
  3441. border-bottom: 1rpx solid #eeeeee;
  3442. }
  3443. .topBox > .boldFonstType {
  3444. font-weight: 500;
  3445. font-size: 30rpx;
  3446. margin: 16rpx 0rpx 23rpx;
  3447. }
  3448. .topBox > .firstTopL {
  3449. display: flex;
  3450. align-items: center;
  3451. }
  3452. .topBox > .firstTopL > .imageBs {
  3453. width: 331rpx;
  3454. height: 160rpx;
  3455. border-radius: 6rpx;
  3456. overflow: hidden;
  3457. margin-right: 8rpx;
  3458. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  3459. }
  3460. .topBox > .firstTopL > .imageBs > image {
  3461. width: 100%;
  3462. height: 100%;
  3463. }
  3464. .topBox > .firstTopL > .textBs {
  3465. font-size: 30rpx;
  3466. font-weight: bold;
  3467. color: #0c141f;
  3468. }
  3469. .content {
  3470. padding: 24rpx;
  3471. text-align: left;
  3472. }
  3473. .catalogBox {
  3474. display: flex;
  3475. align-items: center;
  3476. flex-wrap: nowrap;
  3477. overflow-x: auto;
  3478. padding-left: 38rpx;
  3479. max-height: 305rpx;
  3480. overflow-y: auto;
  3481. transition: all 0.4s;
  3482. }
  3483. .catalogBox > .catalogA {
  3484. min-width: 200rpx;
  3485. height: 48rpx;
  3486. line-height: 48rpx;
  3487. // text-align: center;
  3488. border: 2rpx solid transparent;
  3489. white-space: nowrap;
  3490. text-overflow: ellipsis;
  3491. overflow: hidden;
  3492. word-break: break-all;
  3493. border-radius: 10rpx;
  3494. background: rgba(22, 119, 255, 0.05);
  3495. padding-left: 19rpx;
  3496. box-sizing: border-box;
  3497. padding-right: 15rpx;
  3498. margin-right: 16rpx;
  3499. margin-bottom: 20rpx;
  3500. margin-top: 15rpx;
  3501. font-size: 24rpx;
  3502. color: #666;
  3503. }
  3504. .catalogBox > .activesq {
  3505. border-color: #1677ff;
  3506. }
  3507. .changeCatalogBox {
  3508. display: block;
  3509. }
  3510. .catalogBox::-webkit-scrollbar {
  3511. display: none; /* Chrome Safari */
  3512. }
  3513. .price_t2 {
  3514. font-size: 18rpx;
  3515. font-family: PingFang SC;
  3516. font-weight: 500;
  3517. text-decoration: line-through;
  3518. color: #999999;
  3519. }
  3520. .price_t1 {
  3521. font-size: 33rpx;
  3522. font-family: PingFang SC;
  3523. font-weight: bold;
  3524. color: #e91313;
  3525. }
  3526. .sc_t {
  3527. font-size: 22rpx;
  3528. color: #000000;
  3529. }
  3530. .sc {
  3531. width: 29rpx;
  3532. height: 29rpx;
  3533. }
  3534. .buy {
  3535. width: 138rpx;
  3536. height: 48rpx;
  3537. line-height: 48rpx;
  3538. background: #32467b;
  3539. border-radius: 10rpx;
  3540. color: #ffffff;
  3541. font-size: 28rpx;
  3542. text-align: center;
  3543. vertical-align: middle;
  3544. position: absolute;
  3545. right: 30rpx;
  3546. }
  3547. .video_body {
  3548. padding-bottom: 96rpx;
  3549. }
  3550. .footer_tab {
  3551. position: fixed;
  3552. bottom: 0;
  3553. height: 96rpx;
  3554. width: 100%;
  3555. background-color: #ffffff;
  3556. }
  3557. .tj_box {
  3558. width: 50%;
  3559. display: inline-block;
  3560. text-align: center;
  3561. margin: 10rpx 0;
  3562. }
  3563. .teacher_t {
  3564. font-size: 24rpx;
  3565. font-family: PingFang SC;
  3566. font-weight: 400;
  3567. color: #666666;
  3568. line-height: 36rpx;
  3569. margin-left: 15rpx;
  3570. }
  3571. .teacher_img {
  3572. width: 87rpx;
  3573. height: 129rpx;
  3574. }
  3575. .t2 {
  3576. font-size: 24rpx;
  3577. font-family: PingFang SC;
  3578. color: #666666;
  3579. line-height: 36rpx;
  3580. margin: 15rpx;
  3581. }
  3582. .r_t2 {
  3583. width: 201rpx;
  3584. height: 49rpx;
  3585. background: rgba(22, 119, 255, 0.05);
  3586. border: 1rpx solid #32467b;
  3587. border-radius: 16rpx;
  3588. color: #666666;
  3589. font-size: 23rpx;
  3590. text-align: center;
  3591. display: flex;
  3592. align-items: center;
  3593. padding: 5rpx;
  3594. }
  3595. .scroll_box {
  3596. width: 100%;
  3597. height: 60rpx;
  3598. background: #ffffff;
  3599. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  3600. white-space: nowrap;
  3601. overflow: hidden;
  3602. margin: 15rpx 0;
  3603. }
  3604. .r_sliper {
  3605. padding: 0 20rpx;
  3606. }
  3607. .top_line {
  3608. width: 6rpx;
  3609. height: 22rpx;
  3610. background: #32467b;
  3611. margin-right: 10rpx;
  3612. }
  3613. .video_t2 {
  3614. font-size: 24rpx;
  3615. font-family: PingFang SC;
  3616. font-weight: 500;
  3617. color: #666666;
  3618. }
  3619. .video_play {
  3620. position: absolute;
  3621. width: 95rpx;
  3622. height: 95rpx;
  3623. top: 0;
  3624. left: 0;
  3625. right: 0;
  3626. bottom: 0;
  3627. margin: auto;
  3628. }
  3629. .video_box {
  3630. position: relative;
  3631. #playerVideo {
  3632. position: relative;
  3633. z-index: 99;
  3634. }
  3635. .video-toast {
  3636. position: absolute;
  3637. width: 686rpx;
  3638. height: 80rpx;
  3639. background: rgba(0, 0, 0, 0.6);
  3640. border-radius: 24rpx;
  3641. bottom: 100rpx;
  3642. left: 50%;
  3643. transform: translateX(-50%);
  3644. color: #fff;
  3645. display: flex;
  3646. font-size: 26rpx;
  3647. align-items: center;
  3648. overflow: visible;
  3649. &__text {
  3650. flex: 1;
  3651. margin-left: 40rpx;
  3652. }
  3653. &__btn {
  3654. width: 180rpx;
  3655. text-align: center;
  3656. border-left: 1rpx solid #fff;
  3657. }
  3658. }
  3659. .video-toast__close {
  3660. position: absolute;
  3661. right: 32rpx;
  3662. bottom: 184rpx;
  3663. width: 40rpx;
  3664. height: 40rpx;
  3665. line-height: 40rpx;
  3666. text-align: center;
  3667. background: rgba(0, 0, 0, 0.6);
  3668. border-radius: 50%;
  3669. color: rgba(255, 255, 255, 0.3);
  3670. }
  3671. }
  3672. .rotoct {
  3673. transform: rotate(90deg);
  3674. }
  3675. .slot-content {
  3676. padding: 0 20rpx;
  3677. }
  3678. .notice_modal {
  3679. .content {
  3680. width: 100%;
  3681. height: 100%;
  3682. padding: 20rpx;
  3683. .title {
  3684. color: #333;
  3685. line-height: 40rpx;
  3686. font-size: 30rpx;
  3687. text-align: center;
  3688. font-weight: bold;
  3689. }
  3690. .text {
  3691. line-height: 40rpx;
  3692. }
  3693. }
  3694. }
  3695. .full_mulu {
  3696. position: absolute;
  3697. top: 100rpx;
  3698. right: 20rpx;
  3699. width: 700rpx;
  3700. height: 515rpx;
  3701. color: #333;
  3702. display: flex;
  3703. align-items: center;
  3704. justify-content: space-between;
  3705. z-index: 99999;
  3706. .mulus {
  3707. width: 623rpx;
  3708. // height: 515rpx;
  3709. height: 400rpx;
  3710. overflow-y: scroll;
  3711. // overflow: scroll;
  3712. }
  3713. .mulu_box_in {
  3714. background-color: #b7b7b7;
  3715. border-radius: 16rpx;
  3716. // transition: all 0.5s;
  3717. &::after {
  3718. content: "";
  3719. width: 0;
  3720. height: 0;
  3721. position: absolute;
  3722. top: 235rpx;
  3723. right: 27px;
  3724. border-top: 16rpx solid transparent;
  3725. border-right: 16rpx solid transparent;
  3726. border-left: 16rpx solid #b7b7b7;
  3727. border-bottom: 16rpx solid transparent;
  3728. }
  3729. }
  3730. .mulu_box_out {
  3731. // visibility: hidden;
  3732. display: none;
  3733. }
  3734. .menuBox_mulu {
  3735. // width: 100%;
  3736. background: #ffffff;
  3737. border-radius: 16rpx;
  3738. padding: 0rpx 20rpx;
  3739. margin-bottom: 20rpx;
  3740. }
  3741. .ml_img {
  3742. position: absolute;
  3743. right: 0;
  3744. top: 100rpx;
  3745. }
  3746. .items {
  3747. width: 620rpx;
  3748. height: 100rpx;
  3749. border: 1rpx solid red;
  3750. }
  3751. }
  3752. </style>