detail.vue 115 KB

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