detail.vue 62 KB

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