12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975 |
- <template>
- <div class="course-detail">
- <Header></Header>
- <section class="section">
- <div class="container">
- <div class="section__header">
- <div class="container">
- <el-breadcrumb separator="/">
- <el-breadcrumb-item :to="{ path: '/index' }"
- >首页</el-breadcrumb-item
- >
- <el-breadcrumb-item>课程详情</el-breadcrumb-item>
- </el-breadcrumb>
- </div>
- </div>
- <div class="section__body">
- <div class="container">
- <div class="course-info">
- <div class="course-info__header clearfix">
- <div class="title">
- <span>{{ changeName(courseId) }}</span>
- <el-button
- v-if="courseTotal > 1"
- size="mini"
- type="primary"
- plain
- icon="el-icon-sort"
- style="margin-left: 14px"
- @click="openChangeCourseBoxs"
- >切换课程</el-button
- >
- </div>
- <div
- class="left-box"
- :style="{
- backgroundImage: `url(${$tools.splitImgHost(
- goodsData.coverUrl,
- false
- )})`,
- }"
- >
- <div v-show="vid" id="player"></div>
- <div v-show="vidzb" id="playerzb"></div>
- <div class="recordStyle" v-if="showRecordStatus">
- 您上次看到{{
- $tools.secondToTime(recordObj.videoCurrentTime)
- }},正在自动续播<span
- style="
- display: inline-block;
- width: 50px;
- text-align: center;
- "
- >|</span
- >
- <span class="btn_sty" @click="backLI">从头播放</span>
- </div>
- </div>
- <div class="right-box">
- <div class="right-box__header">
- <div class="tabs">
- <el-tabs
- v-model="courseTabIndex"
- @tab-click="handleClick"
- >
- <el-tab-pane
- :name="tab.name"
- v-for="(tab, index) in menuTab"
- :key="index"
- >
- <div slot="label">
- <span class="label">{{ tab.label }}</span>
- </div>
- <!-- 章节目录 -->
- <template v-if="tab.name == '1'">
- <div
- v-if="teacherList && teacherList.length > 0"
- class="teacherList_name"
- >
- <div
- v-for="(tea, index) in teacherList"
- :key="index"
- class="names"
- :class="{ nactive: teaIndex == index }"
- @click="activeFunc(tea.courseId, index)"
- >
- {{ tea.aliasName }}
- </div>
- </div>
- <div class="right-box__body">
- <div
- class="item"
- v-for="(menu, index) in menuList"
- :key="index"
- >
- <template v-if="menu.type == 1">
- <div
- class="item__title"
- @click="openModule(menu)"
- >
- <i
- :class="{
- 'el-icon-caret-right': !menu.showList,
- 'el-icon-caret-bottom': menu.showList,
- }"
- ></i>
- {{ menu.menuName }}
- </div>
- <div class="item__content">
- <div
- class="bank-chapter"
- v-if="menu.showList"
- >
- <div
- class="bank-chapter__item"
- v-for="(
- chapter, chapterIndex
- ) in menu.list"
- :key="chapterIndex"
- >
- <div
- v-if="chapter.type == 1"
- class="bank-chapter__item__text"
- @click="openChapter(chapter)"
- >
- <i
- :class="{
- 'el-icon-caret-right':
- !chapter.showList,
- 'el-icon-caret-bottom':
- chapter.showList,
- }"
- ></i
- >{{ chapter.name }}
- </div>
- <div
- class="bank-section"
- v-if="
- chapter.showList &&
- chapter.type == 1
- "
- >
- <div
- class="bank-section__item"
- :class="{
- active: isActive(section),
- }"
- v-for="(
- section, sectionIndex
- ) in chapter.list"
- :key="sectionIndex"
- @click="getResource(section, 1)"
- >
- <template v-if="section.type != 2">
- <template>
- <div
- class="note note--blue"
- v-if="
- section.sectionType == 1
- "
- >
- 视频
- </div>
- <div
- class="note"
- v-if="
- section.sectionType == 2
- "
- >
- 直播
- </div>
- <div
- class="note note--yellow"
- v-if="
- section.sectionType == 3
- "
- >
- 回放
- </div>
- <div
- class="
- bank-section__item__text
- "
- >
- {{ section.name }}
- <div
- style="font-size: 12px"
- v-if="
- section.liveStartTime >
- nowTime
- "
- >
- <span>{{
- $tools.timestampToTime(
- section.liveStartTime,
- (isDay = false)
- )
- }}</span
- >-
- <span>{{
- $tools.timestampToTime(
- section.liveEndTime,
- (isDay = false)
- )
- }}</span>
- </div>
- </div>
- </template>
- <div
- class="lear-state"
- v-if="isActive(section)"
- >
- <img
- src="../../assets/learing.gif"
- alt=""
- />
- </div>
- <template
- v-if="section.durationTime > 0"
- >
- <div class="during">
- {{
- $tools.secondToDate(
- section.durationTime
- )
- }}
- </div>
- </template>
- <template>
- <div
- class="btn"
- v-if="section.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="section.learning == 1"
- >
- 已学完
- </div>
- </template>
- </template>
- <template
- v-if="
- section.liveStartTime &&
- section.sectionType == 2
- "
- >
- <div
- class="
- live-btn live-btn--blue
- "
- v-if="
- section.liveStartTime >
- nowTime
- "
- >
- 待开播
- </div>
- <div
- class="
- live-btn live-btn--yellow
- "
- v-if="
- section.liveStartTime <=
- nowTime &&
- section.liveEndTime >
- nowTime
- "
- >
- 直播中
- </div>
- <div
- class="live-btn"
- v-if="
- section.liveEndTime <
- nowTime
- "
- >
- 已结束
- </div>
- </template>
- <template
- v-if="
- checkSection(
- section.sectionId,
- 'sectionExam'
- )
- "
- >
- <div
- class="exercises"
- @click.stop="
- handelPracticeOrRxam(
- section,
- 2
- )
- "
- >
- 习题
- <i
- class="
- el-icon-arrow-right
- icons
- "
- ></i>
- </div>
- </template>
- </template>
- <template v-if="section.type == 2">
- <template>
- <div
- class="test-btn"
- v-if="section.doType == 1"
- >
- 练习
- </div>
- <div
- class="test-btn"
- v-if="section.doType != 1"
- >
- 考试
- </div>
- </template>
- <div
- class="bank-section__item__text"
- >
- {{ section.name }}
- </div>
- <template>
- <div
- class="btn"
- v-if="section.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="section.learning == 1"
- >
- 合格
- </div>
- <div
- class="btn btn--red"
- v-if="section.learning == 0"
- >
- 不合格
- </div>
- <div
- class="btn btn--green"
- v-if="section.rebuild > 0"
- >
- 待重测
- </div>
- </template>
- </template>
- </template>
- </div>
- </div>
- <div
- v-if="chapter.type == 2"
- class="bank-section__item"
- @click="getResource(chapter, 3)"
- >
- <template>
- <template>
- <div
- class="test-btn"
- v-if="chapter.doType == 1"
- >
- 练习
- </div>
- <div
- class="test-btn"
- v-if="chapter.doType != 1"
- >
- 考试
- </div>
- </template>
- <div
- class="bank-section__item__text"
- >
- {{ chapter.name }}
- </div>
- <template>
- <div
- class="btn btn--green"
- v-if="chapter.learning == 1"
- >
- 合格
- </div>
- <div
- class="btn btn--red"
- v-if="chapter.learning == 0"
- >
- 不合格
- </div>
- </template>
- </template>
- </div>
- </div>
- </div>
- </div>
- </template>
- <template v-if="menu.type == 2">
- <div class="item__content">
- <div class="bank-chapter">
- <div class="bank-chapter__item">
- <div
- class="bank-chapter__item__text"
- @click="openChapter(menu)"
- >
- <i
- :class="{
- 'el-icon-caret-right':
- !menu.showList,
- 'el-icon-caret-bottom':
- menu.showList,
- }"
- ></i
- >{{ menu.menuName }}
- </div>
- <div
- class="bank-section"
- v-if="menu.showList"
- >
- <div
- class="bank-section__item"
- :class="{
- active: isActive(section),
- }"
- v-for="(
- section, sectionIndex
- ) in menu.list"
- :key="sectionIndex"
- @click="getResource(section, 1)"
- >
- <template v-if="section.type != 2">
- <template>
- <div
- class="note note--blue"
- v-if="
- section.sectionType == 1
- "
- >
- 视频
- </div>
- <div
- class="note"
- v-if="
- section.sectionType == 2
- "
- >
- 直播
- </div>
- <div
- class="note note--yellow"
- v-if="
- section.sectionType == 3
- "
- >
- 回放
- </div>
- </template>
- <div
- class="bank-section__item__text"
- >
- {{ section.name }}
- <div
- style="font-size: 12px"
- v-if="
- section.liveStartTime >
- nowTime
- "
- >
- <span>{{
- $tools.timestampToTime(
- section.liveStartTime,
- (isDay = false)
- )
- }}</span
- >-
- <span>{{
- $tools.timestampToTime(
- section.liveEndTime,
- (isDay = false)
- )
- }}</span>
- </div>
- </div>
- <template
- v-if="section.durationTime > 0"
- >
- <div class="during">
- {{
- $tools.secondToDate(
- section.durationTime
- )
- }}
- </div>
- </template>
- <template>
- <div
- class="btn"
- v-if="section.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="section.learning == 1"
- >
- 已学完
- </div>
- </template>
- </template>
- <template
- v-if="
- section.liveStartTime &&
- section.sectionType == 2
- "
- >
- <div
- class="
- live-btn live-btn--blue
- "
- v-if="
- section.liveStartTime >
- nowTime
- "
- >
- 待开播
- </div>
- <div
- class="
- live-btn live-btn--yellow
- "
- v-if="
- section.liveStartTime <=
- nowTime &&
- section.liveEndTime >
- nowTime
- "
- >
- 直播中
- </div>
- <div
- class="live-btn"
- v-if="
- section.liveEndTime <
- nowTime
- "
- >
- 已结束
- </div>
- </template>
- <template
- v-if="
- checkSection(
- section.sectionId,
- 'sectionExam'
- )
- "
- >
- <div
- class="exercises"
- @click.stop="
- handelPracticeOrRxam(
- section,
- 2
- )
- "
- >
- 习题
- <i
- class="
- el-icon-arrow-right
- icons
- "
- ></i>
- </div>
- </template>
- </template>
- <template v-if="section.type == 2">
- <template>
- <div
- class="test-btn"
- v-if="section.doType == 1"
- >
- 练习
- </div>
- <div
- class="test-btn"
- v-if="section.doType != 1"
- >
- 考试
- </div>
- </template>
- <div
- class="bank-section__item__text"
- >
- {{ section.name }}
- </div>
- <template>
- <div
- class="btn"
- v-if="section.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="section.learning == 1"
- >
- 合格
- </div>
- <div
- class="btn btn--red"
- v-if="section.learning == 0"
- >
- 不合格
- </div>
- <div
- class="btn btn--green"
- v-if="section.rebuild > 0"
- >
- 待重测
- </div>
- </template>
- </template>
- </template>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <template v-if="menu.type == 3">
- <div class="item__content">
- <div class="bank-section">
- <div
- class="bank-section__item"
- :class="{
- active: isActive(menu),
- }"
- @click="getResource(menu, 1)"
- >
- <template>
- <div
- class="note note--blue"
- v-if="menu.sectionType == 1"
- >
- 视频
- </div>
- <div
- class="note"
- v-if="menu.sectionType == 2"
- >
- 直播
- </div>
- <div
- class="note note--yellow"
- v-if="menu.sectionType == 3"
- >
- 回放
- </div>
- <div class="bank-section__item__text">
- {{ menu.name }}
- <div
- style="font-size: 12px"
- v-if="
- menu.liveStartTime > nowTime
- "
- >
- <span>{{
- $tools.timestampToTime(
- menu.liveStartTime,
- (isDay = false)
- )
- }}</span
- >-
- <span>{{
- $tools.timestampToTime(
- menu.liveEndTime,
- (isDay = false)
- )
- }}</span>
- </div>
- </div>
- </template>
- <template v-if="menu.durationTime > 0">
- <div class="during">
- {{
- $tools.secondToDate(
- menu.durationTime
- )
- }}
- </div>
- </template>
- <template>
- <div
- class="btn"
- v-if="menu.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="menu.learning == 1"
- >
- 已学完
- </div>
- </template>
- </template>
- <template
- v-if="
- menu.liveStartTime &&
- menu.sectionType == 2
- "
- >
- <div
- class="live-btn live-btn--blue"
- v-if="menu.liveStartTime > nowTime"
- >
- 待开播
- </div>
- <div
- class="live-btn live-btn--yellow"
- v-if="
- menu.liveStartTime <= nowTime &&
- menu.liveEndTime > nowTime
- "
- >
- 直播中
- </div>
- <div
- class="live-btn"
- v-if="menu.liveEndTime < nowTime"
- >
- 已结束
- </div>
- </template>
- <template
- v-if="
- checkSection(
- menu.menuId,
- 'sectionExamList'
- )
- "
- >
- <div
- class="exercises"
- @click.stop="
- handelPracticeOrRxam(menu, 3)
- "
- >
- 习题
- <i
- class="el-icon-arrow-right icons"
- ></i>
- </div>
- </template>
- </div>
- </div>
- </div>
- </template>
- </div>
- </div>
- </template>
- <!-- 重修目录 -->
- <template v-if="tab.name == '2'">
- <div class="right-box__body">
- <div
- class="item"
- v-for="(menu, index) in reMenuList"
- :key="index"
- >
- <template v-if="menu.type == 1">
- <div
- class="item__title"
- @click="openModule(menu)"
- >
- <i
- :class="{
- 'el-icon-caret-right': !menu.showList,
- 'el-icon-caret-bottom': menu.showList,
- }"
- ></i>
- {{ menu.menuName }}
- </div>
- <div class="item__content">
- <div
- class="bank-chapter"
- v-if="menu.showList"
- >
- <div
- class="bank-chapter__item"
- v-for="(
- chapter, chapterIndex
- ) in menu.list"
- :key="chapterIndex"
- >
- <div
- class="bank-chapter__item__text"
- @click="openChapter(chapter)"
- >
- <i
- :class="{
- 'el-icon-caret-right':
- !chapter.showList,
- 'el-icon-caret-bottom':
- chapter.showList,
- }"
- ></i
- >{{ chapter.name }}
- </div>
- <div
- class="bank-section"
- v-if="chapter.showList"
- >
- <div
- class="bank-section__item"
- :class="{
- active: isActive(section),
- }"
- v-for="(
- section, sectionIndex
- ) in chapter.list"
- :key="sectionIndex"
- @click="getResource(section, 1)"
- >
- <template v-if="section.type != 2">
- <template>
- <div
- class="note note--blue"
- v-if="
- section.sectionType == 1
- "
- >
- 视频
- </div>
- <div
- class="note"
- v-if="
- section.sectionType == 2
- "
- >
- 直播
- </div>
- <div
- class="note note--yellow"
- v-if="
- section.sectionType == 3
- "
- >
- 回放
- </div>
- <div
- class="
- bank-section__item__text
- "
- >
- {{ section.name }}
- <div
- style="font-size: 12px"
- v-if="
- section.liveStartTime >
- nowTime
- "
- >
- <span>{{
- $tools.timestampToTime(
- section.liveStartTime,
- (isDay = false)
- )
- }}</span
- >-
- <span>{{
- $tools.timestampToTime(
- section.liveEndTime,
- (isDay = false)
- )
- }}</span>
- </div>
- </div>
- </template>
- <template
- v-if="section.durationTime > 0"
- >
- <div class="during">
- {{
- $tools.secondToDate(
- section.durationTime
- )
- }}
- </div>
- </template>
- <template>
- <div
- class="btn"
- v-if="section.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="section.learning == 1"
- >
- 已学完
- </div>
- </template>
- </template>
- <template
- v-if="
- section.liveStartTime &&
- section.sectionType == 2
- "
- >
- <div
- class="
- live-btn live-btn--blue
- "
- v-if="
- section.liveStartTime >
- nowTime
- "
- >
- 待开播
- </div>
- <div
- class="
- live-btn live-btn--yellow
- "
- v-if="
- section.liveStartTime <=
- nowTime &&
- section.liveEndTime >
- nowTime
- "
- >
- 直播中
- </div>
- <div
- class="live-btn"
- v-if="
- section.liveEndTime <
- nowTime
- "
- >
- 已结束
- </div>
- </template>
- </template>
- <template v-if="section.type == 2">
- <template>
- <div
- class="test-btn"
- v-if="section.doType == 1"
- >
- 练习
- </div>
- <div
- class="test-btn"
- v-if="section.doType != 1"
- >
- 考试
- </div>
- </template>
- <div
- class="bank-section__item__text"
- >
- {{ section.name }}
- </div>
- <template>
- <div
- class="btn"
- v-if="section.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="section.learning == 1"
- >
- 合格
- </div>
- <div
- class="btn btn--red"
- v-if="section.learning == 0"
- >
- 不合格
- </div>
- <div
- class="btn btn--green"
- v-if="section.rebuild > 0"
- >
- 待重测
- </div>
- </template>
- </template>
- </template>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <template v-if="menu.type == 2">
- <div class="item__content">
- <div class="bank-chapter">
- <div class="bank-chapter__item">
- <div
- class="bank-chapter__item__text"
- @click="openChapter(menu)"
- >
- <i
- :class="{
- 'el-icon-caret-right':
- !menu.showList,
- 'el-icon-caret-bottom':
- menu.showList,
- }"
- ></i
- >{{ menu.menuName }}
- </div>
- <div
- class="bank-section"
- v-if="menu.showList"
- >
- <div
- class="bank-section__item"
- :class="{
- active: isActive(section),
- }"
- v-for="(
- section, sectionIndex
- ) in menu.list"
- :key="sectionIndex"
- @click="getResource(section, 1)"
- >
- <template v-if="section.type != 2">
- <template>
- <div
- class="note note--blue"
- v-if="
- section.sectionType == 1
- "
- >
- 视频
- </div>
- <div
- class="note"
- v-if="
- section.sectionType == 2
- "
- >
- 直播
- </div>
- <div
- class="note note--yellow"
- v-if="
- section.sectionType == 3
- "
- >
- 回放
- </div>
- </template>
- <div
- class="bank-section__item__text"
- >
- {{ section.name }}
- <div
- style="font-size: 12px"
- v-if="
- section.liveStartTime >
- nowTime
- "
- >
- <span>{{
- $tools.timestampToTime(
- section.liveStartTime,
- (isDay = false)
- )
- }}</span
- >-
- <span>{{
- $tools.timestampToTime(
- section.liveEndTime,
- (isDay = false)
- )
- }}</span>
- </div>
- </div>
- <template
- v-if="section.durationTime > 0"
- >
- <div class="during">
- {{
- $tools.secondToDate(
- section.durationTime
- )
- }}
- </div>
- </template>
- <template>
- <div
- class="btn"
- v-if="section.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="section.learning == 1"
- >
- 已学完
- </div>
- </template>
- </template>
- <template
- v-if="
- section.liveStartTime &&
- section.sectionType == 2
- "
- >
- <div
- class="
- live-btn live-btn--blue
- "
- v-if="
- section.liveStartTime >
- nowTime
- "
- >
- 待开播
- </div>
- <div
- class="
- live-btn live-btn--yellow
- "
- v-if="
- section.liveStartTime <=
- nowTime &&
- section.liveEndTime >
- nowTime
- "
- >
- 直播中
- </div>
- <div
- class="live-btn"
- v-if="
- section.liveEndTime <
- nowTime
- "
- >
- 已结束
- </div>
- </template>
- </template>
- <template v-if="section.type == 2">
- <template>
- <div
- class="test-btn"
- v-if="section.doType == 1"
- >
- 练习
- </div>
- <div
- class="test-btn"
- v-if="section.doType != 1"
- >
- 考试
- </div>
- </template>
- <div
- class="bank-section__item__text"
- >
- {{ section.name }}
- </div>
- <template>
- <div
- class="btn"
- v-if="section.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="section.learning == 1"
- >
- 合格
- </div>
- <div
- class="btn btn--red"
- v-if="section.learning == 0"
- >
- 不合格
- </div>
- <div
- class="btn btn--green"
- v-if="section.rebuild > 0"
- >
- 待重测
- </div>
- </template>
- </template>
- </template>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <template v-if="menu.type == 3">
- <div class="item__content">
- <div class="bank-section">
- <div
- class="bank-section__item"
- :class="{
- active: isActive(menu),
- }"
- @click="getResource(menu, 1)"
- >
- <template>
- <div
- class="note note--blue"
- v-if="menu.sectionType == 1"
- >
- 视频
- </div>
- <div
- class="note"
- v-if="menu.sectionType == 2"
- >
- 直播
- </div>
- <div
- class="note note--yellow"
- v-if="menu.sectionType == 3"
- >
- 回放
- </div>
- <div class="bank-section__item__text">
- {{ menu.name }}
- <div
- style="font-size: 12px"
- v-if="
- menu.liveStartTime > nowTime
- "
- >
- <span>{{
- $tools.timestampToTime(
- menu.liveStartTime,
- (isDay = false)
- )
- }}</span
- >-
- <span>{{
- $tools.timestampToTime(
- menu.liveEndTime,
- (isDay = false)
- )
- }}</span>
- </div>
- </div>
- </template>
- <template v-if="menu.durationTime > 0">
- <div class="during">
- {{
- $tools.secondToDate(
- menu.durationTime
- )
- }}
- </div>
- </template>
- <template>
- <div
- class="btn"
- v-if="menu.rebuild > 0"
- >
- 待重修
- </div>
- <template v-else>
- <div
- class="btn btn--green"
- v-if="menu.learning == 1"
- >
- 已学完
- </div>
- </template>
- </template>
- <template
- v-if="
- menu.liveStartTime &&
- menu.sectionType == 2
- "
- >
- <div
- class="live-btn live-btn--blue"
- v-if="menu.liveStartTime > nowTime"
- >
- 待开播
- </div>
- <div
- class="live-btn live-btn--yellow"
- v-if="
- menu.liveStartTime <= nowTime &&
- menu.liveEndTime > nowTime
- "
- >
- 直播中
- </div>
- <div
- class="live-btn"
- v-if="menu.liveEndTime < nowTime"
- >
- 已结束
- </div>
- </template>
- </div>
- </div>
- </div>
- </template>
- </div>
- </div>
- </template>
- <template v-if="tab.name == '3'">
- <div class="answer-question">
- <div class="answer-question__header clearfix">
- <div class="textarea-wrap">
- <el-input
- class="textarea"
- resize="none"
- v-model="textarea"
- rows="3"
- type="textarea"
- placeholder="请输入"
- maxlength="1000"
- show-word-limit
- ></el-input>
- </div>
- <el-button
- type="primary"
- class="submit"
- @click="addAnswer"
- >提出疑问</el-button
- >
- </div>
- <div class="answer-question__body">
- <div class="question-list">
- <div
- v-if="answerList.length == 0"
- style="
- text-align: center;
- color: #cccccc;
- margin-top: 14px;
- "
- >
- 暂无记录
- </div>
- <div
- class="question-list__item"
- v-for="(item, index) in answerList"
- :key="index"
- >
- <div class="question-list__item__avatar">
- <img
- v-if="item.assignRealname"
- :src="
- $tools.splitImgHost(item.assignAvatar)
- "
- alt=""
- />
- <img
- v-else
- :src="$tools.splitImgHost(item.avatar)"
- alt=""
- />
- </div>
- <div class="question-list__item__content">
- <div class="nickname">
- {{ item.realname }}
- </div>
- <div class="desc">
- {{ item.answerText }}
- </div>
- <div class="time">
- {{
- $tools.timestampToTime(
- item.createTime,
- false
- )
- }}
- <div
- class="del"
- v-if="item.userId !== userInfo.userId"
- @click="answerBack(item)"
- >
- <el-button type="text"
- >回复</el-button
- >
- </div>
- <div
- class="del"
- style="color: red"
- @click="del(item)"
- v-if="item.userId === userInfo.userId"
- >
- 删除
- </div>
- </div>
- <div
- class="reply-list"
- v-if="
- item.newArraysAnswerList &&
- item.newArraysAnswerList.length
- "
- >
- <div
- class="reply-list__item"
- v-for="(
- items, indexs
- ) in item.newArraysAnswerList"
- :key="indexs"
- >
- <div class="reply-list__item__avatar">
- <img
- :src="
- $tools.splitImgHost(
- items.avatar
- )
- "
- alt=""
- />
- </div>
- <div
- class="reply-list__item__content"
- >
- <div class="nickname">
- {{ items.realname }}
- </div>
- <div class="desc">
- 回复
- <span
- style="
- margin: 0px 4px;
- color: #409eff;
- "
- >@{{
- items.assignRealname
- }}</span
- >
- <span style="color: #ccc">{{
- items.answerText
- }}</span>
- </div>
- <div class="time">
- {{
- $tools.timestampToTime(
- items.createTime,
- false
- )
- }}
- <div
- class="del"
- style="color: red"
- @click="del(items)"
- v-if="
- items.userId ===
- userInfo.userId
- "
- >
- 删除
- </div>
- <div
- class="reply"
- v-if="
- items.userId !==
- userInfo.userId
- "
- @click="answerBack(items)"
- >
- 回复
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <template v-if="tab.name == '4'">
- <div class="lecture-notes">
- <div class="lecture-notes__content clearfix">
- <div class="left-boxs">
- <div
- class="textarea clearfix"
- v-if="!(isPlayRebuild > 0) && !vidzb"
- >
- <el-input
- resize="none"
- rows="3"
- v-model="textareaNote"
- type="textarea"
- maxlength="1000"
- show-word-limit
- placeholder="觉得重要的就记下来吧~"
- ></el-input>
- <el-button
- type="primary"
- class="submit"
- @click="noteSubmit"
- >
- 提交笔记
- </el-button>
- </div>
- <div class="note-list">
- <div
- v-if="noteList.length == 0"
- style="
- text-align: center;
- color: #cccccc;
- margin-top: 14px;
- "
- >
- 暂无笔记
- </div>
- <div
- class="note-list__content"
- v-for="(item, index) in noteList"
- :key="index"
- >
- <div
- v-for="(note, index) in item.userNotes"
- :key="index"
- class="user_notes"
- >
- <p class="p1">
- <i
- class="el-icon-video-camera"
- style="margin-right: 8px"
- ></i
- >{{
- $tools.secondToDate(note.noteSecond)
- }}
- <span>{{
- $tools.timestampToTime(
- note.createTime,
- false,
- false
- )
- }}</span>
- </p>
- <p class="p2">{{ note.noteText }}</p>
- </div>
- </div>
- </div>
- <!-- <div class="pagination">
- <el-pagination
- background
- layout="prev, pager, next"
- :total="noteTotal"
- :page-size="noteParams.pageSize"
- >
- </el-pagination>
- </div> -->
- </div>
- </div>
- </div>
- </template>
- <template v-if="tab.name == '5'">
- <div class="lecture-notesjy">
- <div class="listItem">
- <div class="titles">
- {{ courseHandoutsData.handoutsName }}
- </div>
- <div class="btns">
- <div
- class="btn"
- @click="
- previvew(
- $tools.splitImgHost(
- courseHandoutsData.handoutsUrl
- )
- )
- "
- >
- 预览
- </div>
- <div
- v-if="
- courseHandoutsData.canDownload == 1
- ? true
- : false
- "
- class="btn"
- @click="
- printView(
- $tools.splitImgHost(
- courseHandoutsData.handoutsUrl
- )
- )
- "
- >
- 打印
- </div>
- <div
- v-if="
- courseHandoutsData.canDownload == 1
- ? true
- : false
- "
- class="btn"
- @click="
- download(
- $tools.splitImgHost(
- courseHandoutsData.handoutsUrl
- ),
- courseHandoutsData.urlName
- )
- "
- >
- 下载
- </div>
- </div>
- </div>
- <div class="lecture-listFooter" v-if="showPdf">
- <div style="color: #fff">
- {{ courseHandoutsData.urlName }}
- </div>
- <pdf
- class="iframe"
- :src="
- $tools.splitImgHost(
- courseHandoutsData.handoutsUrl
- )
- "
- v-for="i in numPages"
- :key="i"
- :page="i"
- ref="pdf"
- ></pdf>
- <iframe
- id="printIframe"
- :src="
- $tools.splitImgHost(
- courseHandoutsData.handoutsUrl
- )
- "
- frameborder="0"
- style="display: none"
- ></iframe>
- </div>
- </div>
- </template>
- </el-tab-pane>
- </el-tabs>
- </div>
- </div>
- </div>
- </div>
- <div class="course-info__body">
- <el-tabs v-model="activeName">
- <el-tab-pane
- v-for="(item, index) in tabList"
- :key="index"
- :name="item.name"
- :label="item.label"
- >
- <template v-if="item.label == '学员须知'">
- <div class="course-menu clearfix">
- <div class="left-box">
- <div class="left-box__body">
- <div
- class="buy-note"
- v-html="
- goodsData.buyNote &&
- goodsData.buyNote.replace(/\n|\r\n/g, '<br>')
- "
- ></div>
- </div>
- </div>
- <div class="right-box">
- <div class="title">
- 推荐课程
- <a class="more" @click="go('/course-list')"
- >更多></a
- >
- </div>
- <ul class="list">
- <li
- class="course-item"
- v-for="(itemy, index) in compyRecommend(
- recommendList.goodsList
- )"
- :key="index"
- >
- <GoodsItem :item="itemy"></GoodsItem>
- <!-- <div
- class="course-item__img"
- :style="`background-image:url(${$tools.splitImgHost(
- itemy.coverUrl,
- true
- )})`"
- @click="toGoodsDetail(itemy)"
- >
- <div class="note" v-if="itemy.year">
- {{ itemy.year }}
- </div>
- </div>
- <div class="course-item__title">
- {{ itemy.goodsName }}
- </div>
- <div class="course-item__desc">
- <div class="price">
- ¥{{ itemy.standPrice }}
- </div>
- <a
- class="add"
- @click.stop="addCart(true, itemy.goodsId)"
- >加购物车</a
- >
- </div> -->
- </li>
- </ul>
- </div>
- </div>
- </template>
- <template v-if="item.label == '课程答疑'">
- <div class="answer-question">
- <div class="answer-question__header clearfix">
- <div class="textarea-wrap">
- <el-input
- class="textarea"
- v-model="textarea"
- rows="3"
- type="textarea"
- placeholder=""
- >
- </el-input>
- </div>
- <el-button
- type="primary"
- class="submit"
- @click="addAnswer"
- >提出疑问</el-button
- >
- </div>
- <div class="answer-question__body">
- <div class="question-list">
- <div
- v-if="answerList.length == 0"
- style="text-align: center"
- >
- 暂无记录
- </div>
- <div
- class="question-list__item"
- v-for="(item, index) in answerList"
- :key="index"
- >
- <div class="question-list__item__avatar">
- <img
- v-if="item.assignRealname"
- :src="$tools.splitImgHost(item.assignAvatar)"
- alt=""
- />
- <img
- v-else
- :src="$tools.splitImgHost(item.avatar)"
- alt=""
- />
- </div>
- <div class="question-list__item__content">
- <div class="nickname">
- {{ item.realname }}
- </div>
- <div class="desc">
- {{ item.answerText }}
- </div>
- <div class="time">
- {{
- $tools.timestampToTime(
- item.createTime,
- false
- )
- }}
- <div
- class="del"
- v-if="item.userId !== userInfo.userId"
- @click="answerBack(item)"
- >
- <el-button type="text">回复</el-button>
- </div>
- <div
- class="del"
- @click="del(item)"
- v-if="item.userId === userInfo.userId"
- >
- 删除
- </div>
- </div>
- <div
- class="reply-list"
- v-if="
- item.newArraysAnswerList &&
- item.newArraysAnswerList.length
- "
- >
- <div
- class="reply-list__item"
- v-for="(
- items, indexs
- ) in item.newArraysAnswerList"
- :key="indexs"
- >
- <div class="reply-list__item__avatar">
- <img
- :src="$tools.splitImgHost(items.avatar)"
- alt=""
- />
- </div>
- <div class="reply-list__item__content">
- <div class="nickname">
- {{ items.realname }}
- </div>
- <div class="desc">
- 回复
- <span
- style="
- margin: 0px 4px;
- color: #409eff;
- "
- >@{{ items.assignRealname }}</span
- >
- {{ items.answerText }}
- </div>
- <div class="time">
- {{
- $tools.timestampToTime(
- items.createTime,
- false
- )
- }}
- <div
- class="del"
- @click="del(items)"
- v-if="
- items.userId === userInfo.userId
- "
- >
- 删除
- </div>
- <div
- class="reply"
- v-if="
- items.userId !== userInfo.userId
- "
- @click="answerBack(items)"
- >
- 回复
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <template v-if="item.label == '笔记讲义'">
- <div class="lecture-notes">
- <div class="lecture-notes__content clearfix">
- <div class="left-box">
- <div
- class="textarea clearfix"
- v-if="!(isPlayRebuild > 0) && !vidzb"
- >
- <el-input
- resize="none"
- rows="3"
- v-model="textareaNote"
- type="textarea"
- placeholder="觉得重要的就记下来吧~"
- ></el-input>
- <el-button
- type="primary"
- class="submit"
- @click="noteSubmit"
- >
- 提交笔记
- </el-button>
- </div>
- <div class="note-list">
- <div
- v-if="noteList.length == 0"
- style="text-align: center"
- >
- 暂无笔记
- </div>
- <div
- class="note-list__content"
- v-for="(item, index) in noteList"
- :key="index"
- >
- <div class="note-list__content__title">
- {{ $tools.timestampToTime(item.dateNote) }}
- </div>
- <div
- class="note-list__item"
- v-for="(note, index) in item.userNotes"
- :key="index"
- >
- <i
- class="el-icon-video-play"
- @click="noteClick(note)"
- ></i>
- <div class="note-list__item__content">
- <div class="title" @click="noteClick(note)">
- {{ $tools.secondToDate(note.noteSecond) }}
- </div>
- <div class="desc">
- {{ note.sectionName }}
- </div>
- <div class="time">{{ note.noteText }}</div>
- </div>
- </div>
- </div>
- </div>
- <div class="pagination">
- <el-pagination
- background
- layout="prev, pager, next"
- :total="noteTotal"
- :page-size="noteParams.pageSize"
- >
- </el-pagination>
- </div>
- </div>
- <div class="right-box" v-if="courseHandoutsData">
- <div class="lecture-list">
- <div class="lecture-list__header">
- 讲义
- <div
- class="slide-btn"
- @click="lectureShow = !lectureShow"
- >
- 收起
- </div>
- </div>
- <div
- class="lecture-list__body"
- v-if="lectureShow"
- >
- <div class="list">
- <div class="list__item">
- <div class="title">
- {{ courseHandoutsData.handoutsName }}
- </div>
- <div class="btns">
- <div
- class="btn"
- @click="
- previvew(
- $tools.splitImgHost(
- courseHandoutsData.handoutsUrl
- )
- )
- "
- >
- 预览
- </div>
- <div
- v-if="
- courseHandoutsData.canDownload == 1
- ? true
- : false
- "
- class="btn"
- @click="
- printView(
- $tools.splitImgHost(
- courseHandoutsData.handoutsUrl
- )
- )
- "
- >
- 打印
- </div>
- <div
- v-if="
- courseHandoutsData.canDownload == 1
- ? true
- : false
- "
- class="btn"
- @click="
- download(
- $tools.splitImgHost(
- courseHandoutsData.handoutsUrl
- ),
- courseHandoutsData.urlName
- )
- "
- >
- 下载
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="lecture-list__footer" v-if="showPdf">
- <div class="lecture-scan">
- <div class="lecture-scan__header">
- {{ courseHandoutsData.urlName }}
- </div>
- <div class="lecture-scan__body">
- <pdf
- class="iframe"
- :src="
- $tools.splitImgHost(
- courseHandoutsData.handoutsUrl
- )
- "
- v-for="i in numPages"
- :key="i"
- :page="i"
- ref="pdf"
- ></pdf>
- <iframe
- id="printIframe"
- :src="
- $tools.splitImgHost(
- courseHandoutsData.handoutsUrl
- )
- "
- frameborder="0"
- style="display: none"
- ></iframe>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- </el-tab-pane>
- </el-tabs>
- </div>
- </div>
- </div>
- </div>
- </div>
- </section>
- <el-dialog
- width="800px"
- class="take-photo"
- :visible.sync="takePhotoModal"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- :show-close="false"
- >
- <div class="take-photo__content">
- <!-- <div class="take-photo__close" @click="takePhotoModal = false">X</div> -->
- <div class="take-photo__header">人脸验证</div>
- <div class="take-photo__body clearfix">
- <div class="left-box">
- <div class="title">重要提示:</div>
- <div class="content">
- <p>1、请保证摄像头正对自己,避免头像偏左或者偏右。</p>
- <p>
- 2、请保证拍照环境光线充足(照片太暗或曝光会降低验证通过率)。
- </p>
- <p>
- 3、请保证整个头像在人脸识别区域内,脸部无遮挡装饰物(佩戴眼镜会降低通过率)。
- </p>
- <p>
- 4、如果下面视频中出现黑屏,摄像头可能被其他进程占用,请关闭其他调用摄像头的程序,重新刷新当前页面重新拍照识别。
- </p>
- </div>
- </div>
- <div class="right-box">
- <img v-show="!isTaking" :src="faceUrl" alt="" />
- <video v-show="isTaking" id="video" :src="stream"></video>
- <div v-show="isTaking" class="mask"></div>
- </div>
- </div>
- <div class="take-photo__footer">
- <el-button
- type="primary"
- v-if="isTaking"
- class="take"
- @click="onPhoto"
- >拍照</el-button
- >
- <el-button
- type="primary"
- v-if="!isTaking"
- class="take"
- :loading="loading"
- @click="reTake"
- >重拍</el-button
- >
- <el-button
- type="primary"
- v-if="!isTaking"
- :loading="loading"
- class="take"
- @click="takeOk"
- >确认</el-button
- >
- </div>
- </div>
- </el-dialog>
- <el-dialog
- width="996px"
- height="600px"
- class="info"
- :visible.sync="showInfoDetailModal"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- :show-close="false"
- title="资料填写"
- >
- <div class="info__content">
- <el-form
- :model="infoForm"
- ref="infoForm"
- :rules="rules"
- :error-type="errorType"
- >
- <template v-for="(item, index) in listData">
- <el-form-item
- :key="index"
- v-if="item.fieldKey == 'name'"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-input
- :disabled="disName"
- v-model="infoForm.name"
- :placeholder="`请输入${item.fieldName}`"
- />
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.fieldKey == 'idcard'"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-input
- :disabled="disCard"
- v-model="infoForm.idcard"
- :placeholder="`请输入${item.fieldName}`"
- />
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.fieldKey == 'telphone'"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-input
- :disabled="true"
- v-model="infoForm.telphone"
- :placeholder="`请输入${item.fieldName}`"
- />
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.fieldKey == 'school'"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-input
- v-model="infoForm.school"
- :placeholder="`请输入${item.fieldName}`"
- />
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.fieldKey == 'work_unit'"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-input
- v-model="infoForm.work_unit"
- :placeholder="`请输入${item.fieldName}`"
- />
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.fieldKey == 'unit_contact'"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-input
- v-model="infoForm.unit_contact"
- :placeholder="`请输入${item.fieldName}`"
- />
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.fieldKey == 'unit_tel'"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-input
- v-model="infoForm.unit_tel"
- :placeholder="`请输入${item.fieldName}`"
- />
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.fieldKey == 'apply_post'"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-input
- :disabled="apply_post_disabled"
- v-model="infoForm.apply_post"
- :placeholder="`请输入${item.fieldName}`"
- />
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.fieldKey == 'major'"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-input
- v-model="infoForm.major"
- :placeholder="`请输入${item.fieldName}`"
- />
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.inputType == 2"
- :label="item.fieldName"
- label-width="120px"
- :required="item.required"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-select v-model="infoForm[item.fieldKey]" placeholder="">
- <el-option
- v-for="(option, optionIndex) in getarrays(item.fieldKey)"
- :key="optionIndex"
- :label="option"
- :value="optionIndex + ''"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="item.inputType == 5"
- :label="item.fieldName"
- label-width="120px"
- :required="item.required"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-date-picker
- v-model="infoForm[item.fieldKey]"
- align="right"
- type="date"
- placeholder="选择日期"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item
- :key="index"
- v-if="
- item.inputType == 3 &&
- item.fieldKey !== 'commitment_electr_signature'
- "
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- label-position="top"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-upload
- action=""
- :max-size="2097152"
- accept="image/jpeg, image/jpg, image/png"
- :show-file-list="false"
- list-type="picture"
- :auto-upload="false"
- :ref="
- item.fieldKey === 'recent_photos'
- ? 'recent_photos'
- : item.fieldKey === 'idcard_face_photo'
- ? 'idcard_face_photo'
- : item.fieldKey === 'idcard_national_photo'
- ? 'idcard_national_photo'
- : ''
- "
- :on-change="
- item.fieldKey === 'recent_photos'
- ? changePhotoListHeader1
- : item.fieldKey === 'idcard_face_photo'
- ? changePhotoListHeader2
- : item.fieldKey === 'idcard_national_photo'
- ? changePhotoListHeader3
- : ''
- "
- :file-list="
- item.fieldKey === 'recent_photos'
- ? fileList1
- : item.fieldKey === 'idcard_face_photo'
- ? fileList2
- : item.fieldKey === 'idcard_national_photo'
- ? fileList3
- : ''
- "
- >
- <div class="upload-box">
- <div
- :style="
- item.fieldKey === 'recent_photos'
- ? 'width: 120px; height: 169px;background:url(' +
- require('@/assets/info_1.png') +
- ') no-repeat center;background-size:cover;position:relative;'
- : item.fieldKey === 'idcard_face_photo'
- ? 'width: 120px; height: 82px;background:url(' +
- require('@/assets/info_2.png') +
- ') no-repeat center;background-size:cover;position:relative;'
- : item.fieldKey === 'idcard_national_photo'
- ? 'width: 120px; height: 82px;background:url(' +
- require('@/assets/info_3.png') +
- ') no-repeat center;background-size:cover;position:relative;'
- : ''
- "
- >
- <i
- @click="deleteImg(item)"
- class="el-icon-error"
- v-if="
- item.fieldKey === 'recent_photos'
- ? fileList1[0]
- : item.fieldKey === 'idcard_face_photo'
- ? fileList2[0]
- : item.fieldKey === 'idcard_national_photo'
- ? fileList3[0]
- : ''
- "
- ></i>
- <el-image
- style="width: 100%; height: 100%"
- :src="
- item.fieldKey === 'recent_photos'
- ? $tools.splitImgHost(fileList1[0].url)
- : item.fieldKey === 'idcard_face_photo'
- ? $tools.splitImgHost(fileList2[0].url)
- : item.fieldKey === 'idcard_national_photo'
- ? $tools.splitImgHost(fileList3[0].url)
- : ''
- "
- v-if="
- item.fieldKey === 'recent_photos'
- ? fileList1[0]
- : item.fieldKey === 'idcard_face_photo'
- ? fileList2[0]
- : item.fieldKey === 'idcard_national_photo'
- ? fileList3[0]
- : ''
- "
- :preview-src-list="
- item.fieldKey === 'recent_photos'
- ? [$tools.splitImgHost(fileList1[0].url)]
- : item.fieldKey === 'idcard_face_photo'
- ? [$tools.splitImgHost(fileList2[0].url)]
- : item.fieldKey === 'idcard_national_photo'
- ? [$tools.splitImgHost(fileList3[0].url)]
- : ''
- "
- >
- </el-image>
- </div>
- <div>
- <span
- v-if="item.fieldKey === 'recent_photos'"
- style="color: #999999"
- >竖向白底证件照 文件大小≤2M</span
- >
- <span
- v-if="
- item.fieldKey === 'idcard_face_photo' ||
- item.fieldKey === 'idcard_national_photo'
- "
- style="color: #999999"
- >
- 文件大小≤2M
- </span>
- </div>
- </div>
- <div style="display: inline-block" slot="trigger">
- <el-button type="primary" size="small" round
- >浏览文件</el-button
- >
- </div>
- </el-upload>
- </el-form-item>
- <div
- :key="index"
- v-if="
- item.inputType == 3 &&
- item.fieldKey === 'commitment_electr_signature'
- "
- >
- <el-form-item
- v-if="
- item.inputType == 3 &&
- item.fieldKey === 'commitment_electr_signature'
- "
- label="承诺书"
- :required="item.required"
- label-width="120px"
- label-position="top"
- >
- <div style="line-height: 40px; text-indent: 2em">
- <span>
- 本人自愿做出如下承诺:本人己仔细阅读《广东省住房和城乡建设厅关于推进住房和城乡建设领域施工现场专业人员职业培训工作的通知》
- 全部内容并知晓和理解,本人的学历证书、身份证、工作年限、相片等所有资料完全真实、符合报名条件、资格审查要求和相关规定,本人在报名、审查、培训、测试等有关的事项中会严格道守相关规定和要求,如有虛假或与实际规定不符等情况造成的一切后果由本人承担。
- </span>
- <div style="line-height: 40px; text-indent: 2em">
- <span>特此承诺!</span>
- </div>
- </div>
- </el-form-item>
- <el-form-item
- v-if="
- item.inputType == 3 &&
- item.fieldKey === 'commitment_electr_signature'
- "
- label="签名板"
- :required="item.required"
- label-width="120px"
- label-position="top"
- :prop="item.required ? item.fieldKey : ''"
- >
- <div class="dis_stys">
- <span style="color: #999999">请在下方签名区进行签名</span>
- <el-button
- type="primary"
- size="small"
- @click="retDraw"
- mode=""
- >清空</el-button
- >
- </div>
- <div class="handCenter">
- <vue-esign
- v-if="!infoForm[item.fieldKey]"
- ref="esign"
- :width="600"
- :height="300"
- :isCrop="false"
- :lineWidth="5"
- :lineColor="'#333'"
- />
- <div
- v-else
- style="width: 100%; height: 100%; position: relative"
- >
- <img
- style="width: 100%; height: 100%"
- :src="$tools.splitImgHost(infoForm[item.fieldKey])"
- mode=""
- />
- </div>
- </div>
- </el-form-item>
- </div>
- <el-form-item
- :key="index"
- v-if="item.inputType == 4"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- label-position="top"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-button
- type="primary"
- size="small"
- round
- @click="downloadStamp(item)"
- >下载模板</el-button
- >
- <el-upload
- action=""
- :max-size="2097152"
- accept="image/jpeg, image/jpg, image/png"
- :show-file-list="false"
- list-type="picture"
- :auto-upload="false"
- ref="stamp"
- :on-change="changePhotoListStamp"
- :file-list="fileListStamp"
- >
- <div style="display: inline-block; vertical-align: top">
- <div
- :style="
- 'width: 120px; height: 120px;background:url(' +
- require('@/assets/info_4.png') +
- ') no-repeat center;background-size:cover;position:relative;'
- "
- >
- <el-image
- style="width: 100%; height: 100%"
- :src="$tools.splitImgHost(fileListStamp[0].url)"
- v-if="fileListStamp[0]"
- :preview-src-list="[
- $tools.splitImgHost(fileListStamp[0].url),
- ]"
- >
- </el-image>
- </div>
- <div>
- <span style="color: #999999">文件大小≤2M</span>
- </div>
- </div>
- <div style="display: inline-block" slot="trigger">
- <el-button type="primary" size="small" round
- >浏览文件</el-button
- >
- </div>
- </el-upload>
- </el-form-item>
- </template>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button
- @click="
- showInfoDetailModal = false;
- $router.back(-1);
- "
- >取 消</el-button
- >
- <el-button type="primary" :loading="uploading" @click="submit"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <el-dialog
- width="996px"
- height="600px"
- class="info"
- :visible.sync="showStampDetailModail"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- :show-close="false"
- title="资料填写"
- >
- <div class="info__content">
- <el-form
- :model="stampForm"
- ref="stampForm"
- :rules="stampRules"
- :error-type="errorType"
- >
- <template v-for="(item, index) in listDataStamp">
- <el-form-item
- :key="index"
- v-if="item.inputType == 4"
- :label="item.fieldName"
- :required="item.required"
- label-width="120px"
- label-position="top"
- :prop="item.required ? item.fieldKey : ''"
- >
- <el-button
- type="primary"
- size="small"
- round
- @click="downloadStamp(item)"
- >下载模板</el-button
- >
- <el-upload
- action=""
- :max-size="2097152"
- accept="image/jpeg, image/jpg, image/png"
- :show-file-list="false"
- list-type="picture"
- :auto-upload="false"
- ref="stamp"
- :on-change="changePhotoListStamp"
- :file-list="fileListStamp"
- >
- <div style="display: inline-block; vertical-align: top">
- <div
- :style="
- 'width: 120px; height: 120px;background:url(' +
- require('@/assets/info_4.png') +
- ') no-repeat center;background-size:cover;position:relative;'
- "
- >
- <el-image
- style="width: 100%; height: 100%"
- :src="$tools.splitImgHost(fileListStamp[0].url)"
- v-if="fileListStamp[0]"
- :preview-src-list="[
- $tools.splitImgHost(fileListStamp[0].url),
- ]"
- >
- </el-image>
- </div>
- <div>
- <span style="color: #999999">文件大小≤2M</span>
- </div>
- </div>
- <div style="display: inline-block" slot="trigger">
- <el-button type="primary" size="small" round
- >浏览文件</el-button
- >
- </div>
- </el-upload>
- </el-form-item>
- </template>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button
- @click="
- showStampDetailModail = false;
- $router.back(-1);
- "
- >取 消</el-button
- >
- <el-button type="primary" :loading="uploading" @click="stampSubmit"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <el-dialog
- width="996px"
- height="600px"
- class="info"
- :visible.sync="showAgreementModal"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- :show-close="false"
- title="提示"
- >
- <div class="">
- <div>
- 本产品(或服务)提供【{{
- goodsData.goodsName
- }}】课程的在线学习功能,为使用这些功能,我们需要使用您设备上的摄像头,并收集以下个人信息:
- <span v-for="(item, listIndex) in listData" :key="listIndex"
- >{{ item.fieldName }}、</span
- >
- <!-- 姓名、性别、身份证号码、移动电话号码、身份证照片、一寸照、证书名称/岗位、证书编号、有效期、人脸照片(每节课随机拍摄三张)、 -->
- 学习详细记录。
- </div>
- <div>
- 我们会将上述信息提供至广东省建设执业注册管理中心等第三方组织使用,用于继续教育备案等。如果您拒绝,将导致这些功能无法实现,但不影响您使用本产品(或服务)的其他业务功能。
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="$router.back(-1)">取 消</el-button>
- <el-button type="primary" @click="showInfoDetailModal = true"
- >同意并继续</el-button
- >
- </span>
- </el-dialog>
- <el-dialog title="切换课程" :visible.sync="dialogVisible" width="800px">
- <div class="topstyle">
- <p>当前课程</p>
- <div class="list_styleHeader">
- <span style="font-weight: bold; font-size: 16px">{{
- getCourseName(courseId)
- }}</span>
- </div>
- </div>
- <div v-for="(courseItem, index) in goodsTeacher" :key="index + 'one'">
- <div class="height_style">
- <div v-for="(item, i) in courseItem.courseList" :key="i + 'two'">
- <div
- v-if="item.show == 1"
- class="list_style"
- @click="activeFunc(item.courseId, index)"
- >
- <span style="font-weight: bold; font-size: 16px"
- >{{ item.courseName }}{{ i }}</span
- >
- <!-- <span v-if="courseItem.teaList && courseItem.teaList.length > 0" v-for="(tea, index) in courseItem.teaList" :key="index">
- <el-button type="info" round>{{tea.aliasName}}</el-button>
- </span> -->
- <span
- v-if="courseItem.teaList && courseItem.teaList.length > 0"
- class="teacher_names"
- >
- <span
- v-for="(tea, cindex) in courseItem.teaList"
- :key="cindex + 'three'"
- class="names"
- >
- {{ tea.aliasName }}
- </span>
- </span>
- </div>
- </div>
- </div>
- </div>
- </el-dialog>
- <el-dialog
- title="温馨提示"
- width="380px"
- center
- class="tip-dialog"
- :visible.sync="dialogPalyVisible"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- :show-close="false"
- >
- <template v-if="!isLastVideo"
- ><p>当前视频已学完,继续学习下一个视频?</p>
- <div class="btn1">
- <el-button type="info" plain round @click="dialogPalyVisible = false"
- >取 消</el-button
- >
- <el-button type="primary" @click="playNextVideo" round
- >确定</el-button
- >
- </div></template
- >
- <template v-else
- ><p>
- 当前是最后一个视频并已学习完,请检查所有章节的视频是否已学习完成。
- </p>
- <div class="btn2">
- <el-button type="primary" round @click="dialogPalyVisible = false"
- >确定</el-button
- >
- </div></template
- >
- </el-dialog>
- <div id="printTable"></div>
- <!-- <ToolBar></ToolBar> -->
- <Footer></Footer>
- </div>
- </template>
- <script>
- import Footer from "@/components/footer/index";
- import Header from "@/components/header/index";
- import ToolBar from "@/components/toolbar/index";
- import GoodsItem from "@/components/goodsItem/index";
- import * as imageConversion from "image-conversion";
- import { mapGetters, mapMutations, mapActions } from "vuex";
- import * as baseUrls from "@/axios.js";
- import pdf from "vue-pdf";
- import print from "print-js";
- export default {
- name: "CourseDetail",
- components: {
- Footer,
- Header,
- ToolBar,
- pdf,
- GoodsItem,
- },
- data() {
- return {
- dialogVisible: false, //选择课程弹窗
- liveDuration: 0,
- numPages: 0,
- showPdf: false,
- // 总页数
- pdfPages: 10,
- // 当前页数
- pageNum: 1,
- // 加载进度
- loadedRatio: 10,
- // 页面加载完成
- curPageNum: 0,
- // 放大系数 默认百分百
- scale: 100,
- // 旋转角度 ‘90’的倍数才有效
- pageRotate: 0,
- // 单击内部链接时触发 (目前我没有遇到使用场景)
- page: 0,
- bgColor: "#ccc",
- answerTimer: null,
- recordObj: {},
- showAgreementModal: false,
- showInfoDetailModal: false,
- showStampDetailModail: false,
- isTaking: true, //是否正在拍照
- photoConfig: false,
- stream: null,
- photoNum: 0,
- playSectionId: 0,
- photoIndex: 0, //当前位于拍照的区间下标 从0开始
- photoHistoryList: [], //已拍照历史的下标点
- moduleId: 0,
- chapterId: 0,
- menuTab: [],
- lectureShow: true,
- textarea: "",
- textareaNote: "",
- takePhotoModal: false,
- activeName: "1",
- courseId: "",
- courseTabIndex: "1",
- goodsId: "",
- gradeId: "",
- livingTimer: null,
- sectionItem: {},
- gradeDetail: {},
- autoplay: false,
- isAllowSeek: "on",
- playbackRate: false,
- goodsPlayConfig: null,
- playTime: 0, //页面播放时长,不含暂停
- param: {
- pageNum: 1,
- pageSize: 100,
- total: 0,
- },
- postTimer: null, //提交视频观看记录定时器
- lockTimer: null,
- courseList: [],
- businessData: {},
- courseHandoutsData: "",
- // menuList: [],
- goodsData: {},
- tabList: [],
- historyChatMsgList: [],
- vid: "",
- vidzb: "",
- player: "",
- playerzb: "",
- vodPlayerJs: "https://player.polyv.net/script/player.js",
- playerJs:
- "https://player.polyv.net/resp/live-h5-player/latest/liveplayer.min.js",
- uidzb: "egsxlptzdq",
- menuList: [],
- reMenuList: [],
- answerList: [{ newArraysAnswerList: [] }],
- noteList: [],
- photoList: [],
- noteTotal: 0,
- duration: 0,
- answerTimer: null,
- noteParams: {
- pageNum: 1,
- // pageSize: 4,
- },
- ossAvatarUrl: "", //照片地址
- nowTime: 0,
- faceUrl: "",
- loading: null,
- listData: [],
- listDataStamp: [],
- remark: "",
- remarkStatus: false,
- remarkStamp: "",
- remarkStatusStamp: false,
- errorType: ["message"],
- stampForm: {
- commitment_seal: "",
- },
- infoForm: {
- name: "",
- sex: "",
- idcard: "",
- telphone: "",
- education: "",
- school: "",
- graduation_time: "",
- work_unit: "",
- unit_contact: "",
- unit_tel: "",
- apply_post: "",
- major: "",
- working_years: "",
- recent_photos: "",
- idcard_face_photo: "",
- idcard_national_photo: "",
- commitment_electr_signature: "",
- commitment_seal: "",
- },
- needOpenNew: true,
- recommendList: [],
- rules: {
- name: [
- {
- required: true,
- message: "请输入姓名",
- trigger: ["change", "blur"],
- },
- ],
- sex: [
- {
- required: true,
- message: "请选择性别",
- trigger: "change",
- },
- ],
- idcard: [
- {
- required: true,
- message: "请输入身份证号",
- trigger: ["change", "blur"],
- },
- // {
- // validator: (rule, value, callback) => {
- // let IDRe18 =
- // /^([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]$/;
- // let IDre15 =
- // /^([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}$/;
- // if (!IDRe18.test(value) && !IDre15.test(value)) {
- // return callback(new Error("请输入格式正确的身份证号"));
- // } else {
- // return callback();
- // }
- // },
- // message: "请输入格式正确的身份证号",
- // trigger: ["change", "blur"],
- // },
- ],
- telphone: [
- {
- required: true,
- message: "请输入手机号码",
- trigger: ["change", "blur"],
- },
- // {
- // validator: (rule, value, callback) => {
- // var reg_tel =
- // /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
- // if (reg_tel.test(value)) {
- // return callback();
- // } else {
- // return callback(new Error("手机号码不正确"));
- // }
- // },
- // trigger: ["change", "blur"],
- // },
- ],
- education: [
- {
- required: true,
- message: "请选择学历",
- trigger: "change",
- },
- ],
- school: [
- {
- required: true,
- message: "请输入毕业院校",
- trigger: ["change", "blur"],
- },
- ],
- graduation_time: [
- {
- required: true,
- message: "请选择毕业时间",
- trigger: "change",
- },
- ],
- work_unit: [
- {
- required: true,
- message: "请输入工作单位",
- trigger: ["change", "blur"],
- },
- ],
- unit_contact: [
- {
- required: true,
- message: "请输入单位联系人",
- trigger: ["change", "blur"],
- },
- ],
- unit_tel: [
- {
- required: true,
- message: "请输入单位联系电话",
- trigger: ["change", "blur"],
- },
- {
- validator: (rule, value, callback) => {
- var reg_tel =
- /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
- var vartest = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
- var vartest1 = /^([0-9]{3,4})?[0-9]{7,8}$/;
- if (
- reg_tel.test(value) ||
- vartest.test(value) ||
- vartest1.test(value)
- ) {
- return callback();
- } else {
- return callback(new Error("单位联系电话不正确"));
- }
- },
- trigger: ["change", "blur"],
- },
- ],
- apply_post: [
- {
- required: true,
- message: "请输入报名岗位",
- trigger: ["change", "blur"],
- },
- ],
- major: [
- {
- required: true,
- message: "请输入所学专业",
- trigger: ["change", "blur"],
- },
- ],
- working_years: [
- {
- required: true,
- message: "请选择工作年限",
- trigger: "change",
- },
- ],
- recent_photos: [
- {
- required: true,
- message: "请上传证件照",
- trigger: ["change", "blur"],
- },
- ],
- idcard_face_photo: [
- {
- required: true,
- message: "请上传身份证人像面",
- trigger: ["change", "blur"],
- },
- ],
- idcard_national_photo: [
- {
- required: true,
- message: "请上传身份证国徽面",
- trigger: ["change", "blur"],
- },
- ],
- commitment_electr_signature: [
- {
- required: true,
- message: "请签写承诺书电子签",
- trigger: ["change", "blur"],
- },
- ],
- commitment_seal: [
- {
- required: true,
- message: "请上传承诺书盖章",
- trigger: ["change", "blur"],
- },
- ],
- },
- stampRules: {
- commitment_seal: [
- {
- required: true,
- message: "请上传承诺书盖章",
- trigger: ["change", "blur"],
- },
- ],
- },
- fileList1: [], //证件照
- fileList2: [], //人像
- fileList3: [], //国徽
- fileListStamp: [], //印章
- dictObj: null,
- isRequired: false,
- uploading: false,
- veryIdCard: "",
- veryIdName: "",
- isPlayRebuild: false,
- showRecordStatus: false,
- hasStart: false,
- needOpen: true, //是否需要展开第一章节
- menuIndex: [],
- clickLock: false,
- goodsTeacher: [],
- teacherList: [],
- liveLast: null,
- apply_post_disabled: false,
- disName: false, // 姓名是否禁止输入
- disCard: false, // 身份证是否禁止输入
- clickSectionItem: {}, // 点击节的内容
- courseTotal: 0,
- teaIndex: 0,
- sectionExamList: [], //节试卷集合
- sectionExam: [], //节试卷集合
- compareFaceData: 0, // 拍照匹配相似度
- dialogPalyVisible: false,
- allVideoList: [],
- };
- },
- computed: {
- ...mapGetters(["userInfo"]),
- compyRecommend: function () {
- return function (array) {
- let ary = [];
- if (array) {
- for (let i = 0; i < array.length; i++) {
- if (i >= 5) {
- break;
- } else {
- ary.push(array[i]);
- }
- }
- }
- return ary;
- };
- },
- changeName: function () {
- return function (id) {
- var aryName = "";
- for (let i = 0; i < this.courseList.length; i++) {
- if (this.courseList[i].courseId == id) {
- if (this.courseList[i].subjectName) {
- aryName =
- `【${this.courseList[i].subjectName}】 ` +
- this.courseList[i].courseName;
- } else {
- aryName = this.courseList[i].courseName;
- }
- }
- }
- return aryName;
- };
- },
- getCourseName: function () {
- return function (id) {
- var courseName = "";
- for (let i = 0; i < this.courseList.length; i++) {
- if (this.courseList[i].courseId == id) {
- courseName = this.courseList[i].courseName;
- break;
- }
- }
- return courseName;
- };
- },
- isLastVideo() {
- try {
- let { sectionId, chapterId } = this.sectionItem;
- let lastVideo =this.allVideoList.slice(-1)[0];
- return (
- sectionId == lastVideo.sectionId && chapterId == lastVideo.chapterId
- );
- } catch (error) {
- return false;
- }
- },
- },
- async mounted() {
- this.courseId = +this.$route.query.courseId || "";
- this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
- this.goodsId = this.$route.params.goodsId;
- this.orderGoodsId = this.$route.query.orderGoodsId;
- this.gradeId = this.$route.query.gradeId;
- this.sectionItem = this.$route.query;
- let isOther = this.$route.query.isOther || "";
- if (isOther) {
- const confirmText = [
- "您的学习账号已经开通,请按照步骤操作,进行学习。",
- "1.点击【跳转学习网址】按钮",
- "2.打开学习网址后,选择【个人用户】进行登录",
- "(1)账号:您个人的身份证号码",
- "(2)密码:身份证号码,再加111111",
- ];
- const newDatas = [];
- const h = this.$createElement;
- for (const i in confirmText) {
- newDatas.push(h("p", null, confirmText[i]));
- }
- this.$confirm(h("div", null, newDatas), "温馨提示", {
- beforeClose: (type) => {
- if (type == "confirm") {
- window.open("http://admin.zhujianpeixun.com/", "_blank");
- } else if (type == "cancel") {
- this.$router.back(-1);
- }
- },
- confirmButtonText: "跳转学习网址",
- cancelButtonText: "关闭",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- distinguishCancelAndClose: false,
- showClose: false,
- });
- return;
- }
- if (this.$route.query.rebuild) {
- this.courseTabIndex = "2";
- }
- await this.getGoodsDetail(); //商品详情
- this.studyRecordMenuAllList();
- this.dictList();
- // this.userConfirmInfoDetail().then((res) => {
- this.getbaseprofiletplists().then(async (res) => {
- // let allMenuList = await this.studyRecordMenuAllList();
- // let nowTime = Number(new Date().getTime() / 1000).toFixed(0);
- // let liveMenu = allMenuList.filter((item) => {
- // //获取直播中的视频
- // if (
- // item.type == 3 &&
- // item.liveStartTime <= nowTime &&
- // item.liveEndTime > nowTime
- // ) {
- // return true;
- // } else {
- // return false;
- // }
- // });
- // let earlyTime = 0;
- // if (liveMenu && liveMenu.length) {
- // earlyTime = liveMenu[0].liveStartTime;
- // }
- await this.courseCourseList();
- if (this.sectionItem.recordingUrl) {
- return;
- let noteSecond = this.$route.query.noteSecond;
- if (noteSecond > 0) {
- let item = {
- sectionId: this.$route.query.sectionId,
- recordingUrl: this.$route.query.recordingUrl,
- noteSecond: noteSecond,
- studyDuration: noteSecond,
- moduleId: this.$route.query.moduleId,
- chapterId: this.$route.query.chapterId,
- };
- this.playSectionId = this.$route.query.sectionId;
- setTimeout(() => {
- this.noteClick(item);
- }, 1000);
- }
- } else {
- // this.studyRecordQueryLiveLast();
- }
- // let noteSecond = this.$route.query.noteSecond;
- // if (noteSecond > 0) {
- // let item = {
- // sectionId: this.$route.query.sectionId,
- // recordingUrl: this.$route.query.recordingUrl,
- // noteSecond: noteSecond,
- // studyDuration: noteSecond,
- // moduleId: this.$route.query.moduleId,
- // chapterId: this.$route.query.chapterId,
- // };
- // this.sectionItem = item;
- // this.playSectionId = this.$route.query.sectionId;
- // setTimeout(() => {
- // this.noteClick(item);
- // }, 1000);
- // }
- });
- // });
- // 切换窗口暂停播放
- document.addEventListener("visibilitychange", this.pauseVideo);
- },
- beforeDestroy() {
- clearInterval(this.answerTimer);
- clearInterval(this.postTimer);
- clearInterval(this.livingTimer);
- document.removeEventListener("visibilitychange", this.pauseVideo);
- try {
- this.$msgbox.close();
- } catch (err) {}
- if (this.playSectionId && this.hasStart) {
- this.postStudyRecord();
- }
- // if (this.lockTimer) {
- // clearInterval(this.lockTimer);
- // this.$request
- // .lockDelLock({
- // action: "jxjy",
- // })
- // .then((res) => {});
- // }
- this.clears();
- // clearInterval(this.answerTimer);
- // clearInterval(this.postTimer);
- // clearInterval(this.livingTimer);
- },
- methods: {
- ...mapMutations(["getCartCount"]),
- ...mapActions(["getUserInfo"]),
- pauseVideo() {
- let _p = this.player
- if (document.visibilityState === "hidden") {
- _p && _p .j2s_pauseVideo();
- } else {
- if (_p) {
- if(parseInt(_p .j2s_getCurrentTime())<_p .j2s_getDuration()){
- this.player.j2s_resumeVideo();
- }
- }
- }
- },
- openChangeCourseBoxs() {
- this.dialogVisible = true;
- },
- handleClick(tab) {
- if (tab.name == "3") {
- this.getAnswerList(); //答疑列表
- }
- },
- /**
- * 确定选中
- */
- activeFunc(courseId, index) {
- if (this.teaIndex == index) {
- this.dialogVisible = false;
- return;
- }
- if (index) {
- let prevItem = this.courseList[index - 1];
- if (prevItem.stuAllNum != prevItem.secAllNum) {
- return this.$message({
- type: "warning",
- message: "需按课程顺序学习",
- });
- }
- }
- this.teaIndex = index || 0;
- this.courseId = courseId;
- this.courseChange();
- this.dialogVisible = false;
- },
- isLast(item) {
- if (this.liveLast) {
- let sectionASame =
- this.liveLast.sectionId == (item.sectionId || item.menuId);
- let chapterSame = this.liveLast.chapterId == (item.chapterId || 0);
- let moduleSame = this.liveLast.moduleId == (item.moduleId || 0);
- return sectionASame && chapterSame && moduleSame;
- } else {
- return false;
- }
- },
- /**
- * 获取上次观看的直播
- */
- studyRecordGetLastLive() {
- this.$request
- .studyRecordGetLastLive({
- orderGoodsId: this.orderGoodsId,
- courseId: this.courseId,
- })
- .then((res) => {
- this.liveLast = res.data;
- });
- },
- //校验节是否有试卷
- checkSection(sectionId, key) {
- let _data = this[key];
- if (_data.length == 0) {
- return false;
- }
- return _data.some((section) => section.sectionId == sectionId);
- },
- /**
- * 获取观看记录
- */
- studyRecordQueryLiveLast() {
- return new Promise((resolve, reject) => {
- this.$request
- .studyRecordQueryLiveLast({
- orderGoodsId: this.orderGoodsId,
- courseId: this.courseId,
- })
- .then((res) => {
- console.log(res, "couse");
- if (res.data) {
- if (res.data.sectionType == 1) {
- //视频
- this.chapterId = res.data.chapterId;
- this.moduleId = res.data.moduleId;
- this.playSectionId = res.data.sectionId;
- this.vid = res.data.recordingUrl;
- this.sectionItem = res.data;
- console.log("================sectionItem", this.sectionItem);
- this.playVideo(res.data);
- } else if (res.data.sectionType == 2) {
- //直播
- this.studyRecordGetLastLive();
- } else if (res.data.sectionType == 3) {
- //回放
- this.chapterId = res.data.chapterId;
- this.moduleId = res.data.moduleId;
- this.playSectionId = res.data.sectionId;
- this.vid = res.data.recordingUrl;
- this.sectionItem = res.data;
- this.playVideo(res.data);
- }
- if (res.data.sectionId > 0) {
- resolve(true);
- } else {
- resolve(false);
- }
- } else {
- resolve(false);
- }
- });
- });
- },
- /**
- *
- 获取推荐列表
- */
- getRecommend() {
- this.$request
- .appCommonActivityRecommendList({
- businessId: this.goodsData.businessId,
- type: 1,
- })
- .then((res) => {
- if (res.rows.length) {
- this.recommendList = res.rows[0];
- }
- });
- },
- addCart(status, goodsId) {
- this.$request
- .addCart({ goodsId: status ? goodsId : this.goodsId })
- .then((res) => {
- this.getCartCount();
- this.$message({
- message: "加入购物车成功",
- type: "success",
- });
- })
- .catch((err) => {
- if (err.code == 500) {
- this.$message({
- message: err.msg,
- type: "warning",
- });
- }
- });
- },
- toGoodsDetail(item) {
- this.$router.push({
- path: "/course-detail/" + item.goodsId,
- });
- },
- async takeOk() {
- this.loading = true;
- let compareFaceData = await this.faceRecognition();
- this.compareFaceData = compareFaceData;
- if (compareFaceData >= 80) {
- const waitYS = await this.imageInfos();
- this.postCoursePhotoRecord()
- .then((res) => {
- this.photoHistoryList.push(this.photoIndex);
- this.postStudyRecord(); //提交记录
- //恢复播放
- this.$message({
- type: "success",
- message: "拍照成功",
- });
- this.takePhotoModal = false;
- this.isTaking = false;
- this.loading = false;
- var polyvPlayerContext = this.player;
- if (polyvPlayerContext) {
- polyvPlayerContext.j2s_resumeVideo();
- }
- var polyvPlayerContext = this.playerzb;
- if (polyvPlayerContext) {
- polyvPlayerContext.j2s_resumeVideo();
- }
- })
- .catch((err) => {
- this.loading = false;
- console.log(err, "err");
- this.$message({
- type: "warning",
- message: "上传接口报错,请重新拍照上传",
- });
- this.reTake();
- });
- } else {
- this.$message({
- type: "warning",
- message: "人脸匹配不通过,请重新拍照上传",
- });
- setTimeout(() => {
- this.loading = false;
- this.reTake();
- }, 2000);
- return;
- }
- },
- async changePhotoListStamp(params, fileList) {
- let file = await this.uploadRules(params);
- if (fileList.length == 1) {
- fileList.splice(0, 1);
- }
- this.$refs.stamp[0].clearFiles();
- this.$upload
- .upload(file, 0)
- .then((res) => {
- this.$set(this.infoForm, "commitment_seal", res);
- this.fileListStamp = [
- {
- name: res,
- url: res,
- },
- ];
- this.$refs.stamp[0].clearFiles();
- })
- .catch((err) => {
- this.$refs.stamp[0].clearFiles();
- });
- },
- changePhotoListStamp1(params, fileList) {
- const file = params.raw;
- const fileType = file.type;
- const isImage = fileType.indexOf("image") != -1;
- const isLt2M = file.size / 1024 / 1024 < 2;
- // 这里常规检验,看项目需求而定
- if (!isImage) {
- this.$message.error("只能上传图片格式png、jpg、gif!");
- return;
- }
- if (!isLt2M) {
- this.$message.error("只能上传图片大小小于2M");
- return;
- }
- if (fileList.length == 1) {
- fileList.splice(0, 1);
- }
- this.$refs.stamp[0].clearFiles();
- this.$upload
- .upload(file, 0)
- .then((res) => {
- this.$set(this.infoForm, "commitment_seal", res);
- this.fileListStamp = [
- {
- name: res,
- url: res,
- },
- ];
- this.$refs.stamp[0].clearFiles();
- console.log(res);
- })
- .catch((err) => {
- this.$refs.stamp[0].clearFiles();
- });
- },
- // 页面加载成功 当前页数
- pageLoaded(e) {
- this.$emit("current", e);
- this.curPageNum = e;
- },
- uploadRules(params) {
- return new Promise((resolve, reject) => {
- const file = params.raw;
- const fileType = file.type;
- const isImage = fileType.indexOf("image") != -1;
- const sizeToM = file.size / 1024 / 1024;
- if (!isImage) {
- this.$message.error("只能上传图片格式png、jpg、gif!");
- reject(false);
- }
- if (sizeToM > 2) {
- imageConversion
- .compressAccurately(file, {
- size: 1024 * 2,
- width: 1000,
- height: 1000,
- })
- .then((res) => {
- res = new File([res], file.name, { type: res.type });
- resolve(res);
- });
- } else {
- resolve(file);
- }
- });
- },
- async changePhotoListHeader1(params, fileList) {
- let file = await this.uploadRules(params);
- if (fileList.length == 1) {
- fileList.splice(0, 1);
- }
- this.$refs.recent_photos[0].clearFiles();
- this.$upload
- .upload(file, 0)
- .then((res) => {
- this.$set(this.infoForm, "recent_photos", res);
- this.fileList1 = [
- {
- name: res,
- url: res,
- },
- ];
- this.$refs.recent_photos[0].clearFiles();
- })
- .catch((err) => {
- this.$refs.recent_photos[0].clearFiles();
- });
- },
- async changePhotoListHeader2(params, fileList) {
- let file = await this.uploadRules(params);
- if (fileList.length == 1) {
- fileList.splice(0, 1);
- }
- let res = await this.faceCertificationIDCardOCR(1, file);
- if (res.code == 500) {
- this.$message.warning("请上传正确清晰的身份证人像面照片");
- return;
- }
- this.$refs.idcard_face_photo[0].clearFiles();
- this.$set(this.infoForm, "idcard_face_photo", res.data.IdImgPath);
- this.fileList2 = [
- {
- name: res.data.IdImgPath,
- url: res.data.IdImgPath,
- },
- ];
- // this.$upload
- // .upload(file, 0)
- // .then((res) => {
- // console.log(res, "res");
- // this.$set(this.infoForm, "idcard_face_photo", res);
- // this.fileList2 = [
- // {
- // name: res,
- // url: res,
- // },
- // ];
- // this.$refs.idcard_face_photo[0].clearFiles();
- // console.log(res);
- // })
- // .catch((err) => {
- // this.$refs.idcard_face_photo[0].clearFiles();
- // });
- },
- async changePhotoListHeader3(params, fileList) {
- let file = await this.uploadRules(params);
- if (fileList.length == 1) {
- fileList.splice(0, 1);
- }
- let res = await this.faceCertificationIDCardOCR(2, file);
- if (res.code == 500) {
- this.$message.warning("请上传正确清晰的身份证国徽面照片");
- return;
- }
- this.$refs.idcard_national_photo[0].clearFiles();
- this.$set(this.infoForm, "idcard_national_photo", res.data.IdImgPath);
- this.fileList3 = [
- {
- name: res.data.IdImgPath,
- url: res.data.IdImgPath,
- },
- ];
- // this.$upload
- // .upload(file, 0)
- // .then((res) => {
- // this.$set(this.infoForm, "idcard_national_photo", res);
- // this.fileList3 = [
- // {
- // name: res,
- // url: res,
- // },
- // ];
- // this.$refs.idcard_national_photo[0].clearFiles();
- // console.log(res);
- // })
- // .catch((err) => {
- // this.$refs.idcard_national_photo[0].clearFiles();
- // });
- },
- faceCertificationIDCardOCR(cardSide, file) {
- return new Promise((resolve) => {
- var reader = new FileReader();
- // 将文件加载进入
- reader.readAsDataURL(file);
- reader.onload = (e) => {
- // 转换完成输出该文件base64编码
- let base64 = e.target.result;
- this.$request
- .faceCertificationIDCardOCR({
- cardSide: cardSide, //1人像 2 国徽
- cardImageBase64: base64,
- gradeId: this.gradeId,
- })
- .then((res) => {
- resolve(res);
- })
- .catch((err) => {
- resolve(err);
- });
- };
- });
- },
- async submit() {
- if (this.uploading) {
- return;
- }
- this.uploading = true;
- var ast = this.listData.some((item) => {
- return item.fieldKey === "commitment_electr_signature";
- });
- if (ast) {
- await this.subCanvas();
- }
- this.resultForm();
- },
- stampSubmit() {
- if (this.uploading) {
- return;
- }
- this.uploading = true;
- this.stampResultForm();
- },
- backLI() {
- this.player.j2s_seekVideo(0);
- this.showRecordStatus = false;
- },
- //验证表单
- stampResultForm() {
- for (let i = 0; i < this.listDataStamp.length; i++) {
- if (
- this.listDataStamp[i].fieldKey === "commitment_seal" &&
- !this.listDataStamp[i].required
- ) {
- this.submitApi();
- return;
- }
- }
- this.$refs.stampForm.validate((valid) => {
- if (valid) {
- this.submitApiStamp();
- } else {
- this.uploading = false;
- }
- });
- },
- async submitApiStamp() {
- var data = JSON.parse(JSON.stringify(this.stampForm));
- if (data["commitment_seal"]) {
- data.commitment_seal = await this.$upload.upload(
- data.commitment_seal,
- 0
- );
- }
- this.optionChanges(data);
- },
- optionChanges(data) {
- var self = this;
- var objs = {};
- for (let k in data) {
- objs[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listDataStamp.length; i++) {
- if (self.listDataStamp[i].fieldKey == k) {
- return self.listDataStamp[i].fieldName;
- }
- }
- })(),
- status: self.remarkStatusStamp ? 1 : 0,
- };
- }
- var datas = {
- orderGoodsId: this.orderGoodsId,
- goodsId: self.goodsId,
- keyValue: JSON.stringify(objs),
- };
- if (self.remarkStatus) {
- datas.id = self.id;
- self.$request.editbaseprofileStamp(datas).then((res) => {
- this.uploading = false;
- this.getUserInfo();
- this.showStampDetailModail = false;
- this.$message.success("提交成功");
- });
- } else {
- self.$request.addbaseprofileStamp(datas).then((res) => {
- this.uploading = false;
- this.getUserInfo();
- this.showStampDetailModail = false;
- this.$message.success("提交成功");
- });
- }
- },
- resultForm() {
- console.log(1);
- if (this.isRequired) {
- this.submitApi();
- } else {
- console.log(1);
- this.$refs.infoForm.validate((valid) => {
- console.log(1);
- if (valid) {
- this.submitApi();
- } else {
- this.uploading = false;
- }
- });
- // if (int === 1) {
- // this.errorType = ["toast"];
- // } else {
- // this.errorType = ["message"];
- // }
- }
- },
- async submitApi() {
- console.log(this.infoForm, "999");
- var data = JSON.parse(JSON.stringify(this.infoForm));
- if (data["sex"]) {
- data.sex = this.dictObj["sys_user_sex"][Number(data.sex)];
- }
- if (data["education"]) {
- data.education = this.dictObj["edu_level"][Number(data.education)];
- }
- if (data["working_years"]) {
- data.working_years =
- this.dictObj["working_years"][Number(data.working_years)];
- }
- if (data["recent_photos"]) {
- data.recent_photos = await this.$upload.upload(data.recent_photos, 0);
- }
- if (data["idcard_face_photo"]) {
- data.idcard_face_photo = await this.$upload.upload(
- data.idcard_face_photo,
- 0
- );
- }
- if (data["idcard_national_photo"]) {
- data.idcard_national_photo = await this.$upload.upload(
- data.idcard_national_photo,
- 0
- );
- }
- if (data["commitment_electr_signature"]) {
- data.commitment_electr_signature = await this.$upload.upload(
- data.commitment_electr_signature,
- 0
- );
- }
- this.uploadDatas(data);
- },
- async downloadStamp(item) {
- let self = this;
- var ast = this.listData.some((item) => {
- return item.fieldKey === "commitment_electr_signature";
- });
- if (ast) {
- await this.subCanvas();
- }
- let data = JSON.parse(JSON.stringify(this.infoForm));
- if (data["sex"]) {
- data.sex = this.dictObj["sys_user_sex"][Number(data.sex)];
- }
- if (data["education"]) {
- data.education = this.dictObj["edu_level"][Number(data.education)];
- }
- if (data["working_years"]) {
- data.working_years =
- this.dictObj["working_years"][Number(data.working_years)];
- }
- console.log(data, "data");
- if (this.remarkStatus) {
- var arsty = {};
- for (let k in data) {
- for (let j in self.copyData) {
- if (k === j) {
- if (self.copyData[j].value === data[k]) {
- arsty[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listData.length; i++) {
- if (self.listData[i].fieldKey == k) {
- return self.listData[i].fieldName;
- }
- }
- })(),
- status: 0,
- };
- } else {
- arsty[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listData.length; i++) {
- if (self.listData[i].fieldKey == k) {
- return self.listData[i].fieldName;
- }
- }
- })(),
- status: 1,
- };
- }
- }
- }
- }
- } else {
- var arsty = {};
- for (let k in data) {
- arsty[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listData.length; i++) {
- if (self.listData[i].fieldKey == k) {
- return self.listData[i].fieldName;
- }
- }
- })(),
- status: 0,
- };
- }
- }
- console.log(arsty, "arsty");
- this.$request
- .baseProfileStampV2AddWord({
- goodsId: this.goodsId,
- keyValue: JSON.stringify(arsty),
- })
- .then((res) => {
- let url = this.$tools.splitImgHost(res.msg);
- let name = res.msg.substring(res.msg.lastIndexOf("/") + 1);
- let image = new Image();
- // 解决跨域 Canvas 污染问题,
- image.setAttribute("crossorigin", "anonymous");
- image.onload = function () {
- var canvas = document.createElement("canvas");
- canvas.width = image.width;
- canvas.height = image.height;
- var context = canvas.getContext("2d");
- context.drawImage(image, 0, 0, image.width, image.height);
- var base64 = canvas.toDataURL("image/jpg"); //将图片格式转为base64
- var a = document.createElement("a"); // 生成一个a元素
- var event = new MouseEvent("click"); // 创建一个单击事件
- a.download = name; // 设置图片名称
- console.log(base64);
- a.href = base64; // 将生成的URL设置为a.href属性
- a.dispatchEvent(event); // 触发a的单击事件
- };
- image.src = url + "?time=" + Date.now(); //注意,这里是灵魂,否则依旧会产生跨域问题
- });
- },
- convertBase64UrlToBlob(urlData) {
- var localData = urlData; //dataUrl为base64位
- let base = atob(localData.substring(localData.indexOf(",") + 1)); // base是将base64编码解码,去掉data:image/png;base64部分
- let length = base.length;
- let url = new Uint8Array(length);
- while (length--) {
- url[length] = base.charCodeAt(length);
- }
- let file = new File([url], "a.jpg", {
- type: "image/jpg",
- });
- //最后将file,通过ajax请求做为参数传给服务器就可以了
- return file;
- },
- async uploadDatas(data) {
- let self = this;
- if (this.infoForm.recent_photos && this.infoForm.idcard_face_photo) {
- let base = await this.$tools.imageToBase64(
- this.$tools.splitImgHost(this.infoForm.idcard_face_photo)
- );
- console.log(base);
- console.log(this.$tools.splitImgHost(this.infoForm.idcard_face_photo));
- let resData = {};
- try {
- resData = await this.$request.faceCertificationIDCardOCR({
- cardSide: 1, //1人像 2 国徽
- cardImageBase64: base,
- gradeId: this.gradeId,
- });
- } catch (err) {
- self.$message.warning("身份证人像面照片异常,请重新上传");
- self.uploading = false;
- return;
- }
- if (!resData.data) {
- this.$message.warning("身份证人像面照片异常,请重新上传");
- this.uploading = false;
- return;
- }
- this.veryIdCard = resData.data.IdNum;
- this.veryIdName = resData.data.IdName;
- // if (this.infoForm.idcard) {
- // if (this.infoForm.idcard != this.veryIdCard) {
- // this.$message.warning(
- // "输入的身份证号和身份证人像面照片身份证号不匹配"
- // );
- // this.uploading = false;
- // return;
- // }
- // }
- let base64 = await this.$tools.imageToBase64(
- this.$tools.splitImgHost(this.infoForm.recent_photos)
- );
- let newData = {
- urlA: this.infoForm.idcard_face_photo,
- oneInchPhotos: base64,
- };
- this.$request
- .faceCertificationIdCardCompareFace(newData)
- .then((res1) => {
- if (res1.data >= 70) {
- var self = this;
- if (self.remarkStatus) {
- var arsty = {};
- for (let k in data) {
- for (let j in self.copyData) {
- if (k === j) {
- if (self.copyData[j].value === data[k]) {
- arsty[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listData.length; i++) {
- if (self.listData[i].fieldKey == k) {
- return self.listData[i].fieldName;
- }
- }
- })(),
- status: 0,
- };
- } else {
- arsty[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listData.length; i++) {
- if (self.listData[i].fieldKey == k) {
- return self.listData[i].fieldName;
- }
- }
- })(),
- status: 1,
- };
- }
- }
- }
- }
- var datas = {
- id: this.id,
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- keyValue: JSON.stringify(arsty),
- };
- this.$request
- .editbaseprofiletp(datas)
- .then((res) => {
- this.uploading = false;
- this.courseCourseList();
- this.getUserInfo();
- this.$message.success("提交成功");
- this.showInfoDetailModal = false;
- this.showAgreementModal = false;
- })
- .catch((err) => {
- this.$message.warning(err.msg);
- this.uploading = false;
- });
- } else {
- var objs = {};
- for (let k in data) {
- objs[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listData.length; i++) {
- if (self.listData[i].fieldKey == k) {
- return self.listData[i].fieldName;
- }
- }
- })(),
- status: 0,
- };
- }
- var datas = {
- goodsId: this.goodsId,
- profileTpId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- keyValue: JSON.stringify(objs),
- };
- this.$request
- .addbaseprofiletp(datas)
- .then((res) => {
- this.uploading = false;
- this.courseCourseList();
- this.getUserInfo();
- this.$message.success("提交成功");
- this.showInfoDetailModal = false;
- this.showAgreementModal = false;
- })
- .catch((err) => {
- this.$message.warning(err.msg);
- this.uploading = false;
- });
- }
- } else {
- this.uploading = false;
- this.$message.warning("证件照和身份证人像面照片不匹配");
- }
- })
- .catch((err) => {
- this.uploading = false;
- this.$message.warning(err.msg);
- });
- return;
- }
- if (self.remarkStatus) {
- var arsty = {};
- for (let k in data) {
- for (let j in self.copyData) {
- if (k === j) {
- if (self.copyData[j].value === data[k]) {
- arsty[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listData.length; i++) {
- if (self.listData[i].fieldKey == k) {
- return self.listData[i].fieldName;
- }
- }
- })(),
- status: 0,
- };
- } else {
- arsty[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listData.length; i++) {
- if (self.listData[i].fieldKey == k) {
- return self.listData[i].fieldName;
- }
- }
- })(),
- status: 1,
- };
- }
- }
- }
- }
- var datas = {
- id: this.id,
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- keyValue: JSON.stringify(arsty),
- };
- this.$request
- .editbaseprofiletp(datas)
- .then((res) => {
- this.uploading = false;
- this.courseCourseList();
- this.getUserInfo();
- this.$message.success("提交成功");
- this.showInfoDetailModal = false;
- this.showAgreementModal = false;
- })
- .catch((err) => {
- this.$message.warning(err.msg);
- this.uploading = false;
- });
- } else {
- var objs = {};
- for (let k in data) {
- objs[k] = {
- fieldKey: k,
- value: data[k],
- fieldName: (function () {
- for (let i = 0; i < self.listData.length; i++) {
- if (self.listData[i].fieldKey == k) {
- return self.listData[i].fieldName;
- }
- }
- })(),
- status: 0,
- };
- }
- var datas = {
- goodsId: this.goodsId,
- profileTpId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- keyValue: JSON.stringify(objs),
- };
- this.$request
- .addbaseprofiletp(datas)
- .then((res) => {
- this.uploading = false;
- this.courseCourseList();
- this.getUserInfo();
- this.$message.success("提交成功");
- this.showInfoDetailModal = false;
- this.showAgreementModal = false;
- })
- .catch((err) => {
- this.$message.warning(err.msg);
- this.uploading = false;
- });
- }
- },
- subCanvas() {
- return new Promise((resolve, reject) => {
- var self = this;
- if (self.infoForm.commitment_electr_signature) {
- resolve();
- return;
- }
- this.$refs.esign[0]
- .generate() // 使用生成器调用把签字的图片转换成为base64图片格式
- .then(async (res) => {
- let url = await this.$upload.upload(
- this.convertBase64UrlToBlob(res),
- 0
- );
- this.$set(this.infoForm, "commitment_electr_signature", url);
- resolve();
- })
- .catch((err) => {
- console.log(err, "err");
- // 画布没有签字时会执行这里提示一下
- // this.uploading = false;
- // this.$message({
- // type: "warning",
- // message: "请签名后再生成签字图片",
- // });
- resolve();
- });
- });
- },
- imageInfos() {
- var self = this;
- return new Promise(async (resolve, reject) => {
- const waitUpload = await self.uploadFile(self.faceUrl, 0);
- resolve(waitUpload);
- });
- },
- getarrays(key) {
- if (key === "sex") {
- return this.dictObj["sys_user_sex"];
- }
- if (key === "education") {
- return this.dictObj["edu_level"];
- }
- if (key === "working_years") {
- return this.dictObj["working_years"];
- }
- },
- dictList() {
- this.$request.dictList().then((res) => {
- if (res.code === 200) {
- let newList = {};
- let list = res.data;
- for (let i = 0; i < list.length; i++) {
- let item = list[i];
- if (newList.hasOwnProperty(item.dictType)) {
- newList[item.dictType].push(item.dictLabel);
- } else {
- newList[item.dictType] = [item.dictLabel];
- }
- }
- this.dictObj = newList;
- }
- });
- },
- getbaseprofiletplists() {
- return new Promise((resolve) => {
- let self = this;
- this.$request
- .getbaseprofiletplists({
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId || "",
- })
- .then((res) => {
- if (res.code === 200 && res.rows.length) {
- if (res.rows[0].keyValue) {
- self.$request
- .getbaseprofiletpId(self.goodsId)
- .then((baseRes) => {
- if (baseRes.code === 200) {
- if (baseRes.data) {
- self.$request
- .getbaseprofiletpgetInfo({
- goodsId: self.goodsId,
- orderGoodsId: self.orderGoodsId,
- })
- .then((result) => {
- console.log(result, "result");
- if (result.code === 200) {
- if (
- !result.data ||
- (result.data.status === 3 &&
- result.data.changeStatus === 1)
- ) {
- if (!result.data) {
- self.needProfileModal = true;
- this.$confirm(`请填写资料`, "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "返回",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- distinguishCancelAndClose: false,
- showClose: false,
- })
- .then((_) => {
- this.showAgreementModal = true;
- this.getInfo();
- })
- .catch((_) => {
- this.$router.back(-1);
- });
- } else {
- this.$confirm(
- `资料审核不通过,请前往重新填写`,
- "提示",
- {
- confirmButtonText: "确定",
- cancelButtonText: "返回",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- distinguishCancelAndClose: false,
- showClose: false,
- }
- )
- .then((_) => {
- this.showInfoDetailModal = true;
- this.getInfo();
- })
- .catch((_) => {
- this.$router.back(-1);
- });
- }
- } else if (
- result.data.status === 1 &&
- JSON.parse(res.rows[0].keyValue2)[0]
- ) {
- console.log(8);
- self.$request
- .getbaseprofileStampgetInfo({
- goodsId: self.goodsId,
- orderGoodsId: self.orderGoodsId,
- })
- .then((k) => {
- if (k.code === 200) {
- if (
- !k.data ||
- (k.data.status === 3 &&
- k.data.changeStatus === 1)
- ) {
- if (!k.data) {
- console.log(9);
- this.$confirm(
- `请前往填写盖章资料`,
- "提示",
- {
- confirmButtonText: "确定",
- cancelButtonText: "返回",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- distinguishCancelAndClose: false,
- showClose: false,
- }
- )
- .then((_) => {
- this.showStampDetailModail = true;
- this.getInfoStamp();
- })
- .catch((_) => {
- this.$router.back(-1);
- });
- } else {
- console.log(10);
- self.needProfileModal = true;
- this.$confirm(
- `资料盖章审核不通过,请前往重新填写`,
- "提示",
- {
- confirmButtonText: "确定",
- cancelButtonText: "返回",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- distinguishCancelAndClose: false,
- showClose: false,
- }
- )
- .then((_) => {
- this.showStampDetailModail = true;
- this.getInfoStamp();
- })
- .catch((_) => {
- this.$router.back(-1);
- });
- }
- } else {
- resolve();
- }
- }
- });
- } else {
- resolve();
- }
- }
- });
- } else {
- resolve();
- }
- }
- });
- } else {
- resolve();
- }
- } else {
- resolve();
- }
- });
- if (this.gradeId > 0) {
- //提交完资料返回判断是否已开班
- this.getGradeInfo();
- }
- });
- },
- getInfoStamp() {
- var self = this;
- this.$request.getbaseprofiletpId(this.goodsId).then((res) => {
- var ast = JSON.parse(res.data.keyValue2);
- self.listDataStamp = ast;
- self.$request
- .getbaseprofileStampgetInfo({
- goodsId: self.goodsId,
- orderGoodsId: self.orderGoodsId,
- })
- .then((result) => {
- if (result.data && result.data.status === 3) {
- self.remarkStamp = result.data.text;
- self.remarkStatusStamp = true;
- self.id = result.data.id;
- } else if (
- result.data &&
- (result.data.status === 1 || result.data.status === 2)
- ) {
- // uni.showModal({
- // showCancel: false,
- // content:
- // result.data.status === 1
- // ? "该商品审核资料已通过,不可重复提交资料"
- // : result.data.status === 2
- // ? "该商品审核资料处于待审核状态,不可重复提交资料"
- // : "请联系管理员",
- // success: function (k) {
- // if (k.confirm) {
- // uni.navigateBack();
- // }
- // },
- // });
- }
- })
- .catch((err) => {});
- });
- },
- getGradeInfo() {
- let self = this;
- this.$request.goodsGradeInfo(this.gradeId).then((res) => {
- if (res.code == 200) {
- self.gradeDetail = res.data;
- if (self.needProfileModal) {
- return;
- }
- if (self.gradeDetail.learningStatus == 2) {
- this.$confirm(
- `当前课程正在申请中,正式开班后方可进行学习,请耐心等候!`,
- "提示",
- {
- confirmButtonText: "确定",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- showCancelButton: false,
- distinguishCancelAndClose: false,
- showClose: false,
- }
- )
- .then((_) => {
- this.$router.back(-1);
- })
- .catch((_) => {});
- }
- if (
- self.gradeDetail.learningStatus == 3 &&
- Number(self.gradeDetail.learningTimeStart) >
- Number(new Date() / 1000)
- ) {
- this.$confirm(
- `当前课程正在申请中,正式开班后方可进行学习,请耐心等候!`,
- "提示",
- {
- confirmButtonText: "返回",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- showCancelButton: false,
- distinguishCancelAndClose: false,
- showClose: false,
- }
- )
- .then((_) => {
- this.$router.back(-1);
- })
- .catch((_) => {});
- }
- }
- });
- this.$store.state.allowLoading = true;
- },
- deleteImg(item) {
- if (item.fieldKey == "recent_photos") {
- this.fileList1 = [];
- this.infoForm["recent_photos"] = "";
- } else if (item.fieldKey == "idcard_face_photo") {
- this.fileList2 = [];
- this.infoForm["idcard_face_photo"] = "";
- } else if (item.fieldKey == "idcard_national_photo") {
- this.fileList3 = [];
- this.infoForm["idcard_national_photo"] = "";
- }
- },
- /**
- * getbaseprofiletpgetInfo接口返回值result.data.data不存在的话说明是第一次填写资料
- */
- getInfo() {
- var self = this;
- this.$request.getbaseprofiletpId(this.goodsId).then((res) => {
- console.log(res, "res");
- var listData = JSON.parse(res.data.keyValue);
- var ast = JSON.parse(res.data.keyValue2);
- self.listData = [...listData, ...ast];
- console.log(self.listData, "self.listData");
- self.listData.forEach((item) => {
- if (item.fieldKey == "idcard") {
- this.infoForm.idcard = this.userInfo.idCard;
- this.disCard = this.infoForm.idcard ? true : false;
- }
- if (item.fieldKey == "telphone") {
- this.infoForm.telphone = this.userInfo.telphone;
- }
- if (item.fieldKey == "name") {
- this.infoForm.name = this.userInfo.realname || "";
- this.disName = this.infoForm.name ? true : false;
- }
- });
- self.isRequired = self.listData.every((ims) => {
- return ims.required === false;
- });
- this.$nextTick(() => {
- this.agreementModal = true;
- });
- self.$request
- .getbaseprofiletpgetInfo({
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- })
- .then((result) => {
- if (result.code === 200) {
- if (!result.data) {
- self.$request
- .getbaseprofiletplistProfile({
- pageNum: 1,
- pageSize: 1,
- })
- .then((kit) => {
- if (kit.rows.length) {
- var ajson = JSON.parse(kit.rows[0].keyValue);
- self.listData.forEach((zyitem, zyindex) => {
- for (let k in ajson) {
- if (zyitem.fieldKey == k && ajson[k].value) {
- if (k === "sex") {
- const sexIndex =
- self.dictObj["sys_user_sex"].indexOf(
- ajson[k].value
- ) + "";
- self.$set(self.infoForm, k, sexIndex);
- } else if (k === "education") {
- const sexIndex =
- self.dictObj["edu_level"].indexOf(
- ajson[k].value
- ) + "";
- self.$set(self.infoForm, k, sexIndex);
- } else if (k === "working_years") {
- const sexIndex =
- self.dictObj["working_years"].indexOf(
- ajson[k].value
- ) + "";
- self.$set(self.infoForm, k, sexIndex);
- } else if (k === "recent_photos") {
- self.$set(self.infoForm, k, ajson[k].value);
- if (ajson[k].value) {
- self.fileList1 = [
- {
- url: ajson[k].value,
- },
- ];
- }
- } else if (k === "idcard_face_photo") {
- self.$set(self.infoForm, k, ajson[k].value);
- if (ajson[k].value) {
- self.fileList2 = [
- {
- url: ajson[k].value,
- },
- ];
- }
- } else if (k === "idcard_national_photo") {
- self.$set(self.infoForm, k, ajson[k].value);
- if (ajson[k].value) {
- self.fileList3 = [
- {
- url: ajson[k].value,
- },
- ];
- }
- } else {
- if (k === "name") {
- self.$set(
- self.infoForm,
- k,
- this.$store.state.userInfo.realname
- );
- } else if (k === "idcard") {
- self.$set(
- self.infoForm,
- k,
- this.$store.state.userInfo.idCard
- );
- } else if (k === "telphone") {
- self.$set(
- self.infoForm,
- k,
- this.$store.state.userInfo.telphone
- );
- } else if (k !== "commitment_electr_signature") {
- self.$set(self.infoForm, k, ajson[k].value);
- }
- }
- }
- }
- });
- }
- });
- }
- if (result.data && result.data.status === 3) {
- self.remark = result.data.text;
- self.remarkStatus = true;
- self.id = result.data.id;
- var arrays = JSON.parse(result.data.keyValue);
- self.copyData = JSON.parse(JSON.stringify(arrays));
- for (let k in arrays) {
- if (k === "sex") {
- if (arrays[k].value) {
- const sexIndex =
- self.dictObj["sys_user_sex"].indexOf(arrays[k].value) +
- "";
- self.$set(self.infoForm, k, sexIndex);
- }
- } else if (k === "education") {
- if (arrays[k].value) {
- const sexIndex =
- self.dictObj["edu_level"].indexOf(arrays[k].value) + "";
- self.$set(self.infoForm, k, sexIndex);
- }
- } else if (k === "working_years") {
- if (arrays[k].value) {
- const sexIndex =
- self.dictObj["working_years"].indexOf(arrays[k].value) +
- "";
- self.$set(self.infoForm, k, sexIndex);
- }
- } else if (k === "recent_photos") {
- self.$set(self.infoForm, k, arrays[k].value);
- if (arrays[k].value) {
- self.fileList1 = [{ url: arrays[k].value }];
- }
- } else if (k === "idcard_face_photo") {
- self.$set(self.infoForm, k, arrays[k].value);
- if (arrays[k].value) {
- self.fileList2 = [{ url: arrays[k].value }];
- }
- } else if (k === "idcard_national_photo") {
- self.$set(self.infoForm, k, arrays[k].value);
- if (arrays[k].value) {
- self.fileList3 = [{ url: arrays[k].value }];
- }
- } else if (k === "name") {
- self.$set(
- self.infoForm,
- k,
- this.$store.state.userInfo.realname
- );
- } else if (k === "idcard") {
- self.$set(
- self.infoForm,
- k,
- this.$store.state.userInfo.idCard
- );
- } else if (k === "telphone") {
- self.$set(
- self.infoForm,
- k,
- this.$store.state.userInfo.telphone
- );
- } else {
- self.$set(self.infoForm, k, arrays[k].value);
- }
- }
- } else if (
- result.data &&
- (result.data.status === 1 || result.data.status === 2)
- ) {
- this.$confirm(
- result.data.status === 1
- ? "该商品审核资料已通过,不可重复提交资料"
- : result.data.status === 2
- ? "该商品审核资料处于待审核状态,不可重复提交资料"
- : "请联系管理员",
- "提示",
- {
- confirmButtonText: "返回",
- closeOnClickModal: false,
- closeOnPressEscape: false,
- showCancelButton: false,
- distinguishCancelAndClose: false,
- showClose: false,
- }
- )
- .then((_) => {
- this.$router.back(-1);
- })
- .catch((_) => {});
- }
- }
- });
- });
- },
- returnName(key) {
- if (key === "sex") {
- if (this.infoForm[key]) {
- return this.dictObj["sys_user_sex"][Number(this.infoForm[key])];
- } else {
- return "请选择性别";
- }
- }
- if (key === "education") {
- if (this.infoForm[key]) {
- return this.dictObj["edu_level"][Number(this.infoForm[key])];
- } else {
- return "请选择学历";
- }
- }
- if (key === "working_years") {
- if (this.infoForm[key]) {
- return this.dictObj["working_years"][Number(this.infoForm[key])];
- } else {
- return "请选择工作年限";
- }
- }
- },
- retDraw() {
- this.$set(this.infoForm, "commitment_electr_signature", "");
- this.$nextTick(() => {
- this.$refs.esign[0].reset();
- });
- },
- uploadFile(options, int) {
- var self = this;
- return new Promise((resolve, reject) => {
- var data = {
- imageStatus: int,
- gradeId: this.gradeId,
- orderGoodsId: this.orderGoodsId,
- };
- self.$request
- .getPolicy(data)
- .then((res) => {
- var ossToken = res.data.resultContent;
- if (ossToken.host == null || ossToken.host == undefined) {
- this.$message({
- type: "warning",
- message: "上传路径报错" + JSON.stringify(res.data),
- });
- return;
- }
- let data = this.$tools.convertBase64UrlToBlob(this.faceUrl);
- this.$upload
- .upload(data, 0)
- .then((res) => {
- this.ossAvatarUrl = res;
- resolve(res);
- })
- .catch((err) => {
- this.$message({
- type: "warning",
- message: "上传接口报错,请重新拍照上传",
- });
- this.reTake();
- });
- })
- .catch((err) => {
- this.$message({
- type: "warning",
- message: "签名错误" + JSON.stringify(err),
- });
- return;
- });
- });
- },
- faceRecognition() {
- return new Promise((resolve) => {
- this.$request
- .faceCertificationCompareFace({
- imageA: this.faceUrl,
- orderGoodsId: this.orderGoodsId,
- gradeId: this.gradeId,
- })
- .then((res) => {
- resolve(res.data);
- })
- .catch((err) => {
- if (err.toString().indexOf("timeout") != -1) {
- err = {
- msg: "拍照超时,请重新拍照",
- };
- }
- this.loading = false;
- this.$message({
- type: "warning",
- message: err.msg,
- });
- });
- });
- },
- /**
- * 点击重拍
- */
- reTake() {
- this.faceUrl = "";
- this.isTaking = true;
- this.getUserMedia({
- video: {
- width: 400,
- height: 400,
- },
- });
- },
- // 点击拍照按钮
- onPhoto() {
- // if (this.isIE) {
- // window.webcam.capture();
- // } else {
- const canvas = document.createElement("canvas");
- canvas.width = 400;
- canvas.height = 400;
- const context = canvas.getContext("2d");
- const video = document.getElementById("video");
- context.drawImage(video, 0, 0, 400, 400);
- this.faceUrl = canvas.toDataURL("image/png");
- this.isTaking = false;
- // }
- },
- getUserMedia(constraints, success, error) {
- if (window.navigator.mediaDevices.getUserMedia) {
- // 最新的标准API
- window.navigator.mediaDevices
- .getUserMedia(constraints)
- .then(success)
- .catch(error);
- } else if (window.navigator.webkitGetUserMedia) {
- // webkit核心浏览器
- window.navigator.webkitGetUserMedia(constraints, success, error);
- } else if (window.navigator.mozGetUserMedia) {
- // firfox浏览器
- window.navigator.mozGetUserMedia(constraints, success, error);
- } else if (window.navigator.getUserMedia) {
- // 旧版API
- window.navigator.getUserMedia(constraints, success, error);
- }
- },
- photographSuccess(stream) {
- // 兼容webkit核心浏览器
- if (this.isVirtualCamera(stream)) {
- return;
- }
- this.isTaking = true;
- this.takePhotoModal = true;
- this.$nextTick(() => {
- const video = document.getElementById("video");
- // 将视频流设置为video元素的源
- console.dir(video);
- video.srcObject = stream;
- this.mediaStreamTrack =
- typeof stream.stop === "function" ? stream : stream.getTracks()[0];
- video.play();
- });
- },
- photographError(err) {
- this.$confirm(
- "课程学习需要开启摄像头进行拍照,经检测您的设备无摄像头可使用,请检测环境是否支持。",
- "提示",
- {
- confirmButtonText: "返回",
- showConfirmButton: true,
- closeOnClickModal: false,
- showCancelButton: false,
- closeOnPressEscape: false,
- distinguishCancelAndClose: false,
- showClose: false,
- }
- ).then(() => {
- this.$router.go(-1);
- });
- },
- isVirtualCamera(stream) {
- const list = [
- "VCam",
- "ManyCam",
- "OBS",
- "ClassInCam",
- "Ev",
- "Video2Webcam",
- ];
- let isT = list.some((e) => {
- return stream.getTracks()[0].label.indexOf(e) != -1;
- });
- if (isT) {
- this.$confirm("检测到你使用虚拟摄像头,无法继续学习。", "提示", {
- confirmButtonText: "返回",
- showConfirmButton: true,
- closeOnClickModal: false,
- showCancelButton: false,
- closeOnPressEscape: false,
- distinguishCancelAndClose: false,
- showClose: false,
- }).then(() => {
- this.$router.go(-1);
- });
- }
- return isT;
- },
- /**
- * 切换科目
- */
- courseChange() {
- return new Promise((resolve) => {
- this.needOpen = true;
- this.noteParams = {
- pageNum: 1,
- // pageSize: 4,
- };
- this.duration = 0;
- this.playSectionId = 0;
- this.vid = "";
- if (this.player) {
- this.player.destroy();
- }
- this.player = "";
- if (this.playerzb) {
- this.playerzb.destroy();
- }
- this.playerzb = "";
- this.vidzb = "";
- this.historyChatMsgList = [];
- this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
- this.courseDetail(); //课程详情
- this.getAnswerList(); //答疑列表
- // this.answerTimer = setInterval(() => {
- // this.getAnswerList();
- // }, 5000);
- this.getMenuList(); //学习目录
- this.getReMenuList(); //获取重修目录
- this.getNoteList(); //获取节笔记
- //更新老师信息
- this.goodsTeacher.forEach((item) => {
- if (item.courseList.some((x) => x.courseId == this.courseId)) {
- this.teacherList = item.teaList;
- }
- });
- console.log(this.teacherList, "this.teacherList");
- resolve();
- });
- },
- polyvLiveHistoryChatMsgList() {
- this.$request
- .polyvLiveHistoryChatMsgList({
- sectionId: this.playSectionId,
- channelId: this.sectionItem.liveUrl,
- })
- .then((res) => {
- this.historyChatMsgList = res.data;
- });
- },
- courseDetail() {
- let self = this;
- this.$request.courseDetail(this.courseId).then((res) => {
- // if (res.data.educationName == "继续教育") {
- // this.$request
- // .lockLockAction({
- // action: "jxjy",
- // })
- // .then((res) => {});
- // this.lockTimer = setInterval(() => {
- // this.$request
- // .lockLockAction({
- // action: "jxjy",
- // })
- // .then((res) => {});
- // }, 10000);
- // }
- self.detail = res.data;
- });
- },
- openModule(menuItem, status = false, isAuto = false) {
- menuItem.showList = !menuItem.showList;
- let { list, isRebuild, id, courseId } = menuItem;
- if (list.length) return;
- return this.$request
- .reChapterList({
- moduleId: id,
- gradeId: this.gradeId,
- courseId: courseId,
- rebuild: isRebuild ? 1 : undefined,
- })
- .then((res) => {
- for (let i = 0; i < res.data.length; i++) {
- let item = res.data[i];
- item.id = item.chapterId;
- item.showList = false;
- item.list = [];
- item.parent = menuItem;
- isRebuild ? (item.isRebuild = 1) : (item.menuType = 2);
- }
- menuItem.list = res.data;
- if (isAuto) {
- return Promise.resolve(res.data);
- }
- if (isRebuild) return;
- if (status) {
- const FindIndexs = menuItem.list.findIndex((item) => {
- return item.chapterId == this.sectionItem.chapterId;
- });
- if (FindIndexs != -1) {
- this.openChapter(menuItem.list[FindIndexs]);
- } else {
- this.$message.warning("章列表定位失败");
- }
- } else {
- if (this.needOpen) {
- this.openChapter(menuItem.list[0]);
- }
- }
- });
- },
- async openChapter(chapter) {
- //获取节试卷列表
- this.$request
- .reSectionExamList({
- chapterId: chapter.chapterId || chapter.menuId,
- courseId: this.courseId,
- gradeId: this.gradeId,
- })
- .then((res) => {
- this.sectionExam = [...this.sectionExam, ...res.data];
- });
- chapter.showList = !chapter.showList;
- if (!chapter.list.length) {
- if (chapter.isRebuild) {
- return await this.getReSectionList(
- chapter.id,
- chapter.courseId,
- chapter.moduleId || 0,
- chapter
- );
- } else {
- return await this.getBuySectionList(
- chapter.id,
- chapter.courseId,
- chapter.moduleId || 0,
- chapter
- );
- }
- }
- },
- getReSectionList(chapterId, courseId, moduleId, chapter) {
- return this.$request
- .reSectionList({
- chapterId: chapterId,
- gradeId: this.gradeId,
- courseId: courseId,
- rebuild: 1,
- moduleId: moduleId,
- })
- .then((res) => {
- let newArr = res.data.filter((item) => {
- return item.type != 2;
- });
- chapter.canLearn = newArr.every((item) => {
- if (item.learning == 1) {
- return true;
- } else {
- return false;
- }
- });
- res.data.forEach((section) => {
- section.parent = chapter;
- });
- chapter.list = res.data;
- return Promise.resolve(chapter.list);
- });
- },
- getBuySectionList(chapterId, courseId, moduleId = 0, chapter) {
- // /course/sectionList 查询章与节关系列表+章卷同级展示
- return this.$request
- .reSectionList({
- chapterId: chapterId,
- gradeId: this.gradeId,
- courseId: courseId,
- moduleId: moduleId,
- })
- .then((res) => {
- let newArr = res.data.filter((item) => {
- return item.type != 2;
- });
- chapter.canLearn = newArr.every((item) => {
- if (item.learning == 1) {
- return true;
- } else {
- return false;
- }
- });
- res.data.forEach((section) => {
- section.parent = chapter;
- });
- chapter.list = res.data;
- if (this.needOpen) {
- this.needOpen = false;
- if (
- chapter.list &&
- !this.sectionItem.recordingUrl &&
- this.sectionItem.sectionType != 2
- ) {
- // this.getResource(chapter.list[0]);
- }
- }
- return Promise.resolve(chapter.list);
- });
- },
- getGoodsDetail() {
- return new Promise((resolve) => {
- let self = this;
- this.$request.goodsDetail(this.goodsId).then((res) => {
- self.goodsData = res.data;
- self.gradeId = self.goodsData.gradeId;
- if (this.goodsData.categoryName) {
- this.infoForm.apply_post = this.goodsData.categoryName;
- if (this.goodsData.categoryName) {
- this.apply_post_disabled = true;
- }
- if (this.userInfo.companyName) {
- this.infoForm.work_unit = this.userInfo.companyName;
- }
- }
- if (this.goodsData.buyNote) {
- this.tabList = [
- { name: "1", label: "学员须知" },
- // { name: "2", label: "课程答疑" },
- // { name: "3", label: "笔记讲义" },
- ];
- console.log(res, "res111");
- this.getRecommend();
- } else {
- this.tabList = [
- // { name: "1", label: "课程答疑" },
- // { name: "2", label: "笔记讲义" },
- ];
- }
- this.courseBusiness();
- this.courseHandouts();
- if (self.goodsData.goodsPlayConfig) {
- self.goodsPlayConfig = JSON.parse(self.goodsData.goodsPlayConfig);
- if (self.goodsPlayConfig.autoPlay > 0) {
- self.autoplay = true;
- }
- if (self.goodsPlayConfig.drag > 0) {
- self.isAllowSeek = "off";
- }
- if (self.goodsPlayConfig.speed > 0) {
- self.playbackRate = true;
- }
- }
- if (self.goodsData.goodsPhotographConfig) {
- self.goodsPhotographConfig = JSON.parse(
- self.goodsData.goodsPhotographConfig
- );
- if (self.goodsPhotographConfig.photoNum > 0) {
- self.photoNum = self.goodsPhotographConfig.photoNum;
- }
- }
- });
- resolve();
- });
- },
- // 新增用户视频学习日志
- studyLog(moduleId, chapterId, sectionId) {
- this.$axios({
- url: "/user/study/log",
- method: "post",
- data: {
- goodsId: this.goodsId,
- courseId: this.courseId,
- moduleId: moduleId || 0,
- chapterId: chapterId || 0,
- sectionId: sectionId || 0,
- fromPlat: 2, //来源平台 1小程序 2PC网站
- goodsType: 1, // 商品类型 1视频2题库 3补考 4前培 5虚拟赠送题库 6直播
- orderGoodsId: this.orderGoodsId,
- },
- }).then((res) => {
- console.log("直播的用户学习日志:", res);
- });
- },
- // 节卷不需要控制
- handelPracticeOrRxam(section, type) {
- if (type == 3) {
- //节卷
- let data = this.sectionExamList.filter(
- (x) => x.sectionId == section.menuId
- );
- if (data && data.length > 0) {
- section = data[0];
- }
- } else if (type == 2) {
- //节卷
- let data = this.sectionExam.filter(
- (x) => x.sectionId == section.sectionId
- );
- if (data && data.length > 0) {
- section = data[0];
- }
- }
- this.$router.push({
- path: "/course-exam/" + this.goodsId,
- query: {
- courseId: this.courseId,
- gradeId: this.gradeId,
- moduleId: section.moduleId || 0,
- sectionId: section.sectionId || 0,
- examId: section.typeId,
- learning: section.learning,
- type: type,
- chapterId: section.chapterId || 0,
- orderGoodsId: this.orderGoodsId,
- },
- });
- },
- async exceedLearnNum(section) {
- let learnNum = await this.goodsTodayStudySectionNum();
- let hasLearn = await this.gradeCheckGoodsStudy(section.typeId);
- if (this.goodsData.sectionMaxNum > 0) {
- if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
- this.$message({
- type: "warning",
- message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
- });
- return false;
- }
- }
- return true;
- },
- /**
- * 点击节
- */
- async getResource(section, type) {
- if (!(await this.orderTopTobottom(section, type))) {
- this.clickLock = false;
- this.$message({
- type: "warning",
- message:
- section.type == 2
- ? "请学完视频课程再进行练习和测试"
- : "请按顺序学习视频课程",
- });
- return false;
- }
- this.clickSectionItem = section;
- //逻辑
- if (
- section.sectionType === 2 &&
- section.liveStartTime &&
- section.liveEndTime
- ) {
- if (section.liveStartTime > this.nowTime) {
- this.$message.warning("直播待开播");
- return;
- }
- if (section.liveEndTime < this.nowTime) {
- this.$message.warning("直播已结束");
- return;
- }
- }
- if (section.type == 2) {
- //试卷
- // 学习次数
- if (!(await this.exceedLearnNum(section))) {
- return false;
- }
- let num =
- this.businessData.goodsLearningOrder != 2 || section.rebuild
- ? await this.bankRecordDoNum(section.typeId)
- : section.doNum;
- if (section.answerNum - num > 0 && section.answerNum > 0) {
- this.$router.push({
- path: "/course-exam/" + this.goodsId,
- query: {
- courseId: this.courseId,
- gradeId: this.gradeId,
- moduleId: section.moduleId || 0,
- sectionId: section.sectionId || 0,
- examId: section.typeId,
- learning: section.learning,
- type: type,
- chapterId: section.chapterId || 0,
- orderGoodsId: this.orderGoodsId,
- },
- });
- //没有答题次数限制
- } else if (section.answerNum == 0) {
- this.$router.push({
- path: "/course-exam/" + this.goodsId,
- query: {
- courseId: this.courseId,
- gradeId: this.gradeId,
- moduleId: section.moduleId || 0,
- sectionId: section.sectionId || 0,
- examId: section.typeId,
- learning: section.learning,
- type: type,
- chapterId: section.chapterId || 0,
- orderGoodsId: this.orderGoodsId,
- },
- });
- } else {
- this.$message({
- type: "warning",
- message: "该试卷只能答题" + section.answerNum + "次",
- });
- return;
- }
- this.studyLog(
- (section.moduleId = 0),
- (section.chapterId = 0),
- section.typeId
- );
- return;
- }
- if (section.type != 2) {
- if (this.clickLock) {
- return;
- }
- this.clickLock = true;
- if (
- this.sectionItem.sectionType === 1 &&
- this.playSectionId &&
- (this.playSectionId == section.sectionId ||
- this.playSectionId == section.menuId) &&
- this.moduleId == (section.moduleId || 0) &&
- this.chapterId == (section.chapterId || 0)
- ) {
- //切换为同一频道不作为
- this.clickLock = false;
- return;
- }
- this.initVideo(section);
- }
- },
- async orderTopTobottom(section, type) {
- let { rebuild, moduleId, chapterId } = section;
- if (this.businessData.goodsLearningOrder != 2 || rebuild) {
- return true;
- }
- let list = await this.studyRecordMenuAllList();
- type = type == 1 && section.type == 2 ? 2 : type;
- if (type == 1) {
- let index = list.findIndex(
- (e) =>
- e.moduleId == moduleId &&
- e.chapterId == chapterId &&
- e.id == section.sectionId
- );
- list = list.slice(0, index);
- } else if (type != 3) {
- list = list.filter(
- (e) => e.moduleId == moduleId && e.chapterId == chapterId
- );
- }
- return list.every((item) => item.studyStatus == 1);
- },
- bankRecordDoNum(section) {
- return new Promise((resolve) => {
- this.$request
- .bankRecordDoNum({
- goodsId: this.goodsId,
- gradeId: this.gradeId,
- chapterId: section.chapterId,
- courseId: this.courseId,
- moduleId: 0,
- examId: section.typeId,
- })
- .then((res) => {
- resolve(res.data);
- });
- });
- },
- /**
- * 是否有上一章节
- */
- hasPreItem(rows, option) {
- let moduleId = option.moduleId;
- let chapterId = option.chapterId;
- let sectionId = option.sectionId;
- let index = 0;
- for (let i = 0; i < rows.length; i++) {
- if (
- rows[i].moduleId == moduleId &&
- rows[i].chapterId == chapterId &&
- rows[i].sectionId == sectionId
- ) {
- index = i;
- break;
- }
- }
- if (index == 0) {
- return false;
- } else {
- return true;
- }
- },
- async initVideo(option) {
- if (option.sectionType == 1 || option.sectionType == 3) {
- //视频
- let learnNum = await this.goodsTodayStudySectionNum(option);
- let hasLearn = await this.gradeCheckGoodsStudy(option);
- console.log(hasLearn, "hasLearn");
- console.log(learnNum, "learnNum");
- console.log(
- this.goodsData.sectionMaxNum,
- "this.goodsData.sectionMaxNum"
- );
- if (this.goodsData.sectionMaxNum > 0) {
- if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
- this.clickLock = false;
- this.$message({
- type: "warning",
- message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
- });
- return;
- }
- }
- if (!option.recordingUrl) {
- this.clickLock = false;
- this.$message({
- type: "warning",
- message: `暂无播放地址数据`,
- });
- return;
- }
- if (this.playSectionId > 0) {
- //切换视频
- // let oldSectionId = this.playSectionId;
- // uni.$emit("changeSection", oldSectionId);
- }
- this.playVideo(option);
- }
- if (option.sectionType == 2) {
- //直播
- let learnNum = await this.goodsTodayStudySectionNum(option);
- let hasLearn = await this.gradeCheckGoodsStudy(option);
- if (this.goodsData.sectionMaxNum > 0) {
- if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
- this.clickLock = false;
- this.$message({
- type: "warning",
- message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
- });
- return;
- }
- }
- if (!option.liveUrl) {
- this.clickLock = false;
- this.$message({
- type: "warning",
- message: `暂无直播地址数据`,
- });
- }
- let data = await this.studyRecordGetChannelBasicInfo(option.liveUrl);
- if (data.watchStatus == "end" || data.watchStatus == "playback") {
- this.clickLock = false;
- this.$message({
- type: "warning",
- message: `直播已结束`,
- });
- return;
- }
- if (data.watchStatus == "waiting") {
- this.clickLock = false;
- this.$message({
- type: "warning",
- message: `直播未开始`,
- });
- return;
- }
- this.playVideo(option);
- }
- return;
- },
- studyRecordGetChannelBasicInfo(channelId) {
- return new Promise((resolve) => {
- this.$request
- .studyRecordGetChannelBasicInfo({
- channelId,
- })
- .then((res) => {
- console.log(res, "channel");
- resolve(res.data);
- })
- .catch((err) => {
- this.clickLock = false;
- this.$message.error(err.msg);
- });
- });
- },
- /**
- * 判断是否是当前播放的节
- */
- isActive(section) {
- let moduleId = section.moduleId || 0;
- let chapterId = section.chapterId || 0;
- let sectionId = section.sectionId || section.menuId;
- if (
- moduleId == this.moduleId &&
- chapterId == this.chapterId &&
- sectionId == this.playSectionId
- ) {
- return true;
- } else {
- return false;
- }
- },
- async playVideo(option) {
- console.log("asdhsuohfosufgasoug", option);
- if (option.sectionType == 3) {
- console.log("huifang");
- // 回放
- if (Object.keys(this.clickSectionItem).length) {
- //this.clickSectionItem 判断点击节才跳转, 不判断的话一进来页面到这里就直接跳转了
- this.$router.push({
- path: "/living-room/" + option.liveUrl,
- query: {
- goodsId: this.goodsId,
- courseId: this.courseId,
- gradeId: this.gradeId,
- orderGoodsId: this.orderGoodsId,
- sectionId: option.sectionId || option.menuId,
- chapterId: option.chapterId || 0,
- moduleId: option.moduleId || 0,
- sectionType: 3,
- goodsName: option.name,
- vid: option.recordingUrl, // 回放vid
- },
- });
- this.clickSectionItem = {};
- return;
- }
- }
- if (option.sectionType == 1) {
- //提交保存观看历史
- if (this.playSectionId) {
- this.postStudyRecord(0, this.playSectionId);
- }
- this.player &&
- this.player.HTML5.video.removeEventListener(
- "timeupdate",
- this.timeEvent
- );
- //播放视频
- this.showRecordStatus = false; //隐藏播放记录提示
- this.sectionItem = option;
- this.isPlayRebuild = option.rebuild;
- this.moduleId = option.moduleId || 0;
- this.chapterId = option.chapterId || 0;
- this.playSectionId = option.sectionId || option.menuId;
- await this.getPhotoLastRecord();
- this.recordObj = await this.getRecordLast();
- this.getNoteList();
- await this.clears();
- this.vid = option.recordingUrl;
- this.historyChatMsgList = [];
- if (option.sectionType == 3) {
- this.polyvLiveHistoryChatMsgList();
- }
- this.loadPlayerScript(this.loadPlayer);
- setTimeout(() => {
- this.clickLock = false;
- }, 3000);
- this.studyLog(this.moduleId, this.chapterId, this.playSectionId);
- // uni.$emit("levelId", this.levelId);
- // uni.$emit("getSection", this.menuItem);
- // uni.$emit("isRebuild", this.isRebuild);
- }
- if (option.sectionType == 2) {
- //直播
- //提交保存观看历史
- if (this.playSectionId) {
- this.postStudyRecord(0, this.playSectionId);
- }
- this.player &&
- this.player.HTML5.video.removeEventListener(
- "timeupdate",
- this.timeEvent
- );
- //播放视频
- this.showRecordStatus = false; //隐藏播放记录提示
- this.sectionItem = option;
- console.log(option, "option");
- this.isPlayRebuild = option.rebuild;
- this.moduleId = option.moduleId || 0;
- this.chapterId = option.chapterId || 0;
- this.playSectionId = option.sectionId || option.menuId;
- // console.log(this.moduleId, this.chapterId, this.playSectionId);
- await this.getPhotoLastRecord();
- this.recordObj = await this.getRecordLast();
- this.getNoteList();
- //设置播放的节ID
- await this.clears();
- this.vidzb = option.liveUrl;
- this.$router.push({
- path: "/living-room/" + option.liveUrl,
- query: {
- goodsId: this.goodsId,
- courseId: this.courseId,
- gradeId: this.gradeId,
- orderGoodsId: this.orderGoodsId,
- sectionId: option.sectionId || option.menuId,
- chapterId: option.chapterId || 0,
- moduleId: option.moduleId || 0,
- sectionType: 2,
- },
- });
- // this.loadPlayerScriptzb(this.loadPlayerzb);
- // setTimeout(() => {
- // this.clickLock = false;
- // }, 3000);
- }
- },
- gradeCheckGoodsStudy(option) {
- return new Promise((resolve) => {
- this.$request
- .gradeCheckGoodsStudy({
- goodsId: this.goodsId,
- gradeId: this.gradeId,
- moduleId: option.moduleId || 0,
- chapterId: option.chapterId || 0,
- sectionId: option.sectionId || option.menuId,
- })
- .then((res) => {
- resolve(res.data);
- });
- });
- },
- goodsTodayStudySectionNum(option) {
- return new Promise((resolve) => {
- this.$request
- .goodsTodayStudySectionNum({
- goodsId: this.goodsId,
- gradeId: this.gradeId,
- })
- .then((res) => {
- resolve(res.data);
- });
- });
- },
- studyRecordMenuAllList() {
- return new Promise((resolve) => {
- this.$request
- .studyRecordMenuAllList({
- courseId: this.courseId,
- gradeId: this.gradeId,
- goodsId: this.goodsId,
- })
- .then((res) => {
- this.allVideoList = res.data;
- resolve(res.data);
- });
- });
- },
- loadPlayerzb() {
- var self = this;
- const polyvLivePlayer = window.polyvLivePlayer;
- this.playerzb = polyvLivePlayer({
- wrap: "#playerzb",
- width: 810,
- height: 455,
- showLine: "off",
- uid: this.uidzb,
- vid: this.vidzb,
- });
- this.playerzb.on("s2j_onStartPlay", () => {
- console.log("s2j_onStartPlay");
- this.hasStart = true;
- this.livingTimer = setInterval(self.timeEventLiving, 1000);
- });
- this.playerzb.on("s2j_onOver", () => {
- console.log("s2j_onOver");
- clearInterval(this.livingTimer);
- this.hasStart = false;
- this.$message({
- type: "success",
- message: "播放完毕",
- });
- this.postStudyRecord(1);
- });
- },
- // 播放视频
- loadPlayer() {
- var self = this;
- const polyvPlayer = window.polyvPlayer;
- self.$request.obtainpolyvvideosign(self.vid).then((res) => {
- self.player = polyvPlayer({
- wrap: "#player",
- width: 810,
- showLine: "off",
- height: 455,
- ban_history_time: "on",
- vid: self.vid,
- autoplay: this.autoplay,
- ban_seek: this.isAllowSeek,
- speed: this.playbackRate,
- teaser_show: 1,
- tail_show: 1,
- hideSwitchPlayer: true,
- watchStartTime: this.recordObj.videoCurrentTime,
- ts: res.data.ts,
- sign: res.data.sign,
- // adMatter: [
- // {
- // // 广告参数详细配置
- // location: 1, //广告位置: 1 片头广告,2 暂停广告,3 片尾广告,4 弹窗广告
- // adtype: 2, //广告资源类型: 1 图片广告,2 视频广告,3 swf广告(flash播放器生效)
- // matterurl: "https://www.runoob.com/try/demo_source/movie.mp4", //广告资源URL
- // timesize: 5, //广告时长,单位:秒
- // skipenabled: false, //是否显示跳过按钮
- // },
- // {
- // // 广告参数详细配置
- // location: 3, //广告位置: 1 片头广告,2 暂停广告,3 片尾广告,4 弹窗广告
- // adtype: 2, //广告资源类型: 1 图片广告,2 视频广告,3 swf广告(flash播放器生效)
- // matterurl: "https://www.runoob.com/try/demo_source/movie.mp4", //广告资源URL
- // timesize: 5, //广告时长,单位:秒
- // skipenabled: false, //是否显示跳过按钮
- // },
- // ],
- playsafe: function (vid, next) {
- self.$request.obtainpolyvvideopcsign(vid).then((res) => {
- next(res.data);
- });
- },
- });
- this.player.HTML5.video.addEventListener("timeupdate", self.timeEvent);
- this.player.on("s2j_onPlayStart", () => {
- //开始播放每5秒提交一次观看时间
- this.hasStart = true;
- clearInterval(this.postTimer);
- this.postTimer = setInterval(() => {
- this.postStudyRecord(0, this.playSectionId, 5);
- }, 30000);
- if (this.recordObj.videoCurrentTime) {
- this.showRecordStatus = true;
- setTimeout(() => {
- this.showRecordStatus = false;
- }, 5000);
- } else {
- //新视频直接提交一条观看记录
- // this.postStudyRecord(0);
- this.showRecordStatus = false;
- }
- });
- this.player.on("s2j_onVideoPause", () => {
- clearInterval(this.postTimer);
- });
- this.player.on("s2j_onVideoPlay", () => {
- if (this.postTimer) {
- this.postTimer = setInterval(() => {
- this.postStudyRecord(0, this.playSectionId, 5);
- }, 30000);
- }
- });
- this.player.on("s2j_onPlayOver", () => {
- this.hasStart = false;
- clearInterval(this.postTimer);
- this.$message({
- type: "success",
- message: "播放完毕",
- });
- this.dialogPalyVisible = true;
- if (this.isFullScreen()) {
- this.exitFullscreen();
- }
- this.postStudyRecord(1);
- });
- });
- },
- async playNextVideo() {
- this.dialogPalyVisible = false;
- this.autoplay = true;
- let { sectionId, chapterId, moduleId } = this.sectionItem;
- let moduleIndex = this.menuList.findIndex((e) => e.id == moduleId);
- let chapterList = this.menuList[moduleIndex].list.filter(
- (e) => e.type == 1
- );
- let playChapterIndex = chapterList.findIndex(
- (e) => e.chapterId == chapterId
- );
- let playChapter = chapterList[playChapterIndex].list.filter(
- (e) => e.type == 1
- );
- let playVideoIndex = playChapter.findIndex(
- (e) => e.sectionId == sectionId
- );
- if (playVideoIndex < playChapter.length - 1) {
- this.getResource(playChapter[playVideoIndex + 1], 1);
- } else if (playChapterIndex < chapterList.length - 1) {
- // 不是最后一杰
- let nextChapter = chapterList[playChapterIndex + 1].list;
- if (nextChapter.length) {
- this.getResource(nextChapter.list[0], 1);
- } else {
- // 去请求数据回来
- let data = await this.openChapter(chapterList[playChapterIndex + 1]);
- this.getResource(data[0], 1);
- }
- } else {
- // 章最后一个视频 跳去下一章
- let nextChapterList = this.menuList[moduleIndex + 1].list;
- if (!nextChapterList.length) {
- this.needOpen = true;
- nextChapterList = await this.openModule(
- this.menuList[moduleIndex + 1],
- false,
- true
- );
- }
- if (nextChapterList[0].list.length) {
- this.getResource(nextChapterList[0].list[0], 1);
- } else {
- let data = await this.openChapter(nextChapterList[0]);
- this.getResource(data[0], 1);
- }
- }
- },
- timeEventLiving() {
- var polyvPlayerContext = this.playerzb;
- if (polyvPlayerContext) {
- this.liveDuration = this.liveDuration + 1; //每隔1秒
- console.log(this.liveDuration);
- if (this.liveDuration == 2) {
- //直播第2秒拍照
- if (
- this.goodsPhotographConfig &&
- this.goodsPhotographConfig.livephotograph == 1 &&
- this.sectionItem.learning != 1 &&
- this.photoHistoryList.length == 0
- ) {
- //开启直播拍照
- polyvPlayerContext.j2s_pauseVideo();
- this.openPhoto();
- } else {
- this.postStudyRecord();
- }
- }
- }
- },
- timeEvent() {
- let self = this;
- var polyvPlayerContext = this.player;
- if (polyvPlayerContext) {
- this.playTime = polyvPlayerContext.j2s_getCurrentTime(); //播放时刻
- //判断是否需要拍照
- if (this.photoNum > 0) {
- this.configPhoto();
- let photoTime = 0; //获取拍照秒数
- for (let i = 0; i < this.photoList.length; i++) {
- photoTime = Number(this.photoList[i]); //获取拍照秒数
- if (photoTime < this.playTime && photoTime > this.playTime - 8) {
- //3秒区间内才触发拍照,避免拉动滚动条
- if (
- this.photoHistoryList.indexOf(i) < 0 &&
- this.sectionItem.learning != 1
- ) {
- //不存在拍照历史,没有重修过,没有学过,则拍照
- //启动拍照
- //暂停
- polyvPlayerContext.j2s_pauseVideo();
- this.photoIndex = i;
- this.openPhoto();
- } else {
- }
- }
- }
- }
- }
- },
- getPhotoLastRecord() {
- return new Promise((resolve) => {
- let self = this;
- let data = {
- sectionId: parseInt(self.playSectionId),
- goodsId: parseInt(self.goodsId),
- courseId: parseInt(self.courseId),
- gradeId: self.gradeId,
- chapterId: parseInt(self.chapterId),
- moduleId: parseInt(self.moduleId),
- };
- this.$request.getPhotoLastRecord(data).then((res) => {
- console.log(res, 666);
- //清空历史数据
- self.photoHistoryList = [];
- this.photoIndex = 0;
- self.photoList = [];
- for (let i = 0; i < res.data.length; i++) {
- //-2存储随机拍照数组
- if (res.data[i].photoIndex == -2 && res.data[i].timeInterval) {
- self.photoList = res.data[i].timeInterval.split(",");
- } else {
- self.photoHistoryList.push(res.data[i].photoIndex);
- }
- }
- resolve();
- });
- });
- },
- //拍照
- openPhoto() {
- var polyvPlayerContext = this.player;
- if (polyvPlayerContext) {
- if (this.isFullScreen()) {
- this.exitFullscreen();
- }
- }
- var polyvPlayerContext = this.playerzb;
- if (polyvPlayerContext) {
- if (this.isFullScreen()) {
- this.exitFullscreen();
- }
- }
- this.$nextTick(() => {
- if (
- (window.navigator.mediaDevices &&
- window.navigator.mediaDevices.getUserMedia) ||
- window.navigator.getUserMedia ||
- window.navigator.webkitGetUserMedia ||
- window.navigator.mozGetUserMedia
- ) {
- // 调用用户媒体设备, 访问摄像头
- this.getUserMedia(
- {
- video: {
- width: 400,
- height: 400,
- },
- },
- this.photographSuccess,
- this.photographError
- );
- } else {
- this.photographError();
- }
- });
- },
- /**
- * 退出全屏
- */
- exitFullscreen() {
- try {
- var de = document;
- console.log(de);
- if (de.exitFullscreen) {
- de.exitFullscreen();
- } else if (de.mozCancelFullScreen) {
- de.mozCancelFullScreen();
- } else if (de.webkitCancelFullScreen) {
- de.webkitCancelFullScreen();
- }
- } catch (err) {}
- },
- fullele() {
- return (
- document.fullscreenElement ||
- document.webkitFullscreenElement ||
- document.msFullscreenElement ||
- document.mozFullScreenElement ||
- null
- );
- },
- //判断是否全屏
- isFullScreen() {
- return !!(document.webkitIsFullScreen || this.fullele());
- },
- //配置随机拍照时间
- configPhoto() {
- var polyvPlayerContext = this.player;
- let totalVideoTime = polyvPlayerContext.j2s_getDuration();
- let duration = polyvPlayerContext.j2s_getCurrentTime();
- let photoNum = this.photoNum;
- if (!this.photoConfig) {
- this.photoConfig = true;
- //没有历史拍照间隔数据
- if (this.photoList.length == 0) {
- if (totalVideoTime >= 900) {
- //大于15分钟
- if (photoNum == 1) {
- //开头拍1张
- this.photoList.push(1);
- } else if (photoNum == 3) {
- //拍3张
- this.photoList.push(0); //开头拍一张
- let centerTime = Math.floor(totalVideoTime / 2); //获取中间时间
- let centerMinTime = centerTime - 300; //前后5分钟
- let centerMaxTime = centerTime + 300;
- let centerTakeTime = this.randomNum(centerMinTime, centerMaxTime);
- this.photoList.push(centerTakeTime); //中间拍一张
- let endMaxTime = totalVideoTime - 60;
- let endMinTime = totalVideoTime - 300;
- let endTakeTime = this.randomNum(endMinTime, endMaxTime);
- this.photoList.push(endTakeTime); //最后拍一张
- }
- } else {
- //小于15分钟,只拍前后各一张
- if (photoNum == 1) {
- //开头拍1张
- this.photoList.push(1);
- } else if (photoNum == 3) {
- //拍2张
- if (totalVideoTime <= 300) {
- //小于5分钟
- this.photoList.push(1); //开头拍一张
- let endTakeTime = this.randomNum(10, totalVideoTime); //中间随机取一张
- this.photoList.push(endTakeTime);
- } else {
- this.photoList.push(1); //开头拍一张
- let endMaxTime = totalVideoTime - 60;
- let endMinTime = totalVideoTime - 300;
- let endTakeTime = this.randomNum(endMinTime, endMaxTime);
- this.photoList.push(endTakeTime); //最后1-5分钟拍一张
- }
- }
- }
- console.log(this.photoList, "随机拍照时间数组11", photoNum);
- this.postCoursePhotoRecord(true); //提交随机拍照时间数组
- }
- console.log(this.photoList, "随机拍照时间数组");
- //兼容已有观看历史
- for (let i = 0; i < this.photoList.length - 1; i++) {
- if (
- this.photoList[i] < duration &&
- this.photoList[i + 1] > duration
- ) {
- this.photoIndex = i + 1;
- // console.log("我的修改了photoIndex")
- break;
- }
- if (duration > this.photoList[this.photoList.length - 1]) {
- this.photoIndex = this.photoList.length - 1; //取最后一个下标
- // console.log("我的修改了photoIndex")
- break;
- }
- }
- }
- },
- randomNum(minNum, maxNum) {
- switch (arguments.length) {
- case 1:
- return parseInt(Math.random() * minNum + 1, 10);
- break;
- case 2:
- return parseInt(Math.random() * (maxNum - minNum + 1) + minNum, 10);
- break;
- default:
- return 0;
- break;
- }
- },
- //postTime 只提交随机时间
- postCoursePhotoRecord(postTime = false) {
- return new Promise((resolve, reject) => {
- let currentTime = 0;
- var polyvPlayerContext = this.player;
- if (polyvPlayerContext) {
- currentTime = polyvPlayerContext.j2s_getCurrentTime();
- }
- let self = this;
- let photoIndex = self.photoIndex;
- let data = {
- photo: self.ossAvatarUrl,
- sectionId: parseInt(self.playSectionId),
- goodsId: parseInt(self.goodsId),
- courseId: parseInt(self.courseId),
- photoTime: parseInt(currentTime > 0 ? currentTime : 0),
- gradeId: parseInt(self.gradeId),
- photoIndex: postTime ? -2 : parseInt(photoIndex), //从0算起,-2只提交随机时间
- photoNum: parseInt(self.photoNum),
- chapterId: parseInt(self.chapterId),
- moduleId: parseInt(self.moduleId),
- timeInterval: postTime ? self.photoList.join(",") : "",
- };
- console.log("提交接口", data);
- this.$request
- .coursePhotoRecord(data)
- .then((res) => {
- console.log(res, "res");
- resolve();
- })
- .catch((err) => {
- console.log(err, "err");
- reject();
- });
- });
- },
- /**
- * @param {String} 直播预览
- */
- loadPlayerScriptzb(callback) {
- if (!window.polyvLivePlayer) {
- const myScript = document.createElement("script");
- myScript.setAttribute("src", this.playerJs);
- myScript.onload = callback;
- document.body.appendChild(myScript);
- } else {
- callback();
- }
- },
- loadPlayerScript(callback) {
- if (!window.polyvPlayer) {
- const myScript = document.createElement("script");
- myScript.setAttribute("src", this.vodPlayerJs);
- myScript.onload = callback;
- document.body.appendChild(myScript);
- } else {
- callback();
- }
- },
- clears() {
- return new Promise((resolve, reject) => {
- this.vid = "";
- this.vidzb = "";
- if (this.player) {
- this.player.destroy();
- }
- if (this.playerzb) {
- this.playerzb.destroy();
- }
- resolve();
- });
- },
- /**
- * 提交观看记录
- */
- postStudyRecord(status = 0, sectionId = this.playSectionId) {
- let currentTime = 0;
- let PlayDuration = 0;
- var polyvPlayerContext = this.player;
- if (polyvPlayerContext) {
- currentTime = polyvPlayerContext.j2s_getCurrentTime(); //当前视频播放时刻
- PlayDuration = polyvPlayerContext.j2s_realPlayVideoTime(); //本次看的时长
- }
- if (this.vidzb) {
- currentTime = 2; //直播无法获取,无论开始结束都传2秒
- }
- if (currentTime == 0) {
- return;
- }
- let self = this;
- let data = {
- fromPlat: 2, //来源平台 1小程序 2网站
- photo: self.ossAvatarUrl,
- sectionId: parseInt(this.playSectionId),
- goodsId: parseInt(this.goodsId),
- courseId: parseInt(this.courseId),
- studyDuration: parseInt(PlayDuration > 0 ? PlayDuration : 0),
- gradeId: parseInt(this.gradeId),
- chapterId: parseInt(this.chapterId),
- moduleId: parseInt(this.moduleId),
- videoCurrentTime: parseInt(currentTime > 0 ? currentTime : 0),
- orderGoodsId: parseInt(this.orderGoodsId),
- };
- if (this.ossAvatarUrl) {
- data.similarity = this.compareFaceData; // 相似度
- }
- if (status > 0) {
- data.status = status;
- }
- // /study/record 学习记录
- this.$request
- .studyRecord(data)
- .then((res) => {
- if (status > 0) {
- //看完视频刷新父级列表
- let rebuildObj = this.getSameObj(this.sectionItem);
- this.refreshParentList(this.sectionItem, rebuildObj);
- }
- self.ossAvatarUrl = "";
- })
- .catch((err) => {
- // this.$message({
- // type: "warning",
- // message: err.msg,
- // });
- });
- },
- /**
- * 获取重修列表中是否有相同对象
- */
- getSameObj(metaObj) {
- console.log("看完视频后----", metaObj, this.reMenuList);
- let newObj = false;
- if (this.reMenuList.length) {
- console.log(this.reMenuList, "this.reMenuList");
- this.reMenuList.forEach((menu) => {
- if (menu.type == 3) {
- let isSame = this.contrast(metaObj, menu);
- if (isSame) {
- newObj = isSame;
- }
- } else {
- if (menu.list && menu.list.length) {
- menu.list.forEach((menuItem) => {
- if (menuItem.type == 1) {
- console.log(menuItem, metaObj);
- let isSame = this.contrast(metaObj, menuItem);
- if (isSame) {
- newObj = isSame;
- }
- } else {
- if (menuItem.list && menuItem.list.length) {
- menuItem.list.forEach((menuChild) => {
- if (menuChild.type == 1) {
- let isSame = this.contrast(metaObj, menuChild);
- if (isSame) {
- newObj = isSame;
- }
- }
- });
- }
- }
- });
- }
- }
- });
- return newObj;
- } else {
- return false;
- }
- },
- contrast(obj1, obj2) {
- let moduleId1 = obj1.moduleId || 0;
- let chapterId1 = obj1.chapterId || 0;
- let sectionId1 = obj1.sectionId || obj1.menuId;
- let moduleId2 = obj2.moduleId || 0;
- let chapterId2 = obj2.chapterId || 0;
- let sectionId2 = obj2.sectionId || obj2.menuId;
- //转字符串后对比是否一致
- return moduleId1 == moduleId2 &&
- chapterId1 == chapterId2 &&
- sectionId1 == sectionId2
- ? obj2
- : false;
- },
- /**
- * 刷新父级列表
- */
- refreshParentList(sectionItem, rebuildObj) {
- let self = this;
- if (sectionItem.menuId) {
- //最外层节有menuid
- //普通章节目录
- this.$request
- .reMenuList({ courseId: this.courseId, gradeId: this.gradeId })
- .then((res) => {
- for (let i = 0; i < res.rows.length; i++) {
- let item = res.rows[i];
- if (item.type == 3) {
- self.menuList[i].learning = item.learning;
- self.menuList[i].rebuild = item.rebuild;
- }
- }
- });
- if (this.menuTab.length > 1) {
- //有重修目录
- this.$request
- .reMenuList({
- courseId: this.courseId,
- gradeId: this.gradeId,
- rebuild: 1,
- })
- .then((res) => {
- if (res.rows.length > 0) {
- for (let i = 0; i < res.rows.length; i++) {
- let item = res.rows[i];
- item.id = item.menuId;
- item.name = item.menuName;
- item.menuType = item.type;
- item.showList = false;
- item.list = [];
- item.isRebuild = 1;
- }
- self.reMenuList = self.reMenuList.filter((reMenu) => {
- //筛选剩下的选项
- return res.rows.find((row) => row.menuId == reMenu.menuId);
- });
- } else {
- this.menuTab = [
- {
- name: "1",
- label: "章节目录",
- },
- {
- name: "3",
- label: "答疑",
- },
- {
- name: "4",
- label: "笔记",
- },
- {
- name: "5",
- label: "讲义",
- },
- ];
- this.courseTabIndex = "1";
- self.reMenuList = [];
- }
- });
- }
- } else if (!sectionItem.moduleId) {
- //第二层节没有moduleid
- this.$request
- .reSectionList({
- chapterId: sectionItem.chapterId,
- gradeId: this.gradeId,
- courseId: this.courseId,
- moduleId: 0,
- })
- .then((res) => {
- let newArr = res.data.filter((item) => {
- return item.type != 2;
- });
- if (sectionItem.parent) {
- sectionItem.parent.canLearn = newArr.every((item) => {
- if (item.learning == 1) {
- return true;
- } else {
- return false;
- }
- });
- res.data.forEach((section) => {
- section.isRebuild = 1;
- section.parent = sectionItem.parent;
- });
- }
- this.menuList.forEach((menu) => {
- if (menu.menuId == sectionItem.chapterId) {
- menu.list = res.data;
- }
- });
- });
- if (this.menuTab.length > 1 && rebuildObj) {
- this.$request
- .reSectionList({
- chapterId: rebuildObj.chapterId,
- gradeId: this.gradeId,
- courseId: this.courseId,
- moduleId: 0,
- rebuild: 1,
- })
- .then((res) => {
- let newArr = res.data.filter((item) => {
- return item.type != 2;
- });
- if (rebuildObj.parent) {
- rebuildObj.parent.canLearn = newArr.every((item) => {
- if (item.learning == 1) {
- return true;
- } else {
- return false;
- }
- });
- res.data.forEach((section) => {
- section.parent = rebuildObj.parent;
- });
- }
- this.reMenuList.forEach((menu) => {
- if (menu.menuId == rebuildObj.chapterId) {
- menu.list = res.data;
- }
- });
- });
- this.$request
- .reMenuList({
- courseId: this.courseId,
- gradeId: this.gradeId,
- rebuild: 1,
- })
- .then((res) => {
- if (res.rows.length > 0) {
- for (let i = 0; i < res.rows.length; i++) {
- let item = res.rows[i];
- item.id = item.menuId;
- item.name = item.menuName;
- item.menuType = item.type;
- item.showList = false;
- item.list = [];
- item.isRebuild = 1;
- }
- self.reMenuList = self.reMenuList.filter((reMenu) => {
- //筛选剩下的选项
- return res.rows.find((row) => row.menuId == reMenu.menuId);
- });
- } else {
- this.menuTab = [
- {
- name: "1",
- label: "章节目录",
- },
- {
- name: "3",
- label: "答疑",
- },
- {
- name: "4",
- label: "笔记",
- },
- {
- name: "5",
- label: "讲义",
- },
- ];
- this.courseTabIndex = "1";
- self.reMenuList = [];
- }
- });
- }
- } else {
- //第三层节有moduleid和chapterid都有
- console.log("第三层第三层");
- this.$request
- .reSectionList({
- chapterId: sectionItem.chapterId,
- gradeId: this.gradeId,
- courseId: this.courseId,
- moduleId: sectionItem.moduleId,
- })
- .then((res) => {
- let newArr = res.data.filter((item) => {
- return item.type != 2;
- });
- if (sectionItem.parent) {
- sectionItem.parent.canLearn = newArr.every((item) => {
- if (item.learning == 1) {
- return true;
- } else {
- return false;
- }
- });
- res.data.forEach((section) => {
- section.parent = sectionItem.parent;
- });
- }
- this.menuList.forEach((menu) => {
- if (menu.list && menu.list.length) {
- menu.list.forEach((chapter) => {
- if (
- chapter.moduleId == sectionItem.moduleId &&
- chapter.chapterId == sectionItem.chapterId
- ) {
- // chapter.learning = res.data[0].learning
- console.log(res.data, "res.data");
- chapter.list = res.data;
- console.log(chapter.list, "chapter.list");
- }
- });
- }
- });
- console.log("this.menuList", this.menuList);
- });
- if (this.menuTab.length > 1 && rebuildObj) {
- this.$request
- .reSectionList({
- chapterId: rebuildObj.chapterId,
- gradeId: this.gradeId,
- courseId: this.courseId,
- moduleId: rebuildObj.moduleId,
- rebuild: 1,
- })
- .then((res) => {
- let newArr = res.data.filter((item) => {
- return item.type != 2;
- });
- if (sectionItem.parent) {
- rebuildObj.parent.canLearn = newArr.every((item) => {
- if (item.learning == 1) {
- return true;
- } else {
- return false;
- }
- });
- res.data.forEach((section) => {
- section.parent = rebuildObj.parent;
- });
- }
- this.reMenuList.forEach((menu) => {
- if (menu.list && menu.list.length) {
- menu.list.forEach((chapter) => {
- if (
- chapter.moduleId == rebuildObj.moduleId &&
- chapter.chapterId == rebuildObj.chapterId
- ) {
- chapter.learning = res.data[0].learning;
- chapter.list = res.data;
- }
- });
- }
- });
- });
- this.$request
- .reMenuList({
- courseId: this.courseId,
- gradeId: this.gradeId,
- rebuild: 1,
- })
- .then((res) => {
- if (res.rows.length > 0) {
- for (let i = 0; i < res.rows.length; i++) {
- let item = res.rows[i];
- item.id = item.menuId;
- item.name = item.menuName;
- item.menuType = item.type;
- item.showList = false;
- item.list = [];
- item.isRebuild = 1;
- }
- self.reMenuList = self.reMenuList.filter((reMenu) => {
- //筛选剩下的选项
- return res.rows.find((row) => row.menuId == reMenu.menuId);
- });
- } else {
- this.menuTab = [
- {
- name: "1",
- label: "章节目录",
- },
- {
- name: "3",
- label: "答疑",
- },
- {
- name: "4",
- label: "笔记",
- },
- {
- name: "5",
- label: "讲义",
- },
- ];
- this.courseTabIndex = "1";
- self.reMenuList = [];
- }
- });
- }
- }
- },
- getRecordLast() {
- let self = this;
- return new Promise((resolve) => {
- let data = {
- gradeId: Number(self.gradeId),
- goodsId: Number(self.goodsId),
- sectionId: Number(self.playSectionId),
- courseId: Number(self.courseId),
- chapterId: parseInt(self.chapterId),
- moduleId: parseInt(self.moduleId),
- };
- self.$request.recordLast(data).then((res) => {
- console.log(res.data, "res.datares.datares.datares.datares.data");
- resolve(res.data);
- });
- });
- },
- /**
- * 获取笔记列表
- */
- getNoteList() {
- let self = this;
- self.noteList = [];
- let data = {
- courseId: this.courseId,
- gradeId: this.gradeId,
- goodsId: this.goodsId,
- // pageNum: this.noteParams.pageNum,
- // pageSize: this.noteParams.pageSize,
- };
- if (this.playSectionId > 0) {
- data.sectionId = this.playSectionId;
- }
- this.$request.noteList(data).then((res) => {
- self.noteList = res.rows;
- self.noteTotal = res.total;
- });
- },
- noteClick(note) {
- if (this.vid) {
- //切换视频
- if (this.vid == note.recordingUrl) {
- var polyvPlayerContext = this.player;
- if (polyvPlayerContext) {
- polyvPlayerContext.j2s_seekVideo(note.noteSecond);
- }
- } else {
- var polyvPlayerContext = this.player;
- if (polyvPlayerContext) {
- polyvPlayerContext.changeVid(note.recordingUrl);
- }
- }
- } else {
- var polyvPlayerContext = this.player;
- console.log(polyvPlayerContext);
- if (polyvPlayerContext) {
- polyvPlayerContext.changeVid(note.recordingUrl);
- } else {
- this.vid = note.recordingUrl;
- console.log(note.recordingUrl);
- this.moduleId = note.moduleId;
- this.chapterId = note.chapterId;
- this.playSectionId = note.sectionId;
- note.sectionType = 3;
- this.loadPlayerScript(this.loadPlayer);
- }
- }
- this.recordObj = { videoCurrentTime: note.noteSecond };
- },
- /**
- * 展开列表
- */
- getMenuList() {
- let self = this;
- // /course/menuList
- this.$request
- .reMenuList({ courseId: this.courseId, gradeId: this.gradeId })
- .then(async (res) => {
- console.log("--asfsdgshfduofhdug", res.rows, this.menuList);
- for (let i = 0; i < res.rows.length; i++) {
- let item = res.rows[i];
- item.id = item.menuId;
- item.name = item.menuName;
- item.menuType = item.type;
- item.showList = false;
- item.list = [];
- item.parent = this.menuList;
- }
- self.menuList = res.rows;
- console.log(
- "==============self.menuList===",
- res.rows,
- self.menuList
- );
- if (
- (this.sectionItem.recordingUrl || this.sectionItem.liveUrl) &&
- this.needOpenNew
- ) {
- this.needOpenNew = false;
- if (this.sectionItem.sectionType == 1) {
- console.log("视频", this.sectionItem);
- //视频
- this.chapterId = this.sectionItem.chapterId;
- this.moduleId = this.sectionItem.moduleId;
- this.playSectionId = this.sectionItem.sectionId;
- this.vid = this.sectionItem.recordingUrl;
- this.playVideo(this.sectionItem);
- } else if (this.sectionItem.sectionType == 2) {
- console.log("直播");
- this.getResource(this.sectionItem, 1);
- //直播
- // this.studyRecordGetLastLive();
- } else if (this.sectionItem.sectionType == 3) {
- //回放
- this.chapterId = this.sectionItem.chapterId;
- this.moduleId = this.sectionItem.moduleId;
- this.playSectionId = this.sectionItem.sectionId;
- this.vid = this.sectionItem.recordingUrl;
- this.playVideo(this.sectionItem);
- }
- for (let i = 0; i < res.rows.length; i++) {
- if (
- res.rows[i].type == 1 &&
- res.rows[i].menuId == this.sectionItem.moduleId
- ) {
- this.menuIndex = [i];
- this.openModule(this.menuList[i], true);
- break;
- } else if (
- res.rows[i].type == 2 &&
- res.rows[i].menuId == this.sectionItem.chapterId &&
- (!this.sectionItem.moduleId || this.sectionItem.moduleId == 0)
- ) {
- console.log("噢噢噢");
- this.menuIndex = [i];
- // this.needOpen = false;
- this.openChapter(this.menuList[i]);
- break;
- }
- }
- } else {
- console.log("我走了");
- const changeStatus = await this.studyRecordQueryLiveLast();
- if (changeStatus) {
- for (let i = 0; i < res.rows.length; i++) {
- if (
- res.rows[i].type == 1 &&
- res.rows[i].menuId == this.sectionItem.moduleId
- ) {
- this.menuIndex = [i];
- this.openModule(this.menuList[i], true);
- break;
- } else if (
- res.rows[i].type == 2 &&
- res.rows[i].menuId == this.sectionItem.chapterId &&
- !this.sectionItem.moduleId
- ) {
- this.menuIndex = [i];
- this.openChapter(this.menuList[i]);
- break;
- }
- }
- } else {
- //展开第一个
- if (this.needOpen) {
- for (let i = 0; i < res.rows.length; i++) {
- if (res.rows[i].type == 1) {
- this.menuIndex = [i];
- this.openModule(this.menuList[i]);
- break;
- } else if (res.rows[i].type == 2) {
- this.menuIndex = [i];
- this.openChapter(this.menuList[i]);
- break;
- }
- }
- //第一个是节,直接播放
- if (self.menuList.length) {
- if (
- self.menuList[0].type == 3 &&
- !this.sectionItem.recordingUrl &&
- self.menuList[0].sectionType != 2
- ) {
- // this.getResource(self.menuList[0]);
- }
- }
- }
- }
- }
- });
- //获取节试卷列表
- this.$request
- .reSectionExamList({
- chapterId: 0,
- courseId: this.courseId,
- gradeId: this.gradeId,
- })
- .then((res) => {
- this.sectionExamList = res.data;
- });
- },
- getReMenuList() {
- let self = this;
- this.$request
- .reMenuList({
- courseId: this.courseId,
- rebuild: 1,
- gradeId: this.gradeId,
- })
- .then((res) => {
- for (let i = 0; i < res.rows.length; i++) {
- let item = res.rows[i];
- item.id = item.menuId;
- item.name = item.menuName;
- item.menuType = item.type;
- item.showList = false;
- item.list = [];
- item.parent = this.reMenuList;
- item.isRebuild = 1;
- }
- self.reMenuList = res.rows;
- if (self.reMenuList.length > 0) {
- this.menuTab = [
- {
- name: "1",
- label: "章节目录",
- },
- {
- name: "2",
- label: "重修目录",
- },
- {
- name: "3",
- label: "答疑",
- },
- {
- name: "4",
- label: "笔记",
- },
- {
- name: "5",
- label: "讲义",
- },
- ];
- if (this.courseTabIndex == "2") {
- return;
- }
- this.courseTabIndex = "1";
- } else {
- this.menuTab = [
- {
- name: "1",
- label: "章节目录",
- },
- {
- name: "3",
- label: "答疑",
- },
- {
- name: "4",
- label: "笔记",
- },
- {
- name: "5",
- label: "讲义",
- },
- ];
- this.courseTabIndex = "1";
- }
- });
- },
- /**
- * 获取讲义权限
- */
- courseHandouts() {
- if (this.goodsData.handoutsId) {
- this.$request
- .courseHandouts(this.goodsData.handoutsId)
- .then((res) => {
- this.courseHandoutsData = res.data;
- const loadingTask = pdf.createLoadingTask(
- this.$tools.splitImgHost(this.courseHandoutsData.handoutsUrl)
- );
- loadingTask.promise
- .then((pdf) => {
- this.numPages = pdf.numPages;
- })
- .catch((err) => {});
- })
- .catch((err) => {});
- }
- },
- /**
- * 获取培训项目详情
- */
- courseBusiness() {
- this.$request.courseBusiness(this.goodsData.businessId).then((res) => {
- this.businessData = res.data;
- });
- },
- /**提出答疑 */
- addAnswer() {
- if (!this.textarea) {
- this.$message.warning("请输入疑问内容");
- return;
- }
- let data = {
- courseId: this.courseId,
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- answerText: this.textarea,
- };
- this.$request.addAnswer(data).then((res) => {
- this.textarea = "";
- this.getAnswerList();
- });
- },
- /**回复 */
- answerBack(row) {
- this.$prompt(`${row.realname}:${row.answerText}`, "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- inputErrorMessage: "输入不能为空",
- inputValidator: (value) => {
- let str = value.replace(/^ +| +$/g, "");
- // 点击按钮时,对文本框里面的值进行验证
- if (!str) {
- return "输入不能为空";
- }
- },
- })
- .then(({ value }) => {
- let data = {
- assignUserId: row.userId,
- assignAnswerId: row.answerId,
- courseId: this.courseId,
- goodsId: this.goodsId,
- orderGoodsId: this.orderGoodsId,
- answerText: value,
- assignAnswerText: row.assignAnswerText,
- };
- this.$request.addAnswer(data).then((res) => {
- this.getAnswerList();
- });
- })
- .catch(() => {});
- },
- getAnswerList() {
- let self = this;
- // /app/answer/list 查询答疑列表
- this.$request
- .answerList({ courseId: this.courseId, goodsId: this.goodsId })
- .then((res) => {
- let data1 = [];
- let data2 = [];
- let copydata2 = [];
- res.rows.forEach((item) => {
- if (!item.assignAnswerId) {
- data1.push(item);
- } else {
- data2.push(item);
- copydata2.push(item);
- }
- });
- data2.forEach((item, index) => {
- //回复层
- data1.forEach((items) => {
- //提问层
- if (items.answerId === item.assignAnswerId) {
- if (
- items.newArraysAnswerList &&
- items.newArraysAnswerList.length
- ) {
- items.newArraysAnswerList.push(item);
- } else {
- items.newArraysAnswerList = [item];
- }
- let indexInd = copydata2.findIndex((itemsxs) => {
- return itemsxs.answerId === item.answerId;
- });
- if (indexInd !== -1) {
- copydata2.splice(indexInd, 1);
- }
- }
- });
- });
- copydata2.forEach((it) => {
- for (let i = 0; i < data1.length; i++) {
- let STATUS = null;
- if (data1[i].newArraysAnswerList) {
- STATUS = data1[i].newArraysAnswerList.some((items) => {
- return items.answerId === it.assignAnswerId;
- });
- }
- if (STATUS) {
- data1[i].newArraysAnswerList.push(it);
- break;
- }
- }
- });
- self.answerList = data1.reverse();
- });
- },
- courseCourseList() {
- return new Promise((resolve) => {
- this.param.goodsId = this.goodsId;
- this.param.gradeId = this.gradeId;
- this.$request.courseCourseList(this.param).then(async (res) => {
- //获取商品双师资模板
- this.$request
- .courseTeacherList({
- goodsId: this.goodsId,
- })
- .then((res1) => {
- if (res1.data && res1.data.length > 0) {
- //课程老师模板
- let teacherTel = res1.data;
- //商品课程
- let courses = res.rows;
- teacherTel.forEach((tea) => {
- let dataList = [];
- let teacherList = [];
- courses.forEach((item) => {
- let data = tea.courseList.filter(
- (x) => x.courseId == item.courseId
- );
- if (data && data.length > 0) {
- dataList.push(item);
- teacherList = tea.courseList;
- }
- });
- let result = {
- teaList: teacherList,
- courseList: dataList,
- };
- this.goodsTeacher.push(result);
- });
- if (this.goodsTeacher && this.goodsTeacher.length > 0) {
- let courseIds = [];
- this.goodsTeacher.forEach((item) => {
- item.courseList.forEach((course) => {
- courseIds.push(course.courseId);
- });
- });
- if (courseIds.length > 0) {
- courses.forEach((item) => {
- if (!courseIds.includes(item.courseId)) {
- let data = {
- teaList: [],
- courseList: [],
- };
- data.courseList.push(item);
- this.goodsTeacher.push(data);
- }
- });
- }
- this.goodsTeacher.forEach((item) => {
- if (item.courseList && item.courseList.length > 0) {
- item.courseList[0].show = 1;
- }
- });
- }
- } else {
- //没有双师资模板
- res.rows.forEach((item) => {
- item.show = 1;
- let data = {
- teaList: [],
- courseList: [],
- };
- data.courseList.push(item);
- this.goodsTeacher.push(data);
- });
- }
- console.log(this.goodsTeacher, "this.goodsTeacher");
- this.goodsTeacher.forEach((item) => {
- if (item.courseList.some((x) => x.courseId == this.courseId)) {
- this.teacherList = item.teaList;
- }
- });
- console.log(this.teacherList, "this.teacherList");
- });
- this.courseList.push(...res.rows);
- this.courseTotal = res.total;
- // console.log('courseTotal::', this.courseTotal)
- if (!this.courseId) {
- this.courseId = this.courseList[0].courseId;
- }
- this.param.total = res.total;
- await this.courseChange();
- resolve();
- });
- });
- },
- download(url, fileName) {
- let xhr = new XMLHttpRequest();
- xhr.open("get", url, true);
- xhr.setRequestHeader("Content-Type", `application/pdf`);
- xhr.responseType = "blob";
- let that = this;
- xhr.onload = function () {
- if (this.status == 200) {
- //接受二进制文件流
- var blob = this.response;
- that.downloadExportFile(blob, fileName);
- }
- };
- xhr.send();
- },
- downloadExportFile(blob, tagFileName) {
- let downloadElement = document.createElement("a");
- let href = "";
- if (typeof blob == "string") {
- downloadElement.target = "_blank";
- } else {
- href = window.URL.createObjectURL(blob); //创建下载的链接
- }
- downloadElement.href = href;
- downloadElement.download = tagFileName;
- //下载后文件名
- document.body.appendChild(downloadElement);
- downloadElement.click(); //点击下载
- document.body.removeChild(downloadElement); //下载完成移除元素
- if (typeof blob != "string") {
- window.URL.revokeObjectURL(href); //释放掉blob对象
- }
- },
- print() {
- document.getElementById("printIframe").contentWindow.print();
- },
- previvew(url) {
- this.showPdf = true;
- },
- noteSubmit() {
- let self = this;
- if (!(this.playSectionId > 0)) {
- this.$message({
- message: "目前无播放视频",
- type: "warning",
- });
- return;
- }
- if (!this.textareaNote) {
- this.$message({
- message: "请输入内容",
- type: "warning",
- });
- return;
- }
- if (!this.gradeId) {
- this.$message({
- message: "暂无班级数据",
- type: "warning",
- });
- return;
- }
- var polyvPlayerContext = this.player;
- let noteDate = this.$tools.getZeroTime();
- let noteSecond = polyvPlayerContext.j2s_getCurrentTime();
- console.log(noteSecond, "noteSecond");
- if (!noteSecond) {
- if (noteSecond == 0) {
- //播放结束
- noteSecond = polyvPlayerContext.j2s_getCurrentTime();
- }
- if (!noteSecond) {
- this.$message({
- message: "视频暂未开始",
- type: "warning",
- });
- return;
- }
- }
- let data = {
- gradeId: this.gradeId,
- goodsId: this.goodsId,
- sectionId: this.playSectionId,
- courseId: this.courseId,
- noteText: this.textareaNote,
- noteDate: noteDate,
- noteSecond: noteSecond,
- moduleId: this.moduleId,
- chapterId: this.chapterId,
- };
- this.$request.postNote(data).then((res) => {
- this.$message({
- message: "发布成功",
- type: "success",
- });
- self.getNoteList();
- this.textareaNote = "";
- });
- },
- del(item) {
- console.log(item);
- let data = { answerId: item.answerId, status: -1 };
- this.$request.delAnswer(data).then((res) => {
- this.$message({
- message: "删除成功",
- type: "success",
- });
- this.getAnswerList();
- });
- },
- /**
- * 打印
- */
- printView(url) {
- console.log("触发打印", url);
- printJS({
- printable: url,
- type: "pdf",
- header: null,
- targetStyles: ["*"],
- style: "@page {margin:0 10mm}",
- });
- // this.print(url);
- },
- // 打印方法
- print(filePath) {
- console.log("执行打印");
- let iframe = document.createElement("iframe");
- iframe.style.border = "0px";
- iframe.style.position = "absolute";
- iframe.style.width = "0px";
- iframe.style.height = "0px";
- iframe.style.right = "0px";
- iframe.style.top = "0px";
- iframe.setAttribute("src", filePath);
- iframe.onload = () => {
- iframe.contentWindow.print();
- // setTimeout(() => {
- // document.body.removeChild(iframe);
- // });
- };
- document.body.append(iframe);
- },
- },
- };
- </script>
- <!-- Add "scoped" attribute to limit CSS to this component only -->
- <style scoped lang="scss">
- .course-detail {
- .section {
- padding-bottom: 30px;
- &__header {
- height: 40px;
- display: flex;
- align-items: center;
- padding: 0 20px;
- }
- &__body {
- .course-info {
- &__header {
- .title {
- height: 40px;
- border-bottom: 1px solid #999;
- // color: #fff;
- .select {
- // width: 100%;
- }
- /deep/ .el-input__icon {
- width: 20px;
- height: 20px;
- border: 1px solid #eee;
- border-radius: 4px;
- margin-top: 10px;
- line-height: 20px;
- }
- /deep/ .el-input__inner {
- // color: #fff;
- font-size: 16px;
- background: none;
- border: 0;
- }
- }
- .left-box {
- width: 810px;
- height: 455px;
- float: left;
- background-size: cover;
- background-position: center center;
- background-repeat: no-repeat;
- position: relative;
- .video {
- width: 100%;
- height: 100%;
- }
- }
- .recordStyle {
- position: absolute;
- bottom: 90px;
- padding: 6px 12px;
- left: 8px;
- background-color: rgba(0, 0, 0, 0.4);
- color: #fff;
- border-radius: 24px;
- user-select: none;
- .btn_sty {
- cursor: pointer;
- }
- }
- .right-box {
- width: 462px;
- height: 455px;
- background: #3f4449;
- border-radius: 0px;
- float: right;
- &__header {
- .tabs {
- /deep/.el-tabs__nav-wrap::after {
- background-color: #999;
- }
- /deep/ .el-tabs__header {
- margin: 0;
- }
- .label {
- color: #fff;
- height: 40px;
- line-height: 40px;
- padding: 0 20px;
- }
- .item {
- &__title {
- padding-left: 12px;
- height: 40px;
- line-height: 40px;
- cursor: pointer;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #fff;
- .el-icon-caret-right,
- .el-icon-caret-bottom {
- color: #999;
- }
- }
- &__content {
- .bank-chapter {
- &__item {
- color: #fff;
- font-size: 14px;
- &__text {
- padding: 8px 8px 8px 24px;
- cursor: pointer;
- flex: 1;
- .el-icon-caret-right,
- .el-icon-caret-bottom {
- color: #999;
- }
- }
- }
- }
- .bank-section {
- &__item {
- user-select: none;
- color: #fff;
- font-size: 14px;
- display: flex;
- align-items: center;
- .lear-state {
- height: 20px;
- padding-right: 8px;
- img {
- width: 20px;
- height: 20px;
- // margin-right: 4px;
- }
- }
- &.active {
- background: #132b4d;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #3f8dfd;
- }
- &__text {
- flex: 1;
- padding: 8px 8px 8px 12px;
- height: 40px;
- display: flex;
- flex-direction: column;
- justify-content: center;
- cursor: pointer;
- .el-icon-caret-right,
- .el-icon-caret-bottom {
- color: #999;
- }
- }
- .test-btn {
- margin-left: 10px;
- width: 32px;
- height: 20px;
- background: #007aff;
- border-radius: 4px;
- line-height: 18px;
- color: #fff;
- text-align: center;
- }
- .note {
- margin-left: 10px;
- width: 32px;
- height: 20px;
- border: 1px solid #ff3b30;
- border-radius: 4px;
- line-height: 18px;
- color: #ff3b30;
- text-align: center;
- &--yellow {
- border-color: #ff9500;
- color: #ff9500;
- }
- &--blue {
- border-color: #3f8dfd;
- color: #3f8dfd;
- }
- }
- .during {
- color: #999;
- margin-right: 10px;
- }
- .btn {
- margin-right: 12px;
- width: 48px;
- height: 20px;
- border: 1px solid #ff3b30;
- background: #ff3b30;
- border-radius: 4px;
- line-height: 18px;
- color: #fff;
- text-align: center;
- &--green {
- border: 1px solid #34c759;
- background: #34c759;
- }
- }
- .live-btn {
- margin-left: 20px;
- width: 60px;
- height: 20px;
- border-radius: 4px;
- background: #eeeeee;
- line-height: 18px;
- color: #666666;
- text-align: center;
- &--yellow {
- background: #fff7eb;
- color: #ff9500;
- }
- &--blue {
- border-color: #ebf4ff;
- color: #007aff;
- }
- }
- .exercises {
- cursor: pointer;
- font-size: 14px;
- color: #498afe;
- }
- }
- }
- }
- }
- }
- .title {
- height: 40px;
- border-bottom: 1px solid #999;
- color: #fff;
- .select {
- width: 100%;
- }
- /deep/ .el-input__icon {
- width: 20px;
- height: 20px;
- border: 1px solid #fff;
- border-radius: 4px;
- margin-top: 10px;
- line-height: 20px;
- }
- /deep/ .el-input__inner {
- color: #fff;
- font-size: 16px;
- background: none;
- border: 0;
- }
- }
- }
- &__body {
- height: 374px;
- overflow-y: scroll;
- &::-webkit-scrollbar {
- // width: 6px;
- display: none;
- }
- &::-webkit-scrollbar-track {
- background-color: #060e1a;
- -webkit-border-radius: 2em;
- -moz-border-radius: 2em;
- border-radius: 2em;
- }
- &::-webkit-scrollbar-thumb {
- background-color: #eeeeee;
- -webkit-border-radius: 2em;
- -moz-border-radius: 2em;
- border-radius: 2em;
- }
- }
- }
- }
- &__body {
- /deep/ .el-tabs__item {
- padding: 0 20px !important;
- height: 80px;
- line-height: 80px;
- }
- .course-img {
- width: 100%;
- }
- .course-menu {
- margin-top: 25px;
- .left-box {
- width: 948px;
- float: left;
- &__header {
- padding-right: 50px;
- position: relative;
- .item {
- width: auto;
- margin-right: 24px;
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #333333;
- background: #eeeeee;
- border-radius: 8px;
- padding: 12px;
- position: relative;
- &.canlearn {
- background: #3f8dfd;
- color: #fff;
- }
- }
- }
- &__body {
- .buy-note {
- margin-right: 50px;
- }
- .item {
- margin-top: 24px;
- padding: 16px;
- background: #eee;
- border-radius: 10px;
- &__title {
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #333333;
- .note {
- display: inline-block;
- margin-left: 20px;
- width: 40px;
- height: 24px;
- border: 1px solid #ff3b30;
- border-radius: 8px;
- line-height: 22px;
- color: #ff3b30;
- text-align: center;
- }
- }
- &__content {
- margin-top: 12px;
- background: #f5f7fa;
- }
- }
- }
- }
- .right-box {
- width: 255px;
- float: right;
- .title {
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #333333;
- text-shadow: 0px 6px 6px rgba(85, 158, 255, 0.08);
- position: relative;
- .more {
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- position: absolute;
- right: 0;
- }
- }
- .list {
- .course-item {
- }
- }
- }
- }
- .answer-question {
- &__header {
- border-bottom: 1px solid #eee;
- .textarea-wrap {
- background: #f9f9f9;
- border: 1px solid #eeeeee;
- border-radius: 8px;
- .textarea {
- height: 100%;
- }
- }
- .submit {
- padding: 10px 20px;
- border-radius: 20px;
- text-align: center;
- font-size: 16px;
- margin: 10px 0;
- float: right;
- }
- }
- &__body {
- .question-list {
- &__item {
- padding: 20px 0;
- display: flex;
- &__avatar {
- width: 40px;
- height: 40px;
- display: table-cell;
- border-radius: 50%;
- text-align: center;
- img {
- display: inline-block;
- vertical-align: middle;
- max-width: 100%;
- max-height: 100%;
- }
- }
- &__content {
- flex: 1;
- border-bottom: 1px solid #ccc;
- margin-left: 10px;
- .nickname {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #fff;
- line-height: 24px;
- }
- .desc {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #666666;
- line-height: 24px;
- }
- .time {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- line-height: 24px;
- .replay {
- float: right;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #3f8dfd;
- line-height: 24px;
- margin-right: 20px;
- }
- .del {
- float: right;
- cursor: pointer;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ff3b30;
- line-height: 24px;
- margin-right: 20px;
- }
- }
- .reply-list {
- margin: 20px 0;
- width: 100%;
- background: #f9f9f9;
- border-radius: 8px;
- padding: 0 0 0 20px;
- &__item {
- padding: 20px 0;
- display: flex;
- border-bottom: 1px solid #ccc;
- &:nth-last-of-type(1) {
- border: 0;
- }
- &__avatar {
- width: 40px;
- height: 40px;
- display: table-cell;
- border-radius: 50%;
- text-align: center;
- img {
- display: inline-block;
- vertical-align: middle;
- max-width: 100%;
- max-height: 100%;
- }
- }
- &__content {
- border-radius: 8px;
- flex: 1;
- margin-left: 10px;
- .nickname {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #fff;
- line-height: 24px;
- }
- .desc {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #666666;
- line-height: 24px;
- }
- .time {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- line-height: 24px;
- .reply {
- float: right;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #3f8dfd;
- line-height: 24px;
- margin-right: 20px;
- cursor: pointer;
- user-select: none;
- }
- .del {
- cursor: pointer;
- margin-right: 20px;
- float: right;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ff3b30;
- line-height: 24px;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- .lecture-notes {
- &__content {
- .left-box {
- float: left;
- width: 462px;
- .textarea {
- border-bottom: 1px solid #eee;
- .submit {
- float: right;
- width: 138px;
- padding: 10px 0;
- margin: 10px 0 25px 0;
- border-radius: 20px;
- text-align: center;
- font-size: 16px;
- }
- }
- .note-list {
- &__content {
- border-bottom: 1px solid #eee;
- &__title {
- width: 216px;
- height: 24px;
- background: #ccc;
- border-radius: 24px;
- font-size: 14px;
- color: #666666;
- text-align: center;
- line-height: 24px;
- margin: 20px 0;
- }
- }
- &__item {
- display: flex;
- padding: 15px;
- .el-icon-video-play {
- cursor: pointer;
- font-size: 20px;
- color: #3f8dfd;
- }
- &__content {
- flex: 1;
- margin-left: 10px;
- .title {
- cursor: pointer;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #3f8dfd;
- line-height: 24px;
- }
- .desc {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #666666;
- line-height: 24px;
- }
- .time {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- line-height: 24px;
- }
- }
- }
- }
- .pagination {
- margin-top: 30px;
- text-align: center;
- }
- }
- .right-box {
- width: 786px;
- float: right;
- .lecture-list {
- background: #f5f7fa;
- border-radius: 8px;
- &__header {
- padding: 0 16px;
- height: 40px;
- line-height: 40px;
- font-size: 18px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #333333;
- .slide-btn {
- cursor: pointer;
- float: right;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- }
- }
- &__body {
- .list {
- &__item {
- border-top: 1px solid #fff;
- padding: 0 8px 0 16px;
- height: 56px;
- line-height: 55px;
- display: flex;
- align-items: center;
- .title {
- flex: 1;
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #333333;
- }
- .btns {
- .btn {
- cursor: pointer;
- display: inline-block;
- vertical-align: middle;
- width: 80px;
- height: 32px;
- background: #ffffff;
- border: 1px solid #3f8dfd;
- border-radius: 16px;
- text-align: center;
- line-height: 30px;
- color: #3f8dfd;
- margin: 0 8px;
- }
- }
- }
- }
- }
- &__footer {
- margin-top: 24px;
- .lecture-scan {
- background: #f5f7fa;
- border-radius: 8px;
- overflow: hidden;
- &__header {
- height: 40px;
- line-height: 40px;
- padding: 0 16px;
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #333333;
- }
- &__body {
- height: 800px;
- text-align: center;
- overflow-y: scroll;
- .iframe {
- width: 100%;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- .tip-dialog {
- /deep/ {
- .el-dialog__body {
- padding: 6px 40px 44px;
- }
- .el-dialog__header {
- padding-top: 36px;
- }
- .el-dialog__title {
- font-weight: bold;
- color: #222222;
- }
- }
- p {
- color: #666666;
- font-size: 16px;
- text-align: center;
- }
- .btn1 {
- display: flex;
- justify-content: space-between;
- margin-top: 50px;
- .el-button {
- width: 140px;
- }
- }
- .btn2 {
- width: 200px;
- margin: 32px auto 0;
- .el-button {
- width: 200px;
- }
- }
- }
- .take-photo {
- /deep/ .el-dialog__header {
- display: none;
- }
- /deep/ .el-dialog__body {
- padding: 0;
- overflow: unset;
- }
- &__close {
- cursor: pointer;
- position: absolute;
- right: 0;
- top: -28px;
- width: 24px;
- height: 24px;
- line-height: 24px;
- text-align: center;
- color: #eee;
- border: 1px solid #eee;
- border-radius: 50%;
- }
- &__header {
- height: 40px;
- border-bottom: 1px solid #eee;
- line-height: 40px;
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #333333;
- padding-left: 24px;
- }
- &__body {
- // height: 400px;
- padding: 40px 24px;
- .left-box {
- width: 336px;
- float: left;
- .title {
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #ff3b30;
- line-height: 24px;
- }
- .content {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #333333;
- line-height: 28px;
- margin-top: 32px;
- }
- }
- .right-box {
- float: right;
- width: 400px;
- height: 400px;
- position: relative;
- overflow: hidden;
- video {
- width: 100%;
- height: 100%;
- }
- .mask {
- width: 55%;
- height: 200px;
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- margin: 30px auto 0;
- box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.4);
- }
- }
- }
- &__footer {
- height: 90px;
- border-top: 1px solid #eee;
- text-align: center;
- .take {
- display: inline-block;
- width: 200px;
- height: 40px;
- padding: 0;
- border-radius: 20px;
- text-align: center;
- line-height: 40px;
- margin: 24px auto;
- }
- }
- }
- .info {
- &__content {
- height: 500px;
- overflow-y: scroll;
- .handCenter {
- width: 600px;
- height: 300px;
- background: #ccc;
- }
- .upload-box {
- display: inline-block;
- vertical-align: top;
- .el-icon-error {
- cursor: pointer;
- z-index: 99;
- position: absolute;
- left: 100%;
- bottom: 100%;
- font-size: 20px;
- color: red;
- }
- }
- }
- }
- .showconfirm {
- &__content {
- .text {
- padding-bottom: 20px;
- color: red;
- }
- }
- }
- }
- .answer-question {
- max-height: 416px;
- overflow-y: auto;
- padding: 16px;
- background: rgb(63, 68, 73);
- &::-webkit-scrollbar {
- display: none;
- }
- &__header {
- border-bottom: 1px solid #555;
- .textarea-wrap {
- // background: #65696D;
- border: 1px solid #555;
- border-radius: 8px;
- .textarea {
- height: 100%;
- &::placeholder {
- color: red;
- }
- }
- }
- .submit {
- padding: 10px 20px;
- border-radius: 2px;
- text-align: center;
- font-size: 16px;
- margin: 10px 0;
- float: right;
- }
- }
- &__body {
- .question-list {
- &__item {
- padding: 20px 0;
- display: flex;
- &__avatar {
- width: 40px;
- height: 40px;
- display: table-cell;
- border-radius: 50%;
- text-align: center;
- overflow: hidden;
- img {
- display: inline-block;
- vertical-align: middle;
- max-width: 100%;
- max-height: 100%;
- }
- }
- &__content {
- flex: 1;
- border-bottom: 1px solid #555555;
- margin-left: 10px;
- .nickname {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #f5f5f5;
- line-height: 24px;
- }
- .desc {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #cccccc;
- line-height: 24px;
- }
- .time {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- line-height: 24px;
- .replay {
- float: right;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #3f8dfd;
- line-height: 24px;
- margin-right: 20px;
- }
- .del {
- float: right;
- cursor: pointer;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #fa8c16;
- line-height: 24px;
- margin-right: 20px;
- }
- }
- .reply-list {
- margin: 20px 0;
- width: 100%;
- background-color: #2f3236;
- border-radius: 8px;
- padding: 0 0 0 20px;
- &__item {
- padding: 20px 0;
- display: flex;
- border-bottom: 1px solid #555555;
- &:nth-last-of-type(1) {
- border: 0;
- }
- &__avatar {
- width: 40px;
- height: 40px;
- display: table-cell;
- border-radius: 50%;
- text-align: center;
- border-radius: 50%;
- overflow: hidden;
- img {
- display: inline-block;
- vertical-align: middle;
- max-width: 100%;
- max-height: 100%;
- }
- }
- &__content {
- border-radius: 8px;
- flex: 1;
- margin-left: 10px;
- .nickname {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #f5f5f5;
- line-height: 24px;
- }
- .desc {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #666666;
- line-height: 24px;
- }
- .time {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- line-height: 24px;
- .reply {
- float: right;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #3f8dfd;
- line-height: 24px;
- margin-right: 20px;
- cursor: pointer;
- user-select: none;
- }
- .del {
- cursor: pointer;
- margin-right: 20px;
- float: right;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #ff3b30;
- line-height: 24px;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- .lecture-notes {
- &::-webkit-scrollbar {
- display: none;
- }
- max-height: 416px;
- overflow-y: auto;
- padding: 16px;
- background: rgb(63, 68, 73);
- &__content {
- .left-boxs {
- // float: left;
- // width: 462px;
- .textarea {
- border-bottom: 1px solid #555555;
- .submit {
- padding: 10px 20px;
- border-radius: 2px;
- text-align: center;
- font-size: 16px;
- margin: 10px 0;
- float: right;
- }
- }
- .note-list {
- &__content {
- border-bottom: 1px solid #555555;
- &__title {
- width: 216px;
- height: 24px;
- background: #ccc;
- border-radius: 24px;
- font-size: 14px;
- color: #666666;
- text-align: center;
- line-height: 24px;
- margin: 20px 0;
- }
- }
- &__item {
- display: flex;
- padding: 15px;
- .el-icon-video-play {
- cursor: pointer;
- font-size: 20px;
- color: #3f8dfd;
- }
- &__content {
- flex: 1;
- margin-left: 10px;
- .title {
- cursor: pointer;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #3f8dfd;
- line-height: 24px;
- }
- .desc {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #666666;
- line-height: 24px;
- }
- .time {
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- line-height: 24px;
- }
- }
- }
- }
- .pagination {
- margin-top: 30px;
- text-align: center;
- }
- }
- .right-box {
- width: 786px;
- float: right;
- .lecture-list {
- background: #f5f7fa;
- border-radius: 8px;
- &__header {
- padding: 0 16px;
- height: 40px;
- line-height: 40px;
- font-size: 18px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #333333;
- .slide-btn {
- cursor: pointer;
- float: right;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- }
- }
- &__body {
- .list {
- &__item {
- border-top: 1px solid #fff;
- padding: 0 8px 0 16px;
- height: 56px;
- line-height: 55px;
- display: flex;
- align-items: center;
- .title {
- flex: 1;
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #333333;
- }
- .btns {
- .btn {
- cursor: pointer;
- display: inline-block;
- vertical-align: middle;
- width: 80px;
- height: 32px;
- background: #ffffff;
- border: 1px solid #3f8dfd;
- border-radius: 16px;
- text-align: center;
- line-height: 30px;
- color: #3f8dfd;
- margin: 0 8px;
- }
- }
- }
- }
- }
- &__footer {
- margin-top: 24px;
- .lecture-scan {
- background: #f5f7fa;
- border-radius: 8px;
- overflow: hidden;
- &__header {
- height: 40px;
- line-height: 40px;
- padding: 0 16px;
- font-size: 16px;
- font-family: Microsoft YaHei;
- font-weight: bold;
- color: #333333;
- }
- &__body {
- height: 800px;
- text-align: center;
- overflow-y: scroll;
- .iframe {
- width: 100%;
- }
- }
- }
- }
- }
- }
- }
- }
- .user_notes {
- border-bottom: 1px solid #555;
- .p1 {
- margin: 8px 0px;
- color: #3f8dfd;
- font-size: 14px;
- span {
- float: right;
- color: #999;
- font-size: 12px;
- }
- }
- .p2 {
- margin-bottom: 8px;
- font-size: 14px;
- color: #ccc;
- }
- }
- /deep/ textarea {
- background: #65696d;
- color: #c7c7c7;
- border-color: transparent;
- }
- /deep/ .el-input__count {
- color: #999;
- background: transparent;
- }
- .lecture-notesjy {
- display: flex;
- flex-direction: column;
- max-height: 416px;
- .listItem {
- padding-bottom: 14px;
- margin-bottom: 10px;
- border-bottom: 1px solid #eee;
- .titles {
- color: #fff;
- font-weight: bold;
- text-align: center;
- padding: 10px;
- }
- .btns {
- display: flex;
- justify-content: space-around;
- align-items: center;
- .btn {
- border-radius: 8px;
- background-color: #fff;
- padding: 6px 16px;
- user-select: none;
- cursor: pointer;
- transition: all 0.2s;
- &:hover {
- background-color: #f2f7ff;
- color: #3f8dfd;
- }
- }
- }
- }
- .lecture-listFooter {
- flex: 1;
- overflow: auto;
- }
- }
- .topstyle {
- border-bottom: 2px solid #eee;
- margin-bottom: 16px;
- p {
- background-color: #f8f8f9;
- font-size: 14px;
- color: #3f8dfd;
- padding: 5px 12px;
- }
- }
- .height_style {
- max-height: 600px;
- overflow-y: auto;
- }
- .list_style {
- height: 62px;
- color: #222;
- line-height: 58px;
- padding: 0px 16px;
- cursor: pointer;
- transition: all 0.2s;
- display: flex;
- &:hover {
- background-color: rgba(63, 141, 253, 0.3) !important;
- }
- }
- .list_styleHeader {
- height: 60px;
- color: #3f8dfd;
- line-height: 58px;
- padding: 0px 16px;
- }
- // 老师名字样式
- .teacher_names {
- display: flex;
- margin-left: 20px;
- .names {
- font-size: 13px;
- color: #666666;
- margin-right: 12px;
- cursor: pointer;
- // background: #F8F8F8;
- border-radius: 4px;
- padding: 3px 6px;
- &.nactive {
- color: #3f8dfd;
- background: #f2f7ff;
- }
- }
- }
- .teacherList_name {
- display: flex;
- margin-left: 20px;
- margin-top: 10px;
- .names {
- font-size: 13px;
- color: #383838;
- margin-right: 8px;
- cursor: pointer;
- background: #818181;
- border-radius: 4px;
- padding: 3px 6px;
- &.nactive {
- background: #cccccc;
- }
- }
- }
- </style>
|