detail.vue 115 KB

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