detail.vue 82 KB

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