index.vue 265 KB

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