index copy.vue 265 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348
  1. <template>
  2. <div class="course-detail">
  3. <Header></Header>
  4. <section class="section">
  5. <div class="container">
  6. <div class="section__header">
  7. <div class="container">
  8. <el-breadcrumb separator="/">
  9. <el-breadcrumb-item :to="{ path: '/index' }"
  10. >首页</el-breadcrumb-item
  11. >
  12. <el-breadcrumb-item>课程详情</el-breadcrumb-item>
  13. </el-breadcrumb>
  14. </div>
  15. </div>
  16. <div class="section__body">
  17. <div class="container">
  18. <div class="course-info">
  19. <div class="course-info__header clearfix">
  20. <div
  21. class="left-box"
  22. :style="{
  23. backgroundImage: `url(${$tools.splitImgHost(
  24. goodsData.coverUrl,
  25. false
  26. )})`,
  27. }"
  28. >
  29. <div v-show="vid" id="player"></div>
  30. <div v-show="vidzb" id="playerzb"></div>
  31. <div class="recordStyle" v-if="showRecordStatus">
  32. 您上次看到{{
  33. $tools.secondToTime(recordObj.videoCurrentTime)
  34. }},正在自动续播<span
  35. style="
  36. display: inline-block;
  37. width: 50px;
  38. text-align: center;
  39. "
  40. >|</span
  41. >
  42. <span class="btn_sty" @click="backLI">从头播放</span>
  43. </div>
  44. </div>
  45. <div class="right-box">
  46. <div class="right-box__header">
  47. <div class="title">
  48. <el-select
  49. class="select"
  50. v-model="courseId"
  51. @change="courseChange"
  52. >
  53. <el-option
  54. :label="item.courseName"
  55. :value="item.courseId"
  56. v-for="(item, index) in courseList"
  57. :key="index"
  58. ></el-option>
  59. </el-select>
  60. </div>
  61. <div class="tabs">
  62. <el-tabs v-model="courseTabIndex">
  63. <el-tab-pane
  64. :name="tab.name"
  65. v-for="(tab, index) in menuTab"
  66. :key="index"
  67. >
  68. <div slot="label">
  69. <span class="label">{{ tab.label }}</span>
  70. </div>
  71. <template v-if="tab.name == '1'">
  72. <div class="right-box__body">
  73. <div
  74. class="item"
  75. v-for="(menu, index) in menuList"
  76. :key="index"
  77. >
  78. <template v-if="menu.type == 1">
  79. <div
  80. class="item__title"
  81. @click="openModule(menu)"
  82. >
  83. <i
  84. :class="{
  85. 'el-icon-caret-right': !menu.showList,
  86. 'el-icon-caret-bottom': menu.showList,
  87. }"
  88. ></i>
  89. {{ menu.menuName }}
  90. </div>
  91. <div class="item__content">
  92. <div
  93. class="bank-chapter"
  94. v-if="menu.showList"
  95. >
  96. <div
  97. class="bank-chapter__item"
  98. v-for="(
  99. chapter, chapterIndex
  100. ) in menu.list"
  101. :key="chapterIndex"
  102. >
  103. <div
  104. class="bank-chapter__item__text"
  105. @click="openChapter(chapter)"
  106. >
  107. <i
  108. :class="{
  109. 'el-icon-caret-right':
  110. !chapter.showList,
  111. 'el-icon-caret-bottom':
  112. chapter.showList,
  113. }"
  114. ></i
  115. >{{ chapter.name }}
  116. </div>
  117. <div
  118. class="bank-section"
  119. v-if="chapter.showList"
  120. >
  121. <div
  122. class="bank-section__item"
  123. :class="{
  124. active: isActive(section),
  125. }"
  126. v-for="(
  127. section, sectionIndex
  128. ) in chapter.list"
  129. :key="sectionIndex"
  130. @click="getResource(section)"
  131. >
  132. <template v-if="section.type != 2">
  133. <template>
  134. <div
  135. class="note note--blue"
  136. v-if="
  137. section.sectionType == 1
  138. "
  139. >
  140. 录播
  141. </div>
  142. <div
  143. class="note"
  144. v-if="
  145. section.sectionType == 2
  146. "
  147. >
  148. 直播
  149. </div>
  150. <div
  151. class="note note--yellow"
  152. v-if="
  153. section.sectionType == 3
  154. "
  155. >
  156. 回放
  157. </div>
  158. <div
  159. class="
  160. bank-section__item__text
  161. "
  162. >
  163. {{ section.name }}
  164. <div
  165. style="font-size: 12px"
  166. v-if="
  167. section.liveStartTime >
  168. nowTime
  169. "
  170. >
  171. <span>{{
  172. $tools.timestampToTime(
  173. section.liveStartTime,
  174. (isDay = false)
  175. )
  176. }}</span
  177. >-
  178. <span>{{
  179. $tools.timestampToTime(
  180. section.liveEndTime,
  181. (isDay = false)
  182. )
  183. }}</span>
  184. </div>
  185. </div>
  186. </template>
  187. <template
  188. v-if="section.durationTime > 0"
  189. >
  190. <div class="during">
  191. {{
  192. $tools.secondToDate(
  193. section.durationTime
  194. )
  195. }}
  196. </div>
  197. </template>
  198. <template>
  199. <div
  200. class="btn"
  201. v-if="section.rebuild > 0"
  202. >
  203. 待重修
  204. </div>
  205. <template v-else>
  206. <div
  207. class="btn btn--green"
  208. v-if="section.learning == 1"
  209. >
  210. 已看完
  211. </div>
  212. </template>
  213. </template>
  214. <template
  215. v-if="
  216. section.liveStartTime &&
  217. section.sectionType != 3
  218. "
  219. >
  220. <div
  221. class="
  222. live-btn live-btn--blue
  223. "
  224. v-if="
  225. section.liveStartTime >
  226. nowTime
  227. "
  228. >
  229. 待开播
  230. </div>
  231. <div
  232. class="
  233. live-btn live-btn--yellow
  234. "
  235. v-if="
  236. section.liveStartTime <=
  237. nowTime &&
  238. section.liveEndTime >
  239. nowTime
  240. "
  241. >
  242. 直播中
  243. </div>
  244. <div
  245. class="live-btn"
  246. v-if="
  247. section.liveEndTime <
  248. nowTime
  249. "
  250. >
  251. 已结束
  252. </div>
  253. </template>
  254. </template>
  255. <template v-if="section.type == 2">
  256. <template>
  257. <div
  258. class="test-btn"
  259. v-if="section.doType == 1"
  260. >
  261. 练习
  262. </div>
  263. <div
  264. class="test-btn"
  265. v-if="section.doType != 1"
  266. >
  267. 考试
  268. </div>
  269. </template>
  270. <div
  271. class="bank-section__item__text"
  272. >
  273. {{ section.name }}
  274. </div>
  275. <template>
  276. <div
  277. class="btn"
  278. v-if="section.rebuild > 0"
  279. >
  280. 待重修
  281. </div>
  282. <template v-else>
  283. <div
  284. class="btn btn--green"
  285. v-if="section.learning == 1"
  286. >
  287. 合格
  288. </div>
  289. <div
  290. class="btn btn--red"
  291. v-if="section.learning == 0"
  292. >
  293. 不合格
  294. </div>
  295. <div
  296. class="btn btn--green"
  297. v-if="section.rebuild > 0"
  298. >
  299. 待重测
  300. </div>
  301. </template>
  302. </template>
  303. </template>
  304. </div>
  305. </div>
  306. </div>
  307. </div>
  308. </div>
  309. </template>
  310. <template v-if="menu.type == 2">
  311. <div class="item__content">
  312. <div class="bank-chapter">
  313. <div class="bank-chapter__item">
  314. <div
  315. class="bank-chapter__item__text"
  316. @click="openChapter(menu)"
  317. >
  318. <i
  319. :class="{
  320. 'el-icon-caret-right':
  321. !menu.showList,
  322. 'el-icon-caret-bottom':
  323. menu.showList,
  324. }"
  325. ></i
  326. >{{ menu.menuName }}
  327. </div>
  328. <div
  329. class="bank-section"
  330. v-if="menu.showList"
  331. >
  332. <div
  333. class="bank-section__item"
  334. :class="{
  335. active: isActive(section),
  336. }"
  337. v-for="(
  338. section, sectionIndex
  339. ) in menu.list"
  340. :key="sectionIndex"
  341. @click="getResource(section)"
  342. >
  343. <template v-if="section.type != 2">
  344. <template>
  345. <div
  346. class="note note--blue"
  347. v-if="
  348. section.sectionType == 1
  349. "
  350. >
  351. 录播
  352. </div>
  353. <div
  354. class="note"
  355. v-if="
  356. section.sectionType == 2
  357. "
  358. >
  359. 直播
  360. </div>
  361. <div
  362. class="note note--yellow"
  363. v-if="
  364. section.sectionType == 3
  365. "
  366. >
  367. 回放
  368. </div>
  369. </template>
  370. <div
  371. class="bank-section__item__text"
  372. >
  373. {{ section.name }}
  374. <div
  375. style="font-size: 12px"
  376. v-if="
  377. section.liveStartTime >
  378. nowTime
  379. "
  380. >
  381. <span>{{
  382. $tools.timestampToTime(
  383. section.liveStartTime,
  384. (isDay = false)
  385. )
  386. }}</span
  387. >-
  388. <span>{{
  389. $tools.timestampToTime(
  390. section.liveEndTime,
  391. (isDay = false)
  392. )
  393. }}</span>
  394. </div>
  395. </div>
  396. <template
  397. v-if="section.durationTime > 0"
  398. >
  399. <div class="during">
  400. {{
  401. $tools.secondToDate(
  402. section.durationTime
  403. )
  404. }}
  405. </div>
  406. </template>
  407. <template>
  408. <div
  409. class="btn"
  410. v-if="section.rebuild > 0"
  411. >
  412. 待重修
  413. </div>
  414. <template v-else>
  415. <div
  416. class="btn btn--green"
  417. v-if="section.learning == 1"
  418. >
  419. 已看完
  420. </div>
  421. </template>
  422. </template>
  423. <template
  424. v-if="
  425. section.liveStartTime &&
  426. section.sectionType != 3
  427. "
  428. >
  429. <div
  430. class="
  431. live-btn live-btn--blue
  432. "
  433. v-if="
  434. section.liveStartTime >
  435. nowTime
  436. "
  437. >
  438. 待开播
  439. </div>
  440. <div
  441. class="
  442. live-btn live-btn--yellow
  443. "
  444. v-if="
  445. section.liveStartTime <=
  446. nowTime &&
  447. section.liveEndTime >
  448. nowTime
  449. "
  450. >
  451. 直播中
  452. </div>
  453. <div
  454. class="live-btn"
  455. v-if="
  456. section.liveEndTime <
  457. nowTime
  458. "
  459. >
  460. 已结束
  461. </div>
  462. </template>
  463. </template>
  464. <template v-if="section.type == 2">
  465. <template>
  466. <div
  467. class="test-btn"
  468. v-if="section.doType == 1"
  469. >
  470. 练习
  471. </div>
  472. <div
  473. class="test-btn"
  474. v-if="section.doType != 1"
  475. >
  476. 考试
  477. </div>
  478. </template>
  479. <div
  480. class="bank-section__item__text"
  481. >
  482. {{ section.name }}
  483. </div>
  484. <template>
  485. <div
  486. class="btn"
  487. v-if="section.rebuild > 0"
  488. >
  489. 待重修
  490. </div>
  491. <template v-else>
  492. <div
  493. class="btn btn--green"
  494. v-if="section.learning == 1"
  495. >
  496. 合格
  497. </div>
  498. <div
  499. class="btn btn--red"
  500. v-if="section.learning == 0"
  501. >
  502. 不合格
  503. </div>
  504. <div
  505. class="btn btn--green"
  506. v-if="section.rebuild > 0"
  507. >
  508. 待重测
  509. </div>
  510. </template>
  511. </template>
  512. </template>
  513. </div>
  514. </div>
  515. </div>
  516. </div>
  517. </div>
  518. </template>
  519. <template v-if="menu.type == 3">
  520. <div class="item__content">
  521. <div class="bank-section">
  522. <div
  523. class="bank-section__item"
  524. :class="{
  525. active: isActive(menu),
  526. }"
  527. @click="getResource(menu)"
  528. >
  529. <template>
  530. <div
  531. class="note note--blue"
  532. v-if="menu.sectionType == 1"
  533. >
  534. 录播
  535. </div>
  536. <div
  537. class="note"
  538. v-if="menu.sectionType == 2"
  539. >
  540. 直播
  541. </div>
  542. <div
  543. class="note note--yellow"
  544. v-if="menu.sectionType == 3"
  545. >
  546. 回放
  547. </div>
  548. <div class="bank-section__item__text">
  549. {{ menu.name }}
  550. <div
  551. style="font-size: 12px"
  552. v-if="
  553. menu.liveStartTime > nowTime
  554. "
  555. >
  556. <span>{{
  557. $tools.timestampToTime(
  558. menu.liveStartTime,
  559. (isDay = false)
  560. )
  561. }}</span
  562. >-
  563. <span>{{
  564. $tools.timestampToTime(
  565. menu.liveEndTime,
  566. (isDay = false)
  567. )
  568. }}</span>
  569. </div>
  570. </div>
  571. </template>
  572. <template v-if="menu.durationTime > 0">
  573. <div class="during">
  574. {{
  575. $tools.secondToDate(
  576. menu.durationTime
  577. )
  578. }}
  579. </div>
  580. </template>
  581. <template>
  582. <div
  583. class="btn"
  584. v-if="menu.rebuild > 0"
  585. >
  586. 待重修
  587. </div>
  588. <template v-else>
  589. <div
  590. class="btn btn--green"
  591. v-if="menu.learning == 1"
  592. >
  593. 已看完
  594. </div>
  595. </template>
  596. </template>
  597. <template
  598. v-if="
  599. menu.liveStartTime &&
  600. menu.sectionType != 3
  601. "
  602. >
  603. <div
  604. class="live-btn live-btn--blue"
  605. v-if="menu.liveStartTime > nowTime"
  606. >
  607. 待开播
  608. </div>
  609. <div
  610. class="live-btn live-btn--yellow"
  611. v-if="
  612. menu.liveStartTime <= nowTime &&
  613. menu.liveEndTime > nowTime
  614. "
  615. >
  616. 直播中
  617. </div>
  618. <div
  619. class="live-btn"
  620. v-if="menu.liveEndTime < nowTime"
  621. >
  622. 已结束
  623. </div>
  624. </template>
  625. </div>
  626. </div>
  627. </div>
  628. </template>
  629. </div>
  630. </div>
  631. </template>
  632. <template v-if="tab.name == '2'">
  633. <div class="right-box__body">
  634. <div
  635. class="item"
  636. v-for="(menu, index) in reMenuList"
  637. :key="index"
  638. >
  639. <template v-if="menu.type == 1">
  640. <div
  641. class="item__title"
  642. @click="openModule(menu)"
  643. >
  644. <i
  645. :class="{
  646. 'el-icon-caret-right': !menu.showList,
  647. 'el-icon-caret-bottom': menu.showList,
  648. }"
  649. ></i>
  650. {{ menu.menuName }}
  651. </div>
  652. <div class="item__content">
  653. <div
  654. class="bank-chapter"
  655. v-if="menu.showList"
  656. >
  657. <div
  658. class="bank-chapter__item"
  659. v-for="(
  660. chapter, chapterIndex
  661. ) in menu.list"
  662. :key="chapterIndex"
  663. >
  664. <div
  665. class="bank-chapter__item__text"
  666. @click="openChapter(chapter)"
  667. >
  668. <i
  669. :class="{
  670. 'el-icon-caret-right':
  671. !chapter.showList,
  672. 'el-icon-caret-bottom':
  673. chapter.showList,
  674. }"
  675. ></i
  676. >{{ chapter.name }}
  677. </div>
  678. <div
  679. class="bank-section"
  680. v-if="chapter.showList"
  681. >
  682. <div
  683. class="bank-section__item"
  684. :class="{
  685. active: isActive(section),
  686. }"
  687. v-for="(
  688. section, sectionIndex
  689. ) in chapter.list"
  690. :key="sectionIndex"
  691. @click="getResource(section)"
  692. >
  693. <template v-if="section.type != 2">
  694. <template>
  695. <div
  696. class="note note--blue"
  697. v-if="
  698. section.sectionType == 1
  699. "
  700. >
  701. 录播
  702. </div>
  703. <div
  704. class="note"
  705. v-if="
  706. section.sectionType == 2
  707. "
  708. >
  709. 直播
  710. </div>
  711. <div
  712. class="note note--yellow"
  713. v-if="
  714. section.sectionType == 3
  715. "
  716. >
  717. 回放
  718. </div>
  719. <div
  720. class="
  721. bank-section__item__text
  722. "
  723. >
  724. {{ section.name }}
  725. <div
  726. style="font-size: 12px"
  727. v-if="
  728. section.liveStartTime >
  729. nowTime
  730. "
  731. >
  732. <span>{{
  733. $tools.timestampToTime(
  734. section.liveStartTime,
  735. (isDay = false)
  736. )
  737. }}</span
  738. >-
  739. <span>{{
  740. $tools.timestampToTime(
  741. section.liveEndTime,
  742. (isDay = false)
  743. )
  744. }}</span>
  745. </div>
  746. </div>
  747. </template>
  748. <template
  749. v-if="section.durationTime > 0"
  750. >
  751. <div class="during">
  752. {{
  753. $tools.secondToDate(
  754. section.durationTime
  755. )
  756. }}
  757. </div>
  758. </template>
  759. <template>
  760. <div
  761. class="btn"
  762. v-if="section.rebuild > 0"
  763. >
  764. 待重修
  765. </div>
  766. <template v-else>
  767. <div
  768. class="btn btn--green"
  769. v-if="section.learning == 1"
  770. >
  771. 已看完
  772. </div>
  773. </template>
  774. </template>
  775. <template
  776. v-if="
  777. section.liveStartTime &&
  778. section.sectionType != 3
  779. "
  780. >
  781. <div
  782. class="
  783. live-btn live-btn--blue
  784. "
  785. v-if="
  786. section.liveStartTime >
  787. nowTime
  788. "
  789. >
  790. 待开播
  791. </div>
  792. <div
  793. class="
  794. live-btn live-btn--yellow
  795. "
  796. v-if="
  797. section.liveStartTime <=
  798. nowTime &&
  799. section.liveEndTime >
  800. nowTime
  801. "
  802. >
  803. 直播中
  804. </div>
  805. <div
  806. class="live-btn"
  807. v-if="
  808. section.liveEndTime <
  809. nowTime
  810. "
  811. >
  812. 已结束
  813. </div>
  814. </template>
  815. </template>
  816. <template v-if="section.type == 2">
  817. <template>
  818. <div
  819. class="test-btn"
  820. v-if="section.doType == 1"
  821. >
  822. 练习
  823. </div>
  824. <div
  825. class="test-btn"
  826. v-if="section.doType != 1"
  827. >
  828. 考试
  829. </div>
  830. </template>
  831. <div
  832. class="bank-section__item__text"
  833. >
  834. {{ section.name }}
  835. </div>
  836. <template>
  837. <div
  838. class="btn"
  839. v-if="section.rebuild > 0"
  840. >
  841. 待重修
  842. </div>
  843. <template v-else>
  844. <div
  845. class="btn btn--green"
  846. v-if="section.learning == 1"
  847. >
  848. 合格
  849. </div>
  850. <div
  851. class="btn btn--red"
  852. v-if="section.learning == 0"
  853. >
  854. 不合格
  855. </div>
  856. <div
  857. class="btn btn--green"
  858. v-if="section.rebuild > 0"
  859. >
  860. 待重测
  861. </div>
  862. </template>
  863. </template>
  864. </template>
  865. </div>
  866. </div>
  867. </div>
  868. </div>
  869. </div>
  870. </template>
  871. <template v-if="menu.type == 2">
  872. <div class="item__content">
  873. <div class="bank-chapter">
  874. <div class="bank-chapter__item">
  875. <div
  876. class="bank-chapter__item__text"
  877. @click="openChapter(menu)"
  878. >
  879. <i
  880. :class="{
  881. 'el-icon-caret-right':
  882. !menu.showList,
  883. 'el-icon-caret-bottom':
  884. menu.showList,
  885. }"
  886. ></i
  887. >{{ menu.menuName }}
  888. </div>
  889. <div
  890. class="bank-section"
  891. v-if="menu.showList"
  892. >
  893. <div
  894. class="bank-section__item"
  895. :class="{
  896. active: isActive(section),
  897. }"
  898. v-for="(
  899. section, sectionIndex
  900. ) in menu.list"
  901. :key="sectionIndex"
  902. @click="getResource(section)"
  903. >
  904. <template v-if="section.type != 2">
  905. <template>
  906. <div
  907. class="note note--blue"
  908. v-if="
  909. section.sectionType == 1
  910. "
  911. >
  912. 录播
  913. </div>
  914. <div
  915. class="note"
  916. v-if="
  917. section.sectionType == 2
  918. "
  919. >
  920. 直播
  921. </div>
  922. <div
  923. class="note note--yellow"
  924. v-if="
  925. section.sectionType == 3
  926. "
  927. >
  928. 回放
  929. </div>
  930. </template>
  931. <div
  932. class="bank-section__item__text"
  933. >
  934. {{ section.name }}
  935. <div
  936. style="font-size: 12px"
  937. v-if="
  938. section.liveStartTime >
  939. nowTime
  940. "
  941. >
  942. <span>{{
  943. $tools.timestampToTime(
  944. section.liveStartTime,
  945. (isDay = false)
  946. )
  947. }}</span
  948. >-
  949. <span>{{
  950. $tools.timestampToTime(
  951. section.liveEndTime,
  952. (isDay = false)
  953. )
  954. }}</span>
  955. </div>
  956. </div>
  957. <template
  958. v-if="section.durationTime > 0"
  959. >
  960. <div class="during">
  961. {{
  962. $tools.secondToDate(
  963. section.durationTime
  964. )
  965. }}
  966. </div>
  967. </template>
  968. <template>
  969. <div
  970. class="btn"
  971. v-if="section.rebuild > 0"
  972. >
  973. 待重修
  974. </div>
  975. <template v-else>
  976. <div
  977. class="btn btn--green"
  978. v-if="section.learning == 1"
  979. >
  980. 已看完
  981. </div>
  982. </template>
  983. </template>
  984. <template
  985. v-if="
  986. section.liveStartTime &&
  987. section.sectionType != 3
  988. "
  989. >
  990. <div
  991. class="
  992. live-btn live-btn--blue
  993. "
  994. v-if="
  995. section.liveStartTime >
  996. nowTime
  997. "
  998. >
  999. 待开播
  1000. </div>
  1001. <div
  1002. class="
  1003. live-btn live-btn--yellow
  1004. "
  1005. v-if="
  1006. section.liveStartTime <=
  1007. nowTime &&
  1008. section.liveEndTime >
  1009. nowTime
  1010. "
  1011. >
  1012. 直播中
  1013. </div>
  1014. <div
  1015. class="live-btn"
  1016. v-if="
  1017. section.liveEndTime <
  1018. nowTime
  1019. "
  1020. >
  1021. 已结束
  1022. </div>
  1023. </template>
  1024. </template>
  1025. <template v-if="section.type == 2">
  1026. <template>
  1027. <div
  1028. class="test-btn"
  1029. v-if="section.doType == 1"
  1030. >
  1031. 练习
  1032. </div>
  1033. <div
  1034. class="test-btn"
  1035. v-if="section.doType != 1"
  1036. >
  1037. 考试
  1038. </div>
  1039. </template>
  1040. <div
  1041. class="bank-section__item__text"
  1042. >
  1043. {{ section.name }}
  1044. </div>
  1045. <template>
  1046. <div
  1047. class="btn"
  1048. v-if="section.rebuild > 0"
  1049. >
  1050. 待重修
  1051. </div>
  1052. <template v-else>
  1053. <div
  1054. class="btn btn--green"
  1055. v-if="section.learning == 1"
  1056. >
  1057. 合格
  1058. </div>
  1059. <div
  1060. class="btn btn--red"
  1061. v-if="section.learning == 0"
  1062. >
  1063. 不合格
  1064. </div>
  1065. <div
  1066. class="btn btn--green"
  1067. v-if="section.rebuild > 0"
  1068. >
  1069. 待重测
  1070. </div>
  1071. </template>
  1072. </template>
  1073. </template>
  1074. </div>
  1075. </div>
  1076. </div>
  1077. </div>
  1078. </div>
  1079. </template>
  1080. <template v-if="menu.type == 3">
  1081. <div class="item__content">
  1082. <div class="bank-section">
  1083. <div
  1084. class="bank-section__item"
  1085. :class="{
  1086. active: isActive(menu),
  1087. }"
  1088. @click="getResource(menu)"
  1089. >
  1090. <template>
  1091. <div
  1092. class="note note--blue"
  1093. v-if="menu.sectionType == 1"
  1094. >
  1095. 录播
  1096. </div>
  1097. <div
  1098. class="note"
  1099. v-if="menu.sectionType == 2"
  1100. >
  1101. 直播
  1102. </div>
  1103. <div
  1104. class="note note--yellow"
  1105. v-if="menu.sectionType == 3"
  1106. >
  1107. 回放
  1108. </div>
  1109. <div class="bank-section__item__text">
  1110. {{ menu.name }}
  1111. <div
  1112. style="font-size: 12px"
  1113. v-if="
  1114. menu.liveStartTime > nowTime
  1115. "
  1116. >
  1117. <span>{{
  1118. $tools.timestampToTime(
  1119. menu.liveStartTime,
  1120. (isDay = false)
  1121. )
  1122. }}</span
  1123. >-
  1124. <span>{{
  1125. $tools.timestampToTime(
  1126. menu.liveEndTime,
  1127. (isDay = false)
  1128. )
  1129. }}</span>
  1130. </div>
  1131. </div>
  1132. </template>
  1133. <template v-if="menu.durationTime > 0">
  1134. <div class="during">
  1135. {{
  1136. $tools.secondToDate(
  1137. menu.durationTime
  1138. )
  1139. }}
  1140. </div>
  1141. </template>
  1142. <template>
  1143. <div
  1144. class="btn"
  1145. v-if="menu.rebuild > 0"
  1146. >
  1147. 待重修
  1148. </div>
  1149. <template v-else>
  1150. <div
  1151. class="btn btn--green"
  1152. v-if="menu.learning == 1"
  1153. >
  1154. 已看完
  1155. </div>
  1156. </template>
  1157. </template>
  1158. <template
  1159. v-if="
  1160. menu.liveStartTime &&
  1161. menu.sectionType != 3
  1162. "
  1163. >
  1164. <div
  1165. class="live-btn live-btn--blue"
  1166. v-if="menu.liveStartTime > nowTime"
  1167. >
  1168. 待开播
  1169. </div>
  1170. <div
  1171. class="live-btn live-btn--yellow"
  1172. v-if="
  1173. menu.liveStartTime <= nowTime &&
  1174. menu.liveEndTime > nowTime
  1175. "
  1176. >
  1177. 直播中
  1178. </div>
  1179. <div
  1180. class="live-btn"
  1181. v-if="menu.liveEndTime < nowTime"
  1182. >
  1183. 已结束
  1184. </div>
  1185. </template>
  1186. </div>
  1187. </div>
  1188. </div>
  1189. </template>
  1190. </div>
  1191. </div>
  1192. </template>
  1193. </el-tab-pane>
  1194. </el-tabs>
  1195. </div>
  1196. </div>
  1197. </div>
  1198. </div>
  1199. <div class="course-info__body">
  1200. <el-tabs v-model="activeName">
  1201. <el-tab-pane
  1202. v-for="(item, index) in tabList"
  1203. :key="index"
  1204. :name="item.name"
  1205. :label="item.label"
  1206. >
  1207. <template v-if="item.label == '学员须知'">
  1208. <div class="course-menu clearfix">
  1209. <div class="left-box">
  1210. <div class="left-box__body">
  1211. <div
  1212. class="buy-note"
  1213. v-html="
  1214. goodsData.buyNote &&
  1215. goodsData.buyNote.replace(/\n|\r\n/g, '<br>')
  1216. "
  1217. ></div>
  1218. </div>
  1219. </div>
  1220. <div class="right-box">
  1221. <div class="title">
  1222. 推荐课程
  1223. <a class="more" @click="go('/course-list')"
  1224. >更多></a
  1225. >
  1226. </div>
  1227. <ul class="list">
  1228. <li
  1229. class="course-item"
  1230. v-for="(itemy, index) in compyRecommend(
  1231. recommendList.goodsList
  1232. )"
  1233. :key="index"
  1234. >
  1235. <GoodsItem :item="itemy"></GoodsItem>
  1236. <!-- <div
  1237. class="course-item__img"
  1238. :style="`background-image:url(${$tools.splitImgHost(
  1239. itemy.coverUrl,
  1240. true
  1241. )})`"
  1242. @click="toGoodsDetail(itemy)"
  1243. >
  1244. <div class="note" v-if="itemy.year">
  1245. {{ itemy.year }}
  1246. </div>
  1247. </div>
  1248. <div class="course-item__title">
  1249. {{ itemy.goodsName }}
  1250. </div>
  1251. <div class="course-item__desc">
  1252. <div class="price">
  1253. ¥{{ itemy.standPrice }}
  1254. </div>
  1255. <a
  1256. class="add"
  1257. @click.stop="addCart(true, itemy.goodsId)"
  1258. >加购物车</a
  1259. >
  1260. </div> -->
  1261. </li>
  1262. </ul>
  1263. </div>
  1264. </div>
  1265. </template>
  1266. <template v-if="item.label == '课程答疑'">
  1267. <div class="answer-question">
  1268. <div class="answer-question__header clearfix">
  1269. <div class="textarea-wrap">
  1270. <el-input
  1271. class="textarea"
  1272. v-model="textarea"
  1273. rows="3"
  1274. type="textarea"
  1275. placeholder=""
  1276. ></el-input>
  1277. </div>
  1278. <el-button
  1279. type="primary"
  1280. class="submit"
  1281. @click="addAnswer"
  1282. >提出疑问</el-button
  1283. >
  1284. </div>
  1285. <div class="answer-question__body">
  1286. <div class="question-list">
  1287. <div
  1288. v-if="answerList.length == 0"
  1289. style="text-align: center"
  1290. >
  1291. 暂无记录
  1292. </div>
  1293. <div
  1294. class="question-list__item"
  1295. v-for="(item, index) in answerList"
  1296. :key="index"
  1297. >
  1298. <div class="question-list__item__avatar">
  1299. <img
  1300. v-if="item.assignRealname"
  1301. :src="$tools.splitImgHost(item.assignAvatar)"
  1302. alt=""
  1303. />
  1304. <img
  1305. v-else
  1306. :src="$tools.splitImgHost(item.avatar)"
  1307. alt=""
  1308. />
  1309. </div>
  1310. <div class="question-list__item__content">
  1311. <div class="nickname">
  1312. {{ item.realname }}
  1313. </div>
  1314. <div class="desc">
  1315. {{ item.answerText }}
  1316. </div>
  1317. <div class="time">
  1318. {{
  1319. $tools.timestampToTime(
  1320. item.createTime,
  1321. false
  1322. )
  1323. }}
  1324. <div
  1325. class="del"
  1326. v-if="item.userId !== userInfo.userId"
  1327. @click="answerBack(item)"
  1328. >
  1329. <el-button type="text">回复</el-button>
  1330. </div>
  1331. <div
  1332. class="del"
  1333. @click="del(item)"
  1334. v-if="item.userId === userInfo.userId"
  1335. >
  1336. 删除
  1337. </div>
  1338. </div>
  1339. <div
  1340. class="reply-list"
  1341. v-if="
  1342. item.newArraysAnswerList &&
  1343. item.newArraysAnswerList.length
  1344. "
  1345. >
  1346. <div
  1347. class="reply-list__item"
  1348. v-for="(
  1349. items, indexs
  1350. ) in item.newArraysAnswerList"
  1351. :key="indexs"
  1352. >
  1353. <div class="reply-list__item__avatar">
  1354. <img
  1355. :src="$tools.splitImgHost(items.avatar)"
  1356. alt=""
  1357. />
  1358. </div>
  1359. <div class="reply-list__item__content">
  1360. <div class="nickname">
  1361. {{ items.realname }}
  1362. </div>
  1363. <div class="desc">
  1364. 回复
  1365. <span
  1366. style="
  1367. margin: 0px 4px;
  1368. color: #409eff;
  1369. "
  1370. >@{{ items.assignRealname }}</span
  1371. >
  1372. {{ items.answerText }}
  1373. </div>
  1374. <div class="time">
  1375. {{
  1376. $tools.timestampToTime(
  1377. items.createTime,
  1378. false
  1379. )
  1380. }}
  1381. <div
  1382. class="del"
  1383. @click="del(items)"
  1384. v-if="
  1385. items.userId === userInfo.userId
  1386. "
  1387. >
  1388. 删除
  1389. </div>
  1390. <div
  1391. class="reply"
  1392. v-if="
  1393. items.userId !== userInfo.userId
  1394. "
  1395. @click="answerBack(items)"
  1396. >
  1397. 回复
  1398. </div>
  1399. </div>
  1400. </div>
  1401. </div>
  1402. </div>
  1403. </div>
  1404. </div>
  1405. </div>
  1406. </div>
  1407. </div>
  1408. </template>
  1409. <template v-if="item.label == '笔记讲义'">
  1410. <div class="lecture-notes">
  1411. <div class="lecture-notes__content clearfix">
  1412. <div class="left-box">
  1413. <div
  1414. class="textarea clearfix"
  1415. v-if="!(isPlayRebuild > 0) && !vidzb"
  1416. >
  1417. <el-input
  1418. resize="none"
  1419. rows="3"
  1420. v-model="textareaNote"
  1421. type="textarea"
  1422. placeholder="觉得重要的就记下来吧~"
  1423. ></el-input>
  1424. <el-button
  1425. type="primary"
  1426. class="submit"
  1427. @click="noteSubmit"
  1428. >
  1429. 提交笔记
  1430. </el-button>
  1431. </div>
  1432. <div class="note-list">
  1433. <div
  1434. v-if="noteList.length == 0"
  1435. style="text-align: center"
  1436. >
  1437. 暂无笔记
  1438. </div>
  1439. <div
  1440. class="note-list__content"
  1441. v-for="(item, index) in noteList"
  1442. :key="index"
  1443. >
  1444. <div class="note-list__content__title">
  1445. {{ $tools.timestampToTime(item.dateNote) }}
  1446. </div>
  1447. <div
  1448. class="note-list__item"
  1449. v-for="(note, index) in item.userNotes"
  1450. :key="index"
  1451. >
  1452. <i
  1453. class="el-icon-video-play"
  1454. @click="noteClick(note)"
  1455. ></i>
  1456. <div class="note-list__item__content">
  1457. <div class="title" @click="noteClick(note)">
  1458. {{ $tools.secondToDate(note.noteSecond) }}
  1459. </div>
  1460. <div class="desc">
  1461. {{ note.sectionName }}
  1462. </div>
  1463. <div class="time">{{ note.noteText }}</div>
  1464. </div>
  1465. </div>
  1466. </div>
  1467. </div>
  1468. <div class="pagination">
  1469. <el-pagination
  1470. background
  1471. layout="prev, pager, next"
  1472. :total="noteTotal"
  1473. :page-size="noteParams.pageSize"
  1474. >
  1475. </el-pagination>
  1476. </div>
  1477. </div>
  1478. <div class="right-box" v-if="courseHandoutsData">
  1479. <div class="lecture-list">
  1480. <div class="lecture-list__header">
  1481. 讲义
  1482. <div
  1483. class="slide-btn"
  1484. @click="lectureShow = !lectureShow"
  1485. >
  1486. 收起
  1487. </div>
  1488. </div>
  1489. <div
  1490. class="lecture-list__body"
  1491. v-if="lectureShow"
  1492. >
  1493. <div class="list">
  1494. <div class="list__item">
  1495. <div class="title">
  1496. {{ courseHandoutsData.handoutsName }}
  1497. </div>
  1498. <div class="btns">
  1499. <div
  1500. class="btn"
  1501. @click="
  1502. previvew(
  1503. $tools.splitImgHost(
  1504. courseHandoutsData.handoutsUrl
  1505. )
  1506. )
  1507. "
  1508. >
  1509. 预览
  1510. </div>
  1511. <div
  1512. v-if="
  1513. courseHandoutsData.canDownload == 1
  1514. ? true
  1515. : false
  1516. "
  1517. class="btn"
  1518. @click="
  1519. printView(
  1520. $tools.splitImgHost(
  1521. courseHandoutsData.handoutsUrl
  1522. )
  1523. )
  1524. "
  1525. >
  1526. 打印
  1527. </div>
  1528. <div
  1529. v-if="
  1530. courseHandoutsData.canDownload == 1
  1531. ? true
  1532. : false
  1533. "
  1534. class="btn"
  1535. @click="
  1536. download(
  1537. $tools.splitImgHost(
  1538. courseHandoutsData.handoutsUrl
  1539. ),
  1540. courseHandoutsData.urlName
  1541. )
  1542. "
  1543. >
  1544. 下载
  1545. </div>
  1546. </div>
  1547. </div>
  1548. </div>
  1549. </div>
  1550. </div>
  1551. <div class="lecture-list__footer" v-if="showPdf">
  1552. <div class="lecture-scan">
  1553. <div class="lecture-scan__header">
  1554. {{ courseHandoutsData.urlName }}
  1555. </div>
  1556. <div class="lecture-scan__body">
  1557. <pdf
  1558. class="iframe"
  1559. :src="
  1560. $tools.splitImgHost(
  1561. courseHandoutsData.handoutsUrl
  1562. )
  1563. "
  1564. v-for="i in numPages"
  1565. :key="i"
  1566. :page="i"
  1567. ref="pdf"
  1568. ></pdf>
  1569. <iframe
  1570. id="printIframe"
  1571. :src="
  1572. $tools.splitImgHost(
  1573. courseHandoutsData.handoutsUrl
  1574. )
  1575. "
  1576. frameborder="0"
  1577. style="display: none"
  1578. ></iframe>
  1579. </div>
  1580. </div>
  1581. </div>
  1582. </div>
  1583. </div>
  1584. </div>
  1585. </template>
  1586. </el-tab-pane>
  1587. </el-tabs>
  1588. </div>
  1589. </div>
  1590. </div>
  1591. </div>
  1592. </div>
  1593. </section>
  1594. <el-dialog
  1595. width="800px"
  1596. class="take-photo"
  1597. :visible.sync="takePhotoModal"
  1598. :close-on-click-modal="false"
  1599. :close-on-press-escape="false"
  1600. :show-close="false"
  1601. >
  1602. <div class="take-photo__content">
  1603. <!-- <div class="take-photo__close" @click="takePhotoModal = false">X</div> -->
  1604. <div class="take-photo__header">人脸验证</div>
  1605. <div class="take-photo__body clearfix">
  1606. <div class="left-box">
  1607. <div class="title">重要提示:</div>
  1608. <div class="content">
  1609. <p>1、请保证摄像头正对自己,避免头像偏左或者偏右。</p>
  1610. <p>
  1611. 2、请保证拍照环境光线充足(照片太暗或曝光会降低验证通过率)。
  1612. </p>
  1613. <p>
  1614. 3、请保证整个头像在人脸识别区域内,脸部无遮挡装饰物(佩戴眼镜会降低通过率)。
  1615. </p>
  1616. <p>
  1617. 4、如果下面视频中出现黑屏,摄像头可能被其他进程占用,请关闭其他调用摄像头的程序,重新刷新当前页面重新拍照识别。
  1618. </p>
  1619. </div>
  1620. </div>
  1621. <div class="right-box">
  1622. <img v-show="!isTaking" :src="faceUrl" alt="" />
  1623. <video v-show="isTaking" id="video" :src="stream"></video>
  1624. <div class="mask"></div>
  1625. </div>
  1626. </div>
  1627. <div class="take-photo__footer">
  1628. <el-button
  1629. type="primary"
  1630. v-if="isTaking"
  1631. class="take"
  1632. @click="onPhoto"
  1633. >拍照</el-button
  1634. >
  1635. <el-button
  1636. type="primary"
  1637. v-if="!isTaking"
  1638. class="take"
  1639. :loading="loading"
  1640. @click="reTake"
  1641. >重拍</el-button
  1642. >
  1643. <el-button
  1644. type="primary"
  1645. v-if="!isTaking"
  1646. :loading="loading"
  1647. class="take"
  1648. @click="takeOk"
  1649. >确认</el-button
  1650. >
  1651. </div>
  1652. </div>
  1653. </el-dialog>
  1654. <el-dialog
  1655. width="996px"
  1656. height="600px"
  1657. class="info"
  1658. :visible.sync="showInfoDetailModal"
  1659. :close-on-click-modal="false"
  1660. :close-on-press-escape="false"
  1661. :show-close="false"
  1662. title="资料填写"
  1663. >
  1664. <div class="info__content">
  1665. <el-form
  1666. :model="infoForm"
  1667. ref="infoForm"
  1668. :rules="rules"
  1669. :error-type="errorType"
  1670. >
  1671. <template v-for="(item, index) in listData">
  1672. <el-form-item
  1673. :key="index"
  1674. v-if="item.fieldKey == 'name'"
  1675. :label="item.fieldName"
  1676. :required="item.required"
  1677. label-width="120px"
  1678. :prop="item.required ? item.fieldKey : ''"
  1679. >
  1680. <el-input
  1681. :disabled="true"
  1682. v-model="infoForm.name"
  1683. :placeholder="`请输入${item.fieldName}`"
  1684. />
  1685. </el-form-item>
  1686. <el-form-item
  1687. :key="index"
  1688. v-if="item.fieldKey == 'idcard'"
  1689. :label="item.fieldName"
  1690. :required="item.required"
  1691. label-width="120px"
  1692. :prop="item.required ? item.fieldKey : ''"
  1693. >
  1694. <el-input
  1695. :disabled="true"
  1696. v-model="infoForm.idcard"
  1697. :placeholder="`请输入${item.fieldName}`"
  1698. />
  1699. </el-form-item>
  1700. <el-form-item
  1701. :key="index"
  1702. v-if="item.fieldKey == 'telphone'"
  1703. :label="item.fieldName"
  1704. :required="item.required"
  1705. label-width="120px"
  1706. :prop="item.required ? item.fieldKey : ''"
  1707. >
  1708. <el-input
  1709. :disabled="true"
  1710. v-model="infoForm.telphone"
  1711. :placeholder="`请输入${item.fieldName}`"
  1712. />
  1713. </el-form-item>
  1714. <el-form-item
  1715. :key="index"
  1716. v-if="item.fieldKey == 'school'"
  1717. :label="item.fieldName"
  1718. :required="item.required"
  1719. label-width="120px"
  1720. :prop="item.required ? item.fieldKey : ''"
  1721. >
  1722. <el-input
  1723. v-model="infoForm.school"
  1724. :placeholder="`请输入${item.fieldName}`"
  1725. />
  1726. </el-form-item>
  1727. <el-form-item
  1728. :key="index"
  1729. v-if="item.fieldKey == 'work_unit'"
  1730. :label="item.fieldName"
  1731. :required="item.required"
  1732. label-width="120px"
  1733. :prop="item.required ? item.fieldKey : ''"
  1734. >
  1735. <el-input
  1736. v-model="infoForm.work_unit"
  1737. :placeholder="`请输入${item.fieldName}`"
  1738. />
  1739. </el-form-item>
  1740. <el-form-item
  1741. :key="index"
  1742. v-if="item.fieldKey == 'unit_contact'"
  1743. :label="item.fieldName"
  1744. :required="item.required"
  1745. label-width="120px"
  1746. :prop="item.required ? item.fieldKey : ''"
  1747. >
  1748. <el-input
  1749. v-model="infoForm.unit_contact"
  1750. :placeholder="`请输入${item.fieldName}`"
  1751. />
  1752. </el-form-item>
  1753. <el-form-item
  1754. :key="index"
  1755. v-if="item.fieldKey == 'unit_tel'"
  1756. :label="item.fieldName"
  1757. :required="item.required"
  1758. label-width="120px"
  1759. :prop="item.required ? item.fieldKey : ''"
  1760. >
  1761. <el-input
  1762. v-model="infoForm.unit_tel"
  1763. :placeholder="`请输入${item.fieldName}`"
  1764. />
  1765. </el-form-item>
  1766. <el-form-item
  1767. :key="index"
  1768. v-if="item.fieldKey == 'apply_post'"
  1769. :label="item.fieldName"
  1770. :required="item.required"
  1771. label-width="120px"
  1772. :prop="item.required ? item.fieldKey : ''"
  1773. >
  1774. <el-input
  1775. :disabled="apply_post_disabled"
  1776. v-model="infoForm.apply_post"
  1777. :placeholder="`请输入${item.fieldName}`"
  1778. />
  1779. </el-form-item>
  1780. <el-form-item
  1781. :key="index"
  1782. v-if="item.fieldKey == 'major'"
  1783. :label="item.fieldName"
  1784. :required="item.required"
  1785. label-width="120px"
  1786. :prop="item.required ? item.fieldKey : ''"
  1787. >
  1788. <el-input
  1789. v-model="infoForm.major"
  1790. :placeholder="`请输入${item.fieldName}`"
  1791. />
  1792. </el-form-item>
  1793. <el-form-item
  1794. :key="index"
  1795. v-if="item.inputType == 2"
  1796. :label="item.fieldName"
  1797. label-width="120px"
  1798. :required="item.required"
  1799. :prop="item.required ? item.fieldKey : ''"
  1800. >
  1801. <el-select v-model="infoForm[item.fieldKey]" placeholder="">
  1802. <el-option
  1803. v-for="(option, optionIndex) in getarrays(item.fieldKey)"
  1804. :key="optionIndex"
  1805. :label="option"
  1806. :value="optionIndex + ''"
  1807. ></el-option>
  1808. </el-select>
  1809. </el-form-item>
  1810. <el-form-item
  1811. :key="index"
  1812. v-if="item.inputType == 5"
  1813. :label="item.fieldName"
  1814. label-width="120px"
  1815. :required="item.required"
  1816. :prop="item.required ? item.fieldKey : ''"
  1817. >
  1818. <el-date-picker
  1819. v-model="infoForm[item.fieldKey]"
  1820. align="right"
  1821. type="date"
  1822. placeholder="选择日期"
  1823. >
  1824. </el-date-picker>
  1825. </el-form-item>
  1826. <el-form-item
  1827. :key="index"
  1828. v-if="
  1829. item.inputType == 3 &&
  1830. item.fieldKey !== 'commitment_electr_signature'
  1831. "
  1832. :label="item.fieldName"
  1833. :required="item.required"
  1834. label-width="120px"
  1835. label-position="top"
  1836. :prop="item.required ? item.fieldKey : ''"
  1837. >
  1838. <el-upload
  1839. action=""
  1840. :max-size="2097152"
  1841. accept="image/jpeg, image/jpg, image/png"
  1842. :show-file-list="false"
  1843. list-type="picture"
  1844. :auto-upload="false"
  1845. :ref="
  1846. item.fieldKey === 'recent_photos'
  1847. ? 'recent_photos'
  1848. : item.fieldKey === 'idcard_face_photo'
  1849. ? 'idcard_face_photo'
  1850. : item.fieldKey === 'idcard_national_photo'
  1851. ? 'idcard_national_photo'
  1852. : ''
  1853. "
  1854. :on-change="
  1855. item.fieldKey === 'recent_photos'
  1856. ? changePhotoListHeader1
  1857. : item.fieldKey === 'idcard_face_photo'
  1858. ? changePhotoListHeader2
  1859. : item.fieldKey === 'idcard_national_photo'
  1860. ? changePhotoListHeader3
  1861. : ''
  1862. "
  1863. :file-list="
  1864. item.fieldKey === 'recent_photos'
  1865. ? fileList1
  1866. : item.fieldKey === 'idcard_face_photo'
  1867. ? fileList2
  1868. : item.fieldKey === 'idcard_national_photo'
  1869. ? fileList3
  1870. : ''
  1871. "
  1872. >
  1873. <div class="upload-box">
  1874. <div
  1875. :style="
  1876. item.fieldKey === 'recent_photos'
  1877. ? 'width: 120px; height: 169px;background:url(' +
  1878. require('@/assets/info_1.png') +
  1879. ') no-repeat center;background-size:cover;position:relative;'
  1880. : item.fieldKey === 'idcard_face_photo'
  1881. ? 'width: 120px; height: 82px;background:url(' +
  1882. require('@/assets/info_2.png') +
  1883. ') no-repeat center;background-size:cover;position:relative;'
  1884. : item.fieldKey === 'idcard_national_photo'
  1885. ? 'width: 120px; height: 82px;background:url(' +
  1886. require('@/assets/info_3.png') +
  1887. ') no-repeat center;background-size:cover;position:relative;'
  1888. : ''
  1889. "
  1890. >
  1891. <i
  1892. @click="deleteImg(item)"
  1893. class="el-icon-error"
  1894. v-if="
  1895. item.fieldKey === 'recent_photos'
  1896. ? fileList1[0]
  1897. : item.fieldKey === 'idcard_face_photo'
  1898. ? fileList2[0]
  1899. : item.fieldKey === 'idcard_national_photo'
  1900. ? fileList3[0]
  1901. : ''
  1902. "
  1903. ></i>
  1904. <el-image
  1905. style="width: 100%; height: 100%"
  1906. :src="
  1907. item.fieldKey === 'recent_photos'
  1908. ? $tools.splitImgHost(fileList1[0].url)
  1909. : item.fieldKey === 'idcard_face_photo'
  1910. ? $tools.splitImgHost(fileList2[0].url)
  1911. : item.fieldKey === 'idcard_national_photo'
  1912. ? $tools.splitImgHost(fileList3[0].url)
  1913. : ''
  1914. "
  1915. v-if="
  1916. item.fieldKey === 'recent_photos'
  1917. ? fileList1[0]
  1918. : item.fieldKey === 'idcard_face_photo'
  1919. ? fileList2[0]
  1920. : item.fieldKey === 'idcard_national_photo'
  1921. ? fileList3[0]
  1922. : ''
  1923. "
  1924. :preview-src-list="
  1925. item.fieldKey === 'recent_photos'
  1926. ? [$tools.splitImgHost(fileList1[0].url)]
  1927. : item.fieldKey === 'idcard_face_photo'
  1928. ? [$tools.splitImgHost(fileList2[0].url)]
  1929. : item.fieldKey === 'idcard_national_photo'
  1930. ? [$tools.splitImgHost(fileList3[0].url)]
  1931. : ''
  1932. "
  1933. >
  1934. </el-image>
  1935. </div>
  1936. <div>
  1937. <span
  1938. v-if="item.fieldKey === 'recent_photos'"
  1939. style="color: #999999"
  1940. >竖向白底证件照 文件大小≤2M</span
  1941. >
  1942. <span
  1943. v-if="
  1944. item.fieldKey === 'idcard_face_photo' ||
  1945. item.fieldKey === 'idcard_national_photo'
  1946. "
  1947. style="color: #999999"
  1948. >
  1949. 文件大小≤2M
  1950. </span>
  1951. </div>
  1952. </div>
  1953. <div style="display: inline-block" slot="trigger">
  1954. <el-button type="primary" size="small" round
  1955. >浏览文件</el-button
  1956. >
  1957. </div>
  1958. </el-upload>
  1959. </el-form-item>
  1960. <div
  1961. :key="index"
  1962. v-if="
  1963. item.inputType == 3 &&
  1964. item.fieldKey === 'commitment_electr_signature'
  1965. "
  1966. >
  1967. <el-form-item
  1968. v-if="
  1969. item.inputType == 3 &&
  1970. item.fieldKey === 'commitment_electr_signature'
  1971. "
  1972. label="承诺书"
  1973. :required="item.required"
  1974. label-width="120px"
  1975. label-position="top"
  1976. >
  1977. <div style="line-height: 40px; text-indent: 2em">
  1978. <span>
  1979. 本人自愿做出如下承诺:本人己仔细阅读《广东省住房和城乡建设厅关于推进住房和城乡建设领域施工现场专业人员职业培训工作的通知》
  1980. 全部内容并知晓和理解,本人的学历证书、身份证、工作年限、相片等所有资料完全真实、符合报名条件、资格审查要求和相关规定,本人在报名、审查、培训、测试等有关的事项中会严格道守相关规定和要求,如有虛假或与实际规定不符等情况造成的一切后果由本人承担。
  1981. </span>
  1982. <div style="line-height: 40px; text-indent: 2em">
  1983. <span>特此承诺!</span>
  1984. </div>
  1985. </div>
  1986. </el-form-item>
  1987. <el-form-item
  1988. v-if="
  1989. item.inputType == 3 &&
  1990. item.fieldKey === 'commitment_electr_signature'
  1991. "
  1992. label="签名板"
  1993. :required="item.required"
  1994. label-width="120px"
  1995. label-position="top"
  1996. :prop="item.required ? item.fieldKey : ''"
  1997. >
  1998. <div class="dis_stys">
  1999. <span style="color: #999999">请在下方签名区进行签名</span>
  2000. <el-button
  2001. type="primary"
  2002. size="small"
  2003. @click="retDraw"
  2004. mode=""
  2005. >清空</el-button
  2006. >
  2007. </div>
  2008. <div class="handCenter">
  2009. <vue-esign
  2010. v-if="!infoForm[item.fieldKey]"
  2011. ref="esign"
  2012. :width="600"
  2013. :height="300"
  2014. :isCrop="false"
  2015. :lineWidth="5"
  2016. :lineColor="'#333'"
  2017. />
  2018. <div
  2019. v-else
  2020. style="width: 100%; height: 100%; position: relative"
  2021. >
  2022. <img
  2023. style="width: 100%; height: 100%"
  2024. :src="$tools.splitImgHost(infoForm[item.fieldKey])"
  2025. mode=""
  2026. />
  2027. </div>
  2028. </div>
  2029. </el-form-item>
  2030. </div>
  2031. <el-form-item
  2032. :key="index"
  2033. v-if="item.inputType == 4"
  2034. :label="item.fieldName"
  2035. :required="item.required"
  2036. label-width="120px"
  2037. label-position="top"
  2038. :prop="item.required ? item.fieldKey : ''"
  2039. >
  2040. <el-button
  2041. type="primary"
  2042. size="small"
  2043. round
  2044. @click="downloadStamp(item)"
  2045. >下载模板</el-button
  2046. >
  2047. <el-upload
  2048. action=""
  2049. :max-size="2097152"
  2050. accept="image/jpeg, image/jpg, image/png"
  2051. :show-file-list="false"
  2052. list-type="picture"
  2053. :auto-upload="false"
  2054. ref="stamp"
  2055. :on-change="changePhotoListStamp"
  2056. :file-list="fileListStamp"
  2057. >
  2058. <div style="display: inline-block; vertical-align: top">
  2059. <div
  2060. :style="
  2061. 'width: 120px; height: 120px;background:url(' +
  2062. require('@/assets/info_4.png') +
  2063. ') no-repeat center;background-size:cover;position:relative;'
  2064. "
  2065. >
  2066. <el-image
  2067. style="width: 100%; height: 100%"
  2068. :src="$tools.splitImgHost(fileListStamp[0].url)"
  2069. v-if="fileListStamp[0]"
  2070. :preview-src-list="[
  2071. $tools.splitImgHost(fileListStamp[0].url),
  2072. ]"
  2073. >
  2074. </el-image>
  2075. </div>
  2076. <div>
  2077. <span style="color: #999999">文件大小≤2M</span>
  2078. </div>
  2079. </div>
  2080. <div style="display: inline-block" slot="trigger">
  2081. <el-button type="primary" size="small" round
  2082. >浏览文件</el-button
  2083. >
  2084. </div>
  2085. </el-upload>
  2086. </el-form-item>
  2087. </template>
  2088. </el-form>
  2089. </div>
  2090. <span slot="footer" class="dialog-footer">
  2091. <el-button
  2092. @click="
  2093. showInfoDetailModal = false;
  2094. $router.back(-1);
  2095. "
  2096. >取 消</el-button
  2097. >
  2098. <el-button type="primary" :loading="uploading" @click="submit"
  2099. >确 定</el-button
  2100. >
  2101. </span>
  2102. </el-dialog>
  2103. <el-dialog
  2104. width="996px"
  2105. height="600px"
  2106. class="info"
  2107. :visible.sync="showStampDetailModail"
  2108. :close-on-click-modal="false"
  2109. :close-on-press-escape="false"
  2110. :show-close="false"
  2111. title="资料填写"
  2112. >
  2113. <div class="info__content">
  2114. <el-form
  2115. :model="stampForm"
  2116. ref="stampForm"
  2117. :rules="stampRules"
  2118. :error-type="errorType"
  2119. >
  2120. <template v-for="(item, index) in listDataStamp">
  2121. <el-form-item
  2122. :key="index"
  2123. v-if="item.inputType == 4"
  2124. :label="item.fieldName"
  2125. :required="item.required"
  2126. label-width="120px"
  2127. label-position="top"
  2128. :prop="item.required ? item.fieldKey : ''"
  2129. >
  2130. <el-button
  2131. type="primary"
  2132. size="small"
  2133. round
  2134. @click="downloadStamp(item)"
  2135. >下载模板</el-button
  2136. >
  2137. <el-upload
  2138. action=""
  2139. :max-size="2097152"
  2140. accept="image/jpeg, image/jpg, image/png"
  2141. :show-file-list="false"
  2142. list-type="picture"
  2143. :auto-upload="false"
  2144. ref="stamp"
  2145. :on-change="changePhotoListStamp"
  2146. :file-list="fileListStamp"
  2147. >
  2148. <div style="display: inline-block; vertical-align: top">
  2149. <div
  2150. :style="
  2151. 'width: 120px; height: 120px;background:url(' +
  2152. require('@/assets/info_4.png') +
  2153. ') no-repeat center;background-size:cover;position:relative;'
  2154. "
  2155. >
  2156. <el-image
  2157. style="width: 100%; height: 100%"
  2158. :src="$tools.splitImgHost(fileListStamp[0].url)"
  2159. v-if="fileListStamp[0]"
  2160. :preview-src-list="[
  2161. $tools.splitImgHost(fileListStamp[0].url),
  2162. ]"
  2163. >
  2164. </el-image>
  2165. </div>
  2166. <div>
  2167. <span style="color: #999999">文件大小≤2M</span>
  2168. </div>
  2169. </div>
  2170. <div style="display: inline-block" slot="trigger">
  2171. <el-button type="primary" size="small" round
  2172. >浏览文件</el-button
  2173. >
  2174. </div>
  2175. </el-upload>
  2176. </el-form-item>
  2177. </template>
  2178. </el-form>
  2179. </div>
  2180. <span slot="footer" class="dialog-footer">
  2181. <el-button
  2182. @click="
  2183. showStampDetailModail = false;
  2184. $router.back(-1);
  2185. "
  2186. >取 消</el-button
  2187. >
  2188. <el-button type="primary" :loading="uploading" @click="stampSubmit"
  2189. >确 定</el-button
  2190. >
  2191. </span>
  2192. </el-dialog>
  2193. <el-dialog
  2194. width="996px"
  2195. height="600px"
  2196. class="info"
  2197. :visible.sync="showAgreementModal"
  2198. :close-on-click-modal="false"
  2199. :close-on-press-escape="false"
  2200. :show-close="false"
  2201. title="提示"
  2202. >
  2203. <div class="">
  2204. <div>
  2205. 本产品(或服务)提供【{{
  2206. goodsData.goodsName
  2207. }}】课程的在线学习功能,为使用这些功能,我们需要使用您设备上的摄像头,并收集以下个人信息:
  2208. <span v-for="(item, listIndex) in listData" :key="listIndex"
  2209. >{{ item.fieldName }}、</span
  2210. >
  2211. <!-- 姓名、性别、身份证号码、移动电话号码、身份证照片、一寸照、证书名称/岗位、证书编号、有效期、人脸照片(每节课随机拍摄三张)、 -->
  2212. 学习详细记录。
  2213. </div>
  2214. <div>
  2215. 我们会将上述信息提供至广东省建设执业注册管理中心等第三方组织使用,用于继续教育备案等。如果您拒绝,将导致这些功能无法实现,但不影响您使用本产品(或服务)的其他业务功能。
  2216. </div>
  2217. </div>
  2218. <span slot="footer" class="dialog-footer">
  2219. <el-button @click="$router.back(-1)">取 消</el-button>
  2220. <el-button type="primary" @click="showInfoDetailModal = true"
  2221. >同意并继续</el-button
  2222. >
  2223. </span>
  2224. </el-dialog>
  2225. <div id="printTable"></div>
  2226. <!-- 修改 -->
  2227. <!-- <ToolBar></ToolBar> -->
  2228. <Footer></Footer>
  2229. </div>
  2230. </template>
  2231. <script>
  2232. import Footer from "@/components/footer/index";
  2233. import Header from "@/components/header/index";
  2234. import ToolBar from "@/components/toolbar/index";
  2235. import GoodsItem from "@/components/goodsItem/index";
  2236. import { mapGetters, mapMutations, mapActions } from "vuex";
  2237. import * as baseUrls from "@/axios.js";
  2238. import pdf from "vue-pdf";
  2239. import print from "print-js";
  2240. export default {
  2241. name: "CourseDetail",
  2242. components: {
  2243. Footer,
  2244. Header,
  2245. ToolBar,
  2246. pdf,
  2247. GoodsItem,
  2248. },
  2249. data() {
  2250. return {
  2251. liveDuration: 0,
  2252. numPages: 0,
  2253. showPdf: false,
  2254. // 总页数
  2255. pdfPages: 10,
  2256. // 当前页数
  2257. pageNum: 1,
  2258. // 加载进度
  2259. loadedRatio: 10,
  2260. // 页面加载完成
  2261. curPageNum: 0,
  2262. // 放大系数 默认百分百
  2263. scale: 100,
  2264. // 旋转角度 ‘90’的倍数才有效
  2265. pageRotate: 0,
  2266. // 单击内部链接时触发 (目前我没有遇到使用场景)
  2267. page: 0,
  2268. bgColor: "#ccc",
  2269. answerTimer: null,
  2270. recordObj: {},
  2271. showAgreementModal: false,
  2272. showInfoDetailModal: false,
  2273. showStampDetailModail: false,
  2274. isTaking: true, //是否正在拍照
  2275. photoConfig: false,
  2276. stream: null,
  2277. photoNum: 0,
  2278. playSectionId: 0,
  2279. photoIndex: 0, //当前位于拍照的区间下标 从0开始
  2280. photoHistoryList: [], //已拍照历史的下标点
  2281. moduleId: 0,
  2282. chapterId: 0,
  2283. menuTab: [],
  2284. lectureShow: true,
  2285. textarea: "",
  2286. textareaNote: "",
  2287. takePhotoModal: false,
  2288. activeName: "1",
  2289. courseId: "",
  2290. courseTabIndex: "1",
  2291. goodsId: "",
  2292. gradeId: "",
  2293. livingTimer: null,
  2294. sectionItem: {},
  2295. gradeDetail: {},
  2296. autoplay: false,
  2297. isAllowSeek: "on",
  2298. playbackRate: false,
  2299. goodsPlayConfig: null,
  2300. playTime: 0, //页面播放时长,不含暂停
  2301. param: {
  2302. pageNum: 1,
  2303. pageSize: 100,
  2304. total: 0,
  2305. },
  2306. postTimer: null, //提交视频观看记录定时器
  2307. lockTimer: null,
  2308. courseList: [],
  2309. businessData: {},
  2310. courseHandoutsData: "",
  2311. menuList: [],
  2312. goodsData: {},
  2313. tabList: [],
  2314. historyChatMsgList: [],
  2315. vid: "",
  2316. vidzb: "",
  2317. player: "",
  2318. playerzb: "",
  2319. activeId: "", //当前选中ID
  2320. vodPlayerJs: "https://player.polyv.net/script/player.js",
  2321. playerJs:
  2322. "https://player.polyv.net/resp/live-h5-player/latest/liveplayer.min.js",
  2323. uidzb: "egsxlptzdq",
  2324. menuList: [],
  2325. reMenuList: [],
  2326. answerList: [{ newArraysAnswerList: [] }],
  2327. noteList: [],
  2328. photoList: [],
  2329. noteTotal: 0,
  2330. duration: 0,
  2331. answerTimer: null,
  2332. noteParams: {
  2333. pageNum: 1,
  2334. // pageSize: 4,
  2335. },
  2336. ossAvatarUrl: "", //照片地址
  2337. nowTime: 0,
  2338. faceUrl: "",
  2339. loading: null,
  2340. listData: [],
  2341. listDataStamp: [],
  2342. remark: "",
  2343. remarkStatus: false,
  2344. remarkStamp: "",
  2345. remarkStatusStamp: false,
  2346. errorType: ["message"],
  2347. stampForm: {
  2348. commitment_seal: "",
  2349. },
  2350. infoForm: {
  2351. name: "",
  2352. sex: "",
  2353. idcard: "",
  2354. telphone: "",
  2355. education: "",
  2356. school: "",
  2357. graduation_time: "",
  2358. work_unit: "",
  2359. unit_contact: "",
  2360. unit_tel: "",
  2361. apply_post: "",
  2362. major: "",
  2363. working_years: "",
  2364. recent_photos: "",
  2365. idcard_face_photo: "",
  2366. idcard_national_photo: "",
  2367. commitment_electr_signature: "",
  2368. commitment_seal: "",
  2369. },
  2370. recommendList: [],
  2371. rules: {
  2372. name: [
  2373. {
  2374. required: true,
  2375. message: "请输入姓名",
  2376. trigger: ["change", "blur"],
  2377. },
  2378. ],
  2379. sex: [
  2380. {
  2381. required: true,
  2382. message: "请选择性别",
  2383. trigger: "change",
  2384. },
  2385. ],
  2386. idcard: [
  2387. {
  2388. required: true,
  2389. message: "请输入身份证号",
  2390. trigger: ["change", "blur"],
  2391. },
  2392. // {
  2393. // validator: (rule, value, callback) => {
  2394. // let IDRe18 =
  2395. // /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
  2396. // let IDre15 =
  2397. // /^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}$/;
  2398. // if (!IDRe18.test(value) && !IDre15.test(value)) {
  2399. // return callback(new Error("请输入格式正确的身份证号"));
  2400. // } else {
  2401. // return callback();
  2402. // }
  2403. // },
  2404. // message: "请输入格式正确的身份证号",
  2405. // trigger: ["change", "blur"],
  2406. // },
  2407. ],
  2408. telphone: [
  2409. {
  2410. required: true,
  2411. message: "请输入手机号码",
  2412. trigger: ["change", "blur"],
  2413. },
  2414. // {
  2415. // validator: (rule, value, callback) => {
  2416. // var reg_tel =
  2417. // /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
  2418. // if (reg_tel.test(value)) {
  2419. // return callback();
  2420. // } else {
  2421. // return callback(new Error("手机号码不正确"));
  2422. // }
  2423. // },
  2424. // trigger: ["change", "blur"],
  2425. // },
  2426. ],
  2427. education: [
  2428. {
  2429. required: true,
  2430. message: "请选择学历",
  2431. trigger: "change",
  2432. },
  2433. ],
  2434. school: [
  2435. {
  2436. required: true,
  2437. message: "请输入毕业院校",
  2438. trigger: ["change", "blur"],
  2439. },
  2440. ],
  2441. graduation_time: [
  2442. {
  2443. required: true,
  2444. message: "请选择毕业时间",
  2445. trigger: "change",
  2446. },
  2447. ],
  2448. work_unit: [
  2449. {
  2450. required: true,
  2451. message: "请输入工作单位",
  2452. trigger: ["change", "blur"],
  2453. },
  2454. ],
  2455. unit_contact: [
  2456. {
  2457. required: true,
  2458. message: "请输入单位联系人",
  2459. trigger: ["change", "blur"],
  2460. },
  2461. ],
  2462. unit_tel: [
  2463. {
  2464. required: true,
  2465. message: "请输入单位联系电话",
  2466. trigger: ["change", "blur"],
  2467. },
  2468. {
  2469. validator: (rule, value, callback) => {
  2470. var reg_tel =
  2471. /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
  2472. var vartest = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
  2473. var vartest1 = /^([0-9]{3,4})?[0-9]{7,8}$/;
  2474. if (
  2475. reg_tel.test(value) ||
  2476. vartest.test(value) ||
  2477. vartest1.test(value)
  2478. ) {
  2479. return callback();
  2480. } else {
  2481. return callback(new Error("单位联系电话不正确"));
  2482. }
  2483. },
  2484. trigger: ["change", "blur"],
  2485. },
  2486. ],
  2487. apply_post: [
  2488. {
  2489. required: true,
  2490. message: "请输入报名岗位",
  2491. trigger: ["change", "blur"],
  2492. },
  2493. ],
  2494. major: [
  2495. {
  2496. required: true,
  2497. message: "请输入所学专业",
  2498. trigger: ["change", "blur"],
  2499. },
  2500. ],
  2501. working_years: [
  2502. {
  2503. required: true,
  2504. message: "请选择工作年限",
  2505. trigger: "change",
  2506. },
  2507. ],
  2508. recent_photos: [
  2509. {
  2510. required: true,
  2511. message: "请上传证件照",
  2512. trigger: ["change", "blur"],
  2513. },
  2514. ],
  2515. idcard_face_photo: [
  2516. {
  2517. required: true,
  2518. message: "请上传身份证人像面",
  2519. trigger: ["change", "blur"],
  2520. },
  2521. ],
  2522. idcard_national_photo: [
  2523. {
  2524. required: true,
  2525. message: "请上传身份证国徽面",
  2526. trigger: ["change", "blur"],
  2527. },
  2528. ],
  2529. commitment_electr_signature: [
  2530. {
  2531. required: true,
  2532. message: "请签写承诺书电子签",
  2533. trigger: ["change", "blur"],
  2534. },
  2535. ],
  2536. commitment_seal: [
  2537. {
  2538. required: true,
  2539. message: "请上传承诺书盖章",
  2540. trigger: ["change", "blur"],
  2541. },
  2542. ],
  2543. },
  2544. stampRules: {
  2545. commitment_seal: [
  2546. {
  2547. required: true,
  2548. message: "请上传承诺书盖章",
  2549. trigger: ["change", "blur"],
  2550. },
  2551. ],
  2552. },
  2553. fileList1: [], //证件照
  2554. fileList2: [], //人像
  2555. fileList3: [], //国徽
  2556. fileListStamp: [], //印章
  2557. dictObj: null,
  2558. isRequired: false,
  2559. uploading: false,
  2560. veryIdCard: "",
  2561. veryIdName: "",
  2562. isPlayRebuild: false,
  2563. showRecordStatus: false,
  2564. hasStart: false,
  2565. needOpen: true, //是否需要展开第一章节
  2566. menuIndex: [],
  2567. clickLock: false,
  2568. liveLast: null,
  2569. apply_post_disabled: false,
  2570. };
  2571. },
  2572. computed: {
  2573. ...mapGetters(["userInfo"]),
  2574. compyRecommend: function () {
  2575. return function (array) {
  2576. let ary = [];
  2577. if (array) {
  2578. for (let i = 0; i < array.length; i++) {
  2579. if (i >= 5) {
  2580. break;
  2581. } else {
  2582. ary.push(array[i]);
  2583. }
  2584. }
  2585. }
  2586. return ary;
  2587. };
  2588. },
  2589. },
  2590. async mounted() {
  2591. this.courseId = +this.$route.query.courseId || "";
  2592. this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  2593. this.goodsId = this.$route.params.goodsId;
  2594. this.orderGoodsId = this.$route.query.orderGoodsId;
  2595. this.gradeId = this.$route.query.gradeId;
  2596. this.sectionItem = this.$route.query;
  2597. let isOther = this.$route.query.isOther || "";
  2598. if (isOther) {
  2599. const confirmText = [
  2600. "您的学习账号已经开通,请按照步骤操作,进行学习。",
  2601. "1.点击【跳转学习网址】按钮",
  2602. "2.打开学习网址后,选择【个人用户】进行登录",
  2603. "(1)账号:您个人的身份证号码",
  2604. "(2)密码:身份证号码,再加111111",
  2605. ];
  2606. const newDatas = [];
  2607. const h = this.$createElement;
  2608. for (const i in confirmText) {
  2609. newDatas.push(h("p", null, confirmText[i]));
  2610. }
  2611. this.$confirm(h("div", null, newDatas), "温馨提示", {
  2612. beforeClose: (type) => {
  2613. if (type == "confirm") {
  2614. window.open("http://admin.zhujianpeixun.com/", "_blank");
  2615. } else if (type == "cancel") {
  2616. this.$router.back(-1);
  2617. }
  2618. },
  2619. confirmButtonText: "跳转学习网址",
  2620. cancelButtonText: "关闭",
  2621. closeOnClickModal: false,
  2622. closeOnPressEscape: false,
  2623. distinguishCancelAndClose: false,
  2624. showClose: false,
  2625. });
  2626. return;
  2627. }
  2628. if (this.$route.query.rebuild) {
  2629. this.courseTabIndex = "2";
  2630. }
  2631. await this.getGoodsDetail(); //商品详情
  2632. this.dictList();
  2633. // this.userConfirmInfoDetail().then((res) => {
  2634. this.getbaseprofiletplists().then(async (res) => {
  2635. // let allMenuList = await this.studyRecordMenuAllList();
  2636. // let nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  2637. // let liveMenu = allMenuList.filter((item) => {
  2638. // //获取直播中的视频
  2639. // if (
  2640. // item.type == 3 &&
  2641. // item.liveStartTime <= nowTime &&
  2642. // item.liveEndTime > nowTime
  2643. // ) {
  2644. // return true;
  2645. // } else {
  2646. // return false;
  2647. // }
  2648. // });
  2649. // let earlyTime = 0;
  2650. // if (liveMenu && liveMenu.length) {
  2651. // earlyTime = liveMenu[0].liveStartTime;
  2652. // }
  2653. await this.courseCourseList();
  2654. if (this.sectionItem.recordingUrl) {
  2655. let noteSecond = this.$route.query.noteSecond;
  2656. if (noteSecond > 0) {
  2657. let item = {
  2658. sectionId: this.$route.query.sectionId,
  2659. recordingUrl: this.$route.query.recordingUrl,
  2660. noteSecond: noteSecond,
  2661. studyDuration: noteSecond,
  2662. moduleId: this.$route.query.moduleId,
  2663. chapterId: this.$route.query.chapterId,
  2664. };
  2665. this.playSectionId = this.$route.query.sectionId;
  2666. setTimeout(() => {
  2667. this.noteClick(item);
  2668. }, 1000);
  2669. }
  2670. } else {
  2671. this.studyRecordQueryLiveLast();
  2672. }
  2673. // let noteSecond = this.$route.query.noteSecond;
  2674. // if (noteSecond > 0) {
  2675. // let item = {
  2676. // sectionId: this.$route.query.sectionId,
  2677. // recordingUrl: this.$route.query.recordingUrl,
  2678. // noteSecond: noteSecond,
  2679. // studyDuration: noteSecond,
  2680. // moduleId: this.$route.query.moduleId,
  2681. // chapterId: this.$route.query.chapterId,
  2682. // };
  2683. // this.sectionItem = item;
  2684. // this.playSectionId = this.$route.query.sectionId;
  2685. // setTimeout(() => {
  2686. // this.noteClick(item);
  2687. // }, 1000);
  2688. // }
  2689. });
  2690. // });
  2691. },
  2692. beforeDestroy() {
  2693. try {
  2694. this.$msgbox.close();
  2695. } catch (err) {}
  2696. if (this.playSectionId && this.hasStart) {
  2697. this.postStudyRecord();
  2698. }
  2699. // if (this.lockTimer) {
  2700. // clearInterval(this.lockTimer);
  2701. // this.$request
  2702. // .lockDelLock({
  2703. // action: "jxjy",
  2704. // })
  2705. // .then((res) => {});
  2706. // }
  2707. this.clears();
  2708. clearInterval(this.answerTimer);
  2709. clearInterval(this.postTimer);
  2710. clearInterval(this.livingTimer);
  2711. },
  2712. methods: {
  2713. ...mapMutations(["getCartCount"]),
  2714. ...mapActions(["getUserInfo"]),
  2715. isLast(item) {
  2716. if (this.liveLast) {
  2717. let sectionASame =
  2718. this.liveLast.sectionId == (item.sectionId || item.menuId);
  2719. let chapterSame = this.liveLast.chapterId == (item.chapterId || 0);
  2720. let moduleSame = this.liveLast.moduleId == (item.moduleId || 0);
  2721. return sectionASame && chapterSame && moduleSame;
  2722. } else {
  2723. return false;
  2724. }
  2725. },
  2726. /**
  2727. * 获取上次观看的直播
  2728. */
  2729. studyRecordGetLastLive() {
  2730. this.$request
  2731. .studyRecordGetLastLive({
  2732. orderGoodsId: this.orderGoodsId,
  2733. courseId: this.courseId,
  2734. })
  2735. .then((res) => {
  2736. this.liveLast = res.data;
  2737. });
  2738. },
  2739. /**
  2740. * 获取观看记录
  2741. */
  2742. studyRecordQueryLiveLast() {
  2743. this.$request
  2744. .studyRecordQueryLiveLast({
  2745. orderGoodsId: this.orderGoodsId,
  2746. courseId: this.courseId,
  2747. })
  2748. .then((res) => {
  2749. console.log(res, "couse");
  2750. if (res.data) {
  2751. if (res.data.sectionType == 1) {
  2752. //录播
  2753. this.chapterId = res.data.chapterId;
  2754. this.moduleId = res.data.moduleId;
  2755. this.playSectionId = res.data.sectionId;
  2756. this.vid = res.data.recordingUrl;
  2757. this.sectionItem = res.data;
  2758. this.playVideo(res.data);
  2759. } else if (res.data.sectionType == 2) {
  2760. //直播
  2761. this.studyRecordGetLastLive();
  2762. } else if (res.data.sectionType == 3) {
  2763. //回放
  2764. this.chapterId = res.data.chapterId;
  2765. this.moduleId = res.data.moduleId;
  2766. this.playSectionId = res.data.sectionId;
  2767. this.vid = res.data.recordingUrl;
  2768. this.sectionItem = res.data;
  2769. this.playVideo(res.data);
  2770. }
  2771. }
  2772. });
  2773. },
  2774. /**
  2775. *
  2776. 获取推荐列表
  2777. */
  2778. getRecommend() {
  2779. this.$request
  2780. .appCommonActivityRecommendList({
  2781. businessId: this.goodsData.businessId,
  2782. type: 1,
  2783. })
  2784. .then((res) => {
  2785. if (res.rows.length) {
  2786. this.recommendList = res.rows[0];
  2787. }
  2788. });
  2789. },
  2790. addCart(status, goodsId) {
  2791. this.$request
  2792. .addCart({ goodsId: status ? goodsId : this.goodsId })
  2793. .then((res) => {
  2794. this.getCartCount();
  2795. this.$message({
  2796. message: "加入购物车成功",
  2797. type: "success",
  2798. });
  2799. })
  2800. .catch((err) => {
  2801. if (err.code == 500) {
  2802. this.$message({
  2803. message: err.msg,
  2804. type: "warning",
  2805. });
  2806. }
  2807. });
  2808. },
  2809. toGoodsDetail(item) {
  2810. this.$router.push({
  2811. path: "/course-detail/" + item.goodsId,
  2812. });
  2813. },
  2814. async takeOk() {
  2815. this.loading = true;
  2816. let compareFaceData = await this.faceRecognition();
  2817. if (compareFaceData >= 80) {
  2818. const waitYS = await this.imageInfos();
  2819. this.postCoursePhotoRecord()
  2820. .then((res) => {
  2821. this.photoHistoryList.push(this.photoIndex);
  2822. this.postStudyRecord(); //提交记录
  2823. //恢复播放
  2824. this.$message({
  2825. type: "success",
  2826. message: "拍照成功",
  2827. });
  2828. this.takePhotoModal = false;
  2829. this.isTaking = false;
  2830. this.loading = false;
  2831. var polyvPlayerContext = this.player;
  2832. if (polyvPlayerContext) {
  2833. polyvPlayerContext.j2s_resumeVideo();
  2834. }
  2835. var polyvPlayerContext = this.playerzb;
  2836. if (polyvPlayerContext) {
  2837. polyvPlayerContext.j2s_resumeVideo();
  2838. }
  2839. })
  2840. .catch((err) => {
  2841. this.loading = false;
  2842. console.log(err, "err");
  2843. this.$message({
  2844. type: "warning",
  2845. message: "上传接口报错,请重新拍照上传",
  2846. });
  2847. this.reTake();
  2848. });
  2849. } else {
  2850. this.$message({
  2851. type: "warning",
  2852. message: "人脸匹配不通过,请重新拍照上传",
  2853. });
  2854. setTimeout(() => {
  2855. this.loading = false;
  2856. this.reTake();
  2857. }, 2000);
  2858. return;
  2859. }
  2860. },
  2861. changePhotoListStamp(params, fileList) {
  2862. const file = params.raw;
  2863. const fileType = file.type;
  2864. const isImage = fileType.indexOf("image") != -1;
  2865. const isLt2M = file.size / 1024 / 1024 < 2;
  2866. // 这里常规检验,看项目需求而定
  2867. if (!isImage) {
  2868. this.$message.error("只能上传图片格式png、jpg、gif!");
  2869. return;
  2870. }
  2871. if (!isLt2M) {
  2872. this.$message.error("只能上传图片大小小于2M");
  2873. return;
  2874. }
  2875. if (fileList.length == 1) {
  2876. fileList.splice(0, 1);
  2877. }
  2878. this.$refs.stamp[0].clearFiles();
  2879. this.$upload
  2880. .upload(file, 0)
  2881. .then((res) => {
  2882. this.$set(this.infoForm, "commitment_seal", res);
  2883. this.fileListStamp = [
  2884. {
  2885. name: res,
  2886. url: res,
  2887. },
  2888. ];
  2889. this.$refs.stamp[0].clearFiles();
  2890. console.log(res);
  2891. })
  2892. .catch((err) => {
  2893. this.$refs.stamp[0].clearFiles();
  2894. });
  2895. },
  2896. // 页面加载成功 当前页数
  2897. pageLoaded(e) {
  2898. this.$emit("current", e);
  2899. this.curPageNum = e;
  2900. },
  2901. changePhotoListHeader1(params, fileList) {
  2902. console.log(params);
  2903. const file = params.raw;
  2904. const fileType = file.type;
  2905. const isImage = fileType.indexOf("image") != -1;
  2906. const isLt2M = file.size / 1024 / 1024 < 2;
  2907. // 这里常规检验,看项目需求而定
  2908. if (!isImage) {
  2909. this.$message.error("只能上传图片格式png、jpg、gif!");
  2910. return;
  2911. }
  2912. if (!isLt2M) {
  2913. this.$message.error("只能上传图片大小小于2M");
  2914. return;
  2915. }
  2916. if (fileList.length == 1) {
  2917. fileList.splice(0, 1);
  2918. }
  2919. this.$refs.recent_photos[0].clearFiles();
  2920. this.$upload
  2921. .upload(file, 0)
  2922. .then((res) => {
  2923. this.$set(this.infoForm, "recent_photos", res);
  2924. this.fileList1 = [
  2925. {
  2926. name: res,
  2927. url: res,
  2928. },
  2929. ];
  2930. this.$refs.recent_photos[0].clearFiles();
  2931. console.log(res);
  2932. })
  2933. .catch((err) => {
  2934. this.$refs.recent_photos[0].clearFiles();
  2935. });
  2936. },
  2937. async changePhotoListHeader2(params, fileList) {
  2938. const file = params.raw;
  2939. const fileType = file.type;
  2940. const isImage = fileType.indexOf("image") != -1;
  2941. const isLt2M = file.size / 1024 / 1024 < 2;
  2942. // 这里常规检验,看项目需求而定
  2943. if (!isImage) {
  2944. this.$message.error("只能上传图片格式png、jpg、gif!");
  2945. return;
  2946. }
  2947. if (!isLt2M) {
  2948. this.$message.error("只能上传图片大小小于2M");
  2949. return;
  2950. }
  2951. if (fileList.length == 1) {
  2952. fileList.splice(0, 1);
  2953. }
  2954. let res = await this.faceCertificationIDCardOCR(1, file);
  2955. console.log(res.data.IdImgPath, "res.data.IdImgPath");
  2956. if (res.code == 500) {
  2957. this.$message.warning("请上传正确清晰的身份证人像面照片");
  2958. return;
  2959. }
  2960. this.$refs.idcard_face_photo[0].clearFiles();
  2961. this.$set(this.infoForm, "idcard_face_photo", res.data.IdImgPath);
  2962. this.fileList2 = [
  2963. {
  2964. name: res.data.IdImgPath,
  2965. url: res.data.IdImgPath,
  2966. },
  2967. ];
  2968. // this.$upload
  2969. // .upload(file, 0)
  2970. // .then((res) => {
  2971. // console.log(res, "res");
  2972. // this.$set(this.infoForm, "idcard_face_photo", res);
  2973. // this.fileList2 = [
  2974. // {
  2975. // name: res,
  2976. // url: res,
  2977. // },
  2978. // ];
  2979. // this.$refs.idcard_face_photo[0].clearFiles();
  2980. // console.log(res);
  2981. // })
  2982. // .catch((err) => {
  2983. // this.$refs.idcard_face_photo[0].clearFiles();
  2984. // });
  2985. },
  2986. async changePhotoListHeader3(params, fileList) {
  2987. const file = params.raw;
  2988. const fileType = file.type;
  2989. const isImage = fileType.indexOf("image") != -1;
  2990. const isLt2M = file.size / 1024 / 1024 < 2;
  2991. // 这里常规检验,看项目需求而定
  2992. if (!isImage) {
  2993. this.$message.error("只能上传图片格式png、jpg、gif!");
  2994. return;
  2995. }
  2996. if (!isLt2M) {
  2997. this.$message.error("只能上传图片大小小于2M");
  2998. return;
  2999. }
  3000. if (fileList.length == 1) {
  3001. fileList.splice(0, 1);
  3002. }
  3003. let res = await this.faceCertificationIDCardOCR(2, file);
  3004. if (res.code == 500) {
  3005. this.$message.warning("请上传正确清晰的身份证国徽面照片");
  3006. return;
  3007. }
  3008. this.$refs.idcard_national_photo[0].clearFiles();
  3009. this.$set(this.infoForm, "idcard_national_photo", res.data.IdImgPath);
  3010. this.fileList3 = [
  3011. {
  3012. name: res.data.IdImgPath,
  3013. url: res.data.IdImgPath,
  3014. },
  3015. ];
  3016. // this.$upload
  3017. // .upload(file, 0)
  3018. // .then((res) => {
  3019. // this.$set(this.infoForm, "idcard_national_photo", res);
  3020. // this.fileList3 = [
  3021. // {
  3022. // name: res,
  3023. // url: res,
  3024. // },
  3025. // ];
  3026. // this.$refs.idcard_national_photo[0].clearFiles();
  3027. // console.log(res);
  3028. // })
  3029. // .catch((err) => {
  3030. // this.$refs.idcard_national_photo[0].clearFiles();
  3031. // });
  3032. },
  3033. faceCertificationIDCardOCR(cardSide, file) {
  3034. return new Promise((resolve) => {
  3035. var reader = new FileReader();
  3036. // 将文件加载进入
  3037. reader.readAsDataURL(file);
  3038. reader.onload = (e) => {
  3039. // 转换完成输出该文件base64编码
  3040. let base64 = e.target.result;
  3041. this.$request
  3042. .faceCertificationIDCardOCR({
  3043. cardSide: cardSide, //1人像 2 国徽
  3044. cardImageBase64: base64,
  3045. gradeId: this.gradeId,
  3046. })
  3047. .then((res) => {
  3048. resolve(res);
  3049. })
  3050. .catch((err) => {
  3051. resolve(err);
  3052. });
  3053. };
  3054. });
  3055. },
  3056. async submit() {
  3057. if (this.uploading) {
  3058. return;
  3059. }
  3060. this.uploading = true;
  3061. var ast = this.listData.some((item) => {
  3062. return item.fieldKey === "commitment_electr_signature";
  3063. });
  3064. if (ast) {
  3065. await this.subCanvas();
  3066. }
  3067. this.resultForm();
  3068. },
  3069. stampSubmit() {
  3070. if (this.uploading) {
  3071. return;
  3072. }
  3073. this.uploading = true;
  3074. this.stampResultForm();
  3075. },
  3076. backLI() {
  3077. this.player.j2s_seekVideo(0);
  3078. this.showRecordStatus = false;
  3079. },
  3080. //验证表单
  3081. stampResultForm() {
  3082. for (let i = 0; i < this.listDataStamp.length; i++) {
  3083. if (
  3084. this.listDataStamp[i].fieldKey === "commitment_seal" &&
  3085. !this.listDataStamp[i].required
  3086. ) {
  3087. this.submitApi();
  3088. return;
  3089. }
  3090. }
  3091. this.$refs.stampForm.validate((valid) => {
  3092. if (valid) {
  3093. this.submitApiStamp();
  3094. } else {
  3095. this.uploading = false;
  3096. }
  3097. });
  3098. },
  3099. async submitApiStamp() {
  3100. var data = JSON.parse(JSON.stringify(this.stampForm));
  3101. if (data["commitment_seal"]) {
  3102. data.commitment_seal = await this.$upload.upload(
  3103. data.commitment_seal,
  3104. 0
  3105. );
  3106. }
  3107. this.optionChanges(data);
  3108. },
  3109. optionChanges(data) {
  3110. var self = this;
  3111. var objs = {};
  3112. for (let k in data) {
  3113. objs[k] = {
  3114. fieldKey: k,
  3115. value: data[k],
  3116. fieldName: (function () {
  3117. for (let i = 0; i < self.listDataStamp.length; i++) {
  3118. if (self.listDataStamp[i].fieldKey == k) {
  3119. return self.listDataStamp[i].fieldName;
  3120. }
  3121. }
  3122. })(),
  3123. status: self.remarkStatusStamp ? 1 : 0,
  3124. };
  3125. }
  3126. var datas = {
  3127. orderGoodsId: this.orderGoodsId,
  3128. goodsId: self.goodsId,
  3129. keyValue: JSON.stringify(objs),
  3130. };
  3131. if (self.remarkStatus) {
  3132. datas.id = self.id;
  3133. self.$request.editbaseprofileStamp(datas).then((res) => {
  3134. this.uploading = false;
  3135. this.getUserInfo();
  3136. this.showStampDetailModail = false;
  3137. this.$message.success("提交成功");
  3138. });
  3139. } else {
  3140. self.$request.addbaseprofileStamp(datas).then((res) => {
  3141. this.uploading = false;
  3142. this.getUserInfo();
  3143. this.showStampDetailModail = false;
  3144. this.$message.success("提交成功");
  3145. });
  3146. }
  3147. },
  3148. resultForm() {
  3149. console.log(1);
  3150. if (this.isRequired) {
  3151. this.submitApi();
  3152. } else {
  3153. console.log(1);
  3154. this.$refs.infoForm.validate((valid) => {
  3155. console.log(1);
  3156. if (valid) {
  3157. this.submitApi();
  3158. } else {
  3159. this.uploading = false;
  3160. }
  3161. });
  3162. // if (int === 1) {
  3163. // this.errorType = ["toast"];
  3164. // } else {
  3165. // this.errorType = ["message"];
  3166. // }
  3167. }
  3168. },
  3169. async submitApi() {
  3170. console.log(this.infoForm, "999");
  3171. var data = JSON.parse(JSON.stringify(this.infoForm));
  3172. if (data["sex"]) {
  3173. data.sex = this.dictObj["sys_user_sex"][Number(data.sex)];
  3174. }
  3175. if (data["education"]) {
  3176. data.education = this.dictObj["edu_level"][Number(data.education)];
  3177. }
  3178. if (data["working_years"]) {
  3179. data.working_years =
  3180. this.dictObj["working_years"][Number(data.working_years)];
  3181. }
  3182. if (data["recent_photos"]) {
  3183. data.recent_photos = await this.$upload.upload(data.recent_photos, 0);
  3184. }
  3185. if (data["idcard_face_photo"]) {
  3186. data.idcard_face_photo = await this.$upload.upload(
  3187. data.idcard_face_photo,
  3188. 0
  3189. );
  3190. }
  3191. if (data["idcard_national_photo"]) {
  3192. data.idcard_national_photo = await this.$upload.upload(
  3193. data.idcard_national_photo,
  3194. 0
  3195. );
  3196. }
  3197. if (data["commitment_electr_signature"]) {
  3198. data.commitment_electr_signature = await this.$upload.upload(
  3199. data.commitment_electr_signature,
  3200. 0
  3201. );
  3202. }
  3203. this.uploadDatas(data);
  3204. },
  3205. async downloadStamp(item) {
  3206. let self = this;
  3207. var ast = this.listData.some((item) => {
  3208. return item.fieldKey === "commitment_electr_signature";
  3209. });
  3210. if (ast) {
  3211. await this.subCanvas();
  3212. }
  3213. let data = JSON.parse(JSON.stringify(this.infoForm));
  3214. if (data["sex"]) {
  3215. data.sex = this.dictObj["sys_user_sex"][Number(data.sex)];
  3216. }
  3217. if (data["education"]) {
  3218. data.education = this.dictObj["edu_level"][Number(data.education)];
  3219. }
  3220. if (data["working_years"]) {
  3221. data.working_years =
  3222. this.dictObj["working_years"][Number(data.working_years)];
  3223. }
  3224. console.log(data, "data");
  3225. if (this.remarkStatus) {
  3226. var arsty = {};
  3227. for (let k in data) {
  3228. for (let j in self.copyData) {
  3229. if (k === j) {
  3230. if (self.copyData[j].value === data[k]) {
  3231. arsty[k] = {
  3232. fieldKey: k,
  3233. value: data[k],
  3234. fieldName: (function () {
  3235. for (let i = 0; i < self.listData.length; i++) {
  3236. if (self.listData[i].fieldKey == k) {
  3237. return self.listData[i].fieldName;
  3238. }
  3239. }
  3240. })(),
  3241. status: 0,
  3242. };
  3243. } else {
  3244. arsty[k] = {
  3245. fieldKey: k,
  3246. value: data[k],
  3247. fieldName: (function () {
  3248. for (let i = 0; i < self.listData.length; i++) {
  3249. if (self.listData[i].fieldKey == k) {
  3250. return self.listData[i].fieldName;
  3251. }
  3252. }
  3253. })(),
  3254. status: 1,
  3255. };
  3256. }
  3257. }
  3258. }
  3259. }
  3260. } else {
  3261. var arsty = {};
  3262. for (let k in data) {
  3263. arsty[k] = {
  3264. fieldKey: k,
  3265. value: data[k],
  3266. fieldName: (function () {
  3267. for (let i = 0; i < self.listData.length; i++) {
  3268. if (self.listData[i].fieldKey == k) {
  3269. return self.listData[i].fieldName;
  3270. }
  3271. }
  3272. })(),
  3273. status: 0,
  3274. };
  3275. }
  3276. }
  3277. console.log(arsty, "arsty");
  3278. this.$request
  3279. .baseProfileStampV2AddWord({
  3280. goodsId: this.goodsId,
  3281. keyValue: JSON.stringify(arsty),
  3282. })
  3283. .then((res) => {
  3284. let url = this.$tools.splitImgHost(res.msg);
  3285. let name = res.msg.substring(res.msg.lastIndexOf("/") + 1);
  3286. let image = new Image();
  3287. // 解决跨域 Canvas 污染问题,
  3288. image.setAttribute("crossorigin", "anonymous");
  3289. image.onload = function () {
  3290. var canvas = document.createElement("canvas");
  3291. canvas.width = image.width;
  3292. canvas.height = image.height;
  3293. var context = canvas.getContext("2d");
  3294. context.drawImage(image, 0, 0, image.width, image.height);
  3295. var base64 = canvas.toDataURL("image/jpg"); //将图片格式转为base64
  3296. var a = document.createElement("a"); // 生成一个a元素
  3297. var event = new MouseEvent("click"); // 创建一个单击事件
  3298. a.download = name; // 设置图片名称
  3299. console.log(base64);
  3300. a.href = base64; // 将生成的URL设置为a.href属性
  3301. a.dispatchEvent(event); // 触发a的单击事件
  3302. };
  3303. image.src = url + "?time=" + Date.now(); //注意,这里是灵魂,否则依旧会产生跨域问题
  3304. });
  3305. },
  3306. convertBase64UrlToBlob(urlData) {
  3307. var localData = urlData; //dataUrl为base64位
  3308. let base = atob(localData.substring(localData.indexOf(",") + 1)); // base是将base64编码解码,去掉data:image/png;base64部分
  3309. let length = base.length;
  3310. let url = new Uint8Array(length);
  3311. while (length--) {
  3312. url[length] = base.charCodeAt(length);
  3313. }
  3314. let file = new File([url], "a.jpg", {
  3315. type: "image/jpg",
  3316. });
  3317. //最后将file,通过ajax请求做为参数传给服务器就可以了
  3318. return file;
  3319. },
  3320. async uploadDatas(data) {
  3321. let self = this;
  3322. if (this.infoForm.recent_photos && this.infoForm.idcard_face_photo) {
  3323. let base = await this.$tools.imageToBase64(
  3324. this.$tools.splitImgHost(this.infoForm.idcard_face_photo)
  3325. );
  3326. console.log(base);
  3327. console.log(this.$tools.splitImgHost(this.infoForm.idcard_face_photo));
  3328. let resData = {};
  3329. try {
  3330. resData = await this.$request.faceCertificationIDCardOCR({
  3331. cardSide: 1, //1人像 2 国徽
  3332. cardImageBase64: base,
  3333. gradeId: this.gradeId,
  3334. });
  3335. } catch (err) {
  3336. self.$message.warning("身份证人像面照片异常,请重新上传");
  3337. self.uploading = false;
  3338. return;
  3339. }
  3340. if (!resData.data) {
  3341. this.$message.warning("身份证人像面照片异常,请重新上传");
  3342. this.uploading = false;
  3343. return;
  3344. }
  3345. this.veryIdCard = resData.data.IdNum;
  3346. this.veryIdName = resData.data.IdName;
  3347. // if (this.infoForm.idcard) {
  3348. // if (this.infoForm.idcard != this.veryIdCard) {
  3349. // this.$message.warning(
  3350. // "输入的身份证号和身份证人像面照片身份证号不匹配"
  3351. // );
  3352. // this.uploading = false;
  3353. // return;
  3354. // }
  3355. // }
  3356. let base64 = await this.$tools.imageToBase64(
  3357. this.$tools.splitImgHost(this.infoForm.recent_photos)
  3358. );
  3359. let newData = {
  3360. urlA: this.infoForm.idcard_face_photo,
  3361. oneInchPhotos: base64,
  3362. };
  3363. this.$request
  3364. .faceCertificationIdCardCompareFace(newData)
  3365. .then((res1) => {
  3366. if (res1.data >= 70) {
  3367. var self = this;
  3368. if (self.remarkStatus) {
  3369. var arsty = {};
  3370. for (let k in data) {
  3371. for (let j in self.copyData) {
  3372. if (k === j) {
  3373. if (self.copyData[j].value === data[k]) {
  3374. arsty[k] = {
  3375. fieldKey: k,
  3376. value: data[k],
  3377. fieldName: (function () {
  3378. for (let i = 0; i < self.listData.length; i++) {
  3379. if (self.listData[i].fieldKey == k) {
  3380. return self.listData[i].fieldName;
  3381. }
  3382. }
  3383. })(),
  3384. status: 0,
  3385. };
  3386. } else {
  3387. arsty[k] = {
  3388. fieldKey: k,
  3389. value: data[k],
  3390. fieldName: (function () {
  3391. for (let i = 0; i < self.listData.length; i++) {
  3392. if (self.listData[i].fieldKey == k) {
  3393. return self.listData[i].fieldName;
  3394. }
  3395. }
  3396. })(),
  3397. status: 1,
  3398. };
  3399. }
  3400. }
  3401. }
  3402. }
  3403. var datas = {
  3404. id: this.id,
  3405. goodsId: this.goodsId,
  3406. orderGoodsId: this.orderGoodsId,
  3407. keyValue: JSON.stringify(arsty),
  3408. };
  3409. this.$request
  3410. .editbaseprofiletp(datas)
  3411. .then((res) => {
  3412. this.uploading = false;
  3413. this.courseCourseList();
  3414. this.getUserInfo();
  3415. this.$message.success("提交成功");
  3416. this.showInfoDetailModal = false;
  3417. })
  3418. .catch((err) => {
  3419. this.$message.warning(err.msg);
  3420. this.uploading = false;
  3421. });
  3422. } else {
  3423. var objs = {};
  3424. for (let k in data) {
  3425. objs[k] = {
  3426. fieldKey: k,
  3427. value: data[k],
  3428. fieldName: (function () {
  3429. for (let i = 0; i < self.listData.length; i++) {
  3430. if (self.listData[i].fieldKey == k) {
  3431. return self.listData[i].fieldName;
  3432. }
  3433. }
  3434. })(),
  3435. status: 0,
  3436. };
  3437. }
  3438. var datas = {
  3439. goodsId: this.goodsId,
  3440. profileTpId: this.goodsId,
  3441. orderGoodsId: this.orderGoodsId,
  3442. keyValue: JSON.stringify(objs),
  3443. };
  3444. this.$request
  3445. .addbaseprofiletp(datas)
  3446. .then((res) => {
  3447. this.uploading = false;
  3448. this.courseCourseList();
  3449. this.getUserInfo();
  3450. this.$message.success("提交成功");
  3451. this.showInfoDetailModal = false;
  3452. })
  3453. .catch((err) => {
  3454. this.$message.warning(err.msg);
  3455. this.uploading = false;
  3456. });
  3457. }
  3458. } else {
  3459. this.uploading = false;
  3460. this.$message.warning("证件照和身份证人像面照片不匹配");
  3461. }
  3462. })
  3463. .catch((err) => {
  3464. this.uploading = false;
  3465. this.$message.warning(err.msg);
  3466. });
  3467. return;
  3468. }
  3469. if (self.remarkStatus) {
  3470. var arsty = {};
  3471. for (let k in data) {
  3472. for (let j in self.copyData) {
  3473. if (k === j) {
  3474. if (self.copyData[j].value === data[k]) {
  3475. arsty[k] = {
  3476. fieldKey: k,
  3477. value: data[k],
  3478. fieldName: (function () {
  3479. for (let i = 0; i < self.listData.length; i++) {
  3480. if (self.listData[i].fieldKey == k) {
  3481. return self.listData[i].fieldName;
  3482. }
  3483. }
  3484. })(),
  3485. status: 0,
  3486. };
  3487. } else {
  3488. arsty[k] = {
  3489. fieldKey: k,
  3490. value: data[k],
  3491. fieldName: (function () {
  3492. for (let i = 0; i < self.listData.length; i++) {
  3493. if (self.listData[i].fieldKey == k) {
  3494. return self.listData[i].fieldName;
  3495. }
  3496. }
  3497. })(),
  3498. status: 1,
  3499. };
  3500. }
  3501. }
  3502. }
  3503. }
  3504. var datas = {
  3505. id: this.id,
  3506. goodsId: this.goodsId,
  3507. orderGoodsId: this.orderGoodsId,
  3508. keyValue: JSON.stringify(arsty),
  3509. };
  3510. this.$request
  3511. .editbaseprofiletp(datas)
  3512. .then((res) => {
  3513. this.uploading = false;
  3514. this.courseCourseList();
  3515. this.getUserInfo();
  3516. this.$message.success("提交成功");
  3517. this.showInfoDetailModal = false;
  3518. })
  3519. .catch((err) => {
  3520. this.$message.warning(err.msg);
  3521. this.uploading = false;
  3522. });
  3523. } else {
  3524. var objs = {};
  3525. for (let k in data) {
  3526. objs[k] = {
  3527. fieldKey: k,
  3528. value: data[k],
  3529. fieldName: (function () {
  3530. for (let i = 0; i < self.listData.length; i++) {
  3531. if (self.listData[i].fieldKey == k) {
  3532. return self.listData[i].fieldName;
  3533. }
  3534. }
  3535. })(),
  3536. status: 0,
  3537. };
  3538. }
  3539. var datas = {
  3540. goodsId: this.goodsId,
  3541. profileTpId: this.goodsId,
  3542. orderGoodsId: this.orderGoodsId,
  3543. keyValue: JSON.stringify(objs),
  3544. };
  3545. this.$request
  3546. .addbaseprofiletp(datas)
  3547. .then((res) => {
  3548. this.uploading = false;
  3549. this.courseCourseList();
  3550. this.getUserInfo();
  3551. this.$message.success("提交成功");
  3552. this.showInfoDetailModal = false;
  3553. })
  3554. .catch((err) => {
  3555. this.$message.warning(err.msg);
  3556. this.uploading = false;
  3557. });
  3558. }
  3559. },
  3560. subCanvas() {
  3561. return new Promise((resolve, reject) => {
  3562. var self = this;
  3563. if (self.infoForm.commitment_electr_signature) {
  3564. resolve();
  3565. return;
  3566. }
  3567. this.$refs.esign[0]
  3568. .generate() // 使用生成器调用把签字的图片转换成为base64图片格式
  3569. .then(async (res) => {
  3570. let url = await this.$upload.upload(
  3571. this.convertBase64UrlToBlob(res),
  3572. 0
  3573. );
  3574. this.$set(this.infoForm, "commitment_electr_signature", url);
  3575. resolve();
  3576. })
  3577. .catch((err) => {
  3578. console.log(err, "err");
  3579. // 画布没有签字时会执行这里提示一下
  3580. // this.uploading = false;
  3581. // this.$message({
  3582. // type: "warning",
  3583. // message: "请签名后再生成签字图片",
  3584. // });
  3585. resolve();
  3586. });
  3587. });
  3588. },
  3589. imageInfos() {
  3590. var self = this;
  3591. return new Promise(async (resolve, reject) => {
  3592. const waitUpload = await self.uploadFile(self.faceUrl, 0);
  3593. resolve(waitUpload);
  3594. });
  3595. },
  3596. getarrays(key) {
  3597. if (key === "sex") {
  3598. return this.dictObj["sys_user_sex"];
  3599. }
  3600. if (key === "education") {
  3601. return this.dictObj["edu_level"];
  3602. }
  3603. if (key === "working_years") {
  3604. return this.dictObj["working_years"];
  3605. }
  3606. },
  3607. dictList() {
  3608. this.$request.dictList().then((res) => {
  3609. if (res.code === 200) {
  3610. let newList = {};
  3611. let list = res.data;
  3612. for (let i = 0; i < list.length; i++) {
  3613. let item = list[i];
  3614. if (newList.hasOwnProperty(item.dictType)) {
  3615. newList[item.dictType].push(item.dictLabel);
  3616. } else {
  3617. newList[item.dictType] = [item.dictLabel];
  3618. }
  3619. }
  3620. this.dictObj = newList;
  3621. }
  3622. });
  3623. },
  3624. getbaseprofiletplists() {
  3625. return new Promise((resolve) => {
  3626. let self = this;
  3627. this.$request
  3628. .getbaseprofiletplists({
  3629. goodsId: this.goodsId,
  3630. orderGoodsId: this.orderGoodsId || "",
  3631. })
  3632. .then((res) => {
  3633. if (res.code === 200 && res.rows.length) {
  3634. console.log(1);
  3635. if (res.rows[0].keyValue) {
  3636. console.log(2);
  3637. self.$request
  3638. .getbaseprofiletpId(self.goodsId)
  3639. .then((baseRes) => {
  3640. if (baseRes.code === 200) {
  3641. console.log(3);
  3642. if (baseRes.data) {
  3643. console.log(4);
  3644. self.$request
  3645. .getbaseprofiletpgetInfo({
  3646. goodsId: self.goodsId,
  3647. orderGoodsId: self.orderGoodsId,
  3648. })
  3649. .then((result) => {
  3650. console.log(result, "result");
  3651. if (result.code === 200) {
  3652. if (
  3653. !result.data ||
  3654. (result.data.status === 3 &&
  3655. result.data.changeStatus === 1)
  3656. ) {
  3657. console.log(5);
  3658. if (!result.data) {
  3659. console.log(6);
  3660. self.needProfileModal = true;
  3661. this.$confirm(`请填写资料`, "提示", {
  3662. confirmButtonText: "确定",
  3663. cancelButtonText: "返回",
  3664. closeOnClickModal: false,
  3665. closeOnPressEscape: false,
  3666. distinguishCancelAndClose: false,
  3667. showClose: false,
  3668. })
  3669. .then((_) => {
  3670. this.showAgreementModal = true;
  3671. this.getInfo();
  3672. })
  3673. .catch((_) => {
  3674. this.$router.back(-1);
  3675. });
  3676. } else {
  3677. this.$confirm(
  3678. `资料审核不通过,请前往重新填写`,
  3679. "提示",
  3680. {
  3681. confirmButtonText: "确定",
  3682. cancelButtonText: "返回",
  3683. closeOnClickModal: false,
  3684. closeOnPressEscape: false,
  3685. distinguishCancelAndClose: false,
  3686. showClose: false,
  3687. }
  3688. )
  3689. .then((_) => {
  3690. this.showInfoDetailModal = true;
  3691. this.getInfo();
  3692. })
  3693. .catch((_) => {
  3694. this.$router.back(-1);
  3695. });
  3696. }
  3697. } else if (
  3698. result.data.status === 1 &&
  3699. JSON.parse(res.rows[0].keyValue2)[0]
  3700. ) {
  3701. console.log(8);
  3702. self.$request
  3703. .getbaseprofileStampgetInfo({
  3704. goodsId: self.goodsId,
  3705. orderGoodsId: self.orderGoodsId,
  3706. })
  3707. .then((k) => {
  3708. if (k.code === 200) {
  3709. if (
  3710. !k.data ||
  3711. (k.data.status === 3 &&
  3712. k.data.changeStatus === 1)
  3713. ) {
  3714. if (!k.data) {
  3715. console.log(9);
  3716. this.$confirm(
  3717. `请前往填写盖章资料`,
  3718. "提示",
  3719. {
  3720. confirmButtonText: "确定",
  3721. cancelButtonText: "返回",
  3722. closeOnClickModal: false,
  3723. closeOnPressEscape: false,
  3724. distinguishCancelAndClose: false,
  3725. showClose: false,
  3726. }
  3727. )
  3728. .then((_) => {
  3729. this.showStampDetailModail = true;
  3730. this.getInfoStamp();
  3731. })
  3732. .catch((_) => {
  3733. this.$router.back(-1);
  3734. });
  3735. } else {
  3736. console.log(10);
  3737. self.needProfileModal = true;
  3738. this.$confirm(
  3739. `资料盖章审核不通过,请前往重新填写`,
  3740. "提示",
  3741. {
  3742. confirmButtonText: "确定",
  3743. cancelButtonText: "返回",
  3744. closeOnClickModal: false,
  3745. closeOnPressEscape: false,
  3746. distinguishCancelAndClose: false,
  3747. showClose: false,
  3748. }
  3749. )
  3750. .then((_) => {
  3751. this.showStampDetailModail = true;
  3752. this.getInfoStamp();
  3753. })
  3754. .catch((_) => {
  3755. this.$router.back(-1);
  3756. });
  3757. }
  3758. } else {
  3759. resolve();
  3760. }
  3761. }
  3762. });
  3763. } else {
  3764. resolve();
  3765. }
  3766. }
  3767. });
  3768. } else {
  3769. resolve();
  3770. }
  3771. }
  3772. });
  3773. } else {
  3774. resolve();
  3775. }
  3776. } else {
  3777. resolve();
  3778. }
  3779. });
  3780. if (this.gradeId > 0) {
  3781. //提交完资料返回判断是否已开班
  3782. this.getGradeInfo();
  3783. }
  3784. });
  3785. },
  3786. getInfoStamp() {
  3787. var self = this;
  3788. this.$request.getbaseprofiletpId(this.goodsId).then((res) => {
  3789. var ast = JSON.parse(res.data.keyValue2);
  3790. self.listDataStamp = ast;
  3791. self.$request
  3792. .getbaseprofileStampgetInfo({
  3793. goodsId: self.goodsId,
  3794. orderGoodsId: self.orderGoodsId,
  3795. })
  3796. .then((result) => {
  3797. if (result.data && result.data.status === 3) {
  3798. self.remarkStamp = result.data.text;
  3799. self.remarkStatusStamp = true;
  3800. self.id = result.data.id;
  3801. } else if (
  3802. result.data &&
  3803. (result.data.status === 1 || result.data.status === 2)
  3804. ) {
  3805. // uni.showModal({
  3806. // showCancel: false,
  3807. // content:
  3808. // result.data.status === 1
  3809. // ? "该商品审核资料已通过,不可重复提交资料"
  3810. // : result.data.status === 2
  3811. // ? "该商品审核资料处于待审核状态,不可重复提交资料"
  3812. // : "请联系管理员",
  3813. // success: function (k) {
  3814. // if (k.confirm) {
  3815. // uni.navigateBack();
  3816. // }
  3817. // },
  3818. // });
  3819. }
  3820. })
  3821. .catch((err) => {});
  3822. });
  3823. },
  3824. getGradeInfo() {
  3825. let self = this;
  3826. this.$request.goodsGradeInfo(this.gradeId).then((res) => {
  3827. if (res.code == 200) {
  3828. self.gradeDetail = res.data;
  3829. if (self.needProfileModal) {
  3830. return;
  3831. }
  3832. if (self.gradeDetail.learningStatus == 2) {
  3833. this.$confirm(
  3834. `当前课程正在申请中,正式开班后方可进行学习,请耐心等候!`,
  3835. "提示",
  3836. {
  3837. confirmButtonText: "确定",
  3838. closeOnClickModal: false,
  3839. closeOnPressEscape: false,
  3840. showCancelButton: false,
  3841. distinguishCancelAndClose: false,
  3842. showClose: false,
  3843. }
  3844. )
  3845. .then((_) => {
  3846. this.$router.back(-1);
  3847. })
  3848. .catch((_) => {});
  3849. }
  3850. if (
  3851. self.gradeDetail.learningStatus == 3 &&
  3852. Number(self.gradeDetail.learningTimeStart) >
  3853. Number(new Date() / 1000)
  3854. ) {
  3855. this.$confirm(
  3856. `当前课程正在申请中,正式开班后方可进行学习,请耐心等候!`,
  3857. "提示",
  3858. {
  3859. confirmButtonText: "返回",
  3860. closeOnClickModal: false,
  3861. closeOnPressEscape: false,
  3862. showCancelButton: false,
  3863. distinguishCancelAndClose: false,
  3864. showClose: false,
  3865. }
  3866. )
  3867. .then((_) => {
  3868. this.$router.back(-1);
  3869. })
  3870. .catch((_) => {});
  3871. }
  3872. }
  3873. });
  3874. this.$store.state.allowLoading = true;
  3875. },
  3876. deleteImg(item) {
  3877. if (item.fieldKey == "recent_photos") {
  3878. this.fileList1 = [];
  3879. this.infoForm["recent_photos"] = "";
  3880. } else if (item.fieldKey == "idcard_face_photo") {
  3881. this.fileList2 = [];
  3882. this.infoForm["idcard_face_photo"] = "";
  3883. } else if (item.fieldKey == "idcard_national_photo") {
  3884. this.fileList3 = [];
  3885. this.infoForm["idcard_national_photo"] = "";
  3886. }
  3887. },
  3888. /**
  3889. * getbaseprofiletpgetInfo接口返回值result.data.data不存在的话说明是第一次填写资料
  3890. */
  3891. getInfo() {
  3892. var self = this;
  3893. this.$request.getbaseprofiletpId(this.goodsId).then((res) => {
  3894. console.log(res, "res");
  3895. var listData = JSON.parse(res.data.keyValue);
  3896. var ast = JSON.parse(res.data.keyValue2);
  3897. self.listData = [...listData, ...ast];
  3898. console.log(self.listData, "self.listData");
  3899. self.listData.forEach((item) => {
  3900. if (item.fieldKey == "idcard") {
  3901. this.infoForm.idcard = this.userInfo.idCard;
  3902. }
  3903. if (item.fieldKey == "telphone") {
  3904. this.infoForm.telphone = this.userInfo.telphone;
  3905. }
  3906. if (item.fieldKey == "name") {
  3907. this.infoForm.name = this.userInfo.realname || "";
  3908. }
  3909. });
  3910. self.isRequired = self.listData.every((ims) => {
  3911. return ims.required === false;
  3912. });
  3913. this.$nextTick(() => {
  3914. this.agreementModal = true;
  3915. });
  3916. self.$request
  3917. .getbaseprofiletpgetInfo({
  3918. goodsId: this.goodsId,
  3919. orderGoodsId: this.orderGoodsId,
  3920. })
  3921. .then((result) => {
  3922. if (result.code === 200) {
  3923. if (!result.data) {
  3924. self.$request
  3925. .getbaseprofiletplistProfile({
  3926. pageNum: 1,
  3927. pageSize: 1,
  3928. })
  3929. .then((kit) => {
  3930. if (kit.rows.length) {
  3931. var ajson = JSON.parse(kit.rows[0].keyValue);
  3932. self.listData.forEach((zyitem, zyindex) => {
  3933. for (let k in ajson) {
  3934. if (zyitem.fieldKey == k && ajson[k].value) {
  3935. if (k === "sex") {
  3936. const sexIndex =
  3937. self.dictObj["sys_user_sex"].indexOf(
  3938. ajson[k].value
  3939. ) + "";
  3940. self.$set(self.infoForm, k, sexIndex);
  3941. } else if (k === "education") {
  3942. const sexIndex =
  3943. self.dictObj["edu_level"].indexOf(
  3944. ajson[k].value
  3945. ) + "";
  3946. self.$set(self.infoForm, k, sexIndex);
  3947. } else if (k === "working_years") {
  3948. const sexIndex =
  3949. self.dictObj["working_years"].indexOf(
  3950. ajson[k].value
  3951. ) + "";
  3952. self.$set(self.infoForm, k, sexIndex);
  3953. } else if (k === "recent_photos") {
  3954. self.$set(self.infoForm, k, ajson[k].value);
  3955. if (ajson[k].value) {
  3956. self.fileList1 = [
  3957. {
  3958. url: ajson[k].value,
  3959. },
  3960. ];
  3961. }
  3962. } else if (k === "idcard_face_photo") {
  3963. self.$set(self.infoForm, k, ajson[k].value);
  3964. if (ajson[k].value) {
  3965. self.fileList2 = [
  3966. {
  3967. url: ajson[k].value,
  3968. },
  3969. ];
  3970. }
  3971. } else if (k === "idcard_national_photo") {
  3972. self.$set(self.infoForm, k, ajson[k].value);
  3973. if (ajson[k].value) {
  3974. self.fileList3 = [
  3975. {
  3976. url: ajson[k].value,
  3977. },
  3978. ];
  3979. }
  3980. } else {
  3981. if (k === "name") {
  3982. self.$set(
  3983. self.infoForm,
  3984. k,
  3985. this.$store.state.userInfo.realname
  3986. );
  3987. } else if (k === "idcard") {
  3988. self.$set(
  3989. self.infoForm,
  3990. k,
  3991. this.$store.state.userInfo.idCard
  3992. );
  3993. } else if (k === "telphone") {
  3994. self.$set(
  3995. self.infoForm,
  3996. k,
  3997. this.$store.state.userInfo.telphone
  3998. );
  3999. } else if (k !== "commitment_electr_signature") {
  4000. self.$set(self.infoForm, k, ajson[k].value);
  4001. }
  4002. }
  4003. }
  4004. }
  4005. });
  4006. }
  4007. });
  4008. }
  4009. if (result.data && result.data.status === 3) {
  4010. self.remark = result.data.text;
  4011. self.remarkStatus = true;
  4012. self.id = result.data.id;
  4013. var arrays = JSON.parse(result.data.keyValue);
  4014. self.copyData = JSON.parse(JSON.stringify(arrays));
  4015. for (let k in arrays) {
  4016. if (k === "sex") {
  4017. if (arrays[k].value) {
  4018. const sexIndex =
  4019. self.dictObj["sys_user_sex"].indexOf(arrays[k].value) +
  4020. "";
  4021. self.$set(self.infoForm, k, sexIndex);
  4022. }
  4023. } else if (k === "education") {
  4024. if (arrays[k].value) {
  4025. const sexIndex =
  4026. self.dictObj["edu_level"].indexOf(arrays[k].value) + "";
  4027. self.$set(self.infoForm, k, sexIndex);
  4028. }
  4029. } else if (k === "working_years") {
  4030. if (arrays[k].value) {
  4031. const sexIndex =
  4032. self.dictObj["working_years"].indexOf(arrays[k].value) +
  4033. "";
  4034. self.$set(self.infoForm, k, sexIndex);
  4035. }
  4036. } else if (k === "recent_photos") {
  4037. self.$set(self.infoForm, k, arrays[k].value);
  4038. if (arrays[k].value) {
  4039. self.fileList1 = [{ url: arrays[k].value }];
  4040. }
  4041. } else if (k === "idcard_face_photo") {
  4042. self.$set(self.infoForm, k, arrays[k].value);
  4043. if (arrays[k].value) {
  4044. self.fileList2 = [{ url: arrays[k].value }];
  4045. }
  4046. } else if (k === "idcard_national_photo") {
  4047. self.$set(self.infoForm, k, arrays[k].value);
  4048. if (arrays[k].value) {
  4049. self.fileList3 = [{ url: arrays[k].value }];
  4050. }
  4051. } else if (k === "name") {
  4052. self.$set(
  4053. self.infoForm,
  4054. k,
  4055. this.$store.state.userInfo.realname
  4056. );
  4057. } else if (k === "idcard") {
  4058. self.$set(
  4059. self.infoForm,
  4060. k,
  4061. this.$store.state.userInfo.idCard
  4062. );
  4063. } else if (k === "telphone") {
  4064. self.$set(
  4065. self.infoForm,
  4066. k,
  4067. this.$store.state.userInfo.telphone
  4068. );
  4069. } else {
  4070. self.$set(self.infoForm, k, arrays[k].value);
  4071. }
  4072. }
  4073. } else if (
  4074. result.data &&
  4075. (result.data.status === 1 || result.data.status === 2)
  4076. ) {
  4077. this.$confirm(
  4078. result.data.status === 1
  4079. ? "该商品审核资料已通过,不可重复提交资料"
  4080. : result.data.status === 2
  4081. ? "该商品审核资料处于待审核状态,不可重复提交资料"
  4082. : "请联系管理员",
  4083. "提示",
  4084. {
  4085. confirmButtonText: "返回",
  4086. closeOnClickModal: false,
  4087. closeOnPressEscape: false,
  4088. showCancelButton: false,
  4089. distinguishCancelAndClose: false,
  4090. showClose: false,
  4091. }
  4092. )
  4093. .then((_) => {
  4094. this.$router.back(-1);
  4095. })
  4096. .catch((_) => {});
  4097. }
  4098. }
  4099. });
  4100. });
  4101. },
  4102. returnName(key) {
  4103. if (key === "sex") {
  4104. if (this.infoForm[key]) {
  4105. return this.dictObj["sys_user_sex"][Number(this.infoForm[key])];
  4106. } else {
  4107. return "请选择性别";
  4108. }
  4109. }
  4110. if (key === "education") {
  4111. if (this.infoForm[key]) {
  4112. return this.dictObj["edu_level"][Number(this.infoForm[key])];
  4113. } else {
  4114. return "请选择学历";
  4115. }
  4116. }
  4117. if (key === "working_years") {
  4118. if (this.infoForm[key]) {
  4119. return this.dictObj["working_years"][Number(this.infoForm[key])];
  4120. } else {
  4121. return "请选择工作年限";
  4122. }
  4123. }
  4124. },
  4125. retDraw() {
  4126. this.$set(this.infoForm, "commitment_electr_signature", "");
  4127. this.$nextTick(() => {
  4128. this.$refs.esign[0].reset();
  4129. });
  4130. },
  4131. uploadFile(options, int) {
  4132. var self = this;
  4133. return new Promise((resolve, reject) => {
  4134. var data = {
  4135. imageStatus: int,
  4136. gradeId: this.gradeId,
  4137. orderGoodsId: this.orderGoodsId,
  4138. };
  4139. self.$request
  4140. .getPolicy(data)
  4141. .then((res) => {
  4142. var ossToken = res.data.resultContent;
  4143. if (ossToken.host == null || ossToken.host == undefined) {
  4144. this.$message({
  4145. type: "warning",
  4146. message: "上传路径报错" + JSON.stringify(res.data),
  4147. });
  4148. return;
  4149. }
  4150. let data = this.$tools.convertBase64UrlToBlob(this.faceUrl);
  4151. this.$upload
  4152. .upload(data, 0)
  4153. .then((res) => {
  4154. this.ossAvatarUrl = res;
  4155. resolve(res);
  4156. })
  4157. .catch((err) => {
  4158. this.$message({
  4159. type: "warning",
  4160. message: "上传接口报错,请重新拍照上传",
  4161. });
  4162. this.reTake();
  4163. });
  4164. })
  4165. .catch((err) => {
  4166. this.$message({
  4167. type: "warning",
  4168. message: "签名错误" + JSON.stringify(err),
  4169. });
  4170. return;
  4171. });
  4172. });
  4173. },
  4174. faceRecognition() {
  4175. return new Promise((resolve) => {
  4176. this.$request
  4177. .faceCertificationCompareFace({
  4178. imageA: this.faceUrl,
  4179. orderGoodsId: this.orderGoodsId,
  4180. gradeId: this.gradeId,
  4181. })
  4182. .then((res) => {
  4183. resolve(res.data);
  4184. })
  4185. .catch((err) => {
  4186. this.loading = false;
  4187. this.$message({
  4188. type: "warning",
  4189. message: err.msg,
  4190. });
  4191. });
  4192. });
  4193. },
  4194. /**
  4195. * 点击重拍
  4196. */
  4197. reTake() {
  4198. this.faceUrl = "";
  4199. this.isTaking = true;
  4200. this.getUserMedia({
  4201. video: {
  4202. width: 400,
  4203. height: 300,
  4204. },
  4205. });
  4206. },
  4207. // 点击拍照按钮
  4208. onPhoto() {
  4209. // if (this.isIE) {
  4210. // window.webcam.capture();
  4211. // } else {
  4212. const canvas = document.createElement("canvas");
  4213. canvas.width = 400;
  4214. canvas.height = 300;
  4215. const context = canvas.getContext("2d");
  4216. const video = document.getElementById("video");
  4217. context.drawImage(video, 0, 0, 400, 300);
  4218. this.faceUrl = canvas.toDataURL("image/png");
  4219. this.isTaking = false;
  4220. // }
  4221. },
  4222. getUserMedia(constraints, success, error) {
  4223. if (window.navigator.mediaDevices.getUserMedia) {
  4224. // 最新的标准API
  4225. window.navigator.mediaDevices
  4226. .getUserMedia(constraints)
  4227. .then(success)
  4228. .catch(error);
  4229. } else if (window.navigator.webkitGetUserMedia) {
  4230. // webkit核心浏览器
  4231. window.navigator.webkitGetUserMedia(constraints, success, error);
  4232. } else if (window.navigator.mozGetUserMedia) {
  4233. // firfox浏览器
  4234. window.navigator.mozGetUserMedia(constraints, success, error);
  4235. } else if (window.navigator.getUserMedia) {
  4236. // 旧版API
  4237. window.navigator.getUserMedia(constraints, success, error);
  4238. }
  4239. },
  4240. photographSuccess(stream) {
  4241. // 兼容webkit核心浏览器
  4242. this.isTaking = true;
  4243. this.takePhotoModal = true;
  4244. this.$nextTick(() => {
  4245. const video = document.getElementById("video");
  4246. // 将视频流设置为video元素的源
  4247. console.dir(video);
  4248. video.srcObject = stream;
  4249. this.mediaStreamTrack =
  4250. typeof stream.stop === "function" ? stream : stream.getTracks()[0];
  4251. video.play();
  4252. });
  4253. },
  4254. photographError(err) {
  4255. this.$confirm(
  4256. "课程学习需要开启摄像头进行拍照,经检测您的设备无摄像头可使用,请检测环境是否支持。",
  4257. "提示",
  4258. {
  4259. showConfirmButton: false,
  4260. closeOnClickModal: false,
  4261. showCancelButton: false,
  4262. closeOnPressEscape: false,
  4263. distinguishCancelAndClose: false,
  4264. showClose: false,
  4265. }
  4266. );
  4267. },
  4268. /**
  4269. * 切换科目
  4270. */
  4271. courseChange() {
  4272. return new Promise((resolve) => {
  4273. this.noteParams = {
  4274. pageNum: 1,
  4275. // pageSize: 4,
  4276. };
  4277. this.duration = 0;
  4278. this.playSectionId = 0;
  4279. this.vid = "";
  4280. if (this.player) {
  4281. this.player.destroy();
  4282. }
  4283. this.player = "";
  4284. if (this.playerzb) {
  4285. this.playerzb.destroy();
  4286. }
  4287. this.playerzb = "";
  4288. this.vidzb = "";
  4289. this.historyChatMsgList = [];
  4290. this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  4291. this.courseDetail(); //课程详情
  4292. this.getAnswerList(); //答疑列表
  4293. this.answerTimer = setInterval(() => {
  4294. this.getAnswerList();
  4295. }, 5000);
  4296. this.getMenuList(); //学习目录
  4297. this.getReMenuList(); //获取重修目录
  4298. this.getNoteList(); //获取节笔记
  4299. resolve();
  4300. });
  4301. },
  4302. polyvLiveHistoryChatMsgList() {
  4303. this.$request
  4304. .polyvLiveHistoryChatMsgList({
  4305. sectionId: this.playSectionId,
  4306. channelId: this.sectionItem.liveUrl,
  4307. })
  4308. .then((res) => {
  4309. this.historyChatMsgList = res.data;
  4310. });
  4311. },
  4312. courseDetail() {
  4313. let self = this;
  4314. this.$request.courseDetail(this.courseId).then((res) => {
  4315. // if (res.data.educationName == "继续教育") {
  4316. // this.$request
  4317. // .lockLockAction({
  4318. // action: "jxjy",
  4319. // })
  4320. // .then((res) => {});
  4321. // this.lockTimer = setInterval(() => {
  4322. // this.$request
  4323. // .lockLockAction({
  4324. // action: "jxjy",
  4325. // })
  4326. // .then((res) => {});
  4327. // }, 10000);
  4328. // }
  4329. self.detail = res.data;
  4330. });
  4331. },
  4332. openModule(menuItem) {
  4333. //重修目录点击
  4334. console.log(menuItem.list);
  4335. menuItem.showList = !menuItem.showList;
  4336. if (!menuItem.list.length) {
  4337. if (menuItem.isRebuild) {
  4338. this.getReChapterList(menuItem.id, menuItem.courseId, menuItem);
  4339. } else {
  4340. this.getBuyChapterList(menuItem.id, menuItem.courseId, menuItem);
  4341. }
  4342. }
  4343. },
  4344. getReChapterList(moduleId, courseId, menuItem) {
  4345. this.$request
  4346. .reChapterList({
  4347. moduleId: moduleId,
  4348. gradeId: this.gradeId,
  4349. courseId: courseId,
  4350. rebuild: 1,
  4351. })
  4352. .then((res) => {
  4353. for (let i = 0; i < res.data.length; i++) {
  4354. let item = res.data[i];
  4355. item.id = item.chapterId;
  4356. item.showList = false;
  4357. item.list = [];
  4358. item.parent = menuItem;
  4359. item.isRebuild = 1;
  4360. }
  4361. menuItem.list = res.data;
  4362. });
  4363. },
  4364. getBuyChapterList(moduleId, courseId, menuItem) {
  4365. this.$request
  4366. .reChapterList({
  4367. moduleId: moduleId,
  4368. gradeId: this.gradeId,
  4369. courseId: courseId,
  4370. })
  4371. .then((res) => {
  4372. for (let i = 0; i < res.data.length; i++) {
  4373. let item = res.data[i];
  4374. item.id = item.chapterId;
  4375. item.menuType = 2;
  4376. item.showList = false;
  4377. item.list = [];
  4378. item.parent = menuItem;
  4379. }
  4380. menuItem.list = res.data;
  4381. if (this.needOpen) {
  4382. // this.needOpen = false;
  4383. this.openChapter(menuItem.list[0]);
  4384. }
  4385. });
  4386. },
  4387. openChapter(chapter) {
  4388. console.log(chapter, "chapter");
  4389. chapter.showList = !chapter.showList;
  4390. if (!chapter.list.length) {
  4391. if (chapter.isRebuild) {
  4392. this.getReSectionList(
  4393. chapter.id,
  4394. chapter.courseId,
  4395. chapter.moduleId || 0,
  4396. chapter
  4397. );
  4398. } else {
  4399. this.getBuySectionList(
  4400. chapter.id,
  4401. chapter.courseId,
  4402. chapter.moduleId || 0,
  4403. chapter
  4404. );
  4405. }
  4406. }
  4407. },
  4408. getReSectionList(chapterId, courseId, moduleId, chapter) {
  4409. this.$request
  4410. .reSectionList({
  4411. chapterId: chapterId,
  4412. gradeId: this.gradeId,
  4413. courseId: courseId,
  4414. rebuild: 1,
  4415. moduleId: moduleId,
  4416. })
  4417. .then((res) => {
  4418. let newArr = res.data.filter((item) => {
  4419. return item.type != 2;
  4420. });
  4421. chapter.canLearn = newArr.every((item) => {
  4422. if (item.learning == 1) {
  4423. return true;
  4424. } else {
  4425. return false;
  4426. }
  4427. });
  4428. res.data.forEach((section) => {
  4429. section.parent = chapter;
  4430. });
  4431. chapter.list = res.data;
  4432. });
  4433. },
  4434. getBuySectionList(chapterId, courseId, moduleId = 0, chapter) {
  4435. this.$request
  4436. .reSectionList({
  4437. chapterId: chapterId,
  4438. gradeId: this.gradeId,
  4439. courseId: courseId,
  4440. moduleId: moduleId,
  4441. })
  4442. .then((res) => {
  4443. let newArr = res.data.filter((item) => {
  4444. return item.type != 2;
  4445. });
  4446. chapter.canLearn = newArr.every((item) => {
  4447. if (item.learning == 1) {
  4448. return true;
  4449. } else {
  4450. return false;
  4451. }
  4452. });
  4453. res.data.forEach((section) => {
  4454. section.parent = chapter;
  4455. });
  4456. chapter.list = res.data;
  4457. if (this.needOpen) {
  4458. this.needOpen = false;
  4459. if (
  4460. chapter.list &&
  4461. !this.sectionItem.recordingUrl &&
  4462. this.sectionItem.sectionType != 2
  4463. ) {
  4464. // this.getResource(chapter.list[0]);
  4465. }
  4466. }
  4467. });
  4468. },
  4469. getGoodsDetail() {
  4470. return new Promise((resolve) => {
  4471. let self = this;
  4472. this.$request.goodsDetail(this.goodsId).then((res) => {
  4473. self.goodsData = res.data;
  4474. self.gradeId = self.goodsData.gradeId;
  4475. if (this.goodsData.categoryName) {
  4476. this.infoForm.apply_post = this.goodsData.categoryName;
  4477. if (this.goodsData.categoryName) {
  4478. this.apply_post_disabled = true;
  4479. }
  4480. if (this.userInfo.companyName) {
  4481. this.infoForm.work_unit = this.userInfo.companyName;
  4482. }
  4483. }
  4484. if (this.goodsData.buyNote) {
  4485. this.tabList = [
  4486. { name: "1", label: "学员须知" },
  4487. { name: "2", label: "课程答疑" },
  4488. { name: "3", label: "笔记讲义" },
  4489. ];
  4490. console.log(res, "res111");
  4491. this.getRecommend();
  4492. } else {
  4493. this.tabList = [
  4494. { name: "1", label: "课程答疑" },
  4495. { name: "2", label: "笔记讲义" },
  4496. ];
  4497. }
  4498. this.courseBusiness();
  4499. this.courseHandouts();
  4500. if (self.goodsData.goodsPlayConfig) {
  4501. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  4502. if (self.goodsPlayConfig.autoPlay > 0) {
  4503. self.autoplay = true;
  4504. }
  4505. if (self.goodsPlayConfig.drag > 0) {
  4506. self.isAllowSeek = "off";
  4507. }
  4508. if (self.goodsPlayConfig.speed > 0) {
  4509. self.playbackRate = true;
  4510. }
  4511. }
  4512. if (self.goodsData.goodsPhotographConfig) {
  4513. self.goodsPhotographConfig = JSON.parse(
  4514. self.goodsData.goodsPhotographConfig
  4515. );
  4516. if (self.goodsPhotographConfig.photoNum > 0) {
  4517. self.photoNum = self.goodsPhotographConfig.photoNum;
  4518. }
  4519. }
  4520. });
  4521. resolve();
  4522. });
  4523. },
  4524. /**
  4525. * 点击节
  4526. */
  4527. async getResource(section) {
  4528. //逻辑
  4529. if (section.type == 2) {
  4530. //试卷
  4531. console.log("试卷");
  4532. console.log(section);
  4533. let learnNum = await this.goodsTodayStudySectionNum();
  4534. let hasLearn = await this.gradeCheckGoodsStudy(section.typeId);
  4535. if (this.goodsData.sectionMaxNum > 0) {
  4536. if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
  4537. this.$message({
  4538. type: "warning",
  4539. message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
  4540. });
  4541. return;
  4542. }
  4543. }
  4544. if (this.businessData.goodsLearningOrder == 1) {
  4545. if (section.parent.canLearn) {
  4546. let num = await this.bankRecordDoNum(section);
  4547. //有次数限制
  4548. if (section.answerNum - num > 0 && section.answerNum > 0) {
  4549. // this.$set(this.list[index],'doNum',(item.doNum+1))
  4550. this.$router.push({
  4551. path: "/course-exam/" + this.goodsId,
  4552. query: {
  4553. courseId: this.courseId,
  4554. gradeId: this.gradeId,
  4555. moduleId: section.moduleId || 0,
  4556. examId: section.typeId,
  4557. chapterId: section.chapterId || 0,
  4558. orderGoodsId: this.orderGoodsId,
  4559. },
  4560. });
  4561. //没有答题次数限制
  4562. } else if (section.answerNum == 0) {
  4563. this.$router.push({
  4564. path: "/course-exam/" + this.goodsId,
  4565. query: {
  4566. courseId: this.courseId,
  4567. gradeId: this.gradeId,
  4568. moduleId: section.moduleId || 0,
  4569. examId: section.typeId,
  4570. chapterId: section.chapterId || 0,
  4571. orderGoodsId: this.orderGoodsId,
  4572. },
  4573. });
  4574. } else {
  4575. this.$message({
  4576. type: "warning",
  4577. message: "该试卷只能答题" + section.answerNum + "次",
  4578. });
  4579. return;
  4580. }
  4581. } else {
  4582. this.$message({
  4583. type: "warning",
  4584. message: "请按顺序学完视频课程再进行练习和测试",
  4585. });
  4586. }
  4587. } else if (
  4588. this.businessData.goodsLearningOrder == 2 &&
  4589. !section.rebuild
  4590. ) {
  4591. let rows = await this.studyRecordMenuAllList();
  4592. let isStop = false;
  4593. let newRows = [];
  4594. for (let i = 0; i < rows.length; i++) {
  4595. let moduleTrue = rows[i].moduleId == section.moduleId;
  4596. let chapterTrue = rows[i].chapterId == section.chapterId;
  4597. if (moduleTrue && chapterTrue) {
  4598. isStop = true;
  4599. if (rows[i].sectionType != 2) {
  4600. //忽略直播
  4601. newRows.push(rows[i]);
  4602. }
  4603. } else {
  4604. if (!isStop) {
  4605. if (rows[i].sectionType != 2) {
  4606. //忽略直播
  4607. newRows.push(rows[i]);
  4608. }
  4609. } else {
  4610. break;
  4611. }
  4612. }
  4613. }
  4614. console.log(newRows);
  4615. let isAllLearn = newRows.every((item) => {
  4616. return item.studyStatus == 1;
  4617. });
  4618. if (isAllLearn) {
  4619. //之前的都学完了
  4620. // if(canLearn) { //视频的上一节学完
  4621. let num = await this.bankRecordDoNum(section.typeId);
  4622. //有次数限制
  4623. if (section.answerNum - num > 0 && section.answerNum > 0) {
  4624. console.log(this.list[index]);
  4625. this.$router.push({
  4626. path: "/course-exam/" + this.goodsId,
  4627. query: {
  4628. courseId: this.courseId,
  4629. gradeId: this.gradeId,
  4630. moduleId: section.moduleId || 0,
  4631. examId: section.typeId,
  4632. chapterId: section.chapterId || 0,
  4633. orderGoodsId: this.orderGoodsId,
  4634. },
  4635. });
  4636. //没有答题次数限制
  4637. } else if (section.answerNum == 0) {
  4638. this.$router.push({
  4639. path: "/course-exam/" + this.goodsId,
  4640. query: {
  4641. courseId: this.courseId,
  4642. gradeId: this.gradeId,
  4643. moduleId: section.moduleId || 0,
  4644. examId: section.typeId,
  4645. chapterId: section.chapterId || 0,
  4646. orderGoodsId: this.orderGoodsId,
  4647. },
  4648. });
  4649. } else {
  4650. this.$message({
  4651. type: "warning",
  4652. message: "该试卷只能答题" + section.answerNum + "次",
  4653. });
  4654. return;
  4655. }
  4656. } else {
  4657. this.$message({
  4658. type: "warning",
  4659. message: "请学完视频课程再进行练习和测试",
  4660. });
  4661. }
  4662. } else {
  4663. let num = await this.bankRecordDoNum(section.typeId);
  4664. //有次数限制
  4665. if (section.answerNum - section.doNum > 0 && section.answerNum > 0) {
  4666. // this.$set(this.list[index],'doNum',(item.doNum+1))
  4667. this.$router.push({
  4668. path: "/course-exam/" + this.goodsId,
  4669. query: {
  4670. courseId: this.courseId,
  4671. gradeId: this.gradeId,
  4672. moduleId: section.moduleId || 0,
  4673. examId: section.typeId,
  4674. chapterId: section.chapterId || 0,
  4675. orderGoodsId: this.orderGoodsId,
  4676. },
  4677. });
  4678. //没有答题次数限制
  4679. } else if (section.answerNum == 0) {
  4680. this.$router.push({
  4681. path: "/course-exam/" + this.goodsId,
  4682. query: {
  4683. courseId: this.courseId,
  4684. gradeId: this.gradeId,
  4685. moduleId: section.moduleId || 0,
  4686. examId: section.typeId,
  4687. chapterId: section.chapterId || 0,
  4688. orderGoodsId: this.orderGoodsId,
  4689. },
  4690. });
  4691. } else {
  4692. this.$message({
  4693. type: "warning",
  4694. message: "该试卷只能答题" + section.answerNum + "次",
  4695. });
  4696. return;
  4697. }
  4698. }
  4699. return;
  4700. }
  4701. if (section.type != 2) {
  4702. if (this.clickLock) {
  4703. return;
  4704. }
  4705. this.clickLock = true;
  4706. if (
  4707. this.playSectionId &&
  4708. (this.playSectionId == section.sectionId ||
  4709. this.playSectionId == section.menuId) &&
  4710. this.moduleId == (section.moduleId || 0) &&
  4711. this.chapterId == (section.chapterId || 0)
  4712. ) {
  4713. //切换为同一频道不作为
  4714. this.clickLock = false;
  4715. return;
  4716. }
  4717. if (this.businessData.goodsLearningOrder == 2 && !section.isRebuild) {
  4718. //要按从头到尾顺序学习, 且不是重修课程
  4719. let rows = await this.studyRecordMenuAllList();
  4720. if (!this.hasPreItem(rows, section)) {
  4721. //判断是否有上一节
  4722. let newRows = [];
  4723. for (let i = 0; i < rows.length; i++) {
  4724. let moduleTrue =
  4725. rows[i].moduleId == section.moduleId || rows[i].moduleId == 0;
  4726. let chapterTrue =
  4727. rows[i].chapterId == section.chapterId ||
  4728. rows[i].chapterId == 0;
  4729. let sectionTrue =
  4730. rows[i].sectionId == section.sectionId ||
  4731. rows[i].sectionId == section.menuId;
  4732. if (moduleTrue && chapterTrue && sectionTrue) {
  4733. break;
  4734. } else {
  4735. if (rows[i].sectionType != 2) {
  4736. newRows.push(rows[i]);
  4737. }
  4738. }
  4739. }
  4740. let isAllLearn = newRows.every((item) => {
  4741. return item.studyStatus == 1;
  4742. });
  4743. if (isAllLearn) {
  4744. this.initVideo(section);
  4745. } else {
  4746. this.clickLock = false;
  4747. this.$message({
  4748. type: "warning",
  4749. message: "请按顺序学习视频课程",
  4750. });
  4751. }
  4752. } else {
  4753. //第一章第一节
  4754. this.initVideo(section);
  4755. }
  4756. } else {
  4757. this.initVideo(section);
  4758. }
  4759. }
  4760. },
  4761. bankRecordDoNum(section) {
  4762. return new Promise((resolve) => {
  4763. this.$request
  4764. .bankRecordDoNum({
  4765. goodsId: this.goodsId,
  4766. gradeId: this.gradeId,
  4767. chapterId: section.chapterId,
  4768. courseId: this.courseId,
  4769. moduleId: 0,
  4770. examId: section.typeId,
  4771. })
  4772. .then((res) => {
  4773. resolve(res.data);
  4774. });
  4775. });
  4776. },
  4777. /**
  4778. * 是否有上一章节
  4779. */
  4780. hasPreItem(rows, option) {
  4781. let moduleId = option.moduleId;
  4782. let chapterId = option.chapterId;
  4783. let sectionId = option.sectionId;
  4784. let index = 0;
  4785. for (let i = 0; i < rows.length; i++) {
  4786. if (
  4787. rows[i].moduleId == moduleId &&
  4788. rows[i].chapterId == chapterId &&
  4789. rows[i].sectionId == sectionId
  4790. ) {
  4791. index = i;
  4792. break;
  4793. }
  4794. }
  4795. if (index == 0) {
  4796. return false;
  4797. } else {
  4798. return true;
  4799. }
  4800. },
  4801. async initVideo(option) {
  4802. if (option.sectionType == 1 || option.sectionType == 3) {
  4803. //录播
  4804. let learnNum = await this.goodsTodayStudySectionNum(option);
  4805. let hasLearn = await this.gradeCheckGoodsStudy(option);
  4806. console.log(hasLearn, "hasLearn");
  4807. console.log(learnNum, "learnNum");
  4808. console.log(
  4809. this.goodsData.sectionMaxNum,
  4810. "this.goodsData.sectionMaxNum"
  4811. );
  4812. if (this.goodsData.sectionMaxNum > 0) {
  4813. if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
  4814. this.clickLock = false;
  4815. this.$message({
  4816. type: "warning",
  4817. message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
  4818. });
  4819. return;
  4820. }
  4821. }
  4822. if (!option.recordingUrl) {
  4823. this.clickLock = false;
  4824. this.$message({
  4825. type: "warning",
  4826. message: `暂无播放地址数据`,
  4827. });
  4828. return;
  4829. }
  4830. if (this.playSectionId > 0) {
  4831. //切换视频
  4832. // let oldSectionId = this.playSectionId;
  4833. // uni.$emit("changeSection", oldSectionId);
  4834. }
  4835. this.playVideo(option);
  4836. }
  4837. if (option.sectionType == 2) {
  4838. //直播
  4839. let learnNum = await this.goodsTodayStudySectionNum(option);
  4840. let hasLearn = await this.gradeCheckGoodsStudy(option);
  4841. if (this.goodsData.sectionMaxNum > 0) {
  4842. if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
  4843. this.clickLock = false;
  4844. this.$message({
  4845. type: "warning",
  4846. message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
  4847. });
  4848. return;
  4849. }
  4850. }
  4851. if (!option.liveUrl) {
  4852. this.clickLock = false;
  4853. this.$message({
  4854. type: "warning",
  4855. message: `暂无直播地址数据`,
  4856. });
  4857. }
  4858. let data = await this.studyRecordGetChannelBasicInfo(option.liveUrl);
  4859. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  4860. this.clickLock = false;
  4861. this.$message({
  4862. type: "warning",
  4863. message: `直播已结束`,
  4864. });
  4865. return;
  4866. }
  4867. if (data.watchStatus == "waiting") {
  4868. this.clickLock = false;
  4869. this.$message({
  4870. type: "warning",
  4871. message: `直播未开始`,
  4872. });
  4873. return;
  4874. }
  4875. this.playVideo(option);
  4876. }
  4877. return;
  4878. },
  4879. studyRecordGetChannelBasicInfo(channelId) {
  4880. return new Promise((resolve) => {
  4881. this.$request
  4882. .studyRecordGetChannelBasicInfo({
  4883. channelId,
  4884. })
  4885. .then((res) => {
  4886. console.log(res, "channel");
  4887. resolve(res.data);
  4888. });
  4889. });
  4890. },
  4891. /**
  4892. * 判断是否是当前播放的节
  4893. */
  4894. isActive(section) {
  4895. let moduleId = section.moduleId || 0;
  4896. let chapterId = section.chapterId || 0;
  4897. let sectionId = section.sectionId || section.menuId;
  4898. if (
  4899. moduleId == this.moduleId &&
  4900. chapterId == this.chapterId &&
  4901. sectionId == this.playSectionId
  4902. ) {
  4903. return true;
  4904. } else {
  4905. return false;
  4906. }
  4907. },
  4908. async playVideo(option) {
  4909. if (option.sectionType == 1 || option.sectionType == 3) {
  4910. //录播
  4911. //设置播放的节ID
  4912. //提交保存观看历史
  4913. if (this.playSectionId) {
  4914. this.postStudyRecord(0, this.playSectionId);
  4915. }
  4916. this.player &&
  4917. this.player.HTML5.video.removeEventListener(
  4918. "timeupdate",
  4919. this.timeEvent
  4920. );
  4921. //播放视频
  4922. this.showRecordStatus = false; //隐藏播放记录提示
  4923. this.sectionItem = option;
  4924. console.log(option, "option");
  4925. this.isPlayRebuild = option.rebuild;
  4926. this.moduleId = option.moduleId || 0;
  4927. this.chapterId = option.chapterId || 0;
  4928. this.playSectionId = option.sectionId || option.menuId;
  4929. // console.log(this.moduleId, this.chapterId, this.playSectionId);
  4930. await this.getPhotoLastRecord();
  4931. this.recordObj = await this.getRecordLast();
  4932. this.getNoteList();
  4933. await this.clears();
  4934. this.vid = option.recordingUrl;
  4935. this.historyChatMsgList = [];
  4936. if (option.sectionType == 3) {
  4937. this.polyvLiveHistoryChatMsgList();
  4938. }
  4939. this.loadPlayerScript(this.loadPlayer);
  4940. setTimeout(() => {
  4941. this.clickLock = false;
  4942. }, 3000);
  4943. // uni.$emit("levelId", this.levelId);
  4944. // uni.$emit("getSection", this.menuItem);
  4945. // uni.$emit("isRebuild", this.isRebuild);
  4946. }
  4947. if (option.sectionType == 2) {
  4948. //直播
  4949. //提交保存观看历史
  4950. if (this.playSectionId) {
  4951. this.postStudyRecord(0, this.playSectionId);
  4952. }
  4953. this.player &&
  4954. this.player.HTML5.video.removeEventListener(
  4955. "timeupdate",
  4956. this.timeEvent
  4957. );
  4958. //播放视频
  4959. this.showRecordStatus = false; //隐藏播放记录提示
  4960. this.sectionItem = option;
  4961. console.log(option, "option");
  4962. this.isPlayRebuild = option.rebuild;
  4963. this.moduleId = option.moduleId || 0;
  4964. this.chapterId = option.chapterId || 0;
  4965. this.playSectionId = option.sectionId || option.menuId;
  4966. // console.log(this.moduleId, this.chapterId, this.playSectionId);
  4967. await this.getPhotoLastRecord();
  4968. this.recordObj = await this.getRecordLast();
  4969. this.getNoteList();
  4970. //设置播放的节ID
  4971. await this.clears();
  4972. this.vidzb = option.liveUrl;
  4973. this.$router.push({
  4974. path: "/living-room/" + option.liveUrl,
  4975. query: {
  4976. goodsId: this.goodsId,
  4977. courseId: this.courseId,
  4978. gradeId: this.gradeId,
  4979. orderGoodsId: this.orderGoodsId,
  4980. sectionId: option.sectionId || option.menuId,
  4981. chapterId: option.chapterId || 0,
  4982. moduleId: option.moduleId || 0,
  4983. sectionType: 2,
  4984. },
  4985. });
  4986. // this.loadPlayerScriptzb(this.loadPlayerzb);
  4987. // setTimeout(() => {
  4988. // this.clickLock = false;
  4989. // }, 3000);
  4990. }
  4991. },
  4992. gradeCheckGoodsStudy(option) {
  4993. return new Promise((resolve) => {
  4994. this.$request
  4995. .gradeCheckGoodsStudy({
  4996. goodsId: this.goodsId,
  4997. gradeId: this.gradeId,
  4998. moduleId: option.moduleId || 0,
  4999. chapterId: option.chapterId || 0,
  5000. sectionId: option.sectionId || option.menuId,
  5001. })
  5002. .then((res) => {
  5003. resolve(res.data);
  5004. });
  5005. });
  5006. },
  5007. goodsTodayStudySectionNum(option) {
  5008. return new Promise((resolve) => {
  5009. this.$request
  5010. .goodsTodayStudySectionNum({
  5011. goodsId: this.goodsId,
  5012. gradeId: this.gradeId,
  5013. })
  5014. .then((res) => {
  5015. resolve(res.data);
  5016. });
  5017. });
  5018. },
  5019. studyRecordMenuAllList() {
  5020. return new Promise((resolve) => {
  5021. this.$request
  5022. .studyRecordMenuAllList({
  5023. courseId: this.courseId,
  5024. gradeId: this.gradeId,
  5025. goodsId: this.goodsId,
  5026. })
  5027. .then((res) => {
  5028. resolve(res.data);
  5029. });
  5030. });
  5031. },
  5032. loadPlayerzb() {
  5033. var self = this;
  5034. const polyvLivePlayer = window.polyvLivePlayer;
  5035. this.playerzb = polyvLivePlayer({
  5036. wrap: "#playerzb",
  5037. width: 810,
  5038. height: 455,
  5039. showLine: "off",
  5040. uid: this.uidzb,
  5041. vid: this.vidzb,
  5042. });
  5043. this.playerzb.on("s2j_onStartPlay", () => {
  5044. console.log("s2j_onStartPlay");
  5045. this.hasStart = true;
  5046. this.livingTimer = setInterval(self.timeEventLiving, 1000);
  5047. });
  5048. this.playerzb.on("s2j_onOver", () => {
  5049. console.log("s2j_onOver");
  5050. clearInterval(this.livingTimer);
  5051. this.hasStart = false;
  5052. this.$message({
  5053. type: "success",
  5054. message: "播放完毕",
  5055. });
  5056. this.postStudyRecord(1);
  5057. });
  5058. },
  5059. loadPlayer() {
  5060. var self = this;
  5061. const polyvPlayer = window.polyvPlayer;
  5062. console.log(polyvPlayer);
  5063. self.$request.obtainpolyvvideosign(self.vid).then((res) => {
  5064. console.log(res, "res2");
  5065. self.player = polyvPlayer({
  5066. wrap: "#player",
  5067. width: 810,
  5068. showLine: "off",
  5069. height: 455,
  5070. ban_history_time: "on",
  5071. vid: self.vid,
  5072. autoplay: this.autoplay,
  5073. ban_seek: this.isAllowSeek,
  5074. speed: this.playbackRate,
  5075. teaser_show: 1,
  5076. tail_show: 1,
  5077. hideSwitchPlayer: true,
  5078. watchStartTime: this.recordObj.videoCurrentTime,
  5079. ts: res.data.ts,
  5080. sign: res.data.sign,
  5081. // adMatter: [
  5082. // {
  5083. // // 广告参数详细配置
  5084. // location: 1, //广告位置: 1 片头广告,2 暂停广告,3 片尾广告,4 弹窗广告
  5085. // adtype: 2, //广告资源类型: 1 图片广告,2 视频广告,3 swf广告(flash播放器生效)
  5086. // matterurl: "https://www.runoob.com/try/demo_source/movie.mp4", //广告资源URL
  5087. // timesize: 5, //广告时长,单位:秒
  5088. // skipenabled: false, //是否显示跳过按钮
  5089. // },
  5090. // {
  5091. // // 广告参数详细配置
  5092. // location: 3, //广告位置: 1 片头广告,2 暂停广告,3 片尾广告,4 弹窗广告
  5093. // adtype: 2, //广告资源类型: 1 图片广告,2 视频广告,3 swf广告(flash播放器生效)
  5094. // matterurl: "https://www.runoob.com/try/demo_source/movie.mp4", //广告资源URL
  5095. // timesize: 5, //广告时长,单位:秒
  5096. // skipenabled: false, //是否显示跳过按钮
  5097. // },
  5098. // ],
  5099. playsafe: function (vid, next) {
  5100. next();
  5101. },
  5102. });
  5103. this.player.HTML5.video.addEventListener("timeupdate", self.timeEvent);
  5104. this.player.on("s2j_onPlayStart", () => {
  5105. //开始播放每5秒提交一次观看时间
  5106. this.hasStart = true;
  5107. clearInterval(this.postTimer);
  5108. this.postTimer = setInterval(() => {
  5109. this.postStudyRecord(0, this.playSectionId, 5);
  5110. }, 30000);
  5111. if (this.recordObj.videoCurrentTime) {
  5112. this.showRecordStatus = true;
  5113. setTimeout(() => {
  5114. this.showRecordStatus = false;
  5115. }, 5000);
  5116. } else {
  5117. //新视频直接提交一条观看记录
  5118. // this.postStudyRecord(0);
  5119. this.showRecordStatus = false;
  5120. }
  5121. });
  5122. this.player.on("s2j_onVideoPause", () => {
  5123. clearInterval(this.postTimer);
  5124. });
  5125. this.player.on("s2j_onVideoPlay", () => {
  5126. if (this.postTimer) {
  5127. this.postTimer = setInterval(() => {
  5128. this.postStudyRecord(0, this.playSectionId, 5);
  5129. }, 30000);
  5130. }
  5131. });
  5132. this.player.on("s2j_onPlayOver", () => {
  5133. this.hasStart = false;
  5134. clearInterval(this.postTimer);
  5135. this.$message({
  5136. type: "success",
  5137. message: "播放完毕",
  5138. });
  5139. this.postStudyRecord(1);
  5140. });
  5141. });
  5142. },
  5143. timeEventLiving() {
  5144. var polyvPlayerContext = this.playerzb;
  5145. if (polyvPlayerContext) {
  5146. this.liveDuration = this.liveDuration + 1; //每隔1秒
  5147. console.log(this.liveDuration);
  5148. if (this.liveDuration == 2) {
  5149. //直播第2秒拍照
  5150. if (
  5151. this.goodsPhotographConfig &&
  5152. this.goodsPhotographConfig.livephotograph == 1 &&
  5153. this.sectionItem.learning != 1 &&
  5154. this.photoHistoryList.length == 0
  5155. ) {
  5156. //开启直播拍照
  5157. polyvPlayerContext.j2s_pauseVideo();
  5158. this.openPhoto();
  5159. } else {
  5160. this.postStudyRecord();
  5161. }
  5162. }
  5163. }
  5164. },
  5165. timeEvent() {
  5166. let self = this;
  5167. var polyvPlayerContext = this.player;
  5168. if (polyvPlayerContext) {
  5169. this.playTime = polyvPlayerContext.j2s_getCurrentTime(); //播放时刻
  5170. // console.log(this.playTime,789,this.photoHistoryList)
  5171. //判断是否需要拍照
  5172. if (this.photoNum > 0) {
  5173. this.configPhoto();
  5174. let photoTime = 0; //获取拍照秒数
  5175. for (let i = 0; i < this.photoList.length; i++) {
  5176. photoTime = Number(this.photoList[i]); //获取拍照秒数
  5177. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  5178. //3秒区间内才触发拍照,避免拉动滚动条
  5179. if (
  5180. this.photoHistoryList.indexOf(i) < 0 &&
  5181. this.sectionItem.learning != 1
  5182. ) {
  5183. //不存在拍照历史,没有重修过,没有学过,则拍照
  5184. //启动拍照
  5185. //暂停
  5186. polyvPlayerContext.j2s_pauseVideo();
  5187. this.photoIndex = i;
  5188. this.openPhoto();
  5189. } else {
  5190. }
  5191. }
  5192. }
  5193. }
  5194. }
  5195. },
  5196. getPhotoLastRecord() {
  5197. return new Promise((resolve) => {
  5198. let self = this;
  5199. let data = {
  5200. sectionId: parseInt(self.playSectionId),
  5201. goodsId: parseInt(self.goodsId),
  5202. courseId: parseInt(self.courseId),
  5203. gradeId: parseInt(self.gradeId),
  5204. chapterId: parseInt(self.chapterId),
  5205. moduleId: parseInt(self.moduleId),
  5206. };
  5207. this.$request.getPhotoLastRecord(data).then((res) => {
  5208. //清空历史数据
  5209. self.photoHistoryList = [];
  5210. this.photoIndex = 0;
  5211. self.photoList = [];
  5212. for (let i = 0; i < res.data.length; i++) {
  5213. //-2存储随机拍照数组
  5214. if (res.data[i].photoIndex == -2) {
  5215. self.photoList = res.data[i].timeInterval.split(",");
  5216. } else {
  5217. self.photoHistoryList.push(res.data[i].photoIndex);
  5218. }
  5219. }
  5220. resolve();
  5221. });
  5222. });
  5223. },
  5224. //拍照
  5225. openPhoto() {
  5226. var polyvPlayerContext = this.player;
  5227. if (polyvPlayerContext) {
  5228. if (this.isFullScreen()) {
  5229. this.exitFullscreen();
  5230. }
  5231. }
  5232. var polyvPlayerContext = this.playerzb;
  5233. if (polyvPlayerContext) {
  5234. if (this.isFullScreen()) {
  5235. this.exitFullscreen();
  5236. }
  5237. }
  5238. this.$nextTick(() => {
  5239. if (
  5240. (window.navigator.mediaDevices &&
  5241. window.navigator.mediaDevices.getUserMedia) ||
  5242. window.navigator.getUserMedia ||
  5243. window.navigator.webkitGetUserMedia ||
  5244. window.navigator.mozGetUserMedia
  5245. ) {
  5246. console.log(this.getUserMedia, "getUserMedia");
  5247. // 调用用户媒体设备, 访问摄像头
  5248. this.getUserMedia(
  5249. {
  5250. video: {
  5251. width: 400,
  5252. height: 300,
  5253. },
  5254. },
  5255. this.photographSuccess,
  5256. this.photographError
  5257. );
  5258. } else {
  5259. this.photographError();
  5260. }
  5261. });
  5262. },
  5263. /**
  5264. * 退出全屏
  5265. */
  5266. exitFullscreen() {
  5267. try {
  5268. var de = document;
  5269. console.log(de);
  5270. if (de.exitFullscreen) {
  5271. de.exitFullscreen();
  5272. } else if (de.mozCancelFullScreen) {
  5273. de.mozCancelFullScreen();
  5274. } else if (de.webkitCancelFullScreen) {
  5275. de.webkitCancelFullScreen();
  5276. }
  5277. } catch (err) {}
  5278. },
  5279. fullele() {
  5280. return (
  5281. document.fullscreenElement ||
  5282. document.webkitFullscreenElement ||
  5283. document.msFullscreenElement ||
  5284. document.mozFullScreenElement ||
  5285. null
  5286. );
  5287. },
  5288. //判断是否全屏
  5289. isFullScreen() {
  5290. return !!(document.webkitIsFullScreen || this.fullele());
  5291. },
  5292. //配置随机拍照时间
  5293. configPhoto() {
  5294. var polyvPlayerContext = this.player;
  5295. let totalVideoTime = polyvPlayerContext.j2s_getDuration();
  5296. let duration = polyvPlayerContext.j2s_getCurrentTime();
  5297. let photoNum = this.photoNum;
  5298. if (!this.photoConfig) {
  5299. this.photoConfig = true;
  5300. //没有历史拍照间隔数据
  5301. if (this.photoList.length == 0) {
  5302. if (totalVideoTime >= 900) {
  5303. //大于15分钟
  5304. if (photoNum == 1) {
  5305. //开头拍1张
  5306. this.photoList.push(1);
  5307. } else if (photoNum == 3) {
  5308. //拍3张
  5309. this.photoList.push(0); //开头拍一张
  5310. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  5311. let centerMinTime = centerTime - 300; //前后5分钟
  5312. let centerMaxTime = centerTime + 300;
  5313. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  5314. this.photoList.push(centerTakeTime); //中间拍一张
  5315. let endMaxTime = totalVideoTime - 60;
  5316. let endMinTime = totalVideoTime - 300;
  5317. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  5318. this.photoList.push(endTakeTime); //最后拍一张
  5319. }
  5320. } else {
  5321. //小于15分钟,只拍前后各一张
  5322. if (photoNum == 1) {
  5323. //开头拍1张
  5324. this.photoList.push(1);
  5325. } else if (photoNum == 3) {
  5326. //拍2张
  5327. if (totalVideoTime <= 300) {
  5328. //小于5分钟
  5329. this.photoList.push(1); //开头拍一张
  5330. let endTakeTime = this.randomNum(10, totalVideoTime); //中间随机取一张
  5331. this.photoList.push(endTakeTime);
  5332. } else {
  5333. this.photoList.push(1); //开头拍一张
  5334. let endMaxTime = totalVideoTime - 60;
  5335. let endMinTime = totalVideoTime - 300;
  5336. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  5337. this.photoList.push(endTakeTime); //最后1-5分钟拍一张
  5338. }
  5339. }
  5340. }
  5341. console.log(this.photoList, "随机拍照时间数组11", photoNum);
  5342. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  5343. }
  5344. console.log(this.photoList, "随机拍照时间数组");
  5345. //兼容已有观看历史
  5346. for (let i = 0; i < this.photoList.length - 1; i++) {
  5347. if (
  5348. this.photoList[i] < duration &&
  5349. this.photoList[i + 1] > duration
  5350. ) {
  5351. this.photoIndex = i + 1;
  5352. // console.log("我的修改了photoIndex")
  5353. break;
  5354. }
  5355. if (duration > this.photoList[this.photoList.length - 1]) {
  5356. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  5357. // console.log("我的修改了photoIndex")
  5358. break;
  5359. }
  5360. }
  5361. }
  5362. },
  5363. randomNum(minNum, maxNum) {
  5364. switch (arguments.length) {
  5365. case 1:
  5366. return parseInt(Math.random() * minNum + 1, 10);
  5367. break;
  5368. case 2:
  5369. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  5370. break;
  5371. default:
  5372. return 0;
  5373. break;
  5374. }
  5375. },
  5376. //postTime 只提交随机时间
  5377. postCoursePhotoRecord(postTime = false) {
  5378. return new Promise((resolve, reject) => {
  5379. let currentTime = 0;
  5380. var polyvPlayerContext = this.player;
  5381. if (polyvPlayerContext) {
  5382. currentTime = polyvPlayerContext.j2s_getCurrentTime();
  5383. }
  5384. let self = this;
  5385. let photoIndex = self.photoIndex;
  5386. let data = {
  5387. photo: self.ossAvatarUrl,
  5388. sectionId: parseInt(self.playSectionId),
  5389. goodsId: parseInt(self.goodsId),
  5390. courseId: parseInt(self.courseId),
  5391. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  5392. gradeId: parseInt(self.gradeId),
  5393. photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
  5394. photoNum: parseInt(self.photoNum),
  5395. chapterId: parseInt(self.chapterId),
  5396. moduleId: parseInt(self.moduleId),
  5397. timeInterval: postTime ? self.photoList.join(",") : "",
  5398. };
  5399. console.log("提交接口", data);
  5400. this.$request
  5401. .coursePhotoRecord(data)
  5402. .then((res) => {
  5403. console.log(res, "res");
  5404. resolve();
  5405. })
  5406. .catch((err) => {
  5407. console.log(err, "err");
  5408. reject();
  5409. });
  5410. });
  5411. },
  5412. /**
  5413. * @param {String} 直播预览
  5414. */
  5415. loadPlayerScriptzb(callback) {
  5416. if (!window.polyvLivePlayer) {
  5417. const myScript = document.createElement("script");
  5418. myScript.setAttribute("src", this.playerJs);
  5419. myScript.onload = callback;
  5420. document.body.appendChild(myScript);
  5421. } else {
  5422. callback();
  5423. }
  5424. },
  5425. loadPlayerScript(callback) {
  5426. if (!window.polyvPlayer) {
  5427. const myScript = document.createElement("script");
  5428. myScript.setAttribute("src", this.vodPlayerJs);
  5429. myScript.onload = callback;
  5430. document.body.appendChild(myScript);
  5431. } else {
  5432. callback();
  5433. }
  5434. },
  5435. clears() {
  5436. return new Promise((resolve, reject) => {
  5437. this.vid = "";
  5438. this.vidzb = "";
  5439. if (this.player) {
  5440. this.player.destroy();
  5441. }
  5442. if (this.playerzb) {
  5443. this.playerzb.destroy();
  5444. }
  5445. resolve();
  5446. });
  5447. },
  5448. /**
  5449. * 提交观看记录
  5450. */
  5451. postStudyRecord(status = 0, sectionId = this.playSectionId) {
  5452. let currentTime = 0;
  5453. let PlayDuration = 0;
  5454. var polyvPlayerContext = this.player;
  5455. if (polyvPlayerContext) {
  5456. currentTime = polyvPlayerContext.j2s_getCurrentTime(); //当前视频播放时刻
  5457. PlayDuration = polyvPlayerContext.j2s_realPlayVideoTime(); //本次看的时长
  5458. }
  5459. if (this.vidzb) {
  5460. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  5461. }
  5462. let self = this;
  5463. console.log(this);
  5464. console.log(PlayDuration, "PlayDuration");
  5465. let data = {
  5466. fromPlat: 2, //来源平台 1小程序 2网站
  5467. photo: self.ossAvatarUrl,
  5468. sectionId: parseInt(this.playSectionId),
  5469. goodsId: parseInt(this.goodsId),
  5470. courseId: parseInt(this.courseId),
  5471. studyDuration: parseInt(PlayDuration > 0 ? PlayDuration : 0),
  5472. gradeId: parseInt(this.gradeId),
  5473. chapterId: parseInt(this.chapterId),
  5474. moduleId: parseInt(this.moduleId),
  5475. videoCurrentTime: parseInt(currentTime > 0 ? currentTime : 0),
  5476. orderGoodsId: parseInt(this.orderGoodsId),
  5477. };
  5478. console.log(data, "data");
  5479. if (status > 0) {
  5480. data.status = status;
  5481. }
  5482. this.$request
  5483. .studyRecord(data)
  5484. .then((res) => {
  5485. if (status > 0) {
  5486. //看完视频刷新父级列表
  5487. let rebuildObj = this.getSameObj(this.sectionItem);
  5488. this.refreshParentList(this.sectionItem, rebuildObj);
  5489. }
  5490. self.ossAvatarUrl = "";
  5491. })
  5492. .catch((err) => {
  5493. console.log(err);
  5494. this.$message({
  5495. type: "warning",
  5496. message: err.msg,
  5497. });
  5498. });
  5499. },
  5500. /**
  5501. * 获取重修列表中是否有相同对象
  5502. */
  5503. getSameObj(metaObj) {
  5504. let newObj = false;
  5505. if (this.reMenuList.length) {
  5506. console.log(this.reMenuList, "this.reMenuList");
  5507. this.reMenuList.forEach((menu) => {
  5508. if (menu.type == 3) {
  5509. let isSame = this.contrast(metaObj, menu);
  5510. if (isSame) {
  5511. newObj = isSame;
  5512. }
  5513. } else {
  5514. if (menu.list && menu.list.length) {
  5515. menu.list.forEach((menuItem) => {
  5516. if (menuItem.type == 1) {
  5517. console.log(menuItem, metaObj);
  5518. let isSame = this.contrast(metaObj, menuItem);
  5519. if (isSame) {
  5520. newObj = isSame;
  5521. }
  5522. } else {
  5523. if (menuItem.list && menuItem.list.length) {
  5524. menuItem.list.forEach((menuChild) => {
  5525. if (menuChild.type == 1) {
  5526. let isSame = this.contrast(metaObj, menuChild);
  5527. if (isSame) {
  5528. newObj = isSame;
  5529. }
  5530. }
  5531. });
  5532. }
  5533. }
  5534. });
  5535. }
  5536. }
  5537. });
  5538. return newObj;
  5539. } else {
  5540. return false;
  5541. }
  5542. },
  5543. contrast(obj1, obj2) {
  5544. let moduleId1 = obj1.moduleId || 0;
  5545. let chapterId1 = obj1.chapterId || 0;
  5546. let sectionId1 = obj1.sectionId || obj1.menuId;
  5547. let moduleId2 = obj2.moduleId || 0;
  5548. let chapterId2 = obj2.chapterId || 0;
  5549. let sectionId2 = obj2.sectionId || obj2.menuId;
  5550. //转字符串后对比是否一致
  5551. return moduleId1 == moduleId2 &&
  5552. chapterId1 == chapterId2 &&
  5553. sectionId1 == sectionId2
  5554. ? obj2
  5555. : false;
  5556. },
  5557. /**
  5558. * 刷新父级列表
  5559. */
  5560. refreshParentList(sectionItem, rebuildObj) {
  5561. console.log(sectionItem, "sectionItem");
  5562. console.log(rebuildObj, "rebuildObj");
  5563. let self = this;
  5564. if (sectionItem.menuId) {
  5565. //最外层节有menuid
  5566. //普通章节目录
  5567. this.$request
  5568. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId })
  5569. .then((res) => {
  5570. for (let i = 0; i < res.rows.length; i++) {
  5571. let item = res.rows[i];
  5572. if (item.type == 3) {
  5573. self.menuList[i].learning = item.learning;
  5574. self.menuList[i].rebuild = item.rebuild;
  5575. }
  5576. }
  5577. });
  5578. if (this.menuTab.length > 1) {
  5579. //有重修目录
  5580. this.$request
  5581. .reMenuList({
  5582. courseId: this.courseId,
  5583. gradeId: this.gradeId,
  5584. rebuild: 1,
  5585. })
  5586. .then((res) => {
  5587. if (res.rows.length > 0) {
  5588. for (let i = 0; i < res.rows.length; i++) {
  5589. let item = res.rows[i];
  5590. item.id = item.menuId;
  5591. item.name = item.menuName;
  5592. item.menuType = item.type;
  5593. item.showList = false;
  5594. item.list = [];
  5595. item.isRebuild = 1;
  5596. }
  5597. self.reMenuList = self.reMenuList.filter((reMenu) => {
  5598. //筛选剩下的选项
  5599. return res.rows.find((row) => row.menuId == reMenu.menuId);
  5600. });
  5601. } else {
  5602. this.menuTab = [
  5603. {
  5604. name: "1",
  5605. label: "章节目录",
  5606. },
  5607. ];
  5608. this.courseTabIndex = "1";
  5609. self.reMenuList = [];
  5610. }
  5611. });
  5612. }
  5613. } else if (!sectionItem.moduleId) {
  5614. //第二层节没有moduleid
  5615. this.$request
  5616. .reSectionList({
  5617. chapterId: sectionItem.chapterId,
  5618. gradeId: this.gradeId,
  5619. courseId: this.courseId,
  5620. moduleId: 0,
  5621. })
  5622. .then((res) => {
  5623. let newArr = res.data.filter((item) => {
  5624. return item.type != 2;
  5625. });
  5626. sectionItem.parent.canLearn = newArr.every((item) => {
  5627. if (item.learning == 1) {
  5628. return true;
  5629. } else {
  5630. return false;
  5631. }
  5632. });
  5633. res.data.forEach((section) => {
  5634. section.isRebuild = 1;
  5635. section.parent = sectionItem.parent;
  5636. });
  5637. this.menuList.forEach((menu) => {
  5638. if (menu.menuId == sectionItem.chapterId) {
  5639. menu.list = res.data;
  5640. }
  5641. });
  5642. });
  5643. if (this.menuTab.length > 1 && rebuildObj) {
  5644. this.$request
  5645. .reSectionList({
  5646. chapterId: rebuildObj.chapterId,
  5647. gradeId: this.gradeId,
  5648. courseId: this.courseId,
  5649. moduleId: 0,
  5650. rebuild: 1,
  5651. })
  5652. .then((res) => {
  5653. let newArr = res.data.filter((item) => {
  5654. return item.type != 2;
  5655. });
  5656. rebuildObj.parent.canLearn = newArr.every((item) => {
  5657. if (item.learning == 1) {
  5658. return true;
  5659. } else {
  5660. return false;
  5661. }
  5662. });
  5663. res.data.forEach((section) => {
  5664. section.parent = rebuildObj.parent;
  5665. });
  5666. this.reMenuList.forEach((menu) => {
  5667. if (menu.menuId == rebuildObj.chapterId) {
  5668. menu.list = res.data;
  5669. }
  5670. });
  5671. });
  5672. this.$request
  5673. .reMenuList({
  5674. courseId: this.courseId,
  5675. gradeId: this.gradeId,
  5676. rebuild: 1,
  5677. })
  5678. .then((res) => {
  5679. if (res.rows.length > 0) {
  5680. for (let i = 0; i < res.rows.length; i++) {
  5681. let item = res.rows[i];
  5682. item.id = item.menuId;
  5683. item.name = item.menuName;
  5684. item.menuType = item.type;
  5685. item.showList = false;
  5686. item.list = [];
  5687. item.isRebuild = 1;
  5688. }
  5689. self.reMenuList = self.reMenuList.filter((reMenu) => {
  5690. //筛选剩下的选项
  5691. return res.rows.find((row) => row.menuId == reMenu.menuId);
  5692. });
  5693. } else {
  5694. this.menuTab = [
  5695. {
  5696. name: "1",
  5697. label: "章节目录",
  5698. },
  5699. ];
  5700. this.courseTabIndex = "1";
  5701. self.reMenuList = [];
  5702. }
  5703. });
  5704. }
  5705. } else {
  5706. //第三层节有moduleid和chapterid都有
  5707. this.$request
  5708. .reSectionList({
  5709. chapterId: sectionItem.chapterId,
  5710. gradeId: this.gradeId,
  5711. courseId: this.courseId,
  5712. moduleId: sectionItem.moduleId,
  5713. })
  5714. .then((res) => {
  5715. let newArr = res.data.filter((item) => {
  5716. return item.type != 2;
  5717. });
  5718. sectionItem.parent.canLearn = newArr.every((item) => {
  5719. if (item.learning == 1) {
  5720. return true;
  5721. } else {
  5722. return false;
  5723. }
  5724. });
  5725. res.data.forEach((section) => {
  5726. section.parent = sectionItem.parent;
  5727. });
  5728. this.menuList.forEach((menu) => {
  5729. if (menu.list && menu.list.length) {
  5730. menu.list.forEach((chapter) => {
  5731. if (
  5732. chapter.moduleId == sectionItem.moduleId &&
  5733. chapter.chapterId == sectionItem.chapterId
  5734. ) {
  5735. console.log(res.data, "res.data");
  5736. console.log(chapter.list, "chapter.list");
  5737. chapter.list = res.data;
  5738. }
  5739. });
  5740. }
  5741. });
  5742. });
  5743. if (this.menuTab.length > 1 && rebuildObj) {
  5744. this.$request
  5745. .reSectionList({
  5746. chapterId: rebuildObj.chapterId,
  5747. gradeId: this.gradeId,
  5748. courseId: this.courseId,
  5749. moduleId: rebuildObj.moduleId,
  5750. rebuild: 1,
  5751. })
  5752. .then((res) => {
  5753. let newArr = res.data.filter((item) => {
  5754. return item.type != 2;
  5755. });
  5756. rebuildObj.parent.canLearn = newArr.every((item) => {
  5757. if (item.learning == 1) {
  5758. return true;
  5759. } else {
  5760. return false;
  5761. }
  5762. });
  5763. res.data.forEach((section) => {
  5764. section.parent = rebuildObj.parent;
  5765. });
  5766. this.reMenuList.forEach((menu) => {
  5767. if (menu.list && menu.list.length) {
  5768. menu.list.forEach((chapter) => {
  5769. if (
  5770. chapter.moduleId == rebuildObj.moduleId &&
  5771. chapter.chapterId == rebuildObj.chapterId
  5772. ) {
  5773. chapter.list = res.data;
  5774. }
  5775. });
  5776. }
  5777. });
  5778. });
  5779. this.$request
  5780. .reMenuList({
  5781. courseId: this.courseId,
  5782. gradeId: this.gradeId,
  5783. rebuild: 1,
  5784. })
  5785. .then((res) => {
  5786. if (res.rows.length > 0) {
  5787. for (let i = 0; i < res.rows.length; i++) {
  5788. let item = res.rows[i];
  5789. item.id = item.menuId;
  5790. item.name = item.menuName;
  5791. item.menuType = item.type;
  5792. item.showList = false;
  5793. item.list = [];
  5794. item.isRebuild = 1;
  5795. }
  5796. self.reMenuList = self.reMenuList.filter((reMenu) => {
  5797. //筛选剩下的选项
  5798. return res.rows.find((row) => row.menuId == reMenu.menuId);
  5799. });
  5800. } else {
  5801. this.menuTab = [
  5802. {
  5803. name: "1",
  5804. label: "章节目录",
  5805. },
  5806. ];
  5807. this.courseTabIndex = "1";
  5808. self.reMenuList = [];
  5809. }
  5810. });
  5811. }
  5812. }
  5813. },
  5814. getRecordLast() {
  5815. let self = this;
  5816. return new Promise((resolve) => {
  5817. let data = {
  5818. gradeId: Number(self.gradeId),
  5819. goodsId: Number(self.goodsId),
  5820. sectionId: Number(self.playSectionId),
  5821. courseId: Number(self.courseId),
  5822. chapterId: parseInt(self.chapterId),
  5823. moduleId: parseInt(self.moduleId),
  5824. };
  5825. self.$request.recordLast(data).then((res) => {
  5826. resolve(res.data);
  5827. });
  5828. });
  5829. },
  5830. /**
  5831. * 获取笔记列表
  5832. */
  5833. getNoteList() {
  5834. let self = this;
  5835. self.noteList = [];
  5836. let data = {
  5837. courseId: this.courseId,
  5838. gradeId: this.gradeId,
  5839. goodsId: this.goodsId,
  5840. pageNum: this.noteParams.pageNum,
  5841. pageSize: this.noteParams.pageSize,
  5842. };
  5843. if (this.playSectionId > 0) {
  5844. data.sectionId = this.playSectionId;
  5845. }
  5846. this.$request.noteList(data).then((res) => {
  5847. self.noteList = res.rows;
  5848. self.noteTotal = res.total;
  5849. });
  5850. },
  5851. noteClick(note) {
  5852. if (this.vid) {
  5853. //切换视频
  5854. if (this.vid == note.recordingUrl) {
  5855. var polyvPlayerContext = this.player;
  5856. if (polyvPlayerContext) {
  5857. polyvPlayerContext.j2s_seekVideo(note.noteSecond);
  5858. }
  5859. } else {
  5860. var polyvPlayerContext = this.player;
  5861. if (polyvPlayerContext) {
  5862. polyvPlayerContext.changeVid(note.recordingUrl);
  5863. }
  5864. }
  5865. } else {
  5866. var polyvPlayerContext = this.player;
  5867. console.log(polyvPlayerContext);
  5868. if (polyvPlayerContext) {
  5869. polyvPlayerContext.changeVid(note.recordingUrl);
  5870. } else {
  5871. this.vid = note.recordingUrl;
  5872. console.log(note.recordingUrl);
  5873. this.moduleId = note.moduleId;
  5874. this.chapterId = note.chapterId;
  5875. this.playSectionId = note.sectionId;
  5876. note.sectionType = 3;
  5877. this.loadPlayerScript(this.loadPlayer);
  5878. }
  5879. }
  5880. this.recordObj = { videoCurrentTime: note.noteSecond };
  5881. },
  5882. /**
  5883. * 展开列表
  5884. */
  5885. getMenuList() {
  5886. let self = this;
  5887. this.$request
  5888. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId })
  5889. .then((res) => {
  5890. for (let i = 0; i < res.rows.length; i++) {
  5891. let item = res.rows[i];
  5892. item.id = item.menuId;
  5893. item.name = item.menuName;
  5894. item.menuType = item.type;
  5895. item.showList = false;
  5896. item.list = [];
  5897. item.parent = this.menuList;
  5898. }
  5899. self.menuList = res.rows;
  5900. //展开第一个
  5901. if (this.needOpen) {
  5902. for (let i = 0; i < res.rows.length; i++) {
  5903. if (res.rows[i].type == 1) {
  5904. this.menuIndex = [i];
  5905. this.openModule(this.menuList[i]);
  5906. break;
  5907. } else if (res.rows[i].type == 2) {
  5908. this.menuIndex = [i];
  5909. // this.needOpen = false;
  5910. this.openChapter(this.menuList[i]);
  5911. break;
  5912. }
  5913. }
  5914. //第一个是节,直接播放
  5915. if (self.menuList.length) {
  5916. if (
  5917. self.menuList[0].type == 3 &&
  5918. !this.sectionItem.recordingUrl &&
  5919. self.menuList[0].sectionType != 2
  5920. ) {
  5921. // this.getResource(self.menuList[0]);
  5922. }
  5923. }
  5924. }
  5925. });
  5926. },
  5927. getReMenuList() {
  5928. let self = this;
  5929. this.$request
  5930. .reMenuList({
  5931. courseId: this.courseId,
  5932. rebuild: 1,
  5933. gradeId: this.gradeId,
  5934. })
  5935. .then((res) => {
  5936. for (let i = 0; i < res.rows.length; i++) {
  5937. let item = res.rows[i];
  5938. item.id = item.menuId;
  5939. item.name = item.menuName;
  5940. item.menuType = item.type;
  5941. item.showList = false;
  5942. item.list = [];
  5943. item.parent = this.reMenuList;
  5944. item.isRebuild = 1;
  5945. }
  5946. self.reMenuList = res.rows;
  5947. if (self.reMenuList.length > 0) {
  5948. this.menuTab = [
  5949. {
  5950. name: "1",
  5951. label: "章节目录",
  5952. },
  5953. {
  5954. name: "2",
  5955. label: "重修目录",
  5956. },
  5957. ];
  5958. if (this.courseTabIndex == "2") {
  5959. return;
  5960. }
  5961. this.courseTabIndex = "1";
  5962. } else {
  5963. this.menuTab = [
  5964. {
  5965. name: "1",
  5966. label: "章节目录",
  5967. },
  5968. ];
  5969. this.courseTabIndex = "1";
  5970. }
  5971. });
  5972. },
  5973. /**
  5974. * 获取讲义权限
  5975. */
  5976. courseHandouts() {
  5977. if (this.goodsData.handoutsId) {
  5978. this.$request
  5979. .courseHandouts(this.goodsData.handoutsId)
  5980. .then((res) => {
  5981. this.courseHandoutsData = res.data;
  5982. const loadingTask = pdf.createLoadingTask(
  5983. this.$tools.splitImgHost(this.courseHandoutsData.handoutsUrl)
  5984. );
  5985. loadingTask.promise
  5986. .then((pdf) => {
  5987. this.numPages = pdf.numPages;
  5988. })
  5989. .catch((err) => {});
  5990. })
  5991. .catch((err) => {});
  5992. }
  5993. },
  5994. /**
  5995. * 获取培训项目详情
  5996. */
  5997. courseBusiness() {
  5998. this.$request.courseBusiness(this.goodsData.businessId).then((res) => {
  5999. this.businessData = res.data;
  6000. });
  6001. },
  6002. /**提出答疑 */
  6003. addAnswer() {
  6004. if (!this.textarea) {
  6005. this.$message.warning("请输入疑问内容");
  6006. return;
  6007. }
  6008. let data = {
  6009. courseId: this.courseId,
  6010. goodsId: this.goodsId,
  6011. orderGoodsId: this.orderGoodsId,
  6012. answerText: this.textarea,
  6013. };
  6014. this.$request.addAnswer(data).then((res) => {
  6015. this.textarea = "";
  6016. this.getAnswerList();
  6017. });
  6018. },
  6019. /**回复 */
  6020. answerBack(row) {
  6021. this.$prompt(`${row.realname}:${row.answerText}`, "提示", {
  6022. confirmButtonText: "确定",
  6023. cancelButtonText: "取消",
  6024. inputErrorMessage: "输入不能为空",
  6025. inputValidator: (value) => {
  6026. let str = value.replace(/^ +| +$/g, "");
  6027. // 点击按钮时,对文本框里面的值进行验证
  6028. if (!str) {
  6029. return "输入不能为空";
  6030. }
  6031. },
  6032. })
  6033. .then(({ value }) => {
  6034. let data = {
  6035. assignUserId: row.userId,
  6036. assignAnswerId: row.answerId,
  6037. courseId: this.courseId,
  6038. goodsId: this.goodsId,
  6039. orderGoodsId: this.orderGoodsId,
  6040. answerText: value,
  6041. assignAnswerText: row.assignAnswerText,
  6042. };
  6043. this.$request.addAnswer(data).then((res) => {
  6044. this.getAnswerList();
  6045. });
  6046. })
  6047. .catch(() => {});
  6048. },
  6049. getAnswerList() {
  6050. let self = this;
  6051. this.$request
  6052. .answerList({ courseId: this.courseId, goodsId: this.goodsId })
  6053. .then((res) => {
  6054. let data1 = [];
  6055. let data2 = [];
  6056. let copydata2 = [];
  6057. res.rows.forEach((item) => {
  6058. if (!item.assignAnswerId) {
  6059. data1.push(item);
  6060. } else {
  6061. data2.push(item);
  6062. copydata2.push(item);
  6063. }
  6064. });
  6065. data2.forEach((item, index) => {
  6066. //回复层
  6067. data1.forEach((items) => {
  6068. //提问层
  6069. if (items.answerId === item.assignAnswerId) {
  6070. if (
  6071. items.newArraysAnswerList &&
  6072. items.newArraysAnswerList.length
  6073. ) {
  6074. items.newArraysAnswerList.push(item);
  6075. } else {
  6076. items.newArraysAnswerList = [item];
  6077. }
  6078. let indexInd = copydata2.findIndex((itemsxs) => {
  6079. return itemsxs.answerId === item.answerId;
  6080. });
  6081. if (indexInd !== -1) {
  6082. copydata2.splice(indexInd, 1);
  6083. }
  6084. }
  6085. });
  6086. });
  6087. copydata2.forEach((it) => {
  6088. for (let i = 0; i < data1.length; i++) {
  6089. let STATUS = null;
  6090. if (data1[i].newArraysAnswerList) {
  6091. STATUS = data1[i].newArraysAnswerList.some((items) => {
  6092. return items.answerId === it.assignAnswerId;
  6093. });
  6094. }
  6095. if (STATUS) {
  6096. data1[i].newArraysAnswerList.push(it);
  6097. break;
  6098. }
  6099. }
  6100. });
  6101. self.answerList = data1.reverse();
  6102. });
  6103. },
  6104. courseCourseList() {
  6105. return new Promise((resolve) => {
  6106. this.param.goodsId = this.goodsId;
  6107. this.param.gradeId = this.gradeId;
  6108. this.$request.courseCourseList(this.param).then(async (res) => {
  6109. this.courseList.push(...res.rows);
  6110. if (!this.courseId) {
  6111. this.courseId = this.courseList[0].courseId;
  6112. }
  6113. this.param.total = res.total;
  6114. await this.courseChange();
  6115. resolve();
  6116. });
  6117. });
  6118. },
  6119. download(url, fileName) {
  6120. let xhr = new XMLHttpRequest();
  6121. xhr.open("get", url, true);
  6122. xhr.setRequestHeader("Content-Type", `application/pdf`);
  6123. xhr.responseType = "blob";
  6124. let that = this;
  6125. xhr.onload = function () {
  6126. if (this.status == 200) {
  6127. //接受二进制文件流
  6128. var blob = this.response;
  6129. that.downloadExportFile(blob, fileName);
  6130. }
  6131. };
  6132. xhr.send();
  6133. },
  6134. downloadExportFile(blob, tagFileName) {
  6135. let downloadElement = document.createElement("a");
  6136. let href = "";
  6137. if (typeof blob == "string") {
  6138. downloadElement.target = "_blank";
  6139. } else {
  6140. href = window.URL.createObjectURL(blob); //创建下载的链接
  6141. }
  6142. downloadElement.href = href;
  6143. downloadElement.download = tagFileName;
  6144. //下载后文件名
  6145. document.body.appendChild(downloadElement);
  6146. downloadElement.click(); //点击下载
  6147. document.body.removeChild(downloadElement); //下载完成移除元素
  6148. if (typeof blob != "string") {
  6149. window.URL.revokeObjectURL(href); //释放掉blob对象
  6150. }
  6151. },
  6152. print() {
  6153. document.getElementById("printIframe").contentWindow.print();
  6154. },
  6155. previvew(url) {
  6156. this.showPdf = true;
  6157. },
  6158. noteSubmit() {
  6159. let self = this;
  6160. if (!(this.playSectionId > 0)) {
  6161. this.$message({
  6162. message: "目前无播放视频",
  6163. type: "warning",
  6164. });
  6165. return;
  6166. }
  6167. if (!this.textareaNote) {
  6168. this.$message({
  6169. message: "请输入内容",
  6170. type: "warning",
  6171. });
  6172. return;
  6173. }
  6174. if (!this.gradeId) {
  6175. this.$message({
  6176. message: "暂无班级数据",
  6177. type: "warning",
  6178. });
  6179. return;
  6180. }
  6181. var polyvPlayerContext = this.player;
  6182. let noteDate = this.$tools.getZeroTime();
  6183. let noteSecond = polyvPlayerContext.j2s_getCurrentTime();
  6184. console.log(noteSecond, "noteSecond");
  6185. if (!noteSecond) {
  6186. if (noteSecond == 0) {
  6187. //播放结束
  6188. noteSecond = polyvPlayerContext.j2s_getCurrentTime();
  6189. }
  6190. if (!noteSecond) {
  6191. this.$message({
  6192. message: "视频暂未开始",
  6193. type: "warning",
  6194. });
  6195. return;
  6196. }
  6197. }
  6198. let data = {
  6199. gradeId: this.gradeId,
  6200. goodsId: this.goodsId,
  6201. sectionId: this.playSectionId,
  6202. courseId: this.courseId,
  6203. noteText: this.textareaNote,
  6204. noteDate: noteDate,
  6205. noteSecond: noteSecond,
  6206. moduleId: this.moduleId,
  6207. chapterId: this.chapterId,
  6208. };
  6209. this.$request.postNote(data).then((res) => {
  6210. this.$message({
  6211. message: "发布成功",
  6212. type: "success",
  6213. });
  6214. self.getNoteList();
  6215. this.textareaNote = "";
  6216. });
  6217. },
  6218. del(item) {
  6219. console.log(item);
  6220. let data = { answerId: item.answerId, status: -1 };
  6221. this.$request.delAnswer(data).then((res) => {
  6222. this.$message({
  6223. message: "删除成功",
  6224. type: "success",
  6225. });
  6226. this.getAnswerList();
  6227. });
  6228. },
  6229. /**
  6230. * 打印
  6231. */
  6232. printView(url) {
  6233. console.log("触发打印", url);
  6234. printJS({
  6235. printable: url,
  6236. type: "pdf",
  6237. header: null,
  6238. targetStyles: ["*"],
  6239. style: "@page {margin:0 10mm}",
  6240. });
  6241. // this.print(url);
  6242. },
  6243. // 打印方法
  6244. print(filePath) {
  6245. console.log("执行打印");
  6246. let iframe = document.createElement("iframe");
  6247. iframe.style.border = "0px";
  6248. iframe.style.position = "absolute";
  6249. iframe.style.width = "0px";
  6250. iframe.style.height = "0px";
  6251. iframe.style.right = "0px";
  6252. iframe.style.top = "0px";
  6253. iframe.setAttribute("src", filePath);
  6254. iframe.onload = () => {
  6255. iframe.contentWindow.print();
  6256. // setTimeout(() => {
  6257. // document.body.removeChild(iframe);
  6258. // });
  6259. };
  6260. document.body.append(iframe);
  6261. },
  6262. },
  6263. };
  6264. </script>
  6265. <!-- Add "scoped" attribute to limit CSS to this component only -->
  6266. <style scoped lang="scss">
  6267. .course-detail {
  6268. .section {
  6269. padding-bottom: 30px;
  6270. &__header {
  6271. height: 40px;
  6272. display: flex;
  6273. align-items: center;
  6274. padding: 0 20px;
  6275. }
  6276. &__body {
  6277. .course-info {
  6278. &__header {
  6279. .left-box {
  6280. width: 810px;
  6281. height: 455px;
  6282. float: left;
  6283. background-size: cover;
  6284. background-position: center center;
  6285. background-repeat: no-repeat;
  6286. position: relative;
  6287. .video {
  6288. width: 100%;
  6289. height: 100%;
  6290. }
  6291. }
  6292. .recordStyle {
  6293. position: absolute;
  6294. bottom: 90px;
  6295. padding: 6px 12px;
  6296. left: 8px;
  6297. background-color: rgba(0, 0, 0, 0.4);
  6298. color: #fff;
  6299. border-radius: 24px;
  6300. user-select: none;
  6301. .btn_sty {
  6302. cursor: pointer;
  6303. }
  6304. }
  6305. .right-box {
  6306. width: 462px;
  6307. height: 455px;
  6308. background: #060e1a;
  6309. border-radius: 0px;
  6310. float: right;
  6311. &__header {
  6312. .tabs {
  6313. /deep/.el-tabs__nav-wrap::after {
  6314. background-color: #999;
  6315. }
  6316. /deep/ .el-tabs__header {
  6317. margin: 0;
  6318. }
  6319. .label {
  6320. color: #fff;
  6321. height: 40px;
  6322. line-height: 40px;
  6323. padding: 0 20px;
  6324. }
  6325. .item {
  6326. &__title {
  6327. padding-left: 12px;
  6328. height: 40px;
  6329. line-height: 40px;
  6330. cursor: pointer;
  6331. font-size: 14px;
  6332. font-family: Microsoft YaHei;
  6333. font-weight: bold;
  6334. color: #fff;
  6335. .el-icon-caret-right,
  6336. .el-icon-caret-bottom {
  6337. color: #999;
  6338. }
  6339. }
  6340. &__content {
  6341. .bank-chapter {
  6342. &__item {
  6343. color: #fff;
  6344. font-size: 14px;
  6345. &__text {
  6346. padding: 8px 8px 8px 24px;
  6347. cursor: pointer;
  6348. flex: 1;
  6349. .el-icon-caret-right,
  6350. .el-icon-caret-bottom {
  6351. color: #999;
  6352. }
  6353. }
  6354. }
  6355. }
  6356. .bank-section {
  6357. &__item {
  6358. color: #fff;
  6359. font-size: 14px;
  6360. display: flex;
  6361. align-items: center;
  6362. &.active {
  6363. background: #132b4d;
  6364. font-size: 14px;
  6365. font-family: Microsoft YaHei;
  6366. font-weight: bold;
  6367. color: #3f8dfd;
  6368. }
  6369. &__text {
  6370. flex: 1;
  6371. padding: 8px 8px 8px 12px;
  6372. height: 40px;
  6373. display: flex;
  6374. flex-direction: column;
  6375. justify-content: center;
  6376. cursor: pointer;
  6377. .el-icon-caret-right,
  6378. .el-icon-caret-bottom {
  6379. color: #999;
  6380. }
  6381. }
  6382. .test-btn {
  6383. margin-left: 10px;
  6384. width: 32px;
  6385. height: 20px;
  6386. background: #007aff;
  6387. border-radius: 4px;
  6388. line-height: 18px;
  6389. color: #fff;
  6390. text-align: center;
  6391. }
  6392. .note {
  6393. margin-left: 10px;
  6394. width: 32px;
  6395. height: 20px;
  6396. border: 1px solid #ff3b30;
  6397. border-radius: 4px;
  6398. line-height: 18px;
  6399. color: #ff3b30;
  6400. text-align: center;
  6401. &--yellow {
  6402. border-color: #ff9500;
  6403. color: #ff9500;
  6404. }
  6405. &--blue {
  6406. border-color: #3f8dfd;
  6407. color: #3f8dfd;
  6408. }
  6409. }
  6410. .during {
  6411. color: #999;
  6412. margin-right: 10px;
  6413. }
  6414. .btn {
  6415. margin-right: 12px;
  6416. width: 48px;
  6417. height: 20px;
  6418. border: 1px solid #ff3b30;
  6419. background: #ff3b30;
  6420. border-radius: 4px;
  6421. line-height: 18px;
  6422. color: #fff;
  6423. text-align: center;
  6424. &--green {
  6425. border: 1px solid #34c759;
  6426. background: #34c759;
  6427. }
  6428. }
  6429. .live-btn {
  6430. margin-left: 20px;
  6431. width: 60px;
  6432. height: 20px;
  6433. border-radius: 4px;
  6434. background: #eeeeee;
  6435. line-height: 18px;
  6436. color: #666666;
  6437. text-align: center;
  6438. &--yellow {
  6439. background: #fff7eb;
  6440. color: #ff9500;
  6441. }
  6442. &--blue {
  6443. border-color: #ebf4ff;
  6444. color: #007aff;
  6445. }
  6446. }
  6447. }
  6448. }
  6449. }
  6450. }
  6451. }
  6452. .title {
  6453. height: 40px;
  6454. border-bottom: 1px solid #999;
  6455. color: #fff;
  6456. .select {
  6457. width: 100%;
  6458. }
  6459. /deep/ .el-input__icon {
  6460. width: 20px;
  6461. height: 20px;
  6462. border: 1px solid #fff;
  6463. border-radius: 4px;
  6464. margin-top: 10px;
  6465. line-height: 20px;
  6466. }
  6467. /deep/ .el-input__inner {
  6468. color: #fff;
  6469. font-size: 16px;
  6470. background: none;
  6471. border: 0;
  6472. }
  6473. }
  6474. }
  6475. &__body {
  6476. height: 374px;
  6477. overflow-y: scroll;
  6478. &::-webkit-scrollbar {
  6479. width: 6px;
  6480. }
  6481. &::-webkit-scrollbar-track {
  6482. background-color: #060e1a;
  6483. -webkit-border-radius: 2em;
  6484. -moz-border-radius: 2em;
  6485. border-radius: 2em;
  6486. }
  6487. &::-webkit-scrollbar-thumb {
  6488. background-color: #eeeeee;
  6489. -webkit-border-radius: 2em;
  6490. -moz-border-radius: 2em;
  6491. border-radius: 2em;
  6492. }
  6493. }
  6494. }
  6495. }
  6496. &__body {
  6497. /deep/ .el-tabs__item {
  6498. padding: 0 20px !important;
  6499. height: 80px;
  6500. line-height: 80px;
  6501. }
  6502. .course-img {
  6503. width: 100%;
  6504. }
  6505. .course-menu {
  6506. margin-top: 25px;
  6507. .left-box {
  6508. width: 948px;
  6509. float: left;
  6510. &__header {
  6511. padding-right: 50px;
  6512. position: relative;
  6513. .item {
  6514. width: auto;
  6515. margin-right: 24px;
  6516. font-size: 16px;
  6517. font-family: Microsoft YaHei;
  6518. font-weight: 400;
  6519. color: #333333;
  6520. background: #eeeeee;
  6521. border-radius: 8px;
  6522. padding: 12px;
  6523. position: relative;
  6524. &.canlearn {
  6525. background: #3f8dfd;
  6526. color: #fff;
  6527. }
  6528. }
  6529. }
  6530. &__body {
  6531. .buy-note {
  6532. margin-right: 50px;
  6533. }
  6534. .item {
  6535. margin-top: 24px;
  6536. padding: 16px;
  6537. background: #eee;
  6538. border-radius: 10px;
  6539. &__title {
  6540. font-size: 16px;
  6541. font-family: Microsoft YaHei;
  6542. font-weight: bold;
  6543. color: #333333;
  6544. .note {
  6545. display: inline-block;
  6546. margin-left: 20px;
  6547. width: 40px;
  6548. height: 24px;
  6549. border: 1px solid #ff3b30;
  6550. border-radius: 8px;
  6551. line-height: 22px;
  6552. color: #ff3b30;
  6553. text-align: center;
  6554. }
  6555. }
  6556. &__content {
  6557. margin-top: 12px;
  6558. background: #f5f7fa;
  6559. }
  6560. }
  6561. }
  6562. }
  6563. .right-box {
  6564. width: 255px;
  6565. float: right;
  6566. .title {
  6567. font-size: 16px;
  6568. font-family: Microsoft YaHei;
  6569. font-weight: 400;
  6570. color: #333333;
  6571. text-shadow: 0px 6px 6px rgba(85, 158, 255, 0.08);
  6572. position: relative;
  6573. .more {
  6574. font-size: 16px;
  6575. font-family: Microsoft YaHei;
  6576. font-weight: 400;
  6577. color: #999999;
  6578. position: absolute;
  6579. right: 0;
  6580. }
  6581. }
  6582. .list {
  6583. .course-item {
  6584. }
  6585. }
  6586. }
  6587. }
  6588. .answer-question {
  6589. &__header {
  6590. border-bottom: 1px solid #eee;
  6591. .textarea-wrap {
  6592. background: #f9f9f9;
  6593. border: 1px solid #eeeeee;
  6594. border-radius: 8px;
  6595. .textarea {
  6596. height: 100%;
  6597. }
  6598. }
  6599. .submit {
  6600. padding: 10px 20px;
  6601. border-radius: 20px;
  6602. text-align: center;
  6603. font-size: 16px;
  6604. margin: 10px 0;
  6605. float: right;
  6606. }
  6607. }
  6608. &__body {
  6609. .question-list {
  6610. &__item {
  6611. padding: 20px 0;
  6612. display: flex;
  6613. &__avatar {
  6614. width: 40px;
  6615. height: 40px;
  6616. display: table-cell;
  6617. border-radius: 50%;
  6618. text-align: center;
  6619. img {
  6620. display: inline-block;
  6621. vertical-align: middle;
  6622. max-width: 100%;
  6623. max-height: 100%;
  6624. }
  6625. }
  6626. &__content {
  6627. flex: 1;
  6628. border-bottom: 1px solid #ccc;
  6629. margin-left: 10px;
  6630. .nickname {
  6631. font-size: 14px;
  6632. font-family: Microsoft YaHei;
  6633. font-weight: bold;
  6634. color: #333333;
  6635. line-height: 24px;
  6636. }
  6637. .desc {
  6638. font-size: 14px;
  6639. font-family: Microsoft YaHei;
  6640. font-weight: 400;
  6641. color: #666666;
  6642. line-height: 24px;
  6643. }
  6644. .time {
  6645. font-size: 14px;
  6646. font-family: Microsoft YaHei;
  6647. font-weight: 400;
  6648. color: #999999;
  6649. line-height: 24px;
  6650. .replay {
  6651. float: right;
  6652. font-size: 14px;
  6653. font-family: Microsoft YaHei;
  6654. font-weight: 400;
  6655. color: #3f8dfd;
  6656. line-height: 24px;
  6657. margin-right: 20px;
  6658. }
  6659. .del {
  6660. float: right;
  6661. cursor: pointer;
  6662. font-size: 14px;
  6663. font-family: Microsoft YaHei;
  6664. font-weight: 400;
  6665. color: #ff3b30;
  6666. line-height: 24px;
  6667. margin-right: 20px;
  6668. }
  6669. }
  6670. .reply-list {
  6671. margin: 20px 0;
  6672. width: 100%;
  6673. background: #f9f9f9;
  6674. border-radius: 8px;
  6675. padding: 0 0 0 20px;
  6676. &__item {
  6677. padding: 20px 0;
  6678. display: flex;
  6679. border-bottom: 1px solid #ccc;
  6680. &:nth-last-of-type(1) {
  6681. border: 0;
  6682. }
  6683. &__avatar {
  6684. width: 40px;
  6685. height: 40px;
  6686. display: table-cell;
  6687. border-radius: 50%;
  6688. text-align: center;
  6689. img {
  6690. display: inline-block;
  6691. vertical-align: middle;
  6692. max-width: 100%;
  6693. max-height: 100%;
  6694. }
  6695. }
  6696. &__content {
  6697. border-radius: 8px;
  6698. flex: 1;
  6699. margin-left: 10px;
  6700. .nickname {
  6701. font-size: 14px;
  6702. font-family: Microsoft YaHei;
  6703. font-weight: bold;
  6704. color: #333333;
  6705. line-height: 24px;
  6706. }
  6707. .desc {
  6708. font-size: 14px;
  6709. font-family: Microsoft YaHei;
  6710. font-weight: 400;
  6711. color: #666666;
  6712. line-height: 24px;
  6713. }
  6714. .time {
  6715. font-size: 14px;
  6716. font-family: Microsoft YaHei;
  6717. font-weight: 400;
  6718. color: #999999;
  6719. line-height: 24px;
  6720. .reply {
  6721. float: right;
  6722. font-size: 14px;
  6723. font-family: Microsoft YaHei;
  6724. font-weight: 400;
  6725. color: #3f8dfd;
  6726. line-height: 24px;
  6727. margin-right: 20px;
  6728. cursor: pointer;
  6729. user-select: none;
  6730. }
  6731. .del {
  6732. cursor: pointer;
  6733. margin-right: 20px;
  6734. float: right;
  6735. font-size: 14px;
  6736. font-family: Microsoft YaHei;
  6737. font-weight: 400;
  6738. color: #ff3b30;
  6739. line-height: 24px;
  6740. }
  6741. }
  6742. }
  6743. }
  6744. }
  6745. }
  6746. }
  6747. }
  6748. }
  6749. }
  6750. .lecture-notes {
  6751. &__content {
  6752. .left-box {
  6753. float: left;
  6754. width: 462px;
  6755. .textarea {
  6756. border-bottom: 1px solid #eee;
  6757. .submit {
  6758. float: right;
  6759. width: 138px;
  6760. padding: 10px 0;
  6761. margin: 10px 0 25px 0;
  6762. border-radius: 20px;
  6763. text-align: center;
  6764. font-size: 16px;
  6765. }
  6766. }
  6767. .note-list {
  6768. &__content {
  6769. border-bottom: 1px solid #eee;
  6770. &__title {
  6771. width: 216px;
  6772. height: 24px;
  6773. background: #ccc;
  6774. border-radius: 24px;
  6775. font-size: 14px;
  6776. color: #666666;
  6777. text-align: center;
  6778. line-height: 24px;
  6779. margin: 20px 0;
  6780. }
  6781. }
  6782. &__item {
  6783. display: flex;
  6784. padding: 15px;
  6785. .el-icon-video-play {
  6786. cursor: pointer;
  6787. font-size: 20px;
  6788. color: #3f8dfd;
  6789. }
  6790. &__content {
  6791. flex: 1;
  6792. margin-left: 10px;
  6793. .title {
  6794. cursor: pointer;
  6795. font-size: 14px;
  6796. font-family: Microsoft YaHei;
  6797. font-weight: bold;
  6798. color: #3f8dfd;
  6799. line-height: 24px;
  6800. }
  6801. .desc {
  6802. font-size: 14px;
  6803. font-family: Microsoft YaHei;
  6804. font-weight: 400;
  6805. color: #666666;
  6806. line-height: 24px;
  6807. }
  6808. .time {
  6809. font-size: 14px;
  6810. font-family: Microsoft YaHei;
  6811. font-weight: 400;
  6812. color: #999999;
  6813. line-height: 24px;
  6814. }
  6815. }
  6816. }
  6817. }
  6818. .pagination {
  6819. margin-top: 30px;
  6820. text-align: center;
  6821. }
  6822. }
  6823. .right-box {
  6824. width: 786px;
  6825. float: right;
  6826. .lecture-list {
  6827. background: #f5f7fa;
  6828. border-radius: 8px;
  6829. &__header {
  6830. padding: 0 16px;
  6831. height: 40px;
  6832. line-height: 40px;
  6833. font-size: 18px;
  6834. font-family: Microsoft YaHei;
  6835. font-weight: bold;
  6836. color: #333333;
  6837. .slide-btn {
  6838. cursor: pointer;
  6839. float: right;
  6840. font-size: 14px;
  6841. font-family: Microsoft YaHei;
  6842. font-weight: 400;
  6843. color: #999999;
  6844. }
  6845. }
  6846. &__body {
  6847. .list {
  6848. &__item {
  6849. border-top: 1px solid #fff;
  6850. padding: 0 8px 0 16px;
  6851. height: 56px;
  6852. line-height: 55px;
  6853. display: flex;
  6854. align-items: center;
  6855. .title {
  6856. flex: 1;
  6857. font-size: 16px;
  6858. font-family: Microsoft YaHei;
  6859. font-weight: 400;
  6860. color: #333333;
  6861. }
  6862. .btns {
  6863. .btn {
  6864. cursor: pointer;
  6865. display: inline-block;
  6866. vertical-align: middle;
  6867. width: 80px;
  6868. height: 32px;
  6869. background: #ffffff;
  6870. border: 1px solid #3f8dfd;
  6871. border-radius: 16px;
  6872. text-align: center;
  6873. line-height: 30px;
  6874. color: #3f8dfd;
  6875. margin: 0 8px;
  6876. }
  6877. }
  6878. }
  6879. }
  6880. }
  6881. &__footer {
  6882. margin-top: 24px;
  6883. .lecture-scan {
  6884. background: #f5f7fa;
  6885. border-radius: 8px;
  6886. overflow: hidden;
  6887. &__header {
  6888. height: 40px;
  6889. line-height: 40px;
  6890. padding: 0 16px;
  6891. font-size: 16px;
  6892. font-family: Microsoft YaHei;
  6893. font-weight: bold;
  6894. color: #333333;
  6895. }
  6896. &__body {
  6897. height: 800px;
  6898. text-align: center;
  6899. overflow-y: scroll;
  6900. .iframe {
  6901. width: 100%;
  6902. }
  6903. }
  6904. }
  6905. }
  6906. }
  6907. }
  6908. }
  6909. }
  6910. }
  6911. }
  6912. }
  6913. }
  6914. .take-photo {
  6915. /deep/ .el-dialog__header {
  6916. display: none;
  6917. }
  6918. /deep/ .el-dialog__body {
  6919. padding: 0;
  6920. overflow: unset;
  6921. }
  6922. &__close {
  6923. cursor: pointer;
  6924. position: absolute;
  6925. right: 0;
  6926. top: -28px;
  6927. width: 24px;
  6928. height: 24px;
  6929. line-height: 24px;
  6930. text-align: center;
  6931. color: #eee;
  6932. border: 1px solid #eee;
  6933. border-radius: 50%;
  6934. }
  6935. &__header {
  6936. height: 40px;
  6937. border-bottom: 1px solid #eee;
  6938. line-height: 40px;
  6939. font-size: 16px;
  6940. font-family: Microsoft YaHei;
  6941. font-weight: bold;
  6942. color: #333333;
  6943. padding-left: 24px;
  6944. }
  6945. &__body {
  6946. height: 400px;
  6947. padding: 40px 24px;
  6948. .left-box {
  6949. width: 336px;
  6950. float: left;
  6951. .title {
  6952. font-size: 16px;
  6953. font-family: Microsoft YaHei;
  6954. font-weight: bold;
  6955. color: #ff3b30;
  6956. line-height: 24px;
  6957. }
  6958. .content {
  6959. font-size: 14px;
  6960. font-family: Microsoft YaHei;
  6961. font-weight: 400;
  6962. color: #333333;
  6963. line-height: 28px;
  6964. margin-top: 32px;
  6965. }
  6966. }
  6967. .right-box {
  6968. float: right;
  6969. width: 400px;
  6970. height: 300px;
  6971. video {
  6972. width: 100%;
  6973. height: 100%;
  6974. }
  6975. .mask {
  6976. width: 55%;
  6977. height: 200px;
  6978. position: absolute;
  6979. top: 0;
  6980. left: 0;
  6981. right: 0;
  6982. bottom: 0;
  6983. margin: 30px auto 0;
  6984. box-shadow: 0 0 0 2000px rgba(0,0,0,0.4);
  6985. }
  6986. }
  6987. }
  6988. &__footer {
  6989. height: 90px;
  6990. border-top: 1px solid #eee;
  6991. text-align: center;
  6992. .take {
  6993. display: inline-block;
  6994. width: 200px;
  6995. height: 40px;
  6996. padding: 0;
  6997. border-radius: 20px;
  6998. text-align: center;
  6999. line-height: 40px;
  7000. margin: 24px auto;
  7001. }
  7002. }
  7003. }
  7004. .info {
  7005. &__content {
  7006. height: 500px;
  7007. overflow-y: scroll;
  7008. .handCenter {
  7009. width: 600px;
  7010. height: 300px;
  7011. background: #ccc;
  7012. }
  7013. .upload-box {
  7014. display: inline-block;
  7015. vertical-align: top;
  7016. .el-icon-error {
  7017. cursor: pointer;
  7018. z-index: 99;
  7019. position: absolute;
  7020. left: 100%;
  7021. bottom: 100%;
  7022. font-size: 20px;
  7023. color: red;
  7024. }
  7025. }
  7026. }
  7027. }
  7028. .showconfirm {
  7029. &__content {
  7030. .text {
  7031. padding-bottom: 20px;
  7032. color: red;
  7033. }
  7034. }
  7035. }
  7036. }
  7037. </style>