index.vue 320 KB

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