detail.vue 142 KB

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