detail.vue 142 KB

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