detail.vue 61 KB

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