detail.vue 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148
  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 class="video_box" style="width: 100%;height: 460rpx;">
  9. <polyv-player
  10. id="playerVideo"
  11. playerId="playerVideo"
  12. height="460rpx"
  13. :vid="vid"
  14. :showSettingBtn="true"
  15. :enablePlayGesture="true"
  16. @statechange="onStateChange"
  17. :autoplay="autoplay"
  18. :isAllowSeek="isAllowSeek"
  19. :playbackRate="playbackRate"
  20. ></polyv-player>
  21. </view>
  22. <view>
  23. <u-row>
  24. <u-col span="10">
  25. <view class="video_t1">{{ detail.courseName }}</view>
  26. </u-col>
  27. <u-col span="2">
  28. <view class="video_t1_t" @click="openPhoto">
  29. <image src="/static/icon/jy_icon.png" style="width: 40rpx;height: 40rpx;"></image>
  30. 讲义
  31. </view>
  32. </u-col>
  33. </u-row>
  34. </view>
  35. <u-line color="#D6D6DB" />
  36. <view style="display: flex;justify-content: center;">
  37. <view style="width: 280px;">
  38. <u-tabs :list="list" font-size="24" bar-width="80" :current="current" @change="change" active-color="#007AFF"></u-tabs>
  39. </view>
  40. </view>
  41. <u-line color="#D6D6DB" />
  42. </view>
  43. <view class="box">
  44. <!--目录 -->
  45. <view v-show="current == 0">
  46. <view class="menuBox" v-for="(item, index) in reMenuList">
  47. <!--模块 -->
  48. <view v-if="item.type == 1"><courseModule :gradeId="gradeId" :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="item.menuId"></courseModule></view>
  49. <!--章 -->
  50. <view v-if="item.type == 2"><courseChapter :gradeId="gradeId" :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="'0-'+item.menuId"></courseChapter></view>
  51. <!--节 -->
  52. <view v-if="item.type == 3"><courseSection :gradeId="gradeId" :isRebuild="true" :isBuy="true" :menuItem="item" :levelId="'0-0-'+item.menuId"></courseSection></view>
  53. </view>
  54. </view>
  55. <!--目录 -->
  56. <view v-show="current == 1">
  57. <view class="menuBox" v-for="(item, index) in menuList">
  58. <!--模块 -->
  59. <view v-if="item.type == 1"><courseModule :isBuy="true" :menuItem="item" :levelId="item.menuId"></courseModule></view>
  60. <!--章 -->
  61. <view v-if="item.type == 2"><courseChapter :isBuy="true" :menuItem="item" :levelId="'0-'+item.menuId"></courseChapter></view>
  62. <!--节 -->
  63. <view v-if="item.type == 3"><courseSection :isBuy="true" :menuItem="item" :levelId="'0-0-'+item.menuId"></courseSection></view>
  64. </view>
  65. </view>
  66. <!--笔记 -->
  67. <view v-show="current == 2">
  68. <view class="inputBottom">
  69. <view style="width: 10%;"><image src="/static/icon/note3.png" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image></view>
  70. <view style="width: 73%;height: 88rpx;margin-bottom: 15rpx;">
  71. <u-input height="78" fixed="true" :placeholder="placeholder" type="textarea" :custom-style="inputStyle" v-model="noteValue" />
  72. </view>
  73. <view style="color: #007AFF;font-size: 30rpx;font-weight: bold;width: 15%;text-align: center;" @click="postNote">提交</view>
  74. </view>
  75. <view v-for="(item, index) in noteList" >
  76. <view class="dateBox">{{$method.timestampToTime(item.dateNote)}}</view>
  77. <view class="noteBox">
  78. <view v-for="(item1, index1) in item.userNotes" style="margin-top: 30rpx;" @click="jumpNote(item1)">
  79. <view style="display: flex;">
  80. <view>
  81. <view >
  82. <image src="/static/icon/note2.png" v-if="noteId!=item1.noteId" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image>
  83. <image src="/static/icon/note1.png" v-if="noteId==item1.noteId" style="width: 39rpx;height: 39rpx;margin:0 29rpx;"></image>
  84. </view>
  85. <view class="title" style="width: 39rpx;height: 39rpx;margin:0 29rpx;">{{$method.secondToDate(item1.noteSecond)}}</view>
  86. </view>
  87. <view style="margin-left: 10rpx;">
  88. <view class="t2Content leftPadding">{{item1.sectionName}}</view>
  89. <view class="tBox2">
  90. {{item1.noteText}}
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. </view>
  98. <!--答疑 -->
  99. <view v-show="current == 3">
  100. <view class="inputBottom">
  101. <view style="width: 73%;height: 88rpx;margin-bottom: 15rpx;margin-left: 10% ;">
  102. <u-input height="78" fixed="true" :placeholder="placeholder" type="textarea" :custom-style="inputStyle" v-model="ctxValue" />
  103. </view>
  104. <view style="color: #007AFF;font-size: 30rpx;font-weight: bold;width: 15%;text-align: center;" @click="postContent">提交</view>
  105. </view>
  106. <view v-for="(item, index) in answerList" style="background-color: #FFFFFF;margin-bottom: 20rpx;">
  107. <view class="chat_box" @click.stop="clearCtx">
  108. <view style="display: flex;" >
  109. <view><image :src="$method.splitImgHost(item.avatar)" style="width: 64rpx;height: 64rpx;"></image></view>
  110. <view style="margin-left: 15rpx;">
  111. <view class="chat1">{{item.realname}}</view>
  112. <view class="chat2">{{$method.timestampToTime(item.createTime)}}</view>
  113. <view class="chat3">
  114. <text v-if="item.assignUserId>0">回复</text>
  115. <text v-if="item.assignUserId>0" style="color: #007AFF;">@{{item.assignRealname}}</text>
  116. {{item.answerText}}</view>
  117. </view>
  118. </view>
  119. <view class="btnReply" @click.stop="replyContent(item)" v-if="item.userId!=userInfo.userId">回复</view>
  120. <view v-else class="btnDel" @click.stop="delContent(item)">删除</view>
  121. </view>
  122. <u-line color="#D6D6DB" />
  123. </view>
  124. <view v-if="answerList.length==0" style="text-align: center;">
  125. 暂无记录
  126. </view>
  127. </view>
  128. </view>
  129. <!-- 播放前拍照start -->
  130. <u-popup v-model="photoPopup" mode="bottom" border-radius="32" :mask-close-able="false">
  131. <view class="photoBox">
  132. <view class="photoTop">
  133. <view class="sqzz" v-if="true">
  134. <u-icon name="close" color="#333333" size="30" @click="closePhoto"></u-icon>
  135. </view>
  136. <view class="centersq">
  137. 请正视手机屏幕
  138. </view>
  139. <view class="sqzz">
  140. </view>
  141. </view>
  142. <view class="photoCenter">
  143. <camera device-position="front" flash="off" @error="error" style="width: 100%; height: 100%" v-if="photoPopup"></camera>
  144. <view class="custom">
  145. <image src="@/pages2/static/zhezhao.png" mode=""></image>
  146. </view>
  147. </view>
  148. <view class="btnResult" @click="takePhoto">
  149. 拍照
  150. </view>
  151. </view>
  152. </u-popup>
  153. <!-- 播放前拍照end -->
  154. </view>
  155. </template>
  156. <script>
  157. import eventHub from '@/common/eventHub.js';
  158. import courseModule from '@/components/course/courseModule.vue';
  159. import courseChapter from '@/components/course/courseChapter.vue';
  160. import courseSection from '@/components/course/courseSection.vue';
  161. import { mapGetters } from 'vuex';
  162. export default {
  163. components: {
  164. courseModule,
  165. courseChapter,
  166. courseSection
  167. },
  168. data() {
  169. return {
  170. startStatus: false,
  171. detail: {},
  172. courseId: 0,
  173. placeholder: '您可以在这里输入笔记内容\n还可以点击左侧图标为笔记加上时间标记',
  174. inputStyle: {
  175. background: 'rgba(244, 244, 244, 0.98)',
  176. borderRadius: '24rpx',
  177. padding: '8rpx',
  178. marginBottom: '10rpx'
  179. },
  180. playbackRate: [0.5, 0.8, 1.0],
  181. list: [
  182. {
  183. name: '重修目录'
  184. },
  185. {
  186. name: '目录'
  187. },
  188. {
  189. name: '笔记'
  190. },
  191. {
  192. name: '答疑'
  193. }
  194. ],
  195. menuList: [
  196. ],
  197. current: 1,
  198. vid:'',
  199. goodsId:0,
  200. goodsData:{},
  201. photoPopup:false,
  202. goodsPlayConfig:null,
  203. autoplay:false,
  204. isAllowSeek:'no',
  205. playbackRate: [1.0],
  206. timer:null,
  207. goodsPhotographConfig:null,
  208. intervalTimeList:[],// 间隔拍照时长
  209. intervalTimeIndex:0 ,//当前处于哪个时间段拍照
  210. playTime:0 ,//页面播放时长,不含暂停
  211. currentTime:0,
  212. avatarUrl:'',
  213. ossAvatarUrl:'',
  214. studyDuration:0, // 当前视频时长
  215. gradeId:0,
  216. chapterId:0,
  217. moduleId:0,
  218. reMenuList: [],
  219. answerList: [],
  220. assignUserId:0,
  221. placeholder:'您可以在这里输入答疑内容',
  222. ctxValue:'',
  223. noteList:[],
  224. noteValue:'',
  225. noteId:0
  226. };
  227. },
  228. onUnload() {},
  229. computed: { ...mapGetters(['userInfo','playSectionId']) },
  230. onLoad(option) {
  231. this.courseId = option.id;
  232. this.goodsId = uni.getStorageSync('courseGoodsId');
  233. this.courseDetail();
  234. this.getGoodsDetail()
  235. this.getAnswerList()
  236. },
  237. onShow() {},
  238. onUnload() {
  239. if(this.playSectionId>0){
  240. //退出提交记录
  241. this.ossAvatarUrl = ""
  242. this.postStudyRecord()
  243. //清除正在播放的节ID
  244. this.$store.commit('setPlaySectionId', {playSectionId :0});
  245. }
  246. },
  247. mounted() {
  248. eventHub.$on('getSection', item => {
  249. if(this.timer){
  250. clearInterval(this.timer);
  251. }
  252. if(this.vid){
  253. //切换视频
  254. var polyvPlayerContext = this.selectComponent('#playerVideo');
  255. polyvPlayerContext.changeVid(item.recordingUrl)
  256. }else{
  257. this.vid = item.recordingUrl
  258. }
  259. this.startStatus = true
  260. this.startTime = 0
  261. //获取节笔记
  262. this.getNoteList()
  263. });
  264. eventHub.$on('levelId', item => {
  265. let arr = item.split('-')
  266. //点击节获取的各层级ID
  267. this.moduleId = arr[0]
  268. this.chapterId = arr[1]
  269. console.log(item,99)
  270. });
  271. },
  272. methods: {
  273. jumpNote(item){
  274. this.noteId = item.noteId
  275. this.$u.toast('即将跳到笔记位置');
  276. //跳到笔记时刻
  277. var polyvPlayerContext = this.selectComponent('#playerVideo');
  278. polyvPlayerContext.seek(item.noteSecond)
  279. polyvPlayerContext.play()
  280. },
  281. postNote() {
  282. let self = this;
  283. if(!(this.playSectionId>0)){
  284. this.$u.toast('目前无播放视频');
  285. retun
  286. }
  287. if(!this.noteValue){
  288. this.$u.toast('请输入内容');
  289. retun
  290. }
  291. var polyvPlayerContext = this.selectComponent('#playerVideo');
  292. let noteDate = this.$method.getZeroTime()
  293. let noteSecond= polyvPlayerContext.getCurrentTime()
  294. if(!noteSecond){
  295. this.$u.toast('视频暂未开始');
  296. retun
  297. }
  298. let data = {
  299. gradeId:this.gradeId,
  300. goodsId:this.goodsId,
  301. sectionId:this.playSectionId,
  302. courseId: this.courseId,
  303. noteText:this.noteValue,
  304. noteDate:noteDate,
  305. noteSecond:noteSecond}
  306. console.log(data,66)
  307. this.$api.postNote(data).then(res => {
  308. if (res.data.code == 200) {
  309. this.$u.toast('发布成功');
  310. self.getNoteList()
  311. this.noteValue = ''
  312. }
  313. });
  314. },
  315. getNoteList() {
  316. let self = this;
  317. this.$api.noteList({ sectionId:this.playSectionId,courseId: this.courseId,gradeId:this.gradeId,goodsId:this.goodsId }).then(res => {
  318. if (res.data.code == 200) {
  319. self.noteList = res.data.rows;
  320. }
  321. });
  322. },
  323. delAnswer(answerId) {
  324. let self = this;
  325. let data = { answerId: answerId,status:-1 }
  326. this.$api.delAnswer(data).then(res => {
  327. if (res.data.code == 200) {
  328. self.getAnswerList()
  329. }
  330. });
  331. },
  332. clearCtx(){
  333. console.log(4234)
  334. this.placeholder ='您可以在这里输入答疑内容'
  335. this.ctxValue = ''
  336. this.assignUserId=0
  337. },
  338. replyContent(item){
  339. this.assignUserId = item.userId
  340. this.placeholder = '@'+item.realname
  341. },
  342. delContent(item){
  343. this.delAnswer(item.answerId)
  344. },
  345. postAnswer() {
  346. let self = this;
  347. let data = { courseId: this.courseId,answerText:this.ctxValue }
  348. if(this.assignUserId>0){
  349. data.assignUserId = this.assignUserId
  350. }
  351. this.$api.postAnswer(data).then(res => {
  352. if (res.data.code == 200) {
  353. this.$u.toast('发布成功');
  354. self.getAnswerList()
  355. this.placeholder ='您可以在这里输入答疑内容'
  356. this.ctxValue = ''
  357. this.assignUserId=0
  358. }
  359. });
  360. },
  361. postContent(){
  362. if(!this.ctxValue){
  363. this.$u.toast('请输入内容');
  364. }
  365. this.postAnswer()
  366. },
  367. postStudyRecord(status=0) {
  368. let self = this;
  369. let data = {
  370. photo:self.ossAvatarUrl,
  371. sectionId:parseInt(self.playSectionId),
  372. goodsId:parseInt(self.goodsId),
  373. courseId:parseInt(self.courseId),
  374. studyDuration:parseInt(self.studyDuration),
  375. gradeId:parseInt(self.gradeId),
  376. chapterId:parseInt(self.chapterId),
  377. moduleId:parseInt(self.moduleId)
  378. }
  379. if(status>0){
  380. data.status = status
  381. }
  382. console.log("提交接口",data)
  383. this.$api.studyRecord(data).then(res => {
  384. console.log(res)
  385. });
  386. },
  387. uploadFile(options, int) {
  388. var self = this;
  389. return new Promise((resolve, reject) => {
  390. var data = {
  391. imageStatus: int
  392. };
  393. self.$api.aliyunpolicy(data).then(res => {
  394. if(res.data.code!=200){
  395. self.$method.showToast('签名错误'+JSON.stringify(res.data))
  396. return
  397. }
  398. var ossToken = res.data.data.resultContent;
  399. if(ossToken.host==null||ossToken.host==undefined){
  400. self.$method.showToast('上传路径报错'+JSON.stringify(res.data))
  401. return
  402. }
  403. uni.uploadFile({
  404. url: ossToken.host,
  405. name: 'file',
  406. filePath: options,
  407. fileType: 'image',
  408. header: {
  409. AuthorizationToken: 'WX ' + uni.getStorageSync('token')
  410. },
  411. formData: {
  412. key: ossToken.dir,
  413. OSSAccessKeyId: ossToken.accessid,
  414. policy: ossToken.policy,
  415. Signature: ossToken.signature,
  416. callback: ossToken.callback,
  417. success_action_status: 200
  418. },
  419. success: result => {
  420. if (result.statusCode === 200) {
  421. self.ossAvatarUrl = ossToken.dir;
  422. resolve();
  423. } else {
  424. uni.showToast({
  425. title: '上传失败',
  426. icon: 'none'
  427. });
  428. return;
  429. }
  430. },
  431. fail: error => {
  432. uni.showToast({
  433. title: '上传接口报错'+error,
  434. icon: 'none'
  435. });
  436. return;
  437. }
  438. });
  439. });
  440. });
  441. },
  442. imageInfos(){
  443. var self = this
  444. return new Promise((resolve, reject) => {
  445. uni.getImageInfo({
  446. src: self.avatarUrl,
  447. success: async res => {
  448. let canvasWidth = res.width; //图片原始长宽
  449. let canvasHeight = res.height;
  450. if (canvasWidth > 1000 || canvasHeight > 1000) {
  451. uni.compressImage({
  452. src: self.avatarUrl,
  453. quality: 75,
  454. width: '50%',
  455. height: '50%',
  456. success: async rest => {
  457. const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
  458. resolve()
  459. }
  460. });
  461. } else {
  462. console.log('无需压缩');
  463. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  464. resolve()
  465. }
  466. }
  467. });
  468. });
  469. },
  470. timeEvent() {
  471. let self = this
  472. var polyvPlayerContext = this.selectComponent('#playerVideo');
  473. if (polyvPlayerContext != null) {
  474. let PlayCurrentTime = polyvPlayerContext.getCurrentTime();
  475. this.studyDuration = PlayCurrentTime
  476. if(this.currentTime<PlayCurrentTime){
  477. this.playTime+=(PlayCurrentTime-this.currentTime)
  478. this.currentTime = PlayCurrentTime
  479. }else{
  480. this.currentTime = PlayCurrentTime
  481. }
  482. //判断是否需要拍照
  483. if(this.intervalTimeList.length>this.intervalTimeIndex){
  484. let photoTime = Number(this.intervalTimeList[this.intervalTimeIndex]) * 60 //获取拍照秒数
  485. if(photoTime<this.playTime){
  486. //启动拍照
  487. //暂停
  488. polyvPlayerContext.exitFullScreen()
  489. polyvPlayerContext.pause()
  490. this.openPhoto();
  491. this.intervalTimeIndex++
  492. }
  493. }
  494. }
  495. },
  496. onStateChange(newstate, oldstate) {
  497. if (newstate.detail.newstate == 'playing') {
  498. //开始播放
  499. if(this.timer){
  500. clearInterval(this.timer);
  501. }
  502. this.timer = setInterval(this.timeEvent, 1500);//定时器
  503. }
  504. if (newstate.detail.newstate == 'pause') {
  505. //暂停提交记录
  506. /* this.ossAvatarUrl = ""
  507. this.postStudyRecord() */
  508. }
  509. if (newstate.detail.newstate == 'ended') {
  510. this.ossAvatarUrl = ""
  511. this.postStudyRecord(1)
  512. }
  513. },
  514. //拍照
  515. openPhoto(){
  516. this.photoPopup = true
  517. },
  518. async submit(){
  519. const waitYS = await this.imageInfos();
  520. this.postStudyRecord()//提交记录
  521. //恢复播放
  522. var polyvPlayerContext = this.selectComponent('#playerVideo');
  523. if (polyvPlayerContext != null) {
  524. polyvPlayerContext.play();
  525. }
  526. console.log(this.ossAvatarUrl,"拍照完成456")
  527. },
  528. //确认拍照
  529. takePhoto() {
  530. var self = this
  531. const ctx = uni.createCameraContext();
  532. ctx.takePhoto({
  533. quality: 'high',
  534. success: res => {
  535. console.log(res.tempImagePath)
  536. self.avatarUrl = res.tempImagePath
  537. self.submit()
  538. self.photoPopup = false
  539. },
  540. fail: err => {
  541. console.log(err)
  542. }
  543. });
  544. },
  545. //拍照报错
  546. error(e) {
  547. console.log(e.detail);
  548. },
  549. //关闭相机
  550. closePhoto(){
  551. this.photoPopup = false
  552. },
  553. getGoodsDetail(){
  554. let self = this
  555. this.$api.goodsDetail(this.goodsId).then(res => {
  556. self.goodsData = res.data.data;
  557. self.gradeId = self.goodsData.gradeId
  558. self.getMenuList();
  559. self.getReMenuList() //获取重修目录
  560. if(self.goodsData.goodsPlayConfig){
  561. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  562. if(self.goodsPlayConfig.autoPlay>0){
  563. self.autoplay = true
  564. }
  565. if(self.goodsPlayConfig.drag>0){
  566. self.isAllowSeek = "yes"
  567. }
  568. if(self.goodsPlayConfig.speed>0){
  569. self.playbackRate = [0.5,0.8,1.0,1.25,1.5,2.0]
  570. }
  571. }
  572. if(self.goodsData.goodsPhotographConfig){
  573. self.goodsPhotographConfig = JSON.parse(self.goodsData.goodsPhotographConfig);
  574. if(self.goodsPhotographConfig.intervalTime){
  575. self.intervalTimeList = self.goodsPhotographConfig.intervalTime.split(',')
  576. }
  577. }
  578. })
  579. },
  580. startVideo() {
  581. this.startStatus = true;
  582. },
  583. getAnswerList() {
  584. let self = this;
  585. this.$api.answerList({ courseId: this.courseId }).then(res => {
  586. if (res.data.code == 200) {
  587. self.answerList = res.data.rows;
  588. }
  589. });
  590. },
  591. getReMenuList() {
  592. let self = this;
  593. this.$api.reMenuList({ courseId: this.courseId,rebuild:1,gradeId:this.gradeId }).then(res => {
  594. if (res.data.code == 200) {
  595. for (let i = 0; i < res.data.rows.length; i++) {
  596. let item = res.data.rows[i];
  597. item.down = true;
  598. item.id = item.menuId;
  599. item.name = item.menuName;
  600. }
  601. self.reMenuList = res.data.rows;
  602. }
  603. });
  604. },
  605. getMenuList() {
  606. let self = this;
  607. this.$api.menuList({ courseId: this.courseId }).then(res => {
  608. if (res.data.code == 200) {
  609. for (let i = 0; i < res.data.rows.length; i++) {
  610. let item = res.data.rows[i];
  611. item.down = true;
  612. item.id = item.menuId;
  613. item.name = item.menuName;
  614. }
  615. self.menuList = res.data.rows;
  616. }
  617. });
  618. },
  619. courseDetail() {
  620. let self = this;
  621. this.$api.courseDetail(this.courseId).then(res => {
  622. if (res.data.code == 200) {
  623. self.detail = res.data.data;
  624. self.gradeId = self.detail.gradeId
  625. }
  626. });
  627. },
  628. open(item) {
  629. item.showChildren = !item.showChildren;
  630. },
  631. change(index) {
  632. this.current = index;
  633. }
  634. }
  635. };
  636. </script>
  637. <style lang="scss" scope>
  638. .btnReply{
  639. width: 80rpx;
  640. height: 40rpx;
  641. background: #E3F0FF;
  642. border-radius: 16rpx;
  643. text-align: center;
  644. color: #007AFF;
  645. }
  646. .btnDel{
  647. width: 80rpx;
  648. height: 40rpx;
  649. background: #FFEDF0;
  650. border-radius: 16rpx;
  651. text-align: center;
  652. color: #FF2D55;
  653. }
  654. .btnReply{
  655. width: 80rpx;
  656. height: 40rpx;
  657. background: #E3F0FF;
  658. border-radius: 16rpx;
  659. font-size: 24rpx;
  660. }
  661. .photoBox{
  662. .photoTop{
  663. height: 74upx;
  664. display: flex;
  665. align-items: center;
  666. justify-content: space-between;
  667. padding: 0upx 38upx;
  668. .sqzz{
  669. width: 28upx;
  670. height: 28upx;
  671. display: flex;
  672. align-items: center;
  673. justify-content: center;
  674. }
  675. .centersq{
  676. color: #333;
  677. font-size: 30upx;
  678. font-weight: 500;
  679. }
  680. }
  681. .photoCenter{
  682. width: 750upx;
  683. height: 979upx;
  684. position: relative;
  685. .custom{
  686. width: 750upx;
  687. height: 979upx;
  688. position: absolute;
  689. top: 0;
  690. left: 0;
  691. image{
  692. width: 100%;
  693. height: 100%;
  694. }
  695. }
  696. }
  697. .btnResult{
  698. height: 100upx;
  699. width: 100%;
  700. background-color: #07c160;
  701. text-align: center;
  702. line-height: 100upx;
  703. color: #fff;
  704. font-size: 32upx;
  705. font-weight: bold;
  706. }
  707. }
  708. .chat_box {
  709. display: flex;
  710. padding: 20rpx;
  711. justify-content: space-between;
  712. }
  713. .chat3 {
  714. font-size: 30rpx;
  715. font-family: PingFang SC;
  716. font-weight: 500;
  717. color: #666666;
  718. margin-top: 10rpx;
  719. }
  720. .chat2 {
  721. font-size: 20rpx;
  722. font-family: PingFang SC;
  723. font-weight: 500;
  724. color: #999999;
  725. margin-top: 10rpx;
  726. }
  727. .chat1 {
  728. font-size: 24rpx;
  729. font-family: PingFang SC;
  730. font-weight: 500;
  731. color: #333333;
  732. }
  733. .leftPadding {
  734. margin-left: 8rpx;
  735. }
  736. .t2Content {
  737. font-size: 28rpx;
  738. font-family: PingFang SC;
  739. font-weight: bold;
  740. color: #999999;
  741. line-height: 48rpx;
  742. }
  743. .tBox2 {
  744. display: flex;
  745. padding-top: 10rpx;
  746. color: #333333;
  747. font-size: 30rpx;
  748. }
  749. .tBox {
  750. display: flex;
  751. align-items: center;
  752. padding-top: 10rpx;
  753. }
  754. .title {
  755. font-size: 24rpx;
  756. color: #999999;
  757. }
  758. page {
  759. padding-top: 10px;
  760. padding-top: constant(safe-area-inset-top);
  761. padding-top: env(safe-area-inset-top);
  762. }
  763. .inputBottom {
  764. position: fixed;
  765. left: 0;
  766. bottom: 0;
  767. background: #ffffff;
  768. height: 98rpx;
  769. display: flex;
  770. align-items: center;
  771. width: 100%;
  772. }
  773. .noteBox {
  774. width: 100%;
  775. background: #ffffff;
  776. padding: 10rpx;
  777. border-radius: 16rpx;
  778. }
  779. .dateBox {
  780. width: 216rpx;
  781. height: 48rpx;
  782. background: #ffffff;
  783. border-radius: 24rpx;
  784. font-size: 24rpx;
  785. color: #666666;
  786. text-align: center;
  787. line-height: 48rpx;
  788. margin: 20rpx 0;
  789. }
  790. .t_content1 {
  791. color: #007aff;
  792. margin-left: 10rpx;
  793. }
  794. .tag1 {
  795. border: 2rpx solid #007aff;
  796. border-radius: 8rpx;
  797. font-size: 20rpx;
  798. color: #007aff;
  799. padding: 5rpx;
  800. }
  801. .b_title {
  802. color: #333333;
  803. font-size: 30rpx;
  804. font-weight: bold;
  805. }
  806. page {
  807. background: #eaeef1;
  808. }
  809. .menuBox {
  810. width: 100%;
  811. background: #ffffff;
  812. border-radius: 16rpx;
  813. padding: 20rpx;
  814. margin-bottom: 20rpx;
  815. }
  816. .btnspric {
  817. border-top: 1rpx solid #eee;
  818. display: flex;
  819. align-items: center;
  820. justify-content: space-between;
  821. height: 108rpx;
  822. padding-left: 43rpx;
  823. padding-right: 32rpx;
  824. }
  825. .btnspric > .lefprL {
  826. font-size: 36rpx;
  827. color: #0c141f;
  828. font-weight: bold;
  829. }
  830. .btnspric > .lefprR {
  831. padding: 0rpx 24rpx;
  832. height: 60rpx;
  833. line-height: 60rpx;
  834. text-align: center;
  835. color: #fff;
  836. background: #32467b;
  837. border-radius: 24rpx;
  838. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  839. }
  840. .yhj,
  841. .hdyhj {
  842. padding: 24rpx 29rpx 24rpx 34rpx;
  843. }
  844. .yhj {
  845. border-bottom: 16rpx solid #f9f9f9;
  846. }
  847. .yhjtit {
  848. font-size: 30rpx;
  849. color: #0c141f;
  850. font-weight: 500;
  851. margin-bottom: 14rpx;
  852. }
  853. .yhjList {
  854. display: flex;
  855. align-items: center;
  856. justify-content: space-between;
  857. margin-bottom: 14rpx;
  858. }
  859. .yhjList > .yhjLefts {
  860. display: flex;
  861. align-items: center;
  862. }
  863. .yhjLefts > .yhl {
  864. color: #32467b;
  865. font-size: 30rpx;
  866. margin-right: 31rpx;
  867. }
  868. .yhjLefts > .yhbq {
  869. font-size: 24rpx;
  870. color: #ff9500;
  871. border-radius: 18rpx;
  872. background-color: rgba(255, 149, 0, 0.2);
  873. border: 2rpx solid #ff9500;
  874. height: 38rpx;
  875. line-height: 38rpx;
  876. padding: 0rpx 16rpx;
  877. }
  878. .ts {
  879. font-size: 24rpx;
  880. color: #999;
  881. margin: 14rpx 0rpx;
  882. padding-right: 29rpx;
  883. padding-left: 34rpx;
  884. }
  885. .yh {
  886. padding-top: 20rpx;
  887. }
  888. .yh > .yhtitle {
  889. display: flex;
  890. align-items: center;
  891. justify-content: space-between;
  892. padding-right: 29rpx;
  893. padding-left: 34rpx;
  894. }
  895. .priceBxs {
  896. display: flex;
  897. align-items: center;
  898. }
  899. .priceBxs > .pricleft {
  900. border-radius: 24rpx;
  901. border: 1rpx solid #e91313;
  902. background-color: rgba(233, 19, 19, 0.1);
  903. padding: 0rpx 18rpx;
  904. height: 49rpx;
  905. line-height: 49rpx;
  906. text-align: center;
  907. font-size: 30rpx;
  908. font-weight: 500;
  909. color: #e91313;
  910. margin-right: 13rpx;
  911. }
  912. .topBox {
  913. padding: 32rpx 32rpx 24rpx;
  914. border-bottom: 1rpx solid #eeeeee;
  915. }
  916. .topBox > .boldFonstType {
  917. font-weight: 500;
  918. font-size: 30rpx;
  919. margin: 16rpx 0rpx 23rpx;
  920. }
  921. .topBox > .firstTopL {
  922. display: flex;
  923. align-items: center;
  924. }
  925. .topBox > .firstTopL > .imageBs {
  926. width: 331rpx;
  927. height: 160rpx;
  928. border-radius: 6rpx;
  929. overflow: hidden;
  930. margin-right: 8rpx;
  931. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  932. }
  933. .topBox > .firstTopL > .imageBs > image {
  934. width: 100%;
  935. height: 100%;
  936. }
  937. .topBox > .firstTopL > .textBs {
  938. font-size: 30rpx;
  939. font-weight: bold;
  940. color: #0c141f;
  941. }
  942. .content {
  943. padding: 24rpx;
  944. text-align: left;
  945. }
  946. .catalogBox {
  947. display: flex;
  948. align-items: center;
  949. flex-wrap: nowrap;
  950. overflow-x: auto;
  951. padding-left: 38rpx;
  952. max-height: 305rpx;
  953. overflow-y: auto;
  954. transition: all 0.4s;
  955. }
  956. .catalogBox > .catalogA {
  957. min-width: 200rpx;
  958. height: 48rpx;
  959. line-height: 48rpx;
  960. // text-align: center;
  961. border: 2rpx solid transparent;
  962. white-space: nowrap;
  963. text-overflow: ellipsis;
  964. overflow: hidden;
  965. word-break: break-all;
  966. border-radius: 10rpx;
  967. background: rgba(22, 119, 255, 0.05);
  968. padding-left: 19rpx;
  969. box-sizing: border-box;
  970. padding-right: 15rpx;
  971. margin-right: 16rpx;
  972. margin-bottom: 20rpx;
  973. margin-top: 15rpx;
  974. font-size: 24rpx;
  975. color: #666;
  976. }
  977. .catalogBox > .activesq {
  978. border-color: #1677ff;
  979. }
  980. .changeCatalogBox {
  981. display: block;
  982. }
  983. .catalogBox::-webkit-scrollbar {
  984. display: none; /* Chrome Safari */
  985. }
  986. .box {
  987. position: relative;
  988. top: 650rpx;
  989. padding-bottom: 88rpx;
  990. margin: 20rpx;
  991. }
  992. .price_t2 {
  993. font-size: 18rpx;
  994. font-family: PingFang SC;
  995. font-weight: 500;
  996. text-decoration: line-through;
  997. color: #999999;
  998. }
  999. .price_t1 {
  1000. font-size: 33rpx;
  1001. font-family: PingFang SC;
  1002. font-weight: bold;
  1003. color: #e91313;
  1004. }
  1005. .sc_t {
  1006. font-size: 22rpx;
  1007. color: #000000;
  1008. }
  1009. .sc {
  1010. width: 29rpx;
  1011. height: 29rpx;
  1012. }
  1013. .buy {
  1014. width: 138rpx;
  1015. height: 48rpx;
  1016. line-height: 48rpx;
  1017. background: #32467b;
  1018. border-radius: 10rpx;
  1019. color: #ffffff;
  1020. font-size: 28rpx;
  1021. text-align: center;
  1022. vertical-align: middle;
  1023. position: absolute;
  1024. right: 30rpx;
  1025. }
  1026. .video_body {
  1027. padding-bottom: 96rpx;
  1028. }
  1029. .footer_tab {
  1030. position: fixed;
  1031. bottom: 0;
  1032. height: 96rpx;
  1033. width: 100%;
  1034. background-color: #ffffff;
  1035. }
  1036. .tj_box {
  1037. width: 50%;
  1038. display: inline-block;
  1039. text-align: center;
  1040. margin: 10rpx 0;
  1041. }
  1042. .teacher_t {
  1043. font-size: 24rpx;
  1044. font-family: PingFang SC;
  1045. font-weight: 400;
  1046. color: #666666;
  1047. line-height: 36rpx;
  1048. margin-left: 15rpx;
  1049. }
  1050. .teacher_img {
  1051. width: 87rpx;
  1052. height: 129rpx;
  1053. }
  1054. .t2 {
  1055. font-size: 24rpx;
  1056. font-family: PingFang SC;
  1057. color: #666666;
  1058. line-height: 36rpx;
  1059. margin: 15rpx;
  1060. }
  1061. .r_t2 {
  1062. width: 201rpx;
  1063. height: 49rpx;
  1064. background: rgba(22, 119, 255, 0.05);
  1065. border: 1rpx solid #32467b;
  1066. border-radius: 16rpx;
  1067. color: #666666;
  1068. font-size: 23rpx;
  1069. text-align: center;
  1070. display: flex;
  1071. align-items: center;
  1072. padding: 5rpx;
  1073. }
  1074. .scroll_box {
  1075. width: 100%;
  1076. height: 60rpx;
  1077. background: #ffffff;
  1078. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  1079. white-space: nowrap;
  1080. overflow: hidden;
  1081. margin: 15rpx 0;
  1082. }
  1083. .r_sliper {
  1084. padding: 0 20rpx;
  1085. }
  1086. .top_line {
  1087. width: 6rpx;
  1088. height: 22rpx;
  1089. background: #32467b;
  1090. margin-right: 10rpx;
  1091. }
  1092. .video_t2 {
  1093. font-size: 24rpx;
  1094. font-family: PingFang SC;
  1095. font-weight: 500;
  1096. color: #666666;
  1097. }
  1098. .video_t1 {
  1099. height: 80rpx;
  1100. color: #333333;
  1101. line-height: 80rpx;
  1102. font-size: 30rpx;
  1103. font-family: PingFang SC;
  1104. font-weight: bold;
  1105. color: #333333;
  1106. }
  1107. .video_t1_t {
  1108. display: flex;
  1109. flex-direction: column;
  1110. height: 80rpx;
  1111. color: #333333;
  1112. text-align: center;
  1113. align-items: center;
  1114. border-left: solid 1px #d6d6db;
  1115. }
  1116. .video_play {
  1117. position: absolute;
  1118. width: 95rpx;
  1119. height: 95rpx;
  1120. top: 0;
  1121. left: 0;
  1122. right: 0;
  1123. bottom: 0;
  1124. margin: auto;
  1125. }
  1126. .video_box {
  1127. position: relative;
  1128. }
  1129. .rotoct {
  1130. transform: rotate(90deg);
  1131. }
  1132. </style>