detail.vue 114 KB

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