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