detail.vue 55 KB

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