detail.vue 87 KB

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