detail.vue 96 KB

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