detail.vue 55 KB

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