detail.vue 47 KB

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