detail.vue 44 KB

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