detail.vue 62 KB

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