detail.vue 97 KB

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