detail.vue 103 KB

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