detail.vue 60 KB

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