detail.vue 40 KB

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