detail.vue 55 KB

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