detail.vue 64 KB

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