detail.vue 60 KB

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