detail.vue 142 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810
  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. console.log(465456)
  2102. if (this.hasStart) {
  2103. // 防止loadedmetadata事件第二次触发
  2104. return;
  2105. }
  2106. // #ifdef MP-WEIXIN
  2107. polyvPlayerContext = this.selectComponent("#playerVideo");
  2108. // #endif
  2109. this.hasStart = true;
  2110. uni.$off("playPause");
  2111. uni.$on("playPause", () => {
  2112. // #ifdef MP-WEIXIN
  2113. polyvPlayerContext.pause();
  2114. // #endif
  2115. // #ifdef H5
  2116. polyvPlayerContext.j2s_pauseVideo(); // 暂停播放视频
  2117. // #endif
  2118. });
  2119. if (!this.recordObj.videoCurrentTime) {
  2120. //新视频直接提交一条观看记录
  2121. this.postStudyRecord(0);
  2122. }
  2123. this.studyTimer && clearInterval(this.studyTimer);
  2124. this.studyTimer = setInterval(() => {
  2125. this.postStudyRecord(0);
  2126. }, 15000);
  2127. },
  2128. getPhotoLastRecord() {
  2129. if (this.erJianErZao) {
  2130. return;
  2131. }
  2132. let self = this;
  2133. let data = {
  2134. sectionId: parseInt(self.playSectionId),
  2135. goodsId: parseInt(self.goodsId),
  2136. courseId: parseInt(self.courseId),
  2137. gradeId: parseInt(self.gradeId),
  2138. chapterId: parseInt(self.chapterId),
  2139. moduleId: parseInt(self.moduleId),
  2140. orderGoodsId: this.orderGoodsId,
  2141. };
  2142. // /course/photo/log/getLastInfo'
  2143. this.$api.getPhotoLastRecord(data).then((res) => {
  2144. if (res.data.code == 200) {
  2145. //清空历史数据
  2146. self.photoHistoryList = [];
  2147. this.photoIndex = 0;
  2148. self.photoList = [];
  2149. for (let i = 0; i < res.data.data.length; i++) {
  2150. //-2存储随机拍照数组
  2151. if (res.data.data[i].photoIndex == -2) {
  2152. self.photoList =
  2153. res.data.data[i].timeInterval &&
  2154. res.data.data[i].timeInterval.split(",");
  2155. } else {
  2156. self.photoHistoryList.push(res.data.data[i].photoIndex);
  2157. }
  2158. }
  2159. // console.log('7777', this.photoHistoryList, this.photoList);
  2160. }
  2161. });
  2162. },
  2163. //postTime 只提交随机时间
  2164. postCoursePhotoRecord(postTime = false) {
  2165. return new Promise((resolve, reject) => {
  2166. let currentTime = 0;
  2167. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2168. if (polyvPlayerContext) {
  2169. // #ifdef MP-WEIXIN
  2170. currentTime = polyvPlayerContext.getCurrentTime();
  2171. // #endif
  2172. // #ifdef H5
  2173. currentTime = polyvPlayerContext.j2s_getCurrentTime();
  2174. // #endif
  2175. }
  2176. let self = this;
  2177. let photoIndex = self.photoIndex;
  2178. let data = {
  2179. photo: self.ossAvatarUrl,
  2180. sectionId: parseInt(self.playSectionId),
  2181. goodsId: parseInt(self.goodsId),
  2182. courseId: parseInt(self.courseId),
  2183. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  2184. gradeId: parseInt(self.gradeId),
  2185. photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
  2186. photoNum: parseInt(self.photoNum),
  2187. chapterId: parseInt(self.chapterId),
  2188. moduleId: parseInt(self.moduleId),
  2189. timeInterval: postTime ? self.photoList.join(",") : "",
  2190. orderGoodsId: this.orderGoodsId,
  2191. };
  2192. // console.log("提交接口", data);
  2193. this.$api
  2194. .coursePhotoRecord(data)
  2195. .then((res) => {
  2196. if (res.data.code == 200) {
  2197. resolve();
  2198. } else {
  2199. reject();
  2200. }
  2201. })
  2202. .catch((err) => {
  2203. reject();
  2204. });
  2205. });
  2206. },
  2207. randomNum(minNum, maxNum) {
  2208. switch (arguments.length) {
  2209. case 1:
  2210. return parseInt(Math.random() * minNum + 1, 10);
  2211. break;
  2212. case 2:
  2213. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  2214. break;
  2215. default:
  2216. return 0;
  2217. break;
  2218. }
  2219. },
  2220. //配置随机拍照时间
  2221. configPhoto() {
  2222. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2223. let totalVideoTime = 0;
  2224. let duration = 0;
  2225. // #ifdef MP-WEIXIN
  2226. totalVideoTime = polyvPlayerContext.getDuration();
  2227. duration = polyvPlayerContext.getCurrentTime();
  2228. // #endif
  2229. // #ifdef H5
  2230. totalVideoTime = polyvPlayerContext.j2s_getDuration();
  2231. duration = polyvPlayerContext.j2s_getCurrentTime();
  2232. // #endif
  2233. let photoNum = this.photoNum;
  2234. if (!this.photoConfig) {
  2235. this.photoConfig = true;
  2236. if (this.erJianErZao) {
  2237. this.photoList = this.randomConfig(totalVideoTime, duration);
  2238. return;
  2239. }
  2240. //没有历史拍照间隔数据
  2241. if (this.photoList.length == 0) {
  2242. if (totalVideoTime >= 900) {
  2243. //大于15分钟
  2244. if (photoNum == 1) {
  2245. //开头拍1张
  2246. this.photoList.push(0);
  2247. } else if (photoNum == 3) {
  2248. //拍3张
  2249. this.photoList.push(0); //开头拍一张
  2250. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  2251. let centerMinTime = centerTime - 300; //前后5分钟
  2252. let centerMaxTime = centerTime + 300;
  2253. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  2254. this.photoList.push(centerTakeTime); //中间拍一张
  2255. let endMaxTime = totalVideoTime - 60;
  2256. let endMinTime = totalVideoTime - 300;
  2257. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  2258. this.photoList.push(endTakeTime); //最后拍一张
  2259. }
  2260. } else {
  2261. //小于15分钟,只拍前后各一张
  2262. if (photoNum == 1) {
  2263. //开头拍1张
  2264. this.photoList.push(0);
  2265. } else if (photoNum == 3) {
  2266. this.photoList.push(1);
  2267. let centerTime = this.randomNum(
  2268. (1 / 3) * totalVideoTime,
  2269. (2 / 3) * totalVideoTime
  2270. );
  2271. this.photoList.push(centerTime);
  2272. let endTakeTime = this.randomNum(
  2273. (2 / 3) * totalVideoTime,
  2274. totalVideoTime
  2275. );
  2276. this.photoList.push(endTakeTime);
  2277. }
  2278. }
  2279. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  2280. }
  2281. //兼容已有观看历史
  2282. for (let i = 0; i < this.photoList.length - 1; i++) {
  2283. if (
  2284. this.photoList[i] < duration &&
  2285. this.photoList[i + 1] > duration
  2286. ) {
  2287. this.photoIndex = i + 1;
  2288. break;
  2289. }
  2290. if (duration > this.photoList[this.photoList.length - 1]) {
  2291. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  2292. break;
  2293. }
  2294. }
  2295. }
  2296. },
  2297. // 随机拍摄时间
  2298. randomConfig(totalVideoTime, duration) {
  2299. this.photoHistoryList = [];
  2300. let photoList = [duration];
  2301. let pre = duration;
  2302. if (totalVideoTime > 300) {
  2303. while (pre <= totalVideoTime) {
  2304. pre += this.randomNum(780, 900);
  2305. pre <= totalVideoTime && photoList.push(pre);
  2306. }
  2307. if (totalVideoTime - 300 > photoList.slice(-1)[0]) {
  2308. photoList.push(this.randomNum(totalVideoTime - 180, totalVideoTime));
  2309. }
  2310. }
  2311. return photoList;
  2312. },
  2313. getLiveUid(channelId) {
  2314. let self = this;
  2315. return new Promise((resolve) => {
  2316. let data = {
  2317. channelId: channelId,
  2318. orderGoodsId: this.orderGoodsId,
  2319. };
  2320. self.$api.polyvSign(data).then((res) => {
  2321. resolve(res.data.data);
  2322. });
  2323. });
  2324. },
  2325. timeEventLiving() {
  2326. if (plv != null) {
  2327. if (this.livePlay) {
  2328. this.liveDuration = this.liveDuration + 1; //每隔1秒
  2329. if (this.liveDuration == 2) {
  2330. //直播第2秒拍照
  2331. if (
  2332. this.goodsPhotographConfig &&
  2333. this.goodsPhotographConfig.livephotograph == 1 &&
  2334. this.channelItem.learning != 1 &&
  2335. this.photoHistoryList.length == 0
  2336. ) {
  2337. //开启直播拍照
  2338. this.openPhoto();
  2339. } else {
  2340. this.postStudyRecord(0);
  2341. }
  2342. }
  2343. }
  2344. }
  2345. },
  2346. playerLiveStatusChange(e) {
  2347. const status = e.detail.status;
  2348. if (status === "live") {
  2349. //开始播放
  2350. if (this.timer) {
  2351. clearInterval(this.timer);
  2352. }
  2353. this.livePlay = true;
  2354. this.timer = setInterval(this.timeEventLiving, 1000); //定时器
  2355. }
  2356. if (status === "end") {
  2357. this.hasStart = false;
  2358. if (this.livePlay) {
  2359. //只有播放过的结束才提交,避免未开播触发结束
  2360. this.postStudyRecord(1);
  2361. }
  2362. this.livePlay = false;
  2363. // 未开始
  2364. }
  2365. },
  2366. closePlv() {
  2367. if (plv) {
  2368. plv.destroy();
  2369. }
  2370. },
  2371. playChannel(item) {
  2372. if (this.timer) {
  2373. clearInterval(this.timer);
  2374. }
  2375. this.startStatus = true;
  2376. this.initLive();
  2377. },
  2378. setLiveOption(status) {
  2379. const { userId, channelId, recordFileSimpleModel, playbackEnabled } =
  2380. this.detail;
  2381. const playRecordFile =
  2382. playbackEnabled && recordFileSimpleModel && status === "end";
  2383. this.videoOption = {
  2384. mode: "live",
  2385. uid: this.liveObj.uid, //this.playChannelId egsxlptzdq
  2386. cid: this.playChannelId,
  2387. openId: this.userInfo.userAccount,
  2388. isAutoChange: false,
  2389. forceVideo: false,
  2390. };
  2391. },
  2392. async initLive() {
  2393. this.liveObj = await this.getLiveUid(this.playChannelId);
  2394. this.initLiveOk = true;
  2395. let optionsData = {};
  2396. optionsData.mode = "live";
  2397. optionsData.forceVideo = false;
  2398. optionsData.channelId = this.playChannelId; // 频道ID '2553128'
  2399. optionsData.openId = this.userInfo.userAccount; // 用户openId this.userInfo.userAccount 'oQ5eX5BCtSjkE1ct8CzvxGWgh0hQ'
  2400. optionsData.userId = this.liveObj.uid; // 2.0.0及以上版本的demo需要使用 userId 设置学员唯一id 'egsxlptzdq'
  2401. let self = this;
  2402. this.closePlv();
  2403. plv.init(optionsData).then(({ detail, chat }) => {
  2404. self.liveDetail = detail;
  2405. // 设置mode为live的videoOption
  2406. this.setLiveOption();
  2407. if (detail.isPPT) {
  2408. chat.on(chat.events.SLICESTART, () => {
  2409. // 开始直播
  2410. });
  2411. } else {
  2412. plv.api.getOrdinaryLiveStatus(detail.stream);
  2413. }
  2414. });
  2415. },
  2416. openSetting(res) {
  2417. console.log(res, 98);
  2418. },
  2419. getCameraSetting() {
  2420. const self = this;
  2421. // 不支持h5
  2422. wx.getSetting({
  2423. success: (res) => {
  2424. if (res.authSetting["scope.camera"]) {
  2425. // 用户已经授权
  2426. self.showSet = false;
  2427. this.prendreAutoCarme = false;
  2428. } else {
  2429. this.prendreAutoCarme = true;
  2430. // 用户还没有授权,向用户发起授权请求
  2431. wx.authorize({
  2432. scope: "scope.camera",
  2433. success: () => {
  2434. // 用户同意授权
  2435. self.showSet = false;
  2436. this.prendreAutoCarme = false;
  2437. },
  2438. fail: () => {
  2439. // 用户不同意授权
  2440. self.showSet = true;
  2441. },
  2442. });
  2443. }
  2444. },
  2445. fail: (res) => {},
  2446. });
  2447. },
  2448. studyNotice() {
  2449. this.noticeShow = true;
  2450. },
  2451. //播放笔记视频
  2452. async playNoteVideo(item) {
  2453. if (this.timer) {
  2454. clearInterval(this.timer);
  2455. }
  2456. if (this.vid) {
  2457. //切换视频
  2458. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2459. polyvPlayerContext.changeVid(item.recordingUrl);
  2460. } else {
  2461. this.vid = item.recordingUrl;
  2462. }
  2463. this.recordObj = { videoCurrentTime: item.noteSecond };
  2464. if (this.recordObj.videoCurrentTime) {
  2465. this.needSeek = true; //需要跳转到播放记录
  2466. }
  2467. this.startStatus = true;
  2468. //获取节笔记
  2469. this.getNoteList();
  2470. },
  2471. //正常播放视频
  2472. async playVideo(item) {
  2473. if (this.timer) {
  2474. clearInterval(this.timer);
  2475. }
  2476. // #ifdef H5
  2477. await this.clears();
  2478. // #endif
  2479. if (this.vid) {
  2480. //切换视频
  2481. polyvPlayerContext && polyvPlayerContext.changeVid(item.recordingUrl);
  2482. } else {
  2483. this.vid = item.recordingUrl;
  2484. }
  2485. this.recordObj = null;
  2486. this.recordObj = await this.getRecordLast();
  2487. this.needSeek = true; //跳转到播放记录
  2488. this.startStatus = true;
  2489. // #ifdef H5
  2490. await this.loadPlayerScript(this.loadPlayer);
  2491. // #endif
  2492. // 提交学习记录
  2493. // #ifdef MP-WEIXIN
  2494. this.postStudyRecord(0);
  2495. // #endif
  2496. //获取节笔记
  2497. this.getNoteList();
  2498. },
  2499. getRecordLast() {
  2500. return new Promise((resolve) => {
  2501. let data = {
  2502. gradeId:
  2503. this.gradeId || this.gradeId == 0 ? Number(this.gradeId) : null,
  2504. goodsId:
  2505. this.goodsId || this.goodsId == 0 ? Number(this.goodsId) : null,
  2506. sectionId: this.playSectionId || 0,
  2507. courseId:
  2508. this.courseId || this.courseId == 0 ? Number(this.courseId) : null,
  2509. chapterId: this.chapterId || 0,
  2510. moduleId: this.moduleId || 0,
  2511. orderGoodsId: this.orderGoodsId,
  2512. };
  2513. this.$api.recordLast(data).then((res) => {
  2514. resolve(res.data.data);
  2515. });
  2516. });
  2517. },
  2518. jumpNote(item) {
  2519. this.noteId = item.noteId;
  2520. //没视频播放
  2521. if (this.playSectionId == 0) {
  2522. this.$u.toast("即将跳到笔记位置");
  2523. this.$store.commit("setPlaySectionId", {
  2524. playSectionId: item.sectionId || item.menuId,
  2525. });
  2526. this.$store.commit("setPlayVID", { playVID: item.recordingUrl });
  2527. this.playNoteVideo(item);
  2528. } else {
  2529. //正在看当前笔记视频
  2530. this.$u.toast("即将跳到笔记位置");
  2531. //跳到笔记时刻
  2532. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2533. // #ifdef MP-WEIXIN
  2534. polyvPlayerContext.seek(item.noteSecond);
  2535. polyvPlayerContext.play();
  2536. // #endif
  2537. // #ifdef H5
  2538. polyvPlayerContext.j2s_seekVideo(0);
  2539. polyvPlayerContext.j2s_resumeVideo();
  2540. // #endif
  2541. }
  2542. },
  2543. postNote() {
  2544. let self = this;
  2545. if (!(this.playSectionId > 0)) {
  2546. this.$u.toast("目前无播放视频");
  2547. return;
  2548. }
  2549. if (!this.noteValue) {
  2550. this.$u.toast("请输入内容");
  2551. return;
  2552. }
  2553. if (!this.gradeId) {
  2554. this.$u.toast("暂无班级数据");
  2555. return;
  2556. }
  2557. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2558. let noteDate = this.$method.getZeroTime();
  2559. let noteSecond = 0;
  2560. // #ifdef MP-WEIXIN
  2561. noteSecond = polyvPlayerContext.getCurrentTime();
  2562. // #endif
  2563. // #ifdef H5
  2564. noteSecond = polyvPlayerContext.j2s_getCurrentTime();
  2565. // #endif
  2566. if (!noteSecond) {
  2567. if (noteSecond == 0) {
  2568. //播放结束
  2569. // #ifdef MP-WEIXIN
  2570. noteSecond = polyvPlayerContext.getDuration();
  2571. // #endif
  2572. // #ifdef H5
  2573. noteSecond = polyvPlayerContext.j2s_getCurrentTime();
  2574. // #endif
  2575. }
  2576. if (!noteSecond) {
  2577. this.$u.toast("视频暂未开始");
  2578. return;
  2579. }
  2580. }
  2581. let data = {
  2582. gradeId: this.gradeId,
  2583. goodsId: this.goodsId,
  2584. sectionId: this.playSectionId,
  2585. courseId: this.courseId,
  2586. noteText: this.noteValue,
  2587. noteDate: noteDate,
  2588. noteSecond: noteSecond,
  2589. orderGoodsId: this.orderGoodsId,
  2590. };
  2591. this.$api.postNote(data).then((res) => {
  2592. if (res.data.code == 200) {
  2593. this.$u.toast("发布成功");
  2594. self.getNoteList();
  2595. this.noteValue = "";
  2596. }
  2597. });
  2598. },
  2599. getGradeInfo() {
  2600. let self = this;
  2601. this.$store.state.allowLoading = false;
  2602. this.$api.goodsGradeInfo(this.gradeId).then((res) => {
  2603. if (res.data.code == 200) {
  2604. self.gradeDetail = res.data.data;
  2605. if (self.needProfileModal) {
  2606. return;
  2607. }
  2608. if (self.gradeDetail.learningStatus == 2) {
  2609. uni.showModal({
  2610. showCancel: false,
  2611. confirmText: "确定",
  2612. content:
  2613. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  2614. success: function (resultst) {
  2615. uni.navigateBack();
  2616. },
  2617. });
  2618. }
  2619. if (
  2620. self.gradeDetail.learningStatus == 3 &&
  2621. Number(self.gradeDetail.learningTimeStart) >
  2622. Number(new Date() / 1000)
  2623. ) {
  2624. uni.showModal({
  2625. showCancel: false,
  2626. cancelText: "返回",
  2627. content:
  2628. "当前课程正在申请中,正式开班后方可进行学习,请耐心等候!",
  2629. success: function (resultst) {
  2630. uni.navigateBack();
  2631. },
  2632. });
  2633. }
  2634. }
  2635. });
  2636. this.$store.state.allowLoading = true;
  2637. },
  2638. getNoteList() {
  2639. let self = this;
  2640. self.noteList = [];
  2641. let data = {
  2642. courseId: this.courseId,
  2643. gradeId: this.gradeId,
  2644. goodsId: this.goodsId,
  2645. orderGoodsId: this.orderGoodsId,
  2646. };
  2647. if (this.playSectionId > 0) {
  2648. data.sectionId = this.playSectionId;
  2649. }
  2650. this.$api.noteList(data).then((res) => {
  2651. if (res.data.code == 200) {
  2652. self.noteList = res.data.rows;
  2653. }
  2654. });
  2655. },
  2656. delAnswer(answerId) {
  2657. let self = this;
  2658. let data = {
  2659. answerId: answerId,
  2660. status: -1,
  2661. orderGoodsId: this.orderGoodsId,
  2662. };
  2663. this.$api.delAnswer(data).then((res) => {
  2664. if (res.data.code == 200) {
  2665. self.getAnswerList();
  2666. }
  2667. });
  2668. },
  2669. clearCtx() {
  2670. this.placeholder = "您可以在这里输入答疑内容";
  2671. this.ctxValue = "";
  2672. this.assignUserId = 0;
  2673. },
  2674. focusNote(event) {
  2675. this.bottomHeight = event.detail.height;
  2676. },
  2677. blurNote() {
  2678. this.bottomHeight = 0;
  2679. },
  2680. blur() {
  2681. this.bottomHeight = 0;
  2682. this.clearTimer = setTimeout(() => {
  2683. this.ctxValue = "";
  2684. this.isFocus = false;
  2685. this.assignUserId = 0;
  2686. this.placeholder = "您可以在这里输入答疑内容";
  2687. }, 2000);
  2688. },
  2689. replyContent(item) {
  2690. this.isFocus = true;
  2691. this.assignUserId = item.userId;
  2692. this.placeholder = "@" + item.realname;
  2693. },
  2694. delContent(item) {
  2695. this.delAnswer(item.answerId);
  2696. },
  2697. postAnswer() {
  2698. let self = this;
  2699. let data = {
  2700. courseId: this.courseId,
  2701. answerText: this.ctxValue,
  2702. goodsId: this.goodsId,
  2703. orderGoodsId: this.orderGoodsId,
  2704. };
  2705. if (this.assignUserId > 0) {
  2706. data.assignUserId = this.assignUserId;
  2707. }
  2708. this.$api.postAnswer(data).then((res) => {
  2709. if (res.data.code == 200) {
  2710. this.$u.toast("发布成功");
  2711. self.getAnswerList();
  2712. this.isFocus = false;
  2713. this.placeholder = "您可以在这里输入答疑内容";
  2714. this.ctxValue = "";
  2715. this.assignUserId = 0;
  2716. }
  2717. });
  2718. },
  2719. postContent() {
  2720. if (!this.ctxValue || this.ctxValue == "") {
  2721. this.$u.toast("请输入内容");
  2722. return;
  2723. }
  2724. this.postAnswer();
  2725. },
  2726. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  2727. let currentTime = 0;
  2728. let PlayDuration = 0;
  2729. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2730. if (polyvPlayerContext) {
  2731. // #ifdef MP-WEIXIN
  2732. currentTime = polyvPlayerContext.getCurrentTime(); //获取视频当前的播放时刻
  2733. PlayDuration = polyvPlayerContext.getVideoPlayDuration(); //本次看的时长
  2734. // #endif
  2735. // #ifdef H5
  2736. currentTime = polyvPlayerContext.j2s_getCurrentTime(); //当前视频播放时刻
  2737. PlayDuration = polyvPlayerContext.j2s_realPlayVideoTime(); //本次看的时长
  2738. // #endif
  2739. }
  2740. if (this.playChannelId > 0) {
  2741. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  2742. }
  2743. let self = this;
  2744. let data = {
  2745. fromPlat: 1, //来源平台 1小程序 2网站
  2746. photo: self.ossAvatarUrl,
  2747. sectionId: sectionId || 0,
  2748. goodsId: parseInt(self.goodsId),
  2749. courseId: parseInt(self.courseId),
  2750. orderGoodsId: this.orderGoodsId,
  2751. studyDuration: parseInt(
  2752. PlayDuration > 0 ? PlayDuration : self.studyDuration
  2753. ),
  2754. gradeId: parseInt(self.gradeId),
  2755. chapterId: this.chapterId || 0,
  2756. moduleId: this.moduleId || 0,
  2757. videoCurrentTime: parseInt(
  2758. currentTime > 0 ? currentTime : self.studyDuration
  2759. ),
  2760. };
  2761. if (this.ossAvatarUrl) {
  2762. data.similarity = this.compareFaceData; // 相似度
  2763. }
  2764. if (status > 0) {
  2765. data.status = status;
  2766. }
  2767. console.log(data, "记录参数");
  2768. return new Promise((resolve, reject) => {
  2769. this.$api
  2770. .studyRecord(data)
  2771. .then((res) => {
  2772. console.log(res, "记录返回");
  2773. let { code } = res.data;
  2774. if (code == 200) {
  2775. if (status > 0) {
  2776. this.studyRecordMenuAllList();
  2777. let moduleId = this.moduleId || 0;
  2778. let chapterId = this.chapterId || 0;
  2779. let playNextIdisRebuild = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}isRebuild`;
  2780. let playNextId = `moduleId${moduleId}chapterId${chapterId}sectionId${sectionId}`; //拼接对应章节唯一id
  2781. uni.$emit("playNext" + playNextIdisRebuild, {
  2782. fromRebuild: this.isRebuild,
  2783. }); //通知播放结束,不来自重修目录的点击不用弹窗学习下一节
  2784. uni.$emit("playNext" + playNextId); //通知播放结束
  2785. }
  2786. self.ossAvatarUrl = "";
  2787. } else {
  2788. this.uploadLock = false;
  2789. uni.showToast({
  2790. icon: "none",
  2791. title: res.data.msg,
  2792. duration: 2000,
  2793. });
  2794. if (this.erJianErZao && code == 559) {
  2795. this.isReach = true;
  2796. this.openPhoto();
  2797. }
  2798. if (code == 559 || code == 588) {
  2799. reject("中断执行");
  2800. }
  2801. }
  2802. resolve();
  2803. })
  2804. .catch((err) => {
  2805. this.studyRecordMenuAllList();
  2806. });
  2807. });
  2808. },
  2809. uploadFile(options, int) {
  2810. var self = this;
  2811. return new Promise((resolve, reject) => {
  2812. var data = {
  2813. imageStatus: int,
  2814. gradeId: this.gradeId,
  2815. orderGoodsId: this.orderGoodsId,
  2816. };
  2817. self.$api.aliyunpolicy(data).then((res) => {
  2818. if (res.data.code != 200) {
  2819. self.$method.showToast("签名错误" + JSON.stringify(res.data));
  2820. return;
  2821. }
  2822. var ossToken = res.data.data.resultContent;
  2823. if (ossToken.host == null || ossToken.host == undefined) {
  2824. self.$method.showToast("上传路径报错" + JSON.stringify(res.data));
  2825. return;
  2826. }
  2827. let filePath = "";
  2828. // #ifdef H5
  2829. var localData = options; //dataUrl为base64位
  2830. let base = atob(localData.substring(localData.indexOf(",") + 1)); // base是将base64编码解码,去掉data:image/png;base64部分
  2831. let length = base.length;
  2832. let url = new Uint8Array(length);
  2833. while (length--) {
  2834. url[length] = base.charCodeAt(length);
  2835. }
  2836. filePath = new File([url], "a.jpg", {
  2837. type: "image/jpg",
  2838. });
  2839. uni.uploadFile({
  2840. url: ossToken.host,
  2841. name: "file",
  2842. file: filePath,
  2843. fileType: "image",
  2844. header: {
  2845. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  2846. },
  2847. formData: {
  2848. key: ossToken.dir,
  2849. OSSAccessKeyId: ossToken.accessid,
  2850. policy: ossToken.policy,
  2851. Signature: ossToken.signature,
  2852. callback: ossToken.callback,
  2853. success_action_status: 200,
  2854. },
  2855. success: (result) => {
  2856. this.$u.toast("上传成功");
  2857. self.ossAvatarUrl = ossToken.dir;
  2858. resolve();
  2859. },
  2860. fail: (error) => {
  2861. uni.showToast({
  2862. title: "上传接口报错,请重新拍照上传" + error,
  2863. icon: "none",
  2864. });
  2865. this.openPhoto();
  2866. return;
  2867. },
  2868. });
  2869. // #endif
  2870. // #ifdef MP-WEIXIN
  2871. uni.uploadFile({
  2872. url: ossToken.host,
  2873. name: "file",
  2874. filePath: options,
  2875. fileType: "image",
  2876. header: {
  2877. AuthorizationToken: "WX " + uni.getStorageSync("token"),
  2878. },
  2879. formData: {
  2880. key: ossToken.dir,
  2881. OSSAccessKeyId: ossToken.accessid,
  2882. policy: ossToken.policy,
  2883. Signature: ossToken.signature,
  2884. callback: ossToken.callback,
  2885. success_action_status: 200,
  2886. },
  2887. success: (result) => {
  2888. // if (result.statusCode === 200) {
  2889. this.$u.toast("上传成功");
  2890. self.ossAvatarUrl = ossToken.dir;
  2891. resolve();
  2892. },
  2893. fail: (error) => {
  2894. uni.showToast({
  2895. title: "上传接口报错,请重新拍照上传" + error,
  2896. icon: "none",
  2897. });
  2898. this.openPhoto();
  2899. return;
  2900. },
  2901. });
  2902. // #endif
  2903. });
  2904. });
  2905. },
  2906. imageInfos() {
  2907. var self = this;
  2908. return new Promise(async (resolve, reject) => {
  2909. // #ifdef MP-WEIXIN
  2910. uni.getImageInfo({
  2911. src: self.avatarUrl,
  2912. success: async (res) => {
  2913. let canvasWidth = res.width; //图片原始长宽
  2914. let canvasHeight = res.height;
  2915. if (canvasWidth > 2000 || canvasHeight > 2000) {
  2916. // h5不支持
  2917. uni.compressImage({
  2918. src: self.avatarUrl,
  2919. quality: 75,
  2920. width: "35%",
  2921. height: "35%",
  2922. success: async (rest) => {
  2923. const waitUpload = await self.uploadFile(
  2924. rest.tempFilePath,
  2925. 0
  2926. );
  2927. resolve(waitUpload);
  2928. },
  2929. });
  2930. } else if (canvasWidth > 1000 || canvasHeight > 1000) {
  2931. uni.compressImage({
  2932. src: self.avatarUrl,
  2933. quality: 75,
  2934. width: "50%",
  2935. height: "50%",
  2936. success: async (rest) => {
  2937. const waitUpload = await self.uploadFile(
  2938. rest.tempFilePath,
  2939. 0
  2940. );
  2941. resolve(waitUpload);
  2942. },
  2943. });
  2944. } else {
  2945. const waitUpload = await self.uploadFile(self.avatarUrl, 0);
  2946. resolve(waitUpload);
  2947. }
  2948. },
  2949. fail: (err) => {
  2950. this.$u.toast("图片上传失败");
  2951. },
  2952. });
  2953. // #endif
  2954. // #ifdef H5
  2955. const waitUpload = await this.uploadFile(this.faceUrl, 0);
  2956. resolve(waitUpload);
  2957. // #endif
  2958. });
  2959. },
  2960. timeEvent() {
  2961. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  2962. if (polyvPlayerContext != null) {
  2963. // #ifdef MP-WEIXIN
  2964. this.playTime = polyvPlayerContext.getCurrentTime(); //播放时刻
  2965. // #endif
  2966. // #ifdef H5
  2967. this.playTime = polyvPlayerContext.j2s_getCurrentTime();
  2968. // #endif
  2969. this.configPhoto();
  2970. console.info(this.photoList, "photoList");
  2971. let photoTime = 0; //获取拍照秒数
  2972. for (let i = 0; i < this.photoList.length; i++) {
  2973. photoTime = Number(this.photoList[i]); //获取拍照秒数
  2974. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  2975. //3秒区间内才触发拍照,避免拉动滚动条
  2976. if (this.photoHistoryList.indexOf(i) < 0) {
  2977. //不存在拍照历史,没有重修过,没有学过,则拍照
  2978. //启动拍照
  2979. //暂停
  2980. console.log("去拍照");
  2981. // #ifdef MP-WEIXIN
  2982. polyvPlayerContext.exitFullScreen();
  2983. polyvPlayerContext.pause();
  2984. // #endif
  2985. // #ifdef H5
  2986. polyvPlayerContext.j2s_pauseVideo();
  2987. polyvPlayerContext.toggleFullscreen();
  2988. // #endif
  2989. this.photoIndex = i;
  2990. if (
  2991. uni.getStorageSync(`tabkePhotoShow${this.goodsId}`) ==
  2992. this.goodsId
  2993. ) {
  2994. this.openPhoto();
  2995. } else {
  2996. this.popupPhotoShow = true;
  2997. uni.setStorageSync(
  2998. `tabkePhotoShow${this.goodsId}`,
  2999. this.goodsId
  3000. ); // 本地缓存用来判断是否已经弹出过弹窗
  3001. }
  3002. }
  3003. }
  3004. }
  3005. }
  3006. },
  3007. closeToast() {
  3008. clearTimeout(this.toastTimer);
  3009. this.videoToastShow = false;
  3010. },
  3011. restart() {
  3012. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3013. // #ifdef MP-WEIXIN
  3014. polyvPlayerContext.seek(0);
  3015. // #endif
  3016. // #ifdef H5
  3017. polyvPlayerContext.j2s_seekVideo(0);
  3018. // #endif
  3019. clearTimeout(this.toastTimer);
  3020. this.videoToastShow = false;
  3021. },
  3022. // 新增用户视频学习日志
  3023. studyLog() {
  3024. this.$http({
  3025. url: "/user/study/log",
  3026. method: "post",
  3027. data: {
  3028. goodsId: this.goodsId,
  3029. courseId: this.courseId,
  3030. moduleId: this.moduleId || 0,
  3031. chapterId: this.chapterId || 0,
  3032. sectionId: this.playSectionId || 0,
  3033. fromPlat: 1, //来源平台 1小程序 2PC网站
  3034. goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  3035. orderGoodsId: this.orderGoodsId,
  3036. },
  3037. }).then((res) => {});
  3038. },
  3039. async onStateChange(newstate, oldstate) {
  3040. polyvPlayerContext = this.selectComponent("#playerVideo");
  3041. if (newstate.detail.newstate == "playing") {
  3042. this.pauseTime = 0;
  3043. if (this.needSeek) {
  3044. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3045. if (this.recordObj.videoCurrentTime) {
  3046. polyvPlayerContext.seek(this.recordObj.videoCurrentTime);
  3047. this.seekTime = this.$method.secondToDate(
  3048. this.recordObj.videoCurrentTime
  3049. );
  3050. this.videoToastShow = true;
  3051. this.toastTimer = setTimeout(() => {
  3052. this.videoToastShow = false;
  3053. }, 3000);
  3054. } else {
  3055. polyvPlayerContext.seek(1); //避免相同节继续播放
  3056. }
  3057. polyvPlayerContext.play();
  3058. this.needSeek = false;
  3059. // 新增用户视频学习日志
  3060. this.studyLog();
  3061. // 提交学习记录
  3062. }
  3063. //开始播放
  3064. this.timer && clearInterval(this.timer);
  3065. if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
  3066. this.clearPauseTimer();
  3067. this.isReach = false;
  3068. this.timer = setInterval(this.timeEvent, 1000); //定时器
  3069. }
  3070. }
  3071. if (newstate.detail.newstate == "pause") {
  3072. console.log("暂停");
  3073. this.erJianErZaoPauseTip();
  3074. clearInterval(this.timer);
  3075. //暂停提交记录
  3076. }
  3077. if (newstate.detail.newstate == "ended") {
  3078. clearInterval(this.timer);
  3079. uni.showToast({
  3080. icon: "none",
  3081. title: "播放完毕",
  3082. });
  3083. this.hasStart = false;
  3084. await this.postStudyRecord(1);
  3085. this.nextSection();
  3086. // uni.$emit('playNext') //播放重修下一节
  3087. }
  3088. },
  3089. //播放下一节
  3090. nextSection() {
  3091. console.log("播放下一节");
  3092. if (!this.menuAllList.length) {
  3093. return;
  3094. }
  3095. this.curPlayIndex = this.menuAllList.findIndex((item) => {
  3096. let i_sectionId = item.sectionId || 0;
  3097. let i_chapterId = item.chapterId || 0;
  3098. let i_moduleId = item.moduleId || 0;
  3099. return (
  3100. i_sectionId == this.playSectionId &&
  3101. i_chapterId == this.chapterId &&
  3102. i_moduleId == this.moduleId
  3103. );
  3104. });
  3105. let data = this.menuAllList[this.curPlayIndex + 1];
  3106. if (!data) {
  3107. //第二个弹窗
  3108. uni.showModal({
  3109. title: "温馨提示",
  3110. content: "当前最后一节视频已学完 请检查所有章节是否学习完成?",
  3111. showCancel: false,
  3112. success: (res) => {
  3113. if (res.confirm) {
  3114. }
  3115. },
  3116. });
  3117. } else {
  3118. uni.showModal({
  3119. title: "温馨提示",
  3120. content: "当前节视频已学完,继续学习下一节?",
  3121. success: async (res) => {
  3122. if (res.confirm) {
  3123. this.moduleId = data.moduleId;
  3124. this.chapterId = data.chapterId;
  3125. this.sectionId = data.sectionId;
  3126. if (data.sectionType == 1) {
  3127. //录播
  3128. this.$store.commit("setPlaySectionId", {
  3129. playSectionId: data.sectionId,
  3130. });
  3131. this.$store.commit("setPlayVID", {
  3132. playVID: data.recordingUrl,
  3133. });
  3134. this.hasStart = false;
  3135. this.photoConfig = false;
  3136. this.photoIndex = 0;
  3137. this.sectionItem = data;
  3138. await this.getPhotoLastRecord(); // 获取拍照历史
  3139. this.playVideo(data);
  3140. } else if (data.sectionType == 2) {
  3141. //直播
  3142. this.studyRecordGetLastLive();
  3143. } else if (data.sectionType == 3) {
  3144. //回放
  3145. this.$store.commit("setPlaySectionId", {
  3146. playSectionId: data.sectionId,
  3147. });
  3148. this.$store.commit("setPlayVID", {
  3149. playVID: data.recordingUrl,
  3150. });
  3151. this.sectionItem = data;
  3152. this.playVideo(data);
  3153. }
  3154. let playNextId = `moduleId${data.moduleId}chapterId${data.chapterId}sectionId${data.sectionId}`;
  3155. this.$store.commit("updatePlayNextId", playNextId);
  3156. this.updateChapterOpen(true);
  3157. this.reStart = false;
  3158. this.getMenuList();
  3159. }
  3160. },
  3161. });
  3162. }
  3163. },
  3164. //拍照
  3165. openPhoto() {
  3166. if (polyvPlayerContext) {
  3167. // #ifdef MP-WEIXIN
  3168. polyvPlayerContext.exitFullScreen();
  3169. // #endif
  3170. // #ifdef H5
  3171. if (this.isFullScreen()) {
  3172. this.exitFullscreen();
  3173. }
  3174. // #endif
  3175. }
  3176. // #ifdef MP-WEIXIN
  3177. this.enableAutoRotation = false;
  3178. this.photoPopup = true;
  3179. this.isTaking = true;
  3180. uni.setKeepScreenOn({
  3181. keepScreenOn: true,
  3182. });
  3183. uni.authorize({
  3184. scope: "scope.camera",
  3185. success() {},
  3186. });
  3187. // #endif
  3188. // #ifdef H5
  3189. if (
  3190. (window.navigator.mediaDevices &&
  3191. window.navigator.mediaDevices.getUserMedia) ||
  3192. window.navigator.getUserMedia ||
  3193. window.navigator.webkitGetUserMedia ||
  3194. window.navigator.mozGetUserMedia
  3195. ) {
  3196. console.log("getUserMedia----");
  3197. // 调用用户媒体设备, 访问摄像头
  3198. this.getUserMedia(
  3199. {
  3200. video: {
  3201. width: 400,
  3202. height: 300,
  3203. },
  3204. },
  3205. this.photographSuccess,
  3206. this.photographError
  3207. );
  3208. } else {
  3209. console.log("1111没有摄像");
  3210. this.photographError();
  3211. }
  3212. // #endif
  3213. },
  3214. /**
  3215. * 人脸匹配
  3216. */
  3217. faceRecognition() {
  3218. return new Promise((resolve) => {
  3219. // #ifdef MP-WEIXIN
  3220. let fileSystem = uni.getFileSystemManager();
  3221. fileSystem.readFile({
  3222. filePath: `${this.avatarUrl}`,
  3223. encoding: "base64",
  3224. position: 0,
  3225. success: (res) => {
  3226. let base64 = "data:image/jpg;base64," + res.data;
  3227. // console.log('base64Data人脸识别参数:', {
  3228. // imageA: base64,
  3229. // orderGoodsId: this.orderGoodsId,
  3230. // gradeId: this.gradeId,
  3231. // })
  3232. this.CompareFace(base64, resolve);
  3233. },
  3234. fail(err) {
  3235. // this.$u.toast('人脸识别错误!')
  3236. console.error(err, "err-----人脸识别错误");
  3237. },
  3238. });
  3239. // #endif
  3240. // #ifdef H5
  3241. this.CompareFace(this.faceUrl, resolve);
  3242. // #endif
  3243. });
  3244. },
  3245. CompareFace(url, resolve) {
  3246. let timer = setTimeout(() => {
  3247. uni.showToast({
  3248. icon: "none",
  3249. title: "拍照超时,请重新拍照",
  3250. duration: 2000,
  3251. success: () => {
  3252. setTimeout(() => {
  3253. uni.navigateBack();
  3254. }, 1000);
  3255. },
  3256. });
  3257. }, 10 * 1000);
  3258. this.$api
  3259. .faceCertificationCompareFace({
  3260. imageA: url,
  3261. orderGoodsId: this.orderGoodsId,
  3262. gradeId: this.gradeId,
  3263. })
  3264. .then((res) => {
  3265. clearTimeout(timer);
  3266. console.log(res, "人脸识别成功res");
  3267. resolve(res.data.data);
  3268. })
  3269. .catch((err) => {
  3270. clearTimeout(timer);
  3271. // 当前网络延迟,
  3272. console.log("人脸识别错误:", err);
  3273. uni.showModal({
  3274. content: "当前网络延迟",
  3275. showCancel: false,
  3276. success: (resultst) => {
  3277. if (resultst.confirm) {
  3278. uni.navigateBack();
  3279. }
  3280. },
  3281. });
  3282. });
  3283. },
  3284. // 确定拍照
  3285. async submit() {
  3286. if (this.uploadLock) {
  3287. return;
  3288. }
  3289. this.uploadLock = true;
  3290. let compareFaceData = await this.faceRecognition();
  3291. console.log(compareFaceData, "compareFaceData");
  3292. this.compareFaceData = compareFaceData;
  3293. if (compareFaceData >= 80) {
  3294. const waitYS = await this.imageInfos();
  3295. this.postCoursePhotoRecord()
  3296. .then(async (res) => {
  3297. this.photoHistoryList.push(this.photoIndex);
  3298. // console.log('拍照确定提交', this.photoHistoryList);
  3299. this.postStudyRecord(); //提交记录
  3300. if (this.erJianErZao && this.isReach) {
  3301. console.log("1校验")
  3302. await this.postStudyRecord(1);
  3303. this.photoPopup = false;
  3304. this.uploadLock = false;
  3305. this.enableAutoRotation = true;
  3306. this.nextSection();
  3307. return;
  3308. }
  3309. //恢复播放
  3310. // #ifdef MP-WEIXIN
  3311. uni.setKeepScreenOn({
  3312. keepScreenOn: false,
  3313. });
  3314. // #endif
  3315. this.photoPopup = false;
  3316. this.uploadLock = false;
  3317. this.enableAutoRotation = true;
  3318. // var polyvPlayerContext = this.selectComponent("#playerVideo");
  3319. if (polyvPlayerContext != null) {
  3320. // #ifdef MP-WEIXIN
  3321. polyvPlayerContext.play();
  3322. // #endif
  3323. // #ifdef H5
  3324. polyvPlayerContext.j2s_resumeVideo();
  3325. // #endif
  3326. }
  3327. })
  3328. .catch((err) => {
  3329. console.log("拍照记录接口的err", err);
  3330. uni.showToast({
  3331. title: "上传接口报错,请重新拍照上传" + err,
  3332. icon: "none",
  3333. });
  3334. this.uploadLock = false;
  3335. this.openPhoto();
  3336. });
  3337. } else {
  3338. uni.showToast({
  3339. title: "人脸匹配不通过,请重新拍照上传",
  3340. icon: "none",
  3341. duration: 2000,
  3342. });
  3343. setTimeout(() => {
  3344. this.uploadLock = false;
  3345. this.openPhoto();
  3346. }, 2000);
  3347. }
  3348. },
  3349. reTake() {
  3350. this.isTaking = true;
  3351. // #ifdef H5
  3352. this.faceUrl = "";
  3353. this.getUserMedia(
  3354. {
  3355. video: {
  3356. width: 400,
  3357. height: 300,
  3358. },
  3359. },
  3360. this.photographSuccess,
  3361. this.photographError
  3362. );
  3363. // #endif
  3364. },
  3365. toTakePhoto() {
  3366. this.popupPhotoShow = false;
  3367. this.openPhoto();
  3368. },
  3369. takePhTips() {
  3370. this.popupPhotoShow = true;
  3371. this.isTaking = false;
  3372. this.photoPopup = false;
  3373. this.enableAutoRotation = false;
  3374. },
  3375. //确认拍照
  3376. takePhoto() {
  3377. // #ifdef MP-WEIXIN
  3378. const ctx = uni.createCameraContext();
  3379. ctx.takePhoto({
  3380. quality: "high",
  3381. success: (res) => {
  3382. this.avatarUrl = res.tempImagePath;
  3383. console.log("开始拍照this.avatarUrl:", this.avatarUrl);
  3384. this.isTaking = false;
  3385. },
  3386. fail: (err) => {},
  3387. });
  3388. // #endif
  3389. // #ifdef H5
  3390. const canvas = document.createElement("canvas");
  3391. canvas.width = 400;
  3392. canvas.height = 400;
  3393. const context = canvas.getContext("2d");
  3394. const video = document.querySelector("video");
  3395. context.drawImage(video, 0, 0, 400, 400);
  3396. this.faceUrl = canvas.toDataURL("image/png");
  3397. this.isTaking = false;
  3398. // #endif
  3399. },
  3400. playError(e) {
  3401. console.log(e);
  3402. },
  3403. //拍照报错
  3404. error(e) {
  3405. console.log(e.detail);
  3406. },
  3407. //关闭相机
  3408. closePhoto() {
  3409. this.photoPopup = false;
  3410. self.enableAutoRotation = true;
  3411. },
  3412. /**
  3413. * 进入全屏
  3414. */
  3415. fullscreenchange(event) {
  3416. if (event.detail.direction == "vertical") {
  3417. this.navShow = true;
  3418. } else if (event.detail.direction == "horizontal") {
  3419. this.navShow = false;
  3420. }
  3421. },
  3422. getGoodsDetail() {
  3423. let self = this;
  3424. // '/goods/'+ data,
  3425. this.$api.goodsDetail(this.goodsId).then((res) => {
  3426. this.goodsData = res.data.data;
  3427. if (self.goodsData.buyNote) {
  3428. this.baseHandoutTipList();
  3429. }
  3430. self.gradeId = self.goodsData.gradeId;
  3431. this.courseBusiness(this.goodsData.businessId);
  3432. this.courseHandouts();
  3433. self.getMenuList();
  3434. self.getReMenuList(); //获取重修目录
  3435. setTimeout(function () {
  3436. if (!self.needProfileModal) {
  3437. self.getGradeInfo();
  3438. }
  3439. }, 500);
  3440. //获取节笔记
  3441. this.getNoteList();
  3442. if (self.goodsData.goodsPlayConfig) {
  3443. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  3444. if (self.goodsPlayConfig.autoPlay > 0) {
  3445. // #ifdef H5
  3446. self.autoplay = true;
  3447. // #endif
  3448. }
  3449. if (self.goodsPlayConfig.drag > 0) {
  3450. // #ifdef MP-WEIXIN
  3451. self.isAllowSeek = "yes";
  3452. // #endif
  3453. // #ifdef H5
  3454. self.H5isAllowSeek = "off";
  3455. // #endif
  3456. }
  3457. if (self.goodsPlayConfig.speed > 0) {
  3458. self.playbackRate = [0.5, 0.8, 1.0, 1.25, 1.5, 2.0];
  3459. }
  3460. }
  3461. self.erJianErZao = self.goodsData.erJianErZao;
  3462. if (self.goodsData.goodsPhotographConfig) {
  3463. self.goodsPhotographConfig = JSON.parse(
  3464. self.goodsData.goodsPhotographConfig
  3465. );
  3466. if (self.goodsPhotographConfig.photoNum > 0) {
  3467. self.photoNum = self.goodsPhotographConfig.photoNum;
  3468. }
  3469. }
  3470. });
  3471. },
  3472. startVideo() {
  3473. this.startStatus = true;
  3474. },
  3475. getAnswerList() {
  3476. let self = this;
  3477. this.$api
  3478. .answerList({
  3479. courseId: this.courseId,
  3480. goodsId: this.goodsId,
  3481. orderGoodsId: this.orderGoodsId,
  3482. })
  3483. .then((res) => {
  3484. if (res.data.code == 200) {
  3485. self.answerList = res.data.rows;
  3486. }
  3487. });
  3488. },
  3489. getReMenuList() {
  3490. // console.log('重修的目录');
  3491. let self = this;
  3492. this.$api
  3493. .reMenuList({
  3494. orderGoodsId: this.orderGoodsId,
  3495. courseId: this.courseId,
  3496. rebuild: 1,
  3497. gradeId: this.gradeId,
  3498. })
  3499. .then((res) => {
  3500. if (res.data.code == 200) {
  3501. for (let i = 0; i < res.data.rows.length; i++) {
  3502. let item = res.data.rows[i];
  3503. item.down = true;
  3504. item.id = item.menuId;
  3505. item.name = item.menuName;
  3506. }
  3507. self.reMenuList = res.data.rows;
  3508. if (self.reMenuList.length > 0) {
  3509. this.showNotes = false;
  3510. self.list = [
  3511. {
  3512. name: "目录",
  3513. },
  3514. {
  3515. name: "讲义",
  3516. },
  3517. {
  3518. name: "笔记",
  3519. },
  3520. {
  3521. name: "答疑",
  3522. },
  3523. { name: "重修目录" },
  3524. ];
  3525. this.current = 0;
  3526. if (Object.keys(this.sectionItem).length) {
  3527. let playNextIdisRebuild = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}isRebuild`;
  3528. this.$store.commit("updatePlayNextId", playNextIdisRebuild);
  3529. }
  3530. } else {
  3531. if (Object.keys(this.sectionItem).length) {
  3532. let playNextId = `moduleId${this.sectionItem.moduleId}chapterId${this.sectionItem.chapterId}sectionId${this.sectionItem.sectionId}`;
  3533. this.$store.commit("updatePlayNextId", playNextId);
  3534. }
  3535. self.list = [
  3536. {
  3537. name: "目录",
  3538. },
  3539. {
  3540. name: "讲义",
  3541. },
  3542. {
  3543. name: "笔记",
  3544. },
  3545. {
  3546. name: "答疑",
  3547. },
  3548. ];
  3549. this.current = 0;
  3550. }
  3551. }
  3552. });
  3553. },
  3554. getMenuList() {
  3555. // console.log('menuList的目录');
  3556. let self = this;
  3557. // /course/menuList 查询课程目录结构列表
  3558. this.$api
  3559. .reMenuList({
  3560. courseId: this.courseId,
  3561. gradeId: this.gradeId,
  3562. orderGoodsId: this.orderGoodsId,
  3563. })
  3564. .then((res) => {
  3565. if (res.data.code == 200) {
  3566. for (let i = 0; i < res.data.rows.length; i++) {
  3567. let item = res.data.rows[i];
  3568. item.down = true;
  3569. item.id = item.menuId;
  3570. item.name = item.menuName;
  3571. item.menuType = item.type;
  3572. }
  3573. self.menuList = res.data.rows;
  3574. this.reStart = true;
  3575. for (let i = 0; i < res.data.rows.length; i++) {
  3576. if (res.data.rows[i].type == 1) {
  3577. // 模块
  3578. if (Object.keys(this.sectionItem).length) {
  3579. if (res.data.rows[i].menuId == this.sectionItem.moduleId) {
  3580. this.menuIndex = [i];
  3581. break;
  3582. }
  3583. } else {
  3584. this.menuIndex = [i];
  3585. break;
  3586. }
  3587. } else if (res.data.rows[i].type == 2) {
  3588. // 章
  3589. if (Object.keys(this.sectionItem).length) {
  3590. if (
  3591. res.data.rows[i].menuId == this.sectionItem.chapterId &&
  3592. (!this.sectionItem.moduleId ||
  3593. this.sectionItem.moduleId == 0)
  3594. ) {
  3595. this.menuIndex = [i];
  3596. break;
  3597. }
  3598. } else {
  3599. this.menuIndex = [i];
  3600. break;
  3601. }
  3602. }
  3603. }
  3604. // console.log('menuList: ---', this.menuList, 'menuIndex:', this.menuIndex);
  3605. }
  3606. });
  3607. },
  3608. courseDetail() {
  3609. let self = this;
  3610. // '/course/'+data,
  3611. this.$api.courseDetail(this.courseId).then((res) => {
  3612. if (res.data.code == 200) {
  3613. // if (res.data.data.educationName == "继续教育") {
  3614. this.$api
  3615. .lockLockAction({
  3616. action: "jxjy",
  3617. uuid: this.$method.getUuid(),
  3618. })
  3619. .then((res) => {});
  3620. this.lockTimer = setInterval(() => {
  3621. this.$api
  3622. .lockLockAction({
  3623. action: "jxjy",
  3624. uuid: this.$method.getUuid(),
  3625. })
  3626. .then((res) => {});
  3627. }, 10000);
  3628. // websocket.sendMsg("doCourse");
  3629. // }
  3630. self.detail = res.data.data;
  3631. }
  3632. });
  3633. },
  3634. open(item) {
  3635. item.showChildren = !item.showChildren;
  3636. },
  3637. change(index) {
  3638. this.current = index;
  3639. },
  3640. openDocument(item) {
  3641. let url = this.$method.splitImgHost(item.url);
  3642. // #ifdef H5
  3643. window.location.href = url;
  3644. // #endif
  3645. // #ifdef MP-WEIXIN
  3646. this.downLoading = true;
  3647. uni.downloadFile({
  3648. url: url,
  3649. success: (res) => {
  3650. var filePath = res.tempFilePath;
  3651. // h5不支持
  3652. uni.openDocument({
  3653. filePath: filePath,
  3654. fileType: "pdf",
  3655. showMenu: item.canDownload == 1 ? true : false,
  3656. success: (res) => {
  3657. this.downLoading = false;
  3658. uni.setStorageSync("current", this.current);
  3659. },
  3660. fail: (err) => {
  3661. this.downLoading = false;
  3662. uni.showToast({
  3663. icon: "none",
  3664. title: "文档地址错误",
  3665. });
  3666. },
  3667. });
  3668. },
  3669. fail: (err) => {
  3670. this.downLoading = false;
  3671. uni.showModal({
  3672. title: "提示",
  3673. content: "文档错误," + err.errMsg,
  3674. showCancel: false,
  3675. });
  3676. },
  3677. });
  3678. // #endif
  3679. },
  3680. clickMulu() {
  3681. this.muluStyle = !this.muluStyle;
  3682. },
  3683. loadPlayerScript(callback) {
  3684. if (!window.polyvPlayer) {
  3685. const myScript = document.createElement("script");
  3686. myScript.setAttribute("src", this.vodPlayerJs);
  3687. myScript.onload = callback;
  3688. document.body.appendChild(myScript);
  3689. } else {
  3690. callback();
  3691. }
  3692. },
  3693. // 播放视频
  3694. loadPlayer() {
  3695. const polyvPlayer = window.polyvPlayer;
  3696. this.pauseTime = 0;
  3697. this.$api.polyvVideoSign(this.vid).then(async (res) => {
  3698. this.player = await polyvPlayer({
  3699. wrap: "#player",
  3700. width: "100%",
  3701. showLine: "off",
  3702. height: 218,
  3703. ban_history_time: "on",
  3704. vid: this.vid,
  3705. forceH5: true,
  3706. autoplay: this.autoplay, // 自动播放
  3707. ban_seek: this.H5isAllowSeek, // 是否禁止拖拽进度条
  3708. speed: this.playbackRate, // 倍数
  3709. teaser_show: 1,
  3710. tail_show: 1,
  3711. hideSwitchPlayer: true,
  3712. watchStartTime: this.recordObj.videoCurrentTime, // 播放开始时间,表示视频从第几秒开始播放,参数值需小于视频时长
  3713. ts: res.data.data.ts, // 移动播放加密视频需传入的时间戳。
  3714. sign: res.data.data.sign, // 移动端播放加密视频所需的签名
  3715. // playsafe: (vid, next) => { // PC端播放加密视频所需的授权凭证
  3716. // console.log('111111111111', vid);
  3717. // // this.$api.obtainpolyvvideopcsign(vid).then((res) => {
  3718. // // console.log('请求完后', res);
  3719. // // next(res.data.data);
  3720. // // });
  3721. // },
  3722. });
  3723. polyvPlayerContext = this.player;
  3724. console.log("this.player:", this.player);
  3725. this.player.on("s2j_onPlayStart", async (vid) => {
  3726. // 视频初次播放时触发
  3727. console.log("视频初次播放时触发:");
  3728. // #ifdef H5
  3729. // h5禁止拖动进度条
  3730. clearInterval(this.barTimer);
  3731. this.barTimer = null;
  3732. let originTime = this.recordObj.videoCurrentTime || 0;
  3733. if (this.H5isAllowSeek == "on" && !this.barTimer) {
  3734. this.barTimer = setInterval(function () {
  3735. const currentTime = polyvPlayerContext.j2s_getCurrentTime();
  3736. // console.log(currentTime, originTime)
  3737. if (
  3738. currentTime - originTime > 1 ||
  3739. currentTime - originTime < 0
  3740. ) {
  3741. polyvPlayerContext.j2s_seekVideo(originTime);
  3742. } else {
  3743. originTime = currentTime;
  3744. }
  3745. }, 500);
  3746. }
  3747. // #endif
  3748. this.loadedmetadata();
  3749. this.postStudyRecord(0);
  3750. });
  3751. this.player.on("s2j_onVideoPause", () => {
  3752. // 视频暂停时触发
  3753. console.log("视频暂停时触发", this.vid);
  3754. this.erJianErZaoPauseTip();
  3755. clearInterval(this.studyTimer);
  3756. clearInterval(this.timer);
  3757. });
  3758. this.player.on("s2j_onVideoPlay", () => {
  3759. // 视频初次播放或由暂停恢复播放时触发
  3760. console.log("视频初次播放或由暂停恢复播放时触发");
  3761. if (this.needSeek) {
  3762. if (this.recordObj.videoCurrentTime) {
  3763. this.seekTime = this.$method.secondToDate(
  3764. this.recordObj.videoCurrentTime
  3765. );
  3766. this.videoToastShow = true;
  3767. this.toastTimer = setTimeout(() => {
  3768. this.videoToastShow = false;
  3769. }, 3000);
  3770. }
  3771. this.needSeek = false;
  3772. // 新增用户视频学习日志
  3773. this.studyLog();
  3774. }
  3775. //开始播放
  3776. this.timer && clearInterval(this.timer);
  3777. if (this.playSecIsLearn && (this.erJianErZao || this.photoNum > 0)) {
  3778. this.isReach = false;
  3779. this.clearPauseTimer();
  3780. this.timer = setInterval(this.timeEvent, 1000); //定时器
  3781. }
  3782. this.studyTimer && clearInterval(this.studyTimer);
  3783. this.studyTimer = setInterval(() => {
  3784. this.postStudyRecord(0, this.playSectionId);
  3785. }, 15000);
  3786. });
  3787. this.player.on("s2j_onPlayOver", async () => {
  3788. // 当前视频播放完毕时触发
  3789. console.log("结束了结束了");
  3790. this.hasStart = false;
  3791. clearInterval(this.studyTimer);
  3792. clearInterval(this.timer);
  3793. uni.showToast({
  3794. icon: "none",
  3795. title: "播放完毕",
  3796. });
  3797. await this.postStudyRecord(1);
  3798. this.nextSection(); // 播放下一节
  3799. });
  3800. });
  3801. },
  3802. clears() {
  3803. return new Promise((resolve, reject) => {
  3804. this.vid = "";
  3805. this.player && this.player.destroy();
  3806. resolve();
  3807. });
  3808. },
  3809. /**
  3810. * 退出全屏
  3811. */
  3812. exitFullscreen() {
  3813. try {
  3814. var de = document;
  3815. // console.log(de);
  3816. if (de.exitFullscreen) {
  3817. de.exitFullscreen();
  3818. } else if (de.mozCancelFullScreen) {
  3819. de.mozCancelFullScreen();
  3820. } else if (de.webkitCancelFullScreen) {
  3821. de.webkitCancelFullScreen();
  3822. }
  3823. } catch (err) {}
  3824. },
  3825. fullele() {
  3826. return (
  3827. document.fullscreenElement ||
  3828. document.webkitFullscreenElement ||
  3829. document.msFullscreenElement ||
  3830. document.mozFullScreenElement ||
  3831. null
  3832. );
  3833. },
  3834. //判断是否全屏
  3835. isFullScreen() {
  3836. return !!(document.webkitIsFullScreen || this.fullele());
  3837. },
  3838. getUserMedia(constraints, success, error) {
  3839. console.log("getUserMedia===", constraints, "success:", success);
  3840. if (window.navigator.mediaDevices.getUserMedia) {
  3841. // 最新的标准API
  3842. window.navigator.mediaDevices
  3843. .getUserMedia(constraints)
  3844. .then(success)
  3845. .catch(error);
  3846. } else if (window.navigator.webkitGetUserMedia) {
  3847. // webkit核心浏览器
  3848. window.navigator.webkitGetUserMedia(constraints, success, error);
  3849. } else if (window.navigator.mozGetUserMedia) {
  3850. // firfox浏览器
  3851. window.navigator.mozGetUserMedia(constraints, success, error);
  3852. } else if (window.navigator.getUserMedia) {
  3853. // 旧版API
  3854. window.navigator.getUserMedia(constraints, success, error);
  3855. }
  3856. },
  3857. photographSuccess(stream) {
  3858. console.log("有摄像头---", stream);
  3859. this.photoPopup = true;
  3860. this.isTaking = true;
  3861. this.enableAutoRotation = false;
  3862. this.$nextTick(() => {
  3863. const video = document.querySelector("video");
  3864. console.log("video:", video);
  3865. video.srcObject = stream;
  3866. video.play();
  3867. });
  3868. },
  3869. photographError(err) {
  3870. console.log("没有摄像头:", err);
  3871. uni.showModal({
  3872. title: "提示",
  3873. content:
  3874. "课程学习需要开启摄像头进行拍照,经检测您的设备无摄像头可使用,请检测环境是否支持。",
  3875. cancelText: "取消",
  3876. confirmText: "确定",
  3877. success: (res) => {
  3878. if (res.confirm) {
  3879. uni.navigateBack();
  3880. } else if (res.cancel) {
  3881. }
  3882. },
  3883. });
  3884. },
  3885. },
  3886. };
  3887. </script>
  3888. <style lang="scss" scope>
  3889. @import "./css/detail.scss";
  3890. .top {
  3891. &__header {
  3892. position: relative;
  3893. width: 100%;
  3894. height: 150rpx;
  3895. padding: 24rpx 150rpx 24rpx 24rpx;
  3896. .img {
  3897. position: absolute;
  3898. left: 0;
  3899. top: 0;
  3900. width: 100%;
  3901. }
  3902. .note {
  3903. position: relative;
  3904. z-index: 10;
  3905. font-size: 24rpx;
  3906. font-family: PingFang SC;
  3907. font-weight: bold;
  3908. color: #efdbff;
  3909. }
  3910. .title {
  3911. position: relative;
  3912. z-index: 10;
  3913. font-size: 26rpx;
  3914. font-family: PingFang SC;
  3915. font-weight: bold;
  3916. color: #ffffff;
  3917. }
  3918. }
  3919. }
  3920. #top {
  3921. position: relative;
  3922. z-index: 99;
  3923. }
  3924. .polyv_detail {
  3925. display: flex;
  3926. flex-direction: column;
  3927. height: 100vh;
  3928. position: relative;
  3929. top: 0;
  3930. left: 0;
  3931. .pops {
  3932. position: absolute;
  3933. top: 0;
  3934. left: 0;
  3935. background: #ccc;
  3936. opacity: 0.5;
  3937. width: 100%;
  3938. height: 300rpx;
  3939. z-index: 9999;
  3940. }
  3941. .box {
  3942. flex: 1;
  3943. overflow: hidden;
  3944. margin: 16rpx 16rpx 100rpx 16rpx;
  3945. .box_in {
  3946. height: 100%;
  3947. }
  3948. }
  3949. .first_ml {
  3950. margin: 16rpx 16rpx 16rpx 16rpx;
  3951. }
  3952. }
  3953. .btnSet {
  3954. width: 440rpx;
  3955. height: 80rpx;
  3956. background: #007aff;
  3957. border-radius: 40rpx;
  3958. color: #ffffff;
  3959. font-size: 28rpx;
  3960. line-height: 80rpx;
  3961. }
  3962. .btnReply {
  3963. width: 80rpx;
  3964. height: 40rpx;
  3965. background: #e3f0ff;
  3966. border-radius: 16rpx;
  3967. text-align: center;
  3968. color: #007aff;
  3969. }
  3970. .btnDel {
  3971. width: 80rpx;
  3972. height: 40rpx;
  3973. background: #ffedf0;
  3974. border-radius: 16rpx;
  3975. text-align: center;
  3976. color: #ff2d55;
  3977. }
  3978. .btnReply {
  3979. width: 80rpx;
  3980. height: 40rpx;
  3981. background: #e3f0ff;
  3982. border-radius: 16rpx;
  3983. font-size: 24rpx;
  3984. }
  3985. .lecture-box {
  3986. display: flex;
  3987. align-items: center;
  3988. height: 80rpx;
  3989. background: #ffffff;
  3990. border-radius: 16rpx 16rpx 16rpx 16rpx;
  3991. margin-bottom: 20rpx;
  3992. .title {
  3993. padding: 10rpx;
  3994. flex: 1;
  3995. overflow: hidden;
  3996. text-overflow: ellipsis;
  3997. white-space: nowrap;
  3998. color: #333;
  3999. font-weight: bold;
  4000. font-size: 32rpx;
  4001. }
  4002. .btn {
  4003. display: flex;
  4004. align-items: center;
  4005. justify-content: center;
  4006. width: 80rpx;
  4007. height: 80rpx;
  4008. background: #ffffff;
  4009. box-shadow: -4rpx 0rpx 4rpx 0rpx rgba(0, 0, 0, 0.1);
  4010. border-radius: 16rpx 16rpx 16rpx 16rpx;
  4011. }
  4012. @keyframes rotation {
  4013. from {
  4014. -webkit-transform: rotate(0deg);
  4015. }
  4016. to {
  4017. -webkit-transform: rotate(360deg);
  4018. }
  4019. }
  4020. .loading_down {
  4021. transform: rotate(360deg);
  4022. animation: rotation 3s linear infinite;
  4023. }
  4024. }
  4025. .lecture-content {
  4026. background: #fff;
  4027. margin-top: 10rpx;
  4028. padding: 10rpx;
  4029. border-radius: 16rpx;
  4030. }
  4031. .photoBox {
  4032. width: 100%;
  4033. // background-color: #ffffff;
  4034. // border-radius: 24px 24px 0px 0px;
  4035. .photoTop {
  4036. width: 100%;
  4037. height: 74rpx;
  4038. border-radius: 20px 20px 0px 0px;
  4039. background-color: #ffffff;
  4040. display: flex;
  4041. align-items: center;
  4042. justify-content: center;
  4043. padding: 0rpx 38rpx;
  4044. .sqzz {
  4045. width: 28rpx;
  4046. height: 28rpx;
  4047. display: flex;
  4048. align-items: center;
  4049. justify-content: center;
  4050. }
  4051. .centersq {
  4052. color: #333;
  4053. font-size: 30rpx;
  4054. font-weight: 500;
  4055. }
  4056. }
  4057. .photoCenter {
  4058. width: 750rpx;
  4059. height: 75vh;
  4060. position: relative;
  4061. .center_camera {
  4062. width: 100%;
  4063. height: 75vh;
  4064. position: fixed;
  4065. .head_take {
  4066. width: 100%;
  4067. height: 75vh;
  4068. display: flex;
  4069. flex-direction: column;
  4070. }
  4071. .headTake_up {
  4072. width: 100%;
  4073. height: 100rpx;
  4074. }
  4075. .headTake_minddle {
  4076. display: flex;
  4077. .min_img {
  4078. width: 500rpx;
  4079. height: 550rpx;
  4080. }
  4081. .min_left,
  4082. .min_right {
  4083. flex: 1;
  4084. height: 550rpx;
  4085. }
  4086. }
  4087. .headTake_down {
  4088. width: 100%;
  4089. flex: 1;
  4090. }
  4091. .color {
  4092. background-color: #333;
  4093. opacity: 0.5;
  4094. }
  4095. .photo_v {
  4096. width: 100%;
  4097. height: 100%;
  4098. }
  4099. .mask {
  4100. width: 500rpx;
  4101. height: 550rpx;
  4102. position: absolute;
  4103. top: 100rpx;
  4104. left: 0;
  4105. right: 0;
  4106. bottom: 0;
  4107. margin: 0 auto;
  4108. box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.4);
  4109. }
  4110. }
  4111. .custom {
  4112. width: 750rpx;
  4113. height: 75vh;
  4114. position: absolute;
  4115. z-index: 1000;
  4116. top: 0;
  4117. left: 0;
  4118. image {
  4119. width: 100%;
  4120. height: 100%;
  4121. }
  4122. }
  4123. }
  4124. .btns {
  4125. display: flex;
  4126. .takePhoto_btn {
  4127. width: 100%;
  4128. display: flex;
  4129. align-items: center;
  4130. justify-content: space-between;
  4131. background: #a9a7a9;
  4132. padding: 40rpx 26rpx;
  4133. .middle_btn {
  4134. width: 120rpx;
  4135. height: 120rpx;
  4136. border-radius: 40rpx;
  4137. border: 4rpx solid #ffffff;
  4138. display: flex;
  4139. align-items: center;
  4140. justify-content: center;
  4141. }
  4142. .square {
  4143. width: 96rpx;
  4144. height: 96rpx;
  4145. background: #ffffff;
  4146. border-radius: 28rpx;
  4147. }
  4148. .rights {
  4149. font-size: 32rpx;
  4150. font-weight: 500;
  4151. color: #ffffff;
  4152. }
  4153. }
  4154. .btnResult {
  4155. height: 100rpx;
  4156. flex: 1;
  4157. background-color: #07c160;
  4158. text-align: center;
  4159. line-height: 100rpx;
  4160. color: #fff;
  4161. font-size: 32rpx;
  4162. font-weight: bold;
  4163. }
  4164. }
  4165. }
  4166. .chat_box {
  4167. display: flex;
  4168. padding: 20rpx;
  4169. justify-content: space-between;
  4170. }
  4171. .chat3 {
  4172. font-size: 30rpx;
  4173. font-family: PingFang SC;
  4174. font-weight: 500;
  4175. color: #666666;
  4176. margin-top: 10rpx;
  4177. }
  4178. .chat2 {
  4179. font-size: 20rpx;
  4180. font-family: PingFang SC;
  4181. font-weight: 500;
  4182. color: #999999;
  4183. margin-top: 10rpx;
  4184. }
  4185. .chat1 {
  4186. font-size: 24rpx;
  4187. font-family: PingFang SC;
  4188. font-weight: 500;
  4189. color: #333333;
  4190. }
  4191. .leftPadding {
  4192. margin-left: 8rpx;
  4193. }
  4194. .t2Content {
  4195. font-size: 24rpx;
  4196. font-family: PingFang SC;
  4197. font-weight: bold;
  4198. color: #999999;
  4199. line-height: 48rpx;
  4200. }
  4201. .tBox2 {
  4202. display: flex;
  4203. padding-top: 10rpx;
  4204. color: #333333;
  4205. font-size: 30rpx;
  4206. font-weight: 400;
  4207. }
  4208. .tBox {
  4209. display: flex;
  4210. align-items: center;
  4211. padding-top: 10rpx;
  4212. }
  4213. .title {
  4214. font-size: 24rpx;
  4215. color: #999999;
  4216. }
  4217. .Answering {
  4218. .answer_item {
  4219. &:nth-child(2) {
  4220. border-radius: 16rpx 16rpx 0rpx 0rpx;
  4221. }
  4222. &:nth-last-child(1) {
  4223. border-radius: 0rpx 0rpx 16rpx 16rpx;
  4224. }
  4225. }
  4226. }
  4227. .inputBottom {
  4228. position: fixed;
  4229. left: 0;
  4230. bottom: 0;
  4231. background: #ffffff;
  4232. height: 98rpx;
  4233. display: flex;
  4234. align-items: center;
  4235. width: 100%;
  4236. .flex_auto {
  4237. flex: 1;
  4238. margin-left: 10%;
  4239. word-break: break-all;
  4240. // .input {
  4241. // height: 60rpx;
  4242. // }
  4243. }
  4244. .btn {
  4245. color: #007aff;
  4246. font-size: 30rpx;
  4247. font-weight: bold;
  4248. width: 15%;
  4249. text-align: center;
  4250. }
  4251. .input {
  4252. background: rgba(244, 244, 244, 0.98);
  4253. height: 60rpx;
  4254. border-radius: 24rpx;
  4255. margin-top: 12rpx;
  4256. }
  4257. }
  4258. .noteBox {
  4259. width: 100%;
  4260. background: #ffffff;
  4261. padding: 0rpx 10rpx 20rpx;
  4262. border-radius: 16rpx;
  4263. overflow: hidden;
  4264. .left_ti {
  4265. padding-top: 14rpx;
  4266. }
  4267. }
  4268. .dateBox {
  4269. width: 216rpx;
  4270. height: 48rpx;
  4271. background: #ffffff;
  4272. border-radius: 24rpx;
  4273. font-size: 24rpx;
  4274. color: #666666;
  4275. text-align: center;
  4276. line-height: 48rpx;
  4277. margin: 16rpx 0rpx 8rpx;
  4278. }
  4279. .t_content1 {
  4280. color: #007aff;
  4281. margin-left: 10rpx;
  4282. }
  4283. .tag1 {
  4284. border: 2rpx solid #007aff;
  4285. border-radius: 8rpx;
  4286. font-size: 20rpx;
  4287. color: #007aff;
  4288. padding: 5rpx;
  4289. }
  4290. .b_title {
  4291. color: #333333;
  4292. font-size: 30rpx;
  4293. font-weight: bold;
  4294. }
  4295. page {
  4296. background: #eaeef1;
  4297. }
  4298. .menuBox {
  4299. width: 100%;
  4300. background: #ffffff;
  4301. border-radius: 16rpx;
  4302. padding: 0rpx 20rpx;
  4303. margin-bottom: 20rpx;
  4304. }
  4305. .btnspric {
  4306. border-top: 1rpx solid #eee;
  4307. display: flex;
  4308. align-items: center;
  4309. justify-content: space-between;
  4310. height: 108rpx;
  4311. padding-left: 43rpx;
  4312. padding-right: 32rpx;
  4313. }
  4314. .btnspric > .lefprL {
  4315. font-size: 36rpx;
  4316. color: #0c141f;
  4317. font-weight: bold;
  4318. }
  4319. .btnspric > .lefprR {
  4320. padding: 0rpx 24rpx;
  4321. height: 60rpx;
  4322. line-height: 60rpx;
  4323. text-align: center;
  4324. color: #fff;
  4325. background: #32467b;
  4326. border-radius: 24rpx;
  4327. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  4328. }
  4329. .yhj,
  4330. .hdyhj {
  4331. padding: 24rpx 29rpx 24rpx 34rpx;
  4332. }
  4333. .yhj {
  4334. border-bottom: 16rpx solid #f9f9f9;
  4335. }
  4336. .yhjtit {
  4337. font-size: 30rpx;
  4338. color: #0c141f;
  4339. font-weight: 500;
  4340. margin-bottom: 14rpx;
  4341. }
  4342. .yhjList {
  4343. display: flex;
  4344. align-items: center;
  4345. justify-content: space-between;
  4346. margin-bottom: 14rpx;
  4347. }
  4348. .yhjList > .yhjLefts {
  4349. display: flex;
  4350. align-items: center;
  4351. }
  4352. .yhjLefts > .yhl {
  4353. color: #32467b;
  4354. font-size: 30rpx;
  4355. margin-right: 31rpx;
  4356. }
  4357. .yhjLefts > .yhbq {
  4358. font-size: 24rpx;
  4359. color: #ff9500;
  4360. border-radius: 18rpx;
  4361. background-color: rgba(255, 149, 0, 0.2);
  4362. border: 2rpx solid #ff9500;
  4363. height: 38rpx;
  4364. line-height: 38rpx;
  4365. padding: 0rpx 16rpx;
  4366. }
  4367. .ts {
  4368. font-size: 24rpx;
  4369. color: #999;
  4370. margin: 14rpx 0rpx;
  4371. padding-right: 29rpx;
  4372. padding-left: 34rpx;
  4373. }
  4374. .yh {
  4375. padding-top: 20rpx;
  4376. }
  4377. .yh > .yhtitle {
  4378. display: flex;
  4379. align-items: center;
  4380. justify-content: space-between;
  4381. padding-right: 29rpx;
  4382. padding-left: 34rpx;
  4383. }
  4384. .priceBxs {
  4385. display: flex;
  4386. align-items: center;
  4387. }
  4388. .priceBxs > .pricleft {
  4389. border-radius: 24rpx;
  4390. border: 1rpx solid #e91313;
  4391. background-color: rgba(233, 19, 19, 0.1);
  4392. padding: 0rpx 18rpx;
  4393. height: 49rpx;
  4394. line-height: 49rpx;
  4395. text-align: center;
  4396. font-size: 30rpx;
  4397. font-weight: 500;
  4398. color: #e91313;
  4399. margin-right: 13rpx;
  4400. }
  4401. .topBox {
  4402. padding: 32rpx 32rpx 24rpx;
  4403. border-bottom: 1rpx solid #eeeeee;
  4404. }
  4405. .topBox > .boldFonstType {
  4406. font-weight: 500;
  4407. font-size: 30rpx;
  4408. margin: 16rpx 0rpx 23rpx;
  4409. }
  4410. .topBox > .firstTopL {
  4411. display: flex;
  4412. align-items: center;
  4413. }
  4414. .topBox > .firstTopL > .imageBs {
  4415. width: 331rpx;
  4416. height: 160rpx;
  4417. border-radius: 6rpx;
  4418. overflow: hidden;
  4419. margin-right: 8rpx;
  4420. box-shadow: 0rpx 6rpx 6rpx 0rpx rgba(47, 67, 121, 0.08);
  4421. }
  4422. .topBox > .firstTopL > .imageBs > image {
  4423. width: 100%;
  4424. height: 100%;
  4425. }
  4426. .topBox > .firstTopL > .textBs {
  4427. font-size: 30rpx;
  4428. font-weight: bold;
  4429. color: #0c141f;
  4430. }
  4431. .content {
  4432. padding: 24rpx;
  4433. text-align: left;
  4434. }
  4435. .catalogBox {
  4436. display: flex;
  4437. align-items: center;
  4438. flex-wrap: nowrap;
  4439. overflow-x: auto;
  4440. padding-left: 38rpx;
  4441. max-height: 305rpx;
  4442. overflow-y: auto;
  4443. transition: all 0.4s;
  4444. }
  4445. .catalogBox > .catalogA {
  4446. min-width: 200rpx;
  4447. height: 48rpx;
  4448. line-height: 48rpx;
  4449. // text-align: center;
  4450. border: 2rpx solid transparent;
  4451. white-space: nowrap;
  4452. text-overflow: ellipsis;
  4453. overflow: hidden;
  4454. word-break: break-all;
  4455. border-radius: 10rpx;
  4456. background: rgba(22, 119, 255, 0.05);
  4457. padding-left: 19rpx;
  4458. box-sizing: border-box;
  4459. padding-right: 15rpx;
  4460. margin-right: 16rpx;
  4461. margin-bottom: 20rpx;
  4462. margin-top: 15rpx;
  4463. font-size: 24rpx;
  4464. color: #666;
  4465. }
  4466. .catalogBox > .activesq {
  4467. border-color: #1677ff;
  4468. }
  4469. .changeCatalogBox {
  4470. display: block;
  4471. }
  4472. .catalogBox::-webkit-scrollbar {
  4473. display: none; /* Chrome Safari */
  4474. }
  4475. .price_t2 {
  4476. font-size: 18rpx;
  4477. font-family: PingFang SC;
  4478. font-weight: 500;
  4479. text-decoration: line-through;
  4480. color: #999999;
  4481. }
  4482. .price_t1 {
  4483. font-size: 33rpx;
  4484. font-family: PingFang SC;
  4485. font-weight: bold;
  4486. color: #e91313;
  4487. }
  4488. .sc_t {
  4489. font-size: 22rpx;
  4490. color: #000000;
  4491. }
  4492. .sc {
  4493. width: 29rpx;
  4494. height: 29rpx;
  4495. }
  4496. .buy {
  4497. width: 138rpx;
  4498. height: 48rpx;
  4499. line-height: 48rpx;
  4500. background: #32467b;
  4501. border-radius: 10rpx;
  4502. color: #ffffff;
  4503. font-size: 28rpx;
  4504. text-align: center;
  4505. vertical-align: middle;
  4506. position: absolute;
  4507. right: 30rpx;
  4508. }
  4509. .video_body {
  4510. padding-bottom: 96rpx;
  4511. }
  4512. .footer_tab {
  4513. position: fixed;
  4514. bottom: 0;
  4515. height: 96rpx;
  4516. width: 100%;
  4517. background-color: #ffffff;
  4518. }
  4519. .tj_box {
  4520. width: 50%;
  4521. display: inline-block;
  4522. text-align: center;
  4523. margin: 10rpx 0;
  4524. }
  4525. .teacher_t {
  4526. font-size: 24rpx;
  4527. font-family: PingFang SC;
  4528. font-weight: 400;
  4529. color: #666666;
  4530. line-height: 36rpx;
  4531. margin-left: 15rpx;
  4532. }
  4533. .teacher_img {
  4534. width: 87rpx;
  4535. height: 129rpx;
  4536. }
  4537. .t2 {
  4538. font-size: 24rpx;
  4539. font-family: PingFang SC;
  4540. color: #666666;
  4541. line-height: 36rpx;
  4542. margin: 15rpx;
  4543. }
  4544. .r_t2 {
  4545. width: 201rpx;
  4546. height: 49rpx;
  4547. background: rgba(22, 119, 255, 0.05);
  4548. border: 1rpx solid #32467b;
  4549. border-radius: 16rpx;
  4550. color: #666666;
  4551. font-size: 23rpx;
  4552. text-align: center;
  4553. display: flex;
  4554. align-items: center;
  4555. padding: 5rpx;
  4556. }
  4557. .scroll_box {
  4558. width: 100%;
  4559. height: 60rpx;
  4560. background: #ffffff;
  4561. box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(145, 156, 178, 0.1);
  4562. white-space: nowrap;
  4563. overflow: hidden;
  4564. margin: 15rpx 0;
  4565. }
  4566. .r_sliper {
  4567. padding: 0 20rpx;
  4568. }
  4569. .top_line {
  4570. width: 6rpx;
  4571. height: 22rpx;
  4572. background: #32467b;
  4573. margin-right: 10rpx;
  4574. }
  4575. .video_t2 {
  4576. font-size: 24rpx;
  4577. font-family: PingFang SC;
  4578. font-weight: 500;
  4579. color: #666666;
  4580. }
  4581. .video_play {
  4582. position: absolute;
  4583. width: 95rpx;
  4584. height: 95rpx;
  4585. top: 0;
  4586. left: 0;
  4587. right: 0;
  4588. bottom: 0;
  4589. margin: auto;
  4590. }
  4591. .video_box {
  4592. position: relative;
  4593. #playerVideo {
  4594. position: relative;
  4595. z-index: 99;
  4596. }
  4597. .video-toast {
  4598. position: absolute;
  4599. width: 686rpx;
  4600. height: 80rpx;
  4601. background: rgba(0, 0, 0, 0.6);
  4602. border-radius: 24rpx;
  4603. bottom: 100rpx;
  4604. left: 50%;
  4605. transform: translateX(-50%);
  4606. color: #fff;
  4607. display: flex;
  4608. font-size: 26rpx;
  4609. align-items: center;
  4610. overflow: visible;
  4611. z-index: 999;
  4612. &__text {
  4613. flex: 1;
  4614. margin-left: 40rpx;
  4615. }
  4616. &__btn {
  4617. width: 180rpx;
  4618. text-align: center;
  4619. border-left: 1rpx solid #fff;
  4620. }
  4621. }
  4622. .video-toast__close {
  4623. position: absolute;
  4624. right: 32rpx;
  4625. bottom: 184rpx;
  4626. width: 40rpx;
  4627. height: 40rpx;
  4628. line-height: 40rpx;
  4629. text-align: center;
  4630. background: rgba(0, 0, 0, 0.6);
  4631. border-radius: 50%;
  4632. color: rgba(255, 255, 255, 0.3);
  4633. }
  4634. }
  4635. .rotoct {
  4636. transform: rotate(90deg);
  4637. }
  4638. .slot-content {
  4639. padding: 0 20rpx;
  4640. }
  4641. .notice_modal {
  4642. .content {
  4643. width: 100%;
  4644. height: 100%;
  4645. padding: 56rpx 56rpx 56rpx 64rpx;
  4646. .title {
  4647. color: #222;
  4648. line-height: 40rpx;
  4649. font-size: 36rpx;
  4650. text-align: center;
  4651. font-weight: bold;
  4652. margin-bottom: 24rpx;
  4653. }
  4654. .text {
  4655. height: 340rpx;
  4656. line-height: 40rpx;
  4657. text-indent: 2em;
  4658. font-size: 32rpx;
  4659. color: #222;
  4660. }
  4661. .had_read {
  4662. width: 100%;
  4663. height: 88rpx;
  4664. line-height: 88rpx;
  4665. text-align: center;
  4666. background: #3577e8;
  4667. border-radius: 240rpx;
  4668. font-size: 32rpx;
  4669. font-weight: 500;
  4670. color: #fff;
  4671. margin-top: 20rpx;
  4672. &.gray {
  4673. background: #bbbec5;
  4674. }
  4675. }
  4676. }
  4677. }
  4678. .full_mulu {
  4679. position: absolute;
  4680. top: 100rpx;
  4681. right: 20rpx;
  4682. width: 700rpx;
  4683. height: 515rpx;
  4684. color: #333;
  4685. display: flex;
  4686. align-items: center;
  4687. justify-content: space-between;
  4688. z-index: 99999;
  4689. .mulus {
  4690. width: 623rpx;
  4691. // height: 515rpx;
  4692. height: 400rpx;
  4693. overflow-y: scroll;
  4694. // overflow: scroll;
  4695. }
  4696. .mulu_box_in {
  4697. background-color: #b7b7b7;
  4698. border-radius: 16rpx;
  4699. // transition: all 0.5s;
  4700. &::after {
  4701. content: "";
  4702. width: 0;
  4703. height: 0;
  4704. position: absolute;
  4705. top: 235rpx;
  4706. right: 27px;
  4707. border-top: 16rpx solid transparent;
  4708. border-right: 16rpx solid transparent;
  4709. border-left: 16rpx solid #b7b7b7;
  4710. border-bottom: 16rpx solid transparent;
  4711. }
  4712. }
  4713. .mulu_box_out {
  4714. // visibility: hidden;
  4715. display: none;
  4716. }
  4717. .menuBox_mulu {
  4718. // width: 100%;
  4719. background: #ffffff;
  4720. border-radius: 16rpx;
  4721. padding: 0rpx 20rpx;
  4722. margin-bottom: 20rpx;
  4723. }
  4724. .ml_img {
  4725. position: absolute;
  4726. right: 0;
  4727. top: 100rpx;
  4728. }
  4729. .items {
  4730. width: 620rpx;
  4731. height: 100rpx;
  4732. border: 1rpx solid red;
  4733. }
  4734. }
  4735. </style>