detail.vue 118 KB

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