detail.vue 97 KB

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