detail.vue 65 KB

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