detail.vue 105 KB

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