detail.vue 86 KB

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