detail.vue 60 KB

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