detail.vue 56 KB

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