detail.vue 45 KB

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