detail.vue 61 KB

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