detail.vue 45 KB

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