detail.vue 114 KB

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