detail.vue 106 KB

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