detail.vue 44 KB

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