detail.vue 114 KB

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