detail.vue 96 KB

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