detail.vue 65 KB

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