detail.vue 58 KB

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