detail.vue 97 KB

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