detail.vue 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736
  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.needProfileModal){
  765. return
  766. }
  767. if(self.gradeDetail.learningStatus==2){
  768. uni.showModal({
  769. showCancel:false,
  770. cancelText: '返回',
  771. content: '当前课程正在申请中,请耐心等待',
  772. success: function(resultst) {
  773. uni.navigateBack();
  774. }
  775. });
  776. }
  777. if(self.gradeDetail.learningStatus==3&&(Number(self.gradeDetail.learningTimeStart)>Number((new Date())/1000))){
  778. uni.showModal({
  779. showCancel:false,
  780. cancelText: '返回',
  781. content: '当前课程正在申请中,请耐心等待',
  782. success: function(resultst) {
  783. uni.navigateBack();
  784. }
  785. });
  786. }
  787. }
  788. });
  789. this.$store.state.allowLoading = true;
  790. },
  791. getNoteList() {
  792. let self = this;
  793. self.noteList = [];
  794. let data = { courseId: this.courseId, gradeId: this.gradeId, goodsId: this.goodsId }
  795. if(this.playSectionId>0){
  796. data.sectionId = this.playSectionId
  797. }
  798. this.$api.noteList(data).then(res => {
  799. if (res.data.code == 200) {
  800. self.noteList = res.data.rows;
  801. }
  802. });
  803. },
  804. delAnswer(answerId) {
  805. let self = this;
  806. let data = { answerId: answerId, status: -1 };
  807. this.$api.delAnswer(data).then(res => {
  808. if (res.data.code == 200) {
  809. self.getAnswerList();
  810. }
  811. });
  812. },
  813. clearCtx() {
  814. console.log(4234);
  815. this.placeholder = '您可以在这里输入答疑内容';
  816. this.ctxValue = '';
  817. this.assignUserId = 0;
  818. },
  819. replyContent(item) {
  820. this.assignUserId = item.userId;
  821. this.placeholder = '@' + item.realname;
  822. },
  823. delContent(item) {
  824. this.delAnswer(item.answerId);
  825. },
  826. postAnswer() {
  827. let self = this;
  828. let data = { courseId: this.courseId, answerText: this.ctxValue, goodsId: this.goodsId };
  829. if (this.assignUserId > 0) {
  830. data.assignUserId = this.assignUserId;
  831. }
  832. this.$api.postAnswer(data).then(res => {
  833. if (res.data.code == 200) {
  834. this.$u.toast('发布成功');
  835. self.getAnswerList();
  836. this.placeholder = '您可以在这里输入答疑内容';
  837. this.ctxValue = '';
  838. this.assignUserId = 0;
  839. }
  840. });
  841. },
  842. postContent() {
  843. if (!this.ctxValue||this.ctxValue=='') {
  844. this.$u.toast('请输入内容');
  845. return
  846. }
  847. this.postAnswer();
  848. },
  849. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  850. let currentTime = 0;
  851. var polyvPlayerContext = this.selectComponent('#playerVideo');
  852. if (polyvPlayerContext) {
  853. currentTime = polyvPlayerContext.getCurrentTime(); //录播回放
  854. }
  855. if(this.playChannelId>0){
  856. currentTime = 2;//直播无法获取,无论开始结束都传2秒
  857. }
  858. let self = this;
  859. let data = {
  860. photo: self.ossAvatarUrl,
  861. sectionId: parseInt(sectionId),
  862. goodsId: parseInt(self.goodsId),
  863. courseId: parseInt(self.courseId),
  864. studyDuration: parseInt(currentTime > 0 ? currentTime : self.studyDuration),
  865. gradeId: parseInt(self.gradeId),
  866. chapterId: parseInt(self.chapterId),
  867. moduleId: parseInt(self.moduleId)
  868. };
  869. if (status > 0) {
  870. data.status = status;
  871. }
  872. console.log('提交接口', data);
  873. this.$api.studyRecord(data).then(res => {
  874. self.ossAvatarUrl = ''
  875. console.log(res);
  876. });
  877. },
  878. uploadFile(options, int) {
  879. var self = this;
  880. return new Promise((resolve, reject) => {
  881. var data = {
  882. imageStatus: int
  883. };
  884. self.$api.aliyunpolicy(data).then(res => {
  885. if (res.data.code != 200) {
  886. self.$method.showToast('签名错误' + JSON.stringify(res.data));
  887. return;
  888. }
  889. var ossToken = res.data.data.resultContent;
  890. if (ossToken.host == null || ossToken.host == undefined) {
  891. self.$method.showToast('上传路径报错' + JSON.stringify(res.data));
  892. return;
  893. }
  894. uni.uploadFile({
  895. url: ossToken.host,
  896. name: 'file',
  897. filePath: options,
  898. fileType: 'image',
  899. header: {
  900. AuthorizationToken: 'WX ' + uni.getStorageSync('token')
  901. },
  902. formData: {
  903. key: ossToken.dir,
  904. OSSAccessKeyId: ossToken.accessid,
  905. policy: ossToken.policy,
  906. Signature: ossToken.signature,
  907. callback: ossToken.callback,
  908. success_action_status: 200
  909. },
  910. success: result => {
  911. if (result.statusCode === 200) {
  912. self.ossAvatarUrl = ossToken.dir;
  913. resolve();
  914. } else {
  915. uni.showToast({
  916. title: '上传失败',
  917. icon: 'none'
  918. });
  919. return;
  920. }
  921. },
  922. fail: error => {
  923. uni.showToast({
  924. title: '上传接口报错' + error,
  925. icon: 'none'
  926. });
  927. return;
  928. }
  929. });
  930. });
  931. });
  932. },
  933. imageInfos() {
  934. var self = this;
  935. return new Promise((resolve, reject) => {
  936. uni.getImageInfo({
  937. src: self.avatarUrl,
  938. success: async res => {
  939. let canvasWidth = res.width; //图片原始长宽
  940. let canvasHeight = res.height;
  941. if (canvasWidth > 1000 || canvasHeight > 1000) {
  942. uni.compressImage({
  943. src: self.avatarUrl,
  944. quality: 75,
  945. width: '50%',
  946. height: '50%',
  947. success: async rest => {
  948. const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
  949. resolve();
  950. }
  951. });
  952. } else {
  953. console.log('无需压缩');
  954. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  955. resolve();
  956. }
  957. }
  958. });
  959. });
  960. },
  961. timeEvent() {
  962. let self = this;
  963. var polyvPlayerContext = this.selectComponent('#playerVideo');
  964. if (polyvPlayerContext != null) {
  965. this.playTime = polyvPlayerContext.getCurrentTime() //播放时刻
  966. //判断是否需要拍照
  967. if (this.photoNum > 0) {
  968. this.configPhoto()
  969. if(this.photoIndex<this.photoList.length){
  970. let photoTime = Number(this.photoList[this.photoIndex]); //获取拍照秒数
  971. let nextIndex = this.photoIndex+1
  972. let nextTime = 0
  973. if(nextIndex<this.photoList.length){
  974. nextTime = Number(this.photoList[nextIndex]); //获取下次拍照秒数
  975. }
  976. if (photoTime < this.playTime) {
  977. if(this.photoHistoryList.indexOf(this.photoIndex)<0){ //不存在拍照历史则拍照
  978. //启动拍照
  979. //暂停
  980. polyvPlayerContext.exitFullScreen();
  981. polyvPlayerContext.pause();
  982. this.photoIndex++;
  983. this.openPhoto();
  984. }
  985. }
  986. }
  987. }
  988. }
  989. },
  990. onStateChange(newstate, oldstate) {
  991. if (newstate.detail.newstate == 'playing') {
  992. if (this.needSeek) {
  993. var polyvPlayerContext = this.selectComponent('#playerVideo');
  994. polyvPlayerContext.seek(this.recordObj.studyDuration);
  995. polyvPlayerContext.play();
  996. this.needSeek = false;
  997. }
  998. //开始播放
  999. if (this.timer) {
  1000. clearInterval(this.timer);
  1001. }
  1002. this.timer = setInterval(this.timeEvent, 1000); //定时器
  1003. }
  1004. if (newstate.detail.newstate == 'pause') {
  1005. //暂停提交记录
  1006. /* this.ossAvatarUrl = ""
  1007. this.postStudyRecord() */
  1008. }
  1009. if (newstate.detail.newstate == 'ended') {
  1010. this.postStudyRecord(1);
  1011. }
  1012. },
  1013. //拍照
  1014. openPhoto() {
  1015. this.photoPopup = true;
  1016. uni.authorize({
  1017. scope: 'scope.camera',
  1018. success() {
  1019. }
  1020. })
  1021. },
  1022. async submit() {
  1023. const waitYS = await this.imageInfos();
  1024. this.postCoursePhotoRecord()
  1025. this.postStudyRecord(); //提交记录
  1026. //恢复播放
  1027. var polyvPlayerContext = this.selectComponent('#playerVideo');
  1028. if (polyvPlayerContext != null) {
  1029. polyvPlayerContext.play();
  1030. }
  1031. },
  1032. //确认拍照
  1033. takePhoto() {
  1034. var self = this;
  1035. const ctx = uni.createCameraContext();
  1036. ctx.takePhoto({
  1037. quality: 'high',
  1038. success: res => {
  1039. console.log(res.tempImagePath);
  1040. self.avatarUrl = res.tempImagePath;
  1041. self.submit();
  1042. self.photoPopup = false;
  1043. },
  1044. fail: err => {
  1045. console.log(err);
  1046. }
  1047. });
  1048. },
  1049. //拍照报错
  1050. error(e) {
  1051. console.log(e.detail);
  1052. },
  1053. //关闭相机
  1054. closePhoto() {
  1055. this.photoPopup = false;
  1056. },
  1057. getGoodsDetail() {
  1058. let self = this;
  1059. this.$api.goodsDetail(this.goodsId).then(res => {
  1060. self.goodsData = res.data.data;
  1061. self.gradeId = self.goodsData.gradeId;
  1062. console.log(self.gradeId, "班级ID");
  1063. self.getMenuList();
  1064. self.getReMenuList(); //获取重修目录
  1065. setTimeout(function(){
  1066. if(!self.needProfileModal){
  1067. self.getGradeInfo()
  1068. }
  1069. },500)
  1070. //获取节笔记
  1071. this.getNoteList();
  1072. if (self.goodsData.goodsPlayConfig) {
  1073. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  1074. if (self.goodsPlayConfig.autoPlay > 0) {
  1075. self.autoplay = true;
  1076. }
  1077. if (self.goodsPlayConfig.drag > 0) {
  1078. self.isAllowSeek = 'yes';
  1079. }
  1080. if (self.goodsPlayConfig.speed > 0) {
  1081. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  1082. }
  1083. }
  1084. if (self.goodsData.goodsPhotographConfig) {
  1085. self.goodsPhotographConfig = JSON.parse(self.goodsData.goodsPhotographConfig);
  1086. if (self.goodsPhotographConfig.photoNum>0) {
  1087. self.photoNum = self.goodsPhotographConfig.photoNum
  1088. console.log(self.photoNum,777777)
  1089. }
  1090. }
  1091. });
  1092. },
  1093. startVideo() {
  1094. this.startStatus = true;
  1095. },
  1096. getAnswerList() {
  1097. let self = this;
  1098. this.$api.answerList({ courseId: this.courseId,goodsId: this.goodsId }).then(res => {
  1099. if (res.data.code == 200) {
  1100. self.answerList = res.data.rows;
  1101. }
  1102. });
  1103. },
  1104. getReMenuList() {
  1105. let self = this;
  1106. this.$api.reMenuList({ courseId: this.courseId, rebuild: 1, gradeId: this.gradeId }).then(res => {
  1107. if (res.data.code == 200) {
  1108. for (let i = 0; i < res.data.rows.length; i++) {
  1109. let item = res.data.rows[i];
  1110. item.down = true;
  1111. item.id = item.menuId;
  1112. item.name = item.menuName;
  1113. }
  1114. self.reMenuList = res.data.rows;
  1115. if(self.reMenuList.length>0){
  1116. self.list = [
  1117. {
  1118. name: '目录'
  1119. },
  1120. {
  1121. name: '笔记'
  1122. },
  1123. {
  1124. name: '答疑'
  1125. },{name:'重修目录'}
  1126. ];
  1127. this.current = 0;
  1128. } else {
  1129. self.list = [
  1130. {
  1131. name: '目录'
  1132. },
  1133. {
  1134. name: '笔记'
  1135. },
  1136. {
  1137. name: '答疑'
  1138. }
  1139. ];
  1140. this.current = 0;
  1141. }
  1142. }
  1143. });
  1144. },
  1145. getMenuList() {
  1146. let self = this;
  1147. this.$api.reMenuList({ courseId: this.courseId, gradeId: this.gradeId }).then(res => {
  1148. if (res.data.code == 200) {
  1149. for (let i = 0; i < res.data.rows.length; i++) {
  1150. let item = res.data.rows[i];
  1151. item.down = true;
  1152. item.id = item.menuId;
  1153. item.name = item.menuName;
  1154. }
  1155. self.menuList = res.data.rows;
  1156. }
  1157. });
  1158. },
  1159. courseDetail() {
  1160. let self = this;
  1161. this.$api.courseDetail(this.courseId).then(res => {
  1162. if (res.data.code == 200) {
  1163. self.detail = res.data.data;
  1164. }
  1165. });
  1166. },
  1167. open(item) {
  1168. item.showChildren = !item.showChildren;
  1169. },
  1170. change(index) {
  1171. this.current = index;
  1172. }
  1173. }
  1174. };
  1175. </script>
  1176. <style lang="scss" scope>
  1177. .btnSet{
  1178. width: 440rpx;
  1179. height: 80rpx;
  1180. background: #007AFF;
  1181. border-radius: 40rpx;
  1182. color: #FFFFFF;
  1183. font-size: 28rpx;
  1184. line-height: 80rpx;
  1185. }
  1186. .btnReply {
  1187. width: 80rpx;
  1188. height: 40rpx;
  1189. background: #e3f0ff;
  1190. border-radius: 16rpx;
  1191. text-align: center;
  1192. color: #007aff;
  1193. }
  1194. .btnDel {
  1195. width: 80rpx;
  1196. height: 40rpx;
  1197. background: #ffedf0;
  1198. border-radius: 16rpx;
  1199. text-align: center;
  1200. color: #ff2d55;
  1201. }
  1202. .btnReply {
  1203. width: 80rpx;
  1204. height: 40rpx;
  1205. background: #e3f0ff;
  1206. border-radius: 16rpx;
  1207. font-size: 24rpx;
  1208. }
  1209. .photoBox {
  1210. background-color: #FFFFFF;
  1211. border-radius: 32px 32px 0px 0px;
  1212. .photoTop {
  1213. height: 74upx;
  1214. display: flex;
  1215. align-items: center;
  1216. justify-content: space-between;
  1217. padding: 0upx 38upx;
  1218. .sqzz {
  1219. width: 28upx;
  1220. height: 28upx;
  1221. display: flex;
  1222. align-items: center;
  1223. justify-content: center;
  1224. }
  1225. .centersq {
  1226. color: #333;
  1227. font-size: 30upx;
  1228. font-weight: 500;
  1229. }
  1230. }
  1231. .photoCenter {
  1232. width: 750upx;
  1233. height: 979upx;
  1234. position: relative;
  1235. .custom {
  1236. width: 750upx;
  1237. height: 979upx;
  1238. position: absolute;
  1239. z-index: 1000;
  1240. top: 0;
  1241. left: 0;
  1242. image {
  1243. width: 100%;
  1244. height: 100%;
  1245. }
  1246. }
  1247. }
  1248. .btnResult {
  1249. height: 100rpx;
  1250. width: 100%;
  1251. background-color: #07c160;
  1252. text-align: center;
  1253. line-height: 100upx;
  1254. color: #fff;
  1255. font-size: 32upx;
  1256. font-weight: bold;
  1257. }
  1258. }
  1259. .chat_box {
  1260. display: flex;
  1261. padding: 20rpx;
  1262. justify-content: space-between;
  1263. }
  1264. .chat3 {
  1265. font-size: 30rpx;
  1266. font-family: PingFang SC;
  1267. font-weight: 500;
  1268. color: #666666;
  1269. margin-top: 10rpx;
  1270. }
  1271. .chat2 {
  1272. font-size: 20rpx;
  1273. font-family: PingFang SC;
  1274. font-weight: 500;
  1275. color: #999999;
  1276. margin-top: 10rpx;
  1277. }
  1278. .chat1 {
  1279. font-size: 24rpx;
  1280. font-family: PingFang SC;
  1281. font-weight: 500;
  1282. color: #333333;
  1283. }
  1284. .leftPadding {
  1285. margin-left: 8rpx;
  1286. }
  1287. .t2Content {
  1288. font-size: 28rpx;
  1289. font-family: PingFang SC;
  1290. font-weight: bold;
  1291. color: #999999;
  1292. line-height: 48rpx;
  1293. }
  1294. .tBox2 {
  1295. display: flex;
  1296. padding-top: 10rpx;
  1297. color: #333333;
  1298. font-size: 30rpx;
  1299. }
  1300. .tBox {
  1301. display: flex;
  1302. align-items: center;
  1303. padding-top: 10rpx;
  1304. }
  1305. .title {
  1306. font-size: 24rpx;
  1307. color: #999999;
  1308. }
  1309. page {
  1310. padding-top: 10px;
  1311. padding-top: constant(safe-area-inset-top);
  1312. padding-top: env(safe-area-inset-top);
  1313. }
  1314. .inputBottom {
  1315. position: fixed;
  1316. left: 0;
  1317. bottom: 0;
  1318. background: #ffffff;
  1319. height: 98rpx;
  1320. display: flex;
  1321. align-items: center;
  1322. width: 100%;
  1323. .flex_auto {
  1324. flex:1;
  1325. margin-left: 10% ;
  1326. .input {
  1327. height:60rpx;
  1328. }
  1329. }
  1330. .btn {
  1331. color: #007AFF;font-size: 30rpx;font-weight: bold;width: 15%;text-align: center;
  1332. }
  1333. }
  1334. .noteBox {
  1335. width: 100%;
  1336. background: #ffffff;
  1337. padding: 10rpx;
  1338. border-radius: 16rpx;
  1339. }
  1340. .dateBox {
  1341. width: 216rpx;
  1342. height: 48rpx;
  1343. background: #ffffff;
  1344. border-radius: 24rpx;
  1345. font-size: 24rpx;
  1346. color: #666666;
  1347. text-align: center;
  1348. line-height: 48rpx;
  1349. margin: 20rpx 0;
  1350. }
  1351. .t_content1 {
  1352. color: #007aff;
  1353. margin-left: 10rpx;
  1354. }
  1355. .tag1 {
  1356. border: 2rpx solid #007aff;
  1357. border-radius: 8rpx;
  1358. font-size: 20rpx;
  1359. color: #007aff;
  1360. padding: 5rpx;
  1361. }
  1362. .b_title {
  1363. color: #333333;
  1364. font-size: 30rpx;
  1365. font-weight: bold;
  1366. }
  1367. page {
  1368. background: #eaeef1;
  1369. }
  1370. .menuBox {
  1371. width: 100%;
  1372. background: #ffffff;
  1373. border-radius: 16rpx;
  1374. padding: 20rpx;
  1375. margin-bottom: 20rpx;
  1376. }
  1377. .btnspric {
  1378. border-top: 1rpx solid #eee;
  1379. display: flex;
  1380. align-items: center;
  1381. justify-content: space-between;
  1382. height: 108rpx;
  1383. padding-left: 43rpx;
  1384. padding-right: 32rpx;
  1385. }
  1386. .btnspric > .lefprL {
  1387. font-size: 36rpx;
  1388. color: #0c141f;
  1389. font-weight: bold;
  1390. }
  1391. .btnspric > .lefprR {
  1392. padding: 0rpx 24rpx;
  1393. height: 60rpx;
  1394. line-height: 60rpx;
  1395. text-align: center;
  1396. color: #fff;
  1397. background: #32467b;
  1398. border-radius: 24rpx;
  1399. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  1400. }
  1401. .yhj,
  1402. .hdyhj {
  1403. padding: 24rpx 29rpx 24rpx 34rpx;
  1404. }
  1405. .yhj {
  1406. border-bottom: 16rpx solid #f9f9f9;
  1407. }
  1408. .yhjtit {
  1409. font-size: 30rpx;
  1410. color: #0c141f;
  1411. font-weight: 500;
  1412. margin-bottom: 14rpx;
  1413. }
  1414. .yhjList {
  1415. display: flex;
  1416. align-items: center;
  1417. justify-content: space-between;
  1418. margin-bottom: 14rpx;
  1419. }
  1420. .yhjList > .yhjLefts {
  1421. display: flex;
  1422. align-items: center;
  1423. }
  1424. .yhjLefts > .yhl {
  1425. color: #32467b;
  1426. font-size: 30rpx;
  1427. margin-right: 31rpx;
  1428. }
  1429. .yhjLefts > .yhbq {
  1430. font-size: 24rpx;
  1431. color: #ff9500;
  1432. border-radius: 18rpx;
  1433. background-color: rgba(255, 149, 0, 0.2);
  1434. border: 2rpx solid #ff9500;
  1435. height: 38rpx;
  1436. line-height: 38rpx;
  1437. padding: 0rpx 16rpx;
  1438. }
  1439. .ts {
  1440. font-size: 24rpx;
  1441. color: #999;
  1442. margin: 14rpx 0rpx;
  1443. padding-right: 29rpx;
  1444. padding-left: 34rpx;
  1445. }
  1446. .yh {
  1447. padding-top: 20rpx;
  1448. }
  1449. .yh > .yhtitle {
  1450. display: flex;
  1451. align-items: center;
  1452. justify-content: space-between;
  1453. padding-right: 29rpx;
  1454. padding-left: 34rpx;
  1455. }
  1456. .priceBxs {
  1457. display: flex;
  1458. align-items: center;
  1459. }
  1460. .priceBxs > .pricleft {
  1461. border-radius: 24rpx;
  1462. border: 1rpx solid #e91313;
  1463. background-color: rgba(233, 19, 19, 0.1);
  1464. padding: 0rpx 18rpx;
  1465. height: 49rpx;
  1466. line-height: 49rpx;
  1467. text-align: center;
  1468. font-size: 30rpx;
  1469. font-weight: 500;
  1470. color: #e91313;
  1471. margin-right: 13rpx;
  1472. }
  1473. .topBox {
  1474. padding: 32rpx 32rpx 24rpx;
  1475. border-bottom: 1rpx solid #eeeeee;
  1476. }
  1477. .topBox > .boldFonstType {
  1478. font-weight: 500;
  1479. font-size: 30rpx;
  1480. margin: 16rpx 0rpx 23rpx;
  1481. }
  1482. .topBox > .firstTopL {
  1483. display: flex;
  1484. align-items: center;
  1485. }
  1486. .topBox > .firstTopL > .imageBs {
  1487. width: 331rpx;
  1488. height: 160rpx;
  1489. border-radius: 6rpx;
  1490. overflow: hidden;
  1491. margin-right: 8rpx;
  1492. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  1493. }
  1494. .topBox > .firstTopL > .imageBs > image {
  1495. width: 100%;
  1496. height: 100%;
  1497. }
  1498. .topBox > .firstTopL > .textBs {
  1499. font-size: 30rpx;
  1500. font-weight: bold;
  1501. color: #0c141f;
  1502. }
  1503. .content {
  1504. padding: 24rpx;
  1505. text-align: left;
  1506. }
  1507. .catalogBox {
  1508. display: flex;
  1509. align-items: center;
  1510. flex-wrap: nowrap;
  1511. overflow-x: auto;
  1512. padding-left: 38rpx;
  1513. max-height: 305rpx;
  1514. overflow-y: auto;
  1515. transition: all 0.4s;
  1516. }
  1517. .catalogBox > .catalogA {
  1518. min-width: 200rpx;
  1519. height: 48rpx;
  1520. line-height: 48rpx;
  1521. // text-align: center;
  1522. border: 2rpx solid transparent;
  1523. white-space: nowrap;
  1524. text-overflow: ellipsis;
  1525. overflow: hidden;
  1526. word-break: break-all;
  1527. border-radius: 10rpx;
  1528. background: rgba(22, 119, 255, 0.05);
  1529. padding-left: 19rpx;
  1530. box-sizing: border-box;
  1531. padding-right: 15rpx;
  1532. margin-right: 16rpx;
  1533. margin-bottom: 20rpx;
  1534. margin-top: 15rpx;
  1535. font-size: 24rpx;
  1536. color: #666;
  1537. }
  1538. .catalogBox > .activesq {
  1539. border-color: #1677ff;
  1540. }
  1541. .changeCatalogBox {
  1542. display: block;
  1543. }
  1544. .catalogBox::-webkit-scrollbar {
  1545. display: none; /* Chrome Safari */
  1546. }
  1547. .box {
  1548. position: relative;
  1549. top: 650rpx;
  1550. padding-bottom: 88rpx;
  1551. margin: 20rpx;
  1552. }
  1553. .price_t2 {
  1554. font-size: 18rpx;
  1555. font-family: PingFang SC;
  1556. font-weight: 500;
  1557. text-decoration: line-through;
  1558. color: #999999;
  1559. }
  1560. .price_t1 {
  1561. font-size: 33rpx;
  1562. font-family: PingFang SC;
  1563. font-weight: bold;
  1564. color: #e91313;
  1565. }
  1566. .sc_t {
  1567. font-size: 22rpx;
  1568. color: #000000;
  1569. }
  1570. .sc {
  1571. width: 29rpx;
  1572. height: 29rpx;
  1573. }
  1574. .buy {
  1575. width: 138rpx;
  1576. height: 48rpx;
  1577. line-height: 48rpx;
  1578. background: #32467b;
  1579. border-radius: 10rpx;
  1580. color: #ffffff;
  1581. font-size: 28rpx;
  1582. text-align: center;
  1583. vertical-align: middle;
  1584. position: absolute;
  1585. right: 30rpx;
  1586. }
  1587. .video_body {
  1588. padding-bottom: 96rpx;
  1589. }
  1590. .footer_tab {
  1591. position: fixed;
  1592. bottom: 0;
  1593. height: 96rpx;
  1594. width: 100%;
  1595. background-color: #ffffff;
  1596. }
  1597. .tj_box {
  1598. width: 50%;
  1599. display: inline-block;
  1600. text-align: center;
  1601. margin: 10rpx 0;
  1602. }
  1603. .teacher_t {
  1604. font-size: 24rpx;
  1605. font-family: PingFang SC;
  1606. font-weight: 400;
  1607. color: #666666;
  1608. line-height: 36rpx;
  1609. margin-left: 15rpx;
  1610. }
  1611. .teacher_img {
  1612. width: 87rpx;
  1613. height: 129rpx;
  1614. }
  1615. .t2 {
  1616. font-size: 24rpx;
  1617. font-family: PingFang SC;
  1618. color: #666666;
  1619. line-height: 36rpx;
  1620. margin: 15rpx;
  1621. }
  1622. .r_t2 {
  1623. width: 201rpx;
  1624. height: 49rpx;
  1625. background: rgba(22, 119, 255, 0.05);
  1626. border: 1rpx solid #32467b;
  1627. border-radius: 16rpx;
  1628. color: #666666;
  1629. font-size: 23rpx;
  1630. text-align: center;
  1631. display: flex;
  1632. align-items: center;
  1633. padding: 5rpx;
  1634. }
  1635. .scroll_box {
  1636. width: 100%;
  1637. height: 60rpx;
  1638. background: #ffffff;
  1639. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  1640. white-space: nowrap;
  1641. overflow: hidden;
  1642. margin: 15rpx 0;
  1643. }
  1644. .r_sliper {
  1645. padding: 0 20rpx;
  1646. }
  1647. .top_line {
  1648. width: 6rpx;
  1649. height: 22rpx;
  1650. background: #32467b;
  1651. margin-right: 10rpx;
  1652. }
  1653. .video_t2 {
  1654. font-size: 24rpx;
  1655. font-family: PingFang SC;
  1656. font-weight: 500;
  1657. color: #666666;
  1658. }
  1659. .video_t1 {
  1660. height: 80rpx;
  1661. color: #333333;
  1662. line-height: 80rpx;
  1663. font-size: 30rpx;
  1664. font-family: PingFang SC;
  1665. font-weight: bold;
  1666. color: #333333;
  1667. overflow: hidden;
  1668. text-overflow: ellipsis;
  1669. white-space: nowrap;
  1670. }
  1671. .video_t1_t {
  1672. display: flex;
  1673. flex-direction: column;
  1674. height: 80rpx;
  1675. color: #333333;
  1676. text-align: center;
  1677. align-items: center;
  1678. border-left: solid 1px #d6d6db;
  1679. }
  1680. .video_play {
  1681. position: absolute;
  1682. width: 95rpx;
  1683. height: 95rpx;
  1684. top: 0;
  1685. left: 0;
  1686. right: 0;
  1687. bottom: 0;
  1688. margin: auto;
  1689. }
  1690. .video_box {
  1691. position: relative;
  1692. }
  1693. .rotoct {
  1694. transform: rotate(90deg);
  1695. }
  1696. </style>