detail.vue 106 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578
  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 || item.menuId });
  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 || null
  860. this.chapterId = item.chapterId || null
  861. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  862. this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId || item.menuId });
  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 || item.menuId });
  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. if (this.playSectionId > 0 && this.hasStart) {
  896. //退出提交记录
  897. console.log('退出提交记录sfhasdoufsou敖德萨所多', this.courseId)
  898. this.postStudyRecord();
  899. }
  900. //清除正在播放的节ID
  901. // this.$store.commit('setPlayObj',null)
  902. this.$store.commit("setPlaySectionId", { playSectionId: 0 });
  903. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  904. this.$store.commit("setPlayVID", { playVID: null });
  905. this.closePlv();
  906. //移除所有的事件监听器
  907. uni.$off();
  908. clearInterval(this.answerTimer);
  909. if (this.timer) {
  910. clearInterval(this.timer);
  911. }
  912. if (this.lockTimer) {
  913. clearInterval(this.lockTimer);
  914. this.$api
  915. .lockDelLock({
  916. action: "jxjy",
  917. uuid:this.$method.getUuid()
  918. })
  919. .then((res) => {});
  920. }
  921. uni.removeStorageSync('current')
  922. // websocket.sendMsg("delAction");
  923. },
  924. changeCourses() {
  925. this.toggleCourseShow = true
  926. },
  927. closePop() {
  928. this.toggleCourseShow = false
  929. },
  930. // 进入学习
  931. async jump(item, index) {
  932. console.log('item------>', item,'courseId:',item.courseId, 'goodsId:', this.goodsId, 'orderGoodsId:',item.orderGoodsId)
  933. this.vid = ''
  934. this.hasStart = true
  935. await this.originUnload()
  936. // return
  937. this.reStart = false
  938. this.courseId = item.courseId
  939. this.gradeId = item.gradeId
  940. this.toggleCourseShow = false
  941. if (index == 0) {
  942. if (item.rebuild === 0) {
  943. //未重修
  944. this.$navTo.togo("/pages2/learn/details", {
  945. id: item.courseId,
  946. gradeId: item.gradeId,
  947. goodsId: this.goodsId,
  948. orderGoodsId: this.orderGoodsId,
  949. });
  950. return;
  951. }
  952. this.$api.courseDetail(item.courseId).then((res) => {
  953. if (res.data.code == 200) {
  954. // if (res.data.data.educationName == "继续教育") {
  955. this.$api
  956. .lockLockStatus({
  957. action: "jxjy",
  958. uuid: this.$method.getUuid(),
  959. })
  960. .then((res) => {
  961. if (res.data.code == 200) {
  962. //有其他端在操作,不能学习
  963. uni.showToast({
  964. icon: "none",
  965. title: res.data.msg,
  966. mask: true,
  967. duration: 3000,
  968. });
  969. } else if (res.data.code == 500) {
  970. //可以学习
  971. // this.$navTo.togo("/pages3/polyv/detail", {
  972. // id: item.courseId,
  973. // goodsId: this.goodsId,
  974. // orderGoodsId: this.orderGoodsId,
  975. // });
  976. this.courseId = item.courseId
  977. // this.toggleCourseShow = false
  978. this.originOnShow()
  979. this.originMounted()
  980. }
  981. });
  982. }
  983. });
  984. } else {
  985. if (this.businessData.goodsLearningOrder == 2) {
  986. //学习顺序是从头到尾学习,没学完上一课不能学习下一课
  987. let prevItem = this.courseList[index - 1]; //上一课
  988. if (
  989. prevItem.stuAllNum + prevItem.recordNum ==
  990. prevItem.secAllNum + prevItem.examNum
  991. ) {
  992. if (item.rebuild === 0) {
  993. //未重修
  994. this.$navTo.togo("/pages2/learn/details", {
  995. id: item.courseId,
  996. gradeId: item.gradeId,
  997. goodsId: this.goodsId,
  998. orderGoodsId: this.orderGoodsId,
  999. });
  1000. return;
  1001. }
  1002. this.$api.courseDetail(item.courseId).then((res) => {
  1003. if (res.data.code == 200) {
  1004. // if (res.data.data.educationName == "继续教育") {
  1005. this.$api
  1006. .lockLockStatus({
  1007. action: "jxjy",
  1008. uuid: this.$method.getUuid(),
  1009. })
  1010. .then((res) => {
  1011. if (res.data.code == 200) {
  1012. //有其他端在操作,不能学习
  1013. uni.showToast({
  1014. icon: "none",
  1015. title: res.data.msg,
  1016. duration: 2000,
  1017. });
  1018. } else if (res.data.code == 500) {
  1019. //可以学习
  1020. // this.$navTo.togo("/pages3/polyv/detail", {
  1021. // id: item.courseId,
  1022. // goodsId: this.goodsId,
  1023. // orderGoodsId: this.orderGoodsId,
  1024. // });
  1025. this.courseId = item.courseId
  1026. // this.toggleCourseShow = false
  1027. this.originOnShow()
  1028. this.originMounted()
  1029. }
  1030. });
  1031. }
  1032. });
  1033. } else {
  1034. uni.showToast({
  1035. icon: "none",
  1036. title: "请按顺序学完上一课再学习这一课",
  1037. });
  1038. }
  1039. } else {
  1040. if (item.rebuild === 0) {
  1041. //未重修
  1042. this.$navTo.togo("/pages2/learn/details", {
  1043. id: item.courseId,
  1044. gradeId: item.gradeId,
  1045. goodsId: this.goodsId,
  1046. orderGoodsId: this.orderGoodsId,
  1047. });
  1048. return;
  1049. }
  1050. this.$api.courseDetail(item.courseId).then((res) => {
  1051. if (res.data.code == 200) {
  1052. // if (res.data.data.educationName == "继续教育") {
  1053. this.$api
  1054. .lockLockStatus({
  1055. action: "jxjy",
  1056. uuid: this.$method.getUuid(),
  1057. })
  1058. .then((res) => {
  1059. if (res.data.code == 200) {
  1060. //有其他端在操作,不能学习
  1061. uni.showToast({
  1062. icon: "none",
  1063. title: res.data.msg,
  1064. duration: 2000,
  1065. });
  1066. } else if (res.data.code == 500) {
  1067. //可以学习
  1068. // this.$navTo.togo("/pages3/polyv/detail", {
  1069. // id: item.courseId,
  1070. // goodsId: this.goodsId,
  1071. // orderGoodsId: this.orderGoodsId,
  1072. // });
  1073. this.courseId = item.courseId
  1074. // this.toggleCourseShow = false
  1075. this.originOnShow()
  1076. this.originMounted()
  1077. }
  1078. });
  1079. }
  1080. });
  1081. }
  1082. }
  1083. },
  1084. clickLeft() {
  1085. uni.navigateBack()
  1086. },
  1087. markCancel() {
  1088. uni.navigateBack({
  1089. delta:1
  1090. })
  1091. },
  1092. markConfirm() {
  1093. uni.setClipboardData({
  1094. data: this.markContent,
  1095. success: function() {
  1096. setTimeout(() => {
  1097. uni.navigateBack({
  1098. delta:1
  1099. })
  1100. },1000)
  1101. }
  1102. });
  1103. },
  1104. closeNotice() {
  1105. this.$api.baseHandoutTip({
  1106. orderGoodsId:this.orderGoodsId
  1107. }).then(res => {
  1108. })
  1109. },
  1110. baseHandoutTipList() {
  1111. this.$api.baseHandoutTipList({
  1112. orderGoodsId:this.orderGoodsId
  1113. }).then(res => {
  1114. if(res.data.rows.length == 0) {
  1115. this.noticeShow = true;
  1116. }
  1117. })
  1118. },
  1119. /**
  1120. * 获取上次观看的直播
  1121. */
  1122. studyRecordGetLastLive() {
  1123. this.$api.studyRecordGetLastLive({
  1124. orderGoodsId:this.orderGoodsId,
  1125. courseId:this.courseId
  1126. }).then(res => {
  1127. this.updateLiveLast(res.data.data)
  1128. })
  1129. },
  1130. studyRecordQueryLiveLast() {
  1131. // /study/record/queryLiveLast
  1132. this.$api.studyRecordQueryLiveLast({
  1133. orderGoodsId:this.orderGoodsId,
  1134. courseId:this.courseId
  1135. }).then(res => {
  1136. console.log(res,'couse最后一次观看的视频', this.courseId)
  1137. if(res.data.data) {
  1138. this.moduleId = res.data.data.moduleId
  1139. this.chapterId = res.data.data.chapterId
  1140. if(res.data.data.sectionType == 1) { //录播
  1141. // console.log('录播录播录播')
  1142. this.$store.commit("setPlaySectionId", { playSectionId: res.data.data.sectionId });
  1143. this.$store.commit("setPlayVID", { playVID: res.data.data.recordingUrl });
  1144. console.log('playVID:', this.playVID, 'playSectionId-', this.playSectionId, 'moduleId:', this.moduleId,'chapterId:', this.chapterId, 'courseId:', this.courseId)
  1145. this.sectionItem = res.data.data;
  1146. this.playVideo(res.data.data)
  1147. } else if(res.data.data.sectionType == 2) { //直播
  1148. this.studyRecordGetLastLive();
  1149. } else if(res.data.data.sectionType == 3) { //回放
  1150. this.$store.commit("setPlaySectionId", { playSectionId: res.data.data.sectionId });
  1151. this.$store.commit("setPlayVID", { playVID: res.data.data.recordingUrl });
  1152. this.sectionItem = res.data.data;
  1153. this.playVideo(res.data.data)
  1154. }
  1155. }
  1156. })
  1157. },
  1158. /**
  1159. * 模块大节播放完毕,刷新列表
  1160. */
  1161. sectionPlayEnd(isRebuild, index) {
  1162. console.log("sectionPlayEnd");
  1163. console.log("isRebuild", isRebuild), console.log("index", index);
  1164. if (this.reMenuList.length > 0) {
  1165. //有重修目录
  1166. if (isRebuild.isRebuild) {
  1167. //从重修点击
  1168. this.$api
  1169. .reMenuList({
  1170. orderGoodsId: this.orderGoodsId,
  1171. courseId: this.courseId,
  1172. rebuild: 1,
  1173. gradeId: this.gradeId,
  1174. })
  1175. .then((res) => {
  1176. console.log("Rebuild1");
  1177. if (res.data.code == 200) {
  1178. if (res.data.rows.length) {
  1179. res.data.rows[index].name = res.data.rows[index].menuName;
  1180. this.$set(this.reMenuList,index,res.data.rows[index])
  1181. for (let i = 0; i < res.data.rows.length; i++) {
  1182. let item = res.data.rows[i];
  1183. item.down = true;
  1184. item.id = item.menuId;
  1185. item.name = item.menuName;
  1186. }
  1187. this.reMenuList = []
  1188. this.$nextTick(() => {
  1189. this.reMenuList = res.data.rows;
  1190. console.log(this.reMenuList,'this.reMenuList1')
  1191. })
  1192. } else {
  1193. this.reMenuList = [];
  1194. }
  1195. this.$nextTick(() => {
  1196. if (this.reMenuList.length > 0) {
  1197. this.list = [
  1198. {
  1199. name: "目录",
  1200. },
  1201. {
  1202. name: "讲义",
  1203. },
  1204. {
  1205. name: "笔记",
  1206. },
  1207. {
  1208. name: "答疑",
  1209. },
  1210. { name: "重修目录" },
  1211. ];
  1212. } else {
  1213. this.list = [
  1214. {
  1215. name: "目录",
  1216. },
  1217. {
  1218. name: "讲义",
  1219. },
  1220. {
  1221. name: "笔记",
  1222. },
  1223. {
  1224. name: "答疑",
  1225. },
  1226. ];
  1227. if (this.current == 4) {
  1228. this.current = 0;
  1229. }
  1230. }
  1231. });
  1232. }
  1233. });
  1234. this.$api
  1235. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  1236. .then((res) => {
  1237. console.log("noRebuild1");
  1238. if (res.data.code == 200) {
  1239. for (let i = 0; i < res.data.rows.length; i++) {
  1240. let item = res.data.rows[i];
  1241. item.down = true;
  1242. item.id = item.menuId;
  1243. item.name = item.menuName;
  1244. item.menuType = item.type;
  1245. }
  1246. this.menuList = [];
  1247. this.$nextTick(() => {
  1248. this.menuList = res.data.rows;
  1249. console.log('nextTick==', this.menuList)
  1250. });
  1251. }
  1252. });
  1253. } else {
  1254. //从普通目录点击
  1255. this.$api
  1256. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  1257. .then((res) => {
  1258. console.log("noRebuild2");
  1259. if (res.data.code == 200) {
  1260. res.data.rows[index].name = res.data.rows[index].menuName;
  1261. res.data.rows[index].id = res.data.rows[index].menuId;
  1262. this.$set(this.menuList, index, res.data.rows[index]);
  1263. }
  1264. });
  1265. this.$api
  1266. .reMenuList({
  1267. orderGoodsId: this.orderGoodsId,
  1268. courseId: this.courseId,
  1269. rebuild: 1,
  1270. gradeId: this.gradeId,
  1271. })
  1272. .then((res) => {
  1273. console.log("Rebuild2");
  1274. if (res.data.code == 200) {
  1275. if (res.data.rows.length) {
  1276. // for (let i = 0; i < res.data.rows.length; i++) {
  1277. // let item = res.data.rows[i];
  1278. // item.down = true;
  1279. // item.id = item.menuId;
  1280. // item.name = item.menuName;
  1281. // }
  1282. // this.reMenuList = res.data.rows;
  1283. } else {
  1284. this.reMenuList = [];
  1285. }
  1286. this.$nextTick(() => {
  1287. if (this.reMenuList.length > 0) {
  1288. this.list = [
  1289. {
  1290. name: "目录",
  1291. },
  1292. {
  1293. name: "讲义",
  1294. },
  1295. {
  1296. name: "笔记",
  1297. },
  1298. {
  1299. name: "答疑",
  1300. },
  1301. { name: "重修目录" },
  1302. ];
  1303. } else {
  1304. this.list = [
  1305. {
  1306. name: "目录",
  1307. },
  1308. {
  1309. name: "讲义",
  1310. },
  1311. {
  1312. name: "笔记",
  1313. },
  1314. {
  1315. name: "答疑",
  1316. },
  1317. ];
  1318. if (this.current == 4) {
  1319. this.current = 0;
  1320. }
  1321. }
  1322. });
  1323. }
  1324. });
  1325. }
  1326. } else {
  1327. //没有重修目录
  1328. this.$api
  1329. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId ,orderGoodsId: this.orderGoodsId,})
  1330. .then((res) => {
  1331. console.log("noRebuild3-->this.courseId:", this.courseId);
  1332. console.log("noRebuild3index", index);
  1333. if (res.data.code == 200) {
  1334. res.data.rows[index].name = res.data.rows[index].menuName;
  1335. res.data.rows[index].id = res.data.rows[index].menuId;
  1336. this.$set(this.menuList, index, res.data.rows[index]);
  1337. }
  1338. });
  1339. }
  1340. },
  1341. goLive(item) {
  1342. let moduleId = item.moduleId || 0;
  1343. let chapterId = item.chapterId || 0;
  1344. let sectionId = item.sectionId || item.menuId;
  1345. let uuid = new Date().valueOf() + ""
  1346. // buyCourse 是否购买课程:1是 0否
  1347. let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='
  1348. +item.liveUrl+'&gradeId='+this.gradeId+'&courseId='+this.courseId+'&goodsId='+this.goodsId+'&orderGoodsId='+this.orderGoodsId+'&sectionId='+sectionId+
  1349. '&chapterId='+chapterId+'&moduleId='+moduleId+'&buyCourse=1'+'&ident='+uuid)
  1350. uni.navigateTo({
  1351. url:`../../pages/webview/index?url=`+encode
  1352. })
  1353. },
  1354. studyRecordMenuAllList() {
  1355. this.$api.studyRecordMenuAllList({
  1356. courseId:this.courseId,
  1357. gradeId:this.gradeId,
  1358. goodsId:this.goodsId
  1359. }).then(res => {
  1360. let nowTime = Number(new Date().getTime()/1000).toFixed(0)
  1361. // this.livingItem = res.data.data[0]
  1362. this.livingItem = res.data.data.find(item => item.liveStartTime<=nowTime&&item.liveEndTime>nowTime);
  1363. })
  1364. },
  1365. getbaseprofiletplists() {
  1366. return new Promise(resolve => {
  1367. let self = this;
  1368. this.getCameraSetting();
  1369. this.$api.getbaseprofiletplists({ goodsId: self.goodsId,orderGoodsId: this.orderGoodsId, }).then((res) => {
  1370. // console.log(res, "res1");
  1371. if (res.data.code === 200 && res.data.rows.length) {
  1372. if (res.data.rows[0].keyValue) {
  1373. self.$api.getbaseprofiletpId(self.goodsId).then((baseRes) => {
  1374. if (baseRes.data.code === 200) {
  1375. if (baseRes.data.data) {
  1376. // base/profile/tp/getInfo
  1377. self.$api
  1378. .getbaseprofiletpgetInfo({
  1379. goodsId: self.goodsId,
  1380. orderGoodsId: self.orderGoodsId,
  1381. })
  1382. .then((result) => {
  1383. console.log(result, "result");
  1384. if (result.data.code === 200) {
  1385. if (
  1386. !result.data.data ||
  1387. (result.data.data.status === 3 &&
  1388. result.data.data.changeStatus === 1)
  1389. ) {
  1390. if (!result.data.data) {
  1391. self.needProfileModal = true;
  1392. uni.showModal({
  1393. content: "请前往填写资料",
  1394. cancelText: "返回",
  1395. success: function (resultst) {
  1396. if (resultst.confirm) {
  1397. self.$navTo.togo("/pages2/verify/input", {
  1398. id: self.goodsId,
  1399. orderGoodsId: self.orderGoodsId,
  1400. });
  1401. }
  1402. if (resultst.cancel) {
  1403. uni.navigateBack();
  1404. }
  1405. },
  1406. });
  1407. } else {
  1408. self.needProfileModal = true;
  1409. uni.showModal({
  1410. content: "资料审核不通过,请前往重新填写",
  1411. cancelText: "返回",
  1412. success: function (resultst) {
  1413. if (resultst.confirm) {
  1414. self.$navTo.togo("/pages2/verify/input", {
  1415. id: self.goodsId,
  1416. orderGoodsId: self.orderGoodsId,
  1417. });
  1418. }
  1419. if (resultst.cancel) {
  1420. uni.navigateBack();
  1421. }
  1422. },
  1423. });
  1424. }
  1425. }
  1426. else if (
  1427. result.data.data.status === 1 &&
  1428. JSON.parse(res.data.rows[0].keyValue2)[0]
  1429. ) {
  1430. self.$api
  1431. .getbaseprofileStampgetInfo({
  1432. goodsId: self.goodsId,
  1433. orderGoodsId: self.orderGoodsId,
  1434. })
  1435. .then((k) => {
  1436. if (k.data.code === 200) {
  1437. if (
  1438. !k.data.data ||
  1439. (k.data.data.status === 3 &&
  1440. k.data.data.changeStatus === 1)
  1441. ) {
  1442. if (!k.data.data) {
  1443. self.needProfileModal = true;
  1444. uni.showModal({
  1445. cancelText: "返回",
  1446. content: "请前往填写盖章资料",
  1447. success: function (resultst) {
  1448. if (resultst.confirm) {
  1449. self.$navTo.togo(
  1450. "/pages2/verify/input2",
  1451. {
  1452. id: self.goodsId,
  1453. orderGoodsId: self.orderGoodsId,
  1454. }
  1455. );
  1456. }
  1457. if (resultst.cancel) {
  1458. uni.navigateBack();
  1459. }
  1460. },
  1461. });
  1462. } else {
  1463. self.needProfileModal = true;
  1464. uni.showModal({
  1465. cancelText: "返回",
  1466. content:
  1467. "资料盖章审核不通过,请前往重新填写",
  1468. success: function (resultst) {
  1469. if (resultst.confirm) {
  1470. self.$navTo.togo(
  1471. "/pages2/verify/input2",
  1472. {
  1473. id: self.goodsId,
  1474. orderGoodsId: self.orderGoodsId,
  1475. }
  1476. );
  1477. }
  1478. if (resultst.cancel) {
  1479. uni.navigateBack();
  1480. }
  1481. },
  1482. });
  1483. }
  1484. } else {
  1485. resolve();
  1486. }
  1487. }
  1488. });
  1489. } else {
  1490. resolve();
  1491. }
  1492. }
  1493. });
  1494. } else {
  1495. resolve();
  1496. }
  1497. }
  1498. });
  1499. } else {
  1500. resolve();
  1501. }
  1502. } else {
  1503. resolve();
  1504. }
  1505. });
  1506. if (this.gradeId > 0) {
  1507. //提交完资料返回判断是否已开班
  1508. this.getGradeInfo();
  1509. }
  1510. })
  1511. },
  1512. // /**
  1513. // * 获取业务层次详情
  1514. // */
  1515. // courseBusiness() {
  1516. // this.$api.courseBusiness(this.goodsData.businessId).then((res) => {
  1517. // this.businessData = res.data.data;
  1518. // });
  1519. // },
  1520. /**
  1521. * 计算tabs宽度
  1522. */
  1523. itemWidth() {
  1524. return 100 / this.list.length + "%";
  1525. },
  1526. /**
  1527. * 获取讲义权限
  1528. */
  1529. courseHandouts() {
  1530. this.$api.courseHandouts(this.goodsData.handoutsId).then((res) => {
  1531. this.courseHandoutsData = res.data.data;
  1532. });
  1533. },
  1534. findMenuNextSection(index) {
  1535. for (let i = index + 1; i < this.reMenuList.length; i++) {
  1536. let item = this.reMenuList[i];
  1537. if (item.type == 3) {
  1538. return item;
  1539. }
  1540. }
  1541. return {};
  1542. },
  1543. loadedmetadata(e) {
  1544. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1545. this.hasStart = true;
  1546. uni.$off('playPause')
  1547. uni.$on('playPause',() => {
  1548. polyvPlayerContext.pause()
  1549. })
  1550. if(!this.recordObj.videoCurrentTime) { //新视频直接提交一条观看记录
  1551. this.postStudyRecord(0)
  1552. }
  1553. },
  1554. getPhotoLastRecord() {
  1555. let self = this;
  1556. let data = {
  1557. sectionId: parseInt(self.playSectionId),
  1558. goodsId: parseInt(self.goodsId),
  1559. courseId: parseInt(self.courseId),
  1560. gradeId: parseInt(self.gradeId),
  1561. chapterId: parseInt(self.chapterId),
  1562. moduleId: parseInt(self.moduleId),
  1563. orderGoodsId: this.orderGoodsId,
  1564. };
  1565. this.$api.getPhotoLastRecord(data).then((res) => {
  1566. if (res.data.code == 200) {
  1567. //清空历史数据
  1568. self.photoHistoryList = [];
  1569. this.photoIndex = 0;
  1570. self.photoList = [];
  1571. for (let i = 0; i < res.data.data.length; i++) {
  1572. //-2存储随机拍照数组
  1573. if (res.data.data[i].photoIndex == -2) {
  1574. self.photoList = res.data.data[i].timeInterval.split(",");
  1575. } else {
  1576. self.photoHistoryList.push(res.data.data[i].photoIndex);
  1577. }
  1578. }
  1579. }
  1580. });
  1581. },
  1582. //postTime 只提交随机时间
  1583. postCoursePhotoRecord(postTime = false) {
  1584. return new Promise((resolve, reject) => {
  1585. let currentTime = 0;
  1586. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1587. if (polyvPlayerContext) {
  1588. currentTime = polyvPlayerContext.getCurrentTime();
  1589. }
  1590. let self = this;
  1591. let photoIndex = self.photoIndex;
  1592. let data = {
  1593. photo: self.ossAvatarUrl,
  1594. sectionId: parseInt(self.playSectionId),
  1595. goodsId: parseInt(self.goodsId),
  1596. courseId: parseInt(self.courseId),
  1597. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  1598. gradeId: parseInt(self.gradeId),
  1599. photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
  1600. photoNum: parseInt(self.photoNum),
  1601. chapterId: parseInt(self.chapterId),
  1602. moduleId: parseInt(self.moduleId),
  1603. timeInterval: postTime ? self.photoList.join(",") : "",
  1604. orderGoodsId: this.orderGoodsId,
  1605. };
  1606. // console.log("提交接口", data);
  1607. this.$api
  1608. .coursePhotoRecord(data)
  1609. .then((res) => {
  1610. console.log(res,'postCoursePhotoRecord')
  1611. if (res.data.code == 200) {
  1612. resolve();
  1613. } else {
  1614. reject();
  1615. }
  1616. })
  1617. .catch((err) => {
  1618. reject();
  1619. });
  1620. });
  1621. },
  1622. randomNum(minNum, maxNum) {
  1623. switch (arguments.length) {
  1624. case 1:
  1625. return parseInt(Math.random() * minNum + 1, 10);
  1626. break;
  1627. case 2:
  1628. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  1629. break;
  1630. default:
  1631. return 0;
  1632. break;
  1633. }
  1634. },
  1635. //配置随机拍照时间
  1636. configPhoto() {
  1637. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1638. let totalVideoTime = polyvPlayerContext.getDuration();
  1639. let duration = polyvPlayerContext.getCurrentTime();
  1640. let photoNum = this.photoNum;
  1641. if (!this.photoConfig) {
  1642. this.photoConfig = true;
  1643. // let spaceTime = Math.floor(totalVideoTime/photoNum) //拍照时间区间
  1644. // if(spaceTime<5){//区间小于5秒
  1645. // photoNum = Math.floor(totalVideoTime/5)
  1646. // spaceTime = 5
  1647. // }
  1648. // if(photoNum<1){
  1649. // photoNum = 1 //只要设置,至少拍一次
  1650. // spaceTime = totalVideoTime
  1651. // }
  1652. // let initSpace = 0
  1653. //没有历史拍照间隔数据
  1654. if (this.photoList.length == 0) {
  1655. if (totalVideoTime >= 900) {
  1656. //大于15分钟
  1657. if (photoNum == 1) {
  1658. //开头拍1张
  1659. this.photoList.push(0);
  1660. } else if (photoNum == 3) {
  1661. //拍3张
  1662. this.photoList.push(0); //开头拍一张
  1663. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  1664. let centerMinTime = centerTime - 300; //前后5分钟
  1665. let centerMaxTime = centerTime + 300;
  1666. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  1667. this.photoList.push(centerTakeTime); //中间拍一张
  1668. let endMaxTime = totalVideoTime - 60;
  1669. let endMinTime = totalVideoTime - 300;
  1670. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1671. this.photoList.push(endTakeTime); //最后拍一张
  1672. }
  1673. } else {
  1674. //小于15分钟,只拍前后各一张
  1675. if (photoNum == 1) {
  1676. //开头拍1张
  1677. this.photoList.push(0);
  1678. } else if (photoNum == 3) {
  1679. //拍2张
  1680. if (totalVideoTime <= 300) {
  1681. //小于5分钟
  1682. this.photoList.push(0); //开头拍一张
  1683. let endTakeTime = this.randomNum(10, totalVideoTime); //中间随机取一张
  1684. this.photoList.push(endTakeTime);
  1685. } else {
  1686. this.photoList.push(0); //开头拍一张
  1687. let endMaxTime = totalVideoTime - 60;
  1688. let endMinTime = totalVideoTime - 300;
  1689. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1690. this.photoList.push(endTakeTime); //最后1-5分钟拍一张
  1691. }
  1692. }
  1693. }
  1694. // for(let i=0;i<photoNum;i++){
  1695. // let s = this.randomNum(initSpace,initSpace+spaceTime)
  1696. // if(s>totalVideoTime){
  1697. // s = totalVideoTime-1
  1698. // }
  1699. // if(s<=5){
  1700. // s =5 //避免出现5秒内拍照时间
  1701. // }
  1702. // this.photoList.push(s)
  1703. // initSpace+=spaceTime
  1704. // }
  1705. console.log(this.photoList, "随机拍照时间数组11", photoNum);
  1706. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  1707. }
  1708. console.log(this.photoList, "随机拍照时间数组");
  1709. //兼容已有观看历史
  1710. for (let i = 0; i < this.photoList.length - 1; i++) {
  1711. if (
  1712. this.photoList[i] < duration &&
  1713. this.photoList[i + 1] > duration
  1714. ) {
  1715. this.photoIndex = i + 1;
  1716. // console.log("我的修改了photoIndex")
  1717. break;
  1718. }
  1719. if (duration > this.photoList[this.photoList.length - 1]) {
  1720. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  1721. // console.log("我的修改了photoIndex")
  1722. break;
  1723. }
  1724. }
  1725. }
  1726. },
  1727. getLiveUid(channelId) {
  1728. let self = this;
  1729. return new Promise((resolve) => {
  1730. let data = {
  1731. channelId: channelId,
  1732. orderGoodsId: this.orderGoodsId,
  1733. };
  1734. self.$api.polyvSign(data).then((res) => {
  1735. resolve(res.data.data);
  1736. });
  1737. });
  1738. },
  1739. timeEventLiving() {
  1740. if (plv != null) {
  1741. if (this.livePlay) {
  1742. this.liveDuration = this.liveDuration + 1; //每隔1秒
  1743. if (this.liveDuration == 2) {
  1744. //直播第2秒拍照
  1745. console.log(this.channelItem)
  1746. console.log(this.photoHistoryList,'this.photoHistoryList')
  1747. if (
  1748. this.goodsPhotographConfig && this.goodsPhotographConfig.livephotograph == 1 &&
  1749. this.channelItem.learning != 1 && this.photoHistoryList.length == 0
  1750. ) {
  1751. //开启直播拍照
  1752. this.openPhoto();
  1753. } else {
  1754. this.postStudyRecord(0);
  1755. }
  1756. }
  1757. }
  1758. }
  1759. },
  1760. playerLiveStatusChange(e) {
  1761. const status = e.detail.status;
  1762. console.log("直播状态", status);
  1763. if (status === "live") {
  1764. console.log("开始直播");
  1765. //开始播放
  1766. if (this.timer) {
  1767. clearInterval(this.timer);
  1768. }
  1769. this.livePlay = true;
  1770. this.timer = setInterval(this.timeEventLiving, 1000); //定时器
  1771. }
  1772. if (status === "end") {
  1773. this.hasStart = false;
  1774. if (this.livePlay) {
  1775. //只有播放过的结束才提交,避免未开播触发结束
  1776. this.postStudyRecord(1);
  1777. }
  1778. console.log("结束直播");
  1779. this.livePlay = false;
  1780. // 未开始
  1781. }
  1782. },
  1783. closePlv() {
  1784. if (plv) {
  1785. plv.destroy();
  1786. }
  1787. },
  1788. playChannel(item) {
  1789. if (this.timer) {
  1790. clearInterval(this.timer);
  1791. }
  1792. this.startStatus = true;
  1793. this.initLive();
  1794. },
  1795. setLiveOption(status) {
  1796. const { userId, channelId, recordFileSimpleModel, playbackEnabled } =
  1797. this.detail;
  1798. const playRecordFile =
  1799. playbackEnabled && recordFileSimpleModel && status === "end";
  1800. this.videoOption = {
  1801. mode: "live",
  1802. uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
  1803. cid: this.playChannelId,
  1804. openId: this.userInfo.userAccount,
  1805. isAutoChange: false,
  1806. forceVideo: false,
  1807. };
  1808. },
  1809. async initLive() {
  1810. console.log(this.playChannelId, 7111);
  1811. this.liveObj = await this.getLiveUid(this.playChannelId);
  1812. this.initLiveOk = true;
  1813. let optionsData = {};
  1814. optionsData.mode = "live";
  1815. optionsData.forceVideo = false;
  1816. optionsData.channelId = this.playChannelId; // 频道ID '2553128'
  1817. optionsData.openId = this.userInfo.userAccount; // 用户openId this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
  1818. optionsData.userId = this.liveObj.uid; // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq'
  1819. let self = this;
  1820. this.closePlv();
  1821. plv.init(optionsData).then(({ detail, chat }) => {
  1822. self.liveDetail = detail;
  1823. // 设置mode为live的videoOption
  1824. this.setLiveOption();
  1825. if (detail.isPPT) {
  1826. chat.on(chat.events.SLICESTART, () => {
  1827. // 开始直播
  1828. });
  1829. } else {
  1830. plv.api.getOrdinaryLiveStatus(detail.stream);
  1831. }
  1832. });
  1833. },
  1834. openSetting(res) {
  1835. console.log(res, 98);
  1836. },
  1837. getCameraSetting() {
  1838. const self = this;
  1839. wx.getSetting({
  1840. success: (res) => {
  1841. if (res.authSetting["scope.camera"]) {
  1842. // 用户已经授权
  1843. self.showSet = false;
  1844. } else {
  1845. // 用户还没有授权,向用户发起授权请求
  1846. wx.authorize({
  1847. scope: "scope.camera",
  1848. success() {
  1849. // 用户同意授权
  1850. self.showSet = false;
  1851. },
  1852. fail() {
  1853. // 用户不同意授权
  1854. self.showSet = true;
  1855. /* wx.showToast({
  1856. title: '摄像头授权失败',
  1857. icon: 'none',
  1858. duration: 3000
  1859. }) */
  1860. },
  1861. });
  1862. }
  1863. },
  1864. fail: (res) => {},
  1865. });
  1866. },
  1867. studyNotice() {
  1868. this.noticeShow = true;
  1869. },
  1870. //播放笔记视频
  1871. async playNoteVideo(item) {
  1872. if (this.timer) {
  1873. clearInterval(this.timer);
  1874. }
  1875. if (this.vid) {
  1876. //切换视频
  1877. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1878. polyvPlayerContext.changeVid(item.recordingUrl);
  1879. } else {
  1880. this.vid = item.recordingUrl;
  1881. }
  1882. this.recordObj = { videoCurrentTime: item.noteSecond };
  1883. if (this.recordObj.videoCurrentTime) {
  1884. this.needSeek = true; //需要跳转到播放记录
  1885. }
  1886. this.startStatus = true;
  1887. //获取节笔记
  1888. this.getNoteList();
  1889. },
  1890. //正常播放视频
  1891. async playVideo(item) {
  1892. console.log(item.recordingUrl,'22222222', this.vid);
  1893. if (this.timer) {
  1894. clearInterval(this.timer);
  1895. }
  1896. if (this.vid) {
  1897. //切换视频
  1898. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1899. console.log('polyvPlayerContext', polyvPlayerContext)
  1900. polyvPlayerContext && polyvPlayerContext.changeVid(item.recordingUrl);
  1901. } else {
  1902. this.vid = item.recordingUrl;
  1903. }
  1904. this.recordObj = null;
  1905. this.recordObj = await this.getRecordLast();
  1906. console.log('this.recordObj:', this.recordObj)
  1907. this.needSeek = true; //跳转到播放记录
  1908. this.startStatus = true;
  1909. // 提交学习记录
  1910. this.postStudyRecord(0)
  1911. //获取节笔记
  1912. this.getNoteList();
  1913. },
  1914. getRecordLast() {
  1915. return new Promise((resolve) => {
  1916. let data = {
  1917. gradeId: this.gradeId || this.gradeId == 0 ? Number(this.gradeId) : null,
  1918. goodsId: this.goodsId || this.goodsId == 0 ? Number(this.goodsId) : null,
  1919. sectionId: this.playSectionId || 0,
  1920. courseId: this.courseId || this.courseId == 0 ? Number(this.courseId) : null,
  1921. chapterId: this.chapterId || 0,
  1922. moduleId: this.moduleId || 0,
  1923. orderGoodsId: this.orderGoodsId,
  1924. };
  1925. // if (this.playSectionId || this.playSectionId == 0) {
  1926. // data.sectionId = Number(this.playSectionId)
  1927. // }
  1928. // if (this.chapterId || this.chapterId == 0) {
  1929. // data.chapterId = parseInt(this.chapterId)
  1930. // }
  1931. // if (this.moduleId || this.moduleId == 0) {
  1932. // data.moduleId = parseInt(this.moduleId)
  1933. // }
  1934. this.$api.recordLast(data).then((res) => {
  1935. resolve(res.data.data);
  1936. });
  1937. });
  1938. },
  1939. jumpNote(item) {
  1940. this.noteId = item.noteId;
  1941. //没视频播放
  1942. if (this.playSectionId == 0) {
  1943. console.log("即将跳到笔记位置1");
  1944. this.$u.toast("即将跳到笔记位置");
  1945. this.$store.commit("setPlaySectionId", {
  1946. playSectionId: item.sectionId || item.menuId,
  1947. });
  1948. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  1949. this.playNoteVideo(item);
  1950. } else {
  1951. //正在看当前笔记视频
  1952. console.log("即将跳到笔记位置2");
  1953. this.$u.toast("即将跳到笔记位置");
  1954. //跳到笔记时刻
  1955. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1956. polyvPlayerContext.seek(item.noteSecond);
  1957. polyvPlayerContext.play();
  1958. }
  1959. },
  1960. postNote() {
  1961. let self = this;
  1962. if (!(this.playSectionId > 0)) {
  1963. this.$u.toast("目前无播放视频");
  1964. return;
  1965. }
  1966. if (!this.noteValue) {
  1967. this.$u.toast("请输入内容");
  1968. return;
  1969. }
  1970. if (!this.gradeId) {
  1971. this.$u.toast("暂无班级数据");
  1972. return;
  1973. }
  1974. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1975. let noteDate = this.$method.getZeroTime();
  1976. let noteSecond = polyvPlayerContext.getCurrentTime();
  1977. console.log(noteSecond, 698);
  1978. if (!noteSecond) {
  1979. if (noteSecond == 0) {
  1980. //播放结束
  1981. noteSecond = polyvPlayerContext.getDuration();
  1982. console.log(noteSecond, 63398);
  1983. }
  1984. if (!noteSecond) {
  1985. this.$u.toast("视频暂未开始");
  1986. return;
  1987. }
  1988. }
  1989. let data = {
  1990. gradeId: this.gradeId,
  1991. goodsId: this.goodsId,
  1992. sectionId: this.playSectionId,
  1993. courseId: this.courseId,
  1994. noteText: this.noteValue,
  1995. noteDate: noteDate,
  1996. noteSecond: noteSecond,
  1997. orderGoodsId: this.orderGoodsId,
  1998. };
  1999. this.$api.postNote(data).then((res) => {
  2000. if (res.data.code == 200) {
  2001. this.$u.toast("发布成功");
  2002. self.getNoteList();
  2003. this.noteValue = "";
  2004. }
  2005. });
  2006. },
  2007. getGradeInfo() {
  2008. let self = this;
  2009. this.$store.state.allowLoading = false;
  2010. this.$api.goodsGradeInfo(this.gradeId).then((res) => {
  2011. if (res.data.code == 200) {
  2012. self.gradeDetail = res.data.data;
  2013. if (self.needProfileModal) {
  2014. return;
  2015. }
  2016. if (self.gradeDetail.learningStatus == 2) {
  2017. uni.showModal({
  2018. showCancel: false,
  2019. confirmText: "确定",
  2020. content:
  2021. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  2022. success: function (resultst) {
  2023. uni.navigateBack();
  2024. },
  2025. });
  2026. }
  2027. if (
  2028. self.gradeDetail.learningStatus == 3 &&
  2029. Number(self.gradeDetail.learningTimeStart) >
  2030. Number(new Date() / 1000)
  2031. ) {
  2032. uni.showModal({
  2033. showCancel: false,
  2034. cancelText: "返回",
  2035. content:
  2036. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  2037. success: function (resultst) {
  2038. uni.navigateBack();
  2039. },
  2040. });
  2041. }
  2042. }
  2043. });
  2044. this.$store.state.allowLoading = true;
  2045. },
  2046. getNoteList() {
  2047. let self = this;
  2048. self.noteList = [];
  2049. let data = {
  2050. courseId: this.courseId,
  2051. gradeId: this.gradeId,
  2052. goodsId: this.goodsId,
  2053. orderGoodsId: this.orderGoodsId,
  2054. };
  2055. if (this.playSectionId > 0) {
  2056. data.sectionId = this.playSectionId;
  2057. }
  2058. this.$api.noteList(data).then((res) => {
  2059. if (res.data.code == 200) {
  2060. self.noteList = res.data.rows;
  2061. }
  2062. });
  2063. },
  2064. delAnswer(answerId) {
  2065. let self = this;
  2066. let data = { answerId: answerId, status: -1 ,orderGoodsId: this.orderGoodsId,};
  2067. this.$api.delAnswer(data).then((res) => {
  2068. if (res.data.code == 200) {
  2069. self.getAnswerList();
  2070. }
  2071. });
  2072. },
  2073. clearCtx() {
  2074. console.log(4234);
  2075. this.placeholder = "您可以在这里输入答疑内容";
  2076. this.ctxValue = "";
  2077. this.assignUserId = 0;
  2078. },
  2079. focusNote(event) {
  2080. console.log('event', event.detail.height)
  2081. this.bottomHeight = event.detail.height
  2082. },
  2083. blurNote() {
  2084. this.bottomHeight = 0
  2085. },
  2086. blur() {
  2087. this.bottomHeight = 0
  2088. this.clearTimer = setTimeout(() => {
  2089. this.ctxValue = ""
  2090. this.isFocus = false;
  2091. this.assignUserId = 0;
  2092. this.placeholder = '您可以在这里输入答疑内容';
  2093. },2000)
  2094. },
  2095. replyContent(item) {
  2096. this.isFocus = true;
  2097. this.assignUserId = item.userId;
  2098. this.placeholder = "@" + item.realname;
  2099. },
  2100. delContent(item) {
  2101. this.delAnswer(item.answerId);
  2102. },
  2103. postAnswer() {
  2104. let self = this;
  2105. let data = {
  2106. courseId: this.courseId,
  2107. answerText: this.ctxValue,
  2108. goodsId: this.goodsId,
  2109. orderGoodsId: this.orderGoodsId,
  2110. };
  2111. if (this.assignUserId > 0) {
  2112. data.assignUserId = this.assignUserId;
  2113. }
  2114. this.$api.postAnswer(data).then((res) => {
  2115. if (res.data.code == 200) {
  2116. this.$u.toast("发布成功");
  2117. self.getAnswerList();
  2118. this.isFocus = false;
  2119. this.placeholder = "您可以在这里输入答疑内容";
  2120. this.ctxValue = "";
  2121. this.assignUserId = 0;
  2122. }
  2123. });
  2124. },
  2125. postContent() {
  2126. if (!this.ctxValue || this.ctxValue == "") {
  2127. this.$u.toast("请输入内容");
  2128. return;
  2129. }
  2130. this.postAnswer();
  2131. },
  2132. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  2133. // console.log("status", status);
  2134. let currentTime = 0;
  2135. let PlayDuration = 0;
  2136. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2137. if (polyvPlayerContext) {
  2138. currentTime = polyvPlayerContext.getCurrentTime(); //总的视频播放时刻
  2139. PlayDuration = polyvPlayerContext.getVideoPlayDuration(); //本次看的时长
  2140. }
  2141. if (this.playChannelId > 0) {
  2142. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  2143. }
  2144. let self = this;
  2145. let data = {
  2146. fromPlat: 1, //来源平台 1小程序 2网站
  2147. photo: self.ossAvatarUrl,
  2148. sectionId: sectionId || 0,
  2149. goodsId: parseInt(self.goodsId),
  2150. courseId: parseInt(self.courseId),
  2151. orderGoodsId: this.orderGoodsId,
  2152. studyDuration: parseInt(
  2153. PlayDuration > 0 ? PlayDuration : self.studyDuration
  2154. ),
  2155. gradeId: parseInt(self.gradeId),
  2156. chapterId: this.chapterId || 0,
  2157. moduleId: this.moduleId || 0,
  2158. videoCurrentTime: parseInt(
  2159. currentTime > 0 ? currentTime : self.studyDuration
  2160. ),
  2161. };
  2162. if (status > 0) {
  2163. data.status = status;
  2164. }
  2165. console.log("提交接口:", data,'sectionId:', sectionId,'chapterId:', self.chapterId,'moduleId:', self.moduleId, 'courseId:', this.courseId);
  2166. this.$api.studyRecord(data).then((res) => {
  2167. console.log('提交接口的结果:', res)
  2168. if (res.data.code == 200) {
  2169. if (status > 0) {
  2170. let moduleId = this.moduleId || 0;
  2171. let chapterId = this.chapterId || 0;
  2172. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  2173. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  2174. console.log(playNextId, "playNextId");
  2175. console.log(playNextIdisRebuild, "playNextIdisRebuild");
  2176. uni.$emit("playNext" + playNextIdisRebuild, {
  2177. fromRebuild: this.isRebuild,
  2178. }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  2179. uni.$emit("playNext" + playNextId); //通知播放结束
  2180. }
  2181. self.ossAvatarUrl = "";
  2182. } else {
  2183. this.uploadLock = false;
  2184. uni.showToast({
  2185. icon: "none",
  2186. title: res.data.msg,
  2187. });
  2188. }
  2189. // console.log(res, "res");
  2190. });
  2191. },
  2192. uploadFile(options, int) {
  2193. console.log(options)
  2194. var self = this;
  2195. return new Promise((resolve, reject) => {
  2196. var data = {
  2197. imageStatus: int,
  2198. gradeId: this.gradeId,
  2199. orderGoodsId: this.orderGoodsId,
  2200. };
  2201. self.$api.aliyunpolicy(data).then((res) => {
  2202. if (res.data.code != 200) {
  2203. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  2204. return;
  2205. }
  2206. var ossToken = res.data.data.resultContent;
  2207. if (ossToken.host == null || ossToken.host == undefined) {
  2208. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  2209. return;
  2210. }
  2211. uni.uploadFile({
  2212. url: ossToken.host,
  2213. name: "file",
  2214. filePath: options,
  2215. fileType: "image",
  2216. header: {
  2217. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  2218. },
  2219. formData: {
  2220. key: ossToken.dir,
  2221. OSSAccessKeyId: ossToken.accessid,
  2222. policy: ossToken.policy,
  2223. Signature: ossToken.signature,
  2224. callback: ossToken.callback,
  2225. success_action_status: 200,
  2226. },
  2227. success: (result) => {
  2228. // if (result.statusCode === 200) {
  2229. this.$u.toast('上传成功')
  2230. self.ossAvatarUrl = ossToken.dir;
  2231. resolve();
  2232. // } else {
  2233. // uni.showToast({
  2234. // title: "上传失败",
  2235. // icon: "none",
  2236. // });
  2237. // this.openPhoto();
  2238. // return;
  2239. // }
  2240. },
  2241. fail: (error) => {
  2242. uni.showToast({
  2243. title: "上传接口报错,请重新拍照上传" + error,
  2244. icon: "none",
  2245. });
  2246. this.openPhoto();
  2247. return;
  2248. },
  2249. });
  2250. });
  2251. });
  2252. },
  2253. imageInfos() {
  2254. var self = this;
  2255. return new Promise((resolve, reject) => {
  2256. uni.getImageInfo({
  2257. src: self.avatarUrl,
  2258. success: async (res) => {
  2259. let canvasWidth = res.width; //图片原始长宽
  2260. let canvasHeight = res.height;
  2261. if (canvasWidth > 2000 || canvasHeight > 2000) {
  2262. uni.compressImage({
  2263. src: self.avatarUrl,
  2264. quality: 75,
  2265. width: "35%",
  2266. height: "35%",
  2267. success: async (rest) => {
  2268. const waitUpload = await self.uploadFile(
  2269. rest.tempFilePath,
  2270. 0
  2271. );
  2272. resolve(waitUpload);
  2273. },
  2274. });
  2275. } else if (canvasWidth > 1000 || canvasHeight > 1000) {
  2276. uni.compressImage({
  2277. src: self.avatarUrl,
  2278. quality: 75,
  2279. width: "50%",
  2280. height: "50%",
  2281. success: async (rest) => {
  2282. const waitUpload = await self.uploadFile(
  2283. rest.tempFilePath,
  2284. 0
  2285. );
  2286. resolve(waitUpload);
  2287. },
  2288. });
  2289. } else {
  2290. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  2291. resolve(waitUpload);
  2292. }
  2293. },
  2294. fail: (err) => {
  2295. this.$u.toast('图片上传失败')
  2296. }
  2297. });
  2298. });
  2299. },
  2300. timeEvent() {
  2301. let self = this;
  2302. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2303. if (polyvPlayerContext != null) {
  2304. this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
  2305. // console.log(this.playTime,789,this.photoHistoryList)
  2306. //判断是否需要拍照
  2307. if (this.photoNum > 0) {
  2308. this.configPhoto();
  2309. let photoTime = 0; //获取拍照秒数
  2310. for (let i = 0; i < this.photoList.length; i++) {
  2311. photoTime = Number(this.photoList[i]); //获取拍照秒数
  2312. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  2313. //3秒区间内才触发拍照,避免拉动滚动条
  2314. if (
  2315. this.photoHistoryList.indexOf(i) < 0 &&
  2316. this.sectionItem.learning != 1
  2317. ) {
  2318. //不存在拍照历史,没有重修过,没有学过,则拍照
  2319. //启动拍照
  2320. //暂停
  2321. polyvPlayerContext.exitFullScreen();
  2322. polyvPlayerContext.pause();
  2323. this.photoIndex = i;
  2324. this.openPhoto();
  2325. }
  2326. }
  2327. }
  2328. }
  2329. }
  2330. },
  2331. closeToast() {
  2332. clearTimeout(this.toastTimer);
  2333. this.videoToastShow = false;
  2334. },
  2335. restart() {
  2336. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2337. polyvPlayerContext.seek(0);
  2338. clearTimeout(this.toastTimer);
  2339. this.videoToastShow = false;
  2340. },
  2341. // 新增用户视频学习日志
  2342. studyLog() {
  2343. this.$http({
  2344. url: '/user/study/log',
  2345. method: 'post',
  2346. data: {
  2347. goodsId: this.goodsId,
  2348. courseId: this.courseId,
  2349. moduleId: this.moduleId || 0,
  2350. chapterId: this.chapterId || 0,
  2351. sectionId: this.playSectionId || 0,
  2352. fromPlat: 1, //来源平台 1小程序 2PC网站
  2353. goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  2354. orderGoodsId: this.orderGoodsId,
  2355. }
  2356. }).then((res) => {
  2357. console.log('直播的用户学习日志:', res)
  2358. })
  2359. },
  2360. onStateChange(newstate, oldstate) {
  2361. console.log('视频的开始播放事件', newstate.detail.newstate, this.needSeek)
  2362. if (newstate.detail.newstate == "playing") {
  2363. if (this.needSeek) {
  2364. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2365. if (this.recordObj.videoCurrentTime) {
  2366. polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
  2367. this.seekTime = this.$method.secondToDate(
  2368. this.recordObj.videoCurrentTime
  2369. );
  2370. this.videoToastShow = true;
  2371. this.toastTimer = setTimeout(() => {
  2372. this.videoToastShow = false;
  2373. }, 3000);
  2374. } else {
  2375. polyvPlayerContext.seek(1); //避免相同节继续播放
  2376. }
  2377. polyvPlayerContext.play();
  2378. this.needSeek = false;
  2379. // 新增用户视频学习日志
  2380. this.studyLog()
  2381. // 提交学习记录
  2382. }
  2383. //开始播放
  2384. if (this.timer) {
  2385. clearInterval(this.timer);
  2386. }
  2387. this.timer = setInterval(this.timeEvent, 1000); //定时器
  2388. }
  2389. if (newstate.detail.newstate == "pause") {
  2390. clearInterval(this.timer);
  2391. //暂停提交记录
  2392. /* this.ossAvatarUrl = ""
  2393. this.postStudyRecord() */
  2394. }
  2395. if (newstate.detail.newstate == "ended") {
  2396. clearInterval(this.timer);
  2397. uni.showToast({
  2398. icon: "none",
  2399. title: "播放完毕",
  2400. });
  2401. this.hasStart = false;
  2402. this.postStudyRecord(1);
  2403. // uni.$emit('playNext') //播放重修下一节
  2404. }
  2405. },
  2406. //拍照
  2407. openPhoto() {
  2408. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2409. if (polyvPlayerContext) {
  2410. polyvPlayerContext.exitFullScreen();
  2411. }
  2412. this.enableAutoRotation = false;
  2413. this.photoPopup = true;
  2414. this.isTaking = true;
  2415. uni.setKeepScreenOn({
  2416. keepScreenOn: true,
  2417. });
  2418. uni.authorize({
  2419. scope: "scope.camera",
  2420. success() {},
  2421. });
  2422. },
  2423. /**
  2424. * 人脸匹配
  2425. */
  2426. faceRecognition() {
  2427. return new Promise((resolve) => {
  2428. let fileSystem = uni.getFileSystemManager();
  2429. fileSystem.readFile({
  2430. filePath: `${this.avatarUrl}`,
  2431. encoding: "base64",
  2432. position: 0,
  2433. success: (res) => {
  2434. console.log(res);
  2435. let base64 = "data:image/jpg;base64," + res.data;
  2436. console.log({
  2437. imageA: base64,
  2438. orderGoodsId: this.orderGoodsId,
  2439. gradeId: this.gradeId,
  2440. },'base64Data')
  2441. this.$api
  2442. .faceCertificationCompareFace({
  2443. imageA: base64,
  2444. orderGoodsId: this.orderGoodsId,
  2445. gradeId: this.gradeId,
  2446. })
  2447. .then((res) => {
  2448. console.log(res, "res");
  2449. resolve(res.data.data);
  2450. });
  2451. },
  2452. fail(err) {
  2453. console.error(err, "err");
  2454. },
  2455. });
  2456. });
  2457. },
  2458. async submit() {
  2459. if (this.uploadLock) {
  2460. return;
  2461. }
  2462. this.uploadLock = true;
  2463. let compareFaceData = await this.faceRecognition();
  2464. console.log(compareFaceData,'compareFaceData')
  2465. if (compareFaceData >= 80) {
  2466. const waitYS = await this.imageInfos();
  2467. this.postCoursePhotoRecord()
  2468. .then((res) => {
  2469. this.photoHistoryList.push(this.photoIndex);
  2470. this.postStudyRecord(); //提交记录
  2471. //恢复播放
  2472. uni.setKeepScreenOn({
  2473. keepScreenOn: false,
  2474. });
  2475. this.photoPopup = false;
  2476. this.uploadLock = false;
  2477. this.enableAutoRotation = true;
  2478. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2479. if (polyvPlayerContext != null) {
  2480. polyvPlayerContext.play();
  2481. }
  2482. })
  2483. .catch((err) => {
  2484. uni.showToast({
  2485. title: "上传接口报错,请重新拍照上传" + err,
  2486. icon: "none",
  2487. });
  2488. this.uploadLock = false;
  2489. this.openPhoto();
  2490. });
  2491. } else {
  2492. uni.showToast({
  2493. title: "人脸匹配不通过,请重新拍照上传",
  2494. icon: "none",
  2495. duration: 2000,
  2496. });
  2497. setTimeout(() => {
  2498. this.uploadLock = false;
  2499. this.openPhoto();
  2500. }, 2000);
  2501. return;
  2502. }
  2503. },
  2504. reTake() {
  2505. this.isTaking = true;
  2506. },
  2507. //确认拍照
  2508. takePhoto() {
  2509. var self = this;
  2510. const ctx = uni.createCameraContext();
  2511. ctx.takePhoto({
  2512. quality: "high",
  2513. success: (res) => {
  2514. self.avatarUrl = res.tempImagePath;
  2515. this.isTaking = false;
  2516. // self.submit();
  2517. // self.photoPopup = false;
  2518. // self.enableAutoRotation = true;
  2519. },
  2520. fail: (err) => {
  2521. },
  2522. });
  2523. },
  2524. playError(e) {
  2525. console.log(e);
  2526. },
  2527. //拍照报错
  2528. error(e) {
  2529. console.log(e.detail);
  2530. },
  2531. //关闭相机
  2532. closePhoto() {
  2533. this.photoPopup = false;
  2534. self.enableAutoRotation = true;
  2535. },
  2536. /**
  2537. * 进入全屏
  2538. */
  2539. fullscreenchange(event) {
  2540. console.log('进入全屏',event);
  2541. if (event.detail.direction == "vertical") {
  2542. this.navShow = true;
  2543. } else if (event.detail.direction == "horizontal") {
  2544. this.navShow = false;
  2545. }
  2546. },
  2547. getGoodsDetail() {
  2548. let self = this;
  2549. this.$api.goodsDetail(this.goodsId).then((res) => {
  2550. this.goodsData = res.data.data;
  2551. if(self.goodsData.buyNote) {
  2552. this.baseHandoutTipList()
  2553. }
  2554. self.gradeId = self.goodsData.gradeId;
  2555. console.log(self.gradeId, "班级ID");
  2556. this.courseBusiness(this.goodsData.businessId);
  2557. this.courseHandouts();
  2558. self.getMenuList();
  2559. self.getReMenuList(); //获取重修目录
  2560. setTimeout(function () {
  2561. if (!self.needProfileModal) {
  2562. self.getGradeInfo();
  2563. }
  2564. }, 500);
  2565. //获取节笔记
  2566. this.getNoteList();
  2567. if (self.goodsData.goodsPlayConfig) {
  2568. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  2569. if (self.goodsPlayConfig.autoPlay > 0) {
  2570. self.autoplay = true;
  2571. }
  2572. if (self.goodsPlayConfig.drag > 0) {
  2573. self.isAllowSeek = "yes";
  2574. }
  2575. if (self.goodsPlayConfig.speed > 0) {
  2576. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  2577. }
  2578. }
  2579. if (self.goodsData.goodsPhotographConfig) {
  2580. self.goodsPhotographConfig = JSON.parse(
  2581. self.goodsData.goodsPhotographConfig
  2582. );
  2583. if (self.goodsPhotographConfig.photoNum > 0) {
  2584. self.photoNum = self.goodsPhotographConfig.photoNum;
  2585. console.log(self.photoNum, 777777);
  2586. }
  2587. }
  2588. });
  2589. },
  2590. startVideo() {
  2591. this.startStatus = true;
  2592. },
  2593. getAnswerList() {
  2594. let self = this;
  2595. this.$api
  2596. .answerList({ courseId: this.courseId, goodsId: this.goodsId,orderGoodsId: this.orderGoodsId, })
  2597. .then((res) => {
  2598. if (res.data.code == 200) {
  2599. self.answerList = res.data.rows;
  2600. }
  2601. });
  2602. },
  2603. getReMenuList() {
  2604. let self = this;
  2605. this.$api
  2606. .reMenuList({
  2607. orderGoodsId: this.orderGoodsId,
  2608. courseId: this.courseId,
  2609. rebuild: 1,
  2610. gradeId: this.gradeId,
  2611. })
  2612. .then((res) => {
  2613. if (res.data.code == 200) {
  2614. for (let i = 0; i < res.data.rows.length; i++) {
  2615. let item = res.data.rows[i];
  2616. item.down = true;
  2617. item.id = item.menuId;
  2618. item.name = item.menuName;
  2619. }
  2620. self.reMenuList = res.data.rows;
  2621. if (self.reMenuList.length > 0) {
  2622. this.showNotes = false;
  2623. self.list = [
  2624. {
  2625. name: "目录",
  2626. },
  2627. {
  2628. name: "讲义",
  2629. },
  2630. {
  2631. name: "笔记",
  2632. },
  2633. {
  2634. name: "答疑",
  2635. },
  2636. { name: "重修目录" },
  2637. ];
  2638. this.current = 0;
  2639. } else {
  2640. self.list = [
  2641. {
  2642. name: "目录",
  2643. },
  2644. {
  2645. name: "讲义",
  2646. },
  2647. {
  2648. name: "笔记",
  2649. },
  2650. {
  2651. name: "答疑",
  2652. },
  2653. ];
  2654. this.current = 0;
  2655. }
  2656. }
  2657. });
  2658. },
  2659. getMenuList() {
  2660. let self = this;
  2661. // /course/menuList 查询课程目录结构列表
  2662. this.$api
  2663. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  2664. .then((res) => {
  2665. if (res.data.code == 200) {
  2666. for (let i = 0; i < res.data.rows.length; i++) {
  2667. let item = res.data.rows[i];
  2668. item.down = true;
  2669. item.id = item.menuId;
  2670. item.name = item.menuName;
  2671. item.menuType = item.type;
  2672. }
  2673. self.menuList = res.data.rows;
  2674. console.log('======menuList', this.menuList)
  2675. this.reStart = true
  2676. for (let i = 0; i < res.data.rows.length; i++) {
  2677. if (res.data.rows[i].type == 1) {
  2678. this.menuIndex = [i];
  2679. break;
  2680. } else if (res.data.rows[i].type == 2) {
  2681. this.menuIndex = [i];
  2682. break;
  2683. }
  2684. }
  2685. }
  2686. });
  2687. },
  2688. courseDetail() {
  2689. let self = this;
  2690. this.$api.courseDetail(this.courseId).then((res) => {
  2691. if (res.data.code == 200) {
  2692. // if (res.data.data.educationName == "继续教育") {
  2693. this.$api
  2694. .lockLockAction({
  2695. action: "jxjy",
  2696. uuid:this.$method.getUuid()
  2697. })
  2698. .then((res) => {});
  2699. this.lockTimer = setInterval(() => {
  2700. this.$api
  2701. .lockLockAction({
  2702. action: "jxjy",
  2703. uuid:this.$method.getUuid()
  2704. })
  2705. .then((res) => {});
  2706. }, 10000);
  2707. // websocket.sendMsg("doCourse");
  2708. // }
  2709. self.detail = res.data.data;
  2710. }
  2711. });
  2712. },
  2713. open(item) {
  2714. item.showChildren = !item.showChildren;
  2715. },
  2716. change(index) {
  2717. this.current = index;
  2718. },
  2719. openDocument() {
  2720. this.downLoading = true
  2721. let url = this.$method.splitImgHost(this.courseHandoutsData.handoutsUrl);
  2722. uni.downloadFile({
  2723. url: url,
  2724. success: (res) => {
  2725. var filePath = res.tempFilePath;
  2726. uni.openDocument({
  2727. filePath: filePath,
  2728. showMenu: this.courseHandoutsData.canDownload == 1 ? true : false,
  2729. success: (res) => {
  2730. this.downLoading = false
  2731. uni.setStorageSync('current', this.current)
  2732. console.log(res, "打开文档成功");
  2733. },
  2734. fail: (err) => {
  2735. this.downLoading = false
  2736. console.log(err);
  2737. uni.showToast({
  2738. icon: "none",
  2739. title: "文档地址错误",
  2740. });
  2741. },
  2742. });
  2743. },
  2744. fail: (err) => {
  2745. this.downLoading = false
  2746. uni.showModal({
  2747. title: "提示",
  2748. content: "文档错误," + err.errMsg,
  2749. showCancel: false,
  2750. });
  2751. },
  2752. });
  2753. },
  2754. clickMulu() {
  2755. this.muluStyle = !this.muluStyle
  2756. }
  2757. },
  2758. };
  2759. </script>
  2760. <style lang="scss" scope>
  2761. @import './css/detail.scss';
  2762. .top {
  2763. &__header {
  2764. position:relative;
  2765. width:100%;
  2766. height:150rpx;
  2767. padding:24rpx 150rpx 24rpx 24rpx;
  2768. .img {
  2769. position:absolute;
  2770. left:0;
  2771. top:0;
  2772. width:100%;
  2773. }
  2774. .note {
  2775. position:relative;
  2776. z-index: 10;
  2777. font-size: 24rpx;
  2778. font-family: PingFang SC;
  2779. font-weight: bold;
  2780. color: #EFDBFF;
  2781. }
  2782. .title {
  2783. position:relative;
  2784. z-index: 10;
  2785. font-size: 26rpx;
  2786. font-family: PingFang SC;
  2787. font-weight: bold;
  2788. color: #FFFFFF;
  2789. }
  2790. }
  2791. }
  2792. #top {
  2793. position: relative;
  2794. z-index: 99;
  2795. }
  2796. .polyv_detail {
  2797. display: flex;
  2798. flex-direction: column;
  2799. height: 100vh;
  2800. position: relative;
  2801. top: 0;
  2802. left: 0;
  2803. .pops {
  2804. position: absolute;
  2805. top: 0;
  2806. left: 0;
  2807. background: #ccc;
  2808. opacity: 0.5;
  2809. width: 100%;
  2810. height: 300rpx;
  2811. z-index: 9999;
  2812. }
  2813. .box {
  2814. flex: 1;
  2815. overflow: hidden;
  2816. margin: 16rpx 16rpx 100rpx 16rpx;
  2817. .box_in {
  2818. height: 100%;
  2819. }
  2820. }
  2821. .first_ml {
  2822. margin: 16rpx 16rpx 16rpx 16rpx;
  2823. }
  2824. }
  2825. .btnSet {
  2826. width: 440rpx;
  2827. height: 80rpx;
  2828. background: #007aff;
  2829. border-radius: 40rpx;
  2830. color: #ffffff;
  2831. font-size: 28rpx;
  2832. line-height: 80rpx;
  2833. }
  2834. .btnReply {
  2835. width: 80rpx;
  2836. height: 40rpx;
  2837. background: #e3f0ff;
  2838. border-radius: 16rpx;
  2839. text-align: center;
  2840. color: #007aff;
  2841. }
  2842. .btnDel {
  2843. width: 80rpx;
  2844. height: 40rpx;
  2845. background: #ffedf0;
  2846. border-radius: 16rpx;
  2847. text-align: center;
  2848. color: #ff2d55;
  2849. }
  2850. .btnReply {
  2851. width: 80rpx;
  2852. height: 40rpx;
  2853. background: #e3f0ff;
  2854. border-radius: 16rpx;
  2855. font-size: 24rpx;
  2856. }
  2857. .lecture-box {
  2858. display: flex;
  2859. align-items: center;
  2860. height: 80rpx;
  2861. background: #ffffff;
  2862. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2863. .title {
  2864. padding: 10rpx;
  2865. flex: 1;
  2866. overflow: hidden;
  2867. text-overflow: ellipsis;
  2868. white-space: nowrap;
  2869. color: #333;
  2870. font-weight: bold;
  2871. font-size: 32rpx;
  2872. }
  2873. .btn {
  2874. display: flex;
  2875. align-items: center;
  2876. justify-content: center;
  2877. width: 80rpx;
  2878. height: 80rpx;
  2879. background: #ffffff;
  2880. box-shadow: -4rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.1);
  2881. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2882. }
  2883. @keyframes rotation{
  2884. from {-webkit-transform: rotate(0deg);}
  2885. to {-webkit-transform: rotate(360deg);}
  2886. }
  2887. .loading_down {
  2888. transform: rotate(360deg);
  2889. animation: rotation 3s linear infinite;
  2890. }
  2891. }
  2892. .lecture-content {
  2893. background: #fff;
  2894. margin-top: 10rpx;
  2895. padding: 10rpx;
  2896. border-radius: 16rpx;
  2897. }
  2898. .photoBox {
  2899. background-color: #ffffff;
  2900. border-radius: 32px 32px 0px 0px;
  2901. .photoTop {
  2902. height: 74rpx;
  2903. display: flex;
  2904. align-items: center;
  2905. justify-content: space-between;
  2906. padding: 0rpx 38rpx;
  2907. .sqzz {
  2908. width: 28rpx;
  2909. height: 28rpx;
  2910. display: flex;
  2911. align-items: center;
  2912. justify-content: center;
  2913. }
  2914. .centersq {
  2915. color: #333;
  2916. font-size: 30rpx;
  2917. font-weight: 500;
  2918. }
  2919. }
  2920. .photoCenter {
  2921. width: 750rpx;
  2922. height: 979rpx;
  2923. position: relative;
  2924. .custom {
  2925. width: 750rpx;
  2926. height: 979rpx;
  2927. position: absolute;
  2928. z-index: 1000;
  2929. top: 0;
  2930. left: 0;
  2931. image {
  2932. width: 100%;
  2933. height: 100%;
  2934. }
  2935. }
  2936. }
  2937. .btns {
  2938. display: flex;
  2939. .btnResult {
  2940. height: 100rpx;
  2941. flex: 1;
  2942. background-color: #07c160;
  2943. text-align: center;
  2944. line-height: 100rpx;
  2945. color: #fff;
  2946. font-size: 32rpx;
  2947. font-weight: bold;
  2948. }
  2949. }
  2950. }
  2951. .chat_box {
  2952. display: flex;
  2953. padding: 20rpx;
  2954. justify-content: space-between;
  2955. }
  2956. .chat3 {
  2957. font-size: 30rpx;
  2958. font-family: PingFang SC;
  2959. font-weight: 500;
  2960. color: #666666;
  2961. margin-top: 10rpx;
  2962. }
  2963. .chat2 {
  2964. font-size: 20rpx;
  2965. font-family: PingFang SC;
  2966. font-weight: 500;
  2967. color: #999999;
  2968. margin-top: 10rpx;
  2969. }
  2970. .chat1 {
  2971. font-size: 24rpx;
  2972. font-family: PingFang SC;
  2973. font-weight: 500;
  2974. color: #333333;
  2975. }
  2976. .leftPadding {
  2977. margin-left: 8rpx;
  2978. }
  2979. .t2Content {
  2980. font-size: 24rpx;
  2981. font-family: PingFang SC;
  2982. font-weight: bold;
  2983. color: #999999;
  2984. line-height: 48rpx;
  2985. }
  2986. .tBox2 {
  2987. display: flex;
  2988. padding-top: 10rpx;
  2989. color: #333333;
  2990. font-size: 30rpx;
  2991. font-weight: 400;
  2992. }
  2993. .tBox {
  2994. display: flex;
  2995. align-items: center;
  2996. padding-top: 10rpx;
  2997. }
  2998. .title {
  2999. font-size: 24rpx;
  3000. color: #999999;
  3001. }
  3002. .Answering {
  3003. .answer_item {
  3004. &:nth-child(2) {
  3005. border-radius: 16rpx 16rpx 0rpx 0rpx;
  3006. }
  3007. &:nth-last-child(1) {
  3008. border-radius: 0rpx 0rpx 16rpx 16rpx;
  3009. }
  3010. }
  3011. }
  3012. .inputBottom {
  3013. position: fixed;
  3014. left: 0;
  3015. bottom: 0;
  3016. background: #ffffff;
  3017. height: 98rpx;
  3018. display: flex;
  3019. align-items: center;
  3020. width: 100%;
  3021. .flex_auto {
  3022. flex: 1;
  3023. margin-left: 10%;
  3024. // .input {
  3025. // height: 60rpx;
  3026. // }
  3027. }
  3028. .btn {
  3029. color: #007aff;
  3030. font-size: 30rpx;
  3031. font-weight: bold;
  3032. width: 15%;
  3033. text-align: center;
  3034. }
  3035. .input {
  3036. background: rgba(244, 244, 244, 0.98);
  3037. height: 60rpx;
  3038. border-radius: 24rpx;
  3039. margin-top: 12rpx;
  3040. }
  3041. }
  3042. .noteBox {
  3043. width: 100%;
  3044. background: #ffffff;
  3045. padding: 0rpx 10rpx 20rpx;
  3046. border-radius: 16rpx;
  3047. overflow: hidden;
  3048. .left_ti {
  3049. padding-top: 14rpx;
  3050. }
  3051. }
  3052. .dateBox {
  3053. width: 216rpx;
  3054. height: 48rpx;
  3055. background: #ffffff;
  3056. border-radius: 24rpx;
  3057. font-size: 24rpx;
  3058. color: #666666;
  3059. text-align: center;
  3060. line-height: 48rpx;
  3061. margin: 16rpx 0rpx 8rpx;
  3062. }
  3063. .t_content1 {
  3064. color: #007aff;
  3065. margin-left: 10rpx;
  3066. }
  3067. .tag1 {
  3068. border: 2rpx solid #007aff;
  3069. border-radius: 8rpx;
  3070. font-size: 20rpx;
  3071. color: #007aff;
  3072. padding: 5rpx;
  3073. }
  3074. .b_title {
  3075. color: #333333;
  3076. font-size: 30rpx;
  3077. font-weight: bold;
  3078. }
  3079. page {
  3080. background: #eaeef1;
  3081. }
  3082. .menuBox {
  3083. width: 100%;
  3084. background: #ffffff;
  3085. border-radius: 16rpx;
  3086. padding: 0rpx 20rpx;
  3087. margin-bottom: 20rpx;
  3088. }
  3089. .btnspric {
  3090. border-top: 1rpx solid #eee;
  3091. display: flex;
  3092. align-items: center;
  3093. justify-content: space-between;
  3094. height: 108rpx;
  3095. padding-left: 43rpx;
  3096. padding-right: 32rpx;
  3097. }
  3098. .btnspric > .lefprL {
  3099. font-size: 36rpx;
  3100. color: #0c141f;
  3101. font-weight: bold;
  3102. }
  3103. .btnspric > .lefprR {
  3104. padding: 0rpx 24rpx;
  3105. height: 60rpx;
  3106. line-height: 60rpx;
  3107. text-align: center;
  3108. color: #fff;
  3109. background: #32467b;
  3110. border-radius: 24rpx;
  3111. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  3112. }
  3113. .yhj,
  3114. .hdyhj {
  3115. padding: 24rpx 29rpx 24rpx 34rpx;
  3116. }
  3117. .yhj {
  3118. border-bottom: 16rpx solid #f9f9f9;
  3119. }
  3120. .yhjtit {
  3121. font-size: 30rpx;
  3122. color: #0c141f;
  3123. font-weight: 500;
  3124. margin-bottom: 14rpx;
  3125. }
  3126. .yhjList {
  3127. display: flex;
  3128. align-items: center;
  3129. justify-content: space-between;
  3130. margin-bottom: 14rpx;
  3131. }
  3132. .yhjList > .yhjLefts {
  3133. display: flex;
  3134. align-items: center;
  3135. }
  3136. .yhjLefts > .yhl {
  3137. color: #32467b;
  3138. font-size: 30rpx;
  3139. margin-right: 31rpx;
  3140. }
  3141. .yhjLefts > .yhbq {
  3142. font-size: 24rpx;
  3143. color: #ff9500;
  3144. border-radius: 18rpx;
  3145. background-color: rgba(255, 149, 0, 0.2);
  3146. border: 2rpx solid #ff9500;
  3147. height: 38rpx;
  3148. line-height: 38rpx;
  3149. padding: 0rpx 16rpx;
  3150. }
  3151. .ts {
  3152. font-size: 24rpx;
  3153. color: #999;
  3154. margin: 14rpx 0rpx;
  3155. padding-right: 29rpx;
  3156. padding-left: 34rpx;
  3157. }
  3158. .yh {
  3159. padding-top: 20rpx;
  3160. }
  3161. .yh > .yhtitle {
  3162. display: flex;
  3163. align-items: center;
  3164. justify-content: space-between;
  3165. padding-right: 29rpx;
  3166. padding-left: 34rpx;
  3167. }
  3168. .priceBxs {
  3169. display: flex;
  3170. align-items: center;
  3171. }
  3172. .priceBxs > .pricleft {
  3173. border-radius: 24rpx;
  3174. border: 1rpx solid #e91313;
  3175. background-color: rgba(233, 19, 19, 0.1);
  3176. padding: 0rpx 18rpx;
  3177. height: 49rpx;
  3178. line-height: 49rpx;
  3179. text-align: center;
  3180. font-size: 30rpx;
  3181. font-weight: 500;
  3182. color: #e91313;
  3183. margin-right: 13rpx;
  3184. }
  3185. .topBox {
  3186. padding: 32rpx 32rpx 24rpx;
  3187. border-bottom: 1rpx solid #eeeeee;
  3188. }
  3189. .topBox > .boldFonstType {
  3190. font-weight: 500;
  3191. font-size: 30rpx;
  3192. margin: 16rpx 0rpx 23rpx;
  3193. }
  3194. .topBox > .firstTopL {
  3195. display: flex;
  3196. align-items: center;
  3197. }
  3198. .topBox > .firstTopL > .imageBs {
  3199. width: 331rpx;
  3200. height: 160rpx;
  3201. border-radius: 6rpx;
  3202. overflow: hidden;
  3203. margin-right: 8rpx;
  3204. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  3205. }
  3206. .topBox > .firstTopL > .imageBs > image {
  3207. width: 100%;
  3208. height: 100%;
  3209. }
  3210. .topBox > .firstTopL > .textBs {
  3211. font-size: 30rpx;
  3212. font-weight: bold;
  3213. color: #0c141f;
  3214. }
  3215. .content {
  3216. padding: 24rpx;
  3217. text-align: left;
  3218. }
  3219. .catalogBox {
  3220. display: flex;
  3221. align-items: center;
  3222. flex-wrap: nowrap;
  3223. overflow-x: auto;
  3224. padding-left: 38rpx;
  3225. max-height: 305rpx;
  3226. overflow-y: auto;
  3227. transition: all 0.4s;
  3228. }
  3229. .catalogBox > .catalogA {
  3230. min-width: 200rpx;
  3231. height: 48rpx;
  3232. line-height: 48rpx;
  3233. // text-align: center;
  3234. border: 2rpx solid transparent;
  3235. white-space: nowrap;
  3236. text-overflow: ellipsis;
  3237. overflow: hidden;
  3238. word-break: break-all;
  3239. border-radius: 10rpx;
  3240. background: rgba(22, 119, 255, 0.05);
  3241. padding-left: 19rpx;
  3242. box-sizing: border-box;
  3243. padding-right: 15rpx;
  3244. margin-right: 16rpx;
  3245. margin-bottom: 20rpx;
  3246. margin-top: 15rpx;
  3247. font-size: 24rpx;
  3248. color: #666;
  3249. }
  3250. .catalogBox > .activesq {
  3251. border-color: #1677ff;
  3252. }
  3253. .changeCatalogBox {
  3254. display: block;
  3255. }
  3256. .catalogBox::-webkit-scrollbar {
  3257. display: none; /* Chrome Safari */
  3258. }
  3259. .price_t2 {
  3260. font-size: 18rpx;
  3261. font-family: PingFang SC;
  3262. font-weight: 500;
  3263. text-decoration: line-through;
  3264. color: #999999;
  3265. }
  3266. .price_t1 {
  3267. font-size: 33rpx;
  3268. font-family: PingFang SC;
  3269. font-weight: bold;
  3270. color: #e91313;
  3271. }
  3272. .sc_t {
  3273. font-size: 22rpx;
  3274. color: #000000;
  3275. }
  3276. .sc {
  3277. width: 29rpx;
  3278. height: 29rpx;
  3279. }
  3280. .buy {
  3281. width: 138rpx;
  3282. height: 48rpx;
  3283. line-height: 48rpx;
  3284. background: #32467b;
  3285. border-radius: 10rpx;
  3286. color: #ffffff;
  3287. font-size: 28rpx;
  3288. text-align: center;
  3289. vertical-align: middle;
  3290. position: absolute;
  3291. right: 30rpx;
  3292. }
  3293. .video_body {
  3294. padding-bottom: 96rpx;
  3295. }
  3296. .footer_tab {
  3297. position: fixed;
  3298. bottom: 0;
  3299. height: 96rpx;
  3300. width: 100%;
  3301. background-color: #ffffff;
  3302. }
  3303. .tj_box {
  3304. width: 50%;
  3305. display: inline-block;
  3306. text-align: center;
  3307. margin: 10rpx 0;
  3308. }
  3309. .teacher_t {
  3310. font-size: 24rpx;
  3311. font-family: PingFang SC;
  3312. font-weight: 400;
  3313. color: #666666;
  3314. line-height: 36rpx;
  3315. margin-left: 15rpx;
  3316. }
  3317. .teacher_img {
  3318. width: 87rpx;
  3319. height: 129rpx;
  3320. }
  3321. .t2 {
  3322. font-size: 24rpx;
  3323. font-family: PingFang SC;
  3324. color: #666666;
  3325. line-height: 36rpx;
  3326. margin: 15rpx;
  3327. }
  3328. .r_t2 {
  3329. width: 201rpx;
  3330. height: 49rpx;
  3331. background: rgba(22, 119, 255, 0.05);
  3332. border: 1rpx solid #32467b;
  3333. border-radius: 16rpx;
  3334. color: #666666;
  3335. font-size: 23rpx;
  3336. text-align: center;
  3337. display: flex;
  3338. align-items: center;
  3339. padding: 5rpx;
  3340. }
  3341. .scroll_box {
  3342. width: 100%;
  3343. height: 60rpx;
  3344. background: #ffffff;
  3345. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  3346. white-space: nowrap;
  3347. overflow: hidden;
  3348. margin: 15rpx 0;
  3349. }
  3350. .r_sliper {
  3351. padding: 0 20rpx;
  3352. }
  3353. .top_line {
  3354. width: 6rpx;
  3355. height: 22rpx;
  3356. background: #32467b;
  3357. margin-right: 10rpx;
  3358. }
  3359. .video_t2 {
  3360. font-size: 24rpx;
  3361. font-family: PingFang SC;
  3362. font-weight: 500;
  3363. color: #666666;
  3364. }
  3365. .video_play {
  3366. position: absolute;
  3367. width: 95rpx;
  3368. height: 95rpx;
  3369. top: 0;
  3370. left: 0;
  3371. right: 0;
  3372. bottom: 0;
  3373. margin: auto;
  3374. }
  3375. .video_box {
  3376. position: relative;
  3377. #playerVideo {
  3378. position: relative;
  3379. z-index: 99;
  3380. }
  3381. .video-toast {
  3382. position: absolute;
  3383. width: 686rpx;
  3384. height: 80rpx;
  3385. background: rgba(0, 0, 0, 0.6);
  3386. border-radius: 24rpx;
  3387. bottom: 100rpx;
  3388. left: 50%;
  3389. transform: translateX(-50%);
  3390. color: #fff;
  3391. display: flex;
  3392. font-size: 26rpx;
  3393. align-items: center;
  3394. overflow: visible;
  3395. &__text {
  3396. flex: 1;
  3397. margin-left: 40rpx;
  3398. }
  3399. &__btn {
  3400. width: 180rpx;
  3401. text-align: center;
  3402. border-left: 1rpx solid #fff;
  3403. }
  3404. }
  3405. .video-toast__close {
  3406. position: absolute;
  3407. right: 32rpx;
  3408. bottom: 184rpx;
  3409. width: 40rpx;
  3410. height: 40rpx;
  3411. line-height: 40rpx;
  3412. text-align: center;
  3413. background: rgba(0, 0, 0, 0.6);
  3414. border-radius: 50%;
  3415. color: rgba(255, 255, 255, 0.3);
  3416. }
  3417. }
  3418. .rotoct {
  3419. transform: rotate(90deg);
  3420. }
  3421. .slot-content {
  3422. padding: 0 20rpx;
  3423. }
  3424. .notice_modal {
  3425. .content {
  3426. width: 100%;
  3427. height: 100%;
  3428. padding: 20rpx;
  3429. .title {
  3430. color: #333;
  3431. line-height: 40rpx;
  3432. font-size: 30rpx;
  3433. text-align: center;
  3434. font-weight: bold;
  3435. }
  3436. .text {
  3437. line-height: 40rpx;
  3438. }
  3439. }
  3440. }
  3441. .full_mulu {
  3442. position: absolute;
  3443. top: 100rpx;
  3444. right: 20rpx;
  3445. width: 700rpx;
  3446. height: 515rpx;
  3447. color: #333;
  3448. display: flex;
  3449. align-items: center;
  3450. justify-content: space-between;
  3451. z-index: 99999;
  3452. .mulus {
  3453. width: 623rpx;
  3454. // height: 515rpx;
  3455. height: 400rpx;
  3456. overflow-y: scroll;
  3457. // overflow: scroll;
  3458. }
  3459. .mulu_box_in {
  3460. background-color: #b7b7b7;
  3461. border-radius: 16rpx;
  3462. // transition: all 0.5s;
  3463. &::after {
  3464. content: "";
  3465. width: 0;
  3466. height: 0;
  3467. position: absolute;
  3468. top: 235rpx;
  3469. right: 27px;
  3470. border-top: 16rpx solid transparent;
  3471. border-right: 16rpx solid transparent;
  3472. border-left: 16rpx solid #b7b7b7;
  3473. border-bottom: 16rpx solid transparent;
  3474. }
  3475. }
  3476. .mulu_box_out {
  3477. // visibility: hidden;
  3478. display: none;
  3479. }
  3480. .menuBox_mulu {
  3481. // width: 100%;
  3482. background: #ffffff;
  3483. border-radius: 16rpx;
  3484. padding: 0rpx 20rpx;
  3485. margin-bottom: 20rpx;
  3486. }
  3487. .ml_img {
  3488. position: absolute;
  3489. right: 0;
  3490. top: 100rpx;
  3491. }
  3492. .items {
  3493. width: 620rpx;
  3494. height: 100rpx;
  3495. border: 1rpx solid red;
  3496. }
  3497. }
  3498. </style>