detail.vue 61 KB

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