index.vue 274 KB

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