detail.vue 45 KB

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