detail.vue 44 KB

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