detail.vue 142 KB

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