detail.vue 90 KB

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