detail.vue 113 KB

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