index.vue 250 KB

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