detail.vue 115 KB

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