detail.vue 86 KB

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