detail.vue 61 KB

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