detail.vue 65 KB

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