detail.vue 60 KB

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