detail.vue 55 KB

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