index.vue 250 KB

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