index.vue 319 KB

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