detail.vue 63 KB

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