index.vue 276 KB

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