detail.vue 44 KB

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