detail.vue 82 KB

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