detail.vue 85 KB

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