detail.vue 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450
  1. <template>
  2. <view class="polyv_detail">
  3. <nav-bar :title="detail.courseName || '课程详情'" v-show="navShow"></nav-bar>
  4. <view id="top">
  5. <view class="video_box" v-if="!startStatus">
  6. <image :src="$method.splitImgHost(detail.coverUrl)" mode="widthFix" style="width: 100%;height: 460rpx;"></image>
  7. <image v-if="false" class="video_play" src="/static/play.png" @click="startVideo"></image>
  8. </view>
  9. <view v-else>
  10. <view class="video_box" style="width: 100%;height: 460rpx;" v-if="playVID">
  11. <polyv-player
  12. id="playerVideo"
  13. playerId="playerVideo"
  14. height="460rpx"
  15. :vid="vid"
  16. :showSettingBtn="true"
  17. :enablePlayGesture="true"
  18. :custom-cache="false"
  19. :object-fit="'contain'"
  20. @statechange="onStateChange"
  21. @fullscreenchange="fullscreenchange"
  22. @error="playError"
  23. :autoplay="autoplay"
  24. :isAllowSeek="isAllowSeek"
  25. :playbackRate="playbackRate"
  26. :startTime="startTime"
  27. :enableAutoRotation="enableAutoRotation"
  28. ></polyv-player>
  29. <cover-view class="video-toast__close" v-if="videoToastShow" @click="closeToast()">X</cover-view>
  30. <cover-view class="video-toast" v-if="videoToastShow">
  31. <cover-view class="video-toast__text">您上次看到 {{seekTime}},正在自动续播</cover-view>
  32. <cover-view class="video-toast__btn" @click="restart()">从头播放</cover-view>
  33. </cover-view>
  34. </view>
  35. <view class="video_box" style="width: 100%;height: 460rpx;" v-if="playChannelId>0">
  36. <player
  37. class="plv-mp-demo-player"
  38. :videoOption="videoOption"
  39. @onLiveStatusChange="playerLiveStatusChange"
  40. />
  41. </view>
  42. </view>
  43. <view>
  44. <u-row>
  45. <u-col span="10">
  46. <view class="video_t1">{{ detail.courseName }}</view>
  47. </u-col>
  48. <u-col span="2" >
  49. <div class="notice_wrap" v-if="goodsData.buyNote">
  50. <view class="video_t1_t" @click="studyNotice">
  51. 学员须知
  52. </view>
  53. </div>
  54. </u-col>
  55. </u-row>
  56. </view>
  57. <u-line color="#D6D6DB" />
  58. <view>
  59. <view><u-tabs gutter="0" :item-width="itemWidth()" :list="list" font-size="32" bar-width="24" :current="current" @change="change" active-color="#007AFF"></u-tabs></view>
  60. </view>
  61. <u-line color="#D6D6DB" />
  62. </view>
  63. <view class="box">
  64. <scroll-view class="box_in" scroll-y="true">
  65. <!--目录 -->
  66. <view v-show="current == 0">
  67. <view class="menuBox" v-for="(item, index) in menuList" :key="index">
  68. <!--模块 -->
  69. <view v-if="item.type == 1"><courseModule :sectionMaxNum="goodsData.sectionMaxNum" :needOpen="menuIndex[0] === index ? true : false" :courseId="courseId" :preItem="menuList[index-1]" :learningOrder="businessData.goodsLearningOrder" :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="item.menuId"></courseModule></view>
  70. <!--章 -->
  71. <view v-if="item.type == 2"><courseChapter :sectionMaxNum="goodsData.sectionMaxNum" :needOpen="menuIndex[0] === index ? true : false" :courseId="courseId" :preItem="menuList[index-1]" @playEnd="sectionPlayEnd($event,index)" :learningOrder="businessData.goodsLearningOrder" :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="'0-' + item.menuId"></courseChapter></view>
  72. <!--节 -->
  73. <view v-if="item.type == 3"><courseSection :sectionMaxNum="goodsData.sectionMaxNum" @playEnd="sectionPlayEnd($event,index)" :courseId="courseId" :preItem="menuList[index-1]" :learningOrder="businessData.goodsLearningOrder" :goodsId="goodsId" :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="'0-0-' + item.menuId"></courseSection></view>
  74. </view>
  75. </view>
  76. <!--讲义 -->
  77. <view v-show="current == 1">
  78. <view class="lecture-box" v-if="courseHandoutsData">
  79. <view class="title">
  80. {{courseHandoutsData.handoutsName}}
  81. <!-- 这是后台配置的讲义标题过长省略这是后台配置的讲义标题过长省略 -->
  82. </view>
  83. <view class="btn" @click="openDocument">
  84. <u-icon name="download" color="#007AFF" size="40"></u-icon>
  85. </view>
  86. </view>
  87. <view style="text-align: center;" v-else>暂无讲义</view>
  88. <!-- <view class="lecture-content">
  89. <rich-text :nodes="'讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容讲义内容'"></rich-text>
  90. </view> -->
  91. <!-- <view class="inputBottom">
  92. <view style="width: 10%;"><image src="/static/icon/note3.png" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image></view>
  93. <view style="width: 73%;height: 100%;padding: 10rpx 0;">
  94. <u-input class="input" height="60" fixed="true" placeholder="您可以在这里输入笔记内容" type="textarea" :custom-style="inputStyle" v-model="noteValue" />
  95. </view>
  96. <view style="color: #007AFF;font-size: 30rpx;font-weight: bold;width: 15%;text-align: center;" @click="postNote">提交</view>
  97. </view> -->
  98. </view>
  99. <!--笔记 -->
  100. <view v-show="current == 2">
  101. <view v-if="noteList.length == 0" style="text-align: center;">暂无笔记</view>
  102. <view class="inputBottom" v-if="!(isPlayRebuild > 0)">
  103. <view style="width: 10%;"><image src="/static/icon/note3.png" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image></view>
  104. <view style="width: 73%;height: 100%;padding: 10rpx 0;">
  105. <u-input class="input" height="60" fixed="true" placeholder="您可以在这里输入笔记内容" type="input" :custom-style="inputStyle" v-model="noteValue" />
  106. </view>
  107. <view style="color: #007AFF;font-size: 30rpx;font-weight: bold;width: 15%;text-align: center;" @click="postNote">提交</view>
  108. </view>
  109. <view v-for="(item, index) in noteList" :key="index">
  110. <view class="dateBox">{{ $method.timestampToTime(item.dateNote) }}</view>
  111. <view class="noteBox">
  112. <view v-for="(item1, index1) in item.userNotes" :key="index1" style="margin-top: 30rpx;" @click="jumpNote(item1)">
  113. <view style="display: flex;">
  114. <view>
  115. <view>
  116. <image src="/static/icon/note2.png" v-if="noteId != item1.noteId" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image>
  117. <image src="/static/icon/note1.png" v-if="noteId == item1.noteId" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image>
  118. </view>
  119. <view class="title" style="width: 39rpx;height: 39rpx;margin:0 29rpx;">{{ $method.secondToDate(item1.noteSecond) }}</view>
  120. </view>
  121. <view style="margin-left: 10rpx;">
  122. <view class="t2Content leftPadding">{{ item1.sectionName }}</view>
  123. <view class="tBox2">{{ item1.noteText }}</view>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. <!--答疑 -->
  131. <view v-show="current == 3">
  132. <view class="inputBottom">
  133. <view class="flex_auto">
  134. <u-input height="60" fixed="true" :placeholder="placeholder" type="input" :custom-style="inputStyle" v-model="ctxValue" />
  135. </view>
  136. <view class="btn" @click="postContent">提交</view>
  137. </view>
  138. <view v-for="(item, index) in answerList" :key="index" style="background-color: #FFFFFF;margin-bottom: 20rpx;">
  139. <view class="chat_box" @click.stop="clearCtx">
  140. <view style="display: flex;flex:1;">
  141. <view><image :src="item.assignUserId > 0 && !item.realname ? '/static/logo_xcx.png' :$method.splitImgHost(item.avatar)" style="width: 64rpx;height: 64rpx;"></image></view>
  142. <view style="margin-left: 15rpx;">
  143. <view class="chat1">{{ item.assignUserId > 0 && !item.realname ? '祥粤老师' : item.realname }}</view>
  144. <view class="chat2">{{ $method.timestampToTime(item.createTime,false) }}</view>
  145. <view class="chat3">
  146. <text v-if="item.assignUserId > 0">回复</text>
  147. <text v-if="item.assignUserId > 0" style="color: #007AFF;">@{{ item.assignRealname }}</text>
  148. <view style="word-break: break-all;">{{ item.answerText }}</view>
  149. </view>
  150. </view>
  151. </view>
  152. <view class="btnReply" @click.stop="replyContent(item)" v-if="item.userId != userInfo.userId">回复</view>
  153. <view v-else class="btnDel" @click.stop="delContent(item)">删除</view>
  154. </view>
  155. <u-line color="#D6D6DB" />
  156. </view>
  157. <view v-if="answerList.length == 0" style="text-align: center;">暂无记录</view>
  158. </view>
  159. <!--目录 -->
  160. <view v-show="current == 4" >
  161. <view class="menuBox" v-for="(item, index) in reMenuList" :key="index">
  162. <!--模块 -->
  163. <view v-if="item.type == 1"><courseModule :sectionMaxNum="goodsData.sectionMaxNum" :courseId="courseId" :goodsId="goodsId" :gradeId="gradeId" :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="item.menuId"></courseModule></view>
  164. <!--章 -->
  165. <view v-if="item.type == 2">
  166. <courseChapter :courseId="courseId" :sectionMaxNum="goodsData.sectionMaxNum" @playEnd="sectionPlayEnd($event,index)" :gradeId="gradeId" :goodsId="goodsId" :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="'0-' + item.menuId"></courseChapter>
  167. </view>
  168. <!--节 -->
  169. <view v-if="item.type == 3">
  170. <courseSection :courseId="courseId" :sectionMaxNum="goodsData.sectionMaxNum" @playEnd="sectionPlayEnd($event,index)" :gradeId="gradeId" :goodsId="goodsId" :isRebuild="true" :isBuy="true" :nextMenuItem="findMenuNextSection(index)" :menuItem="item" :levelId="'0-0-' + item.menuId"></courseSection>
  171. </view>
  172. </view>
  173. </view>
  174. </scroll-view>
  175. </view>
  176. <!-- 播放前拍照end -->
  177. <u-popup v-model="showSet" :mask-close-able="false" mode="center" border-radius="24">
  178. <view style="align-items:center;padding: 0 40rpx;display: flex;flex-direction: column;justify-content:center;">
  179. <view style="font-weight: bold;color: #333333;font-size: 30rpx;margin-top: 30rpx;">温馨提示</view>
  180. <view style="width: 457rpx;color: #666666;font-size: 30rpx;margin-top: 30rpx;">学习过程中需要拍照验证学员身份,
  181. 拍照功能需要使用您的相机。
  182. 是否授权使用?</view>
  183. <view style="margin: 40rpx 0;">
  184. <button open-type="openSetting" @bindopensetting="openSetting" class="btnSet">去授权</button>
  185. </view>
  186. </view>
  187. </u-popup>
  188. <u-mask :show="photoPopup" >
  189. <!-- 播放前拍照start -->
  190. <view v-if="photoPopup" :mask-close-able="false" style="bottom: 0;position: fixed;width: 100%;z-index: 999;">
  191. <view class="photoBox">
  192. <view class="photoTop">
  193. <view class="sqzz" v-if="false"><u-icon name="close" color="#333333" size="30" @click="closePhoto"></u-icon></view>
  194. <view class="centersq">请正视手机屏幕</view>
  195. <view class="sqzz"></view>
  196. </view>
  197. <view class="photoCenter">
  198. <view style="width: 100%; height: 979rpx;position: fixed;" v-if="photoPopup && isTaking">
  199. <camera device-position="front" flash="off" @error="error" style="width: 100%; height: 100%;" ></camera>
  200. </view>
  201. <view class="custom" v-if="!isTaking" ><image :src="avatarUrl" mode=""></image></view>
  202. </view>
  203. <view class="btns">
  204. <view class="btnResult" v-if="isTaking" @click="takePhoto">拍照</view>
  205. <view class="btnResult" v-if="!isTaking" @click="reTake">重拍</view>
  206. <view class="btnResult" v-if="!isTaking" @click="submit">确认</view>
  207. </view>
  208. </view>
  209. </view>
  210. </u-mask>
  211. <u-popup v-model="noticeShow" class="notice_modal" mode="center" border-radius="14" width="700rpx" height="900rpx">
  212. <div class="content">
  213. <scroll-view scroll-y="true" style="height: 100%;">
  214. <view class="title">学员须知</view>
  215. <text class="text">
  216. {{goodsData.buyNote}}
  217. </text>
  218. </scroll-view>
  219. </div>
  220. </u-popup>
  221. </view>
  222. </template>
  223. <script>
  224. import plv from '../static/polyv-sdk/index';
  225. import courseModule from '@/components/course/courseModule.vue';
  226. import courseChapter from '@/components/course/courseChapter.vue';
  227. import courseSection from '@/components/course/courseSection.vue';
  228. import { websocket } from '@/common/socket.js';
  229. import { mapGetters, mapMutations } from 'vuex';
  230. export default {
  231. components: {
  232. courseModule,
  233. courseChapter,
  234. courseSection
  235. },
  236. data() {
  237. return {
  238. orderGoodsId:0,
  239. noticeShow:false,
  240. navShow:true,
  241. enableAutoRotation:true,
  242. seekTime:'',
  243. toastTimer:null,
  244. videoToastShow:false,
  245. initLiveOk:false,
  246. livePlay:false, //是否正在播放直播,不含暂停
  247. liveDuration:0, //直播观看时长
  248. videoOption:{
  249. mode: 'live',
  250. uid: '',
  251. cid: '',
  252. openId: '',
  253. isAutoChange: false,
  254. forceVideo: false,
  255. },
  256. courseHandoutsData:'',
  257. liveDetail:{},
  258. showSet:false,
  259. startStatus: false,
  260. detail: {},
  261. courseId: 0,
  262. placeholder: '您可以在这里输入笔记内容\n还可以点击左侧图标为笔记加上时间标记',
  263. inputStyle: {
  264. background: 'rgba(244, 244, 244, 0.98)',
  265. borderRadius: '24rpx',
  266. padding: '8rpx',
  267. marginBottom: '10rpx'
  268. },
  269. list: [],
  270. menuList: [],
  271. current: 0,
  272. vid: '',
  273. goodsId: 0,
  274. goodsData: {},
  275. photoPopup: false,
  276. goodsPlayConfig: null,
  277. autoplay: false,
  278. isAllowSeek: 'no',
  279. playbackRate: [1.0],
  280. timer: null,
  281. answerTimer:null,
  282. goodsPhotographConfig: null,
  283. intervalTimeList: [], // 间隔拍照时长
  284. intervalTimeIndex: 0, //当前处于哪个时间段拍照
  285. playTime: 0, //页面播放时长,不含暂停
  286. currentTime: 0,
  287. avatarUrl: '',
  288. ossAvatarUrl: '',
  289. studyDuration: 0, // 当前视频时长
  290. gradeId: 0,
  291. chapterId: 0,
  292. moduleId: 0,
  293. reMenuList: [],
  294. answerList: [],
  295. assignUserId: 0,
  296. placeholder: '您可以在这里输入答疑内容',
  297. ctxValue: '',
  298. noteList: [],
  299. noteValue: '',
  300. noteId: 0,
  301. recordObj: 0,
  302. gradeDetail:{},
  303. isTaking:true, //是否正在拍照
  304. needSeek: false, //第一次播放是否需要跳转
  305. needProfileModal:false, //是否需要资料审核弹框
  306. liveObj:{},
  307. photoNum:0,
  308. photoList:[], //拍照的时间点
  309. photoConfig:false, //是否配置好拍照次数
  310. photoIndex:0, //当前位于拍照的区间下标 从0开始
  311. photoHistoryList:[], //已拍照历史的下标点
  312. sectionItem:null,
  313. businessData:{},
  314. showNotes:true,
  315. menuIndex:[],
  316. uploadLock:false, //上传图片
  317. isPlayRebuild:false, //是否正在播放重修视频
  318. isRebuild:false, //视频是否从重修目录点击
  319. };
  320. },
  321. computed: { ...mapGetters(['userInfo', 'playSectionId','playChannelId','playVID']) },
  322. onLoad(option) {
  323. this.courseId = Number(option.id);
  324. this.goodsId = Number(option.goodsId);
  325. this.orderGoodsId = Number(option.orderGoodsId)
  326. this.courseDetail();
  327. this.getGoodsDetail();
  328. this.getAnswerList();
  329. this.answerTimer = setInterval(() => {
  330. this.getAnswerList();
  331. },5000)
  332. let noteSecond = Number(option.noteSecond);
  333. if(noteSecond>0){
  334. //我的消息跳过来,播放节
  335. let item = {
  336. sectionId:Number(option.sectionId),
  337. recordingUrl:option.recordingUrl,
  338. noteSecond:noteSecond,
  339. studyDuration:noteSecond
  340. }
  341. let playNextId = `moduleId${option.moduleId}chapterId${option.chapterId}sectionId${option.sectionId}${option.isRebuild?'isRebuild':''}`;
  342. this.$store.commit('setPlaySectionId', {playSectionId :item.sectionId});
  343. this.$store.commit('setPlayVID', {playVID :item.recordingUrl});
  344. this.$store.commit('updatePlayNextId',playNextId)
  345. console.log('this.playNoteVideo')
  346. }
  347. },
  348. onShow() {
  349. var self = this;
  350. //相机授权
  351. this.getCameraSetting()
  352. this.$api.getbaseprofiletplists({ goodsId: self.goodsId }).then(res => {
  353. console.log(res,'res')
  354. if (res.data.code === 200 && res.data.rows.length) {
  355. if (res.data.rows[0].keyValue) {
  356. self.$api.getbaseprofiletpId(self.goodsId).then(baseRes => {
  357. if(baseRes.data.code === 200) {
  358. if(baseRes.data.data) {
  359. self.$api.getbaseprofiletpgetInfo({ goodsId: self.goodsId,orderGoodsId:self.orderGoodsId }).then(result => {
  360. console.log(result,'result')
  361. if (result.data.code === 200) {
  362. if (!result.data.data || (result.data.data.status === 3 && result.data.data.changeStatus === 1)) {
  363. if (!result.data.data) {
  364. self.needProfileModal = true
  365. uni.showModal({
  366. content: '请前往填写资料',
  367. cancelText: '返回',
  368. success: function(resultst) {
  369. if (resultst.confirm) {
  370. self.$navTo.togo('/pages2/verify/input', {
  371. id: self.goodsId,
  372. orderGoodsId:self.orderGoodsId
  373. });
  374. }
  375. if (resultst.cancel) {
  376. uni.navigateBack();
  377. }
  378. }
  379. });
  380. } else {
  381. self.needProfileModal = true
  382. uni.showModal({
  383. content: '资料审核不通过,请前往重新填写',
  384. cancelText: '返回',
  385. success: function(resultst) {
  386. if (resultst.confirm) {
  387. self.$navTo.togo('/pages2/verify/input', {
  388. id: self.goodsId,
  389. orderGoodsId:self.orderGoodsId
  390. });
  391. }
  392. if (resultst.cancel) {
  393. uni.navigateBack();
  394. }
  395. }
  396. });
  397. }
  398. } else if (result.data.data.status === 1 && JSON.parse(res.data.rows[0].keyValue2)[0]) {
  399. self.$api.getbaseprofileStampgetInfo({ goodsId: self.goodsId,orderGoodsId:self.orderGoodsId }).then(k => {
  400. if (k.data.code === 200) {
  401. if (!k.data.data || (k.data.data.status === 3 && k.data.data.changeStatus === 1)) {
  402. if (!k.data.data) {
  403. self.needProfileModal = true
  404. uni.showModal({
  405. cancelText: '返回',
  406. content: '请前往填写盖章资料',
  407. success: function(resultst) {
  408. if (resultst.confirm) {
  409. self.$navTo.togo('/pages2/verify/input2', {
  410. id: self.goodsId,
  411. orderGoodsId:self.orderGoodsId
  412. });
  413. }
  414. if (resultst.cancel) {
  415. uni.navigateBack();
  416. }
  417. }
  418. });
  419. } else {
  420. self.needProfileModal = true
  421. uni.showModal({
  422. cancelText: '返回',
  423. content: '资料盖章审核不通过,请前往重新填写',
  424. success: function(resultst) {
  425. if (resultst.confirm) {
  426. self.$navTo.togo('/pages2/verify/input2', {
  427. id: self.goodsId,
  428. orderGoodsId:self.orderGoodsId
  429. });
  430. }
  431. if (resultst.cancel) {
  432. uni.navigateBack();
  433. }
  434. }
  435. });
  436. }
  437. }
  438. }
  439. });
  440. }
  441. }
  442. });
  443. }
  444. }
  445. })
  446. }
  447. }
  448. });
  449. console.log(this.gradeId,7512)
  450. if(this.gradeId>0){
  451. //提交完资料返回判断是否已开班
  452. this.getGradeInfo()
  453. }
  454. },
  455. onUnload() {
  456. if (this.playSectionId > 0) {
  457. //退出提交记录
  458. this.postStudyRecord();
  459. }
  460. //清除正在播放的节ID
  461. this.$store.commit('setPlaySectionId', { playSectionId: 0 });
  462. this.$store.commit('setPlayChannelId', { playChannelId: 0 });
  463. this.$store.commit('setPlayVID', { playVID: null });
  464. this.closePlv()
  465. console.log('onUnload')
  466. //移除所有的事件监听器
  467. uni.$off();
  468. clearInterval(this.answerTimer)
  469. if (this.timer) {
  470. clearInterval(this.timer);
  471. }
  472. websocket.sendMsg('delAction')
  473. },
  474. mounted() {
  475. uni.$on('changeSection', oldSectionId => {
  476. console.log(this.playVID)
  477. this.photoConfig = false
  478. this.photoIndex = 0
  479. var polyvPlayerContext = this.selectComponent('#playerVideo');
  480. if(polyvPlayerContext){
  481. //解决同个节视频切换问题
  482. polyvPlayerContext.seek(0)
  483. polyvPlayerContext.pause();
  484. }
  485. //清除直播
  486. this.$store.commit('setPlayChannelId', { playChannelId: 0 });
  487. this.postStudyRecord(0, oldSectionId);
  488. });
  489. uni.$on('getSection', item => {
  490. //清除直播
  491. this.isPlayRebuild = item.rebuild
  492. this.photoConfig = false
  493. this.photoIndex = 0
  494. this.sectionItem = item;
  495. this.$store.commit('setPlayChannelId', { playChannelId: 0 });
  496. //获取拍照历史
  497. this.getPhotoLastRecord()
  498. this.playVideo(item);
  499. });
  500. uni.$on('levelId', item => {
  501. let arr = item.split('-');
  502. //点击节获取的各层级ID
  503. this.moduleId = arr[0];
  504. this.chapterId = arr[1];
  505. });
  506. uni.$on('getChannel', item => {
  507. //清除录播
  508. this.$store.commit('setPlayVID', {playVID :null});
  509. this.playChannel(item);
  510. });
  511. uni.$on('isRebuild',item => {
  512. console.log(item)
  513. this.isRebuild = item;
  514. })
  515. this.updateChapterOpen(true)
  516. },
  517. methods: {
  518. ...mapMutations(['updateChapterOpen']),
  519. /**
  520. * 模块大节播放完毕,刷新列表
  521. */
  522. sectionPlayEnd(isRebuild,index) {
  523. console.log('sectionPlayEnd')
  524. console.log('isRebuild',isRebuild),
  525. console.log('index',index)
  526. if(this.reMenuList.length>0) { //有重修目录
  527. if(isRebuild.isRebuild) { //从重修点击
  528. this.$api.reMenuList({ courseId: this.courseId, rebuild: 1, gradeId: this.gradeId }).then(res => {
  529. console.log('Rebuild1')
  530. if (res.data.code == 200) {
  531. if(res.data.rows.length) {
  532. // res.data.rows[index].name = res.data.rows[index].menuName;
  533. // this.$set(this.reMenuList,index,res.data.rows[index])
  534. for (let i = 0; i < res.data.rows.length; i++) {
  535. let item = res.data.rows[i];
  536. item.down = true;
  537. item.id = item.menuId;
  538. item.name = item.menuName;
  539. }
  540. this.reMenuList = []
  541. this.$nextTick(() => {
  542. this.reMenuList = res.data.rows;
  543. console.log(this.reMenuList,'this.reMenuList1')
  544. })
  545. } else {
  546. this.reMenuList = []
  547. }
  548. this.$nextTick(() => {
  549. if(this.reMenuList.length>0){
  550. this.list = [
  551. {
  552. name: '目录'
  553. },
  554. {
  555. name: '讲义'
  556. },
  557. {
  558. name: '笔记'
  559. },
  560. {
  561. name: '答疑'
  562. },
  563. {name:'重修目录'}
  564. ];
  565. } else {
  566. this.list = [
  567. {
  568. name: '目录'
  569. },
  570. {
  571. name: '讲义'
  572. },
  573. {
  574. name: '笔记'
  575. },
  576. {
  577. name: '答疑'
  578. }
  579. ];
  580. if(this.current == 4) {
  581. this.current = 0;
  582. }
  583. }
  584. })
  585. }
  586. });
  587. this.$api.reMenuList({ courseId: this.courseId, gradeId: this.gradeId }).then(res => {
  588. console.log('noRebuild1')
  589. if (res.data.code == 200) {
  590. for (let i = 0; i < res.data.rows.length; i++) {
  591. let item = res.data.rows[i];
  592. item.down = true;
  593. item.id = item.menuId;
  594. item.name = item.menuName;
  595. item.menuType = item.type;
  596. }
  597. this.menuList = []
  598. this.$nextTick(() => {
  599. this.menuList = res.data.rows;
  600. })
  601. }
  602. });
  603. } else { //从普通目录点击
  604. this.$api.reMenuList({ courseId: this.courseId, gradeId: this.gradeId }).then(res => {
  605. console.log('noRebuild2')
  606. if (res.data.code == 200) {
  607. res.data.rows[index].name = res.data.rows[index].menuName;
  608. res.data.rows[index].id = res.data.rows[index].menuId;
  609. this.$set(this.menuList,index,res.data.rows[index])
  610. }
  611. });
  612. this.$api.reMenuList({ courseId: this.courseId, rebuild: 1, gradeId: this.gradeId }).then(res => {
  613. console.log('Rebuild2')
  614. if (res.data.code == 200) {
  615. for (let i = 0; i < res.data.rows.length; i++) {
  616. let item = res.data.rows[i];
  617. item.down = true;
  618. item.id = item.menuId;
  619. item.name = item.menuName;
  620. }
  621. this.reMenuList = []
  622. this.$nextTick(() => {
  623. this.reMenuList = res.data.rows;
  624. if(this.reMenuList.length>0){
  625. this.list = [
  626. {
  627. name: '目录'
  628. },
  629. {
  630. name: '讲义'
  631. },
  632. {
  633. name: '笔记'
  634. },
  635. {
  636. name: '答疑'
  637. },
  638. {name:'重修目录'}
  639. ];
  640. } else {
  641. this.list = [
  642. {
  643. name: '目录'
  644. },
  645. {
  646. name: '讲义'
  647. },
  648. {
  649. name: '笔记'
  650. },
  651. {
  652. name: '答疑'
  653. }
  654. ];
  655. if(this.current == 4) {
  656. this.current = 0;
  657. }
  658. }
  659. })
  660. }
  661. });
  662. }
  663. } else { //没有重修目录
  664. this.$api.reMenuList({ courseId: this.courseId, gradeId: this.gradeId }).then(res => {
  665. console.log('noRebuild3')
  666. console.log('noRebuild3index',index)
  667. if (res.data.code == 200) {
  668. res.data.rows[index].name = res.data.rows[index].menuName;
  669. res.data.rows[index].id = res.data.rows[index].menuId;
  670. this.$set(this.menuList,index,res.data.rows[index])
  671. }
  672. });
  673. }
  674. },
  675. /**
  676. * 获取业务层次详情
  677. */
  678. courseBusiness(){
  679. this.$api.courseBusiness(this.goodsData.businessId).then(res => {
  680. this.businessData = res.data.data;
  681. })
  682. },
  683. /**
  684. * 计算tabs宽度
  685. */
  686. itemWidth() {
  687. return 100/this.list.length + '%'
  688. },
  689. /**
  690. * 获取讲义权限
  691. */
  692. courseHandouts() {
  693. this.$api.courseHandouts(this.goodsData.handoutsId).then(res => {
  694. this.courseHandoutsData = res.data.data
  695. })
  696. },
  697. findMenuNextSection(index){
  698. for(let i=index+1;i<this.reMenuList.length;i++){
  699. let item = this.reMenuList[i]
  700. if(item.type==3){
  701. return item;
  702. }
  703. }
  704. return {}
  705. },
  706. getPhotoLastRecord() {
  707. let self = this;
  708. let data = {
  709. sectionId: parseInt(self.playSectionId),
  710. goodsId: parseInt(self.goodsId),
  711. courseId: parseInt(self.courseId),
  712. gradeId: parseInt(self.gradeId),
  713. chapterId: parseInt(self.chapterId),
  714. moduleId: parseInt(self.moduleId)}
  715. this.$api.getPhotoLastRecord(data).then(res => {
  716. if(res.data.code==200){
  717. //清空历史数据
  718. self.photoHistoryList = []
  719. this.photoIndex = 0
  720. self.photoList = []
  721. for(let i=0;i<res.data.data.length;i++){
  722. //-2存储随机拍照数组
  723. if(res.data.data[i].photoIndex==-2){
  724. self.photoList = res.data.data[i].timeInterval.split(',')
  725. }else{
  726. self.photoHistoryList.push(res.data.data[i].photoIndex)
  727. }
  728. }
  729. }
  730. });
  731. },
  732. //postTime 只提交随机时间
  733. postCoursePhotoRecord(postTime=false) {
  734. return new Promise((resolve,reject) => {
  735. let currentTime = 0;
  736. var polyvPlayerContext = this.selectComponent('#playerVideo');
  737. if (polyvPlayerContext) {
  738. currentTime = polyvPlayerContext.getCurrentTime();
  739. }
  740. let self = this;
  741. let photoIndex = self.photoIndex
  742. let data = {
  743. photo: self.ossAvatarUrl,
  744. sectionId: parseInt(self.playSectionId),
  745. goodsId: parseInt(self.goodsId),
  746. courseId: parseInt(self.courseId),
  747. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  748. gradeId: parseInt(self.gradeId),
  749. photoIndex: postTime?-2:parseInt(photoIndex),//从0算起,-2只提交随机时间
  750. photoNum:parseInt(self.photoNum),
  751. chapterId: parseInt(self.chapterId),
  752. moduleId: parseInt(self.moduleId),
  753. timeInterval: postTime?self.photoList.join(','):''
  754. };
  755. console.log('提交接口', data);
  756. this.$api.coursePhotoRecord(data).then(res => {
  757. if(res.data.code == 200) {
  758. resolve()
  759. } else {
  760. reject()
  761. }
  762. }).catch(err => {
  763. reject()
  764. });
  765. })
  766. },
  767. randomNum(minNum,maxNum){
  768. switch(arguments.length){
  769. case 1:
  770. return parseInt(Math.random()*minNum+1,10);
  771. break;
  772. case 2:
  773. return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10);
  774. break;
  775. default:
  776. return 0;
  777. break;
  778. }
  779. },
  780. //配置随机拍照时间
  781. configPhoto(){
  782. var polyvPlayerContext = this.selectComponent('#playerVideo');
  783. let totalVideoTime = polyvPlayerContext.getDuration()
  784. let duration = polyvPlayerContext.getCurrentTime()
  785. let photoNum = this.photoNum
  786. if(!this.photoConfig){
  787. this.photoConfig = true
  788. // let spaceTime = Math.floor(totalVideoTime/photoNum) //拍照时间区间
  789. // if(spaceTime<5){//区间小于5秒
  790. // photoNum = Math.floor(totalVideoTime/5)
  791. // spaceTime = 5
  792. // }
  793. // if(photoNum<1){
  794. // photoNum = 1 //只要设置,至少拍一次
  795. // spaceTime = totalVideoTime
  796. // }
  797. // let initSpace = 0
  798. //没有历史拍照间隔数据
  799. if(this.photoList.length==0){
  800. if(totalVideoTime >= 900) { //大于15分钟
  801. if(photoNum == 1) { //开头拍1张
  802. this.photoList.push(1)
  803. } else if(photoNum == 3){ //拍3张
  804. this.photoList.push(1) //开头拍一张
  805. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  806. let centerMinTime = centerTime-300; //前后5分钟
  807. let centerMaxTime = centerTime+300;
  808. let centerTakeTime = this.randomNum(centerMinTime,centerMaxTime)
  809. this.photoList.push(centerTakeTime) //中间拍一张
  810. let endMaxTime = totalVideoTime - 60;
  811. let endMinTime = totalVideoTime - 300;
  812. let endTakeTime = this.randomNum(endMinTime,endMaxTime)
  813. this.photoList.push(endTakeTime) //最后拍一张
  814. }
  815. } else { //小于15分钟,只拍前后各一张
  816. if(photoNum == 1) { //开头拍1张
  817. this.photoList.push(1)
  818. } else if(photoNum == 3){ //拍2张
  819. if(totalVideoTime <= 300) { //小于5分钟
  820. this.photoList.push(1) //开头拍一张
  821. let endTakeTime = this.randomNum(10,totalVideoTime) //中间随机取一张
  822. this.photoList.push(endTakeTime)
  823. } else {
  824. this.photoList.push(1) //开头拍一张
  825. let endMaxTime = totalVideoTime - 60;
  826. let endMinTime = totalVideoTime - 300;
  827. let endTakeTime = this.randomNum(endMinTime,endMaxTime)
  828. this.photoList.push(endTakeTime) //最后1-5分钟拍一张
  829. }
  830. }
  831. }
  832. // for(let i=0;i<photoNum;i++){
  833. // let s = this.randomNum(initSpace,initSpace+spaceTime)
  834. // if(s>totalVideoTime){
  835. // s = totalVideoTime-1
  836. // }
  837. // if(s<=5){
  838. // s =5 //避免出现5秒内拍照时间
  839. // }
  840. // this.photoList.push(s)
  841. // initSpace+=spaceTime
  842. // }
  843. console.log(this.photoList,"随机拍照时间数组11",photoNum)
  844. this.postCoursePhotoRecord(true)//提交随机拍照时间数组
  845. }
  846. console.log(this.photoList,"随机拍照时间数组")
  847. //兼容已有观看历史
  848. for(let i=0;i<this.photoList.length-1;i++){
  849. if(this.photoList[i]<duration&&this.photoList[i+1]>duration){
  850. this.photoIndex = i+1
  851. // console.log("我的修改了photoIndex")
  852. break
  853. }
  854. if(duration>this.photoList[this.photoList.length-1]){
  855. this.photoIndex = this.photoList.length-1 //取最后一个下标
  856. // console.log("我的修改了photoIndex")
  857. break
  858. }
  859. }
  860. }
  861. },
  862. getLiveUid(channelId) {
  863. let self = this;
  864. return new Promise(resolve => {
  865. let data = {
  866. channelId: channelId
  867. };
  868. self.$api.polyvSign(data).then(res => {
  869. resolve(res.data.data);
  870. });
  871. });
  872. },
  873. timeEventLiving() {
  874. if (plv != null) {
  875. if(this.livePlay){
  876. this.liveDuration = this.liveDuration +1 //每隔1秒
  877. if(this.liveDuration==2){ //直播第2秒拍照
  878. if(this.goodsPhotographConfig.livephotograph==1 && this.channelItem.learning != 1){
  879. //开启直播拍照
  880. this.openPhoto();
  881. }
  882. }
  883. }
  884. }
  885. },
  886. playerLiveStatusChange(e) {
  887. const status = e.detail.status;
  888. console.log('直播状态',status);
  889. if (status === 'live') {
  890. console.log('开始直播');
  891. //开始播放
  892. if (this.timer) {
  893. clearInterval(this.timer);
  894. }
  895. this.livePlay = true
  896. this.timer = setInterval(this.timeEventLiving, 1000); //定时器
  897. }
  898. if (status === 'end') {
  899. if(this.livePlay){
  900. //只有播放过的结束才提交,避免未开播触发结束
  901. this.postStudyRecord(1);
  902. }
  903. console.log('结束直播');
  904. this.livePlay = false
  905. // 未开始
  906. }
  907. },
  908. closePlv(){
  909. if(plv){
  910. plv.destroy();
  911. }
  912. },
  913. playChannel(item){
  914. if (this.timer) {
  915. clearInterval(this.timer);
  916. }
  917. this.startStatus = true
  918. this.initLive()
  919. },
  920. setLiveOption(status) {
  921. const { userId, channelId, recordFileSimpleModel, playbackEnabled } = this.detail;
  922. const playRecordFile = playbackEnabled && recordFileSimpleModel && status === 'end';
  923. this.videoOption = {
  924. mode: 'live',
  925. uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
  926. cid: this.playChannelId,
  927. openId: this.userInfo.userAccount,
  928. isAutoChange: false,
  929. forceVideo: false,
  930. }
  931. },
  932. async initLive(){
  933. console.log(this.playChannelId,7111)
  934. this.liveObj = await this.getLiveUid(this.playChannelId);
  935. this.initLiveOk = true
  936. let optionsData = {}
  937. optionsData.mode = 'live';
  938. optionsData.forceVideo = false;
  939. optionsData.channelId = this.playChannelId; // 频道ID '2553128'
  940. optionsData.openId = this.userInfo.userAccount; // 用户openId this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
  941. optionsData.userId = this.liveObj.uid // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq'
  942. let self = this
  943. this.closePlv()
  944. plv.init(optionsData)
  945. .then(({ detail, chat }) => {
  946. self.liveDetail = detail
  947. // 设置mode为live的videoOption
  948. this.setLiveOption();
  949. if (detail.isPPT) {
  950. chat.on(chat.events.SLICESTART, () => {
  951. // 开始直播
  952. });
  953. } else {
  954. plv.api.getOrdinaryLiveStatus(detail.stream);
  955. }
  956. });
  957. },
  958. openSetting(res){
  959. console.log(res,98)
  960. },
  961. getCameraSetting () {
  962. const self = this
  963. wx.getSetting({
  964. success: res => {
  965. if (res.authSetting['scope.camera']) {
  966. // 用户已经授权
  967. self.showSet = false
  968. } else {
  969. // 用户还没有授权,向用户发起授权请求
  970. wx.authorize({
  971. scope: 'scope.camera',
  972. success() { // 用户同意授权
  973. self.showSet = false
  974. },
  975. fail() { // 用户不同意授权
  976. self.showSet = true
  977. /* wx.showToast({
  978. title: '摄像头授权失败',
  979. icon: 'none',
  980. duration: 3000
  981. }) */
  982. }
  983. })
  984. }
  985. },
  986. fail: res => {
  987. }
  988. })
  989. },
  990. studyNotice(){
  991. this.noticeShow = true;
  992. },
  993. //播放笔记视频
  994. async playNoteVideo(item) {
  995. console.log(item,'noteItem')
  996. if (this.timer) {
  997. clearInterval(this.timer);
  998. }
  999. if (this.vid) {
  1000. //切换视频
  1001. var polyvPlayerContext = this.selectComponent('#playerVideo');
  1002. polyvPlayerContext.changeVid(item.recordingUrl);
  1003. } else {
  1004. this.vid = item.recordingUrl;
  1005. }
  1006. this.recordObj = {videoCurrentTime:item.noteSecond}
  1007. if (this.recordObj.videoCurrentTime) {
  1008. this.needSeek = true; //需要跳转到播放记录
  1009. }
  1010. this.startStatus = true;
  1011. //获取节笔记
  1012. this.getNoteList();
  1013. },
  1014. //正常播放视频
  1015. async playVideo(item) {
  1016. console.log(item)
  1017. if (this.timer) {
  1018. clearInterval(this.timer);
  1019. }
  1020. if (this.vid) {
  1021. //切换视频
  1022. var polyvPlayerContext = this.selectComponent('#playerVideo');
  1023. console.log(polyvPlayerContext,'polyvPlayerContext')
  1024. polyvPlayerContext.changeVid(item.recordingUrl);
  1025. } else {
  1026. this.vid = item.recordingUrl;
  1027. }
  1028. this.recordObj = null
  1029. this.recordObj = await this.getRecordLast();
  1030. this.needSeek = true; //跳转到播放记录
  1031. this.startStatus = true;
  1032. //获取节笔记
  1033. this.getNoteList();
  1034. },
  1035. getRecordLast() {
  1036. let self = this;
  1037. return new Promise(resolve => {
  1038. let data = {
  1039. gradeId: Number(self.gradeId),
  1040. goodsId: Number(self.goodsId),
  1041. sectionId: Number(self.playSectionId),
  1042. courseId: Number(self.courseId),
  1043. chapterId: parseInt(self.chapterId),
  1044. moduleId: parseInt(self.moduleId)
  1045. };
  1046. self.$api.recordLast(data).then(res => {
  1047. resolve(res.data.data);
  1048. });
  1049. });
  1050. },
  1051. jumpNote(item) {
  1052. this.noteId = item.noteId;
  1053. //没视频播放
  1054. if(this.playSectionId==0){
  1055. console.log('即将跳到笔记位置1')
  1056. this.$u.toast('即将跳到笔记位置');
  1057. this.$store.commit('setPlaySectionId', {playSectionId :item.sectionId});
  1058. this.$store.commit('setPlayVID', {playVID :item.recordingUrl});
  1059. this.playNoteVideo(item);
  1060. }else{
  1061. //正在看当前笔记视频
  1062. console.log('即将跳到笔记位置2')
  1063. this.$u.toast('即将跳到笔记位置');
  1064. //跳到笔记时刻
  1065. var polyvPlayerContext = this.selectComponent('#playerVideo');
  1066. polyvPlayerContext.seek(item.noteSecond);
  1067. polyvPlayerContext.play();
  1068. }
  1069. },
  1070. postNote() {
  1071. let self = this;
  1072. if (!(this.playSectionId > 0)) {
  1073. this.$u.toast('目前无播放视频');
  1074. return;
  1075. }
  1076. if (!this.noteValue) {
  1077. this.$u.toast('请输入内容');
  1078. return;
  1079. }
  1080. if(!this.gradeId){
  1081. this.$u.toast('暂无班级数据');
  1082. return;
  1083. }
  1084. var polyvPlayerContext = this.selectComponent('#playerVideo');
  1085. let noteDate = this.$method.getZeroTime();
  1086. let noteSecond = polyvPlayerContext.getCurrentTime();
  1087. console.log(noteSecond,698)
  1088. if (!noteSecond) {
  1089. if(noteSecond==0){
  1090. //播放结束
  1091. noteSecond = polyvPlayerContext.getDuration();
  1092. console.log(noteSecond,63398)
  1093. }
  1094. if(!noteSecond){
  1095. this.$u.toast('视频暂未开始');
  1096. return;
  1097. }
  1098. }
  1099. let data = {
  1100. gradeId: this.gradeId,
  1101. goodsId: this.goodsId,
  1102. sectionId: this.playSectionId,
  1103. courseId: this.courseId,
  1104. noteText: this.noteValue,
  1105. noteDate: noteDate,
  1106. noteSecond: noteSecond
  1107. };
  1108. this.$api.postNote(data).then(res => {
  1109. if (res.data.code == 200) {
  1110. this.$u.toast('发布成功');
  1111. self.getNoteList();
  1112. this.noteValue = '';
  1113. }
  1114. });
  1115. },
  1116. getGradeInfo() {
  1117. let self = this;
  1118. this.$store.state.allowLoading = false;
  1119. this.$api.goodsGradeInfo(this.gradeId).then(res => {
  1120. if (res.data.code == 200) {
  1121. self.gradeDetail = res.data.data;
  1122. if(self.needProfileModal){
  1123. return
  1124. }
  1125. if(self.gradeDetail.learningStatus==2){
  1126. uni.showModal({
  1127. showCancel:false,
  1128. confirmText: '确定',
  1129. content: '当前课程正在申请中,正式开班后方可进行学习,请耐心等候!',
  1130. success: function(resultst) {
  1131. uni.navigateBack();
  1132. }
  1133. });
  1134. }
  1135. if(self.gradeDetail.learningStatus==3&&(Number(self.gradeDetail.learningTimeStart)>Number((new Date())/1000))){
  1136. uni.showModal({
  1137. showCancel:false,
  1138. cancelText: '返回',
  1139. content: '当前课程正在申请中,正式开班后方可进行学习,请耐心等候!',
  1140. success: function(resultst) {
  1141. uni.navigateBack();
  1142. }
  1143. });
  1144. }
  1145. }
  1146. });
  1147. this.$store.state.allowLoading = true;
  1148. },
  1149. getNoteList() {
  1150. let self = this;
  1151. self.noteList = [];
  1152. let data = { courseId: this.courseId, gradeId: this.gradeId, goodsId: this.goodsId }
  1153. if(this.playSectionId>0){
  1154. data.sectionId = this.playSectionId
  1155. }
  1156. this.$api.noteList(data).then(res => {
  1157. if (res.data.code == 200) {
  1158. self.noteList = res.data.rows;
  1159. }
  1160. });
  1161. },
  1162. delAnswer(answerId) {
  1163. let self = this;
  1164. let data = { answerId: answerId, status: -1 };
  1165. this.$api.delAnswer(data).then(res => {
  1166. if (res.data.code == 200) {
  1167. self.getAnswerList();
  1168. }
  1169. });
  1170. },
  1171. clearCtx() {
  1172. console.log(4234);
  1173. this.placeholder = '您可以在这里输入答疑内容';
  1174. this.ctxValue = '';
  1175. this.assignUserId = 0;
  1176. },
  1177. replyContent(item) {
  1178. this.assignUserId = item.userId;
  1179. this.placeholder = '@' + item.realname;
  1180. },
  1181. delContent(item) {
  1182. this.delAnswer(item.answerId);
  1183. },
  1184. postAnswer() {
  1185. let self = this;
  1186. let data = { courseId: this.courseId, answerText: this.ctxValue, goodsId: this.goodsId };
  1187. if (this.assignUserId > 0) {
  1188. data.assignUserId = this.assignUserId;
  1189. }
  1190. this.$api.postAnswer(data).then(res => {
  1191. if (res.data.code == 200) {
  1192. this.$u.toast('发布成功');
  1193. self.getAnswerList();
  1194. this.placeholder = '您可以在这里输入答疑内容';
  1195. this.ctxValue = '';
  1196. this.assignUserId = 0;
  1197. }
  1198. });
  1199. },
  1200. postContent() {
  1201. if (!this.ctxValue||this.ctxValue=='') {
  1202. this.$u.toast('请输入内容');
  1203. return
  1204. }
  1205. this.postAnswer();
  1206. },
  1207. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  1208. console.log('status',status)
  1209. let currentTime = 0;
  1210. let PlayDuration = 0
  1211. var polyvPlayerContext = this.selectComponent('#playerVideo');
  1212. if (polyvPlayerContext) {
  1213. currentTime = polyvPlayerContext.getCurrentTime(); //总的视频播放时刻
  1214. PlayDuration = polyvPlayerContext.getVideoPlayDuration();//本次看的时长
  1215. }
  1216. if(this.playChannelId>0){
  1217. currentTime = 2;//直播无法获取,无论开始结束都传2秒
  1218. }
  1219. let self = this;
  1220. let data = {
  1221. photo: self.ossAvatarUrl,
  1222. sectionId: parseInt(sectionId),
  1223. goodsId: parseInt(self.goodsId),
  1224. courseId: parseInt(self.courseId),
  1225. studyDuration: parseInt(PlayDuration > 0 ? PlayDuration : self.studyDuration),
  1226. gradeId: parseInt(self.gradeId),
  1227. chapterId: parseInt(self.chapterId),
  1228. moduleId: parseInt(self.moduleId),
  1229. videoCurrentTime: parseInt(currentTime > 0 ? currentTime : self.studyDuration)
  1230. };
  1231. if (status > 0) {
  1232. console.log(sectionId,'sectionId')
  1233. data.status = status;
  1234. }
  1235. console.log('提交接口', data);
  1236. this.$api.studyRecord(data).then(res => {
  1237. if(res.data.code == 200) {
  1238. if (status > 0) {
  1239. let moduleId = this.moduleId || 0;
  1240. let chapterId = this.chapterId || 0;
  1241. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  1242. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  1243. console.log(playNextId,'playNextId')
  1244. console.log(playNextIdisRebuild,'playNextIdisRebuild')
  1245. uni.$emit('playNext'+playNextIdisRebuild,{fromRebuild:this.isRebuild}); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  1246. uni.$emit('playNext'+playNextId); //通知播放结束
  1247. }
  1248. self.ossAvatarUrl = ''
  1249. } else {
  1250. this.uploadLock = false;
  1251. uni.showToast({
  1252. icon:'none',
  1253. title:res.data.msg
  1254. })
  1255. }
  1256. console.log(res,'res');
  1257. });
  1258. },
  1259. uploadFile(options, int) {
  1260. var self = this;
  1261. return new Promise((resolve, reject) => {
  1262. var data = {
  1263. imageStatus: int,
  1264. gradeId:this.gradeId
  1265. };
  1266. self.$api.aliyunpolicy(data).then(res => {
  1267. if (res.data.code != 200) {
  1268. self.$method.showToast('签名错误' + JSON.stringify(res.data));
  1269. return;
  1270. }
  1271. var ossToken = res.data.data.resultContent;
  1272. if (ossToken.host == null || ossToken.host == undefined) {
  1273. self.$method.showToast('上传路径报错' + JSON.stringify(res.data));
  1274. return;
  1275. }
  1276. uni.uploadFile({
  1277. url: ossToken.host,
  1278. name: 'file',
  1279. filePath: options,
  1280. fileType: 'image',
  1281. header: {
  1282. AuthorizationToken: 'WX ' + uni.getStorageSync('token')
  1283. },
  1284. formData: {
  1285. key: ossToken.dir,
  1286. OSSAccessKeyId: ossToken.accessid,
  1287. policy: ossToken.policy,
  1288. Signature: ossToken.signature,
  1289. callback: ossToken.callback,
  1290. success_action_status: 200
  1291. },
  1292. success: result => {
  1293. if (result.statusCode === 200) {
  1294. self.ossAvatarUrl = ossToken.dir;
  1295. resolve();
  1296. } else {
  1297. uni.showToast({
  1298. title: '上传失败',
  1299. icon: 'none'
  1300. });
  1301. this.openPhoto();
  1302. return;
  1303. }
  1304. },
  1305. fail: error => {
  1306. uni.showToast({
  1307. title: '上传接口报错,请重新拍照上传' + error,
  1308. icon: 'none'
  1309. });
  1310. this.openPhoto();
  1311. return;
  1312. }
  1313. });
  1314. });
  1315. });
  1316. },
  1317. imageInfos() {
  1318. var self = this;
  1319. return new Promise((resolve, reject) => {
  1320. uni.getImageInfo({
  1321. src: self.avatarUrl,
  1322. success: async res => {
  1323. let canvasWidth = res.width; //图片原始长宽
  1324. let canvasHeight = res.height;
  1325. if (canvasWidth > 2000 || canvasHeight > 2000) {
  1326. uni.compressImage({
  1327. src: self.avatarUrl,
  1328. quality: 75,
  1329. width: '35%',
  1330. height: '35%',
  1331. success: async rest => {
  1332. const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
  1333. resolve(waitUpload);
  1334. }
  1335. });
  1336. } else if (canvasWidth > 1000 || canvasHeight > 1000) {
  1337. uni.compressImage({
  1338. src: self.avatarUrl,
  1339. quality: 75,
  1340. width: '50%',
  1341. height: '50%',
  1342. success: async rest => {
  1343. const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
  1344. resolve(waitUpload);
  1345. }
  1346. });
  1347. } else {
  1348. console.log('无需压缩');
  1349. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  1350. resolve(waitUpload);
  1351. }
  1352. }
  1353. });
  1354. });
  1355. },
  1356. timeEvent() {
  1357. let self = this;
  1358. var polyvPlayerContext = this.selectComponent('#playerVideo');
  1359. if (polyvPlayerContext != null) {
  1360. this.playTime = polyvPlayerContext.getCurrentTime() //播放时刻
  1361. // console.log(this.playTime,789,this.photoHistoryList)
  1362. //判断是否需要拍照
  1363. if (this.photoNum > 0) {
  1364. this.configPhoto()
  1365. let photoTime =0; //获取拍照秒数
  1366. for(let i=0;i<this.photoList.length;i++){
  1367. photoTime = Number(this.photoList[i]); //获取拍照秒数
  1368. if (photoTime < this.playTime&&photoTime>this.playTime-8) { //3秒区间内才触发拍照,避免拉动滚动条
  1369. if(this.photoHistoryList.indexOf(i)<0 && this.sectionItem.learning != 1){ //不存在拍照历史,没有重修过,没有学过,则拍照
  1370. //启动拍照
  1371. //暂停
  1372. polyvPlayerContext.exitFullScreen();
  1373. polyvPlayerContext.pause();
  1374. this.photoIndex = i
  1375. this.openPhoto();
  1376. }
  1377. }
  1378. }
  1379. }
  1380. }
  1381. },
  1382. closeToast() {
  1383. clearTimeout(this.toastTimer)
  1384. this.videoToastShow = false;
  1385. },
  1386. restart() {
  1387. var polyvPlayerContext = this.selectComponent('#playerVideo');
  1388. polyvPlayerContext.seek(0);
  1389. console.log('seek1')
  1390. clearTimeout(this.toastTimer)
  1391. this.videoToastShow = false;
  1392. },
  1393. onStateChange(newstate, oldstate) {
  1394. if (newstate.detail.newstate == 'playing') {
  1395. if (this.needSeek) {
  1396. var polyvPlayerContext = this.selectComponent('#playerVideo');
  1397. if(this.recordObj.videoCurrentTime){
  1398. console.log('seek2')
  1399. polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
  1400. this.seekTime = this.$method.secondToDate(this.recordObj.videoCurrentTime)
  1401. this.videoToastShow = true;
  1402. this.toastTimer = setTimeout(() => {
  1403. this.videoToastShow = false;
  1404. },3000)
  1405. }else{
  1406. polyvPlayerContext.seek(1);//避免相同节继续播放
  1407. console.log('seek3')
  1408. }
  1409. polyvPlayerContext.play();
  1410. this.needSeek = false;
  1411. }
  1412. //开始播放
  1413. if (this.timer) {
  1414. clearInterval(this.timer);
  1415. }
  1416. this.timer = setInterval(this.timeEvent, 1000); //定时器
  1417. }
  1418. if (newstate.detail.newstate == 'pause') {
  1419. clearInterval(this.timer);
  1420. //暂停提交记录
  1421. /* this.ossAvatarUrl = ""
  1422. this.postStudyRecord() */
  1423. }
  1424. if (newstate.detail.newstate == 'ended') {
  1425. clearInterval(this.timer);
  1426. uni.showToast({
  1427. icon:'none',
  1428. title:'播放完毕'
  1429. })
  1430. this.postStudyRecord(1);
  1431. // uni.$emit('playNext') //播放重修下一节
  1432. }
  1433. },
  1434. //拍照
  1435. openPhoto() {
  1436. var polyvPlayerContext = this.selectComponent('#playerVideo');
  1437. if(polyvPlayerContext) {
  1438. polyvPlayerContext.exitFullScreen();
  1439. }
  1440. this.enableAutoRotation = false;
  1441. this.photoPopup = true;
  1442. this.isTaking = true;
  1443. uni.setKeepScreenOn({
  1444. keepScreenOn: true
  1445. });
  1446. uni.authorize({
  1447. scope: 'scope.camera',
  1448. success() {
  1449. }
  1450. })
  1451. },
  1452. /**
  1453. * 人脸匹配
  1454. */
  1455. faceRecognition() {
  1456. return new Promise(resolve => {
  1457. let fileSystem = uni.getFileSystemManager();
  1458. fileSystem.readFile({
  1459. filePath: `${this.avatarUrl}`,
  1460. encoding: 'base64',
  1461. position: 0,
  1462. success:(res) => {
  1463. console.log(res)
  1464. let base64 = 'data:image/jpg;base64,' + res.data;
  1465. },
  1466. fail(err) {
  1467. console.error(err,'err')
  1468. }
  1469. })
  1470. })
  1471. },
  1472. async submit() {
  1473. if(this.uploadLock) {
  1474. return;
  1475. }
  1476. this.uploadLock = true;
  1477. const waitYS = await this.imageInfos();
  1478. this.postCoursePhotoRecord().then(res => {
  1479. this.photoHistoryList.push(this.photoIndex)
  1480. this.postStudyRecord(); //提交记录
  1481. //恢复播放
  1482. uni.setKeepScreenOn({
  1483. keepScreenOn: false
  1484. });
  1485. this.photoPopup = false;
  1486. this.uploadLock = false;
  1487. this.enableAutoRotation = true;
  1488. var polyvPlayerContext = this.selectComponent('#playerVideo');
  1489. if (polyvPlayerContext != null) {
  1490. polyvPlayerContext.play();
  1491. }
  1492. }).catch(err => {
  1493. uni.showToast({
  1494. title: '上传接口报错,请重新拍照上传' + err,
  1495. icon: 'none'
  1496. });
  1497. this.uploadLock = false;
  1498. this.openPhoto();
  1499. })
  1500. },
  1501. reTake() {
  1502. this.isTaking = true;
  1503. },
  1504. //确认拍照
  1505. takePhoto() {
  1506. var self = this;
  1507. const ctx = uni.createCameraContext();
  1508. ctx.takePhoto({
  1509. quality: 'high',
  1510. success: res => {
  1511. console.log(res.tempImagePath);
  1512. self.avatarUrl = res.tempImagePath;
  1513. this.isTaking = false;
  1514. // self.submit();
  1515. // self.photoPopup = false;
  1516. // self.enableAutoRotation = true;
  1517. },
  1518. fail: err => {
  1519. console.log(err);
  1520. }
  1521. });
  1522. },
  1523. playError(e) {
  1524. console.log(e)
  1525. },
  1526. //拍照报错
  1527. error(e) {
  1528. console.log(e.detail);
  1529. },
  1530. //关闭相机
  1531. closePhoto() {
  1532. this.photoPopup = false;
  1533. self.enableAutoRotation = true;
  1534. },
  1535. /**
  1536. * 进入全屏
  1537. */
  1538. fullscreenchange(event) {
  1539. console.log(event)
  1540. if(event.detail.direction == 'vertical') {
  1541. this.navShow = true;
  1542. } else if(event.detail.direction == 'horizontal') {
  1543. this.navShow = false;
  1544. }
  1545. },
  1546. getGoodsDetail() {
  1547. let self = this;
  1548. this.$api.goodsDetail(this.goodsId).then(res => {
  1549. self.goodsData = res.data.data;
  1550. self.gradeId = self.goodsData.gradeId;
  1551. console.log(self.gradeId, "班级ID");
  1552. this.courseBusiness()
  1553. this.courseHandouts();
  1554. self.getMenuList();
  1555. self.getReMenuList(); //获取重修目录
  1556. setTimeout(function(){
  1557. if(!self.needProfileModal){
  1558. self.getGradeInfo()
  1559. }
  1560. },500)
  1561. //获取节笔记
  1562. this.getNoteList();
  1563. if (self.goodsData.goodsPlayConfig) {
  1564. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  1565. if (self.goodsPlayConfig.autoPlay > 0) {
  1566. self.autoplay = true;
  1567. }
  1568. if (self.goodsPlayConfig.drag > 0) {
  1569. self.isAllowSeek = 'yes';
  1570. }
  1571. if (self.goodsPlayConfig.speed > 0) {
  1572. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  1573. }
  1574. }
  1575. if (self.goodsData.goodsPhotographConfig) {
  1576. self.goodsPhotographConfig = JSON.parse(self.goodsData.goodsPhotographConfig);
  1577. if (self.goodsPhotographConfig.photoNum>0) {
  1578. self.photoNum = self.goodsPhotographConfig.photoNum
  1579. console.log(self.photoNum,777777)
  1580. }
  1581. }
  1582. });
  1583. },
  1584. startVideo() {
  1585. this.startStatus = true;
  1586. },
  1587. getAnswerList() {
  1588. let self = this;
  1589. this.$api.answerList({ courseId: this.courseId,goodsId: this.goodsId }).then(res => {
  1590. if (res.data.code == 200) {
  1591. self.answerList = res.data.rows;
  1592. }
  1593. });
  1594. },
  1595. getReMenuList() {
  1596. let self = this;
  1597. this.$api.reMenuList({ courseId: this.courseId, rebuild: 1, gradeId: this.gradeId }).then(res => {
  1598. if (res.data.code == 200) {
  1599. for (let i = 0; i < res.data.rows.length; i++) {
  1600. let item = res.data.rows[i];
  1601. item.down = true;
  1602. item.id = item.menuId;
  1603. item.name = item.menuName;
  1604. }
  1605. self.reMenuList = res.data.rows;
  1606. if(self.reMenuList.length>0){
  1607. this.showNotes = false;
  1608. self.list = [
  1609. {
  1610. name: '目录'
  1611. },
  1612. {
  1613. name: '讲义'
  1614. },
  1615. {
  1616. name: '笔记'
  1617. },
  1618. {
  1619. name: '答疑'
  1620. },
  1621. {name:'重修目录'}
  1622. ];
  1623. this.current = 0;
  1624. } else {
  1625. self.list = [
  1626. {
  1627. name: '目录'
  1628. },
  1629. {
  1630. name: '讲义'
  1631. },
  1632. {
  1633. name: '笔记'
  1634. },
  1635. {
  1636. name: '答疑'
  1637. }
  1638. ];
  1639. this.current = 0;
  1640. }
  1641. }
  1642. });
  1643. },
  1644. getMenuList() {
  1645. let self = this;
  1646. this.$api.reMenuList({ courseId: this.courseId, gradeId: this.gradeId }).then(res => {
  1647. if (res.data.code == 200) {
  1648. for (let i = 0; i < res.data.rows.length; i++) {
  1649. let item = res.data.rows[i];
  1650. item.down = true;
  1651. item.id = item.menuId;
  1652. item.name = item.menuName;
  1653. item.menuType = item.type;
  1654. }
  1655. self.menuList = res.data.rows;
  1656. for(let i=0;i<res.data.rows.length;i++){
  1657. if(res.data.rows[i].type == 1) {
  1658. this.menuIndex = [i];
  1659. break;
  1660. } else if(res.data.rows[i].type == 2) {
  1661. this.menuIndex = [i];
  1662. break;
  1663. }
  1664. }
  1665. }
  1666. });
  1667. },
  1668. courseDetail() {
  1669. let self = this;
  1670. this.$api.courseDetail(this.courseId).then(res => {
  1671. if (res.data.code == 200) {
  1672. if(res.data.data.educationName == '继续教育') {
  1673. websocket.sendMsg('doCourse')
  1674. }
  1675. self.detail = res.data.data;
  1676. }
  1677. });
  1678. },
  1679. open(item) {
  1680. item.showChildren = !item.showChildren;
  1681. },
  1682. change(index) {
  1683. this.current = index;
  1684. },
  1685. openDocument() {
  1686. let self = this;
  1687. let url = this.$method.splitImgHost(this.courseHandoutsData.handoutsUrl)
  1688. console.log(url)
  1689. uni.downloadFile({
  1690. url: url,
  1691. success: function (res) {
  1692. console.log(999)
  1693. var filePath = res.tempFilePath;
  1694. uni.openDocument({
  1695. filePath: filePath,
  1696. showMenu: self.courseHandoutsData.canDownload == 1 ? true : false,
  1697. success: function (res) {
  1698. console.log(res,'打开文档成功');
  1699. },
  1700. fail:function(err) {
  1701. console.log(err)
  1702. uni.showToast({
  1703. icon:'none',
  1704. title:'文档地址错误'
  1705. })
  1706. }
  1707. });
  1708. },
  1709. fail:(err) => {
  1710. uni.showModal({
  1711. title:'提示',
  1712. content:'文档错误,'+err.errMsg,
  1713. showCancel:false
  1714. })
  1715. }
  1716. });
  1717. }
  1718. }
  1719. };
  1720. </script>
  1721. <style lang="scss" scope>
  1722. .polyv_detail {
  1723. display: flex;
  1724. flex-direction: column;
  1725. height:100vh;
  1726. .box {
  1727. flex:1;
  1728. overflow: hidden;
  1729. margin: 20rpx;
  1730. .box_in {
  1731. height:100%;
  1732. }
  1733. }
  1734. }
  1735. .btnSet{
  1736. width: 440rpx;
  1737. height: 80rpx;
  1738. background: #007AFF;
  1739. border-radius: 40rpx;
  1740. color: #FFFFFF;
  1741. font-size: 28rpx;
  1742. line-height: 80rpx;
  1743. }
  1744. .btnReply {
  1745. width: 80rpx;
  1746. height: 40rpx;
  1747. background: #e3f0ff;
  1748. border-radius: 16rpx;
  1749. text-align: center;
  1750. color: #007aff;
  1751. }
  1752. .btnDel {
  1753. width: 80rpx;
  1754. height: 40rpx;
  1755. background: #ffedf0;
  1756. border-radius: 16rpx;
  1757. text-align: center;
  1758. color: #ff2d55;
  1759. }
  1760. .btnReply {
  1761. width: 80rpx;
  1762. height: 40rpx;
  1763. background: #e3f0ff;
  1764. border-radius: 16rpx;
  1765. font-size: 24rpx;
  1766. }
  1767. .lecture-box {
  1768. display: flex;
  1769. align-items: center;
  1770. height: 80rpx;
  1771. background: #FFFFFF;
  1772. border-radius: 16rpx 16rpx 16rpx 16rpx;
  1773. .title {
  1774. padding:10rpx;
  1775. flex:1;
  1776. overflow: hidden;
  1777. text-overflow: ellipsis;
  1778. white-space: nowrap;
  1779. color:#333;
  1780. font-weight: bold;
  1781. font-size: 32rpx;
  1782. }
  1783. .btn {
  1784. display: flex;
  1785. align-items: center;
  1786. justify-content: center;
  1787. width:80rpx;
  1788. height:80rpx;
  1789. background: #FFFFFF;
  1790. box-shadow: -4rpx 0rpx 4rpx 0rpx rgba(0,0,0,0.1);
  1791. border-radius: 16rpx 16rpx 16rpx 16rpx;
  1792. }
  1793. }
  1794. .lecture-content {
  1795. background:#fff;
  1796. margin-top:10rpx;
  1797. padding:10rpx;
  1798. border-radius:16rpx;
  1799. }
  1800. .photoBox {
  1801. background-color: #FFFFFF;
  1802. border-radius: 32px 32px 0px 0px;
  1803. .photoTop {
  1804. height: 74rpx;
  1805. display: flex;
  1806. align-items: center;
  1807. justify-content: space-between;
  1808. padding: 0rpx 38rpx;
  1809. .sqzz {
  1810. width: 28rpx;
  1811. height: 28rpx;
  1812. display: flex;
  1813. align-items: center;
  1814. justify-content: center;
  1815. }
  1816. .centersq {
  1817. color: #333;
  1818. font-size: 30rpx;
  1819. font-weight: 500;
  1820. }
  1821. }
  1822. .photoCenter {
  1823. width: 750rpx;
  1824. height: 979rpx;
  1825. position: relative;
  1826. .custom {
  1827. width: 750rpx;
  1828. height: 979rpx;
  1829. position: absolute;
  1830. z-index: 1000;
  1831. top: 0;
  1832. left: 0;
  1833. image {
  1834. width: 100%;
  1835. height: 100%;
  1836. }
  1837. }
  1838. }
  1839. .btns {
  1840. display: flex;
  1841. .btnResult {
  1842. height: 100rpx;
  1843. flex:1;
  1844. background-color: #07c160;
  1845. text-align: center;
  1846. line-height: 100rpx;
  1847. color: #fff;
  1848. font-size: 32rpx;
  1849. font-weight: bold;
  1850. }
  1851. }
  1852. }
  1853. .chat_box {
  1854. display: flex;
  1855. padding: 20rpx;
  1856. justify-content: space-between;
  1857. }
  1858. .chat3 {
  1859. font-size: 30rpx;
  1860. font-family: PingFang SC;
  1861. font-weight: 500;
  1862. color: #666666;
  1863. margin-top: 10rpx;
  1864. }
  1865. .chat2 {
  1866. font-size: 20rpx;
  1867. font-family: PingFang SC;
  1868. font-weight: 500;
  1869. color: #999999;
  1870. margin-top: 10rpx;
  1871. }
  1872. .chat1 {
  1873. font-size: 24rpx;
  1874. font-family: PingFang SC;
  1875. font-weight: 500;
  1876. color: #333333;
  1877. }
  1878. .leftPadding {
  1879. margin-left: 8rpx;
  1880. }
  1881. .t2Content {
  1882. font-size: 28rpx;
  1883. font-family: PingFang SC;
  1884. font-weight: bold;
  1885. color: #999999;
  1886. line-height: 48rpx;
  1887. }
  1888. .tBox2 {
  1889. display: flex;
  1890. padding-top: 10rpx;
  1891. color: #333333;
  1892. font-size: 30rpx;
  1893. }
  1894. .tBox {
  1895. display: flex;
  1896. align-items: center;
  1897. padding-top: 10rpx;
  1898. }
  1899. .title {
  1900. font-size: 24rpx;
  1901. color: #999999;
  1902. }
  1903. page {
  1904. // padding-top: 10px;
  1905. // padding-top: constant(safe-area-inset-top);
  1906. // padding-top: env(safe-area-inset-top);
  1907. }
  1908. .inputBottom {
  1909. position: fixed;
  1910. left: 0;
  1911. bottom: 0;
  1912. background: #ffffff;
  1913. height: 98rpx;
  1914. display: flex;
  1915. align-items: center;
  1916. width: 100%;
  1917. .flex_auto {
  1918. flex:1;
  1919. margin-left: 10% ;
  1920. .input {
  1921. height:60rpx;
  1922. }
  1923. }
  1924. .btn {
  1925. color: #007AFF;font-size: 30rpx;font-weight: bold;width: 15%;text-align: center;
  1926. }
  1927. }
  1928. .noteBox {
  1929. width: 100%;
  1930. background: #ffffff;
  1931. padding: 10rpx;
  1932. border-radius: 16rpx;
  1933. }
  1934. .dateBox {
  1935. width: 216rpx;
  1936. height: 48rpx;
  1937. background: #ffffff;
  1938. border-radius: 24rpx;
  1939. font-size: 24rpx;
  1940. color: #666666;
  1941. text-align: center;
  1942. line-height: 48rpx;
  1943. margin: 20rpx 0;
  1944. }
  1945. .t_content1 {
  1946. color: #007aff;
  1947. margin-left: 10rpx;
  1948. }
  1949. .tag1 {
  1950. border: 2rpx solid #007aff;
  1951. border-radius: 8rpx;
  1952. font-size: 20rpx;
  1953. color: #007aff;
  1954. padding: 5rpx;
  1955. }
  1956. .b_title {
  1957. color: #333333;
  1958. font-size: 30rpx;
  1959. font-weight: bold;
  1960. }
  1961. page {
  1962. background: #eaeef1;
  1963. }
  1964. .menuBox {
  1965. width: 100%;
  1966. background: #ffffff;
  1967. border-radius: 16rpx;
  1968. padding: 20rpx;
  1969. margin-bottom: 20rpx;
  1970. }
  1971. .btnspric {
  1972. border-top: 1rpx solid #eee;
  1973. display: flex;
  1974. align-items: center;
  1975. justify-content: space-between;
  1976. height: 108rpx;
  1977. padding-left: 43rpx;
  1978. padding-right: 32rpx;
  1979. }
  1980. .btnspric > .lefprL {
  1981. font-size: 36rpx;
  1982. color: #0c141f;
  1983. font-weight: bold;
  1984. }
  1985. .btnspric > .lefprR {
  1986. padding: 0rpx 24rpx;
  1987. height: 60rpx;
  1988. line-height: 60rpx;
  1989. text-align: center;
  1990. color: #fff;
  1991. background: #32467b;
  1992. border-radius: 24rpx;
  1993. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  1994. }
  1995. .yhj,
  1996. .hdyhj {
  1997. padding: 24rpx 29rpx 24rpx 34rpx;
  1998. }
  1999. .yhj {
  2000. border-bottom: 16rpx solid #f9f9f9;
  2001. }
  2002. .yhjtit {
  2003. font-size: 30rpx;
  2004. color: #0c141f;
  2005. font-weight: 500;
  2006. margin-bottom: 14rpx;
  2007. }
  2008. .yhjList {
  2009. display: flex;
  2010. align-items: center;
  2011. justify-content: space-between;
  2012. margin-bottom: 14rpx;
  2013. }
  2014. .yhjList > .yhjLefts {
  2015. display: flex;
  2016. align-items: center;
  2017. }
  2018. .yhjLefts > .yhl {
  2019. color: #32467b;
  2020. font-size: 30rpx;
  2021. margin-right: 31rpx;
  2022. }
  2023. .yhjLefts > .yhbq {
  2024. font-size: 24rpx;
  2025. color: #ff9500;
  2026. border-radius: 18rpx;
  2027. background-color: rgba(255, 149, 0, 0.2);
  2028. border: 2rpx solid #ff9500;
  2029. height: 38rpx;
  2030. line-height: 38rpx;
  2031. padding: 0rpx 16rpx;
  2032. }
  2033. .ts {
  2034. font-size: 24rpx;
  2035. color: #999;
  2036. margin: 14rpx 0rpx;
  2037. padding-right: 29rpx;
  2038. padding-left: 34rpx;
  2039. }
  2040. .yh {
  2041. padding-top: 20rpx;
  2042. }
  2043. .yh > .yhtitle {
  2044. display: flex;
  2045. align-items: center;
  2046. justify-content: space-between;
  2047. padding-right: 29rpx;
  2048. padding-left: 34rpx;
  2049. }
  2050. .priceBxs {
  2051. display: flex;
  2052. align-items: center;
  2053. }
  2054. .priceBxs > .pricleft {
  2055. border-radius: 24rpx;
  2056. border: 1rpx solid #e91313;
  2057. background-color: rgba(233, 19, 19, 0.1);
  2058. padding: 0rpx 18rpx;
  2059. height: 49rpx;
  2060. line-height: 49rpx;
  2061. text-align: center;
  2062. font-size: 30rpx;
  2063. font-weight: 500;
  2064. color: #e91313;
  2065. margin-right: 13rpx;
  2066. }
  2067. .topBox {
  2068. padding: 32rpx 32rpx 24rpx;
  2069. border-bottom: 1rpx solid #eeeeee;
  2070. }
  2071. .topBox > .boldFonstType {
  2072. font-weight: 500;
  2073. font-size: 30rpx;
  2074. margin: 16rpx 0rpx 23rpx;
  2075. }
  2076. .topBox > .firstTopL {
  2077. display: flex;
  2078. align-items: center;
  2079. }
  2080. .topBox > .firstTopL > .imageBs {
  2081. width: 331rpx;
  2082. height: 160rpx;
  2083. border-radius: 6rpx;
  2084. overflow: hidden;
  2085. margin-right: 8rpx;
  2086. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  2087. }
  2088. .topBox > .firstTopL > .imageBs > image {
  2089. width: 100%;
  2090. height: 100%;
  2091. }
  2092. .topBox > .firstTopL > .textBs {
  2093. font-size: 30rpx;
  2094. font-weight: bold;
  2095. color: #0c141f;
  2096. }
  2097. .content {
  2098. padding: 24rpx;
  2099. text-align: left;
  2100. }
  2101. .catalogBox {
  2102. display: flex;
  2103. align-items: center;
  2104. flex-wrap: nowrap;
  2105. overflow-x: auto;
  2106. padding-left: 38rpx;
  2107. max-height: 305rpx;
  2108. overflow-y: auto;
  2109. transition: all 0.4s;
  2110. }
  2111. .catalogBox > .catalogA {
  2112. min-width: 200rpx;
  2113. height: 48rpx;
  2114. line-height: 48rpx;
  2115. // text-align: center;
  2116. border: 2rpx solid transparent;
  2117. white-space: nowrap;
  2118. text-overflow: ellipsis;
  2119. overflow: hidden;
  2120. word-break: break-all;
  2121. border-radius: 10rpx;
  2122. background: rgba(22, 119, 255, 0.05);
  2123. padding-left: 19rpx;
  2124. box-sizing: border-box;
  2125. padding-right: 15rpx;
  2126. margin-right: 16rpx;
  2127. margin-bottom: 20rpx;
  2128. margin-top: 15rpx;
  2129. font-size: 24rpx;
  2130. color: #666;
  2131. }
  2132. .catalogBox > .activesq {
  2133. border-color: #1677ff;
  2134. }
  2135. .changeCatalogBox {
  2136. display: block;
  2137. }
  2138. .catalogBox::-webkit-scrollbar {
  2139. display: none; /* Chrome Safari */
  2140. }
  2141. .price_t2 {
  2142. font-size: 18rpx;
  2143. font-family: PingFang SC;
  2144. font-weight: 500;
  2145. text-decoration: line-through;
  2146. color: #999999;
  2147. }
  2148. .price_t1 {
  2149. font-size: 33rpx;
  2150. font-family: PingFang SC;
  2151. font-weight: bold;
  2152. color: #e91313;
  2153. }
  2154. .sc_t {
  2155. font-size: 22rpx;
  2156. color: #000000;
  2157. }
  2158. .sc {
  2159. width: 29rpx;
  2160. height: 29rpx;
  2161. }
  2162. .buy {
  2163. width: 138rpx;
  2164. height: 48rpx;
  2165. line-height: 48rpx;
  2166. background: #32467b;
  2167. border-radius: 10rpx;
  2168. color: #ffffff;
  2169. font-size: 28rpx;
  2170. text-align: center;
  2171. vertical-align: middle;
  2172. position: absolute;
  2173. right: 30rpx;
  2174. }
  2175. .video_body {
  2176. padding-bottom: 96rpx;
  2177. }
  2178. .footer_tab {
  2179. position: fixed;
  2180. bottom: 0;
  2181. height: 96rpx;
  2182. width: 100%;
  2183. background-color: #ffffff;
  2184. }
  2185. .tj_box {
  2186. width: 50%;
  2187. display: inline-block;
  2188. text-align: center;
  2189. margin: 10rpx 0;
  2190. }
  2191. .teacher_t {
  2192. font-size: 24rpx;
  2193. font-family: PingFang SC;
  2194. font-weight: 400;
  2195. color: #666666;
  2196. line-height: 36rpx;
  2197. margin-left: 15rpx;
  2198. }
  2199. .teacher_img {
  2200. width: 87rpx;
  2201. height: 129rpx;
  2202. }
  2203. .t2 {
  2204. font-size: 24rpx;
  2205. font-family: PingFang SC;
  2206. color: #666666;
  2207. line-height: 36rpx;
  2208. margin: 15rpx;
  2209. }
  2210. .r_t2 {
  2211. width: 201rpx;
  2212. height: 49rpx;
  2213. background: rgba(22, 119, 255, 0.05);
  2214. border: 1rpx solid #32467b;
  2215. border-radius: 16rpx;
  2216. color: #666666;
  2217. font-size: 23rpx;
  2218. text-align: center;
  2219. display: flex;
  2220. align-items: center;
  2221. padding: 5rpx;
  2222. }
  2223. .scroll_box {
  2224. width: 100%;
  2225. height: 60rpx;
  2226. background: #ffffff;
  2227. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  2228. white-space: nowrap;
  2229. overflow: hidden;
  2230. margin: 15rpx 0;
  2231. }
  2232. .r_sliper {
  2233. padding: 0 20rpx;
  2234. }
  2235. .top_line {
  2236. width: 6rpx;
  2237. height: 22rpx;
  2238. background: #32467b;
  2239. margin-right: 10rpx;
  2240. }
  2241. .video_t2 {
  2242. font-size: 24rpx;
  2243. font-family: PingFang SC;
  2244. font-weight: 500;
  2245. color: #666666;
  2246. }
  2247. .video_t1 {
  2248. height: 80rpx;
  2249. color: #333333;
  2250. line-height: 80rpx;
  2251. font-size: 30rpx;
  2252. font-family: PingFang SC;
  2253. font-weight: bold;
  2254. color: #333333;
  2255. overflow: hidden;
  2256. text-overflow: ellipsis;
  2257. white-space: nowrap;
  2258. }
  2259. .notice_wrap {
  2260. height:80rpx;
  2261. display: flex;
  2262. align-items: center;
  2263. justify-content: flex-end;
  2264. .video_t1_t {
  2265. width:100%;
  2266. height:40rpx;
  2267. line-height: 40rpx;
  2268. text-align: center;
  2269. background:rgba(245,154,35,1);
  2270. color:#333;
  2271. border-radius:10rpx;
  2272. font-size: 24rpx;
  2273. }
  2274. }
  2275. .video_play {
  2276. position: absolute;
  2277. width: 95rpx;
  2278. height: 95rpx;
  2279. top: 0;
  2280. left: 0;
  2281. right: 0;
  2282. bottom: 0;
  2283. margin: auto;
  2284. }
  2285. .video_box {
  2286. position: relative;
  2287. .video-toast {
  2288. position:absolute;
  2289. width: 686rpx;
  2290. height: 80rpx;
  2291. background: rgba(0,0,0,0.6);
  2292. border-radius: 24rpx;
  2293. bottom:100rpx;
  2294. left:50%;
  2295. transform: translateX(-50%);
  2296. color:#fff;
  2297. display: flex;
  2298. font-size: 26rpx;
  2299. align-items: center;
  2300. overflow:visible;
  2301. &__text {
  2302. flex:1;
  2303. margin-left:40rpx;
  2304. }
  2305. &__btn {
  2306. width:180rpx;
  2307. text-align: center;
  2308. border-left:1rpx solid #fff;
  2309. }
  2310. }
  2311. .video-toast__close {
  2312. position:absolute;
  2313. right:32rpx;
  2314. bottom:184rpx;
  2315. width: 40rpx;
  2316. height: 40rpx;
  2317. line-height: 40rpx;
  2318. text-align: center;
  2319. background: rgba(0,0,0,0.6);
  2320. border-radius:50%;
  2321. color:rgba(255,255,255,0.3)
  2322. }
  2323. }
  2324. .rotoct {
  2325. transform: rotate(90deg);
  2326. }
  2327. .notice_modal {
  2328. .content {
  2329. width:100%;
  2330. height:100%;
  2331. padding:20rpx;
  2332. .title {
  2333. color:#333;
  2334. line-height: 40rpx;
  2335. font-size: 30rpx;
  2336. text-align: center;
  2337. font-weight: bold;
  2338. }
  2339. .text {
  2340. line-height: 40rpx;
  2341. }
  2342. }
  2343. }
  2344. </style>