detail.vue 63 KB

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