detail.vue 125 KB

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