detail.vue 82 KB

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