detail.vue 84 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003
  1. <template>
  2. <view class="polyv_detail">
  3. <uni-nav-bar
  4. left-icon="back"
  5. :statusBar="true"
  6. fixed='true'
  7. :title="detail.courseName || '课程详情'"
  8. @clickLeft="clickLeft"
  9. ></uni-nav-bar>
  10. <!-- <nav-bar
  11. :title="detail.courseName || '课程详情'"
  12. v-show="navShow"
  13. ></nav-bar> -->
  14. <view id="top">
  15. <view class="video_box" v-if="!startStatus">
  16. <image
  17. :src="$method.splitImgHost(detail.coverUrl)"
  18. mode="widthFix"
  19. style="width: 100%; height: 421rpx"
  20. ></image>
  21. <image
  22. v-if="false"
  23. class="video_play"
  24. src="/static/play.png"
  25. @click="startVideo"
  26. ></image>
  27. </view>
  28. <view v-else>
  29. <!-- v-if="playVID" -->
  30. <view
  31. class="video_box"
  32. style="width: 100%; height: 421rpx"
  33. >
  34. <polyv-player
  35. v-if="playVID"
  36. id="playerVideo"
  37. playerId="playerVideo"
  38. height="421rpx"
  39. :vid="vid"
  40. :showSettingBtn="true"
  41. :enablePlayGesture="true"
  42. :custom-cache="false"
  43. :object-fit="'contain'"
  44. @statechange="onStateChange"
  45. @fullscreenchange="fullscreenchange"
  46. @error="playError"
  47. :autoplay="true"
  48. :page-gesture="true"
  49. :vslide-gesture="true"
  50. :vslide-gesture-in-fullscreen="true"
  51. :isAllowSeek="isAllowSeek"
  52. :playbackRate="playbackRate"
  53. :startTime="startTime"
  54. :enableAutoRotation="enableAutoRotation"
  55. @loadedmetadata="loadedmetadata"
  56. ></polyv-player>
  57. <cover-view
  58. class="video-toast__close"
  59. v-if="videoToastShow"
  60. @click="closeToast()"
  61. >X</cover-view
  62. >
  63. <cover-view class="video-toast" v-if="videoToastShow">
  64. <cover-view class="video-toast__text"
  65. >您上次看到 {{ seekTime }},正在自动续播</cover-view
  66. >
  67. <cover-view class="video-toast__btn" @click="restart()"
  68. >从头播放</cover-view
  69. >
  70. </cover-view>
  71. </view>
  72. <view
  73. class="video_box"
  74. style="width: 100%; height: 421rpx"
  75. v-if="playChannelId > 0"
  76. >
  77. <player
  78. class="plv-mp-demo-player"
  79. :videoOption="videoOption"
  80. :page-gesture="true"
  81. :vslide-gesture="true"
  82. :vslide-gesture-in-fullscreen="true"
  83. @onLiveStatusChange="playerLiveStatusChange"
  84. />
  85. </view>
  86. </view>
  87. <view class="course_name">
  88. <view class="course_titles">
  89. <view class="video_t1" :class="{'one': !goodsData.buyNote}">{{ detail.courseName }}</view>
  90. <view class="notice_wrap" v-if="goodsData.buyNote">
  91. <view class="video_t1_t" @click="studyNotice"> 学员须知 </view>
  92. </view>
  93. <view v-if="courseTotal > 1" class="toggle_course" @click="changeCourses()">
  94. <image class="img" src="/pages3/static/imgs/toggle.png"></image>
  95. <view class="toggle_name">切换课程</view>
  96. <view class="numbers">共{{ courseTotal }}门</view>
  97. </view>
  98. </view>
  99. <!-- <u-row>
  100. <u-col span="10">
  101. <view class="video_t1">{{ detail.courseName }}</view>
  102. </u-col>
  103. <u-col span="2">
  104. <div class="notice_wrap" v-if="goodsData.buyNote">
  105. <view class="video_t1_t" @click="studyNotice"> 学员须知 </view>
  106. </div>
  107. </u-col>
  108. </u-row> -->
  109. </view>
  110. <u-line color="#D6D6DB" />
  111. <view>
  112. <view
  113. ><u-tabs
  114. gutter="0"
  115. :item-width="itemWidth()"
  116. :list="list"
  117. font-size="32"
  118. bar-width="24"
  119. :current="current"
  120. @change="change"
  121. active-color="#007AFF"
  122. ></u-tabs
  123. ></view>
  124. </view>
  125. <u-line color="#D6D6DB" />
  126. </view>
  127. <view class="box" :class="{'first_ml': current == 0}">
  128. <scroll-view class="box_in" scroll-y="true">
  129. <!--目录 -->
  130. <view v-show="current == 0">
  131. <view class="top__header" v-if="livingItem" @click="goLive(livingItem)">
  132. <image class="img" src="/pages3/static/imgs/live.png" mode="widthFix"></image>
  133. <view class="note">正在直播中</view>
  134. <view class="title">{{livingItem.sectionName}}</view>
  135. </view>
  136. <view class="menuBox" v-for="(item, index) in menuList" :key="index">
  137. <!--模块 -->
  138. <view v-if="item.type == 1"
  139. ><courseModule
  140. v-if="reStart"
  141. :isLive="true"
  142. :orderGoodsId="orderGoodsId"
  143. :sectionMaxNum="goodsData.sectionMaxNum"
  144. :needOpen="menuIndex[0] === index ? true : false"
  145. :courseId="courseId"
  146. :preItem="menuList[index - 1]"
  147. :learningOrder="businessData.goodsLearningOrder"
  148. :goodsId="goodsId"
  149. :gradeId="gradeId"
  150. :isBuy="true"
  151. :menuItem="item"
  152. :levelId="item.menuId"
  153. ></courseModule
  154. ></view>
  155. <!--章 -->
  156. <view v-if="item.type == 2"
  157. ><courseChapter
  158. v-if="reStart"
  159. :isLive="true"
  160. :orderGoodsId="orderGoodsId"
  161. :sectionMaxNum="goodsData.sectionMaxNum"
  162. :needOpen="menuIndex[0] === index ? true : false"
  163. :courseId="courseId"
  164. :preItem="menuList[index - 1]"
  165. @playEnd="sectionPlayEnd($event, index)"
  166. :learningOrder="businessData.goodsLearningOrder"
  167. :goodsId="goodsId"
  168. :gradeId="gradeId"
  169. :isBuy="true"
  170. :menuItem="item"
  171. :levelId="'0-' + item.menuId"
  172. :goodsType='6'
  173. ></courseChapter
  174. ></view>
  175. <!--节 -->
  176. <view v-if="item.type == 3"
  177. ><courseSection
  178. v-if="reStart"
  179. :isLive="true"
  180. :orderGoodsId="orderGoodsId"
  181. :sectionMaxNum="goodsData.sectionMaxNum"
  182. @playEnd="sectionPlayEnd($event, index)"
  183. :courseId="courseId"
  184. :preItem="menuList[index - 1]"
  185. :learningOrder="businessData.goodsLearningOrder"
  186. :goodsId="goodsId"
  187. :gradeId="gradeId"
  188. :isBuy="true"
  189. :menuItem="item"
  190. :levelId="'0-0-' + item.menuId"
  191. ></courseSection
  192. ></view>
  193. </view>
  194. </view>
  195. <!--笔记 -->
  196. <view v-show="current == 1">
  197. <view v-if="noteList.length == 0" style="text-align: center"
  198. >暂无笔记</view
  199. >
  200. <!-- <view class="inputBottom" v-if="!(isPlayRebuild > 0) && playChannelId ==0">
  201. <view style="width: 10%"
  202. ><image
  203. src="/static/icon/note3.png"
  204. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  205. ></image
  206. ></view>
  207. <view style="width: 73%; height: 100%; padding: 10rpx 0">
  208. <u-input
  209. class="input"
  210. height="60"
  211. fixed="true"
  212. placeholder="您可以在这里输入笔记内容"
  213. type="input"
  214. :custom-style="inputStyle"
  215. v-model="noteValue"
  216. />
  217. </view>
  218. <view
  219. style="
  220. color: #007aff;
  221. font-size: 30rpx;
  222. font-weight: bold;
  223. width: 15%;
  224. text-align: center;
  225. "
  226. @click="postNote"
  227. >提交</view
  228. >
  229. </view> -->
  230. <view v-for="(item, index) in noteList" :key="index">
  231. <view class="dateBox">{{
  232. $method.timestampToTime(item.dateNote)
  233. }}</view>
  234. <view class="noteBox">
  235. <view
  236. v-for="(item1, index1) in item.userNotes"
  237. :key="index1"
  238. style="margin-top: 30rpx"
  239. @click="jumpNote(item1)"
  240. >
  241. <view style="display: flex">
  242. <view class="left_ti">
  243. <view>
  244. <image
  245. src="/static/icon/note2.png"
  246. v-if="noteId != item1.noteId"
  247. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  248. ></image>
  249. <image
  250. src="/static/icon/note1.png"
  251. v-if="noteId == item1.noteId"
  252. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  253. ></image>
  254. </view>
  255. <view
  256. class="title"
  257. style="width: 39rpx; height: 39rpx;"
  258. >{{ $method.secondToDate(item1.noteSecond) }}</view
  259. >
  260. </view>
  261. <view style="margin-left: 10rpx">
  262. <view class="t2Content leftPadding">{{
  263. item1.sectionName
  264. }}</view>
  265. <view class="tBox2">{{ item1.noteText }}</view>
  266. </view>
  267. </view>
  268. </view>
  269. </view>
  270. </view>
  271. </view>
  272. <!--答疑 -->
  273. <view v-show="current == 2" class="Answering">
  274. <!-- <view class="inputBottom">
  275. <view class="flex_auto">
  276. <u-input
  277. height="60"
  278. fixed="true"
  279. :focus="isFocus"
  280. :placeholder="placeholder"
  281. type="input"
  282. @blur="blur"
  283. :custom-style="inputStyle"
  284. v-model="ctxValue"
  285. />
  286. </view>
  287. <view class="btn" @click="postContent">提交</view>
  288. </view> -->
  289. <view
  290. v-for="(item, index) in answerList"
  291. :key="index"
  292. style="background-color: #ffffff;"
  293. class="answer_item"
  294. >
  295. <view class="chat_box" @click.stop="clearCtx">
  296. <view style="display: flex; flex: 1">
  297. <view
  298. ><image
  299. :src="
  300. item.assignUserId > 0 && !item.realname
  301. ? '/static/logo_xcx.png'
  302. : $method.splitImgHost(item.avatar)
  303. "
  304. style="width: 64rpx; height: 64rpx"
  305. ></image
  306. ></view>
  307. <view style="margin-left: 15rpx">
  308. <view class="chat1">{{
  309. item.assignUserId > 0 && !item.realname
  310. ? "祥粤老师"
  311. : item.realname
  312. }}</view>
  313. <view class="chat2">{{
  314. $method.timestampToTime(item.createTime, false)
  315. }}</view>
  316. <view class="chat3">
  317. <text v-if="item.assignUserId > 0">回复</text>
  318. <text v-if="item.assignUserId > 0" style="color: #007aff"
  319. >@{{ item.assignRealname }}</text
  320. >
  321. <view style="word-break: break-all">{{
  322. item.answerText
  323. }}</view>
  324. </view>
  325. </view>
  326. </view>
  327. <view
  328. class="btnReply"
  329. @click.stop="replyContent(item)"
  330. v-if="item.userId != userInfo.userId"
  331. >回复</view
  332. >
  333. <view v-else class="btnDel" @click.stop="delContent(item)"
  334. >删除</view
  335. >
  336. </view>
  337. <u-line color="#D6D6DB" />
  338. </view>
  339. <view v-if="answerList.length == 0" style="text-align: center"
  340. >暂无记录</view
  341. >
  342. </view>
  343. <!--答疑 -->
  344. <view v-show="current == 3">
  345. <view
  346. v-for="(item, index) in historyChatMsgList"
  347. :key="index"
  348. style="background-color: #ffffff; margin-bottom: 20rpx"
  349. >
  350. <view class="chat_box" @click.stop="clearCtx">
  351. <view style="display: flex; flex: 1">
  352. <view
  353. ><image
  354. :src="
  355. item.user.pic
  356. "
  357. style="width: 64rpx; height: 64rpx"
  358. ></image
  359. ></view>
  360. <view style="margin-left: 15rpx">
  361. <view class="chat1">{{
  362. item.user.nickname
  363. }}</view>
  364. <view class="chat2">{{
  365. item.time | formatDate
  366. }}</view>
  367. <view class="chat3">
  368. <!-- <text v-if="item.assignUserId > 0">回复</text>
  369. <text v-if="item.assignUserId > 0" style="color: #007aff"
  370. >@{{ item.assignRealname }}</text
  371. > -->
  372. <view style="word-break: break-all">{{
  373. item.content
  374. }}</view>
  375. </view>
  376. </view>
  377. </view>
  378. </view>
  379. <u-line color="#D6D6DB" />
  380. </view>
  381. <view v-if="historyChatMsgList.length == 0" style="text-align: center"
  382. >暂无记录</view
  383. >
  384. </view>
  385. </scroll-view>
  386. <!-- 底部固定按钮 -->
  387. <!-- 笔记的输入框 -->
  388. <template v-if="current == 1">
  389. <view class="inputBottom" v-if="!(isPlayRebuild > 0) && playChannelId ==0" :style="{ bottom: bottomHeight + 'px' }">
  390. <view style="width: 10%"
  391. ><image
  392. src="/static/icon/note3.png"
  393. style="width: 39rpx; height: 39rpx; margin: 0 29rpx"
  394. ></image
  395. ></view>
  396. <view style="width: 73%; height: 100%; padding: 10rpx 0">
  397. <input
  398. v-model="noteValue"
  399. class="input"
  400. height="60"
  401. fixed="true"
  402. placeholder="您可以在这里输入笔记内容"
  403. type="text"
  404. :custom-style="inputStyle"
  405. :adjust-position="false"
  406. @focus="focusNote"
  407. @blur="blurNote"
  408. />
  409. </view>
  410. <view
  411. style="
  412. color: #007aff;
  413. font-size: 30rpx;
  414. font-weight: bold;
  415. width: 15%;
  416. text-align: center;
  417. "
  418. @click="postNote"
  419. >提交</view
  420. >
  421. </view>
  422. </template>
  423. <!-- 答疑 -->
  424. <view v-if="current == 2" class="inputBottom" :style="{ bottom: bottomHeight + 'px' }">
  425. <view class="flex_auto">
  426. <input
  427. v-model="ctxValue"
  428. height="60"
  429. fixed="true"
  430. :focus="isFocus"
  431. :placeholder="placeholder"
  432. type="text"
  433. :custom-style="inputStyle"
  434. :adjust-position="false"
  435. class="input"
  436. @focus="focusNote"
  437. @blur="blur"
  438. />
  439. </view>
  440. <view class="btn" @click="postContent">提交</view>
  441. </view>
  442. </view>
  443. <!-- 播放前拍照end -->
  444. <u-popup
  445. v-model="showSet"
  446. :mask-close-able="false"
  447. mode="center"
  448. border-radius="24"
  449. >
  450. <view
  451. style="
  452. align-items: center;
  453. padding: 0 40rpx;
  454. display: flex;
  455. flex-direction: column;
  456. justify-content: center;
  457. "
  458. >
  459. <view
  460. style="
  461. font-weight: bold;
  462. color: #333333;
  463. font-size: 30rpx;
  464. margin-top: 30rpx;
  465. "
  466. >温馨提示</view
  467. >
  468. <view
  469. style="
  470. width: 457rpx;
  471. color: #666666;
  472. font-size: 30rpx;
  473. margin-top: 30rpx;
  474. "
  475. >学习过程中需要拍照验证学员身份, 拍照功能需要使用您的相机。
  476. 是否授权使用?</view
  477. >
  478. <view style="margin: 40rpx 0">
  479. <button
  480. open-type="openSetting"
  481. @bindopensetting="openSetting"
  482. class="btnSet"
  483. >
  484. 去授权
  485. </button>
  486. </view>
  487. </view>
  488. </u-popup>
  489. <u-mask :show="photoPopup">
  490. <!-- 播放前拍照start -->
  491. <view
  492. v-if="photoPopup"
  493. :mask-close-able="false"
  494. style="bottom: 0; position: fixed; width: 100%; z-index: 999"
  495. >
  496. <view class="photoBox">
  497. <view class="photoTop">
  498. <view class="sqzz" v-if="false"
  499. ><u-icon
  500. name="close"
  501. color="#333333"
  502. size="30"
  503. @click="closePhoto"
  504. ></u-icon
  505. ></view>
  506. <view class="centersq">请正视手机屏幕</view>
  507. <view class="sqzz"></view>
  508. </view>
  509. <view class="photoCenter">
  510. <view
  511. style="width: 100%; height: 979rpx; position: fixed"
  512. v-if="photoPopup && isTaking"
  513. >
  514. <camera
  515. device-position="front"
  516. flash="off"
  517. @error="error"
  518. style="width: 100%; height: 100%"
  519. ></camera>
  520. </view>
  521. <view class="custom" v-if="!isTaking"
  522. ><image :src="avatarUrl" mode=""></image
  523. ></view>
  524. </view>
  525. <view class="btns">
  526. <view class="btnResult" v-if="isTaking" @click="takePhoto"
  527. >拍照</view
  528. >
  529. <view class="btnResult" v-if="!isTaking" @click="reTake">重拍</view>
  530. <view class="btnResult" v-if="!isTaking" @click="submit">确认</view>
  531. </view>
  532. </view>
  533. </view>
  534. </u-mask>
  535. <u-popup
  536. v-model="noticeShow"
  537. class="notice_modal"
  538. mode="center"
  539. border-radius="14"
  540. width="700rpx"
  541. height="900rpx"
  542. >
  543. <div class="content">
  544. <scroll-view scroll-y="true" style="height: 100%">
  545. <view class="title">学员须知</view>
  546. <text class="text">
  547. {{ goodsData.buyNote }}
  548. </text>
  549. </scroll-view>
  550. </div>
  551. </u-popup>
  552. <!-- 切换课程弹窗 -->
  553. <u-popup v-model="toggleCourseShow" mode="bottom" border-radius="40" :mask-close-able='false'>
  554. <view class="popup_box">
  555. <view class="check_head">
  556. <view class="headers">
  557. <view class="grade">切换课程</view>
  558. <u-icon name="close" color="#9C9C9C" size="40" @click="closePop()"></u-icon>
  559. </view>
  560. <view class="coruse_num">共{{ courseTotal }}门</view>
  561. <view class="menuSel">
  562. <scroll-view class="sub_sliper" scroll-x="true" >
  563. <view v-for="(item,index) in subList" :key="index" style="margin-right: 50rpx;display:inline-block">
  564. <view class="r_t1" :class="{'nactive': subIndex == index}" @click="cMenu(item, index)">
  565. {{item.subjectName}}
  566. </view>
  567. </view>
  568. </scroll-view>
  569. </view>
  570. </view>
  571. <view class="check_con">
  572. <scroll-view scroll-y="true" style="height: 700rpx;">
  573. <view class="course_items" v-for="(item, index) in s_courseList" :key="index">
  574. <view class="course_lefts">
  575. <view class="course_title">{{ item.courseName }}</view>
  576. <!-- <view class="course_pros">
  577. 学习进度
  578. <text> {{ item.stuAllNum + item.recordNum }}/{{ item.secAllNum + item.examNum}}</text>
  579. </view> -->
  580. </view>
  581. <view class="course_rights" @click="jump(item, index)">
  582. <view class="cicles">
  583. <u-icon name="arrow-right" color="#498AFE" size="20"></u-icon>
  584. </view>
  585. <view class="intoStudy">进入学习</view>
  586. </view>
  587. </view>
  588. </scroll-view>
  589. </view>
  590. </view>
  591. </u-popup>
  592. </view>
  593. </template>
  594. <script>
  595. import plv from "@/pages3/static/polyv-sdk/index";
  596. import courseModule from "@/components/course/courseModule.vue";
  597. import courseChapter from "@/components/course/courseChapter.vue";
  598. import courseSection from "@/components/course/courseSection.vue";
  599. import {WEBVIEW_URL} from '@/common/request.js'
  600. // import { websocket } from "@/common/socket.js";
  601. import { mapGetters, mapMutations } from "vuex";
  602. export default {
  603. components: {
  604. courseModule,
  605. courseChapter,
  606. courseSection,
  607. },
  608. filters: {
  609. formatDate(date) {
  610. const nDate = new Date(date)
  611. const nyear = nDate.getFullYear()
  612. const nmonth = (nDate.getMonth()+1).toString().padStart(2,0)
  613. const nday = nDate.getDate().toString().padStart(2,0)
  614. const hour = nDate.getHours()
  615. const mins = nDate.getMinutes()
  616. const seconds = nDate.getSeconds()
  617. return nyear+'-'+nmonth+'-'+nday+' '+hour+':'+(mins>=10 ? mins : '0'+mins)+':'+(seconds>=10 ? seconds : '0'+seconds)
  618. }
  619. },
  620. data() {
  621. return {
  622. hasStart:false,
  623. channelItem:null,
  624. lockTimer: null,
  625. orderGoodsId: 0,
  626. noticeShow: false,
  627. navShow: true,
  628. enableAutoRotation: true,
  629. seekTime: "",
  630. toastTimer: null,
  631. videoToastShow: false,
  632. initLiveOk: false,
  633. livePlay: false, //是否正在播放直播,不含暂停
  634. liveDuration: 0, //直播观看时长
  635. videoOption: {
  636. mode: "live",
  637. uid: "",
  638. cid: "",
  639. openId: "",
  640. isAutoChange: false,
  641. forceVideo: false,
  642. },
  643. courseHandoutsData: "",
  644. liveDetail: {},
  645. showSet: false,
  646. startStatus: false,
  647. detail: {},
  648. courseId: 0,
  649. placeholder:
  650. "您可以在这里输入笔记内容\n还可以点击左侧图标为笔记加上时间标记",
  651. inputStyle: {
  652. background: "rgba(244, 244, 244, 0.98)",
  653. borderRadius: "24rpx",
  654. padding: "8rpx",
  655. marginBottom: "10rpx",
  656. },
  657. list: [{
  658. name: "目录",
  659. },
  660. {
  661. name: "笔记",
  662. },
  663. {
  664. name: "答疑",
  665. },
  666. {
  667. name: "聊天",
  668. }],
  669. menuList: [],
  670. current: 0,
  671. vid: "",
  672. goodsId: 0,
  673. goodsData: {},
  674. photoPopup: false,
  675. goodsPlayConfig: null,
  676. autoplay: false,
  677. isAllowSeek: "no",
  678. playbackRate: [1.0],
  679. timer: null,
  680. answerTimer: null,
  681. goodsPhotographConfig: null,
  682. intervalTimeList: [], // 间隔拍照时长
  683. intervalTimeIndex: 0, //当前处于哪个时间段拍照
  684. playTime: 0, //页面播放时长,不含暂停
  685. currentTime: 0,
  686. avatarUrl: "",
  687. ossAvatarUrl: "",
  688. studyDuration: 0, // 当前视频时长
  689. gradeId: 0,
  690. chapterId: 0,
  691. moduleId: 0,
  692. reMenuList: [],
  693. answerList: [],
  694. assignUserId: 0,
  695. placeholder: "您可以在这里输入答疑内容",
  696. ctxValue: "",
  697. noteList: [],
  698. noteValue: "",
  699. noteId: 0,
  700. recordObj: 0,
  701. gradeDetail: {},
  702. isTaking: true, //是否正在拍照
  703. needSeek: false, //第一次播放是否需要跳转
  704. needProfileModal: false, //是否需要资料审核弹框
  705. liveObj: {},
  706. photoNum: 0,
  707. photoList: [], //拍照的时间点
  708. photoConfig: false, //是否配置好拍照次数
  709. photoIndex: 0, //当前位于拍照的区间下标 从0开始
  710. photoHistoryList: [], //已拍照历史的下标点
  711. sectionItem: null,
  712. businessData: {},
  713. showNotes: true,
  714. menuIndex: [],
  715. uploadLock: false, //上传图片
  716. isPlayRebuild: false, //是否正在播放重修视频
  717. isRebuild: false, //视频是否从重修目录点击
  718. isFocus:false,
  719. clearTimer:null,
  720. historyChatMsgList:[],
  721. livingItem:'',
  722. bottomHeight: 0,
  723. toggleCourseShow: false, // 切换课程弹窗
  724. informId: '', //消息id,从公众号消息模板进来的才有
  725. courseList: [], // 课程列表
  726. courseTotal: 0,
  727. options: {},
  728. reStart: false, // 是否显示模块/章/节
  729. s_courseList: [], // 筛选后的
  730. subList: [],
  731. subIndex: 0,
  732. };
  733. },
  734. computed: {
  735. ...mapGetters(["userInfo", "playSectionId", "playChannelId", "playVID"]),
  736. },
  737. onLoad(option) {
  738. console.log('====option', option, this.playChannelId)
  739. this.options = option
  740. this.courseId = option.courseId || ''
  741. this.goodsId = Number(option.goodsId);
  742. // this.gradeId = option.gradeId || 0
  743. this.orderGoodsId = Number(option.orderGoodsId) || '';
  744. // 公众号模板消息的数据埋点
  745. if (option.informId) { // 从公众号消息点击进来上报一次,其他地方进来和没登录需要跳到登录页,登录后返回的不需要上报
  746. this.informId = option.informId
  747. this.clickOfficial()
  748. }
  749. this.$store.getters.dictObj;
  750. },
  751. onShow() {
  752. if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
  753. return;
  754. }
  755. this.courseCourseList();
  756. //相机授权
  757. // this.userConfirmInfoDetail().then(res => {
  758. // })
  759. // this.getbaseprofiletplists();
  760. },
  761. onUnload() {
  762. this.originUnload()
  763. },
  764. mounted() {
  765. },
  766. methods: {
  767. ...mapMutations(["updateChapterOpen","updateLiveLast"]),
  768. // 新增微信公众号模板消息点击数据
  769. clickOfficial() {
  770. this.$http({
  771. url: '/data/click',
  772. method: 'post',
  773. data: { informId: this.informId }
  774. }).then((res) => {
  775. if (res.data.code == 200) {
  776. console.log('埋点')
  777. }
  778. })
  779. },
  780. // 点击课程目录
  781. cMenu(item, index) {
  782. this.subIndex = index
  783. if (item.subjectId != 0) {
  784. this.s_courseList = this.courseList.filter((e) => e.subjectId == item.subjectId)
  785. } else {
  786. this.s_courseList = this.courseList
  787. }
  788. },
  789. courseCourseList() {
  790. this.courseList = []
  791. this.$api.courseCourseList({
  792. pageNum: 1,
  793. pageSize: 100,
  794. goodsId: this.goodsId,
  795. gradeId: this.gradeId,
  796. orderGoodsId: this.orderGoodsId,
  797. }).then((res) => {
  798. if (res.data.code == 200) {
  799. this.courseList.push.apply(this.courseList, res.data.rows)
  800. this.courseTotal = res.data.total || 0
  801. this.s_courseList = this.courseList
  802. let allItem = [{ subjectId: 0, subjectName: '所有'}]
  803. let ids = []
  804. const newArr = []
  805. this.courseList.forEach(item => {
  806. if (ids.indexOf(item.subjectId) == -1) {
  807. ids.push(item.subjectId)
  808. newArr.push(item)
  809. }
  810. })
  811. this.subList = [...allItem, ...newArr]
  812. if(res.data.total > 1) {
  813. this.getUserWatchLast()
  814. } else if(res.data.total == 1) {
  815. this.originOnShow()
  816. this.originOnMount()
  817. }
  818. }
  819. });
  820. },
  821. // 查询用户最后一次看的录播的信息
  822. getUserWatchLast() {
  823. this.$http({
  824. url: '/study/record/getUserWatchLast',
  825. method: 'get',
  826. data: {
  827. goodsId: this.goodsId
  828. }
  829. }).then((res) => {
  830. if (res.data.code == 200) {
  831. if (res.data.data && Object.keys(res.data.data).length) { //有最后一次看的录播的信息
  832. this.courseId = res.data.data.courseId
  833. this.originOnShow()
  834. this.originOnMount()
  835. } else {
  836. this.toggleCourseShow = true
  837. }
  838. }
  839. })
  840. },
  841. // 原来onshow里面的内容
  842. originOnShow() {
  843. this.updateLiveLast(null)
  844. this.courseDetail();
  845. this.getGoodsDetail();
  846. this.getAnswerList();
  847. this.studyRecordMenuAllList();
  848. this.answerTimer = setInterval(() => {
  849. this.getAnswerList();
  850. }, 5000);
  851. let option = this.options
  852. let noteSecond = Number(option.noteSecond);
  853. if (noteSecond > 0) {
  854. //我的消息跳过来,播放节
  855. let item = {
  856. sectionId: Number(option.sectionId),
  857. recordingUrl: option.recordingUrl,
  858. noteSecond: noteSecond,
  859. studyDuration: noteSecond,
  860. };
  861. let playNextId = `moduleId${option.moduleId}chapterId${
  862. option.chapterId
  863. }sectionId${option.sectionId}${option.isRebuild ? "isRebuild" : ""}`;
  864. this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId || item.menuId });
  865. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  866. this.$store.commit("updatePlayNextId", playNextId);
  867. // console.log("this.playNoteVideo");
  868. this.playNoteVideo(item)
  869. } else {
  870. this.studyRecordQueryLiveLast();
  871. }
  872. },
  873. // 原来的mouted内容
  874. originOnMount() {
  875. uni.$on("changeSection", (oldSectionId) => {
  876. // console.log(this.playVID);
  877. this.hasStart = false;
  878. this.photoConfig = false;
  879. this.photoIndex = 0;
  880. var polyvPlayerContext = this.selectComponent("#playerVideo");
  881. if (polyvPlayerContext) {
  882. //解决同个节视频切换问题
  883. polyvPlayerContext.seek(0);
  884. polyvPlayerContext.pause();
  885. }
  886. //清除直播
  887. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  888. this.postStudyRecord(0, oldSectionId);
  889. });
  890. uni.$on("getSection", (item) => {
  891. // console.log('触发事件-=====')
  892. //清除直播
  893. this.hasStart = false;
  894. this.isPlayRebuild = item.rebuild;
  895. this.photoConfig = false;
  896. this.photoIndex = 0;
  897. this.sectionItem = item;
  898. this.moduleId = item.moduleId || null
  899. this.chapterId = item.chapterId || null
  900. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  901. this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId || item.menuId });
  902. console.log('清除直播节点胡:', this.moduleId,this.chapterId, this.playSectionId )
  903. //获取拍照历史
  904. this.getPhotoLastRecord();
  905. this.polyvLiveHistoryChatMsgList();
  906. this.playVideo(item);
  907. });
  908. uni.$on("levelId", (item) => {
  909. let arr = item.split("-");
  910. //点击节获取的各层级ID
  911. this.moduleId = arr[0];
  912. this.chapterId = arr[1];
  913. });
  914. uni.$on("getChannel", (item) => {
  915. //清除录播
  916. this.hasStart = false;
  917. this.$store.commit("setPlayVID", { playVID: null });
  918. this.moduleId = item.moduleId
  919. this.chapterId = item.chapterId
  920. this.$store.commit("setPlaySectionId", { playSectionId: item.sectionId || item.menuId });
  921. this.getPhotoLastRecord();
  922. this.playChannel(item);
  923. this.channelItem = item;
  924. });
  925. uni.$on("isRebuild", (item) => {
  926. // console.log(item);
  927. this.isRebuild = item;
  928. });
  929. this.updateChapterOpen(true);
  930. },
  931. // 原来onUnload里面的内容
  932. originUnload() {
  933. if (this.playSectionId > 0 && this.hasStart) {
  934. //退出提交记录
  935. this.postStudyRecord();
  936. }
  937. //清除正在播放的节ID
  938. // this.$store.commit('setPlayObj',null)
  939. this.$store.commit("setPlaySectionId", { playSectionId: 0 });
  940. this.$store.commit("setPlayChannelId", { playChannelId: 0 });
  941. this.$store.commit("setPlayVID", { playVID: null });
  942. this.closePlv();
  943. // console.log("onUnload");
  944. //移除所有的事件监听器
  945. uni.$off();
  946. clearInterval(this.answerTimer);
  947. if (this.timer) {
  948. clearInterval(this.timer);
  949. }
  950. // console.log(this.lockTimer, "this.lockTimer");
  951. if (this.lockTimer) {
  952. clearInterval(this.lockTimer);
  953. this.$api
  954. .lockDelLock({
  955. action: "jxjy",
  956. })
  957. .then((res) => {});
  958. }
  959. // websocket.sendMsg("delAction");
  960. },
  961. changeCourses() {
  962. this.toggleCourseShow = true
  963. },
  964. closePop() {
  965. this.toggleCourseShow = false
  966. },
  967. // 进入学习
  968. async jump(item, index) {
  969. this.vid = ''
  970. this.hasStart = true
  971. await this.originUnload()
  972. this.courseId = item.courseId
  973. this.reStart = false
  974. this.toggleCourseShow = false
  975. this.originOnShow()
  976. this.originOnMount()
  977. },
  978. clickLeft() {
  979. uni.navigateBack()
  980. },
  981. /**
  982. * 获取上次观看的直播
  983. */
  984. studyRecordGetLastLive() {
  985. this.$api.studyRecordGetLastLive({
  986. orderGoodsId:this.orderGoodsId,
  987. courseId:this.courseId
  988. }).then(res => {
  989. // console.log(res,'liveres')
  990. this.updateLiveLast(res.data.data)
  991. })
  992. },
  993. /**
  994. * 获取最后一次看的节
  995. */
  996. studyRecordQueryLiveLast() {
  997. // /study/record/queryLiveLast
  998. this.$api.studyRecordQueryLiveLast({
  999. orderGoodsId:this.orderGoodsId,
  1000. courseId:this.courseId
  1001. }).then(res => {
  1002. console.log(res,'couse')
  1003. if(res.data.data) {
  1004. this.moduleId = res.data.data.moduleId
  1005. this.chapterId = res.data.data.chapterId
  1006. if(res.data.data.sectionType == 1) { //录播
  1007. this.$store.commit("setPlaySectionId", { playSectionId: res.data.data.sectionId });
  1008. this.$store.commit("setPlayVID", { playVID: res.data.data.recordingUrl });
  1009. this.sectionItem = res.data.data;
  1010. this.playVideo(res.data.data)
  1011. } else if(res.data.data.sectionType == 2) { //直播
  1012. this.studyRecordGetLastLive();
  1013. } else if(res.data.data.sectionType == 3) { //回放
  1014. this.$store.commit("setPlaySectionId", { playSectionId: res.data.data.sectionId });
  1015. this.$store.commit("setPlayVID", { playVID: res.data.data.recordingUrl });
  1016. this.sectionItem = res.data.data;
  1017. this.polyvLiveHistoryChatMsgList();
  1018. if(!res.data.data.recordingUrl) {
  1019. return;
  1020. }
  1021. this.playVideo(res.data.data)
  1022. }
  1023. }
  1024. })
  1025. },
  1026. async goLive(item) {
  1027. let data = await this.studyRecordGetChannelBasicInfo(item.liveUrl);
  1028. let nowTime = +this.$method.timest();
  1029. if (item.liveStartTime > nowTime) {
  1030. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  1031. uni.showToast({
  1032. title: '直播未开始',
  1033. icon: 'none'
  1034. });
  1035. return;
  1036. }
  1037. } else if (
  1038. item.liveStartTime < nowTime &&
  1039. item.liveEndTime > nowTime
  1040. ) {
  1041. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  1042. uni.showToast({
  1043. title: '暂无直播',
  1044. icon: 'none'
  1045. });
  1046. return;
  1047. }
  1048. } else if (item.liveEndTime < nowTime) {
  1049. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  1050. uni.showToast({
  1051. title: '直播已结束',
  1052. icon: 'none'
  1053. });
  1054. return;
  1055. }
  1056. }
  1057. let moduleId = item.moduleId || 0;
  1058. let chapterId = item.chapterId || 0;
  1059. let sectionId = item.sectionId || item.menuId;
  1060. let uuid = new Date().valueOf() + ""
  1061. // buyCourse 是否购买课程:1是 0否
  1062. let encode = encodeURIComponent(WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='+
  1063. item.liveUrl+'&gradeId='+this.gradeId+'&courseId='+this.courseId+'&goodsId='+this.goodsId+'&orderGoodsId='+this.orderGoodsId+'&sectionId='+sectionId+
  1064. '&chapterId='+chapterId+'&moduleId='+moduleId+'&buyCourse=1'+'&ident='+uuid)
  1065. uni.navigateTo({
  1066. url:`../../pages/webview/index?url=`+encode
  1067. })
  1068. },
  1069. studyRecordMenuAllList() {
  1070. this.$api.studyRecordMenuAllList({
  1071. courseId:this.courseId,
  1072. gradeId:this.gradeId,
  1073. goodsId:this.goodsId
  1074. }).then(res => {
  1075. let nowTime = Number(new Date().getTime()/1000).toFixed(0)
  1076. // this.livingItem = res.data.data[0]
  1077. this.livingItem = res.data.data.find(item => item.liveStartTime<=nowTime&&item.liveEndTime>nowTime);
  1078. })
  1079. },
  1080. studyRecordGetChannelBasicInfo(channelId) {
  1081. return new Promise((resolve) => {
  1082. this.$api
  1083. .studyRecordGetChannelBasicInfo({
  1084. channelId,
  1085. })
  1086. .then((res) => {
  1087. resolve(res.data.data);
  1088. });
  1089. });
  1090. },
  1091. polyvLiveHistoryChatMsgList() {
  1092. this.$api.polyvLiveHistoryChatMsgList({
  1093. sectionId:this.playSectionId,
  1094. channelId:this.sectionItem.liveUrl
  1095. }).then(res => {
  1096. this.historyChatMsgList = res.data.data
  1097. })
  1098. },
  1099. /**
  1100. * 获取业务层次详情
  1101. */
  1102. // courseBusiness() {
  1103. // this.$api.courseBusiness(this.goodsData.businessId).then((res) => {
  1104. // this.businessData = res.data.data;
  1105. // });
  1106. // },
  1107. /**
  1108. * 计算tabs宽度
  1109. */
  1110. itemWidth() {
  1111. return 100 / this.list.length + "%";
  1112. },
  1113. /**
  1114. * 获取讲义权限
  1115. */
  1116. // courseHandouts() {
  1117. // this.$api.courseHandouts(this.goodsData.handoutsId).then((res) => {
  1118. // this.courseHandoutsData = res.data.data;
  1119. // });
  1120. // },
  1121. findMenuNextSection(index) {
  1122. for (let i = index + 1; i < this.reMenuList.length; i++) {
  1123. let item = this.reMenuList[i];
  1124. if (item.type == 3) {
  1125. return item;
  1126. }
  1127. }
  1128. return {};
  1129. },
  1130. loadedmetadata(e) {
  1131. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1132. this.hasStart = true;
  1133. uni.$off('playPause')
  1134. uni.$on('playPause',() => {
  1135. polyvPlayerContext.pause()
  1136. })
  1137. if(!this.recordObj.videoCurrentTime) { //新视频直接提交一条观看记录
  1138. this.postStudyRecord(0)
  1139. }
  1140. },
  1141. getPhotoLastRecord() {
  1142. let self = this;
  1143. let data = {
  1144. sectionId: parseInt(self.playSectionId),
  1145. goodsId: parseInt(self.goodsId),
  1146. courseId: parseInt(self.courseId),
  1147. gradeId: parseInt(self.gradeId),
  1148. chapterId: parseInt(self.chapterId),
  1149. moduleId: parseInt(self.moduleId),
  1150. orderGoodsId: this.orderGoodsId,
  1151. };
  1152. this.$api.getPhotoLastRecord(data).then((res) => {
  1153. if (res.data.code == 200) {
  1154. //清空历史数据
  1155. self.photoHistoryList = [];
  1156. this.photoIndex = 0;
  1157. self.photoList = [];
  1158. for (let i = 0; i < res.data.data.length; i++) {
  1159. //-2存储随机拍照数组
  1160. if (res.data.data[i].photoIndex == -2) {
  1161. self.photoList = res.data.data[i].timeInterval.split(",");
  1162. } else {
  1163. self.photoHistoryList.push(res.data.data[i].photoIndex);
  1164. }
  1165. }
  1166. }
  1167. });
  1168. },
  1169. //postTime 只提交随机时间
  1170. postCoursePhotoRecord(postTime = false) {
  1171. return new Promise((resolve, reject) => {
  1172. let currentTime = 0;
  1173. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1174. if (polyvPlayerContext) {
  1175. currentTime = polyvPlayerContext.getCurrentTime();
  1176. }
  1177. let self = this;
  1178. let photoIndex = self.photoIndex;
  1179. let data = {
  1180. photo: self.ossAvatarUrl,
  1181. sectionId: parseInt(self.playSectionId),
  1182. goodsId: parseInt(self.goodsId),
  1183. courseId: parseInt(self.courseId),
  1184. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  1185. gradeId: parseInt(self.gradeId),
  1186. photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
  1187. photoNum: parseInt(self.photoNum),
  1188. chapterId: parseInt(self.chapterId),
  1189. moduleId: parseInt(self.moduleId),
  1190. timeInterval: postTime ? self.photoList.join(",") : "",
  1191. orderGoodsId: this.orderGoodsId,
  1192. };
  1193. // console.log("提交接口", data);
  1194. this.$api
  1195. .coursePhotoRecord(data)
  1196. .then((res) => {
  1197. // console.log(res,'postCoursePhotoRecord')
  1198. if (res.data.code == 200) {
  1199. resolve();
  1200. } else {
  1201. reject();
  1202. }
  1203. })
  1204. .catch((err) => {
  1205. reject();
  1206. });
  1207. });
  1208. },
  1209. randomNum(minNum, maxNum) {
  1210. switch (arguments.length) {
  1211. case 1:
  1212. return parseInt(Math.random() * minNum + 1, 10);
  1213. break;
  1214. case 2:
  1215. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  1216. break;
  1217. default:
  1218. return 0;
  1219. break;
  1220. }
  1221. },
  1222. //配置随机拍照时间
  1223. configPhoto() {
  1224. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1225. let totalVideoTime = polyvPlayerContext.getDuration();
  1226. let duration = polyvPlayerContext.getCurrentTime();
  1227. let photoNum = this.photoNum;
  1228. if (!this.photoConfig) {
  1229. this.photoConfig = true;
  1230. // let spaceTime = Math.floor(totalVideoTime/photoNum) //拍照时间区间
  1231. // if(spaceTime<5){//区间小于5秒
  1232. // photoNum = Math.floor(totalVideoTime/5)
  1233. // spaceTime = 5
  1234. // }
  1235. // if(photoNum<1){
  1236. // photoNum = 1 //只要设置,至少拍一次
  1237. // spaceTime = totalVideoTime
  1238. // }
  1239. // let initSpace = 0
  1240. //没有历史拍照间隔数据
  1241. if (this.photoList.length == 0) {
  1242. if (totalVideoTime >= 900) {
  1243. //大于15分钟
  1244. if (photoNum == 1) {
  1245. //开头拍1张
  1246. this.photoList.push(0);
  1247. } else if (photoNum == 3) {
  1248. //拍3张
  1249. this.photoList.push(0); //开头拍一张
  1250. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  1251. let centerMinTime = centerTime - 300; //前后5分钟
  1252. let centerMaxTime = centerTime + 300;
  1253. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  1254. this.photoList.push(centerTakeTime); //中间拍一张
  1255. let endMaxTime = totalVideoTime - 60;
  1256. let endMinTime = totalVideoTime - 300;
  1257. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1258. this.photoList.push(endTakeTime); //最后拍一张
  1259. }
  1260. } else {
  1261. //小于15分钟,只拍前后各一张
  1262. if (photoNum == 1) {
  1263. //开头拍1张
  1264. this.photoList.push(0);
  1265. } else if (photoNum == 3) {
  1266. //拍2张
  1267. if (totalVideoTime <= 300) {
  1268. //小于5分钟
  1269. this.photoList.push(0); //开头拍一张
  1270. let endTakeTime = this.randomNum(10, totalVideoTime); //中间随机取一张
  1271. this.photoList.push(endTakeTime);
  1272. } else {
  1273. this.photoList.push(0); //开头拍一张
  1274. let endMaxTime = totalVideoTime - 60;
  1275. let endMinTime = totalVideoTime - 300;
  1276. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  1277. this.photoList.push(endTakeTime); //最后1-5分钟拍一张
  1278. }
  1279. }
  1280. }
  1281. // for(let i=0;i<photoNum;i++){
  1282. // let s = this.randomNum(initSpace,initSpace+spaceTime)
  1283. // if(s>totalVideoTime){
  1284. // s = totalVideoTime-1
  1285. // }
  1286. // if(s<=5){
  1287. // s =5 //避免出现5秒内拍照时间
  1288. // }
  1289. // this.photoList.push(s)
  1290. // initSpace+=spaceTime
  1291. // }
  1292. // console.log(this.photoList, "随机拍照时间数组11", photoNum);
  1293. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  1294. }
  1295. // console.log(this.photoList, "随机拍照时间数组");
  1296. //兼容已有观看历史
  1297. for (let i = 0; i < this.photoList.length - 1; i++) {
  1298. if (
  1299. this.photoList[i] < duration &&
  1300. this.photoList[i + 1] > duration
  1301. ) {
  1302. this.photoIndex = i + 1;
  1303. break;
  1304. }
  1305. if (duration > this.photoList[this.photoList.length - 1]) {
  1306. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  1307. break;
  1308. }
  1309. }
  1310. }
  1311. },
  1312. getLiveUid(channelId) {
  1313. let self = this;
  1314. return new Promise((resolve) => {
  1315. let data = {
  1316. channelId: channelId,
  1317. orderGoodsId: this.orderGoodsId,
  1318. };
  1319. self.$api.polyvSign(data).then((res) => {
  1320. resolve(res.data.data);
  1321. });
  1322. });
  1323. },
  1324. timeEventLiving() {
  1325. if (plv != null) {
  1326. if (this.livePlay) {
  1327. this.liveDuration = this.liveDuration + 1; //每隔1秒
  1328. if (this.liveDuration == 2) {
  1329. //直播第2秒拍照
  1330. console.log(this.channelItem)
  1331. console.log(this.photoHistoryList,'this.photoHistoryList')
  1332. if (
  1333. this.goodsPhotographConfig && this.goodsPhotographConfig.livephotograph == 1 &&
  1334. this.channelItem.learning != 1 && this.photoHistoryList.length == 0
  1335. ) {
  1336. //开启直播拍照
  1337. this.openPhoto();
  1338. } else {
  1339. this.postStudyRecord(0);
  1340. }
  1341. }
  1342. }
  1343. }
  1344. },
  1345. playerLiveStatusChange(e) {
  1346. const status = e.detail.status;
  1347. // console.log("直播状态", status);
  1348. if (status === "live") {
  1349. // console.log("开始直播");
  1350. //开始播放
  1351. if (this.timer) {
  1352. clearInterval(this.timer);
  1353. }
  1354. this.livePlay = true;
  1355. this.timer = setInterval(this.timeEventLiving, 1000); //定时器
  1356. }
  1357. if (status === "end") {
  1358. this.hasStart = false;
  1359. if (this.livePlay) {
  1360. //只有播放过的结束才提交,避免未开播触发结束
  1361. this.postStudyRecord(1);
  1362. }
  1363. // console.log("结束直播");
  1364. this.livePlay = false;
  1365. // 未开始
  1366. }
  1367. },
  1368. closePlv() {
  1369. if (plv) {
  1370. plv.destroy();
  1371. }
  1372. },
  1373. playChannel(item) {
  1374. if (this.timer) {
  1375. clearInterval(this.timer);
  1376. }
  1377. this.startStatus = true;
  1378. console.log('11111111111')
  1379. this.initLive();
  1380. },
  1381. setLiveOption(status) {
  1382. const { userId, channelId, recordFileSimpleModel, playbackEnabled } =
  1383. this.detail;
  1384. const playRecordFile =
  1385. playbackEnabled && recordFileSimpleModel && status === "end";
  1386. // if(this.channelItem.sectionType == 3) { //回放
  1387. // // this.videoOption = {
  1388. // // mode: "live",
  1389. // // uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
  1390. // // cid: this.playChannelId,
  1391. // // openId: this.userInfo.userAccount,
  1392. // // isAutoChange: false,
  1393. // // forceVideo: false,
  1394. // // };
  1395. // } else { //直播
  1396. this.videoOption = {
  1397. mode: "live",
  1398. uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
  1399. cid: this.playChannelId,
  1400. openId: this.userInfo.userAccount,
  1401. isAutoChange: false,
  1402. forceVideo: false,
  1403. };
  1404. // }
  1405. },
  1406. async initLive() {
  1407. this.liveObj = await this.getLiveUid(this.playChannelId);
  1408. this.initLiveOk = true;
  1409. let optionsData = {};
  1410. optionsData.mode = "live";
  1411. optionsData.forceVideo = false;
  1412. optionsData.channelId = this.playChannelId; // 频道ID '2553128'
  1413. optionsData.openId = this.userInfo.userAccount; // 用户openId this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
  1414. optionsData.userId = this.liveObj.uid; // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq'
  1415. let self = this;
  1416. this.closePlv();
  1417. plv.init(optionsData).then(({ detail, chat }) => {
  1418. self.liveDetail = detail;
  1419. // 设置mode为live的videoOption
  1420. this.setLiveOption();
  1421. if (detail.isPPT) {
  1422. chat.on(chat.events.SLICESTART, () => {
  1423. // 开始直播
  1424. });
  1425. } else {
  1426. plv.api.getOrdinaryLiveStatus(detail.stream);
  1427. }
  1428. });
  1429. },
  1430. openSetting(res) {
  1431. // console.log(res, 98);
  1432. },
  1433. getCameraSetting() {
  1434. const self = this;
  1435. wx.getSetting({
  1436. success: (res) => {
  1437. if (res.authSetting["scope.camera"]) {
  1438. // 用户已经授权
  1439. self.showSet = false;
  1440. } else {
  1441. // 用户还没有授权,向用户发起授权请求
  1442. wx.authorize({
  1443. scope: "scope.camera",
  1444. success() {
  1445. // 用户同意授权
  1446. self.showSet = false;
  1447. },
  1448. fail() {
  1449. // 用户不同意授权
  1450. self.showSet = true;
  1451. /* wx.showToast({
  1452. title: '摄像头授权失败',
  1453. icon: 'none',
  1454. duration: 3000
  1455. }) */
  1456. },
  1457. });
  1458. }
  1459. },
  1460. fail: (res) => {},
  1461. });
  1462. },
  1463. studyNotice() {
  1464. this.noticeShow = true;
  1465. },
  1466. //播放笔记视频
  1467. async playNoteVideo(item) {
  1468. console.log(item, "noteItem");
  1469. if (this.timer) {
  1470. clearInterval(this.timer);
  1471. }
  1472. if (this.vid) {
  1473. //切换视频
  1474. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1475. polyvPlayerContext.changeVid(item.recordingUrl);
  1476. } else {
  1477. this.vid = item.recordingUrl;
  1478. }
  1479. this.recordObj = { videoCurrentTime: item.noteSecond };
  1480. if (this.recordObj.videoCurrentTime) {
  1481. this.needSeek = true; //需要跳转到播放记录
  1482. }
  1483. this.startStatus = true;
  1484. console.log('222222222222')
  1485. //获取节笔记
  1486. this.getNoteList();
  1487. },
  1488. //正常播放视频
  1489. async playVideo(item) {
  1490. console.log(item);
  1491. if (item.sectionType == 3) { // 回放的不播放
  1492. return
  1493. }
  1494. if (this.timer) {
  1495. clearInterval(this.timer);
  1496. }
  1497. if (this.vid) {
  1498. //切换视频
  1499. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1500. polyvPlayerContext.changeVid(item.recordingUrl);
  1501. } else {
  1502. console.log(2)
  1503. this.vid = item.recordingUrl;
  1504. }
  1505. this.recordObj = null;
  1506. this.recordObj = await this.getRecordLast();
  1507. console.log('this.recordObj:', this.recordObj)
  1508. this.needSeek = true; //跳转到播放记录
  1509. this.startStatus = true;
  1510. // 提交学习记录
  1511. this.postStudyRecord(0)
  1512. //获取节笔记
  1513. this.getNoteList();
  1514. },
  1515. getRecordLast() {
  1516. let self = this;
  1517. return new Promise((resolve) => {
  1518. let data = {
  1519. gradeId: Number(self.gradeId),
  1520. goodsId: Number(self.goodsId),
  1521. sectionId: Number(self.playSectionId),
  1522. courseId: Number(self.courseId),
  1523. chapterId: parseInt(self.chapterId),
  1524. moduleId: parseInt(self.moduleId),
  1525. orderGoodsId: this.orderGoodsId,
  1526. };
  1527. self.$api.recordLast(data).then((res) => {
  1528. resolve(res.data.data);
  1529. });
  1530. });
  1531. },
  1532. jumpNote(item) {
  1533. this.noteId = item.noteId;
  1534. //没视频播放
  1535. if (this.playSectionId == 0) {
  1536. console.log("即将跳到笔记位置1");
  1537. this.$u.toast("即将跳到笔记位置");
  1538. this.$store.commit("setPlaySectionId", {
  1539. playSectionId: item.sectionId || item.menuId,
  1540. });
  1541. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  1542. this.playNoteVideo(item);
  1543. } else {
  1544. //正在看当前笔记视频
  1545. console.log("即将跳到笔记位置2");
  1546. this.$u.toast("即将跳到笔记位置");
  1547. //跳到笔记时刻
  1548. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1549. polyvPlayerContext.seek(item.noteSecond);
  1550. polyvPlayerContext.play();
  1551. }
  1552. },
  1553. postNote() {
  1554. let self = this;
  1555. if (!(this.playSectionId > 0)) {
  1556. this.$u.toast("目前无播放视频");
  1557. return;
  1558. }
  1559. if (!this.noteValue) {
  1560. this.$u.toast("请输入内容");
  1561. return;
  1562. }
  1563. // if (!this.gradeId) { // 直播课程没有班级,去掉判断,默认为0
  1564. // this.$u.toast("暂无班级数据");
  1565. // return;
  1566. // }
  1567. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1568. let noteDate = this.$method.getZeroTime();
  1569. let noteSecond = polyvPlayerContext.getCurrentTime();
  1570. console.log(noteSecond, 698);
  1571. if (!noteSecond) {
  1572. if (noteSecond == 0) {
  1573. //播放结束
  1574. noteSecond = polyvPlayerContext.getDuration();
  1575. console.log(noteSecond, 63398);
  1576. }
  1577. if (!noteSecond) {
  1578. this.$u.toast("视频暂未开始");
  1579. return;
  1580. }
  1581. }
  1582. let data = {
  1583. gradeId: this.gradeId,
  1584. goodsId: this.goodsId,
  1585. sectionId: this.playSectionId,
  1586. courseId: this.courseId,
  1587. noteText: this.noteValue,
  1588. noteDate: noteDate,
  1589. noteSecond: noteSecond,
  1590. orderGoodsId: this.orderGoodsId,
  1591. };
  1592. // /user/note 新增用户笔记
  1593. this.$api.postNote(data).then((res) => {
  1594. if (res.data.code == 200) {
  1595. this.$u.toast("发布成功");
  1596. self.getNoteList();
  1597. this.noteValue = "";
  1598. }
  1599. });
  1600. },
  1601. getNoteList() {
  1602. let self = this;
  1603. self.noteList = [];
  1604. let data = {
  1605. courseId: this.courseId,
  1606. gradeId: this.gradeId,
  1607. goodsId: this.goodsId,
  1608. orderGoodsId: this.orderGoodsId,
  1609. };
  1610. if (this.playSectionId > 0) {
  1611. data.sectionId = this.playSectionId;
  1612. }
  1613. this.$api.noteList(data).then((res) => {
  1614. if (res.data.code == 200) {
  1615. self.noteList = res.data.rows;
  1616. }
  1617. });
  1618. },
  1619. delAnswer(answerId) {
  1620. let self = this;
  1621. let data = { answerId: answerId, status: -1 ,orderGoodsId: this.orderGoodsId,};
  1622. this.$api.delAnswer(data).then((res) => {
  1623. if (res.data.code == 200) {
  1624. self.getAnswerList();
  1625. }
  1626. });
  1627. },
  1628. clearCtx() {
  1629. console.log(4234);
  1630. this.placeholder = "您可以在这里输入答疑内容";
  1631. this.ctxValue = "";
  1632. this.assignUserId = 0;
  1633. },
  1634. focusNote(event) {
  1635. console.log('event', event.detail.height)
  1636. this.bottomHeight = event.detail.height
  1637. },
  1638. blurNote() {
  1639. this.bottomHeight = 0
  1640. },
  1641. blur() {
  1642. this.bottomHeight = 0
  1643. this.clearTimer = setTimeout(() => {
  1644. this.ctxValue = ""
  1645. this.isFocus = false;
  1646. this.assignUserId = 0;
  1647. this.placeholder = '您可以在这里输入答疑内容';
  1648. },2000)
  1649. },
  1650. replyContent(item) {
  1651. this.isFocus = true;
  1652. this.assignUserId = item.userId;
  1653. this.placeholder = "@" + item.realname;
  1654. },
  1655. delContent(item) {
  1656. this.delAnswer(item.answerId);
  1657. },
  1658. postAnswer() {
  1659. let self = this;
  1660. let data = {
  1661. courseId: this.courseId,
  1662. answerText: this.ctxValue,
  1663. goodsId: this.goodsId,
  1664. orderGoodsId: this.orderGoodsId,
  1665. };
  1666. if (this.assignUserId > 0) {
  1667. data.assignUserId = this.assignUserId;
  1668. }
  1669. this.$api.postAnswer(data).then((res) => {
  1670. if (res.data.code == 200) {
  1671. this.$u.toast("发布成功");
  1672. self.getAnswerList();
  1673. this.isFocus = false;
  1674. this.placeholder = "您可以在这里输入答疑内容";
  1675. this.ctxValue = "";
  1676. this.assignUserId = 0;
  1677. }
  1678. });
  1679. },
  1680. postContent() {
  1681. if (!this.ctxValue || this.ctxValue == "") {
  1682. this.$u.toast("请输入内容");
  1683. return;
  1684. }
  1685. this.postAnswer();
  1686. },
  1687. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  1688. console.log("status", status);
  1689. let currentTime = 0;
  1690. let PlayDuration = 0;
  1691. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1692. if (polyvPlayerContext) {
  1693. currentTime = polyvPlayerContext.getCurrentTime(); //总的视频播放时刻
  1694. PlayDuration = polyvPlayerContext.getVideoPlayDuration(); //本次看的时长
  1695. }
  1696. if (this.playChannelId > 0) {
  1697. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  1698. }
  1699. let self = this;
  1700. let data = {
  1701. fromPlat: 1, //来源平台 1小程序 2网站
  1702. photo: self.ossAvatarUrl,
  1703. sectionId: sectionId || 0,
  1704. goodsId: parseInt(self.goodsId),
  1705. courseId: parseInt(self.courseId),
  1706. orderGoodsId: this.orderGoodsId,
  1707. studyDuration: parseInt(
  1708. PlayDuration > 0 ? PlayDuration : self.studyDuration
  1709. ),
  1710. gradeId: parseInt(self.gradeId),
  1711. chapterId: this.chapterId || 0,
  1712. moduleId: this.moduleId || 0,
  1713. videoCurrentTime: parseInt(
  1714. currentTime > 0 ? currentTime : self.studyDuration
  1715. ),
  1716. };
  1717. if (status > 0) {
  1718. data.status = status;
  1719. }
  1720. console.log("提交接口", data);
  1721. this.$api.studyRecord(data).then((res) => {
  1722. if (res.data.code == 200) {
  1723. if (status > 0) {
  1724. let moduleId = this.moduleId || 0;
  1725. let chapterId = this.chapterId || 0;
  1726. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  1727. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  1728. console.log(playNextId, "playNextId");
  1729. console.log(playNextIdisRebuild, "playNextIdisRebuild");
  1730. uni.$emit("playNext" + playNextIdisRebuild, {
  1731. fromRebuild: this.isRebuild,
  1732. }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  1733. uni.$emit("playNext" + playNextId); //通知播放结束
  1734. }
  1735. self.ossAvatarUrl = "";
  1736. } else {
  1737. this.uploadLock = false;
  1738. uni.showToast({
  1739. icon: "none",
  1740. title: res.data.msg,
  1741. });
  1742. }
  1743. console.log(res, "res");
  1744. });
  1745. },
  1746. uploadFile(options, int) {
  1747. console.log(options)
  1748. var self = this;
  1749. return new Promise((resolve, reject) => {
  1750. var data = {
  1751. imageStatus: int,
  1752. gradeId: this.gradeId,
  1753. orderGoodsId: this.orderGoodsId,
  1754. };
  1755. self.$api.aliyunpolicy(data).then((res) => {
  1756. if (res.data.code != 200) {
  1757. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  1758. return;
  1759. }
  1760. var ossToken = res.data.data.resultContent;
  1761. if (ossToken.host == null || ossToken.host == undefined) {
  1762. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  1763. return;
  1764. }
  1765. uni.uploadFile({
  1766. url: ossToken.host,
  1767. name: "file",
  1768. filePath: options,
  1769. fileType: "image",
  1770. header: {
  1771. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  1772. },
  1773. formData: {
  1774. key: ossToken.dir,
  1775. OSSAccessKeyId: ossToken.accessid,
  1776. policy: ossToken.policy,
  1777. Signature: ossToken.signature,
  1778. callback: ossToken.callback,
  1779. success_action_status: 200,
  1780. },
  1781. success: (result) => {
  1782. // if (result.statusCode === 200) {
  1783. this.$u.toast('上传成功')
  1784. self.ossAvatarUrl = ossToken.dir;
  1785. resolve();
  1786. // } else {
  1787. // uni.showToast({
  1788. // title: "上传失败",
  1789. // icon: "none",
  1790. // });
  1791. // this.openPhoto();
  1792. // return;
  1793. // }
  1794. },
  1795. fail: (error) => {
  1796. uni.showToast({
  1797. title: "上传接口报错,请重新拍照上传" + error,
  1798. icon: "none",
  1799. });
  1800. this.openPhoto();
  1801. return;
  1802. },
  1803. });
  1804. });
  1805. });
  1806. },
  1807. imageInfos() {
  1808. var self = this;
  1809. return new Promise((resolve, reject) => {
  1810. uni.getImageInfo({
  1811. src: self.avatarUrl,
  1812. success: async (res) => {
  1813. let canvasWidth = res.width; //图片原始长宽
  1814. let canvasHeight = res.height;
  1815. if (canvasWidth > 2000 || canvasHeight > 2000) {
  1816. uni.compressImage({
  1817. src: self.avatarUrl,
  1818. quality: 75,
  1819. width: "35%",
  1820. height: "35%",
  1821. success: async (rest) => {
  1822. const waitUpload = await self.uploadFile(
  1823. rest.tempFilePath,
  1824. 0
  1825. );
  1826. resolve(waitUpload);
  1827. },
  1828. });
  1829. } else if (canvasWidth > 1000 || canvasHeight > 1000) {
  1830. uni.compressImage({
  1831. src: self.avatarUrl,
  1832. quality: 75,
  1833. width: "50%",
  1834. height: "50%",
  1835. success: async (rest) => {
  1836. const waitUpload = await self.uploadFile(
  1837. rest.tempFilePath,
  1838. 0
  1839. );
  1840. resolve(waitUpload);
  1841. },
  1842. });
  1843. } else {
  1844. console.log("无需压缩");
  1845. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  1846. resolve(waitUpload);
  1847. }
  1848. },
  1849. fail: (err) => {
  1850. this.$u.toast('图片上传失败')
  1851. }
  1852. });
  1853. });
  1854. },
  1855. timeEvent() {
  1856. let self = this;
  1857. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1858. if (polyvPlayerContext != null) {
  1859. this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
  1860. // console.log(this.playTime,789,this.photoHistoryList)
  1861. //判断是否需要拍照
  1862. if (this.photoNum > 0) {
  1863. this.configPhoto();
  1864. let photoTime = 0; //获取拍照秒数
  1865. for (let i = 0; i < this.photoList.length; i++) {
  1866. photoTime = Number(this.photoList[i]); //获取拍照秒数
  1867. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  1868. //3秒区间内才触发拍照,避免拉动滚动条
  1869. if (
  1870. this.photoHistoryList.indexOf(i) < 0 &&
  1871. this.sectionItem.learning != 1
  1872. ) {
  1873. //不存在拍照历史,没有重修过,没有学过,则拍照
  1874. //启动拍照
  1875. //暂停
  1876. polyvPlayerContext.exitFullScreen();
  1877. polyvPlayerContext.pause();
  1878. this.photoIndex = i;
  1879. this.openPhoto();
  1880. }
  1881. }
  1882. }
  1883. }
  1884. }
  1885. },
  1886. closeToast() {
  1887. clearTimeout(this.toastTimer);
  1888. this.videoToastShow = false;
  1889. },
  1890. restart() {
  1891. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1892. polyvPlayerContext.seek(0);
  1893. console.log("seek1");
  1894. clearTimeout(this.toastTimer);
  1895. this.videoToastShow = false;
  1896. },
  1897. // 新增用户视频学习日志
  1898. studyLog() {
  1899. this.$http({
  1900. url: '/user/study/log',
  1901. method: 'post',
  1902. data: {
  1903. goodsId: this.goodsId,
  1904. courseId: this.courseId,
  1905. moduleId: this.moduleId || 0,
  1906. chapterId: this.chapterId || 0,
  1907. sectionId: this.playSectionId || 0,
  1908. fromPlat: 1, //来源平台 1小程序 2PC网站
  1909. goodsType: 6, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  1910. orderGoodsId: this.orderGoodsId,
  1911. }
  1912. }).then((res) => {
  1913. console.log('直播的用户学习日志:', res)
  1914. })
  1915. },
  1916. onStateChange(newstate, oldstate) {
  1917. console.log('直播视频的开始播放事件', newstate.detail.newstate,this.needSeek)
  1918. if (newstate.detail.newstate == "playing") {
  1919. if (this.needSeek) {
  1920. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1921. if (this.recordObj.videoCurrentTime) {
  1922. console.log("seek2");
  1923. polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
  1924. this.seekTime = this.$method.secondToDate(
  1925. this.recordObj.videoCurrentTime
  1926. );
  1927. this.videoToastShow = true;
  1928. this.toastTimer = setTimeout(() => {
  1929. this.videoToastShow = false;
  1930. }, 3000);
  1931. } else {
  1932. polyvPlayerContext.seek(1); //避免相同节继续播放
  1933. console.log("seek3");
  1934. }
  1935. polyvPlayerContext.play();
  1936. this.needSeek = false;
  1937. // 新增用户视频学习日志
  1938. this.studyLog()
  1939. }
  1940. //开始播放
  1941. if (this.timer) {
  1942. clearInterval(this.timer);
  1943. }
  1944. this.timer = setInterval(this.timeEvent, 1000); //定时器
  1945. }
  1946. if (newstate.detail.newstate == "pause") {
  1947. clearInterval(this.timer);
  1948. //暂停提交记录
  1949. /* this.ossAvatarUrl = ""
  1950. this.postStudyRecord() */
  1951. }
  1952. if (newstate.detail.newstate == "ended") {
  1953. clearInterval(this.timer);
  1954. uni.showToast({
  1955. icon: "none",
  1956. title: "播放完毕",
  1957. });
  1958. this.hasStart = false;
  1959. this.postStudyRecord(1);
  1960. // uni.$emit('playNext') //播放重修下一节
  1961. }
  1962. },
  1963. //拍照
  1964. openPhoto() {
  1965. var polyvPlayerContext = this.selectComponent("#playerVideo");
  1966. if (polyvPlayerContext) {
  1967. polyvPlayerContext.exitFullScreen();
  1968. }
  1969. this.enableAutoRotation = false;
  1970. this.photoPopup = true;
  1971. this.isTaking = true;
  1972. uni.setKeepScreenOn({
  1973. keepScreenOn: true,
  1974. });
  1975. uni.authorize({
  1976. scope: "scope.camera",
  1977. success() {},
  1978. });
  1979. },
  1980. /**
  1981. * 人脸匹配
  1982. */
  1983. faceRecognition() {
  1984. return new Promise((resolve) => {
  1985. let fileSystem = uni.getFileSystemManager();
  1986. fileSystem.readFile({
  1987. filePath: `${this.avatarUrl}`,
  1988. encoding: "base64",
  1989. position: 0,
  1990. success: (res) => {
  1991. console.log(res);
  1992. let base64 = "data:image/jpg;base64," + res.data;
  1993. console.log({
  1994. imageA: base64,
  1995. orderGoodsId: this.orderGoodsId,
  1996. gradeId: this.gradeId,
  1997. },'base64Data')
  1998. this.$api
  1999. .faceCertificationCompareFace({
  2000. imageA: base64,
  2001. orderGoodsId: this.orderGoodsId,
  2002. gradeId: this.gradeId,
  2003. })
  2004. .then((res) => {
  2005. console.log(res, "res");
  2006. resolve(res.data.data);
  2007. });
  2008. },
  2009. fail(err) {
  2010. console.error(err, "err");
  2011. },
  2012. });
  2013. });
  2014. },
  2015. async submit() {
  2016. if (this.uploadLock) {
  2017. return;
  2018. }
  2019. this.uploadLock = true;
  2020. let compareFaceData = await this.faceRecognition();
  2021. console.log(compareFaceData,'compareFaceData')
  2022. if (compareFaceData >= 80) {
  2023. const waitYS = await this.imageInfos();
  2024. this.postCoursePhotoRecord()
  2025. .then((res) => {
  2026. this.photoHistoryList.push(this.photoIndex);
  2027. this.postStudyRecord(); //提交记录
  2028. //恢复播放
  2029. uni.setKeepScreenOn({
  2030. keepScreenOn: false,
  2031. });
  2032. this.photoPopup = false;
  2033. this.uploadLock = false;
  2034. this.enableAutoRotation = true;
  2035. var polyvPlayerContext = this.selectComponent("#playerVideo");
  2036. if (polyvPlayerContext != null) {
  2037. polyvPlayerContext.play();
  2038. }
  2039. })
  2040. .catch((err) => {
  2041. uni.showToast({
  2042. title: "上传接口报错,请重新拍照上传" + err,
  2043. icon: "none",
  2044. });
  2045. this.uploadLock = false;
  2046. this.openPhoto();
  2047. });
  2048. } else {
  2049. uni.showToast({
  2050. title: "人脸匹配不通过,请重新拍照上传",
  2051. icon: "none",
  2052. duration: 2000,
  2053. });
  2054. setTimeout(() => {
  2055. this.uploadLock = false;
  2056. this.openPhoto();
  2057. }, 2000);
  2058. return;
  2059. }
  2060. },
  2061. reTake() {
  2062. this.isTaking = true;
  2063. },
  2064. //确认拍照
  2065. takePhoto() {
  2066. var self = this;
  2067. const ctx = uni.createCameraContext();
  2068. ctx.takePhoto({
  2069. quality: "high",
  2070. success: (res) => {
  2071. console.log(res.tempImagePath);
  2072. self.avatarUrl = res.tempImagePath;
  2073. this.isTaking = false;
  2074. // self.submit();
  2075. // self.photoPopup = false;
  2076. // self.enableAutoRotation = true;
  2077. },
  2078. fail: (err) => {
  2079. console.log(err);
  2080. },
  2081. });
  2082. },
  2083. playError(e) {
  2084. console.log(e);
  2085. },
  2086. //拍照报错
  2087. error(e) {
  2088. console.log(e.detail);
  2089. },
  2090. //关闭相机
  2091. closePhoto() {
  2092. this.photoPopup = false;
  2093. self.enableAutoRotation = true;
  2094. },
  2095. /**
  2096. * 进入全屏
  2097. */
  2098. fullscreenchange(event) {
  2099. console.log('进入全屏',event);
  2100. if (event.detail.direction == "vertical") {
  2101. this.navShow = true;
  2102. } else if (event.detail.direction == "horizontal") {
  2103. this.navShow = false;
  2104. }
  2105. },
  2106. getGoodsDetail() {
  2107. console.log('goodsDetail(------')
  2108. let self = this;
  2109. // goods/'+ data
  2110. this.$api.goodsDetail(this.goodsId).then((res) => {
  2111. self.goodsData = res.data.data;
  2112. console.log(self.gradeId, "班级ID");
  2113. // this.courseBusiness();
  2114. // this.courseHandouts();
  2115. self.getMenuList();
  2116. console.log(self.goodsData,'self.goodsData')
  2117. //获取节笔记
  2118. this.getNoteList();
  2119. if (self.goodsData.goodsPlayConfig) {
  2120. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  2121. if (self.goodsPlayConfig.autoPlay > 0) {
  2122. self.autoplay = true;
  2123. }
  2124. if (self.goodsPlayConfig.drag > 0) {
  2125. self.isAllowSeek = "yes";
  2126. }
  2127. if (self.goodsPlayConfig.speed > 0) {
  2128. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  2129. }
  2130. }
  2131. if (self.goodsData.goodsPhotographConfig) {
  2132. self.goodsPhotographConfig = JSON.parse(
  2133. self.goodsData.goodsPhotographConfig
  2134. );
  2135. if (self.goodsPhotographConfig.photoNum > 0) {
  2136. self.photoNum = self.goodsPhotographConfig.photoNum;
  2137. console.log(self.photoNum, 777777);
  2138. }
  2139. }
  2140. });
  2141. },
  2142. startVideo() {
  2143. this.startStatus = true;
  2144. console.log('444444444')
  2145. },
  2146. getAnswerList() {
  2147. let self = this;
  2148. this.$api
  2149. .answerList({ courseId: this.courseId, goodsId: this.goodsId,orderGoodsId: this.orderGoodsId, })
  2150. .then((res) => {
  2151. if (res.data.code == 200) {
  2152. self.answerList = res.data.rows;
  2153. }
  2154. });
  2155. },
  2156. getMenuList() {
  2157. // let self = this;
  2158. // /course/menuList
  2159. this.$api
  2160. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId,orderGoodsId: this.orderGoodsId, })
  2161. .then((res) => {
  2162. if (res.data.code == 200) {
  2163. for (let i = 0; i < res.data.rows.length; i++) {
  2164. let item = res.data.rows[i];
  2165. item.down = true;
  2166. item.id = item.menuId;
  2167. item.name = item.menuName;
  2168. item.menuType = item.type;
  2169. }
  2170. this.menuList = res.data.rows;
  2171. this.reStart = true
  2172. for (let i = 0; i < res.data.rows.length; i++) {
  2173. if (res.data.rows[i].type == 1) {
  2174. this.menuIndex = [i];
  2175. break;
  2176. } else if (res.data.rows[i].type == 2) {
  2177. this.menuIndex = [i];
  2178. break;
  2179. }
  2180. }
  2181. console.log('--this.menuList:-', this.menuList)
  2182. }
  2183. });
  2184. },
  2185. courseDetail() {
  2186. let self = this;
  2187. // /course/'+data 获取课程详细信息
  2188. this.$api.courseDetail(this.courseId).then((res) => {
  2189. if (res.data.code == 200) {
  2190. // if (res.data.data.educationName == "继续教育") {
  2191. this.$api
  2192. .lockLockAction({
  2193. action: "jxjy",
  2194. uuid:this.$method.getUuid()
  2195. })
  2196. .then((res) => {});
  2197. this.lockTimer = setInterval(() => {
  2198. this.$api
  2199. .lockLockAction({
  2200. action: "jxjy",
  2201. uuid:this.$method.getUuid()
  2202. })
  2203. .then((res) => {});
  2204. }, 10000);
  2205. // websocket.sendMsg("doCourse");
  2206. // }
  2207. self.detail = res.data.data;
  2208. }
  2209. });
  2210. },
  2211. open(item) {
  2212. item.showChildren = !item.showChildren;
  2213. },
  2214. change(index) {
  2215. this.current = index;
  2216. },
  2217. openDocument() {
  2218. let self = this;
  2219. let url = this.$method.splitImgHost(this.courseHandoutsData.handoutsUrl);
  2220. console.log(url);
  2221. uni.downloadFile({
  2222. url: url,
  2223. success: function (res) {
  2224. console.log(999);
  2225. var filePath = res.tempFilePath;
  2226. uni.openDocument({
  2227. filePath: filePath,
  2228. showMenu: self.courseHandoutsData.canDownload == 1 ? true : false,
  2229. success: function (res) {
  2230. console.log(res, "打开文档成功");
  2231. },
  2232. fail: function (err) {
  2233. console.log(err);
  2234. uni.showToast({
  2235. icon: "none",
  2236. title: "文档地址错误",
  2237. });
  2238. },
  2239. });
  2240. },
  2241. fail: (err) => {
  2242. uni.showModal({
  2243. title: "提示",
  2244. content: "文档错误," + err.errMsg,
  2245. showCancel: false,
  2246. });
  2247. },
  2248. });
  2249. },
  2250. },
  2251. };
  2252. </script>
  2253. <style lang="scss" scope>
  2254. @import '../polyv/css/detail.scss';
  2255. .top {
  2256. &__header {
  2257. position:relative;
  2258. width:100%;
  2259. height:150rpx;
  2260. padding:24rpx 150rpx 24rpx 24rpx;
  2261. .img {
  2262. position:absolute;
  2263. left:0;
  2264. top:0;
  2265. width:100%;
  2266. }
  2267. .note {
  2268. position:relative;
  2269. z-index: 10;
  2270. font-size: 24rpx;
  2271. font-family: PingFang SC;
  2272. font-weight: bold;
  2273. color: #EFDBFF;
  2274. }
  2275. .title {
  2276. position:relative;
  2277. z-index: 10;
  2278. font-size: 26rpx;
  2279. font-family: PingFang SC;
  2280. font-weight: bold;
  2281. color: #FFFFFF;
  2282. }
  2283. .desc {
  2284. }
  2285. }
  2286. }
  2287. .polyv_detail {
  2288. display: flex;
  2289. flex-direction: column;
  2290. height: 100vh;
  2291. .box {
  2292. flex: 1;
  2293. overflow: hidden;
  2294. margin: 16rpx 16rpx 100rpx 16rpx;
  2295. .box_in {
  2296. height: 100%;
  2297. }
  2298. }
  2299. .first_ml {
  2300. margin: 16rpx 16rpx 16rpx 16rpx;
  2301. }
  2302. }
  2303. .btnSet {
  2304. width: 440rpx;
  2305. height: 80rpx;
  2306. background: #007aff;
  2307. border-radius: 40rpx;
  2308. color: #ffffff;
  2309. font-size: 28rpx;
  2310. line-height: 80rpx;
  2311. }
  2312. .btnReply {
  2313. width: 80rpx;
  2314. height: 40rpx;
  2315. background: #e3f0ff;
  2316. border-radius: 16rpx;
  2317. text-align: center;
  2318. color: #007aff;
  2319. }
  2320. .btnDel {
  2321. width: 80rpx;
  2322. height: 40rpx;
  2323. background: #ffedf0;
  2324. border-radius: 16rpx;
  2325. text-align: center;
  2326. color: #ff2d55;
  2327. }
  2328. .btnReply {
  2329. width: 80rpx;
  2330. height: 40rpx;
  2331. background: #e3f0ff;
  2332. border-radius: 16rpx;
  2333. font-size: 24rpx;
  2334. }
  2335. .lecture-box {
  2336. display: flex;
  2337. align-items: center;
  2338. height: 80rpx;
  2339. background: #ffffff;
  2340. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2341. .title {
  2342. padding: 10rpx;
  2343. flex: 1;
  2344. overflow: hidden;
  2345. text-overflow: ellipsis;
  2346. white-space: nowrap;
  2347. color: #333;
  2348. font-weight: bold;
  2349. font-size: 32rpx;
  2350. }
  2351. .btn {
  2352. display: flex;
  2353. align-items: center;
  2354. justify-content: center;
  2355. width: 80rpx;
  2356. height: 80rpx;
  2357. background: #ffffff;
  2358. box-shadow: -4rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.1);
  2359. border-radius: 16rpx 16rpx 16rpx 16rpx;
  2360. }
  2361. }
  2362. .lecture-content {
  2363. background: #fff;
  2364. margin-top: 10rpx;
  2365. padding: 10rpx;
  2366. border-radius: 16rpx;
  2367. }
  2368. .photoBox {
  2369. background-color: #ffffff;
  2370. border-radius: 32px 32px 0px 0px;
  2371. .photoTop {
  2372. height: 74rpx;
  2373. display: flex;
  2374. align-items: center;
  2375. justify-content: space-between;
  2376. padding: 0rpx 38rpx;
  2377. .sqzz {
  2378. width: 28rpx;
  2379. height: 28rpx;
  2380. display: flex;
  2381. align-items: center;
  2382. justify-content: center;
  2383. }
  2384. .centersq {
  2385. color: #333;
  2386. font-size: 30rpx;
  2387. font-weight: 500;
  2388. }
  2389. }
  2390. .photoCenter {
  2391. width: 750rpx;
  2392. height: 979rpx;
  2393. position: relative;
  2394. .custom {
  2395. width: 750rpx;
  2396. height: 979rpx;
  2397. position: absolute;
  2398. z-index: 1000;
  2399. top: 0;
  2400. left: 0;
  2401. image {
  2402. width: 100%;
  2403. height: 100%;
  2404. }
  2405. }
  2406. }
  2407. .btns {
  2408. display: flex;
  2409. .btnResult {
  2410. height: 100rpx;
  2411. flex: 1;
  2412. background-color: #07c160;
  2413. text-align: center;
  2414. line-height: 100rpx;
  2415. color: #fff;
  2416. font-size: 32rpx;
  2417. font-weight: bold;
  2418. }
  2419. }
  2420. }
  2421. .chat_box {
  2422. display: flex;
  2423. padding: 20rpx;
  2424. justify-content: space-between;
  2425. }
  2426. .chat3 {
  2427. font-size: 30rpx;
  2428. font-family: PingFang SC;
  2429. font-weight: 500;
  2430. color: #666666;
  2431. margin-top: 10rpx;
  2432. }
  2433. .chat2 {
  2434. font-size: 20rpx;
  2435. font-family: PingFang SC;
  2436. font-weight: 500;
  2437. color: #999999;
  2438. margin-top: 10rpx;
  2439. }
  2440. .chat1 {
  2441. font-size: 24rpx;
  2442. font-family: PingFang SC;
  2443. font-weight: 500;
  2444. color: #333333;
  2445. }
  2446. .leftPadding {
  2447. margin-left: 8rpx;
  2448. }
  2449. .t2Content {
  2450. font-size: 24rpx;
  2451. font-family: PingFang SC;
  2452. font-weight: bold;
  2453. color: #999999;
  2454. line-height: 48rpx;
  2455. }
  2456. .tBox2 {
  2457. display: flex;
  2458. padding-top: 10rpx;
  2459. color: #333333;
  2460. font-size: 30rpx;
  2461. font-weight: 400;
  2462. }
  2463. .tBox {
  2464. display: flex;
  2465. align-items: center;
  2466. padding-top: 10rpx;
  2467. }
  2468. .title {
  2469. font-size: 24rpx;
  2470. color: #999999;
  2471. }
  2472. page {
  2473. // padding-top: 10px;
  2474. // padding-top: constant(safe-area-inset-top);
  2475. // padding-top: env(safe-area-inset-top);
  2476. }
  2477. .Answering {
  2478. .answer_item {
  2479. &:nth-child(2) {
  2480. border-radius: 16rpx 16rpx 0rpx 0rpx;
  2481. }
  2482. &:nth-last-child(1) {
  2483. border-radius: 0rpx 0rpx 16rpx 16rpx;
  2484. }
  2485. }
  2486. }
  2487. .inputBottom {
  2488. position: fixed;
  2489. left: 0;
  2490. bottom: 0;
  2491. background: #ffffff;
  2492. height: 98rpx;
  2493. display: flex;
  2494. align-items: center;
  2495. width: 100%;
  2496. z-index: 99;
  2497. .flex_auto {
  2498. flex: 1;
  2499. margin-left: 10%;
  2500. }
  2501. .btn {
  2502. color: #007aff;
  2503. font-size: 30rpx;
  2504. font-weight: bold;
  2505. width: 15%;
  2506. text-align: center;
  2507. }
  2508. .input {
  2509. background: rgba(244, 244, 244, 0.98);
  2510. height: 60rpx;
  2511. border-radius: 24rpx;
  2512. margin-top: 12rpx;
  2513. }
  2514. }
  2515. .noteBox {
  2516. width: 100%;
  2517. background: #ffffff;
  2518. padding: 0rpx 10rpx 20rpx;
  2519. border-radius: 16rpx;
  2520. overflow: hidden;
  2521. .left_ti {
  2522. padding-top: 14rpx;
  2523. }
  2524. }
  2525. .dateBox {
  2526. width: 216rpx;
  2527. height: 48rpx;
  2528. background: #ffffff;
  2529. border-radius: 24rpx;
  2530. font-size: 24rpx;
  2531. color: #666666;
  2532. text-align: center;
  2533. line-height: 48rpx;
  2534. margin: 16rpx 0rpx 8rpx;
  2535. }
  2536. .t_content1 {
  2537. color: #007aff;
  2538. margin-left: 10rpx;
  2539. }
  2540. .tag1 {
  2541. border: 2rpx solid #007aff;
  2542. border-radius: 8rpx;
  2543. font-size: 20rpx;
  2544. color: #007aff;
  2545. padding: 5rpx;
  2546. }
  2547. .b_title {
  2548. color: #333333;
  2549. font-size: 30rpx;
  2550. font-weight: bold;
  2551. }
  2552. page {
  2553. background: #eaeef1;
  2554. }
  2555. .menuBox {
  2556. width: 100%;
  2557. background: #ffffff;
  2558. border-radius: 16rpx;
  2559. padding: 20rpx;
  2560. margin-bottom: 20rpx;
  2561. }
  2562. .btnspric {
  2563. border-top: 1rpx solid #eee;
  2564. display: flex;
  2565. align-items: center;
  2566. justify-content: space-between;
  2567. height: 108rpx;
  2568. padding-left: 43rpx;
  2569. padding-right: 32rpx;
  2570. }
  2571. .btnspric > .lefprL {
  2572. font-size: 36rpx;
  2573. color: #0c141f;
  2574. font-weight: bold;
  2575. }
  2576. .btnspric > .lefprR {
  2577. padding: 0rpx 24rpx;
  2578. height: 60rpx;
  2579. line-height: 60rpx;
  2580. text-align: center;
  2581. color: #fff;
  2582. background: #32467b;
  2583. border-radius: 24rpx;
  2584. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  2585. }
  2586. .yhj,
  2587. .hdyhj {
  2588. padding: 24rpx 29rpx 24rpx 34rpx;
  2589. }
  2590. .yhj {
  2591. border-bottom: 16rpx solid #f9f9f9;
  2592. }
  2593. .yhjtit {
  2594. font-size: 30rpx;
  2595. color: #0c141f;
  2596. font-weight: 500;
  2597. margin-bottom: 14rpx;
  2598. }
  2599. .yhjList {
  2600. display: flex;
  2601. align-items: center;
  2602. justify-content: space-between;
  2603. margin-bottom: 14rpx;
  2604. }
  2605. .yhjList > .yhjLefts {
  2606. display: flex;
  2607. align-items: center;
  2608. }
  2609. .yhjLefts > .yhl {
  2610. color: #32467b;
  2611. font-size: 30rpx;
  2612. margin-right: 31rpx;
  2613. }
  2614. .yhjLefts > .yhbq {
  2615. font-size: 24rpx;
  2616. color: #ff9500;
  2617. border-radius: 18rpx;
  2618. background-color: rgba(255, 149, 0, 0.2);
  2619. border: 2rpx solid #ff9500;
  2620. height: 38rpx;
  2621. line-height: 38rpx;
  2622. padding: 0rpx 16rpx;
  2623. }
  2624. .ts {
  2625. font-size: 24rpx;
  2626. color: #999;
  2627. margin: 14rpx 0rpx;
  2628. padding-right: 29rpx;
  2629. padding-left: 34rpx;
  2630. }
  2631. .yh {
  2632. padding-top: 20rpx;
  2633. }
  2634. .yh > .yhtitle {
  2635. display: flex;
  2636. align-items: center;
  2637. justify-content: space-between;
  2638. padding-right: 29rpx;
  2639. padding-left: 34rpx;
  2640. }
  2641. .priceBxs {
  2642. display: flex;
  2643. align-items: center;
  2644. }
  2645. .priceBxs > .pricleft {
  2646. border-radius: 24rpx;
  2647. border: 1rpx solid #e91313;
  2648. background-color: rgba(233, 19, 19, 0.1);
  2649. padding: 0rpx 18rpx;
  2650. height: 49rpx;
  2651. line-height: 49rpx;
  2652. text-align: center;
  2653. font-size: 30rpx;
  2654. font-weight: 500;
  2655. color: #e91313;
  2656. margin-right: 13rpx;
  2657. }
  2658. .topBox {
  2659. padding: 32rpx 32rpx 24rpx;
  2660. border-bottom: 1rpx solid #eeeeee;
  2661. }
  2662. .topBox > .boldFonstType {
  2663. font-weight: 500;
  2664. font-size: 30rpx;
  2665. margin: 16rpx 0rpx 23rpx;
  2666. }
  2667. .topBox > .firstTopL {
  2668. display: flex;
  2669. align-items: center;
  2670. }
  2671. .topBox > .firstTopL > .imageBs {
  2672. width: 331rpx;
  2673. height: 160rpx;
  2674. border-radius: 6rpx;
  2675. overflow: hidden;
  2676. margin-right: 8rpx;
  2677. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  2678. }
  2679. .topBox > .firstTopL > .imageBs > image {
  2680. width: 100%;
  2681. height: 100%;
  2682. }
  2683. .topBox > .firstTopL > .textBs {
  2684. font-size: 30rpx;
  2685. font-weight: bold;
  2686. color: #0c141f;
  2687. }
  2688. .content {
  2689. padding: 24rpx;
  2690. text-align: left;
  2691. }
  2692. .catalogBox {
  2693. display: flex;
  2694. align-items: center;
  2695. flex-wrap: nowrap;
  2696. overflow-x: auto;
  2697. padding-left: 38rpx;
  2698. max-height: 305rpx;
  2699. overflow-y: auto;
  2700. transition: all 0.4s;
  2701. }
  2702. .catalogBox > .catalogA {
  2703. min-width: 200rpx;
  2704. height: 48rpx;
  2705. line-height: 48rpx;
  2706. // text-align: center;
  2707. border: 2rpx solid transparent;
  2708. white-space: nowrap;
  2709. text-overflow: ellipsis;
  2710. overflow: hidden;
  2711. word-break: break-all;
  2712. border-radius: 10rpx;
  2713. background: rgba(22, 119, 255, 0.05);
  2714. padding-left: 19rpx;
  2715. box-sizing: border-box;
  2716. padding-right: 15rpx;
  2717. margin-right: 16rpx;
  2718. margin-bottom: 20rpx;
  2719. margin-top: 15rpx;
  2720. font-size: 24rpx;
  2721. color: #666;
  2722. }
  2723. .catalogBox > .activesq {
  2724. border-color: #1677ff;
  2725. }
  2726. .changeCatalogBox {
  2727. display: block;
  2728. }
  2729. .catalogBox::-webkit-scrollbar {
  2730. display: none; /* Chrome Safari */
  2731. }
  2732. .price_t2 {
  2733. font-size: 18rpx;
  2734. font-family: PingFang SC;
  2735. font-weight: 500;
  2736. text-decoration: line-through;
  2737. color: #999999;
  2738. }
  2739. .price_t1 {
  2740. font-size: 33rpx;
  2741. font-family: PingFang SC;
  2742. font-weight: bold;
  2743. color: #e91313;
  2744. }
  2745. .sc_t {
  2746. font-size: 22rpx;
  2747. color: #000000;
  2748. }
  2749. .sc {
  2750. width: 29rpx;
  2751. height: 29rpx;
  2752. }
  2753. .buy {
  2754. width: 138rpx;
  2755. height: 48rpx;
  2756. line-height: 48rpx;
  2757. background: #32467b;
  2758. border-radius: 10rpx;
  2759. color: #ffffff;
  2760. font-size: 28rpx;
  2761. text-align: center;
  2762. vertical-align: middle;
  2763. position: absolute;
  2764. right: 30rpx;
  2765. }
  2766. .video_body {
  2767. padding-bottom: 96rpx;
  2768. }
  2769. .footer_tab {
  2770. position: fixed;
  2771. bottom: 0;
  2772. height: 96rpx;
  2773. width: 100%;
  2774. background-color: #ffffff;
  2775. }
  2776. .tj_box {
  2777. width: 50%;
  2778. display: inline-block;
  2779. text-align: center;
  2780. margin: 10rpx 0;
  2781. }
  2782. .teacher_t {
  2783. font-size: 24rpx;
  2784. font-family: PingFang SC;
  2785. font-weight: 400;
  2786. color: #666666;
  2787. line-height: 36rpx;
  2788. margin-left: 15rpx;
  2789. }
  2790. .teacher_img {
  2791. width: 87rpx;
  2792. height: 129rpx;
  2793. }
  2794. .t2 {
  2795. font-size: 24rpx;
  2796. font-family: PingFang SC;
  2797. color: #666666;
  2798. line-height: 36rpx;
  2799. margin: 15rpx;
  2800. }
  2801. .r_t2 {
  2802. width: 201rpx;
  2803. height: 49rpx;
  2804. background: rgba(22, 119, 255, 0.05);
  2805. border: 1rpx solid #32467b;
  2806. border-radius: 16rpx;
  2807. color: #666666;
  2808. font-size: 23rpx;
  2809. text-align: center;
  2810. display: flex;
  2811. align-items: center;
  2812. padding: 5rpx;
  2813. }
  2814. .scroll_box {
  2815. width: 100%;
  2816. height: 60rpx;
  2817. background: #ffffff;
  2818. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  2819. white-space: nowrap;
  2820. overflow: hidden;
  2821. margin: 15rpx 0;
  2822. }
  2823. .r_sliper {
  2824. padding: 0 20rpx;
  2825. }
  2826. .top_line {
  2827. width: 6rpx;
  2828. height: 22rpx;
  2829. background: #32467b;
  2830. margin-right: 10rpx;
  2831. }
  2832. .video_t2 {
  2833. font-size: 24rpx;
  2834. font-family: PingFang SC;
  2835. font-weight: 500;
  2836. color: #666666;
  2837. }
  2838. .course_name {
  2839. height: 80rpx;
  2840. background-color: #fff;
  2841. }
  2842. .video_t1 {
  2843. height: 80rpx;
  2844. color: #333333;
  2845. line-height: 80rpx;
  2846. font-size: 30rpx;
  2847. font-family: PingFang SC;
  2848. font-weight: bold;
  2849. color: #333333;
  2850. margin-left: 15rpx;
  2851. overflow: hidden;
  2852. text-overflow: ellipsis;
  2853. white-space: nowrap;
  2854. }
  2855. .notice_wrap {
  2856. height: 80rpx;
  2857. display: flex;
  2858. align-items: center;
  2859. justify-content: flex-end;
  2860. .video_t1_t {
  2861. width: 100%;
  2862. height: 40rpx;
  2863. line-height: 40rpx;
  2864. text-align: center;
  2865. background: rgba(245, 154, 35, 1);
  2866. color: #333;
  2867. border-radius: 10rpx;
  2868. font-size: 24rpx;
  2869. }
  2870. }
  2871. .video_play {
  2872. position: absolute;
  2873. width: 95rpx;
  2874. height: 95rpx;
  2875. top: 0;
  2876. left: 0;
  2877. right: 0;
  2878. bottom: 0;
  2879. margin: auto;
  2880. }
  2881. .video_box {
  2882. position: relative;
  2883. .video-toast {
  2884. position: absolute;
  2885. width: 686rpx;
  2886. height: 80rpx;
  2887. background: rgba(0, 0, 0, 0.6);
  2888. border-radius: 24rpx;
  2889. bottom: 100rpx;
  2890. left: 50%;
  2891. transform: translateX(-50%);
  2892. color: #fff;
  2893. display: flex;
  2894. font-size: 26rpx;
  2895. align-items: center;
  2896. overflow: visible;
  2897. &__text {
  2898. flex: 1;
  2899. margin-left: 40rpx;
  2900. }
  2901. &__btn {
  2902. width: 180rpx;
  2903. text-align: center;
  2904. border-left: 1rpx solid #fff;
  2905. }
  2906. }
  2907. .video-toast__close {
  2908. position: absolute;
  2909. right: 32rpx;
  2910. bottom: 184rpx;
  2911. width: 40rpx;
  2912. height: 40rpx;
  2913. line-height: 40rpx;
  2914. text-align: center;
  2915. background: rgba(0, 0, 0, 0.6);
  2916. border-radius: 50%;
  2917. color: rgba(255, 255, 255, 0.3);
  2918. }
  2919. }
  2920. .rotoct {
  2921. transform: rotate(90deg);
  2922. }
  2923. .notice_modal {
  2924. .content {
  2925. width: 100%;
  2926. height: 100%;
  2927. padding: 20rpx;
  2928. .title {
  2929. color: #333;
  2930. line-height: 40rpx;
  2931. font-size: 30rpx;
  2932. text-align: center;
  2933. font-weight: bold;
  2934. }
  2935. .text {
  2936. line-height: 40rpx;
  2937. }
  2938. }
  2939. }
  2940. </style>