detail.vue 82 KB

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