detail.vue 44 KB

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