detail.vue 87 KB

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