detail.vue 61 KB

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