detail.vue 82 KB

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