index.vue 277 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578
  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 v-show="isTaking" class="mask"></div>
  1803. </div>
  1804. </div>
  1805. <div class="take-photo__footer">
  1806. <el-button
  1807. type="primary"
  1808. v-if="isTaking"
  1809. class="take"
  1810. @click="onPhoto"
  1811. >拍照</el-button
  1812. >
  1813. <el-button
  1814. type="primary"
  1815. v-if="!isTaking"
  1816. class="take"
  1817. :loading="loading"
  1818. @click="reTake"
  1819. >重拍</el-button
  1820. >
  1821. <el-button
  1822. type="primary"
  1823. v-if="!isTaking"
  1824. :loading="loading"
  1825. class="take"
  1826. @click="takeOk"
  1827. >确认</el-button
  1828. >
  1829. </div>
  1830. </div>
  1831. </el-dialog>
  1832. <el-dialog
  1833. width="996px"
  1834. height="600px"
  1835. class="info"
  1836. :visible.sync="showInfoDetailModal"
  1837. :close-on-click-modal="false"
  1838. :close-on-press-escape="false"
  1839. :show-close="false"
  1840. title="资料填写"
  1841. >
  1842. <div class="info__content">
  1843. <el-form
  1844. :model="infoForm"
  1845. ref="infoForm"
  1846. :rules="rules"
  1847. :error-type="errorType"
  1848. >
  1849. <template v-for="(item, index) in listData">
  1850. <el-form-item
  1851. :key="index"
  1852. v-if="item.fieldKey == 'name'"
  1853. :label="item.fieldName"
  1854. :required="item.required"
  1855. label-width="120px"
  1856. :disabled="true"
  1857. :prop="item.required ? item.fieldKey : ''"
  1858. >
  1859. <el-input
  1860. v-model="infoForm.name"
  1861. :disabled="disName"
  1862. :placeholder="`请输入${item.fieldName}`"
  1863. />
  1864. </el-form-item>
  1865. <el-form-item
  1866. :key="index"
  1867. v-if="item.fieldKey == 'idcard'"
  1868. :label="item.fieldName"
  1869. :required="item.required"
  1870. :disabled="true"
  1871. label-width="120px"
  1872. :prop="item.required ? item.fieldKey : ''"
  1873. >
  1874. <el-input
  1875. v-model="infoForm.idcard"
  1876. :disabled="disCard"
  1877. :placeholder="`请输入${item.fieldName}`"
  1878. />
  1879. </el-form-item>
  1880. <el-form-item
  1881. :key="index"
  1882. v-if="item.fieldKey == 'telphone'"
  1883. :disabled="true"
  1884. :label="item.fieldName"
  1885. :required="item.required"
  1886. label-width="120px"
  1887. :prop="item.required ? item.fieldKey : ''"
  1888. >
  1889. <el-input
  1890. v-model="infoForm.telphone"
  1891. :placeholder="`请输入${item.fieldName}`"
  1892. />
  1893. </el-form-item>
  1894. <el-form-item
  1895. :key="index"
  1896. v-if="item.fieldKey == 'school'"
  1897. :label="item.fieldName"
  1898. :required="item.required"
  1899. label-width="120px"
  1900. :prop="item.required ? item.fieldKey : ''"
  1901. >
  1902. <el-input
  1903. v-model="infoForm.school"
  1904. :placeholder="`请输入${item.fieldName}`"
  1905. />
  1906. </el-form-item>
  1907. <el-form-item
  1908. :key="index"
  1909. v-if="item.fieldKey == 'work_unit'"
  1910. :label="item.fieldName"
  1911. :required="item.required"
  1912. label-width="120px"
  1913. :prop="item.required ? item.fieldKey : ''"
  1914. >
  1915. <el-input
  1916. v-model="infoForm.work_unit"
  1917. :placeholder="`请输入${item.fieldName}`"
  1918. />
  1919. </el-form-item>
  1920. <el-form-item
  1921. :key="index"
  1922. v-if="item.fieldKey == 'unit_contact'"
  1923. :label="item.fieldName"
  1924. :required="item.required"
  1925. label-width="120px"
  1926. :prop="item.required ? item.fieldKey : ''"
  1927. >
  1928. <el-input
  1929. v-model="infoForm.unit_contact"
  1930. :placeholder="`请输入${item.fieldName}`"
  1931. />
  1932. </el-form-item>
  1933. <el-form-item
  1934. :key="index"
  1935. v-if="item.fieldKey == 'unit_tel'"
  1936. :label="item.fieldName"
  1937. :required="item.required"
  1938. label-width="120px"
  1939. :prop="item.required ? item.fieldKey : ''"
  1940. >
  1941. <el-input
  1942. v-model="infoForm.unit_tel"
  1943. :placeholder="`请输入${item.fieldName}`"
  1944. />
  1945. </el-form-item>
  1946. <el-form-item
  1947. :key="index"
  1948. v-if="item.fieldKey == 'apply_post'"
  1949. :label="item.fieldName"
  1950. :required="item.required"
  1951. label-width="120px"
  1952. :prop="item.required ? item.fieldKey : ''"
  1953. >
  1954. <el-input
  1955. v-model="infoForm.apply_post"
  1956. :placeholder="`请输入${item.fieldName}`"
  1957. />
  1958. </el-form-item>
  1959. <el-form-item
  1960. :key="index"
  1961. v-if="item.fieldKey == 'major'"
  1962. :label="item.fieldName"
  1963. :required="item.required"
  1964. label-width="120px"
  1965. :prop="item.required ? item.fieldKey : ''"
  1966. >
  1967. <el-input
  1968. v-model="infoForm.major"
  1969. :placeholder="`请输入${item.fieldName}`"
  1970. />
  1971. </el-form-item>
  1972. <el-form-item
  1973. :key="index"
  1974. v-if="item.inputType == 2"
  1975. :label="item.fieldName"
  1976. label-width="120px"
  1977. :required="item.required"
  1978. :prop="item.required ? item.fieldKey : ''"
  1979. >
  1980. <el-select v-model="infoForm[item.fieldKey]" placeholder="">
  1981. <el-option
  1982. v-for="(option, optionIndex) in getarrays(item.fieldKey)"
  1983. :key="optionIndex"
  1984. :label="option"
  1985. :value="optionIndex + ''"
  1986. ></el-option>
  1987. </el-select>
  1988. </el-form-item>
  1989. <el-form-item
  1990. :key="index"
  1991. v-if="item.inputType == 5"
  1992. :label="item.fieldName"
  1993. label-width="120px"
  1994. :required="item.required"
  1995. :prop="item.required ? item.fieldKey : ''"
  1996. >
  1997. <el-date-picker
  1998. v-model="infoForm[item.fieldKey]"
  1999. align="right"
  2000. type="date"
  2001. placeholder="选择日期"
  2002. >
  2003. </el-date-picker>
  2004. </el-form-item>
  2005. <el-form-item
  2006. :key="index"
  2007. v-if="
  2008. item.inputType == 3 &&
  2009. item.fieldKey !== 'commitment_electr_signature'
  2010. "
  2011. :label="item.fieldName"
  2012. :required="item.required"
  2013. label-width="120px"
  2014. label-position="top"
  2015. :prop="item.required ? item.fieldKey : ''"
  2016. >
  2017. <el-upload
  2018. action=""
  2019. :max-size="2097152"
  2020. accept="image/jpeg, image/jpg, image/png"
  2021. :show-file-list="false"
  2022. list-type="picture"
  2023. :auto-upload="false"
  2024. :ref="
  2025. item.fieldKey === 'recent_photos'
  2026. ? 'recent_photos'
  2027. : item.fieldKey === 'idcard_face_photo'
  2028. ? 'idcard_face_photo'
  2029. : item.fieldKey === 'idcard_national_photo'
  2030. ? 'idcard_national_photo'
  2031. : ''
  2032. "
  2033. :on-change="
  2034. item.fieldKey === 'recent_photos'
  2035. ? changePhotoListHeader1
  2036. : item.fieldKey === 'idcard_face_photo'
  2037. ? changePhotoListHeader2
  2038. : item.fieldKey === 'idcard_national_photo'
  2039. ? changePhotoListHeader3
  2040. : ''
  2041. "
  2042. :file-list="
  2043. item.fieldKey === 'recent_photos'
  2044. ? fileList1
  2045. : item.fieldKey === 'idcard_face_photo'
  2046. ? fileList2
  2047. : item.fieldKey === 'idcard_national_photo'
  2048. ? fileList3
  2049. : ''
  2050. "
  2051. >
  2052. <div class="upload-box">
  2053. <div
  2054. :style="
  2055. item.fieldKey === 'recent_photos'
  2056. ? 'width: 120px; height: 169px;background:url(' +
  2057. require('@/assets/info_1.png') +
  2058. ') no-repeat center;background-size:cover;position:relative;'
  2059. : item.fieldKey === 'idcard_face_photo'
  2060. ? 'width: 120px; height: 82px;background:url(' +
  2061. require('@/assets/info_2.png') +
  2062. ') no-repeat center;background-size:cover;position:relative;'
  2063. : item.fieldKey === 'idcard_national_photo'
  2064. ? 'width: 120px; height: 82px;background:url(' +
  2065. require('@/assets/info_3.png') +
  2066. ') no-repeat center;background-size:cover;position:relative;'
  2067. : ''
  2068. "
  2069. >
  2070. <i
  2071. @click="deleteImg(item)"
  2072. class="el-icon-error"
  2073. v-if="
  2074. item.fieldKey === 'recent_photos'
  2075. ? fileList1[0]
  2076. : item.fieldKey === 'idcard_face_photo'
  2077. ? fileList2[0]
  2078. : item.fieldKey === 'idcard_national_photo'
  2079. ? fileList3[0]
  2080. : ''
  2081. "
  2082. ></i>
  2083. <el-image
  2084. style="width: 100%; height: 100%"
  2085. :src="
  2086. item.fieldKey === 'recent_photos'
  2087. ? $tools.splitImgHost(fileList1[0].url)
  2088. : item.fieldKey === 'idcard_face_photo'
  2089. ? $tools.splitImgHost(fileList2[0].url)
  2090. : item.fieldKey === 'idcard_national_photo'
  2091. ? $tools.splitImgHost(fileList3[0].url)
  2092. : ''
  2093. "
  2094. v-if="
  2095. item.fieldKey === 'recent_photos'
  2096. ? fileList1[0]
  2097. : item.fieldKey === 'idcard_face_photo'
  2098. ? fileList2[0]
  2099. : item.fieldKey === 'idcard_national_photo'
  2100. ? fileList3[0]
  2101. : ''
  2102. "
  2103. :preview-src-list="
  2104. item.fieldKey === 'recent_photos'
  2105. ? [$tools.splitImgHost(fileList1[0].url)]
  2106. : item.fieldKey === 'idcard_face_photo'
  2107. ? [$tools.splitImgHost(fileList2[0].url)]
  2108. : item.fieldKey === 'idcard_national_photo'
  2109. ? [$tools.splitImgHost(fileList3[0].url)]
  2110. : ''
  2111. "
  2112. >
  2113. </el-image>
  2114. </div>
  2115. <div>
  2116. <span
  2117. v-if="item.fieldKey === 'recent_photos'"
  2118. style="color: #999999"
  2119. >竖向白底证件照 文件大小≤2M</span
  2120. >
  2121. <span
  2122. v-if="
  2123. item.fieldKey === 'idcard_face_photo' ||
  2124. item.fieldKey === 'idcard_national_photo'
  2125. "
  2126. style="color: #999999"
  2127. >
  2128. 文件大小≤2M
  2129. </span>
  2130. </div>
  2131. </div>
  2132. <div style="display: inline-block" slot="trigger">
  2133. <el-button type="primary" size="small" round
  2134. >浏览文件</el-button
  2135. >
  2136. </div>
  2137. </el-upload>
  2138. </el-form-item>
  2139. <div
  2140. :key="index"
  2141. v-if="
  2142. item.inputType == 3 &&
  2143. item.fieldKey === 'commitment_electr_signature'
  2144. "
  2145. >
  2146. <el-form-item
  2147. v-if="
  2148. item.inputType == 3 &&
  2149. item.fieldKey === 'commitment_electr_signature'
  2150. "
  2151. label="承诺书"
  2152. :required="item.required"
  2153. label-width="120px"
  2154. label-position="top"
  2155. >
  2156. <div style="line-height: 40px; text-indent: 2em">
  2157. <span>
  2158. 本人自愿做出如下承诺:本人己仔细阅读《广东省住房和城乡建设厅关于推进住房和城乡建设领域施工现场专业人员职业培训工作的通知》
  2159. 全部内容并知晓和理解,本人的学历证书、身份证、工作年限、相片等所有资料完全真实、符合报名条件、资格审查要求和相关规定,本人在报名、审查、培训、测试等有关的事项中会严格道守相关规定和要求,如有虛假或与实际规定不符等情况造成的一切后果由本人承担。
  2160. </span>
  2161. <div style="line-height: 40px; text-indent: 2em">
  2162. <span>特此承诺!</span>
  2163. </div>
  2164. </div>
  2165. </el-form-item>
  2166. <el-form-item
  2167. v-if="
  2168. item.inputType == 3 &&
  2169. item.fieldKey === 'commitment_electr_signature'
  2170. "
  2171. label="签名板"
  2172. :required="item.required"
  2173. label-width="120px"
  2174. label-position="top"
  2175. :prop="item.required ? item.fieldKey : ''"
  2176. >
  2177. <div class="dis_stys">
  2178. <span style="color: #999999">请在下方签名区进行签名</span>
  2179. <el-button
  2180. type="primary"
  2181. size="small"
  2182. @click="retDraw"
  2183. mode=""
  2184. >清空</el-button
  2185. >
  2186. </div>
  2187. <div class="handCenter">
  2188. <vue-esign
  2189. v-if="!infoForm[item.fieldKey]"
  2190. ref="esign"
  2191. :width="600"
  2192. :height="300"
  2193. :isCrop="false"
  2194. :lineWidth="5"
  2195. :lineColor="'#333'"
  2196. />
  2197. <div
  2198. v-else
  2199. style="width: 100%; height: 100%; position: relative"
  2200. >
  2201. <img
  2202. style="width: 100%; height: 100%"
  2203. :src="$tools.splitImgHost(infoForm[item.fieldKey])"
  2204. mode=""
  2205. />
  2206. </div>
  2207. </div>
  2208. </el-form-item>
  2209. </div>
  2210. <el-form-item
  2211. :key="index"
  2212. v-if="item.inputType == 4"
  2213. :label="item.fieldName"
  2214. :required="item.required"
  2215. label-width="120px"
  2216. label-position="top"
  2217. :prop="item.required ? item.fieldKey : ''"
  2218. >
  2219. <el-button
  2220. type="primary"
  2221. size="small"
  2222. round
  2223. @click="downloadStamp(item)"
  2224. >下载模板</el-button
  2225. >
  2226. <el-upload
  2227. action=""
  2228. :max-size="2097152"
  2229. accept="image/jpeg, image/jpg, image/png"
  2230. :show-file-list="false"
  2231. list-type="picture"
  2232. :auto-upload="false"
  2233. ref="stamp"
  2234. :on-change="changePhotoListStamp"
  2235. :file-list="fileListStamp"
  2236. >
  2237. <div style="display: inline-block; vertical-align: top">
  2238. <div
  2239. :style="
  2240. 'width: 120px; height: 120px;background:url(' +
  2241. require('@/assets/info_4.png') +
  2242. ') no-repeat center;background-size:cover;position:relative;'
  2243. "
  2244. >
  2245. <el-image
  2246. style="width: 100%; height: 100%"
  2247. :src="$tools.splitImgHost(fileListStamp[0].url)"
  2248. v-if="fileListStamp[0]"
  2249. :preview-src-list="[
  2250. $tools.splitImgHost(fileListStamp[0].url),
  2251. ]"
  2252. >
  2253. </el-image>
  2254. </div>
  2255. <div>
  2256. <span style="color: #999999">文件大小≤2M</span>
  2257. </div>
  2258. </div>
  2259. <div style="display: inline-block" slot="trigger">
  2260. <el-button type="primary" size="small" round
  2261. >浏览文件</el-button
  2262. >
  2263. </div>
  2264. </el-upload>
  2265. </el-form-item>
  2266. </template>
  2267. </el-form>
  2268. </div>
  2269. <span slot="footer" class="dialog-footer">
  2270. <el-button
  2271. @click="
  2272. showInfoDetailModal = false;
  2273. $router.back(-1);
  2274. "
  2275. >取 消</el-button
  2276. >
  2277. <el-button type="primary" :loading="uploading" @click="submit"
  2278. >确 定</el-button
  2279. >
  2280. </span>
  2281. </el-dialog>
  2282. <el-dialog
  2283. width="996px"
  2284. height="600px"
  2285. class="info"
  2286. :visible.sync="showStampDetailModail"
  2287. :close-on-click-modal="false"
  2288. :close-on-press-escape="false"
  2289. :show-close="false"
  2290. title="资料填写"
  2291. >
  2292. <div class="info__content">
  2293. <el-form
  2294. :model="stampForm"
  2295. ref="stampForm"
  2296. :rules="stampRules"
  2297. :error-type="errorType"
  2298. >
  2299. <template v-for="(item, index) in listDataStamp">
  2300. <el-form-item
  2301. :key="index"
  2302. v-if="item.inputType == 4"
  2303. :label="item.fieldName"
  2304. :required="item.required"
  2305. label-width="120px"
  2306. label-position="top"
  2307. :prop="item.required ? item.fieldKey : ''"
  2308. >
  2309. <el-button
  2310. type="primary"
  2311. size="small"
  2312. round
  2313. @click="downloadStamp(item)"
  2314. >下载模板</el-button
  2315. >
  2316. <el-upload
  2317. action=""
  2318. :max-size="2097152"
  2319. accept="image/jpeg, image/jpg, image/png"
  2320. :show-file-list="false"
  2321. list-type="picture"
  2322. :auto-upload="false"
  2323. ref="stamp"
  2324. :on-change="changePhotoListStamp"
  2325. :file-list="fileListStamp"
  2326. >
  2327. <div style="display: inline-block; vertical-align: top">
  2328. <div
  2329. :style="
  2330. 'width: 120px; height: 120px;background:url(' +
  2331. require('@/assets/info_4.png') +
  2332. ') no-repeat center;background-size:cover;position:relative;'
  2333. "
  2334. >
  2335. <el-image
  2336. style="width: 100%; height: 100%"
  2337. :src="$tools.splitImgHost(fileListStamp[0].url)"
  2338. v-if="fileListStamp[0]"
  2339. :preview-src-list="[
  2340. $tools.splitImgHost(fileListStamp[0].url),
  2341. ]"
  2342. >
  2343. </el-image>
  2344. </div>
  2345. <div>
  2346. <span style="color: #999999">文件大小≤2M</span>
  2347. </div>
  2348. </div>
  2349. <div style="display: inline-block" slot="trigger">
  2350. <el-button type="primary" size="small" round
  2351. >浏览文件</el-button
  2352. >
  2353. </div>
  2354. </el-upload>
  2355. </el-form-item>
  2356. </template>
  2357. </el-form>
  2358. </div>
  2359. <span slot="footer" class="dialog-footer">
  2360. <el-button
  2361. @click="
  2362. showStampDetailModail = false;
  2363. $router.back(-1);
  2364. "
  2365. >取 消</el-button
  2366. >
  2367. <el-button type="primary" :loading="uploading" @click="stampSubmit"
  2368. >确 定</el-button
  2369. >
  2370. </span>
  2371. </el-dialog>
  2372. <div id="printTable"></div>
  2373. <!-- <ToolBar></ToolBar> -->
  2374. <Footer></Footer>
  2375. </div>
  2376. </template>
  2377. <script>
  2378. import Footer from "@/components/footer/index";
  2379. import Header from "@/components/header/index";
  2380. import ToolBar from "@/components/toolbar/index";
  2381. import GoodsItem from "@/components/goodsItem/index";
  2382. import * as imageConversion from "image-conversion";
  2383. import { mapGetters, mapMutations } from "vuex";
  2384. import * as baseUrls from "@/axios.js";
  2385. import pdf from "vue-pdf";
  2386. import print from "print-js";
  2387. export default {
  2388. name: "CourseDetail",
  2389. components: {
  2390. Footer,
  2391. Header,
  2392. ToolBar,
  2393. pdf,
  2394. GoodsItem,
  2395. },
  2396. filters: {
  2397. formatDate(date) {
  2398. const nDate = new Date(date);
  2399. const nyear = nDate.getFullYear();
  2400. const nmonth = (nDate.getMonth() + 1).toString().padStart(2, 0);
  2401. const nday = nDate.getDate().toString().padStart(2, 0);
  2402. const hour = nDate.getHours();
  2403. const mins = nDate.getMinutes();
  2404. const seconds = nDate.getSeconds();
  2405. return (
  2406. nyear +
  2407. "-" +
  2408. nmonth +
  2409. "-" +
  2410. nday +
  2411. " " +
  2412. hour +
  2413. ":" +
  2414. (mins >= 10 ? mins : "0" + mins) +
  2415. ":" +
  2416. (seconds >= 10 ? seconds : "0" + seconds)
  2417. );
  2418. },
  2419. },
  2420. data() {
  2421. return {
  2422. liveDuration: 0,
  2423. numPages: 0,
  2424. showPdf: false,
  2425. // 总页数
  2426. pdfPages: 10,
  2427. // 当前页数
  2428. pageNum: 1,
  2429. // 加载进度
  2430. loadedRatio: 10,
  2431. // 页面加载完成
  2432. curPageNum: 0,
  2433. // 放大系数 默认百分百
  2434. scale: 100,
  2435. // 旋转角度 ‘90’的倍数才有效
  2436. pageRotate: 0,
  2437. // 单击内部链接时触发 (目前我没有遇到使用场景)
  2438. page: 0,
  2439. bgColor: "#ccc",
  2440. answerTimer: null,
  2441. recordObj: {},
  2442. showInfoDetailModal: false,
  2443. showStampDetailModail: false,
  2444. isTaking: true, //是否正在拍照
  2445. photoConfig: false,
  2446. stream: null,
  2447. photoNum: 0,
  2448. playSectionId: 0,
  2449. photoIndex: 0, //当前位于拍照的区间下标 从0开始
  2450. photoHistoryList: [], //已拍照历史的下标点
  2451. moduleId: 0,
  2452. chapterId: 0,
  2453. menuTab: [
  2454. {
  2455. name: "1",
  2456. label: "章节目录",
  2457. },
  2458. ],
  2459. lectureShow: true,
  2460. textarea: "",
  2461. textareaNote: "",
  2462. takePhotoModal: false,
  2463. activeName: "1",
  2464. courseId: "",
  2465. courseTabIndex: "1",
  2466. goodsId: "",
  2467. gradeId: 0,
  2468. livingTimer: null,
  2469. sectionItem: {},
  2470. gradeDetail: {},
  2471. autoplay: false,
  2472. isAllowSeek: "on",
  2473. playbackRate: false,
  2474. goodsPlayConfig: null,
  2475. playTime: 0, //页面播放时长,不含暂停
  2476. param: {
  2477. pageNum: 1,
  2478. pageSize: 100,
  2479. total: 0,
  2480. },
  2481. postTimer: null, //提交视频观看记录定时器
  2482. lockTimer: null,
  2483. courseList: [],
  2484. businessData: {},
  2485. courseHandoutsData: "",
  2486. menuList: [],
  2487. goodsData: {},
  2488. tabList: [],
  2489. historyChatMsgList: [],
  2490. vid: "",
  2491. vidzb: "",
  2492. player: "",
  2493. playerzb: "",
  2494. activeId: "", //当前选中ID
  2495. vodPlayerJs: "https://player.polyv.net/script/player.js",
  2496. playerJs:
  2497. "https://player.polyv.net/resp/live-h5-player/latest/liveplayer.min.js",
  2498. uidzb: "egsxlptzdq",
  2499. menuList: [],
  2500. reMenuList: [],
  2501. answerList: [{ newArraysAnswerList: [] }],
  2502. noteList: [],
  2503. photoList: [],
  2504. noteTotal: 0,
  2505. duration: 0,
  2506. answerTimer: null,
  2507. noteParams: {
  2508. pageNum: 1,
  2509. // pageSize: 4,
  2510. },
  2511. ossAvatarUrl: "", //照片地址
  2512. nowTime: 0,
  2513. faceUrl: "",
  2514. loading: null,
  2515. listData: [],
  2516. listDataStamp: [],
  2517. remark: "",
  2518. remarkStatus: false,
  2519. remarkStamp: "",
  2520. remarkStatusStamp: false,
  2521. errorType: ["message"],
  2522. stampForm: {
  2523. commitment_seal: "",
  2524. },
  2525. infoForm: {
  2526. name: "",
  2527. sex: "",
  2528. idcard: "",
  2529. telphone: "",
  2530. education: "",
  2531. school: "",
  2532. graduation_time: "",
  2533. work_unit: "",
  2534. unit_contact: "",
  2535. unit_tel: "",
  2536. apply_post: "",
  2537. major: "",
  2538. working_years: "",
  2539. recent_photos: "",
  2540. idcard_face_photo: "",
  2541. idcard_national_photo: "",
  2542. commitment_electr_signature: "",
  2543. commitment_seal: "",
  2544. },
  2545. recommendList: [],
  2546. rules: {
  2547. name: [
  2548. {
  2549. required: true,
  2550. message: "请输入姓名",
  2551. trigger: ["change", "blur"],
  2552. },
  2553. ],
  2554. sex: [
  2555. {
  2556. required: true,
  2557. message: "请选择性别",
  2558. trigger: "change",
  2559. },
  2560. ],
  2561. idcard: [
  2562. {
  2563. required: true,
  2564. message: "请输入身份证号",
  2565. trigger: ["change", "blur"],
  2566. },
  2567. {
  2568. validator: (rule, value, callback) => {
  2569. let IDRe18 =
  2570. /^([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]$/;
  2571. let IDre15 =
  2572. /^([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}$/;
  2573. if (!IDRe18.test(value) && !IDre15.test(value)) {
  2574. return callback(new Error("请输入格式正确的身份证号"));
  2575. } else {
  2576. return callback();
  2577. }
  2578. },
  2579. message: "请输入格式正确的身份证号",
  2580. trigger: ["change", "blur"],
  2581. },
  2582. ],
  2583. telphone: [
  2584. {
  2585. required: true,
  2586. message: "请输入手机号码",
  2587. trigger: ["change", "blur"],
  2588. },
  2589. {
  2590. validator: (rule, value, callback) => {
  2591. var reg_tel =
  2592. /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
  2593. if (reg_tel.test(value)) {
  2594. return callback();
  2595. } else {
  2596. return callback(new Error("手机号码不正确"));
  2597. }
  2598. },
  2599. trigger: ["change", "blur"],
  2600. },
  2601. ],
  2602. education: [
  2603. {
  2604. required: true,
  2605. message: "请选择学历",
  2606. trigger: "change",
  2607. },
  2608. ],
  2609. school: [
  2610. {
  2611. required: true,
  2612. message: "请输入毕业院校",
  2613. trigger: ["change", "blur"],
  2614. },
  2615. ],
  2616. graduation_time: [
  2617. {
  2618. required: true,
  2619. message: "请选择毕业时间",
  2620. trigger: "change",
  2621. },
  2622. ],
  2623. work_unit: [
  2624. {
  2625. required: true,
  2626. message: "请输入工作单位",
  2627. trigger: ["change", "blur"],
  2628. },
  2629. ],
  2630. unit_contact: [
  2631. {
  2632. required: true,
  2633. message: "请输入单位联系人",
  2634. trigger: ["change", "blur"],
  2635. },
  2636. ],
  2637. unit_tel: [
  2638. {
  2639. required: true,
  2640. message: "请输入单位联系电话",
  2641. trigger: ["change", "blur"],
  2642. },
  2643. {
  2644. validator: (rule, value, callback) => {
  2645. var reg_tel =
  2646. /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
  2647. var vartest = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
  2648. var vartest1 = /^([0-9]{3,4})?[0-9]{7,8}$/;
  2649. if (
  2650. reg_tel.test(value) ||
  2651. vartest.test(value) ||
  2652. vartest1.test(value)
  2653. ) {
  2654. return callback();
  2655. } else {
  2656. return callback(new Error("单位联系电话不正确"));
  2657. }
  2658. },
  2659. trigger: ["change", "blur"],
  2660. },
  2661. ],
  2662. apply_post: [
  2663. {
  2664. required: true,
  2665. message: "请输入报名岗位",
  2666. trigger: ["change", "blur"],
  2667. },
  2668. ],
  2669. major: [
  2670. {
  2671. required: true,
  2672. message: "请输入所学专业",
  2673. trigger: ["change", "blur"],
  2674. },
  2675. ],
  2676. working_years: [
  2677. {
  2678. required: true,
  2679. message: "请选择工作年限",
  2680. trigger: "change",
  2681. },
  2682. ],
  2683. recent_photos: [
  2684. {
  2685. required: true,
  2686. message: "请上传证件照",
  2687. trigger: ["change", "blur"],
  2688. },
  2689. ],
  2690. idcard_face_photo: [
  2691. {
  2692. required: true,
  2693. message: "请上传身份证人像面",
  2694. trigger: ["change", "blur"],
  2695. },
  2696. ],
  2697. idcard_national_photo: [
  2698. {
  2699. required: true,
  2700. message: "请上传身份证国徽面",
  2701. trigger: ["change", "blur"],
  2702. },
  2703. ],
  2704. commitment_electr_signature: [
  2705. {
  2706. required: true,
  2707. message: "请签写承诺书电子签",
  2708. trigger: ["change", "blur"],
  2709. },
  2710. ],
  2711. commitment_seal: [
  2712. {
  2713. required: true,
  2714. message: "请上传承诺书盖章",
  2715. trigger: ["change", "blur"],
  2716. },
  2717. ],
  2718. },
  2719. stampRules: {
  2720. commitment_seal: [
  2721. {
  2722. required: true,
  2723. message: "请上传承诺书盖章",
  2724. trigger: ["change", "blur"],
  2725. },
  2726. ],
  2727. },
  2728. fileList1: [], //证件照
  2729. fileList2: [], //人像
  2730. fileList3: [], //国徽
  2731. fileListStamp: [], //印章
  2732. dictObj: null,
  2733. isRequired: false,
  2734. uploading: false,
  2735. veryIdCard: "",
  2736. veryIdName: "",
  2737. isPlayRebuild: false,
  2738. showRecordStatus: false,
  2739. hasStart: false,
  2740. needOpen: true, //是否需要展开第一章节
  2741. menuIndex: [],
  2742. clickLock: false,
  2743. liveLast: null,
  2744. disName: false, // 姓名是否禁止输入
  2745. disCard: false, // 身份证是否禁止输入
  2746. clickSectionItem: {}, // 点击节的内容
  2747. compareFaceData: 0, // 拍照匹配相似度
  2748. };
  2749. },
  2750. computed: {
  2751. ...mapGetters(["userInfo"]),
  2752. compyRecommend: function () {
  2753. return function (array) {
  2754. let ary = [];
  2755. if (array) {
  2756. for (let i = 0; i < array.length; i++) {
  2757. if (i >= 5) {
  2758. break;
  2759. } else {
  2760. ary.push(array[i]);
  2761. }
  2762. }
  2763. }
  2764. return ary;
  2765. };
  2766. },
  2767. },
  2768. async mounted() {
  2769. this.courseId = +this.$route.query.courseId || "";
  2770. this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  2771. this.goodsId = this.$route.params.goodsId;
  2772. this.orderGoodsId = this.$route.query.orderGoodsId;
  2773. this.gradeId = this.$route.query.gradeId || 0;
  2774. this.sectionItem = this.$route.query;
  2775. this.dictList();
  2776. // this.userConfirmInfoDetail().then((res) => {
  2777. // this.getbaseprofiletplists().then(async (res) => {
  2778. // let allMenuList = await this.studyRecordMenuAllList();
  2779. // let nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  2780. // let liveMenu = allMenuList.filter((item) => {
  2781. // //获取直播中的视频
  2782. // if (
  2783. // item.type == 3 &&
  2784. // item.liveStartTime <= nowTime &&
  2785. // item.liveEndTime > nowTime
  2786. // ) {
  2787. // return true;
  2788. // } else {
  2789. // return false;
  2790. // }
  2791. // });
  2792. // let earlyTime = 0;
  2793. // if (liveMenu && liveMenu.length) {
  2794. // earlyTime = liveMenu[0].liveStartTime;
  2795. // }
  2796. await this.courseCourseList();
  2797. if (this.sectionItem.recordingUrl) {
  2798. let noteSecond = this.$route.query.noteSecond;
  2799. if (noteSecond > 0) {
  2800. let item = {
  2801. sectionId: this.$route.query.sectionId,
  2802. recordingUrl: this.$route.query.recordingUrl,
  2803. noteSecond: noteSecond,
  2804. studyDuration: noteSecond,
  2805. moduleId: this.$route.query.moduleId,
  2806. chapterId: this.$route.query.chapterId,
  2807. };
  2808. this.playSectionId = this.$route.query.sectionId;
  2809. setTimeout(() => {
  2810. this.noteClick(item);
  2811. }, 1000);
  2812. }
  2813. } else {
  2814. console.log("------");
  2815. this.studyRecordQueryLiveLast();
  2816. }
  2817. document.addEventListener('visibilitychange', this.pauseVideo)
  2818. // let noteSecond = this.$route.query.noteSecond;
  2819. // if (noteSecond > 0) {
  2820. // let item = {
  2821. // sectionId: this.$route.query.sectionId,
  2822. // recordingUrl: this.$route.query.recordingUrl,
  2823. // noteSecond: noteSecond,
  2824. // studyDuration: noteSecond,
  2825. // moduleId: this.$route.query.moduleId,
  2826. // chapterId: this.$route.query.chapterId,
  2827. // };
  2828. // this.sectionItem = item;
  2829. // this.playSectionId = this.$route.query.sectionId;
  2830. // setTimeout(() => {
  2831. // this.noteClick(item);
  2832. // }, 1000);
  2833. // }
  2834. // });
  2835. // });
  2836. },
  2837. beforeDestroy() {
  2838. clearInterval(this.answerTimer);
  2839. clearInterval(this.postTimer);
  2840. clearInterval(this.livingTimer);
  2841. document.removeEventListener('visibilitychange', this.pauseVideo)
  2842. try {
  2843. this.$msgbox.close();
  2844. } catch (err) {}
  2845. if (this.playSectionId && this.hasStart) {
  2846. this.postStudyRecord();
  2847. }
  2848. // if (this.lockTimer) {
  2849. // clearInterval(this.lockTimer);
  2850. // this.$request
  2851. // .lockDelLock({
  2852. // action: "jxjy",
  2853. // })
  2854. // .then((res) => {});
  2855. // }
  2856. this.clears();
  2857. this.player.destroy();
  2858. // clearInterval(this.answerTimer);
  2859. // clearInterval(this.postTimer);
  2860. // clearInterval(this.livingTimer);
  2861. },
  2862. methods: {
  2863. ...mapMutations(["getCartCount"]),
  2864. pauseVideo() {
  2865. if (document.visibilityState === 'hidden') {
  2866. this.player && this.player.j2s_pauseVideo();
  2867. }
  2868. },
  2869. isLast(item) {
  2870. if (this.liveLast) {
  2871. let sectionASame =
  2872. this.liveLast.sectionId == (item.sectionId || item.menuId);
  2873. let chapterSame = this.liveLast.chapterId == (item.chapterId || 0);
  2874. let moduleSame = this.liveLast.moduleId == (item.moduleId || 0);
  2875. return sectionASame && chapterSame && moduleSame;
  2876. } else {
  2877. return false;
  2878. }
  2879. },
  2880. /**
  2881. * 获取上次观看的直播
  2882. */
  2883. studyRecordGetLastLive() {
  2884. this.$request
  2885. .studyRecordGetLastLive({
  2886. orderGoodsId: this.orderGoodsId,
  2887. courseId: this.courseId,
  2888. })
  2889. .then((res) => {
  2890. if (res.data) {
  2891. res.data.sectionType = 2;
  2892. this.liveLast = res.data;
  2893. }
  2894. });
  2895. },
  2896. studyRecordQueryLiveLast() {
  2897. this.$request
  2898. .studyRecordQueryLiveLast({
  2899. orderGoodsId: this.orderGoodsId,
  2900. courseId: this.courseId,
  2901. })
  2902. .then((res) => {
  2903. console.log(res, "couse");
  2904. if (res.data) {
  2905. if (res.data.sectionType == 1) {
  2906. //视频
  2907. this.chapterId = res.data.chapterId;
  2908. this.moduleId = res.data.moduleId;
  2909. this.playSectionId = res.data.sectionId;
  2910. this.vid = res.data.recordingUrl;
  2911. this.sectionItem = res.data;
  2912. this.playVideo(res.data);
  2913. } else if (res.data.sectionType == 2) {
  2914. //直播
  2915. this.studyRecordGetLastLive();
  2916. } else if (res.data.sectionType == 3) {
  2917. //回放
  2918. this.chapterId = res.data.chapterId;
  2919. this.moduleId = res.data.moduleId;
  2920. this.playSectionId = res.data.sectionId;
  2921. this.vid = res.data.recordingUrl;
  2922. this.sectionItem = res.data;
  2923. console.log("回放啊");
  2924. this.playVideo(res.data);
  2925. }
  2926. }
  2927. });
  2928. },
  2929. /**
  2930. *
  2931. 获取推荐列表
  2932. */
  2933. getRecommend() {
  2934. this.$request
  2935. .appCommonActivityRecommendList({
  2936. businessId: this.goodsData.businessId,
  2937. type: 1,
  2938. })
  2939. .then((res) => {
  2940. if (res.rows.length) {
  2941. this.recommendList = res.rows[0];
  2942. }
  2943. });
  2944. },
  2945. addCart(status, goodsId) {
  2946. this.$request
  2947. .addCart({ goodsId: status ? goodsId : this.goodsId })
  2948. .then((res) => {
  2949. this.getCartCount();
  2950. this.$message({
  2951. message: "加入购物车成功",
  2952. type: "success",
  2953. });
  2954. })
  2955. .catch((err) => {
  2956. if (err.code == 500) {
  2957. this.$message({
  2958. message: err.msg,
  2959. type: "warning",
  2960. });
  2961. }
  2962. });
  2963. },
  2964. toGoodsDetail(item) {
  2965. this.$router.push({
  2966. path: "/course-detail/" + item.goodsId,
  2967. });
  2968. },
  2969. async takeOk() {
  2970. this.loading = true;
  2971. let compareFaceData = await this.faceRecognition();
  2972. this.compareFaceData = compareFaceData;
  2973. if (compareFaceData >= 80) {
  2974. const waitYS = await this.imageInfos();
  2975. this.postCoursePhotoRecord()
  2976. .then((res) => {
  2977. this.photoHistoryList.push(this.photoIndex);
  2978. this.postStudyRecord(); //提交记录
  2979. //恢复播放
  2980. this.$message({
  2981. type: "success",
  2982. message: "拍照成功",
  2983. });
  2984. this.takePhotoModal = false;
  2985. this.isTaking = false;
  2986. this.loading = false;
  2987. var polyvPlayerContext = this.player;
  2988. if (polyvPlayerContext) {
  2989. polyvPlayerContext.j2s_resumeVideo();
  2990. }
  2991. var polyvPlayerContext = this.playerzb;
  2992. if (polyvPlayerContext) {
  2993. polyvPlayerContext.j2s_resumeVideo();
  2994. }
  2995. })
  2996. .catch((err) => {
  2997. this.loading = false;
  2998. console.log(err, "err");
  2999. this.$message({
  3000. type: "warning",
  3001. message: "上传接口报错,请重新拍照上传",
  3002. });
  3003. this.reTake();
  3004. });
  3005. } else {
  3006. this.$message({
  3007. type: "warning",
  3008. message: "人脸匹配不通过,请重新拍照上传",
  3009. });
  3010. setTimeout(() => {
  3011. this.loading = false;
  3012. this.reTake();
  3013. }, 2000);
  3014. return;
  3015. }
  3016. },
  3017. async changePhotoListStamp(params, fileList) {
  3018. let file = await this.uploadRules(params);
  3019. if (fileList.length == 1) {
  3020. fileList.splice(0, 1);
  3021. }
  3022. this.$refs.stamp[0].clearFiles();
  3023. this.$upload
  3024. .upload(file, 0)
  3025. .then((res) => {
  3026. this.$set(this.stampForm, "commitment_seal", res);
  3027. this.fileListStamp = [
  3028. {
  3029. name: res,
  3030. url: res,
  3031. },
  3032. ];
  3033. this.$refs.stamp[0].clearFiles();
  3034. console.log(res);
  3035. })
  3036. .catch((err) => {
  3037. this.$refs.stamp[0].clearFiles();
  3038. });
  3039. },
  3040. // 页面加载成功 当前页数
  3041. pageLoaded(e) {
  3042. this.$emit("current", e);
  3043. this.curPageNum = e;
  3044. },
  3045. uploadRules(params) {
  3046. return new Promise((resolve, reject) => {
  3047. const file = params.raw;
  3048. const fileType = file.type;
  3049. const isImage = fileType.indexOf("image") != -1;
  3050. const sizeToM = file.size / 1024 / 1024;
  3051. if (!isImage) {
  3052. this.$message.error("只能上传图片格式png、jpg、gif!");
  3053. reject(false);
  3054. }
  3055. if (sizeToM > 2) {
  3056. imageConversion
  3057. .compressAccurately(file, {
  3058. size: 1024 * 2,
  3059. width: 1000,
  3060. height: 1000,
  3061. })
  3062. .then((res) => {
  3063. res = new File([res], file.name, { type: res.type });
  3064. resolve(res);
  3065. });
  3066. } else {
  3067. resolve(file);
  3068. }
  3069. });
  3070. },
  3071. async changePhotoListHeader1(params, fileList) {
  3072. let file = await this.uploadRules(params);
  3073. if (fileList.length == 1) {
  3074. fileList.splice(0, 1);
  3075. }
  3076. this.$refs.recent_photos[0].clearFiles();
  3077. this.$upload
  3078. .upload(file, 0)
  3079. .then((res) => {
  3080. this.$set(this.infoForm, "recent_photos", res);
  3081. this.fileList1 = [
  3082. {
  3083. name: res,
  3084. url: res,
  3085. },
  3086. ];
  3087. this.$refs.recent_photos[0].clearFiles();
  3088. console.log(res);
  3089. })
  3090. .catch((err) => {
  3091. this.$refs.recent_photos[0].clearFiles();
  3092. });
  3093. },
  3094. async changePhotoListHeader2(params, fileList) {
  3095. let file = await this.uploadRules(params);
  3096. if (fileList.length == 1) {
  3097. fileList.splice(0, 1);
  3098. }
  3099. let res = await this.faceCertificationIDCardOCR(1, file);
  3100. console.log(res.data.IdImgPath, "res.data.IdImgPath");
  3101. if (res.code == 500) {
  3102. this.$message.warning("请上传正确清晰的身份证人像面照片");
  3103. return;
  3104. }
  3105. this.$refs.idcard_face_photo[0].clearFiles();
  3106. this.$set(this.infoForm, "idcard_face_photo", res.data.IdImgPath);
  3107. this.fileList2 = [
  3108. {
  3109. name: res.data.IdImgPath,
  3110. url: res.data.IdImgPath,
  3111. },
  3112. ];
  3113. // this.$upload
  3114. // .upload(file, 0)
  3115. // .then((res) => {
  3116. // console.log(res, "res");
  3117. // this.$set(this.infoForm, "idcard_face_photo", res);
  3118. // this.fileList2 = [
  3119. // {
  3120. // name: res,
  3121. // url: res,
  3122. // },
  3123. // ];
  3124. // this.$refs.idcard_face_photo[0].clearFiles();
  3125. // console.log(res);
  3126. // })
  3127. // .catch((err) => {
  3128. // this.$refs.idcard_face_photo[0].clearFiles();
  3129. // });
  3130. },
  3131. async changePhotoListHeader3(params, fileList) {
  3132. let file = await this.uploadRules(params);
  3133. if (fileList.length == 1) {
  3134. fileList.splice(0, 1);
  3135. }
  3136. let res = await this.faceCertificationIDCardOCR(2, file);
  3137. if (res.code == 500) {
  3138. this.$message.warning("请上传正确清晰的身份证国徽面照片");
  3139. return;
  3140. }
  3141. this.$refs.idcard_national_photo[0].clearFiles();
  3142. this.$set(this.infoForm, "idcard_national_photo", res.data.IdImgPath);
  3143. this.fileList3 = [
  3144. {
  3145. name: res.data.IdImgPath,
  3146. url: res.data.IdImgPath,
  3147. },
  3148. ];
  3149. // this.$upload
  3150. // .upload(file, 0)
  3151. // .then((res) => {
  3152. // this.$set(this.infoForm, "idcard_national_photo", res);
  3153. // this.fileList3 = [
  3154. // {
  3155. // name: res,
  3156. // url: res,
  3157. // },
  3158. // ];
  3159. // this.$refs.idcard_national_photo[0].clearFiles();
  3160. // console.log(res);
  3161. // })
  3162. // .catch((err) => {
  3163. // this.$refs.idcard_national_photo[0].clearFiles();
  3164. // });
  3165. },
  3166. faceCertificationIDCardOCR(cardSide, file) {
  3167. return new Promise((resolve) => {
  3168. var reader = new FileReader();
  3169. // 将文件加载进入
  3170. reader.readAsDataURL(file);
  3171. reader.onload = (e) => {
  3172. // 转换完成输出该文件base64编码
  3173. let base64 = e.target.result;
  3174. this.$request
  3175. .faceCertificationIDCardOCR({
  3176. cardSide: cardSide, //1人像 2 国徽
  3177. cardImageBase64: base64,
  3178. gradeId: this.gradeId,
  3179. })
  3180. .then((res) => {
  3181. resolve(res);
  3182. })
  3183. .catch((err) => {
  3184. resolve(err);
  3185. });
  3186. };
  3187. });
  3188. },
  3189. async submit() {
  3190. if (this.uploading) {
  3191. return;
  3192. }
  3193. this.uploading = true;
  3194. var ast = this.listData.some((item) => {
  3195. return item.fieldKey === "commitment_electr_signature";
  3196. });
  3197. if (ast) {
  3198. await this.subCanvas();
  3199. }
  3200. this.resultForm();
  3201. },
  3202. stampSubmit() {
  3203. if (this.uploading) {
  3204. return;
  3205. }
  3206. this.uploading = true;
  3207. this.stampResultForm();
  3208. },
  3209. backLI() {
  3210. this.player.j2s_seekVideo(0);
  3211. this.showRecordStatus = false;
  3212. },
  3213. //验证表单
  3214. stampResultForm() {
  3215. for (let i = 0; i < this.listDataStamp.length; i++) {
  3216. if (
  3217. this.listDataStamp[i].fieldKey === "commitment_seal" &&
  3218. !this.listDataStamp[i].required
  3219. ) {
  3220. this.submitApi();
  3221. return;
  3222. }
  3223. }
  3224. this.$refs.stampForm.validate((valid) => {
  3225. if (valid) {
  3226. this.submitApiStamp();
  3227. } else {
  3228. this.uploading = false;
  3229. }
  3230. });
  3231. },
  3232. async submitApiStamp() {
  3233. var data = JSON.parse(JSON.stringify(this.stampForm));
  3234. if (data["commitment_seal"]) {
  3235. data.commitment_seal = await this.$upload.upload(
  3236. data.commitment_seal,
  3237. 0
  3238. );
  3239. }
  3240. this.optionChanges(data);
  3241. },
  3242. optionChanges(data) {
  3243. var self = this;
  3244. var objs = {};
  3245. for (let k in data) {
  3246. objs[k] = {
  3247. fieldKey: k,
  3248. value: data[k],
  3249. fieldName: (function () {
  3250. for (let i = 0; i < self.listDataStamp.length; i++) {
  3251. if (self.listDataStamp[i].fieldKey == k) {
  3252. return self.listDataStamp[i].fieldName;
  3253. }
  3254. }
  3255. })(),
  3256. status: self.remarkStatusStamp ? 1 : 0,
  3257. };
  3258. }
  3259. var datas = {
  3260. orderGoodsId: this.orderGoodsId,
  3261. goodsId: self.goodsId,
  3262. keyValue: JSON.stringify(objs),
  3263. };
  3264. if (self.remarkStatus) {
  3265. datas.id = self.id;
  3266. self.$request.editbaseprofileStamp(datas).then((res) => {
  3267. this.uploading = false;
  3268. this.showStampDetailModail = false;
  3269. this.$message.success("提交成功");
  3270. });
  3271. } else {
  3272. self.$request.addbaseprofileStamp(datas).then((res) => {
  3273. this.uploading = false;
  3274. this.showStampDetailModail = false;
  3275. this.$message.success("提交成功");
  3276. });
  3277. }
  3278. },
  3279. resultForm() {
  3280. console.log(1);
  3281. if (this.isRequired) {
  3282. this.submitApi();
  3283. } else {
  3284. console.log(1);
  3285. this.$refs.infoForm.validate((valid) => {
  3286. console.log(1);
  3287. if (valid) {
  3288. this.submitApi();
  3289. } else {
  3290. this.uploading = false;
  3291. }
  3292. });
  3293. // if (int === 1) {
  3294. // this.errorType = ["toast"];
  3295. // } else {
  3296. // this.errorType = ["message"];
  3297. // }
  3298. }
  3299. },
  3300. async submitApi() {
  3301. console.log(this.infoForm, "999");
  3302. var data = JSON.parse(JSON.stringify(this.infoForm));
  3303. if (data["sex"]) {
  3304. data.sex = this.dictObj["sys_user_sex"][Number(data.sex)];
  3305. }
  3306. if (data["education"]) {
  3307. data.education = this.dictObj["edu_level"][Number(data.education)];
  3308. }
  3309. if (data["working_years"]) {
  3310. data.working_years =
  3311. this.dictObj["working_years"][Number(data.working_years)];
  3312. }
  3313. if (data["recent_photos"]) {
  3314. data.recent_photos = await this.$upload.upload(data.recent_photos, 0);
  3315. }
  3316. if (data["idcard_face_photo"]) {
  3317. data.idcard_face_photo = await this.$upload.upload(
  3318. data.idcard_face_photo,
  3319. 0
  3320. );
  3321. }
  3322. if (data["idcard_national_photo"]) {
  3323. data.idcard_national_photo = await this.$upload.upload(
  3324. data.idcard_national_photo,
  3325. 0
  3326. );
  3327. }
  3328. if (data["commitment_electr_signature"]) {
  3329. data.commitment_electr_signature = await this.$upload.upload(
  3330. data.commitment_electr_signature,
  3331. 0
  3332. );
  3333. }
  3334. this.uploadDatas(data);
  3335. },
  3336. async downloadStamp(item) {
  3337. let self = this;
  3338. var ast = this.listData.some((item) => {
  3339. return item.fieldKey === "commitment_electr_signature";
  3340. });
  3341. if (ast) {
  3342. await this.subCanvas();
  3343. }
  3344. let data = JSON.parse(JSON.stringify(this.infoForm));
  3345. if (data["sex"]) {
  3346. data.sex = this.dictObj["sys_user_sex"][Number(data.sex)];
  3347. }
  3348. if (data["education"]) {
  3349. data.education = this.dictObj["edu_level"][Number(data.education)];
  3350. }
  3351. if (data["working_years"]) {
  3352. data.working_years =
  3353. this.dictObj["working_years"][Number(data.working_years)];
  3354. }
  3355. console.log(data, "data");
  3356. if (this.remarkStatus) {
  3357. var arsty = {};
  3358. for (let k in data) {
  3359. for (let j in self.copyData) {
  3360. if (k === j) {
  3361. if (self.copyData[j].value === data[k]) {
  3362. arsty[k] = {
  3363. fieldKey: k,
  3364. value: data[k],
  3365. fieldName: (function () {
  3366. for (let i = 0; i < self.listData.length; i++) {
  3367. if (self.listData[i].fieldKey == k) {
  3368. return self.listData[i].fieldName;
  3369. }
  3370. }
  3371. })(),
  3372. status: 0,
  3373. };
  3374. } else {
  3375. arsty[k] = {
  3376. fieldKey: k,
  3377. value: data[k],
  3378. fieldName: (function () {
  3379. for (let i = 0; i < self.listData.length; i++) {
  3380. if (self.listData[i].fieldKey == k) {
  3381. return self.listData[i].fieldName;
  3382. }
  3383. }
  3384. })(),
  3385. status: 1,
  3386. };
  3387. }
  3388. }
  3389. }
  3390. }
  3391. } else {
  3392. var arsty = {};
  3393. for (let k in data) {
  3394. arsty[k] = {
  3395. fieldKey: k,
  3396. value: data[k],
  3397. fieldName: (function () {
  3398. for (let i = 0; i < self.listData.length; i++) {
  3399. if (self.listData[i].fieldKey == k) {
  3400. return self.listData[i].fieldName;
  3401. }
  3402. }
  3403. })(),
  3404. status: 0,
  3405. };
  3406. }
  3407. }
  3408. console.log(arsty, "arsty");
  3409. this.$request
  3410. .baseProfileStampV2AddWord({
  3411. goodsId: this.goodsId,
  3412. keyValue: JSON.stringify(arsty),
  3413. })
  3414. .then((res) => {
  3415. let url = this.$tools.splitImgHost(res.msg);
  3416. let name = res.msg.substring(res.msg.lastIndexOf("/") + 1);
  3417. let image = new Image();
  3418. // 解决跨域 Canvas 污染问题,
  3419. image.setAttribute("crossorigin", "anonymous");
  3420. image.onload = function () {
  3421. var canvas = document.createElement("canvas");
  3422. canvas.width = image.width;
  3423. canvas.height = image.height;
  3424. var context = canvas.getContext("2d");
  3425. context.drawImage(image, 0, 0, image.width, image.height);
  3426. var base64 = canvas.toDataURL("image/jpg"); //将图片格式转为base64
  3427. var a = document.createElement("a"); // 生成一个a元素
  3428. var event = new MouseEvent("click"); // 创建一个单击事件
  3429. a.download = name; // 设置图片名称
  3430. console.log(base64);
  3431. a.href = base64; // 将生成的URL设置为a.href属性
  3432. a.dispatchEvent(event); // 触发a的单击事件
  3433. };
  3434. image.src = url + "?time=" + Date.now(); //注意,这里是灵魂,否则依旧会产生跨域问题
  3435. });
  3436. },
  3437. convertBase64UrlToBlob(urlData) {
  3438. var localData = urlData; //dataUrl为base64位
  3439. let base = atob(localData.substring(localData.indexOf(",") + 1)); // base是将base64编码解码,去掉data:image/png;base64部分
  3440. let length = base.length;
  3441. let url = new Uint8Array(length);
  3442. while (length--) {
  3443. url[length] = base.charCodeAt(length);
  3444. }
  3445. let file = new File([url], "a.jpg", {
  3446. type: "image/jpg",
  3447. });
  3448. //最后将file,通过ajax请求做为参数传给服务器就可以了
  3449. return file;
  3450. },
  3451. async uploadDatas(data) {
  3452. if (this.infoForm.recent_photos && this.infoForm.idcard_face_photo) {
  3453. let base = await this.$tools.imageToBase64(
  3454. this.$tools.splitImgHost(this.infoForm.idcard_face_photo)
  3455. );
  3456. console.log(base);
  3457. console.log(this.$tools.splitImgHost(this.infoForm.idcard_face_photo));
  3458. let resData = await this.$request.faceCertificationIDCardOCR({
  3459. cardSide: 1, //1人像 2 国徽
  3460. cardImageBase64: base,
  3461. gradeId: this.gradeId,
  3462. });
  3463. if (!resData.data) {
  3464. this.$message.warning("身份证人像面照片异常,请重新上传");
  3465. this.uploading = false;
  3466. return;
  3467. }
  3468. this.veryIdCard = resData.data.IdNum;
  3469. this.veryIdName = resData.data.IdName;
  3470. // if (this.infoForm.idcard) {
  3471. // if (this.infoForm.idcard != this.veryIdCard) {
  3472. // this.$message.warning(
  3473. // "输入的身份证号和身份证人像面照片身份证号不匹配"
  3474. // );
  3475. // this.uploading = false;
  3476. // return;
  3477. // }
  3478. // }
  3479. let base64 = await this.$tools.imageToBase64(
  3480. this.$tools.splitImgHost(this.infoForm.recent_photos)
  3481. );
  3482. let newData = {
  3483. urlA: this.infoForm.idcard_face_photo,
  3484. oneInchPhotos: base64,
  3485. };
  3486. this.$request
  3487. .faceCertificationIdCardCompareFace(newData)
  3488. .then((res1) => {
  3489. if (res1.data >= 70) {
  3490. var self = this;
  3491. if (self.remarkStatus) {
  3492. var arsty = {};
  3493. for (let k in data) {
  3494. for (let j in self.copyData) {
  3495. if (k === j) {
  3496. if (self.copyData[j].value === data[k]) {
  3497. arsty[k] = {
  3498. fieldKey: k,
  3499. value: data[k],
  3500. fieldName: (function () {
  3501. for (let i = 0; i < self.listData.length; i++) {
  3502. if (self.listData[i].fieldKey == k) {
  3503. return self.listData[i].fieldName;
  3504. }
  3505. }
  3506. })(),
  3507. status: 0,
  3508. };
  3509. } else {
  3510. arsty[k] = {
  3511. fieldKey: k,
  3512. value: data[k],
  3513. fieldName: (function () {
  3514. for (let i = 0; i < self.listData.length; i++) {
  3515. if (self.listData[i].fieldKey == k) {
  3516. return self.listData[i].fieldName;
  3517. }
  3518. }
  3519. })(),
  3520. status: 1,
  3521. };
  3522. }
  3523. }
  3524. }
  3525. }
  3526. var datas = {
  3527. id: this.id,
  3528. goodsId: this.goodsId,
  3529. orderGoodsId: this.orderGoodsId,
  3530. keyValue: JSON.stringify(arsty),
  3531. };
  3532. this.$request
  3533. .editbaseprofiletp(datas)
  3534. .then((res) => {
  3535. this.uploading = false;
  3536. this.courseCourseList();
  3537. this.$message.success("提交成功");
  3538. this.showInfoDetailModal = false;
  3539. })
  3540. .catch((err) => {
  3541. this.$message.warning(err.msg);
  3542. this.uploading = false;
  3543. });
  3544. } else {
  3545. var objs = {};
  3546. for (let k in data) {
  3547. objs[k] = {
  3548. fieldKey: k,
  3549. value: data[k],
  3550. fieldName: (function () {
  3551. for (let i = 0; i < self.listData.length; i++) {
  3552. if (self.listData[i].fieldKey == k) {
  3553. return self.listData[i].fieldName;
  3554. }
  3555. }
  3556. })(),
  3557. status: 0,
  3558. };
  3559. }
  3560. var datas = {
  3561. goodsId: this.goodsId,
  3562. profileTpId: this.goodsId,
  3563. orderGoodsId: this.orderGoodsId,
  3564. keyValue: JSON.stringify(objs),
  3565. };
  3566. this.$request
  3567. .addbaseprofiletp(datas)
  3568. .then((res) => {
  3569. this.uploading = false;
  3570. this.courseCourseList();
  3571. this.$message.success("提交成功");
  3572. this.showInfoDetailModal = false;
  3573. })
  3574. .catch((err) => {
  3575. this.$message.warning(err.msg);
  3576. this.uploading = false;
  3577. });
  3578. }
  3579. } else {
  3580. this.uploading = false;
  3581. this.$message.warning("证件照和身份证人像面照片不匹配");
  3582. }
  3583. })
  3584. .catch((err) => {
  3585. this.uploading = false;
  3586. this.$message.warning(err.msg);
  3587. });
  3588. return;
  3589. }
  3590. var self = this;
  3591. if (self.remarkStatus) {
  3592. var arsty = {};
  3593. for (let k in data) {
  3594. for (let j in self.copyData) {
  3595. if (k === j) {
  3596. if (self.copyData[j].value === data[k]) {
  3597. arsty[k] = {
  3598. fieldKey: k,
  3599. value: data[k],
  3600. fieldName: (function () {
  3601. for (let i = 0; i < self.listData.length; i++) {
  3602. if (self.listData[i].fieldKey == k) {
  3603. return self.listData[i].fieldName;
  3604. }
  3605. }
  3606. })(),
  3607. status: 0,
  3608. };
  3609. } else {
  3610. arsty[k] = {
  3611. fieldKey: k,
  3612. value: data[k],
  3613. fieldName: (function () {
  3614. for (let i = 0; i < self.listData.length; i++) {
  3615. if (self.listData[i].fieldKey == k) {
  3616. return self.listData[i].fieldName;
  3617. }
  3618. }
  3619. })(),
  3620. status: 1,
  3621. };
  3622. }
  3623. }
  3624. }
  3625. }
  3626. var datas = {
  3627. id: this.id,
  3628. goodsId: this.goodsId,
  3629. orderGoodsId: this.orderGoodsId,
  3630. keyValue: JSON.stringify(arsty),
  3631. };
  3632. this.$request
  3633. .editbaseprofiletp(datas)
  3634. .then((res) => {
  3635. this.uploading = false;
  3636. this.courseCourseList();
  3637. this.$message.success("提交成功");
  3638. this.showInfoDetailModal = false;
  3639. })
  3640. .catch((err) => {
  3641. this.$message.warning(err.msg);
  3642. this.uploading = false;
  3643. });
  3644. } else {
  3645. var objs = {};
  3646. for (let k in data) {
  3647. objs[k] = {
  3648. fieldKey: k,
  3649. value: data[k],
  3650. fieldName: (function () {
  3651. for (let i = 0; i < self.listData.length; i++) {
  3652. if (self.listData[i].fieldKey == k) {
  3653. return self.listData[i].fieldName;
  3654. }
  3655. }
  3656. })(),
  3657. status: 0,
  3658. };
  3659. }
  3660. var datas = {
  3661. goodsId: this.goodsId,
  3662. profileTpId: this.goodsId,
  3663. orderGoodsId: this.orderGoodsId,
  3664. keyValue: JSON.stringify(objs),
  3665. };
  3666. this.$request
  3667. .addbaseprofiletp(datas)
  3668. .then((res) => {
  3669. this.uploading = false;
  3670. this.courseCourseList();
  3671. this.$message.success("提交成功");
  3672. this.showInfoDetailModal = false;
  3673. })
  3674. .catch((err) => {
  3675. this.$message.warning(err.msg);
  3676. this.uploading = false;
  3677. });
  3678. }
  3679. },
  3680. subCanvas() {
  3681. return new Promise((resolve, reject) => {
  3682. var self = this;
  3683. if (self.infoForm.commitment_electr_signature) {
  3684. resolve();
  3685. return;
  3686. }
  3687. this.$refs.esign[0]
  3688. .generate() // 使用生成器调用把签字的图片转换成为base64图片格式
  3689. .then(async (res) => {
  3690. let url = await this.$upload.upload(
  3691. this.convertBase64UrlToBlob(res),
  3692. 0
  3693. );
  3694. this.$set(this.infoForm, "commitment_electr_signature", url);
  3695. resolve();
  3696. })
  3697. .catch((err) => {
  3698. console.log(err, "err");
  3699. // 画布没有签字时会执行这里提示一下
  3700. // this.uploading = false;
  3701. // this.$message({
  3702. // type: "warning",
  3703. // message: "请签名后再生成签字图片",
  3704. // });
  3705. resolve();
  3706. });
  3707. });
  3708. },
  3709. imageInfos() {
  3710. var self = this;
  3711. return new Promise(async (resolve, reject) => {
  3712. const waitUpload = await self.uploadFile(self.faceUrl, 0);
  3713. resolve(waitUpload);
  3714. });
  3715. },
  3716. getarrays(key) {
  3717. if (key === "sex") {
  3718. return this.dictObj["sys_user_sex"];
  3719. }
  3720. if (key === "education") {
  3721. return this.dictObj["edu_level"];
  3722. }
  3723. if (key === "working_years") {
  3724. return this.dictObj["working_years"];
  3725. }
  3726. },
  3727. dictList() {
  3728. this.$request.dictList().then((res) => {
  3729. if (res.code === 200) {
  3730. let newList = {};
  3731. let list = res.data;
  3732. for (let i = 0; i < list.length; i++) {
  3733. let item = list[i];
  3734. if (newList.hasOwnProperty(item.dictType)) {
  3735. newList[item.dictType].push(item.dictLabel);
  3736. } else {
  3737. newList[item.dictType] = [item.dictLabel];
  3738. }
  3739. }
  3740. this.dictObj = newList;
  3741. }
  3742. });
  3743. },
  3744. getbaseprofiletplists() {
  3745. return new Promise((resolve) => {
  3746. let self = this;
  3747. this.$request
  3748. .getbaseprofiletplists({
  3749. goodsId: this.goodsId,
  3750. orderGoodsId: this.orderGoodsId || "",
  3751. })
  3752. .then((res) => {
  3753. if (res.code === 200 && res.rows.length) {
  3754. console.log(1);
  3755. if (res.rows[0].keyValue) {
  3756. console.log(2);
  3757. self.$request
  3758. .getbaseprofiletpId(self.goodsId)
  3759. .then((baseRes) => {
  3760. if (baseRes.code === 200) {
  3761. console.log(3);
  3762. if (baseRes.data) {
  3763. console.log(4);
  3764. self.$request
  3765. .getbaseprofiletpgetInfo({
  3766. goodsId: self.goodsId,
  3767. orderGoodsId: self.orderGoodsId,
  3768. })
  3769. .then((result) => {
  3770. console.log(result, "result");
  3771. if (result.code === 200) {
  3772. if (
  3773. !result.data ||
  3774. (result.data.status === 3 &&
  3775. result.data.changeStatus === 1)
  3776. ) {
  3777. console.log(5);
  3778. if (!result.data) {
  3779. console.log(6);
  3780. self.needProfileModal = true;
  3781. this.$confirm(`请填写资料`, "提示", {
  3782. confirmButtonText: "确定",
  3783. cancelButtonText: "返回",
  3784. closeOnClickModal: false,
  3785. closeOnPressEscape: false,
  3786. distinguishCancelAndClose: false,
  3787. showClose: false,
  3788. })
  3789. .then((_) => {
  3790. this.showInfoDetailModal = true;
  3791. this.getInfo();
  3792. })
  3793. .catch((_) => {
  3794. this.$router.back(-1);
  3795. });
  3796. } else {
  3797. this.$confirm(
  3798. `资料审核不通过,请前往重新填写`,
  3799. "提示",
  3800. {
  3801. confirmButtonText: "确定",
  3802. cancelButtonText: "返回",
  3803. closeOnClickModal: false,
  3804. closeOnPressEscape: false,
  3805. distinguishCancelAndClose: false,
  3806. showClose: false,
  3807. }
  3808. )
  3809. .then((_) => {
  3810. this.showInfoDetailModal = true;
  3811. this.getInfo();
  3812. })
  3813. .catch((_) => {
  3814. this.$router.back(-1);
  3815. });
  3816. }
  3817. } else if (
  3818. result.data.status === 1 &&
  3819. JSON.parse(res.rows[0].keyValue2)[0]
  3820. ) {
  3821. console.log(8);
  3822. self.$request
  3823. .getbaseprofileStampgetInfo({
  3824. goodsId: self.goodsId,
  3825. orderGoodsId: self.orderGoodsId,
  3826. })
  3827. .then((k) => {
  3828. if (k.code === 200) {
  3829. if (
  3830. !k.data ||
  3831. (k.data.status === 3 &&
  3832. k.data.changeStatus === 1)
  3833. ) {
  3834. if (!k.data) {
  3835. console.log(9);
  3836. this.$confirm(
  3837. `请前往填写盖章资料`,
  3838. "提示",
  3839. {
  3840. confirmButtonText: "确定",
  3841. cancelButtonText: "返回",
  3842. closeOnClickModal: false,
  3843. closeOnPressEscape: false,
  3844. distinguishCancelAndClose: false,
  3845. showClose: false,
  3846. }
  3847. )
  3848. .then((_) => {
  3849. this.showStampDetailModail = true;
  3850. this.getInfoStamp();
  3851. })
  3852. .catch((_) => {
  3853. this.$router.back(-1);
  3854. });
  3855. } else {
  3856. console.log(10);
  3857. self.needProfileModal = true;
  3858. this.$confirm(
  3859. `资料盖章审核不通过,请前往重新填写`,
  3860. "提示",
  3861. {
  3862. confirmButtonText: "确定",
  3863. cancelButtonText: "返回",
  3864. closeOnClickModal: false,
  3865. closeOnPressEscape: false,
  3866. distinguishCancelAndClose: false,
  3867. showClose: false,
  3868. }
  3869. )
  3870. .then((_) => {
  3871. this.showStampDetailModail = true;
  3872. this.getInfoStamp();
  3873. })
  3874. .catch((_) => {
  3875. this.$router.back(-1);
  3876. });
  3877. }
  3878. } else {
  3879. resolve();
  3880. }
  3881. }
  3882. });
  3883. } else {
  3884. resolve();
  3885. }
  3886. }
  3887. });
  3888. } else {
  3889. resolve();
  3890. }
  3891. }
  3892. });
  3893. } else {
  3894. resolve();
  3895. }
  3896. } else {
  3897. resolve();
  3898. }
  3899. });
  3900. if (this.gradeId > 0) {
  3901. //提交完资料返回判断是否已开班
  3902. this.getGradeInfo();
  3903. }
  3904. });
  3905. },
  3906. getInfoStamp() {
  3907. var self = this;
  3908. this.$request.getbaseprofiletpId(this.goodsId).then((res) => {
  3909. var ast = JSON.parse(res.data.keyValue2);
  3910. self.listDataStamp = ast;
  3911. self.$request
  3912. .getbaseprofileStampgetInfo({
  3913. goodsId: self.goodsId,
  3914. orderGoodsId: self.orderGoodsId,
  3915. })
  3916. .then((result) => {
  3917. if (result.data && result.data.status === 3) {
  3918. self.remarkStamp = result.data.text;
  3919. self.remarkStatusStamp = true;
  3920. self.id = result.data.id;
  3921. } else if (
  3922. result.data &&
  3923. (result.data.status === 1 || result.data.status === 2)
  3924. ) {
  3925. // uni.showModal({
  3926. // showCancel: false,
  3927. // content:
  3928. // result.data.status === 1
  3929. // ? "该商品审核资料已通过,不可重复提交资料"
  3930. // : result.data.status === 2
  3931. // ? "该商品审核资料处于待审核状态,不可重复提交资料"
  3932. // : "请联系管理员",
  3933. // success: function (k) {
  3934. // if (k.confirm) {
  3935. // uni.navigateBack();
  3936. // }
  3937. // },
  3938. // });
  3939. }
  3940. })
  3941. .catch((err) => {});
  3942. });
  3943. },
  3944. getGradeInfo() {
  3945. let self = this;
  3946. this.$request.goodsGradeInfo(this.gradeId).then((res) => {
  3947. if (res.code == 200) {
  3948. self.gradeDetail = res.data;
  3949. if (self.needProfileModal) {
  3950. return;
  3951. }
  3952. if (self.gradeDetail.learningStatus == 2) {
  3953. this.$confirm(
  3954. `当前课程正在申请中,正式开班后方可进行学习,请耐心等候!`,
  3955. "提示",
  3956. {
  3957. confirmButtonText: "确定",
  3958. closeOnClickModal: false,
  3959. closeOnPressEscape: false,
  3960. showCancelButton: false,
  3961. distinguishCancelAndClose: false,
  3962. showClose: false,
  3963. }
  3964. )
  3965. .then((_) => {
  3966. this.$router.back(-1);
  3967. })
  3968. .catch((_) => {});
  3969. }
  3970. if (
  3971. self.gradeDetail.learningStatus == 3 &&
  3972. Number(self.gradeDetail.learningTimeStart) >
  3973. Number(new Date() / 1000)
  3974. ) {
  3975. this.$confirm(
  3976. `当前课程正在申请中,正式开班后方可进行学习,请耐心等候!`,
  3977. "提示",
  3978. {
  3979. confirmButtonText: "返回",
  3980. closeOnClickModal: false,
  3981. closeOnPressEscape: false,
  3982. showCancelButton: false,
  3983. distinguishCancelAndClose: false,
  3984. showClose: false,
  3985. }
  3986. )
  3987. .then((_) => {
  3988. this.$router.back(-1);
  3989. })
  3990. .catch((_) => {});
  3991. }
  3992. }
  3993. });
  3994. this.$store.state.allowLoading = true;
  3995. },
  3996. deleteImg(item) {
  3997. if (item.fieldKey == "recent_photos") {
  3998. this.fileList1 = [];
  3999. this.infoForm["recent_photos"] = "";
  4000. } else if (item.fieldKey == "idcard_face_photo") {
  4001. this.fileList2 = [];
  4002. this.infoForm["idcard_face_photo"] = "";
  4003. } else if (item.fieldKey == "idcard_national_photo") {
  4004. this.fileList3 = [];
  4005. this.infoForm["idcard_national_photo"] = "";
  4006. }
  4007. },
  4008. /**
  4009. * getbaseprofiletpgetInfo接口返回值result.data.data不存在的话说明是第一次填写资料
  4010. */
  4011. getInfo() {
  4012. var self = this;
  4013. this.$request.getbaseprofiletpId(this.goodsId).then((res) => {
  4014. console.log(res, "res");
  4015. var listData = JSON.parse(res.data.keyValue);
  4016. var ast = JSON.parse(res.data.keyValue2);
  4017. self.listData = [...listData, ...ast];
  4018. console.log(self.listData, "self.listData");
  4019. self.listData.forEach((item) => {
  4020. if (item.fieldKey == "idcard") {
  4021. this.infoForm.idcard = this.userInfo.idCard;
  4022. this.disCard = this.infoForm.idcard ? true : false;
  4023. }
  4024. if (item.fieldKey == "telphone") {
  4025. this.infoForm.telphone = this.userInfo.telphone;
  4026. }
  4027. if (item.fieldKey == "name") {
  4028. this.infoForm.name = this.userInfo.realname || "";
  4029. this.disName = this.infoForm.name ? true : false;
  4030. }
  4031. });
  4032. self.isRequired = self.listData.every((ims) => {
  4033. return ims.required === false;
  4034. });
  4035. this.$nextTick(() => {
  4036. this.agreementModal = true;
  4037. });
  4038. self.$request
  4039. .getbaseprofiletpgetInfo({
  4040. goodsId: this.goodsId,
  4041. orderGoodsId: this.orderGoodsId,
  4042. })
  4043. .then((result) => {
  4044. if (result.code === 200) {
  4045. if (!result.data) {
  4046. self.$request
  4047. .getbaseprofiletplistProfile({
  4048. pageNum: 1,
  4049. pageSize: 1,
  4050. status: 1,
  4051. })
  4052. .then((kit) => {
  4053. if (kit.rows.length) {
  4054. var ajson = JSON.parse(kit.rows[0].keyValue);
  4055. self.listData.forEach((zyitem, zyindex) => {
  4056. for (let k in ajson) {
  4057. if (zyitem.fieldKey == k && ajson[k].value) {
  4058. if (k === "sex") {
  4059. const sexIndex =
  4060. self.dictObj["sys_user_sex"].indexOf(
  4061. ajson[k].value
  4062. ) + "";
  4063. self.$set(self.infoForm, k, sexIndex);
  4064. } else if (k === "education") {
  4065. const sexIndex =
  4066. self.dictObj["edu_level"].indexOf(
  4067. ajson[k].value
  4068. ) + "";
  4069. self.$set(self.infoForm, k, sexIndex);
  4070. } else if (k === "working_years") {
  4071. const sexIndex =
  4072. self.dictObj["working_years"].indexOf(
  4073. ajson[k].value
  4074. ) + "";
  4075. self.$set(self.infoForm, k, sexIndex);
  4076. } else if (k === "recent_photos") {
  4077. self.$set(self.infoForm, k, ajson[k].value);
  4078. if (ajson[k].value) {
  4079. self.fileList1 = [
  4080. {
  4081. url: ajson[k].value,
  4082. },
  4083. ];
  4084. }
  4085. } else if (k === "idcard_face_photo") {
  4086. self.$set(self.infoForm, k, ajson[k].value);
  4087. if (ajson[k].value) {
  4088. self.fileList2 = [
  4089. {
  4090. url: ajson[k].value,
  4091. },
  4092. ];
  4093. }
  4094. } else if (k === "idcard_national_photo") {
  4095. self.$set(self.infoForm, k, ajson[k].value);
  4096. if (ajson[k].value) {
  4097. self.fileList3 = [
  4098. {
  4099. url: ajson[k].value,
  4100. },
  4101. ];
  4102. }
  4103. } else {
  4104. if (k === "name") {
  4105. self.$set(
  4106. self.infoForm,
  4107. k,
  4108. this.$store.state.userInfo.realname
  4109. );
  4110. } else if (k === "idcard") {
  4111. self.$set(
  4112. self.infoForm,
  4113. k,
  4114. this.$store.state.userInfo.idCard
  4115. );
  4116. } else if (k === "telphone") {
  4117. self.$set(
  4118. self.infoForm,
  4119. k,
  4120. this.$store.state.userInfo.telphone
  4121. );
  4122. } else if (k !== "commitment_electr_signature") {
  4123. self.$set(self.infoForm, k, ajson[k].value);
  4124. }
  4125. }
  4126. }
  4127. }
  4128. });
  4129. }
  4130. });
  4131. }
  4132. if (result.data && result.data.status === 3) {
  4133. self.remark = result.data.text;
  4134. self.remarkStatus = true;
  4135. self.id = result.data.id;
  4136. var arrays = JSON.parse(result.data.keyValue);
  4137. self.copyData = JSON.parse(JSON.stringify(arrays));
  4138. for (let k in arrays) {
  4139. if (k === "sex") {
  4140. if (arrays[k].value) {
  4141. const sexIndex =
  4142. self.dictObj["sys_user_sex"].indexOf(arrays[k].value) +
  4143. "";
  4144. self.$set(self.infoForm, k, sexIndex);
  4145. }
  4146. } else if (k === "education") {
  4147. if (arrays[k].value) {
  4148. const sexIndex =
  4149. self.dictObj["edu_level"].indexOf(arrays[k].value) + "";
  4150. self.$set(self.infoForm, k, sexIndex);
  4151. }
  4152. } else if (k === "working_years") {
  4153. if (arrays[k].value) {
  4154. const sexIndex =
  4155. self.dictObj["working_years"].indexOf(arrays[k].value) +
  4156. "";
  4157. self.$set(self.infoForm, k, sexIndex);
  4158. }
  4159. } else if (k === "recent_photos") {
  4160. self.$set(self.infoForm, k, arrays[k].value);
  4161. if (arrays[k].value) {
  4162. self.fileList1 = [{ url: arrays[k].value }];
  4163. }
  4164. } else if (k === "idcard_face_photo") {
  4165. self.$set(self.infoForm, k, arrays[k].value);
  4166. if (arrays[k].value) {
  4167. self.fileList2 = [{ url: arrays[k].value }];
  4168. }
  4169. } else if (k === "idcard_national_photo") {
  4170. self.$set(self.infoForm, k, arrays[k].value);
  4171. if (arrays[k].value) {
  4172. self.fileList3 = [{ url: arrays[k].value }];
  4173. }
  4174. } else {
  4175. self.$set(self.infoForm, k, arrays[k].value);
  4176. }
  4177. }
  4178. } else if (
  4179. result.data &&
  4180. (result.data.status === 1 || result.data.status === 2)
  4181. ) {
  4182. this.$confirm(
  4183. result.data.status === 1
  4184. ? "该商品审核资料已通过,不可重复提交资料"
  4185. : result.data.status === 2
  4186. ? "该商品审核资料处于待审核状态,不可重复提交资料"
  4187. : "请联系管理员",
  4188. "提示",
  4189. {
  4190. confirmButtonText: "返回",
  4191. closeOnClickModal: false,
  4192. closeOnPressEscape: false,
  4193. showCancelButton: false,
  4194. distinguishCancelAndClose: false,
  4195. showClose: false,
  4196. }
  4197. )
  4198. .then((_) => {
  4199. this.$router.back(-1);
  4200. })
  4201. .catch((_) => {});
  4202. }
  4203. }
  4204. });
  4205. });
  4206. },
  4207. returnName(key) {
  4208. if (key === "sex") {
  4209. if (this.infoForm[key]) {
  4210. return this.dictObj["sys_user_sex"][Number(this.infoForm[key])];
  4211. } else {
  4212. return "请选择性别";
  4213. }
  4214. }
  4215. if (key === "education") {
  4216. if (this.infoForm[key]) {
  4217. return this.dictObj["edu_level"][Number(this.infoForm[key])];
  4218. } else {
  4219. return "请选择学历";
  4220. }
  4221. }
  4222. if (key === "working_years") {
  4223. if (this.infoForm[key]) {
  4224. return this.dictObj["working_years"][Number(this.infoForm[key])];
  4225. } else {
  4226. return "请选择工作年限";
  4227. }
  4228. }
  4229. },
  4230. retDraw() {
  4231. this.$set(this.infoForm, "commitment_electr_signature", "");
  4232. this.$nextTick(() => {
  4233. this.$refs.esign[0].reset();
  4234. });
  4235. },
  4236. uploadFile(options, int) {
  4237. var self = this;
  4238. return new Promise((resolve, reject) => {
  4239. var data = {
  4240. imageStatus: int,
  4241. gradeId: this.gradeId,
  4242. orderGoodsId: this.orderGoodsId,
  4243. };
  4244. self.$request
  4245. .getPolicy(data)
  4246. .then((res) => {
  4247. var ossToken = res.data.resultContent;
  4248. if (ossToken.host == null || ossToken.host == undefined) {
  4249. this.$message({
  4250. type: "warning",
  4251. message: "上传路径报错" + JSON.stringify(res.data),
  4252. });
  4253. return;
  4254. }
  4255. let data = this.$tools.convertBase64UrlToBlob(this.faceUrl);
  4256. this.$upload
  4257. .upload(data, 0)
  4258. .then((res) => {
  4259. this.ossAvatarUrl = res;
  4260. resolve(res);
  4261. })
  4262. .catch((err) => {
  4263. this.$message({
  4264. type: "warning",
  4265. message: "上传接口报错,请重新拍照上传",
  4266. });
  4267. this.reTake();
  4268. });
  4269. })
  4270. .catch((err) => {
  4271. this.$message({
  4272. type: "warning",
  4273. message: "签名错误" + JSON.stringify(err),
  4274. });
  4275. return;
  4276. });
  4277. });
  4278. },
  4279. faceRecognition() {
  4280. return new Promise((resolve) => {
  4281. this.$request
  4282. .faceCertificationCompareFace({
  4283. imageA: this.faceUrl,
  4284. orderGoodsId: this.orderGoodsId,
  4285. gradeId: this.gradeId,
  4286. })
  4287. .then((res) => {
  4288. resolve(res.data);
  4289. })
  4290. .catch((err) => {
  4291. this.loading = false;
  4292. if(err.toString().indexOf('timeout')!=-1){
  4293. err = {
  4294. msg:'拍照超时,请重新拍照'
  4295. }
  4296. }
  4297. this.$message({
  4298. type: "warning",
  4299. message: err.msg,
  4300. });
  4301. });
  4302. });
  4303. },
  4304. /**
  4305. * 点击重拍
  4306. */
  4307. reTake() {
  4308. this.faceUrl = "";
  4309. this.isTaking = true;
  4310. this.getUserMedia({
  4311. video: {
  4312. width: 400,
  4313. height: 400,
  4314. },
  4315. });
  4316. },
  4317. // 点击拍照按钮
  4318. onPhoto() {
  4319. // if (this.isIE) {
  4320. // window.webcam.capture();
  4321. // } else {
  4322. const canvas = document.createElement("canvas");
  4323. canvas.width = 400;
  4324. canvas.height = 400;
  4325. const context = canvas.getContext("2d");
  4326. const video = document.getElementById("video");
  4327. context.drawImage(video, 0, 0, 400, 400);
  4328. this.faceUrl = canvas.toDataURL("image/png");
  4329. this.isTaking = false;
  4330. // }
  4331. },
  4332. getUserMedia(constraints, success, error) {
  4333. if (window.navigator.mediaDevices.getUserMedia) {
  4334. // 最新的标准API
  4335. window.navigator.mediaDevices
  4336. .getUserMedia(constraints)
  4337. .then(success)
  4338. .catch(error);
  4339. } else if (window.navigator.webkitGetUserMedia) {
  4340. // webkit核心浏览器
  4341. window.navigator.webkitGetUserMedia(constraints, success, error);
  4342. } else if (window.navigator.mozGetUserMedia) {
  4343. // firfox浏览器
  4344. window.navigator.mozGetUserMedia(constraints, success, error);
  4345. } else if (window.navigator.getUserMedia) {
  4346. // 旧版API
  4347. window.navigator.getUserMedia(constraints, success, error);
  4348. }
  4349. },
  4350. photographSuccess(stream) {
  4351. // 兼容webkit核心浏览器
  4352. if (this.isVirtualCamera(stream)) {
  4353. return
  4354. }
  4355. this.isTaking = true;
  4356. this.takePhotoModal = true;
  4357. this.$nextTick(() => {
  4358. const video = document.getElementById("video");
  4359. // 将视频流设置为video元素的源
  4360. console.dir(video);
  4361. video.srcObject = stream;
  4362. this.mediaStreamTrack =
  4363. typeof stream.stop === "function" ? stream : stream.getTracks()[0];
  4364. video.play();
  4365. });
  4366. },
  4367. photographError(err) {
  4368. this.$confirm(
  4369. "课程学习需要开启摄像头进行拍照,经检测您的设备无摄像头可使用,请检测环境是否支持。",
  4370. "提示",
  4371. {
  4372. confirmButtonText: "返回",
  4373. showConfirmButton: true,
  4374. closeOnClickModal: false,
  4375. showCancelButton: false,
  4376. closeOnPressEscape: false,
  4377. distinguishCancelAndClose: false,
  4378. showClose: false,
  4379. }
  4380. ).then(() => {
  4381. this.$router.go(-1);
  4382. });
  4383. },
  4384. isVirtualCamera(stream) {
  4385. const list = ['VCam', 'ManyCam', 'OBS', 'ClassInCam', 'Ev', 'Video2Webcam']
  4386. let isT = list.some(e => {
  4387. return stream.getTracks()[0].label.indexOf(e) != -1
  4388. })
  4389. if (isT) {
  4390. this.$confirm(
  4391. "检测到你使用虚拟摄像头,无法继续学习。",
  4392. "提示",
  4393. {
  4394. confirmButtonText: "返回",
  4395. showConfirmButton: true,
  4396. closeOnClickModal: false,
  4397. showCancelButton: false,
  4398. closeOnPressEscape: false,
  4399. distinguishCancelAndClose: false,
  4400. showClose: false,
  4401. }
  4402. ).then(() => {
  4403. this.$router.go(-1);
  4404. });
  4405. }
  4406. return isT
  4407. },
  4408. /**
  4409. * 切换科目
  4410. */
  4411. courseChange() {
  4412. return new Promise((resolve) => {
  4413. this.noteParams = {
  4414. pageNum: 1,
  4415. // pageSize: 4,
  4416. };
  4417. this.duration = 0;
  4418. this.playSectionId = 0;
  4419. this.vid = "";
  4420. if (this.player) {
  4421. this.player.destroy();
  4422. }
  4423. this.player = "";
  4424. if (this.playerzb) {
  4425. this.playerzb.destroy();
  4426. }
  4427. this.playerzb = "";
  4428. this.vidzb = "";
  4429. this.historyChatMsgList = [];
  4430. this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
  4431. this.courseDetail(); //课程详情
  4432. this.getGoodsDetail(); //商品详情
  4433. this.getAnswerList(); //答疑列表
  4434. // this.answerTimer = setInterval(() => {
  4435. // this.getAnswerList();
  4436. // }, 5000);
  4437. this.getMenuList(); //学习目录
  4438. // this.getReMenuList(); //获取重修目录
  4439. this.getNoteList(); //获取节笔记
  4440. resolve();
  4441. });
  4442. },
  4443. polyvLiveHistoryChatMsgList() {
  4444. // /polyv/live/historyChatMsgList-查询保利威节聊天历史
  4445. this.$request
  4446. .polyvLiveHistoryChatMsgList({
  4447. sectionId: this.playSectionId,
  4448. channelId: this.sectionItem.liveUrl,
  4449. })
  4450. .then((res) => {
  4451. this.historyChatMsgList = res.data;
  4452. });
  4453. },
  4454. courseDetail() {
  4455. let self = this;
  4456. this.$request.courseDetail(this.courseId).then((res) => {
  4457. // if (res.data.educationName == "继续教育") {
  4458. // this.$request
  4459. // .lockLockAction({
  4460. // action: "jxjy",
  4461. // })
  4462. // .then((res) => {});
  4463. // this.lockTimer = setInterval(() => {
  4464. // this.$request
  4465. // .lockLockAction({
  4466. // action: "jxjy",
  4467. // })
  4468. // .then((res) => {});
  4469. // }, 10000);
  4470. // }
  4471. self.detail = res.data;
  4472. });
  4473. },
  4474. openModule(menuItem) {
  4475. //重修目录点击
  4476. console.log(menuItem.list);
  4477. menuItem.showList = !menuItem.showList;
  4478. if (!menuItem.list.length) {
  4479. if (menuItem.isRebuild) {
  4480. this.getReChapterList(menuItem.id, menuItem.courseId, menuItem);
  4481. } else {
  4482. this.getBuyChapterList(menuItem.id, menuItem.courseId, menuItem);
  4483. }
  4484. }
  4485. },
  4486. getReChapterList(moduleId, courseId, menuItem) {
  4487. this.$request
  4488. .reChapterList({
  4489. moduleId: moduleId,
  4490. gradeId: this.gradeId,
  4491. courseId: courseId,
  4492. rebuild: 1,
  4493. })
  4494. .then((res) => {
  4495. for (let i = 0; i < res.data.length; i++) {
  4496. let item = res.data[i];
  4497. item.id = item.chapterId;
  4498. item.showList = false;
  4499. item.list = [];
  4500. item.parent = menuItem;
  4501. item.isRebuild = 1;
  4502. }
  4503. menuItem.list = res.data;
  4504. });
  4505. },
  4506. getBuyChapterList(moduleId, courseId, menuItem) {
  4507. this.$request
  4508. .reChapterList({
  4509. moduleId: moduleId,
  4510. gradeId: this.gradeId,
  4511. courseId: courseId,
  4512. })
  4513. .then((res) => {
  4514. for (let i = 0; i < res.data.length; i++) {
  4515. let item = res.data[i];
  4516. item.id = item.chapterId;
  4517. item.menuType = 2;
  4518. item.showList = false;
  4519. item.list = [];
  4520. item.parent = menuItem;
  4521. }
  4522. menuItem.list = res.data;
  4523. if (this.needOpen) {
  4524. // this.needOpen = false;
  4525. this.openChapter(menuItem.list[0]);
  4526. }
  4527. });
  4528. },
  4529. openChapter(chapter) {
  4530. console.log(chapter, "chapter");
  4531. chapter.showList = !chapter.showList;
  4532. if (!chapter.list.length) {
  4533. if (chapter.isRebuild) {
  4534. this.getReSectionList(
  4535. chapter.id,
  4536. chapter.courseId,
  4537. chapter.moduleId || 0,
  4538. chapter
  4539. );
  4540. } else {
  4541. this.getBuySectionList(
  4542. chapter.id,
  4543. chapter.courseId,
  4544. chapter.moduleId || 0,
  4545. chapter
  4546. );
  4547. }
  4548. }
  4549. },
  4550. getReSectionList(chapterId, courseId, moduleId, chapter) {
  4551. this.$request
  4552. .reSectionList({
  4553. chapterId: chapterId,
  4554. gradeId: this.gradeId,
  4555. courseId: courseId,
  4556. rebuild: 1,
  4557. moduleId: moduleId,
  4558. })
  4559. .then((res) => {
  4560. let newArr = res.data.filter((item) => {
  4561. return item.type != 2;
  4562. });
  4563. chapter.canLearn = newArr.every((item) => {
  4564. if (item.learning == 1) {
  4565. return true;
  4566. } else {
  4567. return false;
  4568. }
  4569. });
  4570. res.data.forEach((section) => {
  4571. section.parent = chapter;
  4572. });
  4573. chapter.list = res.data;
  4574. });
  4575. },
  4576. getBuySectionList(chapterId, courseId, moduleId = 0, chapter) {
  4577. this.$request
  4578. .reSectionList({
  4579. chapterId: chapterId,
  4580. gradeId: this.gradeId,
  4581. courseId: courseId,
  4582. moduleId: moduleId,
  4583. })
  4584. .then((res) => {
  4585. let newArr = res.data.filter((item) => {
  4586. return item.type != 2;
  4587. });
  4588. chapter.canLearn = newArr.every((item) => {
  4589. if (item.learning == 1) {
  4590. return true;
  4591. } else {
  4592. return false;
  4593. }
  4594. });
  4595. res.data.forEach((section) => {
  4596. section.parent = chapter;
  4597. });
  4598. chapter.list = res.data;
  4599. if (this.needOpen) {
  4600. this.needOpen = false;
  4601. if (chapter.list && !this.sectionItem.recordingUrl) {
  4602. // this.getResource(chapter.list[0]);
  4603. }
  4604. }
  4605. });
  4606. },
  4607. getGoodsDetail() {
  4608. let self = this;
  4609. this.$request.goodsDetail(this.goodsId).then((res) => {
  4610. self.goodsData = res.data;
  4611. self.gradeId = self.goodsData.gradeId;
  4612. if (this.goodsData.buyNote) {
  4613. this.tabList = [
  4614. { name: "1", label: "学员须知" },
  4615. { name: "2", label: "课程答疑" },
  4616. { name: "3", label: "笔记讲义" },
  4617. { name: "4", label: "聊天" },
  4618. ];
  4619. console.log(res, "res111");
  4620. this.getRecommend();
  4621. } else {
  4622. this.tabList = [
  4623. { name: "1", label: "课程答疑" },
  4624. { name: "2", label: "笔记讲义" },
  4625. { name: "3", label: "聊天" },
  4626. ];
  4627. }
  4628. this.courseBusiness();
  4629. // this.courseHandouts();
  4630. if (self.goodsData.goodsPlayConfig) {
  4631. self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
  4632. if (self.goodsPlayConfig.autoPlay > 0) {
  4633. self.autoplay = true;
  4634. }
  4635. if (self.goodsPlayConfig.drag > 0) {
  4636. self.isAllowSeek = "off";
  4637. }
  4638. if (self.goodsPlayConfig.speed > 0) {
  4639. self.playbackRate = true;
  4640. }
  4641. }
  4642. if (self.goodsData.goodsPhotographConfig) {
  4643. self.goodsPhotographConfig = JSON.parse(
  4644. self.goodsData.goodsPhotographConfig
  4645. );
  4646. if (self.goodsPhotographConfig.photoNum > 0) {
  4647. self.photoNum = self.goodsPhotographConfig.photoNum;
  4648. }
  4649. }
  4650. });
  4651. },
  4652. // 新增用户视频学习日志
  4653. studyLog(moduleId, chapterId, sectionId) {
  4654. this.$axios({
  4655. url: "/user/study/log",
  4656. method: "post",
  4657. data: {
  4658. goodsId: this.goodsId,
  4659. courseId: this.courseId,
  4660. moduleId: moduleId || 0,
  4661. chapterId: chapterId || 0,
  4662. sectionId: sectionId || 0,
  4663. fromPlat: 2, //来源平台 1小程序 2PC网站
  4664. goodsType: 6, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
  4665. orderGoodsId: this.orderGoodsId,
  4666. },
  4667. }).then((res) => {
  4668. console.log("直播的用户学习日志:", res);
  4669. });
  4670. },
  4671. /**
  4672. * 点击节
  4673. */
  4674. async getResource(section) {
  4675. console.log("回放回放", section);
  4676. this.clickSectionItem = section;
  4677. //逻辑
  4678. if (section.type == 2) {
  4679. //试卷
  4680. console.log("试卷");
  4681. console.log(section);
  4682. let learnNum = await this.goodsTodayStudySectionNum();
  4683. let hasLearn = await this.gradeCheckGoodsStudy(section.typeId);
  4684. if (this.goodsData.sectionMaxNum > 0) {
  4685. if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
  4686. this.$message({
  4687. type: "warning",
  4688. message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
  4689. });
  4690. return;
  4691. }
  4692. }
  4693. if (this.businessData.goodsLearningOrder == 1) {
  4694. if (section.parent.canLearn) {
  4695. let num = await this.bankRecordDoNum(section);
  4696. //有次数限制
  4697. if (section.answerNum - num > 0 && section.answerNum > 0) {
  4698. // this.$set(this.list[index],'doNum',(item.doNum+1))
  4699. this.$router.push({
  4700. path: "/course-exam/" + this.goodsId,
  4701. query: {
  4702. courseId: this.courseId,
  4703. gradeId: this.gradeId,
  4704. moduleId: section.moduleId || 0,
  4705. examId: section.typeId,
  4706. chapterId: section.chapterId || 0,
  4707. orderGoodsId: this.orderGoodsId,
  4708. },
  4709. });
  4710. //没有答题次数限制
  4711. } else if (section.answerNum == 0) {
  4712. this.$router.push({
  4713. path: "/course-exam/" + this.goodsId,
  4714. query: {
  4715. courseId: this.courseId,
  4716. gradeId: this.gradeId,
  4717. moduleId: section.moduleId || 0,
  4718. examId: section.typeId,
  4719. chapterId: section.chapterId || 0,
  4720. orderGoodsId: this.orderGoodsId,
  4721. },
  4722. });
  4723. } else {
  4724. this.$message({
  4725. type: "warning",
  4726. message: "该试卷只能答题" + section.answerNum + "次",
  4727. });
  4728. return;
  4729. }
  4730. this.studyLog(
  4731. (section.moduleId = 0),
  4732. (section.chapterId = 0),
  4733. section.typeId
  4734. );
  4735. } else {
  4736. this.$message({
  4737. type: "warning",
  4738. message: "请按顺序学完视频课程再进行练习和测试",
  4739. });
  4740. }
  4741. } else if (
  4742. this.businessData.goodsLearningOrder == 2 &&
  4743. !section.rebuild
  4744. ) {
  4745. let rows = await this.studyRecordMenuAllList();
  4746. let isStop = false;
  4747. let newRows = [];
  4748. for (let i = 0; i < rows.length; i++) {
  4749. let moduleTrue = rows[i].moduleId == section.moduleId;
  4750. let chapterTrue = rows[i].chapterId == section.chapterId;
  4751. if (moduleTrue && chapterTrue) {
  4752. isStop = true;
  4753. if (rows[i].sectionType != 2) {
  4754. //忽略直播
  4755. newRows.push(rows[i]);
  4756. }
  4757. } else {
  4758. if (!isStop) {
  4759. if (rows[i].sectionType != 2) {
  4760. //忽略直播
  4761. newRows.push(rows[i]);
  4762. }
  4763. } else {
  4764. break;
  4765. }
  4766. }
  4767. }
  4768. console.log(newRows);
  4769. let isAllLearn = newRows.every((item) => {
  4770. return item.studyStatus == 1;
  4771. });
  4772. if (isAllLearn) {
  4773. //之前的都学完了
  4774. // if(canLearn) { //视频的上一节学完
  4775. let num = await this.bankRecordDoNum(section.typeId);
  4776. //有次数限制
  4777. if (section.answerNum - num > 0 && section.answerNum > 0) {
  4778. console.log(this.list[index]);
  4779. this.$router.push({
  4780. path: "/course-exam/" + this.goodsId,
  4781. query: {
  4782. courseId: this.courseId,
  4783. gradeId: this.gradeId,
  4784. moduleId: section.moduleId || 0,
  4785. examId: section.typeId,
  4786. chapterId: section.chapterId || 0,
  4787. orderGoodsId: this.orderGoodsId,
  4788. },
  4789. });
  4790. //没有答题次数限制
  4791. } else if (section.answerNum == 0) {
  4792. this.$router.push({
  4793. path: "/course-exam/" + this.goodsId,
  4794. query: {
  4795. courseId: this.courseId,
  4796. gradeId: this.gradeId,
  4797. moduleId: section.moduleId || 0,
  4798. examId: section.typeId,
  4799. chapterId: section.chapterId || 0,
  4800. orderGoodsId: this.orderGoodsId,
  4801. },
  4802. });
  4803. } else {
  4804. this.$message({
  4805. type: "warning",
  4806. message: "该试卷只能答题" + section.answerNum + "次",
  4807. });
  4808. return;
  4809. }
  4810. this.studyLog(
  4811. (section.moduleId = 0),
  4812. (section.chapterId = 0),
  4813. section.typeId
  4814. );
  4815. } else {
  4816. this.$message({
  4817. type: "warning",
  4818. message: "请学完视频课程再进行练习和测试",
  4819. });
  4820. }
  4821. } else {
  4822. let num = await this.bankRecordDoNum(section.typeId);
  4823. //有次数限制
  4824. if (section.answerNum - section.doNum > 0 && section.answerNum > 0) {
  4825. // this.$set(this.list[index],'doNum',(item.doNum+1))
  4826. this.$router.push({
  4827. path: "/course-exam/" + this.goodsId,
  4828. query: {
  4829. courseId: this.courseId,
  4830. gradeId: this.gradeId,
  4831. moduleId: section.moduleId || 0,
  4832. examId: section.typeId,
  4833. chapterId: section.chapterId || 0,
  4834. orderGoodsId: this.orderGoodsId,
  4835. },
  4836. });
  4837. //没有答题次数限制
  4838. } else if (section.answerNum == 0) {
  4839. this.$router.push({
  4840. path: "/course-exam/" + this.goodsId,
  4841. query: {
  4842. courseId: this.courseId,
  4843. gradeId: this.gradeId,
  4844. moduleId: section.moduleId || 0,
  4845. examId: section.typeId,
  4846. chapterId: section.chapterId || 0,
  4847. orderGoodsId: this.orderGoodsId,
  4848. },
  4849. });
  4850. } else {
  4851. this.$message({
  4852. type: "warning",
  4853. message: "该试卷只能答题" + section.answerNum + "次",
  4854. });
  4855. return;
  4856. }
  4857. this.studyLog(
  4858. (section.moduleId = 0),
  4859. (section.chapterId = 0),
  4860. section.typeId
  4861. );
  4862. }
  4863. return;
  4864. }
  4865. if (section.type != 2) {
  4866. if (this.clickLock) {
  4867. return;
  4868. }
  4869. this.clickLock = true;
  4870. if (
  4871. section.sectionType != 3 &&
  4872. this.playSectionId &&
  4873. (this.playSectionId == section.sectionId ||
  4874. this.playSectionId == section.menuId) &&
  4875. this.moduleId == (section.moduleId || 0) &&
  4876. this.chapterId == (section.chapterId || 0)
  4877. ) {
  4878. //切换为同一频道不作为
  4879. console.log("---====", this.moduleId, this.chapterId);
  4880. this.clickLock = false;
  4881. return;
  4882. }
  4883. // if (this.businessData.goodsLearningOrder == 2 && !section.isRebuild) {
  4884. // //要按从头到尾顺序学习, 且不是重修课程
  4885. // let rows = await this.studyRecordMenuAllList();
  4886. // if (!this.hasPreItem(rows, section)) {
  4887. // //判断是否有上一节
  4888. // let newRows = [];
  4889. // for (let i = 0; i < rows.length; i++) {
  4890. // let moduleTrue =
  4891. // rows[i].moduleId == section.moduleId || rows[i].moduleId == 0;
  4892. // let chapterTrue =
  4893. // rows[i].chapterId == section.chapterId ||
  4894. // rows[i].chapterId == 0;
  4895. // let sectionTrue =
  4896. // rows[i].sectionId == section.sectionId ||
  4897. // rows[i].sectionId == section.menuId;
  4898. // if (moduleTrue && chapterTrue && sectionTrue) {
  4899. // break;
  4900. // } else {
  4901. // if (rows[i].sectionType != 2) {
  4902. // newRows.push(rows[i]);
  4903. // }
  4904. // }
  4905. // }
  4906. // let isAllLearn = newRows.every((item) => {
  4907. // return item.studyStatus == 1;
  4908. // });
  4909. // if (isAllLearn) {
  4910. // this.initVideo(section);
  4911. // } else {
  4912. // this.clickLock = false;
  4913. // this.$message({
  4914. // type: "warning",
  4915. // message: "请按顺序学习视频课程",
  4916. // });
  4917. // }
  4918. // } else {
  4919. // //第一章第一节
  4920. // this.initVideo(section);
  4921. // }
  4922. // } else {
  4923. this.initVideo(section);
  4924. // }
  4925. }
  4926. },
  4927. bankRecordDoNum(section) {
  4928. return new Promise((resolve) => {
  4929. this.$request
  4930. .bankRecordDoNum({
  4931. goodsId: this.goodsId,
  4932. gradeId: this.gradeId,
  4933. chapterId: section.chapterId,
  4934. courseId: this.courseId,
  4935. moduleId: 0,
  4936. examId: section.typeId,
  4937. })
  4938. .then((res) => {
  4939. resolve(res.data);
  4940. });
  4941. });
  4942. },
  4943. /**
  4944. * 是否有上一章节
  4945. */
  4946. hasPreItem(rows, option) {
  4947. let moduleId = option.moduleId;
  4948. let chapterId = option.chapterId;
  4949. let sectionId = option.sectionId;
  4950. let index = 0;
  4951. for (let i = 0; i < rows.length; i++) {
  4952. if (
  4953. rows[i].moduleId == moduleId &&
  4954. rows[i].chapterId == chapterId &&
  4955. rows[i].sectionId == sectionId
  4956. ) {
  4957. index = i;
  4958. break;
  4959. }
  4960. }
  4961. if (index == 0) {
  4962. return false;
  4963. } else {
  4964. return true;
  4965. }
  4966. },
  4967. async initVideo(option) {
  4968. console.log("initVideo", option);
  4969. if (option.sectionType == 1 || option.sectionType == 3) {
  4970. //视频
  4971. // let learnNum = await this.goodsTodayStudySectionNum(option);
  4972. // let hasLearn = await this.gradeCheckGoodsStudy(option);
  4973. // console.log(hasLearn, "hasLearn");
  4974. // console.log(learnNum, "learnNum");
  4975. // console.log(
  4976. // this.goodsData.sectionMaxNum,
  4977. // "this.goodsData.sectionMaxNum"
  4978. // );
  4979. // if (this.goodsData.sectionMaxNum > 0) {
  4980. // if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
  4981. // this.clickLock = false;
  4982. // this.$message({
  4983. // type: "warning",
  4984. // message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
  4985. // });
  4986. // return;
  4987. // }
  4988. // }
  4989. if (!option.recordingUrl) {
  4990. this.clickLock = false;
  4991. this.$message({
  4992. type: "warning",
  4993. message: `暂无播放地址数据`,
  4994. });
  4995. return;
  4996. }
  4997. if (this.playSectionId > 0) {
  4998. //切换视频
  4999. // let oldSectionId = this.playSectionId;
  5000. // uni.$emit("changeSection", oldSectionId);
  5001. }
  5002. this.playVideo(option);
  5003. }
  5004. if (option.sectionType == 2) {
  5005. //直播
  5006. // let learnNum = await this.goodsTodayStudySectionNum(option);
  5007. // let hasLearn = await this.gradeCheckGoodsStudy(option);
  5008. // if (this.goodsData.sectionMaxNum > 0) {
  5009. // if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
  5010. // this.clickLock = false;
  5011. // this.$message({
  5012. // type: "warning",
  5013. // message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
  5014. // });
  5015. // return;
  5016. // }
  5017. // }
  5018. if (!option.liveUrl) {
  5019. this.clickLock = false;
  5020. this.$message({
  5021. type: "warning",
  5022. message: `暂无直播地址数据`,
  5023. });
  5024. return;
  5025. }
  5026. let data = await this.studyRecordGetChannelBasicInfo(option.liveUrl);
  5027. let nowTime = +this.$tools.timest();
  5028. if (option.liveStartTime > nowTime) {
  5029. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  5030. this.clickLock = false;
  5031. this.$message({
  5032. type: "warning",
  5033. message: `直播未开始`,
  5034. });
  5035. return;
  5036. }
  5037. } else if (
  5038. option.liveStartTime < nowTime &&
  5039. option.liveEndTime > nowTime
  5040. ) {
  5041. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  5042. this.clickLock = false;
  5043. this.$message({
  5044. type: "warning",
  5045. message: `暂无直播`,
  5046. });
  5047. return;
  5048. }
  5049. } else if (option.liveEndTime < nowTime) {
  5050. if (data.watchStatus == "end" || data.watchStatus == "playback") {
  5051. this.clickLock = false;
  5052. this.$message({
  5053. type: "warning",
  5054. message: `直播已结束`,
  5055. });
  5056. return;
  5057. }
  5058. }
  5059. this.playVideo(option);
  5060. }
  5061. return;
  5062. },
  5063. studyRecordGetChannelBasicInfo(channelId) {
  5064. return new Promise((resolve) => {
  5065. this.$request
  5066. .studyRecordGetChannelBasicInfo({
  5067. channelId,
  5068. })
  5069. .then((res) => {
  5070. console.log(res, "channel");
  5071. resolve(res.data);
  5072. });
  5073. });
  5074. },
  5075. /**
  5076. * 判断是否是当前播放的节
  5077. */
  5078. isActive(section) {
  5079. let moduleId = section.moduleId || 0;
  5080. let chapterId = section.chapterId || 0;
  5081. let sectionId = section.sectionId || section.menuId;
  5082. if (
  5083. moduleId == this.moduleId &&
  5084. chapterId == this.chapterId &&
  5085. sectionId == this.playSectionId
  5086. ) {
  5087. return true;
  5088. } else {
  5089. return false;
  5090. }
  5091. },
  5092. async playVideo(option) {
  5093. console.log(option, "<-----option", this.clickSectionItem);
  5094. if (option.sectionType == 3) {
  5095. console.log("huifang");
  5096. // 回放
  5097. if (Object.keys(this.clickSectionItem).length) {
  5098. //this.clickSectionItem 判断点击节才跳转, 不判断的话一进来页面到这里就直接跳转了
  5099. this.$router.push({
  5100. path: "/living-room/" + option.liveUrl,
  5101. query: {
  5102. goodsId: this.goodsId,
  5103. courseId: this.courseId,
  5104. gradeId: this.gradeId,
  5105. orderGoodsId: this.orderGoodsId,
  5106. sectionId: option.sectionId || option.menuId,
  5107. chapterId: option.chapterId || 0,
  5108. moduleId: option.moduleId || 0,
  5109. sectionType: 3,
  5110. goodsName: option.name,
  5111. vid: option.recordingUrl, // 回放vid
  5112. },
  5113. });
  5114. this.clickSectionItem = {};
  5115. return;
  5116. }
  5117. }
  5118. if (option.sectionType == 1) {
  5119. //视频
  5120. //设置播放的节ID
  5121. //提交保存观看历史
  5122. if (this.playSectionId) {
  5123. this.postStudyRecord(0, this.playSectionId);
  5124. }
  5125. this.player &&
  5126. this.player.HTML5.video.removeEventListener(
  5127. "timeupdate",
  5128. this.timeEvent
  5129. );
  5130. //播放视频
  5131. this.showRecordStatus = false; //隐藏播放记录提示
  5132. this.sectionItem = option;
  5133. this.isPlayRebuild = option.rebuild;
  5134. this.moduleId = option.moduleId || 0;
  5135. this.chapterId = option.chapterId || 0;
  5136. this.playSectionId = option.sectionId || option.menuId;
  5137. // console.log(this.moduleId, this.chapterId, this.playSectionId);
  5138. // await this.getPhotoLastRecord();
  5139. this.recordObj = await this.getRecordLast();
  5140. this.getNoteList();
  5141. await this.clears();
  5142. this.vid = option.recordingUrl;
  5143. this.historyChatMsgList = [];
  5144. if (option.sectionType == 3) {
  5145. this.polyvLiveHistoryChatMsgList();
  5146. }
  5147. this.liveLast = null;
  5148. if (!this.vid) {
  5149. return;
  5150. }
  5151. this.loadPlayerScript(this.loadPlayer);
  5152. setTimeout(() => {
  5153. this.clickLock = false;
  5154. }, 3000);
  5155. this.studyLog(this.moduleId, this.chapterId, this.playSectionId);
  5156. // uni.$emit("levelId", this.levelId);
  5157. // uni.$emit("getSection", this.menuItem);
  5158. // uni.$emit("isRebuild", this.isRebuild);
  5159. }
  5160. if (option.sectionType == 2) {
  5161. //直播
  5162. // 直播下面不需要调用 this.studyLog(),因为跳到直播页面有调用
  5163. //提交保存观看历史
  5164. if (this.playSectionId) {
  5165. this.postStudyRecord(0, this.playSectionId);
  5166. }
  5167. this.player &&
  5168. this.player.HTML5.video.removeEventListener(
  5169. "timeupdate",
  5170. this.timeEvent
  5171. );
  5172. //播放视频
  5173. this.showRecordStatus = false; //隐藏播放记录提示
  5174. this.sectionItem = option;
  5175. console.log(option, "option");
  5176. this.isPlayRebuild = option.rebuild;
  5177. this.moduleId = option.moduleId || 0;
  5178. this.chapterId = option.chapterId || 0;
  5179. this.playSectionId = option.sectionId || option.menuId;
  5180. // console.log(this.moduleId, this.chapterId, this.playSectionId);
  5181. // await this.getPhotoLastRecord();
  5182. this.recordObj = await this.getRecordLast();
  5183. this.getNoteList();
  5184. //设置播放的节ID
  5185. await this.clears();
  5186. this.vidzb = option.liveUrl;
  5187. this.$router.push({
  5188. path: "/living-room/" + option.liveUrl,
  5189. query: {
  5190. goodsId: this.goodsId,
  5191. courseId: this.courseId,
  5192. gradeId: this.gradeId,
  5193. orderGoodsId: this.orderGoodsId,
  5194. sectionId: option.sectionId || option.menuId,
  5195. chapterId: option.chapterId || 0,
  5196. moduleId: option.moduleId || 0,
  5197. sectionType: 2,
  5198. goodsName: option.name,
  5199. },
  5200. });
  5201. // this.loadPlayerScriptzb(this.loadPlayerzb);
  5202. // setTimeout(() => {
  5203. // this.clickLock = false;
  5204. // }, 3000);
  5205. // uni.$emit("levelId", this.levelId);
  5206. // uni.$emit("getChannel", this.menuItem);
  5207. // uni.$emit("isRebuild", this.isRebuild);
  5208. // console.log(this.menuItem, "menuItem");
  5209. }
  5210. },
  5211. gradeCheckGoodsStudy(option) {
  5212. return new Promise((resolve) => {
  5213. this.$request
  5214. .gradeCheckGoodsStudy({
  5215. goodsId: this.goodsId,
  5216. gradeId: this.gradeId,
  5217. moduleId: option.moduleId || 0,
  5218. chapterId: option.chapterId || 0,
  5219. sectionId: option.sectionId || option.menuId,
  5220. })
  5221. .then((res) => {
  5222. resolve(res.data);
  5223. });
  5224. });
  5225. },
  5226. goodsTodayStudySectionNum(option) {
  5227. return new Promise((resolve) => {
  5228. this.$request
  5229. .goodsTodayStudySectionNum({
  5230. goodsId: this.goodsId,
  5231. gradeId: this.gradeId,
  5232. })
  5233. .then((res) => {
  5234. resolve(res.data);
  5235. });
  5236. });
  5237. },
  5238. studyRecordMenuAllList() {
  5239. return new Promise((resolve) => {
  5240. this.$request
  5241. .studyRecordMenuAllList({
  5242. courseId: this.courseId,
  5243. gradeId: this.gradeId,
  5244. goodsId: this.goodsId,
  5245. })
  5246. .then((res) => {
  5247. resolve(res.data);
  5248. });
  5249. });
  5250. },
  5251. loadPlayerzb() {
  5252. var self = this;
  5253. const polyvLivePlayer = window.polyvLivePlayer;
  5254. this.playerzb = polyvLivePlayer({
  5255. wrap: "#playerzb",
  5256. width: 810,
  5257. height: 455,
  5258. showLine: "off",
  5259. uid: this.uidzb,
  5260. vid: this.vidzb,
  5261. });
  5262. this.playerzb.on("s2j_onStartPlay", () => {
  5263. console.log("s2j_onStartPlay");
  5264. this.hasStart = true;
  5265. this.livingTimer = setInterval(self.timeEventLiving, 1000);
  5266. });
  5267. this.playerzb.on("s2j_onOver", () => {
  5268. console.log("s2j_onOver");
  5269. clearInterval(this.livingTimer);
  5270. this.hasStart = false;
  5271. this.$message({
  5272. type: "success",
  5273. message: "播放完毕",
  5274. });
  5275. this.postStudyRecord(1);
  5276. });
  5277. },
  5278. loadPlayer() {
  5279. var self = this;
  5280. const polyvPlayer = window.polyvPlayer;
  5281. console.log(polyvPlayer);
  5282. self.$request.obtainpolyvvideosign(self.vid).then((res) => {
  5283. console.log(res, "res2");
  5284. self.player = polyvPlayer({
  5285. wrap: "#player",
  5286. width: 810,
  5287. showLine: "off",
  5288. height: 455,
  5289. ban_history_time: "on",
  5290. vid: self.vid,
  5291. autoplay: this.autoplay,
  5292. ban_seek: this.isAllowSeek,
  5293. speed: this.playbackRate,
  5294. teaser_show: 1,
  5295. tail_show: 1,
  5296. hideSwitchPlayer: true,
  5297. watchStartTime: this.recordObj.videoCurrentTime,
  5298. ts: res.data.ts,
  5299. sign: res.data.sign,
  5300. // adMatter: [
  5301. // {
  5302. // // 广告参数详细配置
  5303. // location: 1, //广告位置: 1 片头广告,2 暂停广告,3 片尾广告,4 弹窗广告
  5304. // adtype: 2, //广告资源类型: 1 图片广告,2 视频广告,3 swf广告(flash播放器生效)
  5305. // matterurl: "https://www.runoob.com/try/demo_source/movie.mp4", //广告资源URL
  5306. // timesize: 5, //广告时长,单位:秒
  5307. // skipenabled: false, //是否显示跳过按钮
  5308. // },
  5309. // {
  5310. // // 广告参数详细配置
  5311. // location: 3, //广告位置: 1 片头广告,2 暂停广告,3 片尾广告,4 弹窗广告
  5312. // adtype: 2, //广告资源类型: 1 图片广告,2 视频广告,3 swf广告(flash播放器生效)
  5313. // matterurl: "https://www.runoob.com/try/demo_source/movie.mp4", //广告资源URL
  5314. // timesize: 5, //广告时长,单位:秒
  5315. // skipenabled: false, //是否显示跳过按钮
  5316. // },
  5317. // ],
  5318. playsafe: function (vid, next) {
  5319. self.$request.obtainpolyvvideopcsign(vid).then((res) => {
  5320. next(res.data);
  5321. });
  5322. },
  5323. });
  5324. this.player.HTML5.video.addEventListener("timeupdate", self.timeEvent);
  5325. this.player.on("s2j_onPlayStart", () => {
  5326. //开始播放每30秒提交一次观看时间
  5327. this.hasStart = true;
  5328. clearInterval(this.postTimer);
  5329. this.postTimer = setInterval(() => {
  5330. this.postStudyRecord(0, this.playSectionId, 5);
  5331. }, 30000);
  5332. if (this.recordObj.videoCurrentTime) {
  5333. this.showRecordStatus = true;
  5334. setTimeout(() => {
  5335. this.showRecordStatus = false;
  5336. }, 5000);
  5337. } else {
  5338. //新视频直接提交一条观看记录
  5339. // this.postStudyRecord(0);
  5340. this.showRecordStatus = false;
  5341. }
  5342. });
  5343. this.player.on("s2j_onVideoPause", () => {
  5344. clearInterval(this.postTimer);
  5345. });
  5346. this.player.on("s2j_onVideoPlay", () => {
  5347. if (this.postTimer) {
  5348. this.postTimer = setInterval(() => {
  5349. this.postStudyRecord(0, this.playSectionId, 5);
  5350. }, 30000);
  5351. }
  5352. });
  5353. this.player.on("s2j_onPlayOver", () => {
  5354. this.hasStart = false;
  5355. clearInterval(this.postTimer);
  5356. this.$message({
  5357. type: "success",
  5358. message: "播放完毕",
  5359. });
  5360. this.postStudyRecord(1);
  5361. });
  5362. });
  5363. },
  5364. timeEventLiving() {
  5365. var polyvPlayerContext = this.playerzb;
  5366. if (polyvPlayerContext) {
  5367. this.liveDuration = this.liveDuration + 1; //每隔1秒
  5368. console.log(this.liveDuration);
  5369. if (this.liveDuration == 2) {
  5370. //直播第2秒拍照
  5371. if (
  5372. this.goodsPhotographConfig &&
  5373. this.goodsPhotographConfig.livephotograph == 1 &&
  5374. this.sectionItem.learning != 1 &&
  5375. this.photoHistoryList.length == 0
  5376. ) {
  5377. //开启直播拍照
  5378. polyvPlayerContext.j2s_pauseVideo();
  5379. this.openPhoto();
  5380. } else {
  5381. this.postStudyRecord();
  5382. }
  5383. }
  5384. }
  5385. },
  5386. timeEvent() {
  5387. let self = this;
  5388. var polyvPlayerContext = this.player;
  5389. if (polyvPlayerContext) {
  5390. this.playTime = polyvPlayerContext.j2s_getCurrentTime(); //播放时刻
  5391. // console.log(this.playTime,789,this.photoHistoryList)
  5392. //判断是否需要拍照
  5393. if (this.photoNum > 0) {
  5394. this.configPhoto();
  5395. let photoTime = 0; //获取拍照秒数
  5396. for (let i = 0; i < this.photoList.length; i++) {
  5397. photoTime = Number(this.photoList[i]); //获取拍照秒数
  5398. if (photoTime < this.playTime && photoTime > this.playTime - 8) {
  5399. //3秒区间内才触发拍照,避免拉动滚动条
  5400. if (
  5401. this.photoHistoryList.indexOf(i) < 0 &&
  5402. this.sectionItem.learning != 1
  5403. ) {
  5404. //不存在拍照历史,没有重修过,没有学过,则拍照
  5405. //启动拍照
  5406. //暂停
  5407. polyvPlayerContext.j2s_pauseVideo();
  5408. this.photoIndex = i;
  5409. this.openPhoto();
  5410. } else {
  5411. }
  5412. }
  5413. }
  5414. }
  5415. }
  5416. },
  5417. getPhotoLastRecord() {
  5418. return new Promise((resolve) => {
  5419. let self = this;
  5420. let data = {
  5421. sectionId: parseInt(self.playSectionId),
  5422. goodsId: parseInt(self.goodsId),
  5423. courseId: parseInt(self.courseId),
  5424. gradeId: parseInt(self.gradeId),
  5425. chapterId: parseInt(self.chapterId),
  5426. moduleId: parseInt(self.moduleId),
  5427. };
  5428. this.$request.getPhotoLastRecord(data).then((res) => {
  5429. //清空历史数据
  5430. self.photoHistoryList = [];
  5431. this.photoIndex = 0;
  5432. self.photoList = [];
  5433. for (let i = 0; i < res.data.length; i++) {
  5434. //-2存储随机拍照数组
  5435. if (res.data[i].photoIndex == -2) {
  5436. self.photoList = res.data[i].timeInterval.split(",");
  5437. } else {
  5438. self.photoHistoryList.push(res.data[i].photoIndex);
  5439. }
  5440. }
  5441. resolve();
  5442. });
  5443. });
  5444. },
  5445. //拍照
  5446. openPhoto() {
  5447. var polyvPlayerContext = this.player;
  5448. if (polyvPlayerContext) {
  5449. if (this.isFullScreen()) {
  5450. this.exitFullscreen();
  5451. }
  5452. }
  5453. var polyvPlayerContext = this.playerzb;
  5454. if (polyvPlayerContext) {
  5455. if (this.isFullScreen()) {
  5456. this.exitFullscreen();
  5457. }
  5458. }
  5459. this.$nextTick(() => {
  5460. if (
  5461. (window.navigator.mediaDevices &&
  5462. window.navigator.mediaDevices.getUserMedia) ||
  5463. window.navigator.getUserMedia ||
  5464. window.navigator.webkitGetUserMedia ||
  5465. window.navigator.mozGetUserMedia
  5466. ) {
  5467. // 调用用户媒体设备, 访问摄像头
  5468. this.getUserMedia(
  5469. {
  5470. video: {
  5471. width: 400,
  5472. height: 400,
  5473. },
  5474. },
  5475. this.photographSuccess,
  5476. this.photographError
  5477. );
  5478. } else {
  5479. this.photographError();
  5480. }
  5481. });
  5482. },
  5483. /**
  5484. * 退出全屏
  5485. */
  5486. exitFullscreen() {
  5487. try {
  5488. var de = document;
  5489. console.log(de);
  5490. if (de.exitFullscreen) {
  5491. de.exitFullscreen();
  5492. } else if (de.mozCancelFullScreen) {
  5493. de.mozCancelFullScreen();
  5494. } else if (de.webkitCancelFullScreen) {
  5495. de.webkitCancelFullScreen();
  5496. }
  5497. } catch (err) {}
  5498. },
  5499. fullele() {
  5500. return (
  5501. document.fullscreenElement ||
  5502. document.webkitFullscreenElement ||
  5503. document.msFullscreenElement ||
  5504. document.mozFullScreenElement ||
  5505. null
  5506. );
  5507. },
  5508. //判断是否全屏
  5509. isFullScreen() {
  5510. return !!(document.webkitIsFullScreen || this.fullele());
  5511. },
  5512. //配置随机拍照时间
  5513. configPhoto() {
  5514. var polyvPlayerContext = this.player;
  5515. let totalVideoTime = polyvPlayerContext.j2s_getDuration();
  5516. let duration = polyvPlayerContext.j2s_getCurrentTime();
  5517. let photoNum = this.photoNum;
  5518. if (!this.photoConfig) {
  5519. this.photoConfig = true;
  5520. //没有历史拍照间隔数据
  5521. if (this.photoList.length == 0) {
  5522. if (totalVideoTime >= 900) {
  5523. //大于15分钟
  5524. if (photoNum == 1) {
  5525. //开头拍1张
  5526. this.photoList.push(1);
  5527. } else if (photoNum == 3) {
  5528. //拍3张
  5529. this.photoList.push(0); //开头拍一张
  5530. let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
  5531. let centerMinTime = centerTime - 300; //前后5分钟
  5532. let centerMaxTime = centerTime + 300;
  5533. let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
  5534. this.photoList.push(centerTakeTime); //中间拍一张
  5535. let endMaxTime = totalVideoTime - 60;
  5536. let endMinTime = totalVideoTime - 300;
  5537. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  5538. this.photoList.push(endTakeTime); //最后拍一张
  5539. }
  5540. } else {
  5541. //小于15分钟,只拍前后各一张
  5542. if (photoNum == 1) {
  5543. //开头拍1张
  5544. this.photoList.push(1);
  5545. } else if (photoNum == 3) {
  5546. //拍2张
  5547. if (totalVideoTime <= 300) {
  5548. //小于5分钟
  5549. this.photoList.push(1); //开头拍一张
  5550. let endTakeTime = this.randomNum(10, totalVideoTime); //中间随机取一张
  5551. this.photoList.push(endTakeTime);
  5552. } else {
  5553. this.photoList.push(1); //开头拍一张
  5554. let endMaxTime = totalVideoTime - 60;
  5555. let endMinTime = totalVideoTime - 300;
  5556. let endTakeTime = this.randomNum(endMinTime, endMaxTime);
  5557. this.photoList.push(endTakeTime); //最后1-5分钟拍一张
  5558. }
  5559. }
  5560. }
  5561. console.log(this.photoList, "随机拍照时间数组11", photoNum);
  5562. this.postCoursePhotoRecord(true); //提交随机拍照时间数组
  5563. }
  5564. console.log(this.photoList, "随机拍照时间数组");
  5565. //兼容已有观看历史
  5566. for (let i = 0; i < this.photoList.length - 1; i++) {
  5567. if (
  5568. this.photoList[i] < duration &&
  5569. this.photoList[i + 1] > duration
  5570. ) {
  5571. this.photoIndex = i + 1;
  5572. // console.log("我的修改了photoIndex")
  5573. break;
  5574. }
  5575. if (duration > this.photoList[this.photoList.length - 1]) {
  5576. this.photoIndex = this.photoList.length - 1; //取最后一个下标
  5577. // console.log("我的修改了photoIndex")
  5578. break;
  5579. }
  5580. }
  5581. }
  5582. },
  5583. randomNum(minNum, maxNum) {
  5584. switch (arguments.length) {
  5585. case 1:
  5586. return parseInt(Math.random() * minNum + 1, 10);
  5587. break;
  5588. case 2:
  5589. return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
  5590. break;
  5591. default:
  5592. return 0;
  5593. break;
  5594. }
  5595. },
  5596. //postTime 只提交随机时间
  5597. postCoursePhotoRecord(postTime = false) {
  5598. return new Promise((resolve, reject) => {
  5599. let currentTime = 0;
  5600. var polyvPlayerContext = this.player;
  5601. if (polyvPlayerContext) {
  5602. currentTime = polyvPlayerContext.j2s_getCurrentTime();
  5603. }
  5604. let self = this;
  5605. let photoIndex = self.photoIndex;
  5606. let data = {
  5607. photo: self.ossAvatarUrl,
  5608. sectionId: parseInt(self.playSectionId),
  5609. goodsId: parseInt(self.goodsId),
  5610. courseId: parseInt(self.courseId),
  5611. photoTime: parseInt(currentTime > 0 ? currentTime : 0),
  5612. gradeId: parseInt(self.gradeId),
  5613. photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
  5614. photoNum: parseInt(self.photoNum),
  5615. chapterId: parseInt(self.chapterId),
  5616. moduleId: parseInt(self.moduleId),
  5617. timeInterval: postTime ? self.photoList.join(",") : "",
  5618. };
  5619. console.log("提交接口", data);
  5620. this.$request
  5621. .coursePhotoRecord(data)
  5622. .then((res) => {
  5623. console.log(res, "res");
  5624. resolve();
  5625. })
  5626. .catch((err) => {
  5627. console.log(err, "err");
  5628. reject();
  5629. });
  5630. });
  5631. },
  5632. /**
  5633. * @param {String} 直播预览
  5634. */
  5635. loadPlayerScriptzb(callback) {
  5636. if (!window.polyvLivePlayer) {
  5637. const myScript = document.createElement("script");
  5638. myScript.setAttribute("src", this.playerJs);
  5639. myScript.onload = callback;
  5640. document.body.appendChild(myScript);
  5641. } else {
  5642. callback();
  5643. }
  5644. },
  5645. loadPlayerScript(callback) {
  5646. if (!window.polyvPlayer) {
  5647. const myScript = document.createElement("script");
  5648. myScript.setAttribute("src", this.vodPlayerJs);
  5649. myScript.onload = callback;
  5650. document.body.appendChild(myScript);
  5651. } else {
  5652. callback();
  5653. }
  5654. },
  5655. clears() {
  5656. return new Promise((resolve, reject) => {
  5657. this.vid = "";
  5658. this.vidzb = "";
  5659. if (this.player) {
  5660. this.player.destroy();
  5661. }
  5662. if (this.playerzb) {
  5663. this.playerzb.destroy();
  5664. }
  5665. resolve();
  5666. });
  5667. },
  5668. /**
  5669. * 提交观看记录
  5670. */
  5671. postStudyRecord(
  5672. status = 0,
  5673. sectionId = this.playSectionId,
  5674. PlayDuration = 0
  5675. ) {
  5676. let currentTime = 0;
  5677. var polyvPlayerContext = this.player;
  5678. if (polyvPlayerContext) {
  5679. currentTime = polyvPlayerContext.j2s_getCurrentTime(); //当前视频播放时刻
  5680. }
  5681. if (this.vidzb) {
  5682. currentTime = 2; //直播无法获取,无论开始结束都传2秒
  5683. }
  5684. let self = this;
  5685. console.log(this);
  5686. console.log(PlayDuration, "PlayDuration");
  5687. let data = {
  5688. fromPlat: 2, //来源平台 1小程序 2网站
  5689. photo: self.ossAvatarUrl,
  5690. sectionId: parseInt(this.playSectionId),
  5691. goodsId: parseInt(this.goodsId),
  5692. courseId: parseInt(this.courseId),
  5693. studyDuration: parseInt(PlayDuration > 0 ? PlayDuration : 0),
  5694. gradeId: parseInt(this.gradeId),
  5695. chapterId: parseInt(this.chapterId),
  5696. moduleId: parseInt(this.moduleId),
  5697. videoCurrentTime: parseInt(currentTime > 0 ? currentTime : 0),
  5698. orderGoodsId: this.orderGoodsId,
  5699. };
  5700. if (this.ossAvatarUrl) {
  5701. data.similarity = this.compareFaceData; // 相似度
  5702. }
  5703. if (status > 0) {
  5704. data.status = status;
  5705. }
  5706. this.$request
  5707. .studyRecord(data)
  5708. .then((res) => {
  5709. if (status > 0) {
  5710. //看完视频刷新父级列表
  5711. let rebuildObj = this.getSameObj(this.sectionItem);
  5712. this.refreshParentList(this.sectionItem, rebuildObj);
  5713. }
  5714. self.ossAvatarUrl = "";
  5715. })
  5716. .catch((err) => {
  5717. console.log(err);
  5718. this.$message({
  5719. type: "warning",
  5720. message: err.msg,
  5721. });
  5722. });
  5723. },
  5724. /**
  5725. * 获取重修列表中是否有相同对象
  5726. */
  5727. getSameObj(metaObj) {
  5728. let newObj = false;
  5729. if (this.reMenuList.length) {
  5730. console.log(this.reMenuList, "this.reMenuList");
  5731. this.reMenuList.forEach((menu) => {
  5732. if (menu.type == 3) {
  5733. let isSame = this.contrast(metaObj, menu);
  5734. if (isSame) {
  5735. newObj = isSame;
  5736. }
  5737. } else {
  5738. if (menu.list && menu.list.length) {
  5739. menu.list.forEach((menuItem) => {
  5740. if (menuItem.type == 1) {
  5741. console.log(menuItem, metaObj);
  5742. let isSame = this.contrast(metaObj, menuItem);
  5743. if (isSame) {
  5744. newObj = isSame;
  5745. }
  5746. } else {
  5747. if (menuItem.list && menuItem.list.length) {
  5748. menuItem.list.forEach((menuChild) => {
  5749. if (menuChild.type == 1) {
  5750. let isSame = this.contrast(metaObj, menuChild);
  5751. if (isSame) {
  5752. newObj = isSame;
  5753. }
  5754. }
  5755. });
  5756. }
  5757. }
  5758. });
  5759. }
  5760. }
  5761. });
  5762. return newObj;
  5763. } else {
  5764. return false;
  5765. }
  5766. },
  5767. contrast(obj1, obj2) {
  5768. let moduleId1 = obj1.moduleId || 0;
  5769. let chapterId1 = obj1.chapterId || 0;
  5770. let sectionId1 = obj1.sectionId || obj1.menuId;
  5771. let moduleId2 = obj2.moduleId || 0;
  5772. let chapterId2 = obj2.chapterId || 0;
  5773. let sectionId2 = obj2.sectionId || obj2.menuId;
  5774. //转字符串后对比是否一致
  5775. return moduleId1 == moduleId2 &&
  5776. chapterId1 == chapterId2 &&
  5777. sectionId1 == sectionId2
  5778. ? obj2
  5779. : false;
  5780. },
  5781. /**
  5782. * 刷新父级列表
  5783. */
  5784. refreshParentList(sectionItem, rebuildObj) {
  5785. console.log(sectionItem, "sectionItem");
  5786. console.log(rebuildObj, "rebuildObj");
  5787. let self = this;
  5788. if (sectionItem.menuId) {
  5789. //最外层节有menuid
  5790. //普通章节目录
  5791. this.$request
  5792. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId })
  5793. .then((res) => {
  5794. for (let i = 0; i < res.rows.length; i++) {
  5795. let item = res.rows[i];
  5796. if (item.type == 3) {
  5797. self.menuList[i].learning = item.learning;
  5798. self.menuList[i].rebuild = item.rebuild;
  5799. }
  5800. }
  5801. });
  5802. if (this.menuTab.length > 1) {
  5803. //有重修目录
  5804. this.$request
  5805. .reMenuList({
  5806. courseId: this.courseId,
  5807. gradeId: this.gradeId,
  5808. rebuild: 1,
  5809. })
  5810. .then((res) => {
  5811. if (res.rows.length > 0) {
  5812. for (let i = 0; i < res.rows.length; i++) {
  5813. let item = res.rows[i];
  5814. item.id = item.menuId;
  5815. item.name = item.menuName;
  5816. item.menuType = item.type;
  5817. item.showList = false;
  5818. item.list = [];
  5819. item.isRebuild = 1;
  5820. }
  5821. self.reMenuList = self.reMenuList.filter((reMenu) => {
  5822. //筛选剩下的选项
  5823. return res.rows.find((row) => row.menuId == reMenu.menuId);
  5824. });
  5825. } else {
  5826. this.menuTab = [
  5827. {
  5828. name: "1",
  5829. label: "章节目录",
  5830. },
  5831. ];
  5832. this.courseTabIndex = "1";
  5833. self.reMenuList = [];
  5834. }
  5835. });
  5836. }
  5837. } else if (!sectionItem.moduleId) {
  5838. //第二层节没有moduleid
  5839. this.$request
  5840. .reSectionList({
  5841. chapterId: sectionItem.chapterId,
  5842. gradeId: this.gradeId,
  5843. courseId: this.courseId,
  5844. moduleId: 0,
  5845. })
  5846. .then((res) => {
  5847. let newArr = res.data.filter((item) => {
  5848. return item.type != 2;
  5849. });
  5850. sectionItem.parent.canLearn = newArr.every((item) => {
  5851. if (item.learning == 1) {
  5852. return true;
  5853. } else {
  5854. return false;
  5855. }
  5856. });
  5857. res.data.forEach((section) => {
  5858. section.isRebuild = 1;
  5859. section.parent = sectionItem.parent;
  5860. });
  5861. this.menuList.forEach((menu) => {
  5862. if (menu.menuId == sectionItem.chapterId) {
  5863. menu.list = res.data;
  5864. }
  5865. });
  5866. });
  5867. if (this.menuTab.length > 1 && rebuildObj) {
  5868. this.$request
  5869. .reSectionList({
  5870. chapterId: rebuildObj.chapterId,
  5871. gradeId: this.gradeId,
  5872. courseId: this.courseId,
  5873. moduleId: 0,
  5874. rebuild: 1,
  5875. })
  5876. .then((res) => {
  5877. let newArr = res.data.filter((item) => {
  5878. return item.type != 2;
  5879. });
  5880. rebuildObj.parent.canLearn = newArr.every((item) => {
  5881. if (item.learning == 1) {
  5882. return true;
  5883. } else {
  5884. return false;
  5885. }
  5886. });
  5887. res.data.forEach((section) => {
  5888. section.parent = rebuildObj.parent;
  5889. });
  5890. this.reMenuList.forEach((menu) => {
  5891. if (menu.menuId == rebuildObj.chapterId) {
  5892. menu.list = res.data;
  5893. }
  5894. });
  5895. });
  5896. this.$request
  5897. .reMenuList({
  5898. courseId: this.courseId,
  5899. gradeId: this.gradeId,
  5900. rebuild: 1,
  5901. })
  5902. .then((res) => {
  5903. if (res.rows.length > 0) {
  5904. for (let i = 0; i < res.rows.length; i++) {
  5905. let item = res.rows[i];
  5906. item.id = item.menuId;
  5907. item.name = item.menuName;
  5908. item.menuType = item.type;
  5909. item.showList = false;
  5910. item.list = [];
  5911. item.isRebuild = 1;
  5912. }
  5913. self.reMenuList = self.reMenuList.filter((reMenu) => {
  5914. //筛选剩下的选项
  5915. return res.rows.find((row) => row.menuId == reMenu.menuId);
  5916. });
  5917. } else {
  5918. this.menuTab = [
  5919. {
  5920. name: "1",
  5921. label: "章节目录",
  5922. },
  5923. ];
  5924. this.courseTabIndex = "1";
  5925. self.reMenuList = [];
  5926. }
  5927. });
  5928. }
  5929. } else {
  5930. //第三层节有moduleid和chapterid都有
  5931. this.$request
  5932. .reSectionList({
  5933. chapterId: sectionItem.chapterId,
  5934. gradeId: this.gradeId,
  5935. courseId: this.courseId,
  5936. moduleId: sectionItem.moduleId,
  5937. })
  5938. .then((res) => {
  5939. let newArr = res.data.filter((item) => {
  5940. return item.type != 2;
  5941. });
  5942. sectionItem.parent.canLearn = newArr.every((item) => {
  5943. if (item.learning == 1) {
  5944. return true;
  5945. } else {
  5946. return false;
  5947. }
  5948. });
  5949. res.data.forEach((section) => {
  5950. section.parent = sectionItem.parent;
  5951. });
  5952. this.menuList.forEach((menu) => {
  5953. if (menu.list && menu.list.length) {
  5954. menu.list.forEach((chapter) => {
  5955. if (
  5956. chapter.moduleId == sectionItem.moduleId &&
  5957. chapter.chapterId == sectionItem.chapterId
  5958. ) {
  5959. console.log(res.data, "res.data");
  5960. console.log(chapter.list, "chapter.list");
  5961. chapter.list = res.data;
  5962. }
  5963. });
  5964. }
  5965. });
  5966. });
  5967. if (this.menuTab.length > 1 && rebuildObj) {
  5968. this.$request
  5969. .reSectionList({
  5970. chapterId: rebuildObj.chapterId,
  5971. gradeId: this.gradeId,
  5972. courseId: this.courseId,
  5973. moduleId: rebuildObj.moduleId,
  5974. rebuild: 1,
  5975. })
  5976. .then((res) => {
  5977. let newArr = res.data.filter((item) => {
  5978. return item.type != 2;
  5979. });
  5980. rebuildObj.parent.canLearn = newArr.every((item) => {
  5981. if (item.learning == 1) {
  5982. return true;
  5983. } else {
  5984. return false;
  5985. }
  5986. });
  5987. res.data.forEach((section) => {
  5988. section.parent = rebuildObj.parent;
  5989. });
  5990. this.reMenuList.forEach((menu) => {
  5991. if (menu.list && menu.list.length) {
  5992. menu.list.forEach((chapter) => {
  5993. if (
  5994. chapter.moduleId == rebuildObj.moduleId &&
  5995. chapter.chapterId == rebuildObj.chapterId
  5996. ) {
  5997. chapter.list = res.data;
  5998. }
  5999. });
  6000. }
  6001. });
  6002. });
  6003. this.$request
  6004. .reMenuList({
  6005. courseId: this.courseId,
  6006. gradeId: this.gradeId,
  6007. rebuild: 1,
  6008. })
  6009. .then((res) => {
  6010. if (res.rows.length > 0) {
  6011. for (let i = 0; i < res.rows.length; i++) {
  6012. let item = res.rows[i];
  6013. item.id = item.menuId;
  6014. item.name = item.menuName;
  6015. item.menuType = item.type;
  6016. item.showList = false;
  6017. item.list = [];
  6018. item.isRebuild = 1;
  6019. }
  6020. self.reMenuList = self.reMenuList.filter((reMenu) => {
  6021. //筛选剩下的选项
  6022. return res.rows.find((row) => row.menuId == reMenu.menuId);
  6023. });
  6024. } else {
  6025. this.menuTab = [
  6026. {
  6027. name: "1",
  6028. label: "章节目录",
  6029. },
  6030. ];
  6031. this.courseTabIndex = "1";
  6032. self.reMenuList = [];
  6033. }
  6034. });
  6035. }
  6036. }
  6037. },
  6038. getRecordLast() {
  6039. let self = this;
  6040. return new Promise((resolve) => {
  6041. let data = {
  6042. gradeId: Number(self.gradeId),
  6043. goodsId: Number(self.goodsId),
  6044. sectionId: Number(self.playSectionId),
  6045. courseId: Number(self.courseId),
  6046. chapterId: parseInt(self.chapterId),
  6047. moduleId: parseInt(self.moduleId),
  6048. };
  6049. self.$request.recordLast(data).then((res) => {
  6050. resolve(res.data);
  6051. });
  6052. });
  6053. },
  6054. /**
  6055. * 获取笔记列表
  6056. */
  6057. getNoteList() {
  6058. let self = this;
  6059. self.noteList = [];
  6060. let data = {
  6061. courseId: this.courseId,
  6062. gradeId: this.gradeId,
  6063. goodsId: this.goodsId,
  6064. pageNum: this.noteParams.pageNum,
  6065. pageSize: this.noteParams.pageSize,
  6066. };
  6067. if (this.playSectionId > 0) {
  6068. data.sectionId = this.playSectionId;
  6069. }
  6070. this.$request.noteList(data).then((res) => {
  6071. self.noteList = res.rows;
  6072. self.noteTotal = res.total;
  6073. });
  6074. },
  6075. noteClick(note) {
  6076. if (this.vid) {
  6077. //切换视频
  6078. if (this.vid == note.recordingUrl) {
  6079. var polyvPlayerContext = this.player;
  6080. if (polyvPlayerContext) {
  6081. polyvPlayerContext.j2s_seekVideo(note.noteSecond);
  6082. }
  6083. } else {
  6084. var polyvPlayerContext = this.player;
  6085. if (polyvPlayerContext) {
  6086. polyvPlayerContext.changeVid(note.recordingUrl);
  6087. }
  6088. }
  6089. } else {
  6090. var polyvPlayerContext = this.player;
  6091. console.log(polyvPlayerContext);
  6092. if (polyvPlayerContext) {
  6093. polyvPlayerContext.changeVid(note.recordingUrl);
  6094. } else {
  6095. this.vid = note.recordingUrl;
  6096. console.log(note.recordingUrl);
  6097. this.moduleId = note.moduleId;
  6098. this.chapterId = note.chapterId;
  6099. this.playSectionId = note.sectionId;
  6100. note.sectionType = 3;
  6101. this.loadPlayerScript(this.loadPlayer);
  6102. }
  6103. }
  6104. this.recordObj = { videoCurrentTime: note.noteSecond };
  6105. },
  6106. getMenuList() {
  6107. let self = this;
  6108. this.$request
  6109. .reMenuList({ courseId: this.courseId, gradeId: this.gradeId })
  6110. .then((res) => {
  6111. for (let i = 0; i < res.rows.length; i++) {
  6112. let item = res.rows[i];
  6113. item.id = item.menuId;
  6114. item.name = item.menuName;
  6115. item.menuType = item.type;
  6116. item.showList = false;
  6117. item.list = [];
  6118. item.parent = this.menuList;
  6119. }
  6120. self.menuList = res.rows;
  6121. console.log(this.menuList, "menuList");
  6122. //展开第一个
  6123. if (this.needOpen) {
  6124. for (let i = 0; i < res.rows.length; i++) {
  6125. if (res.rows[i].type == 1) {
  6126. this.menuIndex = [i];
  6127. this.openModule(this.menuList[i]);
  6128. break;
  6129. } else if (res.rows[i].type == 2) {
  6130. this.menuIndex = [i];
  6131. // this.needOpen = false;
  6132. this.openChapter(this.menuList[i]);
  6133. break;
  6134. }
  6135. }
  6136. //第一个是节,直接播放
  6137. if (self.menuList.length) {
  6138. if (
  6139. self.menuList[0].type == 3 &&
  6140. !this.sectionItem.recordingUrl &&
  6141. self.menuList[0].sectionType != 2
  6142. ) {
  6143. // this.getResource(self.menuList[0]);
  6144. }
  6145. }
  6146. }
  6147. });
  6148. },
  6149. getReMenuList() {
  6150. let self = this;
  6151. this.$request
  6152. .reMenuList({
  6153. courseId: this.courseId,
  6154. rebuild: 1,
  6155. gradeId: this.gradeId,
  6156. })
  6157. .then((res) => {
  6158. for (let i = 0; i < res.rows.length; i++) {
  6159. let item = res.rows[i];
  6160. item.id = item.menuId;
  6161. item.name = item.menuName;
  6162. item.menuType = item.type;
  6163. item.showList = false;
  6164. item.list = [];
  6165. item.parent = this.reMenuList;
  6166. item.isRebuild = 1;
  6167. }
  6168. self.reMenuList = res.rows;
  6169. if (self.reMenuList.length > 0) {
  6170. this.menuTab = [
  6171. {
  6172. name: "1",
  6173. label: "章节目录",
  6174. },
  6175. {
  6176. name: "2",
  6177. label: "重修目录",
  6178. },
  6179. ];
  6180. if (this.courseTabIndex == "2") {
  6181. return;
  6182. }
  6183. this.courseTabIndex = "1";
  6184. } else {
  6185. this.menuTab = [
  6186. {
  6187. name: "1",
  6188. label: "章节目录",
  6189. },
  6190. ];
  6191. this.courseTabIndex = "1";
  6192. }
  6193. });
  6194. },
  6195. /**
  6196. * 获取讲义权限
  6197. */
  6198. courseHandouts() {
  6199. this.$request
  6200. .courseHandouts(this.goodsData.handoutsId)
  6201. .then((res) => {
  6202. this.courseHandoutsData = res.data;
  6203. const loadingTask = pdf.createLoadingTask(
  6204. this.$tools.splitImgHost(this.courseHandoutsData.handoutsUrl)
  6205. );
  6206. loadingTask.promise
  6207. .then((pdf) => {
  6208. this.numPages = pdf.numPages;
  6209. })
  6210. .catch((err) => {});
  6211. })
  6212. .catch((err) => {});
  6213. },
  6214. /**
  6215. * 获取培训项目详情
  6216. */
  6217. courseBusiness() {
  6218. this.$request.courseBusiness(this.goodsData.businessId).then((res) => {
  6219. this.businessData = res.data;
  6220. });
  6221. },
  6222. /**提出答疑 */
  6223. addAnswer() {
  6224. if (!this.textarea) {
  6225. this.$message.warning("请输入疑问内容");
  6226. return;
  6227. }
  6228. let data = {
  6229. courseId: this.courseId,
  6230. goodsId: this.goodsId,
  6231. orderGoodsId: this.orderGoodsId,
  6232. answerText: this.textarea,
  6233. };
  6234. this.$request.addAnswer(data).then((res) => {
  6235. this.textarea = "";
  6236. this.getAnswerList();
  6237. });
  6238. },
  6239. /**回复 */
  6240. answerBack(row) {
  6241. this.$prompt(`${row.realname}:${row.answerText}`, "提示", {
  6242. confirmButtonText: "确定",
  6243. cancelButtonText: "取消",
  6244. inputErrorMessage: "输入不能为空",
  6245. inputValidator: (value) => {
  6246. let str = value.replace(/^ +| +$/g, "");
  6247. // 点击按钮时,对文本框里面的值进行验证
  6248. if (!str) {
  6249. return "输入不能为空";
  6250. }
  6251. },
  6252. })
  6253. .then(({ value }) => {
  6254. let data = {
  6255. assignUserId: row.userId,
  6256. assignAnswerId: row.answerId,
  6257. courseId: this.courseId,
  6258. goodsId: this.goodsId,
  6259. orderGoodsId: this.orderGoodsId,
  6260. answerText: value,
  6261. assignAnswerText: row.assignAnswerText,
  6262. };
  6263. this.$request.addAnswer(data).then((res) => {
  6264. this.getAnswerList();
  6265. });
  6266. })
  6267. .catch(() => {});
  6268. },
  6269. getAnswerList() {
  6270. let self = this;
  6271. this.$request
  6272. .answerList({ courseId: this.courseId, goodsId: this.goodsId })
  6273. .then((res) => {
  6274. let data1 = [];
  6275. let data2 = [];
  6276. let copydata2 = [];
  6277. res.rows.forEach((item) => {
  6278. if (!item.assignAnswerId) {
  6279. data1.push(item);
  6280. } else {
  6281. data2.push(item);
  6282. copydata2.push(item);
  6283. }
  6284. });
  6285. data2.forEach((item, index) => {
  6286. //回复层
  6287. data1.forEach((items) => {
  6288. //提问层
  6289. if (items.answerId === item.assignAnswerId) {
  6290. if (
  6291. items.newArraysAnswerList &&
  6292. items.newArraysAnswerList.length
  6293. ) {
  6294. items.newArraysAnswerList.push(item);
  6295. } else {
  6296. items.newArraysAnswerList = [item];
  6297. }
  6298. let indexInd = copydata2.findIndex((itemsxs) => {
  6299. return itemsxs.answerId === item.answerId;
  6300. });
  6301. if (indexInd !== -1) {
  6302. copydata2.splice(indexInd, 1);
  6303. }
  6304. }
  6305. });
  6306. });
  6307. copydata2.forEach((it) => {
  6308. for (let i = 0; i < data1.length; i++) {
  6309. let STATUS = null;
  6310. if (data1[i].newArraysAnswerList) {
  6311. STATUS = data1[i].newArraysAnswerList.some((items) => {
  6312. return items.answerId === it.assignAnswerId;
  6313. });
  6314. }
  6315. if (STATUS) {
  6316. data1[i].newArraysAnswerList.push(it);
  6317. break;
  6318. }
  6319. }
  6320. });
  6321. self.answerList = data1.reverse();
  6322. });
  6323. },
  6324. async courseCourseList() {
  6325. return new Promise((resolve) => {
  6326. this.param.goodsId = this.goodsId;
  6327. this.param.gradeId = this.gradeId;
  6328. this.$request.courseCourseList(this.param).then(async (res) => {
  6329. this.courseList.push(...res.rows);
  6330. if (!this.courseId) {
  6331. this.courseId = this.courseList[0].courseId;
  6332. }
  6333. this.param.total = res.total;
  6334. await this.courseChange();
  6335. resolve();
  6336. });
  6337. });
  6338. },
  6339. download(url, fileName) {
  6340. let xhr = new XMLHttpRequest();
  6341. xhr.open("get", url, true);
  6342. xhr.setRequestHeader("Content-Type", `application/pdf`);
  6343. xhr.responseType = "blob";
  6344. let that = this;
  6345. xhr.onload = function () {
  6346. if (this.status == 200) {
  6347. //接受二进制文件流
  6348. var blob = this.response;
  6349. that.downloadExportFile(blob, fileName);
  6350. }
  6351. };
  6352. xhr.send();
  6353. },
  6354. downloadExportFile(blob, tagFileName) {
  6355. let downloadElement = document.createElement("a");
  6356. let href = "";
  6357. if (typeof blob == "string") {
  6358. downloadElement.target = "_blank";
  6359. } else {
  6360. href = window.URL.createObjectURL(blob); //创建下载的链接
  6361. }
  6362. downloadElement.href = href;
  6363. downloadElement.download = tagFileName;
  6364. //下载后文件名
  6365. document.body.appendChild(downloadElement);
  6366. downloadElement.click(); //点击下载
  6367. document.body.removeChild(downloadElement); //下载完成移除元素
  6368. if (typeof blob != "string") {
  6369. window.URL.revokeObjectURL(href); //释放掉blob对象
  6370. }
  6371. },
  6372. print() {
  6373. document.getElementById("printIframe").contentWindow.print();
  6374. },
  6375. previvew(url) {
  6376. this.showPdf = true;
  6377. },
  6378. noteSubmit() {
  6379. let self = this;
  6380. if (!(this.playSectionId > 0)) {
  6381. this.$message({
  6382. message: "目前无播放视频",
  6383. type: "warning",
  6384. });
  6385. return;
  6386. }
  6387. if (!this.textareaNote) {
  6388. this.$message({
  6389. message: "请输入内容",
  6390. type: "warning",
  6391. });
  6392. return;
  6393. }
  6394. // if (!this.gradeId) {
  6395. // this.$message({
  6396. // message: "暂无班级数据",
  6397. // type: "warning",
  6398. // });
  6399. // return;
  6400. // }
  6401. var polyvPlayerContext = this.player;
  6402. let noteDate = this.$tools.getZeroTime();
  6403. let noteSecond = polyvPlayerContext.j2s_getCurrentTime();
  6404. console.log(noteSecond, "noteSecond");
  6405. if (!noteSecond) {
  6406. if (noteSecond == 0) {
  6407. //播放结束
  6408. noteSecond = polyvPlayerContext.j2s_getCurrentTime();
  6409. }
  6410. if (!noteSecond) {
  6411. this.$message({
  6412. message: "视频暂未开始",
  6413. type: "warning",
  6414. });
  6415. return;
  6416. }
  6417. }
  6418. let data = {
  6419. gradeId: this.gradeId,
  6420. goodsId: this.goodsId,
  6421. sectionId: this.playSectionId,
  6422. courseId: this.courseId,
  6423. noteText: this.textareaNote,
  6424. noteDate: noteDate,
  6425. noteSecond: noteSecond,
  6426. moduleId: this.moduleId,
  6427. chapterId: this.chapterId,
  6428. };
  6429. this.$request.postNote(data).then((res) => {
  6430. this.$message({
  6431. message: "发布成功",
  6432. type: "success",
  6433. });
  6434. self.getNoteList();
  6435. this.textareaNote = "";
  6436. });
  6437. },
  6438. del(item) {
  6439. console.log(item);
  6440. let data = { answerId: item.answerId, status: -1 };
  6441. this.$request.delAnswer(data).then((res) => {
  6442. this.$message({
  6443. message: "删除成功",
  6444. type: "success",
  6445. });
  6446. this.getAnswerList();
  6447. });
  6448. },
  6449. /**
  6450. * 打印
  6451. */
  6452. printView(url) {
  6453. console.log("触发打印", url);
  6454. printJS({
  6455. printable: url,
  6456. type: "pdf",
  6457. header: null,
  6458. targetStyles: ["*"],
  6459. style: "@page {margin:0 10mm}",
  6460. });
  6461. // this.print(url);
  6462. },
  6463. // 打印方法
  6464. print(filePath) {
  6465. console.log("执行打印");
  6466. let iframe = document.createElement("iframe");
  6467. iframe.style.border = "0px";
  6468. iframe.style.position = "absolute";
  6469. iframe.style.width = "0px";
  6470. iframe.style.height = "0px";
  6471. iframe.style.right = "0px";
  6472. iframe.style.top = "0px";
  6473. iframe.setAttribute("src", filePath);
  6474. iframe.onload = () => {
  6475. iframe.contentWindow.print();
  6476. // setTimeout(() => {
  6477. // document.body.removeChild(iframe);
  6478. // });
  6479. };
  6480. document.body.append(iframe);
  6481. },
  6482. },
  6483. };
  6484. </script>
  6485. <!-- Add "scoped" attribute to limit CSS to this component only -->
  6486. <style scoped lang="scss">
  6487. .course-detail {
  6488. .living-img {
  6489. width: 17px;
  6490. vertical-align: middle;
  6491. }
  6492. .section {
  6493. padding-bottom: 30px;
  6494. &__header {
  6495. height: 40px;
  6496. display: flex;
  6497. align-items: center;
  6498. padding: 0 20px;
  6499. }
  6500. &__body {
  6501. .course-info {
  6502. &__header {
  6503. .left-box {
  6504. width: 810px;
  6505. height: 455px;
  6506. float: left;
  6507. background-size: cover;
  6508. background-position: center center;
  6509. background-repeat: no-repeat;
  6510. position: relative;
  6511. .video {
  6512. width: 100%;
  6513. height: 100%;
  6514. }
  6515. .live-btn {
  6516. position: absolute;
  6517. left: 0;
  6518. top: 0;
  6519. z-index: 999;
  6520. overflow: hidden;
  6521. width: 100%;
  6522. height: 100%;
  6523. background: url("~@/assets/live-bg.png") no-repeat center;
  6524. background-size: cover;
  6525. .btn {
  6526. display: block;
  6527. margin: 280px auto 0;
  6528. width: 160px;
  6529. height: 40px;
  6530. line-height: 40px;
  6531. padding: 0;
  6532. text-align: center;
  6533. border-radius: 20px;
  6534. }
  6535. }
  6536. }
  6537. .recordStyle {
  6538. position: absolute;
  6539. bottom: 90px;
  6540. padding: 6px 12px;
  6541. left: 8px;
  6542. background-color: rgba(0, 0, 0, 0.4);
  6543. color: #fff;
  6544. border-radius: 24px;
  6545. user-select: none;
  6546. .btn_sty {
  6547. cursor: pointer;
  6548. }
  6549. }
  6550. .right-box {
  6551. width: 462px;
  6552. height: 455px;
  6553. background: #060e1a;
  6554. border-radius: 0px;
  6555. float: right;
  6556. &__header {
  6557. .tabs {
  6558. /deep/.el-tabs__nav-wrap::after {
  6559. background-color: #999;
  6560. }
  6561. /deep/ .el-tabs__header {
  6562. margin: 0;
  6563. }
  6564. .label {
  6565. color: #fff;
  6566. height: 40px;
  6567. line-height: 40px;
  6568. padding: 0 20px;
  6569. }
  6570. .item {
  6571. &__title {
  6572. padding-left: 12px;
  6573. height: 40px;
  6574. line-height: 40px;
  6575. cursor: pointer;
  6576. font-size: 14px;
  6577. font-family: Microsoft YaHei;
  6578. font-weight: bold;
  6579. color: #fff;
  6580. .el-icon-caret-right,
  6581. .el-icon-caret-bottom {
  6582. color: #999;
  6583. }
  6584. }
  6585. &__content {
  6586. .bank-chapter {
  6587. &__item {
  6588. color: #fff;
  6589. font-size: 14px;
  6590. &__text {
  6591. padding: 8px 8px 8px 24px;
  6592. cursor: pointer;
  6593. flex: 1;
  6594. .el-icon-caret-right,
  6595. .el-icon-caret-bottom {
  6596. color: #999;
  6597. }
  6598. }
  6599. }
  6600. }
  6601. .bank-section {
  6602. &__item {
  6603. color: #fff;
  6604. font-size: 14px;
  6605. display: flex;
  6606. align-items: center;
  6607. &.active {
  6608. background: #132b4d;
  6609. font-size: 14px;
  6610. font-family: Microsoft YaHei;
  6611. font-weight: bold;
  6612. color: #3f8dfd;
  6613. }
  6614. &__text {
  6615. flex: 1;
  6616. padding: 8px 8px 8px 12px;
  6617. display: flex;
  6618. flex-direction: column;
  6619. justify-content: center;
  6620. cursor: pointer;
  6621. .el-icon-caret-right,
  6622. .el-icon-caret-bottom {
  6623. color: #999;
  6624. }
  6625. }
  6626. .test-btn {
  6627. margin-left: 10px;
  6628. width: 32px;
  6629. height: 20px;
  6630. background: #007aff;
  6631. border-radius: 4px;
  6632. line-height: 18px;
  6633. color: #fff;
  6634. text-align: center;
  6635. }
  6636. .note {
  6637. margin-left: 10px;
  6638. width: 32px;
  6639. height: 20px;
  6640. border: 1px solid #ff3b30;
  6641. border-radius: 4px;
  6642. line-height: 18px;
  6643. color: #ff3b30;
  6644. text-align: center;
  6645. &--yellow {
  6646. border-color: #ff9500;
  6647. color: #ff9500;
  6648. }
  6649. &--blue {
  6650. border-color: #3f8dfd;
  6651. color: #3f8dfd;
  6652. }
  6653. }
  6654. .during {
  6655. color: #999;
  6656. margin-right: 10px;
  6657. }
  6658. .btn {
  6659. margin-right: 12px;
  6660. width: 48px;
  6661. height: 20px;
  6662. border: 1px solid #ff3b30;
  6663. background: #ff3b30;
  6664. border-radius: 4px;
  6665. line-height: 18px;
  6666. color: #fff;
  6667. text-align: center;
  6668. &--green {
  6669. border: 1px solid #34c759;
  6670. background: #34c759;
  6671. }
  6672. }
  6673. .live-btn {
  6674. margin-left: 20px;
  6675. padding: 2px 5px;
  6676. border-radius: 4px;
  6677. background: #eeeeee;
  6678. line-height: 18px;
  6679. color: #666666;
  6680. text-align: center;
  6681. &--yellow {
  6682. background: #fff7eb;
  6683. color: #ff9500;
  6684. }
  6685. &--blue {
  6686. border-color: #ebf4ff;
  6687. color: #007aff;
  6688. }
  6689. }
  6690. }
  6691. }
  6692. }
  6693. }
  6694. }
  6695. .title {
  6696. height: 40px;
  6697. border-bottom: 1px solid #999;
  6698. color: #fff;
  6699. .select {
  6700. width: 100%;
  6701. }
  6702. /deep/ .el-input__icon {
  6703. width: 20px;
  6704. height: 20px;
  6705. border: 1px solid #fff;
  6706. border-radius: 4px;
  6707. margin-top: 10px;
  6708. line-height: 20px;
  6709. }
  6710. /deep/ .el-input__inner {
  6711. color: #fff;
  6712. font-size: 16px;
  6713. background: none;
  6714. border: 0;
  6715. }
  6716. }
  6717. }
  6718. &__body {
  6719. height: 374px;
  6720. overflow-y: scroll;
  6721. &::-webkit-scrollbar {
  6722. width: 6px;
  6723. }
  6724. &::-webkit-scrollbar-track {
  6725. background-color: #060e1a;
  6726. -webkit-border-radius: 2em;
  6727. -moz-border-radius: 2em;
  6728. border-radius: 2em;
  6729. }
  6730. &::-webkit-scrollbar-thumb {
  6731. background-color: #eeeeee;
  6732. -webkit-border-radius: 2em;
  6733. -moz-border-radius: 2em;
  6734. border-radius: 2em;
  6735. }
  6736. }
  6737. }
  6738. }
  6739. &__body {
  6740. /deep/ .el-tabs__item {
  6741. padding: 0 20px !important;
  6742. height: 80px;
  6743. line-height: 80px;
  6744. }
  6745. .course-img {
  6746. width: 100%;
  6747. }
  6748. .course-menu {
  6749. margin-top: 25px;
  6750. .left-box {
  6751. width: 948px;
  6752. float: left;
  6753. &__header {
  6754. padding-right: 50px;
  6755. position: relative;
  6756. .item {
  6757. width: auto;
  6758. margin-right: 24px;
  6759. font-size: 16px;
  6760. font-family: Microsoft YaHei;
  6761. font-weight: 400;
  6762. color: #333333;
  6763. background: #eeeeee;
  6764. border-radius: 8px;
  6765. padding: 12px;
  6766. position: relative;
  6767. &.canlearn {
  6768. background: #3f8dfd;
  6769. color: #fff;
  6770. }
  6771. }
  6772. }
  6773. &__body {
  6774. .buy-note {
  6775. margin-right: 50px;
  6776. }
  6777. .item {
  6778. margin-top: 24px;
  6779. padding: 16px;
  6780. background: #eee;
  6781. border-radius: 10px;
  6782. &__title {
  6783. font-size: 16px;
  6784. font-family: Microsoft YaHei;
  6785. font-weight: bold;
  6786. color: #333333;
  6787. .note {
  6788. display: inline-block;
  6789. margin-left: 20px;
  6790. width: 40px;
  6791. height: 24px;
  6792. border: 1px solid #ff3b30;
  6793. border-radius: 8px;
  6794. line-height: 22px;
  6795. color: #ff3b30;
  6796. text-align: center;
  6797. }
  6798. }
  6799. &__content {
  6800. margin-top: 12px;
  6801. background: #f5f7fa;
  6802. }
  6803. }
  6804. }
  6805. }
  6806. .right-box {
  6807. width: 255px;
  6808. float: right;
  6809. .title {
  6810. font-size: 16px;
  6811. font-family: Microsoft YaHei;
  6812. font-weight: 400;
  6813. color: #333333;
  6814. text-shadow: 0px 6px 6px rgba(85, 158, 255, 0.08);
  6815. position: relative;
  6816. .more {
  6817. font-size: 16px;
  6818. font-family: Microsoft YaHei;
  6819. font-weight: 400;
  6820. color: #999999;
  6821. position: absolute;
  6822. right: 0;
  6823. }
  6824. }
  6825. .list {
  6826. .course-item {
  6827. }
  6828. }
  6829. }
  6830. }
  6831. .answer-question {
  6832. &__header {
  6833. border-bottom: 1px solid #eee;
  6834. .textarea-wrap {
  6835. background: #f9f9f9;
  6836. border: 1px solid #eeeeee;
  6837. border-radius: 8px;
  6838. .textarea {
  6839. height: 100%;
  6840. }
  6841. }
  6842. .submit {
  6843. padding: 10px 20px;
  6844. border-radius: 20px;
  6845. text-align: center;
  6846. font-size: 16px;
  6847. margin: 10px 0;
  6848. float: right;
  6849. }
  6850. }
  6851. &__body {
  6852. .question-list {
  6853. &__item {
  6854. padding: 20px 0;
  6855. display: flex;
  6856. &__avatar {
  6857. width: 40px;
  6858. height: 40px;
  6859. display: table-cell;
  6860. border-radius: 50%;
  6861. text-align: center;
  6862. img {
  6863. display: inline-block;
  6864. vertical-align: middle;
  6865. max-width: 100%;
  6866. max-height: 100%;
  6867. }
  6868. }
  6869. &__content {
  6870. flex: 1;
  6871. border-bottom: 1px solid #ccc;
  6872. margin-left: 10px;
  6873. .nickname {
  6874. font-size: 14px;
  6875. font-family: Microsoft YaHei;
  6876. font-weight: bold;
  6877. color: #333333;
  6878. line-height: 24px;
  6879. }
  6880. .desc {
  6881. font-size: 14px;
  6882. font-family: Microsoft YaHei;
  6883. font-weight: 400;
  6884. color: #666666;
  6885. line-height: 24px;
  6886. }
  6887. .time {
  6888. font-size: 14px;
  6889. font-family: Microsoft YaHei;
  6890. font-weight: 400;
  6891. color: #999999;
  6892. line-height: 24px;
  6893. .replay {
  6894. float: right;
  6895. font-size: 14px;
  6896. font-family: Microsoft YaHei;
  6897. font-weight: 400;
  6898. color: #3f8dfd;
  6899. line-height: 24px;
  6900. margin-right: 20px;
  6901. }
  6902. .del {
  6903. float: right;
  6904. cursor: pointer;
  6905. font-size: 14px;
  6906. font-family: Microsoft YaHei;
  6907. font-weight: 400;
  6908. color: #ff3b30;
  6909. line-height: 24px;
  6910. margin-right: 20px;
  6911. }
  6912. }
  6913. .reply-list {
  6914. margin: 20px 0;
  6915. width: 100%;
  6916. background: #f9f9f9;
  6917. border-radius: 8px;
  6918. padding: 0 0 0 20px;
  6919. &__item {
  6920. padding: 20px 0;
  6921. display: flex;
  6922. border-bottom: 1px solid #ccc;
  6923. &:nth-last-of-type(1) {
  6924. border: 0;
  6925. }
  6926. &__avatar {
  6927. width: 40px;
  6928. height: 40px;
  6929. display: table-cell;
  6930. border-radius: 50%;
  6931. text-align: center;
  6932. img {
  6933. display: inline-block;
  6934. vertical-align: middle;
  6935. max-width: 100%;
  6936. max-height: 100%;
  6937. }
  6938. }
  6939. &__content {
  6940. border-radius: 8px;
  6941. flex: 1;
  6942. margin-left: 10px;
  6943. .nickname {
  6944. font-size: 14px;
  6945. font-family: Microsoft YaHei;
  6946. font-weight: bold;
  6947. color: #333333;
  6948. line-height: 24px;
  6949. }
  6950. .desc {
  6951. font-size: 14px;
  6952. font-family: Microsoft YaHei;
  6953. font-weight: 400;
  6954. color: #666666;
  6955. line-height: 24px;
  6956. }
  6957. .time {
  6958. font-size: 14px;
  6959. font-family: Microsoft YaHei;
  6960. font-weight: 400;
  6961. color: #999999;
  6962. line-height: 24px;
  6963. .reply {
  6964. float: right;
  6965. font-size: 14px;
  6966. font-family: Microsoft YaHei;
  6967. font-weight: 400;
  6968. color: #3f8dfd;
  6969. line-height: 24px;
  6970. margin-right: 20px;
  6971. cursor: pointer;
  6972. user-select: none;
  6973. }
  6974. .del {
  6975. cursor: pointer;
  6976. margin-right: 20px;
  6977. float: right;
  6978. font-size: 14px;
  6979. font-family: Microsoft YaHei;
  6980. font-weight: 400;
  6981. color: #ff3b30;
  6982. line-height: 24px;
  6983. }
  6984. }
  6985. }
  6986. }
  6987. }
  6988. }
  6989. }
  6990. }
  6991. }
  6992. }
  6993. .lecture-notes {
  6994. &__content {
  6995. .left-box {
  6996. float: left;
  6997. width: 462px;
  6998. .textarea {
  6999. border-bottom: 1px solid #eee;
  7000. .submit {
  7001. float: right;
  7002. width: 138px;
  7003. padding: 10px 0;
  7004. margin: 10px 0 25px 0;
  7005. border-radius: 20px;
  7006. text-align: center;
  7007. font-size: 16px;
  7008. }
  7009. }
  7010. .note-list {
  7011. &__content {
  7012. border-bottom: 1px solid #eee;
  7013. &__title {
  7014. width: 216px;
  7015. height: 24px;
  7016. background: #ccc;
  7017. border-radius: 24px;
  7018. font-size: 14px;
  7019. color: #666666;
  7020. text-align: center;
  7021. line-height: 24px;
  7022. margin: 20px 0;
  7023. }
  7024. }
  7025. &__item {
  7026. display: flex;
  7027. padding: 15px;
  7028. .el-icon-video-play {
  7029. cursor: pointer;
  7030. font-size: 20px;
  7031. color: #3f8dfd;
  7032. }
  7033. &__content {
  7034. flex: 1;
  7035. margin-left: 10px;
  7036. .title {
  7037. cursor: pointer;
  7038. font-size: 14px;
  7039. font-family: Microsoft YaHei;
  7040. font-weight: bold;
  7041. color: #3f8dfd;
  7042. line-height: 24px;
  7043. }
  7044. .desc {
  7045. font-size: 14px;
  7046. font-family: Microsoft YaHei;
  7047. font-weight: 400;
  7048. color: #666666;
  7049. line-height: 24px;
  7050. }
  7051. .time {
  7052. font-size: 14px;
  7053. font-family: Microsoft YaHei;
  7054. font-weight: 400;
  7055. color: #999999;
  7056. line-height: 24px;
  7057. }
  7058. }
  7059. }
  7060. }
  7061. .pagination {
  7062. margin-top: 30px;
  7063. text-align: center;
  7064. }
  7065. }
  7066. .right-box {
  7067. width: 786px;
  7068. float: right;
  7069. .lecture-list {
  7070. background: #f5f7fa;
  7071. border-radius: 8px;
  7072. &__header {
  7073. padding: 0 16px;
  7074. height: 40px;
  7075. line-height: 40px;
  7076. font-size: 18px;
  7077. font-family: Microsoft YaHei;
  7078. font-weight: bold;
  7079. color: #333333;
  7080. .slide-btn {
  7081. cursor: pointer;
  7082. float: right;
  7083. font-size: 14px;
  7084. font-family: Microsoft YaHei;
  7085. font-weight: 400;
  7086. color: #999999;
  7087. }
  7088. }
  7089. &__body {
  7090. .list {
  7091. &__item {
  7092. border-top: 1px solid #fff;
  7093. padding: 0 8px 0 16px;
  7094. height: 56px;
  7095. line-height: 55px;
  7096. display: flex;
  7097. align-items: center;
  7098. .title {
  7099. flex: 1;
  7100. font-size: 16px;
  7101. font-family: Microsoft YaHei;
  7102. font-weight: 400;
  7103. color: #333333;
  7104. }
  7105. .btns {
  7106. .btn {
  7107. cursor: pointer;
  7108. display: inline-block;
  7109. vertical-align: middle;
  7110. width: 80px;
  7111. height: 32px;
  7112. background: #ffffff;
  7113. border: 1px solid #3f8dfd;
  7114. border-radius: 16px;
  7115. text-align: center;
  7116. line-height: 30px;
  7117. color: #3f8dfd;
  7118. margin: 0 8px;
  7119. }
  7120. }
  7121. }
  7122. }
  7123. }
  7124. &__footer {
  7125. margin-top: 24px;
  7126. .lecture-scan {
  7127. background: #f5f7fa;
  7128. border-radius: 8px;
  7129. overflow: hidden;
  7130. &__header {
  7131. height: 40px;
  7132. line-height: 40px;
  7133. padding: 0 16px;
  7134. font-size: 16px;
  7135. font-family: Microsoft YaHei;
  7136. font-weight: bold;
  7137. color: #333333;
  7138. }
  7139. &__body {
  7140. height: 800px;
  7141. text-align: center;
  7142. overflow-y: scroll;
  7143. .iframe {
  7144. width: 100%;
  7145. }
  7146. }
  7147. }
  7148. }
  7149. }
  7150. }
  7151. }
  7152. }
  7153. }
  7154. }
  7155. }
  7156. }
  7157. .take-photo {
  7158. /deep/ .el-dialog__header {
  7159. display: none;
  7160. }
  7161. /deep/ .el-dialog__body {
  7162. padding: 0;
  7163. overflow: unset;
  7164. }
  7165. &__close {
  7166. cursor: pointer;
  7167. position: absolute;
  7168. right: 0;
  7169. top: -28px;
  7170. width: 24px;
  7171. height: 24px;
  7172. line-height: 24px;
  7173. text-align: center;
  7174. color: #eee;
  7175. border: 1px solid #eee;
  7176. border-radius: 50%;
  7177. }
  7178. &__header {
  7179. height: 40px;
  7180. border-bottom: 1px solid #eee;
  7181. line-height: 40px;
  7182. font-size: 16px;
  7183. font-family: Microsoft YaHei;
  7184. font-weight: bold;
  7185. color: #333333;
  7186. padding-left: 24px;
  7187. }
  7188. &__body {
  7189. // height: 400px;
  7190. padding: 40px 24px;
  7191. .left-box {
  7192. width: 336px;
  7193. float: left;
  7194. .title {
  7195. font-size: 16px;
  7196. font-family: Microsoft YaHei;
  7197. font-weight: bold;
  7198. color: #ff3b30;
  7199. line-height: 24px;
  7200. }
  7201. .content {
  7202. font-size: 14px;
  7203. font-family: Microsoft YaHei;
  7204. font-weight: 400;
  7205. color: #333333;
  7206. line-height: 28px;
  7207. margin-top: 32px;
  7208. }
  7209. }
  7210. .right-box {
  7211. float: right;
  7212. width: 400px;
  7213. height: 400px;
  7214. position: relative;
  7215. overflow: hidden;
  7216. video {
  7217. width: 100%;
  7218. height: 100%;
  7219. }
  7220. .mask {
  7221. width: 55%;
  7222. height: 200px;
  7223. position: absolute;
  7224. top: 0;
  7225. left: 0;
  7226. right: 0;
  7227. bottom: 0;
  7228. margin: 30px auto 0;
  7229. box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.4);
  7230. }
  7231. }
  7232. }
  7233. &__footer {
  7234. height: 90px;
  7235. border-top: 1px solid #eee;
  7236. text-align: center;
  7237. .take {
  7238. display: inline-block;
  7239. width: 200px;
  7240. height: 40px;
  7241. padding: 0;
  7242. border-radius: 20px;
  7243. text-align: center;
  7244. line-height: 40px;
  7245. margin: 24px auto;
  7246. }
  7247. }
  7248. }
  7249. .info {
  7250. &__content {
  7251. height: 500px;
  7252. overflow-y: scroll;
  7253. .handCenter {
  7254. width: 600px;
  7255. height: 300px;
  7256. background: #ccc;
  7257. }
  7258. .upload-box {
  7259. display: inline-block;
  7260. vertical-align: top;
  7261. .el-icon-error {
  7262. cursor: pointer;
  7263. z-index: 99;
  7264. position: absolute;
  7265. left: 100%;
  7266. bottom: 100%;
  7267. font-size: 20px;
  7268. color: red;
  7269. }
  7270. }
  7271. }
  7272. }
  7273. .showconfirm {
  7274. &__content {
  7275. .text {
  7276. padding-bottom: 20px;
  7277. color: red;
  7278. }
  7279. }
  7280. }
  7281. }
  7282. </style>