detail.vue 104 KB

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