detail.vue 44 KB

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