detail.vue 43 KB

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