vendor.js 419 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],[
  2. /* 0 */,
  3. /* 1 */
  4. /*!************************************************************!*\
  5. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  6. \************************************************************/
  7. /*! no static exports found */
  8. /***/ (function(module, exports, __webpack_require__) {
  9. "use strict";
  10. /* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
  11. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 4);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  12. var realAtob;
  13. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  14. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  15. if (typeof atob !== 'function') {
  16. realAtob = function realAtob(str) {
  17. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  18. if (!b64re.test(str)) {throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");}
  19. // Adding the padding if missing, for semplicity
  20. str += '=='.slice(2 - (str.length & 3));
  21. var bitmap;var result = '';var r1;var r2;var i = 0;
  22. for (; i < str.length;) {
  23. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 |
  24. (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  25. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  26. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  27. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  28. }
  29. return result;
  30. };
  31. } else {
  32. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  33. realAtob = atob;
  34. }
  35. function b64DecodeUnicode(str) {
  36. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  37. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  38. }).join(''));
  39. }
  40. function getCurrentUserInfo() {
  41. var token = wx.getStorageSync('uni_id_token') || '';
  42. var tokenArr = token.split('.');
  43. if (!token || tokenArr.length !== 3) {
  44. return {
  45. uid: null,
  46. role: [],
  47. permission: [],
  48. tokenExpired: 0 };
  49. }
  50. var userInfo;
  51. try {
  52. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  53. } catch (error) {
  54. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  55. }
  56. userInfo.tokenExpired = userInfo.exp * 1000;
  57. delete userInfo.exp;
  58. delete userInfo.iat;
  59. return userInfo;
  60. }
  61. function uniIdMixin(Vue) {
  62. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  63. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  64. return role.indexOf(roleId) > -1;
  65. };
  66. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  67. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  68. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  69. };
  70. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  71. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  72. return tokenExpired > Date.now();
  73. };
  74. }
  75. var _toString = Object.prototype.toString;
  76. var hasOwnProperty = Object.prototype.hasOwnProperty;
  77. function isFn(fn) {
  78. return typeof fn === 'function';
  79. }
  80. function isStr(str) {
  81. return typeof str === 'string';
  82. }
  83. function isPlainObject(obj) {
  84. return _toString.call(obj) === '[object Object]';
  85. }
  86. function hasOwn(obj, key) {
  87. return hasOwnProperty.call(obj, key);
  88. }
  89. function noop() {}
  90. /**
  91. * Create a cached version of a pure function.
  92. */
  93. function cached(fn) {
  94. var cache = Object.create(null);
  95. return function cachedFn(str) {
  96. var hit = cache[str];
  97. return hit || (cache[str] = fn(str));
  98. };
  99. }
  100. /**
  101. * Camelize a hyphen-delimited string.
  102. */
  103. var camelizeRE = /-(\w)/g;
  104. var camelize = cached(function (str) {
  105. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  106. });
  107. var HOOKS = [
  108. 'invoke',
  109. 'success',
  110. 'fail',
  111. 'complete',
  112. 'returnValue'];
  113. var globalInterceptors = {};
  114. var scopedInterceptors = {};
  115. function mergeHook(parentVal, childVal) {
  116. var res = childVal ?
  117. parentVal ?
  118. parentVal.concat(childVal) :
  119. Array.isArray(childVal) ?
  120. childVal : [childVal] :
  121. parentVal;
  122. return res ?
  123. dedupeHooks(res) :
  124. res;
  125. }
  126. function dedupeHooks(hooks) {
  127. var res = [];
  128. for (var i = 0; i < hooks.length; i++) {
  129. if (res.indexOf(hooks[i]) === -1) {
  130. res.push(hooks[i]);
  131. }
  132. }
  133. return res;
  134. }
  135. function removeHook(hooks, hook) {
  136. var index = hooks.indexOf(hook);
  137. if (index !== -1) {
  138. hooks.splice(index, 1);
  139. }
  140. }
  141. function mergeInterceptorHook(interceptor, option) {
  142. Object.keys(option).forEach(function (hook) {
  143. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  144. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  145. }
  146. });
  147. }
  148. function removeInterceptorHook(interceptor, option) {
  149. if (!interceptor || !option) {
  150. return;
  151. }
  152. Object.keys(option).forEach(function (hook) {
  153. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  154. removeHook(interceptor[hook], option[hook]);
  155. }
  156. });
  157. }
  158. function addInterceptor(method, option) {
  159. if (typeof method === 'string' && isPlainObject(option)) {
  160. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  161. } else if (isPlainObject(method)) {
  162. mergeInterceptorHook(globalInterceptors, method);
  163. }
  164. }
  165. function removeInterceptor(method, option) {
  166. if (typeof method === 'string') {
  167. if (isPlainObject(option)) {
  168. removeInterceptorHook(scopedInterceptors[method], option);
  169. } else {
  170. delete scopedInterceptors[method];
  171. }
  172. } else if (isPlainObject(method)) {
  173. removeInterceptorHook(globalInterceptors, method);
  174. }
  175. }
  176. function wrapperHook(hook) {
  177. return function (data) {
  178. return hook(data) || data;
  179. };
  180. }
  181. function isPromise(obj) {
  182. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  183. }
  184. function queue(hooks, data) {
  185. var promise = false;
  186. for (var i = 0; i < hooks.length; i++) {
  187. var hook = hooks[i];
  188. if (promise) {
  189. promise = Promise.resolve(wrapperHook(hook));
  190. } else {
  191. var res = hook(data);
  192. if (isPromise(res)) {
  193. promise = Promise.resolve(res);
  194. }
  195. if (res === false) {
  196. return {
  197. then: function then() {} };
  198. }
  199. }
  200. }
  201. return promise || {
  202. then: function then(callback) {
  203. return callback(data);
  204. } };
  205. }
  206. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  207. ['success', 'fail', 'complete'].forEach(function (name) {
  208. if (Array.isArray(interceptor[name])) {
  209. var oldCallback = options[name];
  210. options[name] = function callbackInterceptor(res) {
  211. queue(interceptor[name], res).then(function (res) {
  212. /* eslint-disable no-mixed-operators */
  213. return isFn(oldCallback) && oldCallback(res) || res;
  214. });
  215. };
  216. }
  217. });
  218. return options;
  219. }
  220. function wrapperReturnValue(method, returnValue) {
  221. var returnValueHooks = [];
  222. if (Array.isArray(globalInterceptors.returnValue)) {
  223. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  224. }
  225. var interceptor = scopedInterceptors[method];
  226. if (interceptor && Array.isArray(interceptor.returnValue)) {
  227. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  228. }
  229. returnValueHooks.forEach(function (hook) {
  230. returnValue = hook(returnValue) || returnValue;
  231. });
  232. return returnValue;
  233. }
  234. function getApiInterceptorHooks(method) {
  235. var interceptor = Object.create(null);
  236. Object.keys(globalInterceptors).forEach(function (hook) {
  237. if (hook !== 'returnValue') {
  238. interceptor[hook] = globalInterceptors[hook].slice();
  239. }
  240. });
  241. var scopedInterceptor = scopedInterceptors[method];
  242. if (scopedInterceptor) {
  243. Object.keys(scopedInterceptor).forEach(function (hook) {
  244. if (hook !== 'returnValue') {
  245. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  246. }
  247. });
  248. }
  249. return interceptor;
  250. }
  251. function invokeApi(method, api, options) {for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {params[_key - 3] = arguments[_key];}
  252. var interceptor = getApiInterceptorHooks(method);
  253. if (interceptor && Object.keys(interceptor).length) {
  254. if (Array.isArray(interceptor.invoke)) {
  255. var res = queue(interceptor.invoke, options);
  256. return res.then(function (options) {
  257. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  258. });
  259. } else {
  260. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  261. }
  262. }
  263. return api.apply(void 0, [options].concat(params));
  264. }
  265. var promiseInterceptor = {
  266. returnValue: function returnValue(res) {
  267. if (!isPromise(res)) {
  268. return res;
  269. }
  270. return new Promise(function (resolve, reject) {
  271. res.then(function (res) {
  272. if (res[0]) {
  273. reject(res[0]);
  274. } else {
  275. resolve(res[1]);
  276. }
  277. });
  278. });
  279. } };
  280. var SYNC_API_RE =
  281. /^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale/;
  282. var CONTEXT_API_RE = /^create|Manager$/;
  283. // Context例外情况
  284. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  285. // 同步例外情况
  286. var ASYNC_API = ['createBLEConnection'];
  287. var CALLBACK_API_RE = /^on|^off/;
  288. function isContextApi(name) {
  289. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  290. }
  291. function isSyncApi(name) {
  292. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  293. }
  294. function isCallbackApi(name) {
  295. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  296. }
  297. function handlePromise(promise) {
  298. return promise.then(function (data) {
  299. return [null, data];
  300. }).
  301. catch(function (err) {return [err];});
  302. }
  303. function shouldPromise(name) {
  304. if (
  305. isContextApi(name) ||
  306. isSyncApi(name) ||
  307. isCallbackApi(name))
  308. {
  309. return false;
  310. }
  311. return true;
  312. }
  313. /* eslint-disable no-extend-native */
  314. if (!Promise.prototype.finally) {
  315. Promise.prototype.finally = function (callback) {
  316. var promise = this.constructor;
  317. return this.then(
  318. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  319. function (reason) {return promise.resolve(callback()).then(function () {
  320. throw reason;
  321. });});
  322. };
  323. }
  324. function promisify(name, api) {
  325. if (!shouldPromise(name)) {
  326. return api;
  327. }
  328. return function promiseApi() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {params[_key2 - 1] = arguments[_key2];}
  329. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  330. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  331. }
  332. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  333. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  334. success: resolve,
  335. fail: reject })].concat(
  336. params));
  337. })));
  338. };
  339. }
  340. var EPS = 1e-4;
  341. var BASE_DEVICE_WIDTH = 750;
  342. var isIOS = false;
  343. var deviceWidth = 0;
  344. var deviceDPR = 0;
  345. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  346. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  347. deviceWidth = windowWidth;
  348. deviceDPR = pixelRatio;
  349. isIOS = platform === 'ios';
  350. }
  351. function upx2px(number, newDeviceWidth) {
  352. if (deviceWidth === 0) {
  353. checkDeviceWidth();
  354. }
  355. number = Number(number);
  356. if (number === 0) {
  357. return 0;
  358. }
  359. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  360. if (result < 0) {
  361. result = -result;
  362. }
  363. result = Math.floor(result + EPS);
  364. if (result === 0) {
  365. if (deviceDPR === 1 || !isIOS) {
  366. result = 1;
  367. } else {
  368. result = 0.5;
  369. }
  370. }
  371. return number < 0 ? -result : result;
  372. }
  373. function getLocale() {
  374. // 优先使用 $locale
  375. var app = getApp({
  376. allowDefault: true });
  377. if (app && app.$vm) {
  378. return app.$vm.$locale;
  379. }
  380. return wx.getSystemInfoSync().language || 'zh-Hans';
  381. }
  382. function setLocale(locale) {
  383. var app = getApp();
  384. if (!app) {
  385. return false;
  386. }
  387. var oldLocale = app.$vm.$locale;
  388. if (oldLocale !== locale) {
  389. app.$vm.$locale = locale;
  390. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  391. locale: locale });});
  392. return true;
  393. }
  394. return false;
  395. }
  396. var onLocaleChangeCallbacks = [];
  397. function onLocaleChange(fn) {
  398. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  399. onLocaleChangeCallbacks.push(fn);
  400. }
  401. }
  402. if (typeof global !== 'undefined') {
  403. global.getLocale = getLocale;
  404. }
  405. var interceptors = {
  406. promiseInterceptor: promiseInterceptor };
  407. var baseApi = /*#__PURE__*/Object.freeze({
  408. __proto__: null,
  409. upx2px: upx2px,
  410. getLocale: getLocale,
  411. setLocale: setLocale,
  412. onLocaleChange: onLocaleChange,
  413. addInterceptor: addInterceptor,
  414. removeInterceptor: removeInterceptor,
  415. interceptors: interceptors });
  416. function findExistsPageIndex(url) {
  417. var pages = getCurrentPages();
  418. var len = pages.length;
  419. while (len--) {
  420. var page = pages[len];
  421. if (page.$page && page.$page.fullPath === url) {
  422. return len;
  423. }
  424. }
  425. return -1;
  426. }
  427. var redirectTo = {
  428. name: function name(fromArgs) {
  429. if (fromArgs.exists === 'back' && fromArgs.delta) {
  430. return 'navigateBack';
  431. }
  432. return 'redirectTo';
  433. },
  434. args: function args(fromArgs) {
  435. if (fromArgs.exists === 'back' && fromArgs.url) {
  436. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  437. if (existsPageIndex !== -1) {
  438. var delta = getCurrentPages().length - 1 - existsPageIndex;
  439. if (delta > 0) {
  440. fromArgs.delta = delta;
  441. }
  442. }
  443. }
  444. } };
  445. var previewImage = {
  446. args: function args(fromArgs) {
  447. var currentIndex = parseInt(fromArgs.current);
  448. if (isNaN(currentIndex)) {
  449. return;
  450. }
  451. var urls = fromArgs.urls;
  452. if (!Array.isArray(urls)) {
  453. return;
  454. }
  455. var len = urls.length;
  456. if (!len) {
  457. return;
  458. }
  459. if (currentIndex < 0) {
  460. currentIndex = 0;
  461. } else if (currentIndex >= len) {
  462. currentIndex = len - 1;
  463. }
  464. if (currentIndex > 0) {
  465. fromArgs.current = urls[currentIndex];
  466. fromArgs.urls = urls.filter(
  467. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  468. } else {
  469. fromArgs.current = urls[0];
  470. }
  471. return {
  472. indicator: false,
  473. loop: false };
  474. } };
  475. var UUID_KEY = '__DC_STAT_UUID';
  476. var deviceId;
  477. function addUuid(result) {
  478. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  479. if (!deviceId) {
  480. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  481. wx.setStorage({
  482. key: UUID_KEY,
  483. data: deviceId });
  484. }
  485. result.deviceId = deviceId;
  486. }
  487. function addSafeAreaInsets(result) {
  488. if (result.safeArea) {
  489. var safeArea = result.safeArea;
  490. result.safeAreaInsets = {
  491. top: safeArea.top,
  492. left: safeArea.left,
  493. right: result.windowWidth - safeArea.right,
  494. bottom: result.windowHeight - safeArea.bottom };
  495. }
  496. }
  497. var getSystemInfo = {
  498. returnValue: function returnValue(result) {
  499. addUuid(result);
  500. addSafeAreaInsets(result);
  501. } };
  502. // import navigateTo from 'uni-helpers/navigate-to'
  503. var protocols = {
  504. redirectTo: redirectTo,
  505. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  506. previewImage: previewImage,
  507. getSystemInfo: getSystemInfo,
  508. getSystemInfoSync: getSystemInfo };
  509. var todos = [
  510. 'vibrate',
  511. 'preloadPage',
  512. 'unPreloadPage',
  513. 'loadSubPackage'];
  514. var canIUses = [];
  515. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  516. function processCallback(methodName, method, returnValue) {
  517. return function (res) {
  518. return method(processReturnValue(methodName, res, returnValue));
  519. };
  520. }
  521. function processArgs(methodName, fromArgs) {var argsOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};var returnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};var keepFromArgs = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  522. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  523. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  524. if (isFn(argsOption)) {
  525. argsOption = argsOption(fromArgs, toArgs) || {};
  526. }
  527. for (var key in fromArgs) {
  528. if (hasOwn(argsOption, key)) {
  529. var keyOption = argsOption[key];
  530. if (isFn(keyOption)) {
  531. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  532. }
  533. if (!keyOption) {// 不支持的参数
  534. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  535. } else if (isStr(keyOption)) {// 重写参数 key
  536. toArgs[keyOption] = fromArgs[key];
  537. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  538. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  539. }
  540. } else if (CALLBACKS.indexOf(key) !== -1) {
  541. if (isFn(fromArgs[key])) {
  542. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  543. }
  544. } else {
  545. if (!keepFromArgs) {
  546. toArgs[key] = fromArgs[key];
  547. }
  548. }
  549. }
  550. return toArgs;
  551. } else if (isFn(fromArgs)) {
  552. fromArgs = processCallback(methodName, fromArgs, returnValue);
  553. }
  554. return fromArgs;
  555. }
  556. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  557. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  558. res = protocols.returnValue(methodName, res);
  559. }
  560. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  561. }
  562. function wrapper(methodName, method) {
  563. if (hasOwn(protocols, methodName)) {
  564. var protocol = protocols[methodName];
  565. if (!protocol) {// 暂不支持的 api
  566. return function () {
  567. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  568. };
  569. }
  570. return function (arg1, arg2) {// 目前 api 最多两个参数
  571. var options = protocol;
  572. if (isFn(protocol)) {
  573. options = protocol(arg1);
  574. }
  575. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  576. var args = [arg1];
  577. if (typeof arg2 !== 'undefined') {
  578. args.push(arg2);
  579. }
  580. if (isFn(options.name)) {
  581. methodName = options.name(arg1);
  582. } else if (isStr(options.name)) {
  583. methodName = options.name;
  584. }
  585. var returnValue = wx[methodName].apply(wx, args);
  586. if (isSyncApi(methodName)) {// 同步 api
  587. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  588. }
  589. return returnValue;
  590. };
  591. }
  592. return method;
  593. }
  594. var todoApis = Object.create(null);
  595. var TODOS = [
  596. 'onTabBarMidButtonTap',
  597. 'subscribePush',
  598. 'unsubscribePush',
  599. 'onPush',
  600. 'offPush',
  601. 'share'];
  602. function createTodoApi(name) {
  603. return function todoApi(_ref)
  604. {var fail = _ref.fail,complete = _ref.complete;
  605. var res = {
  606. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  607. isFn(fail) && fail(res);
  608. isFn(complete) && complete(res);
  609. };
  610. }
  611. TODOS.forEach(function (name) {
  612. todoApis[name] = createTodoApi(name);
  613. });
  614. var providers = {
  615. oauth: ['weixin'],
  616. share: ['weixin'],
  617. payment: ['wxpay'],
  618. push: ['weixin'] };
  619. function getProvider(_ref2)
  620. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  621. var res = false;
  622. if (providers[service]) {
  623. res = {
  624. errMsg: 'getProvider:ok',
  625. service: service,
  626. provider: providers[service] };
  627. isFn(success) && success(res);
  628. } else {
  629. res = {
  630. errMsg: 'getProvider:fail service not found' };
  631. isFn(fail) && fail(res);
  632. }
  633. isFn(complete) && complete(res);
  634. }
  635. var extraApi = /*#__PURE__*/Object.freeze({
  636. __proto__: null,
  637. getProvider: getProvider });
  638. var getEmitter = function () {
  639. var Emitter;
  640. return function getUniEmitter() {
  641. if (!Emitter) {
  642. Emitter = new _vue.default();
  643. }
  644. return Emitter;
  645. };
  646. }();
  647. function apply(ctx, method, args) {
  648. return ctx[method].apply(ctx, args);
  649. }
  650. function $on() {
  651. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  652. }
  653. function $off() {
  654. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  655. }
  656. function $once() {
  657. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  658. }
  659. function $emit() {
  660. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  661. }
  662. var eventApi = /*#__PURE__*/Object.freeze({
  663. __proto__: null,
  664. $on: $on,
  665. $off: $off,
  666. $once: $once,
  667. $emit: $emit });
  668. var api = /*#__PURE__*/Object.freeze({
  669. __proto__: null });
  670. var MPPage = Page;
  671. var MPComponent = Component;
  672. var customizeRE = /:/g;
  673. var customize = cached(function (str) {
  674. return camelize(str.replace(customizeRE, '-'));
  675. });
  676. function initTriggerEvent(mpInstance) {
  677. var oldTriggerEvent = mpInstance.triggerEvent;
  678. var newTriggerEvent = function newTriggerEvent(event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  679. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  680. };
  681. try {
  682. // 京东小程序 triggerEvent 为只读
  683. mpInstance.triggerEvent = newTriggerEvent;
  684. } catch (error) {
  685. mpInstance._triggerEvent = newTriggerEvent;
  686. }
  687. }
  688. function initHook(name, options, isComponent) {
  689. var oldHook = options[name];
  690. if (!oldHook) {
  691. options[name] = function () {
  692. initTriggerEvent(this);
  693. };
  694. } else {
  695. options[name] = function () {
  696. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  697. return oldHook.apply(this, args);
  698. };
  699. }
  700. }
  701. if (!MPPage.__$wrappered) {
  702. MPPage.__$wrappered = true;
  703. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  704. initHook('onLoad', options);
  705. return MPPage(options);
  706. };
  707. Page.after = MPPage.after;
  708. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  709. initHook('created', options);
  710. return MPComponent(options);
  711. };
  712. }
  713. var PAGE_EVENT_HOOKS = [
  714. 'onPullDownRefresh',
  715. 'onReachBottom',
  716. 'onAddToFavorites',
  717. 'onShareTimeline',
  718. 'onShareAppMessage',
  719. 'onPageScroll',
  720. 'onResize',
  721. 'onTabItemTap'];
  722. function initMocks(vm, mocks) {
  723. var mpInstance = vm.$mp[vm.mpType];
  724. mocks.forEach(function (mock) {
  725. if (hasOwn(mpInstance, mock)) {
  726. vm[mock] = mpInstance[mock];
  727. }
  728. });
  729. }
  730. function hasHook(hook, vueOptions) {
  731. if (!vueOptions) {
  732. return true;
  733. }
  734. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  735. return true;
  736. }
  737. vueOptions = vueOptions.default || vueOptions;
  738. if (isFn(vueOptions)) {
  739. if (isFn(vueOptions.extendOptions[hook])) {
  740. return true;
  741. }
  742. if (vueOptions.super &&
  743. vueOptions.super.options &&
  744. Array.isArray(vueOptions.super.options[hook])) {
  745. return true;
  746. }
  747. return false;
  748. }
  749. if (isFn(vueOptions[hook])) {
  750. return true;
  751. }
  752. var mixins = vueOptions.mixins;
  753. if (Array.isArray(mixins)) {
  754. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  755. }
  756. }
  757. function initHooks(mpOptions, hooks, vueOptions) {
  758. hooks.forEach(function (hook) {
  759. if (hasHook(hook, vueOptions)) {
  760. mpOptions[hook] = function (args) {
  761. return this.$vm && this.$vm.__call_hook(hook, args);
  762. };
  763. }
  764. });
  765. }
  766. function initVueComponent(Vue, vueOptions) {
  767. vueOptions = vueOptions.default || vueOptions;
  768. var VueComponent;
  769. if (isFn(vueOptions)) {
  770. VueComponent = vueOptions;
  771. } else {
  772. VueComponent = Vue.extend(vueOptions);
  773. }
  774. vueOptions = VueComponent.options;
  775. return [VueComponent, vueOptions];
  776. }
  777. function initSlots(vm, vueSlots) {
  778. if (Array.isArray(vueSlots) && vueSlots.length) {
  779. var $slots = Object.create(null);
  780. vueSlots.forEach(function (slotName) {
  781. $slots[slotName] = true;
  782. });
  783. vm.$scopedSlots = vm.$slots = $slots;
  784. }
  785. }
  786. function initVueIds(vueIds, mpInstance) {
  787. vueIds = (vueIds || '').split(',');
  788. var len = vueIds.length;
  789. if (len === 1) {
  790. mpInstance._$vueId = vueIds[0];
  791. } else if (len === 2) {
  792. mpInstance._$vueId = vueIds[0];
  793. mpInstance._$vuePid = vueIds[1];
  794. }
  795. }
  796. function initData(vueOptions, context) {
  797. var data = vueOptions.data || {};
  798. var methods = vueOptions.methods || {};
  799. if (typeof data === 'function') {
  800. try {
  801. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  802. } catch (e) {
  803. if (Object({"VUE_APP_NAME":"uView UI已发布Sketch和Axure设计资源示例","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  804. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  805. }
  806. }
  807. } else {
  808. try {
  809. // 对 data 格式化
  810. data = JSON.parse(JSON.stringify(data));
  811. } catch (e) {}
  812. }
  813. if (!isPlainObject(data)) {
  814. data = {};
  815. }
  816. Object.keys(methods).forEach(function (methodName) {
  817. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  818. data[methodName] = methods[methodName];
  819. }
  820. });
  821. return data;
  822. }
  823. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  824. function createObserver(name) {
  825. return function observer(newVal, oldVal) {
  826. if (this.$vm) {
  827. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  828. }
  829. };
  830. }
  831. function initBehaviors(vueOptions, initBehavior) {
  832. var vueBehaviors = vueOptions.behaviors;
  833. var vueExtends = vueOptions.extends;
  834. var vueMixins = vueOptions.mixins;
  835. var vueProps = vueOptions.props;
  836. if (!vueProps) {
  837. vueOptions.props = vueProps = [];
  838. }
  839. var behaviors = [];
  840. if (Array.isArray(vueBehaviors)) {
  841. vueBehaviors.forEach(function (behavior) {
  842. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  843. if (behavior === 'uni://form-field') {
  844. if (Array.isArray(vueProps)) {
  845. vueProps.push('name');
  846. vueProps.push('value');
  847. } else {
  848. vueProps.name = {
  849. type: String,
  850. default: '' };
  851. vueProps.value = {
  852. type: [String, Number, Boolean, Array, Object, Date],
  853. default: '' };
  854. }
  855. }
  856. });
  857. }
  858. if (isPlainObject(vueExtends) && vueExtends.props) {
  859. behaviors.push(
  860. initBehavior({
  861. properties: initProperties(vueExtends.props, true) }));
  862. }
  863. if (Array.isArray(vueMixins)) {
  864. vueMixins.forEach(function (vueMixin) {
  865. if (isPlainObject(vueMixin) && vueMixin.props) {
  866. behaviors.push(
  867. initBehavior({
  868. properties: initProperties(vueMixin.props, true) }));
  869. }
  870. });
  871. }
  872. return behaviors;
  873. }
  874. function parsePropType(key, type, defaultValue, file) {
  875. // [String]=>String
  876. if (Array.isArray(type) && type.length === 1) {
  877. return type[0];
  878. }
  879. return type;
  880. }
  881. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  882. var properties = {};
  883. if (!isBehavior) {
  884. properties.vueId = {
  885. type: String,
  886. value: '' };
  887. // 用于字节跳动小程序模拟抽象节点
  888. properties.generic = {
  889. type: Object,
  890. value: null };
  891. // scopedSlotsCompiler auto
  892. properties.scopedSlotsCompiler = {
  893. type: String,
  894. value: '' };
  895. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  896. type: null,
  897. value: [],
  898. observer: function observer(newVal, oldVal) {
  899. var $slots = Object.create(null);
  900. newVal.forEach(function (slotName) {
  901. $slots[slotName] = true;
  902. });
  903. this.setData({
  904. $slots: $slots });
  905. } };
  906. }
  907. if (Array.isArray(props)) {// ['title']
  908. props.forEach(function (key) {
  909. properties[key] = {
  910. type: null,
  911. observer: createObserver(key) };
  912. });
  913. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  914. Object.keys(props).forEach(function (key) {
  915. var opts = props[key];
  916. if (isPlainObject(opts)) {// title:{type:String,default:''}
  917. var value = opts.default;
  918. if (isFn(value)) {
  919. value = value();
  920. }
  921. opts.type = parsePropType(key, opts.type);
  922. properties[key] = {
  923. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  924. value: value,
  925. observer: createObserver(key) };
  926. } else {// content:String
  927. var type = parsePropType(key, opts);
  928. properties[key] = {
  929. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  930. observer: createObserver(key) };
  931. }
  932. });
  933. }
  934. return properties;
  935. }
  936. function wrapper$1(event) {
  937. // TODO 又得兼容 mpvue 的 mp 对象
  938. try {
  939. event.mp = JSON.parse(JSON.stringify(event));
  940. } catch (e) {}
  941. event.stopPropagation = noop;
  942. event.preventDefault = noop;
  943. event.target = event.target || {};
  944. if (!hasOwn(event, 'detail')) {
  945. event.detail = {};
  946. }
  947. if (hasOwn(event, 'markerId')) {
  948. event.detail = typeof event.detail === 'object' ? event.detail : {};
  949. event.detail.markerId = event.markerId;
  950. }
  951. if (isPlainObject(event.detail)) {
  952. event.target = Object.assign({}, event.target, event.detail);
  953. }
  954. return event;
  955. }
  956. function getExtraValue(vm, dataPathsArray) {
  957. var context = vm;
  958. dataPathsArray.forEach(function (dataPathArray) {
  959. var dataPath = dataPathArray[0];
  960. var value = dataPathArray[2];
  961. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  962. var propPath = dataPathArray[1];
  963. var valuePath = dataPathArray[3];
  964. var vFor;
  965. if (Number.isInteger(dataPath)) {
  966. vFor = dataPath;
  967. } else if (!dataPath) {
  968. vFor = context;
  969. } else if (typeof dataPath === 'string' && dataPath) {
  970. if (dataPath.indexOf('#s#') === 0) {
  971. vFor = dataPath.substr(3);
  972. } else {
  973. vFor = vm.__get_value(dataPath, context);
  974. }
  975. }
  976. if (Number.isInteger(vFor)) {
  977. context = value;
  978. } else if (!propPath) {
  979. context = vFor[value];
  980. } else {
  981. if (Array.isArray(vFor)) {
  982. context = vFor.find(function (vForItem) {
  983. return vm.__get_value(propPath, vForItem) === value;
  984. });
  985. } else if (isPlainObject(vFor)) {
  986. context = Object.keys(vFor).find(function (vForKey) {
  987. return vm.__get_value(propPath, vFor[vForKey]) === value;
  988. });
  989. } else {
  990. console.error('v-for 暂不支持循环数据:', vFor);
  991. }
  992. }
  993. if (valuePath) {
  994. context = vm.__get_value(valuePath, context);
  995. }
  996. }
  997. });
  998. return context;
  999. }
  1000. function processEventExtra(vm, extra, event) {
  1001. var extraObj = {};
  1002. if (Array.isArray(extra) && extra.length) {
  1003. /**
  1004. *[
  1005. * ['data.items', 'data.id', item.data.id],
  1006. * ['metas', 'id', meta.id]
  1007. *],
  1008. *[
  1009. * ['data.items', 'data.id', item.data.id],
  1010. * ['metas', 'id', meta.id]
  1011. *],
  1012. *'test'
  1013. */
  1014. extra.forEach(function (dataPath, index) {
  1015. if (typeof dataPath === 'string') {
  1016. if (!dataPath) {// model,prop.sync
  1017. extraObj['$' + index] = vm;
  1018. } else {
  1019. if (dataPath === '$event') {// $event
  1020. extraObj['$' + index] = event;
  1021. } else if (dataPath === 'arguments') {
  1022. if (event.detail && event.detail.__args__) {
  1023. extraObj['$' + index] = event.detail.__args__;
  1024. } else {
  1025. extraObj['$' + index] = [event];
  1026. }
  1027. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1028. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1029. } else {
  1030. extraObj['$' + index] = vm.__get_value(dataPath);
  1031. }
  1032. }
  1033. } else {
  1034. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1035. }
  1036. });
  1037. }
  1038. return extraObj;
  1039. }
  1040. function getObjByArray(arr) {
  1041. var obj = {};
  1042. for (var i = 1; i < arr.length; i++) {
  1043. var element = arr[i];
  1044. obj[element[0]] = element[1];
  1045. }
  1046. return obj;
  1047. }
  1048. function processEventArgs(vm, event) {var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];var extra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];var isCustom = arguments.length > 4 ? arguments[4] : undefined;var methodName = arguments.length > 5 ? arguments[5] : undefined;
  1049. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1050. if (isCustom) {// 自定义事件
  1051. isCustomMPEvent = event.currentTarget &&
  1052. event.currentTarget.dataset &&
  1053. event.currentTarget.dataset.comType === 'wx';
  1054. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1055. if (isCustomMPEvent) {
  1056. return [event];
  1057. }
  1058. return event.detail.__args__ || event.detail;
  1059. }
  1060. }
  1061. var extraObj = processEventExtra(vm, extra, event);
  1062. var ret = [];
  1063. args.forEach(function (arg) {
  1064. if (arg === '$event') {
  1065. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1066. ret.push(event.target.value);
  1067. } else {
  1068. if (isCustom && !isCustomMPEvent) {
  1069. ret.push(event.detail.__args__[0]);
  1070. } else {// wxcomponent 组件或内置组件
  1071. ret.push(event);
  1072. }
  1073. }
  1074. } else {
  1075. if (Array.isArray(arg) && arg[0] === 'o') {
  1076. ret.push(getObjByArray(arg));
  1077. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1078. ret.push(extraObj[arg]);
  1079. } else {
  1080. ret.push(arg);
  1081. }
  1082. }
  1083. });
  1084. return ret;
  1085. }
  1086. var ONCE = '~';
  1087. var CUSTOM = '^';
  1088. function isMatchEventType(eventType, optType) {
  1089. return eventType === optType ||
  1090. optType === 'regionchange' && (
  1091. eventType === 'begin' ||
  1092. eventType === 'end');
  1093. }
  1094. function getContextVm(vm) {
  1095. var $parent = vm.$parent;
  1096. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1097. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1098. $parent = $parent.$parent;
  1099. }
  1100. return $parent && $parent.$parent;
  1101. }
  1102. function handleEvent(event) {var _this = this;
  1103. event = wrapper$1(event);
  1104. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1105. var dataset = (event.currentTarget || event.target).dataset;
  1106. if (!dataset) {
  1107. return console.warn('事件信息不存在');
  1108. }
  1109. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1110. if (!eventOpts) {
  1111. return console.warn('事件信息不存在');
  1112. }
  1113. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1114. var eventType = event.type;
  1115. var ret = [];
  1116. eventOpts.forEach(function (eventOpt) {
  1117. var type = eventOpt[0];
  1118. var eventsArray = eventOpt[1];
  1119. var isCustom = type.charAt(0) === CUSTOM;
  1120. type = isCustom ? type.slice(1) : type;
  1121. var isOnce = type.charAt(0) === ONCE;
  1122. type = isOnce ? type.slice(1) : type;
  1123. if (eventsArray && isMatchEventType(eventType, type)) {
  1124. eventsArray.forEach(function (eventArray) {
  1125. var methodName = eventArray[0];
  1126. if (methodName) {
  1127. var handlerCtx = _this.$vm;
  1128. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1129. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1130. }
  1131. if (methodName === '$emit') {
  1132. handlerCtx.$emit.apply(handlerCtx,
  1133. processEventArgs(
  1134. _this.$vm,
  1135. event,
  1136. eventArray[1],
  1137. eventArray[2],
  1138. isCustom,
  1139. methodName));
  1140. return;
  1141. }
  1142. var handler = handlerCtx[methodName];
  1143. if (!isFn(handler)) {
  1144. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1145. }
  1146. if (isOnce) {
  1147. if (handler.once) {
  1148. return;
  1149. }
  1150. handler.once = true;
  1151. }
  1152. var params = processEventArgs(
  1153. _this.$vm,
  1154. event,
  1155. eventArray[1],
  1156. eventArray[2],
  1157. isCustom,
  1158. methodName);
  1159. params = Array.isArray(params) ? params : [];
  1160. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1161. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1162. // eslint-disable-next-line no-sparse-arrays
  1163. params = params.concat([,,,,,,,,,, event]);
  1164. }
  1165. ret.push(handler.apply(handlerCtx, params));
  1166. }
  1167. });
  1168. }
  1169. });
  1170. if (
  1171. eventType === 'input' &&
  1172. ret.length === 1 &&
  1173. typeof ret[0] !== 'undefined')
  1174. {
  1175. return ret[0];
  1176. }
  1177. }
  1178. var messages = {};
  1179. var locale;
  1180. {
  1181. locale = wx.getSystemInfoSync().language;
  1182. }
  1183. function initI18nMessages() {
  1184. if (!isEnableLocale()) {
  1185. return;
  1186. }
  1187. var localeKeys = Object.keys(__uniConfig.locales);
  1188. if (localeKeys.length) {
  1189. localeKeys.forEach(function (locale) {
  1190. var curMessages = messages[locale];
  1191. var userMessages = __uniConfig.locales[locale];
  1192. if (curMessages) {
  1193. Object.assign(curMessages, userMessages);
  1194. } else {
  1195. messages[locale] = userMessages;
  1196. }
  1197. });
  1198. }
  1199. }
  1200. initI18nMessages();
  1201. var i18n = (0, _uniI18n.initVueI18n)(
  1202. locale,
  1203. {});
  1204. var t = i18n.t;
  1205. var i18nMixin = i18n.mixin = {
  1206. beforeCreate: function beforeCreate() {var _this2 = this;
  1207. var unwatch = i18n.i18n.watchLocale(function () {
  1208. _this2.$forceUpdate();
  1209. });
  1210. this.$once('hook:beforeDestroy', function () {
  1211. unwatch();
  1212. });
  1213. },
  1214. methods: {
  1215. $$t: function $$t(key, values) {
  1216. return t(key, values);
  1217. } } };
  1218. var setLocale$1 = i18n.setLocale;
  1219. var getLocale$1 = i18n.getLocale;
  1220. function initAppLocale(Vue, appVm, locale) {
  1221. var state = Vue.observable({
  1222. locale: locale || i18n.getLocale() });
  1223. var localeWatchers = [];
  1224. appVm.$watchLocale = function (fn) {
  1225. localeWatchers.push(fn);
  1226. };
  1227. Object.defineProperty(appVm, '$locale', {
  1228. get: function get() {
  1229. return state.locale;
  1230. },
  1231. set: function set(v) {
  1232. state.locale = v;
  1233. localeWatchers.forEach(function (watch) {return watch(v);});
  1234. } });
  1235. }
  1236. function isEnableLocale() {
  1237. return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length;
  1238. }
  1239. // export function initI18n() {
  1240. // const localeKeys = Object.keys(__uniConfig.locales || {})
  1241. // if (localeKeys.length) {
  1242. // localeKeys.forEach((locale) =>
  1243. // i18n.add(locale, __uniConfig.locales[locale])
  1244. // )
  1245. // }
  1246. // }
  1247. var eventChannels = {};
  1248. var eventChannelStack = [];
  1249. function getEventChannel(id) {
  1250. if (id) {
  1251. var eventChannel = eventChannels[id];
  1252. delete eventChannels[id];
  1253. return eventChannel;
  1254. }
  1255. return eventChannelStack.shift();
  1256. }
  1257. var hooks = [
  1258. 'onShow',
  1259. 'onHide',
  1260. 'onError',
  1261. 'onPageNotFound',
  1262. 'onThemeChange',
  1263. 'onUnhandledRejection'];
  1264. function initEventChannel() {
  1265. _vue.default.prototype.getOpenerEventChannel = function () {
  1266. // 微信小程序使用自身getOpenerEventChannel
  1267. {
  1268. return this.$scope.getOpenerEventChannel();
  1269. }
  1270. };
  1271. var callHook = _vue.default.prototype.__call_hook;
  1272. _vue.default.prototype.__call_hook = function (hook, args) {
  1273. if (hook === 'onLoad' && args && args.__id__) {
  1274. this.__eventChannel__ = getEventChannel(args.__id__);
  1275. delete args.__id__;
  1276. }
  1277. return callHook.call(this, hook, args);
  1278. };
  1279. }
  1280. function initScopedSlotsParams() {
  1281. var center = {};
  1282. var parents = {};
  1283. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1284. var has = center[vueId];
  1285. if (!has) {
  1286. parents[vueId] = this;
  1287. this.$on('hook:destroyed', function () {
  1288. delete parents[vueId];
  1289. });
  1290. }
  1291. return has;
  1292. };
  1293. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1294. var data = center[vueId];
  1295. if (data) {
  1296. var object = data[name] || {};
  1297. return key ? object[key] : object;
  1298. } else {
  1299. parents[vueId] = this;
  1300. this.$on('hook:destroyed', function () {
  1301. delete parents[vueId];
  1302. });
  1303. }
  1304. };
  1305. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1306. var vueIds = this.$options.propsData.vueId;
  1307. if (vueIds) {
  1308. var vueId = vueIds.split(',')[0];
  1309. var object = center[vueId] = center[vueId] || {};
  1310. object[name] = value;
  1311. if (parents[vueId]) {
  1312. parents[vueId].$forceUpdate();
  1313. }
  1314. }
  1315. };
  1316. _vue.default.mixin({
  1317. destroyed: function destroyed() {
  1318. var propsData = this.$options.propsData;
  1319. var vueId = propsData && propsData.vueId;
  1320. if (vueId) {
  1321. delete center[vueId];
  1322. delete parents[vueId];
  1323. }
  1324. } });
  1325. }
  1326. function parseBaseApp(vm, _ref3)
  1327. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1328. initEventChannel();
  1329. {
  1330. initScopedSlotsParams();
  1331. }
  1332. if (vm.$options.store) {
  1333. _vue.default.prototype.$store = vm.$options.store;
  1334. }
  1335. uniIdMixin(_vue.default);
  1336. _vue.default.prototype.mpHost = "mp-weixin";
  1337. _vue.default.mixin({
  1338. beforeCreate: function beforeCreate() {
  1339. if (!this.$options.mpType) {
  1340. return;
  1341. }
  1342. this.mpType = this.$options.mpType;
  1343. this.$mp = _defineProperty({
  1344. data: {} },
  1345. this.mpType, this.$options.mpInstance);
  1346. this.$scope = this.$options.mpInstance;
  1347. delete this.$options.mpType;
  1348. delete this.$options.mpInstance;
  1349. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1350. var app = getApp();
  1351. if (app.$vm && app.$vm.$i18n) {
  1352. this._i18n = app.$vm.$i18n;
  1353. }
  1354. }
  1355. if (this.mpType !== 'app') {
  1356. initRefs(this);
  1357. initMocks(this, mocks);
  1358. }
  1359. } });
  1360. var appOptions = {
  1361. onLaunch: function onLaunch(args) {
  1362. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1363. return;
  1364. }
  1365. {
  1366. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1367. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1368. }
  1369. }
  1370. this.$vm = vm;
  1371. this.$vm.$mp = {
  1372. app: this };
  1373. this.$vm.$scope = this;
  1374. // vm 上也挂载 globalData
  1375. this.$vm.globalData = this.globalData;
  1376. this.$vm._isMounted = true;
  1377. this.$vm.__call_hook('mounted', args);
  1378. this.$vm.__call_hook('onLaunch', args);
  1379. } };
  1380. // 兼容旧版本 globalData
  1381. appOptions.globalData = vm.$options.globalData || {};
  1382. // 将 methods 中的方法挂在 getApp() 中
  1383. var methods = vm.$options.methods;
  1384. if (methods) {
  1385. Object.keys(methods).forEach(function (name) {
  1386. appOptions[name] = methods[name];
  1387. });
  1388. }
  1389. initAppLocale(_vue.default, vm, wx.getSystemInfoSync().language || 'zh-Hans');
  1390. initHooks(appOptions, hooks);
  1391. return appOptions;
  1392. }
  1393. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1394. function findVmByVueId(vm, vuePid) {
  1395. var $children = vm.$children;
  1396. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1397. for (var i = $children.length - 1; i >= 0; i--) {
  1398. var childVm = $children[i];
  1399. if (childVm.$scope._$vueId === vuePid) {
  1400. return childVm;
  1401. }
  1402. }
  1403. // 反向递归查找
  1404. var parentVm;
  1405. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1406. parentVm = findVmByVueId($children[_i], vuePid);
  1407. if (parentVm) {
  1408. return parentVm;
  1409. }
  1410. }
  1411. }
  1412. function initBehavior(options) {
  1413. return Behavior(options);
  1414. }
  1415. function isPage() {
  1416. return !!this.route;
  1417. }
  1418. function initRelation(detail) {
  1419. this.triggerEvent('__l', detail);
  1420. }
  1421. function selectAllComponents(mpInstance, selector, $refs) {
  1422. var components = mpInstance.selectAllComponents(selector);
  1423. components.forEach(function (component) {
  1424. var ref = component.dataset.ref;
  1425. $refs[ref] = component.$vm || component;
  1426. {
  1427. if (component.dataset.vueGeneric === 'scoped') {
  1428. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1429. selectAllComponents(scopedComponent, selector, $refs);
  1430. });
  1431. }
  1432. }
  1433. });
  1434. }
  1435. function initRefs(vm) {
  1436. var mpInstance = vm.$scope;
  1437. Object.defineProperty(vm, '$refs', {
  1438. get: function get() {
  1439. var $refs = {};
  1440. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1441. // TODO 暂不考虑 for 中的 scoped
  1442. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1443. forComponents.forEach(function (component) {
  1444. var ref = component.dataset.ref;
  1445. if (!$refs[ref]) {
  1446. $refs[ref] = [];
  1447. }
  1448. $refs[ref].push(component.$vm || component);
  1449. });
  1450. return $refs;
  1451. } });
  1452. }
  1453. function handleLink(event) {var _ref4 =
  1454. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1455. var parentVm;
  1456. if (vuePid) {
  1457. parentVm = findVmByVueId(this.$vm, vuePid);
  1458. }
  1459. if (!parentVm) {
  1460. parentVm = this.$vm;
  1461. }
  1462. vueOptions.parent = parentVm;
  1463. }
  1464. function parseApp(vm) {
  1465. return parseBaseApp(vm, {
  1466. mocks: mocks,
  1467. initRefs: initRefs });
  1468. }
  1469. function createApp(vm) {
  1470. App(parseApp(vm));
  1471. return vm;
  1472. }
  1473. var encodeReserveRE = /[!'()*]/g;
  1474. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1475. var commaRE = /%2C/g;
  1476. // fixed encodeURIComponent which is more conformant to RFC3986:
  1477. // - escapes [!'()*]
  1478. // - preserve commas
  1479. var encode = function encode(str) {return encodeURIComponent(str).
  1480. replace(encodeReserveRE, encodeReserveReplacer).
  1481. replace(commaRE, ',');};
  1482. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1483. var res = obj ? Object.keys(obj).map(function (key) {
  1484. var val = obj[key];
  1485. if (val === undefined) {
  1486. return '';
  1487. }
  1488. if (val === null) {
  1489. return encodeStr(key);
  1490. }
  1491. if (Array.isArray(val)) {
  1492. var result = [];
  1493. val.forEach(function (val2) {
  1494. if (val2 === undefined) {
  1495. return;
  1496. }
  1497. if (val2 === null) {
  1498. result.push(encodeStr(key));
  1499. } else {
  1500. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1501. }
  1502. });
  1503. return result.join('&');
  1504. }
  1505. return encodeStr(key) + '=' + encodeStr(val);
  1506. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1507. return res ? "?".concat(res) : '';
  1508. }
  1509. function parseBaseComponent(vueComponentOptions)
  1510. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1511. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1512. var options = _objectSpread({
  1513. multipleSlots: true,
  1514. addGlobalClass: true },
  1515. vueOptions.options || {});
  1516. {
  1517. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1518. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1519. Object.assign(options, vueOptions['mp-weixin'].options);
  1520. }
  1521. }
  1522. var componentOptions = {
  1523. options: options,
  1524. data: initData(vueOptions, _vue.default.prototype),
  1525. behaviors: initBehaviors(vueOptions, initBehavior),
  1526. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1527. lifetimes: {
  1528. attached: function attached() {
  1529. var properties = this.properties;
  1530. var options = {
  1531. mpType: isPage.call(this) ? 'page' : 'component',
  1532. mpInstance: this,
  1533. propsData: properties };
  1534. initVueIds(properties.vueId, this);
  1535. // 处理父子关系
  1536. initRelation.call(this, {
  1537. vuePid: this._$vuePid,
  1538. vueOptions: options });
  1539. // 初始化 vue 实例
  1540. this.$vm = new VueComponent(options);
  1541. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1542. initSlots(this.$vm, properties.vueSlots);
  1543. // 触发首次 setData
  1544. this.$vm.$mount();
  1545. },
  1546. ready: function ready() {
  1547. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1548. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1549. if (this.$vm) {
  1550. this.$vm._isMounted = true;
  1551. this.$vm.__call_hook('mounted');
  1552. this.$vm.__call_hook('onReady');
  1553. }
  1554. },
  1555. detached: function detached() {
  1556. this.$vm && this.$vm.$destroy();
  1557. } },
  1558. pageLifetimes: {
  1559. show: function show(args) {
  1560. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1561. },
  1562. hide: function hide() {
  1563. this.$vm && this.$vm.__call_hook('onPageHide');
  1564. },
  1565. resize: function resize(size) {
  1566. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1567. } },
  1568. methods: {
  1569. __l: handleLink,
  1570. __e: handleEvent } };
  1571. // externalClasses
  1572. if (vueOptions.externalClasses) {
  1573. componentOptions.externalClasses = vueOptions.externalClasses;
  1574. }
  1575. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1576. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1577. componentOptions.methods[callMethod] = function (args) {
  1578. return this.$vm[callMethod](args);
  1579. };
  1580. });
  1581. }
  1582. if (isPage) {
  1583. return componentOptions;
  1584. }
  1585. return [componentOptions, VueComponent];
  1586. }
  1587. function parseComponent(vueComponentOptions) {
  1588. return parseBaseComponent(vueComponentOptions, {
  1589. isPage: isPage,
  1590. initRelation: initRelation });
  1591. }
  1592. var hooks$1 = [
  1593. 'onShow',
  1594. 'onHide',
  1595. 'onUnload'];
  1596. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1597. function parseBasePage(vuePageOptions, _ref6)
  1598. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1599. var pageOptions = parseComponent(vuePageOptions);
  1600. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1601. pageOptions.methods.onLoad = function (query) {
  1602. this.options = query;
  1603. var copyQuery = Object.assign({}, query);
  1604. delete copyQuery.__id__;
  1605. this.$page = {
  1606. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1607. this.$vm.$mp.query = query; // 兼容 mpvue
  1608. this.$vm.__call_hook('onLoad', query);
  1609. };
  1610. return pageOptions;
  1611. }
  1612. function parsePage(vuePageOptions) {
  1613. return parseBasePage(vuePageOptions, {
  1614. isPage: isPage,
  1615. initRelation: initRelation });
  1616. }
  1617. function createPage(vuePageOptions) {
  1618. {
  1619. return Component(parsePage(vuePageOptions));
  1620. }
  1621. }
  1622. function createComponent(vueOptions) {
  1623. {
  1624. return Component(parseComponent(vueOptions));
  1625. }
  1626. }
  1627. function createSubpackageApp(vm) {
  1628. var appOptions = parseApp(vm);
  1629. var app = getApp({
  1630. allowDefault: true });
  1631. vm.$scope = app;
  1632. var globalData = app.globalData;
  1633. if (globalData) {
  1634. Object.keys(appOptions.globalData).forEach(function (name) {
  1635. if (!hasOwn(globalData, name)) {
  1636. globalData[name] = appOptions.globalData[name];
  1637. }
  1638. });
  1639. }
  1640. Object.keys(appOptions).forEach(function (name) {
  1641. if (!hasOwn(app, name)) {
  1642. app[name] = appOptions[name];
  1643. }
  1644. });
  1645. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1646. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1647. vm.__call_hook('onShow', args);
  1648. });
  1649. }
  1650. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1651. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1652. vm.__call_hook('onHide', args);
  1653. });
  1654. }
  1655. if (isFn(appOptions.onLaunch)) {
  1656. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1657. vm.__call_hook('onLaunch', args);
  1658. }
  1659. return vm;
  1660. }
  1661. function createPlugin(vm) {
  1662. var appOptions = parseApp(vm);
  1663. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1664. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1665. vm.__call_hook('onShow', args);
  1666. });
  1667. }
  1668. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1669. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1670. vm.__call_hook('onHide', args);
  1671. });
  1672. }
  1673. if (isFn(appOptions.onLaunch)) {
  1674. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1675. vm.__call_hook('onLaunch', args);
  1676. }
  1677. return vm;
  1678. }
  1679. todos.forEach(function (todoApi) {
  1680. protocols[todoApi] = false;
  1681. });
  1682. canIUses.forEach(function (canIUseApi) {
  1683. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1684. canIUseApi;
  1685. if (!wx.canIUse(apiName)) {
  1686. protocols[canIUseApi] = false;
  1687. }
  1688. });
  1689. var uni = {};
  1690. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1691. uni = new Proxy({}, {
  1692. get: function get(target, name) {
  1693. if (hasOwn(target, name)) {
  1694. return target[name];
  1695. }
  1696. if (baseApi[name]) {
  1697. return baseApi[name];
  1698. }
  1699. if (api[name]) {
  1700. return promisify(name, api[name]);
  1701. }
  1702. {
  1703. if (extraApi[name]) {
  1704. return promisify(name, extraApi[name]);
  1705. }
  1706. if (todoApis[name]) {
  1707. return promisify(name, todoApis[name]);
  1708. }
  1709. }
  1710. if (eventApi[name]) {
  1711. return eventApi[name];
  1712. }
  1713. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1714. return;
  1715. }
  1716. return promisify(name, wrapper(name, wx[name]));
  1717. },
  1718. set: function set(target, name, value) {
  1719. target[name] = value;
  1720. return true;
  1721. } });
  1722. } else {
  1723. Object.keys(baseApi).forEach(function (name) {
  1724. uni[name] = baseApi[name];
  1725. });
  1726. {
  1727. Object.keys(todoApis).forEach(function (name) {
  1728. uni[name] = promisify(name, todoApis[name]);
  1729. });
  1730. Object.keys(extraApi).forEach(function (name) {
  1731. uni[name] = promisify(name, todoApis[name]);
  1732. });
  1733. }
  1734. Object.keys(eventApi).forEach(function (name) {
  1735. uni[name] = eventApi[name];
  1736. });
  1737. Object.keys(api).forEach(function (name) {
  1738. uni[name] = promisify(name, api[name]);
  1739. });
  1740. Object.keys(wx).forEach(function (name) {
  1741. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1742. uni[name] = promisify(name, wrapper(name, wx[name]));
  1743. }
  1744. });
  1745. }
  1746. wx.createApp = createApp;
  1747. wx.createPage = createPage;
  1748. wx.createComponent = createComponent;
  1749. wx.createSubpackageApp = createSubpackageApp;
  1750. wx.createPlugin = createPlugin;
  1751. var uni$1 = uni;var _default =
  1752. uni$1;exports.default = _default;
  1753. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  1754. /***/ }),
  1755. /* 2 */
  1756. /*!***********************************!*\
  1757. !*** (webpack)/buildin/global.js ***!
  1758. \***********************************/
  1759. /*! no static exports found */
  1760. /***/ (function(module, exports) {
  1761. var g;
  1762. // This works in non-strict mode
  1763. g = (function() {
  1764. return this;
  1765. })();
  1766. try {
  1767. // This works if eval is allowed (see CSP)
  1768. g = g || new Function("return this")();
  1769. } catch (e) {
  1770. // This works if the window reference is available
  1771. if (typeof window === "object") g = window;
  1772. }
  1773. // g can still be undefined, but nothing to do about it...
  1774. // We return undefined, instead of nothing here, so it's
  1775. // easier to handle this case. if(!global) { ...}
  1776. module.exports = g;
  1777. /***/ }),
  1778. /* 3 */
  1779. /*!******************************************************************************************!*\
  1780. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  1781. \******************************************************************************************/
  1782. /*! exports provided: default */
  1783. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1784. "use strict";
  1785. __webpack_require__.r(__webpack_exports__);
  1786. /* WEBPACK VAR INJECTION */(function(global) {/*!
  1787. * Vue.js v2.6.11
  1788. * (c) 2014-2021 Evan You
  1789. * Released under the MIT License.
  1790. */
  1791. /* */
  1792. var emptyObject = Object.freeze({});
  1793. // These helpers produce better VM code in JS engines due to their
  1794. // explicitness and function inlining.
  1795. function isUndef (v) {
  1796. return v === undefined || v === null
  1797. }
  1798. function isDef (v) {
  1799. return v !== undefined && v !== null
  1800. }
  1801. function isTrue (v) {
  1802. return v === true
  1803. }
  1804. function isFalse (v) {
  1805. return v === false
  1806. }
  1807. /**
  1808. * Check if value is primitive.
  1809. */
  1810. function isPrimitive (value) {
  1811. return (
  1812. typeof value === 'string' ||
  1813. typeof value === 'number' ||
  1814. // $flow-disable-line
  1815. typeof value === 'symbol' ||
  1816. typeof value === 'boolean'
  1817. )
  1818. }
  1819. /**
  1820. * Quick object check - this is primarily used to tell
  1821. * Objects from primitive values when we know the value
  1822. * is a JSON-compliant type.
  1823. */
  1824. function isObject (obj) {
  1825. return obj !== null && typeof obj === 'object'
  1826. }
  1827. /**
  1828. * Get the raw type string of a value, e.g., [object Object].
  1829. */
  1830. var _toString = Object.prototype.toString;
  1831. function toRawType (value) {
  1832. return _toString.call(value).slice(8, -1)
  1833. }
  1834. /**
  1835. * Strict object type check. Only returns true
  1836. * for plain JavaScript objects.
  1837. */
  1838. function isPlainObject (obj) {
  1839. return _toString.call(obj) === '[object Object]'
  1840. }
  1841. function isRegExp (v) {
  1842. return _toString.call(v) === '[object RegExp]'
  1843. }
  1844. /**
  1845. * Check if val is a valid array index.
  1846. */
  1847. function isValidArrayIndex (val) {
  1848. var n = parseFloat(String(val));
  1849. return n >= 0 && Math.floor(n) === n && isFinite(val)
  1850. }
  1851. function isPromise (val) {
  1852. return (
  1853. isDef(val) &&
  1854. typeof val.then === 'function' &&
  1855. typeof val.catch === 'function'
  1856. )
  1857. }
  1858. /**
  1859. * Convert a value to a string that is actually rendered.
  1860. */
  1861. function toString (val) {
  1862. return val == null
  1863. ? ''
  1864. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  1865. ? JSON.stringify(val, null, 2)
  1866. : String(val)
  1867. }
  1868. /**
  1869. * Convert an input value to a number for persistence.
  1870. * If the conversion fails, return original string.
  1871. */
  1872. function toNumber (val) {
  1873. var n = parseFloat(val);
  1874. return isNaN(n) ? val : n
  1875. }
  1876. /**
  1877. * Make a map and return a function for checking if a key
  1878. * is in that map.
  1879. */
  1880. function makeMap (
  1881. str,
  1882. expectsLowerCase
  1883. ) {
  1884. var map = Object.create(null);
  1885. var list = str.split(',');
  1886. for (var i = 0; i < list.length; i++) {
  1887. map[list[i]] = true;
  1888. }
  1889. return expectsLowerCase
  1890. ? function (val) { return map[val.toLowerCase()]; }
  1891. : function (val) { return map[val]; }
  1892. }
  1893. /**
  1894. * Check if a tag is a built-in tag.
  1895. */
  1896. var isBuiltInTag = makeMap('slot,component', true);
  1897. /**
  1898. * Check if an attribute is a reserved attribute.
  1899. */
  1900. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  1901. /**
  1902. * Remove an item from an array.
  1903. */
  1904. function remove (arr, item) {
  1905. if (arr.length) {
  1906. var index = arr.indexOf(item);
  1907. if (index > -1) {
  1908. return arr.splice(index, 1)
  1909. }
  1910. }
  1911. }
  1912. /**
  1913. * Check whether an object has the property.
  1914. */
  1915. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1916. function hasOwn (obj, key) {
  1917. return hasOwnProperty.call(obj, key)
  1918. }
  1919. /**
  1920. * Create a cached version of a pure function.
  1921. */
  1922. function cached (fn) {
  1923. var cache = Object.create(null);
  1924. return (function cachedFn (str) {
  1925. var hit = cache[str];
  1926. return hit || (cache[str] = fn(str))
  1927. })
  1928. }
  1929. /**
  1930. * Camelize a hyphen-delimited string.
  1931. */
  1932. var camelizeRE = /-(\w)/g;
  1933. var camelize = cached(function (str) {
  1934. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  1935. });
  1936. /**
  1937. * Capitalize a string.
  1938. */
  1939. var capitalize = cached(function (str) {
  1940. return str.charAt(0).toUpperCase() + str.slice(1)
  1941. });
  1942. /**
  1943. * Hyphenate a camelCase string.
  1944. */
  1945. var hyphenateRE = /\B([A-Z])/g;
  1946. var hyphenate = cached(function (str) {
  1947. return str.replace(hyphenateRE, '-$1').toLowerCase()
  1948. });
  1949. /**
  1950. * Simple bind polyfill for environments that do not support it,
  1951. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  1952. * since native bind is now performant enough in most browsers.
  1953. * But removing it would mean breaking code that was able to run in
  1954. * PhantomJS 1.x, so this must be kept for backward compatibility.
  1955. */
  1956. /* istanbul ignore next */
  1957. function polyfillBind (fn, ctx) {
  1958. function boundFn (a) {
  1959. var l = arguments.length;
  1960. return l
  1961. ? l > 1
  1962. ? fn.apply(ctx, arguments)
  1963. : fn.call(ctx, a)
  1964. : fn.call(ctx)
  1965. }
  1966. boundFn._length = fn.length;
  1967. return boundFn
  1968. }
  1969. function nativeBind (fn, ctx) {
  1970. return fn.bind(ctx)
  1971. }
  1972. var bind = Function.prototype.bind
  1973. ? nativeBind
  1974. : polyfillBind;
  1975. /**
  1976. * Convert an Array-like object to a real Array.
  1977. */
  1978. function toArray (list, start) {
  1979. start = start || 0;
  1980. var i = list.length - start;
  1981. var ret = new Array(i);
  1982. while (i--) {
  1983. ret[i] = list[i + start];
  1984. }
  1985. return ret
  1986. }
  1987. /**
  1988. * Mix properties into target object.
  1989. */
  1990. function extend (to, _from) {
  1991. for (var key in _from) {
  1992. to[key] = _from[key];
  1993. }
  1994. return to
  1995. }
  1996. /**
  1997. * Merge an Array of Objects into a single Object.
  1998. */
  1999. function toObject (arr) {
  2000. var res = {};
  2001. for (var i = 0; i < arr.length; i++) {
  2002. if (arr[i]) {
  2003. extend(res, arr[i]);
  2004. }
  2005. }
  2006. return res
  2007. }
  2008. /* eslint-disable no-unused-vars */
  2009. /**
  2010. * Perform no operation.
  2011. * Stubbing args to make Flow happy without leaving useless transpiled code
  2012. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  2013. */
  2014. function noop (a, b, c) {}
  2015. /**
  2016. * Always return false.
  2017. */
  2018. var no = function (a, b, c) { return false; };
  2019. /* eslint-enable no-unused-vars */
  2020. /**
  2021. * Return the same value.
  2022. */
  2023. var identity = function (_) { return _; };
  2024. /**
  2025. * Check if two values are loosely equal - that is,
  2026. * if they are plain objects, do they have the same shape?
  2027. */
  2028. function looseEqual (a, b) {
  2029. if (a === b) { return true }
  2030. var isObjectA = isObject(a);
  2031. var isObjectB = isObject(b);
  2032. if (isObjectA && isObjectB) {
  2033. try {
  2034. var isArrayA = Array.isArray(a);
  2035. var isArrayB = Array.isArray(b);
  2036. if (isArrayA && isArrayB) {
  2037. return a.length === b.length && a.every(function (e, i) {
  2038. return looseEqual(e, b[i])
  2039. })
  2040. } else if (a instanceof Date && b instanceof Date) {
  2041. return a.getTime() === b.getTime()
  2042. } else if (!isArrayA && !isArrayB) {
  2043. var keysA = Object.keys(a);
  2044. var keysB = Object.keys(b);
  2045. return keysA.length === keysB.length && keysA.every(function (key) {
  2046. return looseEqual(a[key], b[key])
  2047. })
  2048. } else {
  2049. /* istanbul ignore next */
  2050. return false
  2051. }
  2052. } catch (e) {
  2053. /* istanbul ignore next */
  2054. return false
  2055. }
  2056. } else if (!isObjectA && !isObjectB) {
  2057. return String(a) === String(b)
  2058. } else {
  2059. return false
  2060. }
  2061. }
  2062. /**
  2063. * Return the first index at which a loosely equal value can be
  2064. * found in the array (if value is a plain object, the array must
  2065. * contain an object of the same shape), or -1 if it is not present.
  2066. */
  2067. function looseIndexOf (arr, val) {
  2068. for (var i = 0; i < arr.length; i++) {
  2069. if (looseEqual(arr[i], val)) { return i }
  2070. }
  2071. return -1
  2072. }
  2073. /**
  2074. * Ensure a function is called only once.
  2075. */
  2076. function once (fn) {
  2077. var called = false;
  2078. return function () {
  2079. if (!called) {
  2080. called = true;
  2081. fn.apply(this, arguments);
  2082. }
  2083. }
  2084. }
  2085. var ASSET_TYPES = [
  2086. 'component',
  2087. 'directive',
  2088. 'filter'
  2089. ];
  2090. var LIFECYCLE_HOOKS = [
  2091. 'beforeCreate',
  2092. 'created',
  2093. 'beforeMount',
  2094. 'mounted',
  2095. 'beforeUpdate',
  2096. 'updated',
  2097. 'beforeDestroy',
  2098. 'destroyed',
  2099. 'activated',
  2100. 'deactivated',
  2101. 'errorCaptured',
  2102. 'serverPrefetch'
  2103. ];
  2104. /* */
  2105. var config = ({
  2106. /**
  2107. * Option merge strategies (used in core/util/options)
  2108. */
  2109. // $flow-disable-line
  2110. optionMergeStrategies: Object.create(null),
  2111. /**
  2112. * Whether to suppress warnings.
  2113. */
  2114. silent: false,
  2115. /**
  2116. * Show production mode tip message on boot?
  2117. */
  2118. productionTip: "development" !== 'production',
  2119. /**
  2120. * Whether to enable devtools
  2121. */
  2122. devtools: "development" !== 'production',
  2123. /**
  2124. * Whether to record perf
  2125. */
  2126. performance: false,
  2127. /**
  2128. * Error handler for watcher errors
  2129. */
  2130. errorHandler: null,
  2131. /**
  2132. * Warn handler for watcher warns
  2133. */
  2134. warnHandler: null,
  2135. /**
  2136. * Ignore certain custom elements
  2137. */
  2138. ignoredElements: [],
  2139. /**
  2140. * Custom user key aliases for v-on
  2141. */
  2142. // $flow-disable-line
  2143. keyCodes: Object.create(null),
  2144. /**
  2145. * Check if a tag is reserved so that it cannot be registered as a
  2146. * component. This is platform-dependent and may be overwritten.
  2147. */
  2148. isReservedTag: no,
  2149. /**
  2150. * Check if an attribute is reserved so that it cannot be used as a component
  2151. * prop. This is platform-dependent and may be overwritten.
  2152. */
  2153. isReservedAttr: no,
  2154. /**
  2155. * Check if a tag is an unknown element.
  2156. * Platform-dependent.
  2157. */
  2158. isUnknownElement: no,
  2159. /**
  2160. * Get the namespace of an element
  2161. */
  2162. getTagNamespace: noop,
  2163. /**
  2164. * Parse the real tag name for the specific platform.
  2165. */
  2166. parsePlatformTagName: identity,
  2167. /**
  2168. * Check if an attribute must be bound using property, e.g. value
  2169. * Platform-dependent.
  2170. */
  2171. mustUseProp: no,
  2172. /**
  2173. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  2174. * This will significantly reduce performance if set to false.
  2175. */
  2176. async: true,
  2177. /**
  2178. * Exposed for legacy reasons
  2179. */
  2180. _lifecycleHooks: LIFECYCLE_HOOKS
  2181. });
  2182. /* */
  2183. /**
  2184. * unicode letters used for parsing html tags, component names and property paths.
  2185. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  2186. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  2187. */
  2188. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  2189. /**
  2190. * Check if a string starts with $ or _
  2191. */
  2192. function isReserved (str) {
  2193. var c = (str + '').charCodeAt(0);
  2194. return c === 0x24 || c === 0x5F
  2195. }
  2196. /**
  2197. * Define a property.
  2198. */
  2199. function def (obj, key, val, enumerable) {
  2200. Object.defineProperty(obj, key, {
  2201. value: val,
  2202. enumerable: !!enumerable,
  2203. writable: true,
  2204. configurable: true
  2205. });
  2206. }
  2207. /**
  2208. * Parse simple path.
  2209. */
  2210. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  2211. function parsePath (path) {
  2212. if (bailRE.test(path)) {
  2213. return
  2214. }
  2215. var segments = path.split('.');
  2216. return function (obj) {
  2217. for (var i = 0; i < segments.length; i++) {
  2218. if (!obj) { return }
  2219. obj = obj[segments[i]];
  2220. }
  2221. return obj
  2222. }
  2223. }
  2224. /* */
  2225. // can we use __proto__?
  2226. var hasProto = '__proto__' in {};
  2227. // Browser environment sniffing
  2228. var inBrowser = typeof window !== 'undefined';
  2229. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  2230. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  2231. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  2232. var isIE = UA && /msie|trident/.test(UA);
  2233. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  2234. var isEdge = UA && UA.indexOf('edge/') > 0;
  2235. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  2236. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  2237. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  2238. var isPhantomJS = UA && /phantomjs/.test(UA);
  2239. var isFF = UA && UA.match(/firefox\/(\d+)/);
  2240. // Firefox has a "watch" function on Object.prototype...
  2241. var nativeWatch = ({}).watch;
  2242. if (inBrowser) {
  2243. try {
  2244. var opts = {};
  2245. Object.defineProperty(opts, 'passive', ({
  2246. get: function get () {
  2247. }
  2248. })); // https://github.com/facebook/flow/issues/285
  2249. window.addEventListener('test-passive', null, opts);
  2250. } catch (e) {}
  2251. }
  2252. // this needs to be lazy-evaled because vue may be required before
  2253. // vue-server-renderer can set VUE_ENV
  2254. var _isServer;
  2255. var isServerRendering = function () {
  2256. if (_isServer === undefined) {
  2257. /* istanbul ignore if */
  2258. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  2259. // detect presence of vue-server-renderer and avoid
  2260. // Webpack shimming the process
  2261. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  2262. } else {
  2263. _isServer = false;
  2264. }
  2265. }
  2266. return _isServer
  2267. };
  2268. // detect devtools
  2269. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  2270. /* istanbul ignore next */
  2271. function isNative (Ctor) {
  2272. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  2273. }
  2274. var hasSymbol =
  2275. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  2276. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  2277. var _Set;
  2278. /* istanbul ignore if */ // $flow-disable-line
  2279. if (typeof Set !== 'undefined' && isNative(Set)) {
  2280. // use native Set when available.
  2281. _Set = Set;
  2282. } else {
  2283. // a non-standard Set polyfill that only works with primitive keys.
  2284. _Set = /*@__PURE__*/(function () {
  2285. function Set () {
  2286. this.set = Object.create(null);
  2287. }
  2288. Set.prototype.has = function has (key) {
  2289. return this.set[key] === true
  2290. };
  2291. Set.prototype.add = function add (key) {
  2292. this.set[key] = true;
  2293. };
  2294. Set.prototype.clear = function clear () {
  2295. this.set = Object.create(null);
  2296. };
  2297. return Set;
  2298. }());
  2299. }
  2300. /* */
  2301. var warn = noop;
  2302. var tip = noop;
  2303. var generateComponentTrace = (noop); // work around flow check
  2304. var formatComponentName = (noop);
  2305. if (true) {
  2306. var hasConsole = typeof console !== 'undefined';
  2307. var classifyRE = /(?:^|[-_])(\w)/g;
  2308. var classify = function (str) { return str
  2309. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  2310. .replace(/[-_]/g, ''); };
  2311. warn = function (msg, vm) {
  2312. var trace = vm ? generateComponentTrace(vm) : '';
  2313. if (config.warnHandler) {
  2314. config.warnHandler.call(null, msg, vm, trace);
  2315. } else if (hasConsole && (!config.silent)) {
  2316. console.error(("[Vue warn]: " + msg + trace));
  2317. }
  2318. };
  2319. tip = function (msg, vm) {
  2320. if (hasConsole && (!config.silent)) {
  2321. console.warn("[Vue tip]: " + msg + (
  2322. vm ? generateComponentTrace(vm) : ''
  2323. ));
  2324. }
  2325. };
  2326. formatComponentName = function (vm, includeFile) {
  2327. if (vm.$root === vm) {
  2328. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  2329. return ('') + vm.$options.__file
  2330. }
  2331. return '<Root>'
  2332. }
  2333. var options = typeof vm === 'function' && vm.cid != null
  2334. ? vm.options
  2335. : vm._isVue
  2336. ? vm.$options || vm.constructor.options
  2337. : vm;
  2338. var name = options.name || options._componentTag;
  2339. var file = options.__file;
  2340. if (!name && file) {
  2341. var match = file.match(/([^/\\]+)\.vue$/);
  2342. name = match && match[1];
  2343. }
  2344. return (
  2345. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  2346. (file && includeFile !== false ? (" at " + file) : '')
  2347. )
  2348. };
  2349. var repeat = function (str, n) {
  2350. var res = '';
  2351. while (n) {
  2352. if (n % 2 === 1) { res += str; }
  2353. if (n > 1) { str += str; }
  2354. n >>= 1;
  2355. }
  2356. return res
  2357. };
  2358. generateComponentTrace = function (vm) {
  2359. if (vm._isVue && vm.$parent) {
  2360. var tree = [];
  2361. var currentRecursiveSequence = 0;
  2362. while (vm && vm.$options.name !== 'PageBody') {
  2363. if (tree.length > 0) {
  2364. var last = tree[tree.length - 1];
  2365. if (last.constructor === vm.constructor) {
  2366. currentRecursiveSequence++;
  2367. vm = vm.$parent;
  2368. continue
  2369. } else if (currentRecursiveSequence > 0) {
  2370. tree[tree.length - 1] = [last, currentRecursiveSequence];
  2371. currentRecursiveSequence = 0;
  2372. }
  2373. }
  2374. !vm.$options.isReserved && tree.push(vm);
  2375. vm = vm.$parent;
  2376. }
  2377. return '\n\nfound in\n\n' + tree
  2378. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  2379. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  2380. : formatComponentName(vm))); })
  2381. .join('\n')
  2382. } else {
  2383. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  2384. }
  2385. };
  2386. }
  2387. /* */
  2388. var uid = 0;
  2389. /**
  2390. * A dep is an observable that can have multiple
  2391. * directives subscribing to it.
  2392. */
  2393. var Dep = function Dep () {
  2394. this.id = uid++;
  2395. this.subs = [];
  2396. };
  2397. Dep.prototype.addSub = function addSub (sub) {
  2398. this.subs.push(sub);
  2399. };
  2400. Dep.prototype.removeSub = function removeSub (sub) {
  2401. remove(this.subs, sub);
  2402. };
  2403. Dep.prototype.depend = function depend () {
  2404. if (Dep.SharedObject.target) {
  2405. Dep.SharedObject.target.addDep(this);
  2406. }
  2407. };
  2408. Dep.prototype.notify = function notify () {
  2409. // stabilize the subscriber list first
  2410. var subs = this.subs.slice();
  2411. if ( true && !config.async) {
  2412. // subs aren't sorted in scheduler if not running async
  2413. // we need to sort them now to make sure they fire in correct
  2414. // order
  2415. subs.sort(function (a, b) { return a.id - b.id; });
  2416. }
  2417. for (var i = 0, l = subs.length; i < l; i++) {
  2418. subs[i].update();
  2419. }
  2420. };
  2421. // The current target watcher being evaluated.
  2422. // This is globally unique because only one watcher
  2423. // can be evaluated at a time.
  2424. // fixed by xxxxxx (nvue shared vuex)
  2425. /* eslint-disable no-undef */
  2426. Dep.SharedObject = {};
  2427. Dep.SharedObject.target = null;
  2428. Dep.SharedObject.targetStack = [];
  2429. function pushTarget (target) {
  2430. Dep.SharedObject.targetStack.push(target);
  2431. Dep.SharedObject.target = target;
  2432. Dep.target = target;
  2433. }
  2434. function popTarget () {
  2435. Dep.SharedObject.targetStack.pop();
  2436. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  2437. Dep.target = Dep.SharedObject.target;
  2438. }
  2439. /* */
  2440. var VNode = function VNode (
  2441. tag,
  2442. data,
  2443. children,
  2444. text,
  2445. elm,
  2446. context,
  2447. componentOptions,
  2448. asyncFactory
  2449. ) {
  2450. this.tag = tag;
  2451. this.data = data;
  2452. this.children = children;
  2453. this.text = text;
  2454. this.elm = elm;
  2455. this.ns = undefined;
  2456. this.context = context;
  2457. this.fnContext = undefined;
  2458. this.fnOptions = undefined;
  2459. this.fnScopeId = undefined;
  2460. this.key = data && data.key;
  2461. this.componentOptions = componentOptions;
  2462. this.componentInstance = undefined;
  2463. this.parent = undefined;
  2464. this.raw = false;
  2465. this.isStatic = false;
  2466. this.isRootInsert = true;
  2467. this.isComment = false;
  2468. this.isCloned = false;
  2469. this.isOnce = false;
  2470. this.asyncFactory = asyncFactory;
  2471. this.asyncMeta = undefined;
  2472. this.isAsyncPlaceholder = false;
  2473. };
  2474. var prototypeAccessors = { child: { configurable: true } };
  2475. // DEPRECATED: alias for componentInstance for backwards compat.
  2476. /* istanbul ignore next */
  2477. prototypeAccessors.child.get = function () {
  2478. return this.componentInstance
  2479. };
  2480. Object.defineProperties( VNode.prototype, prototypeAccessors );
  2481. var createEmptyVNode = function (text) {
  2482. if ( text === void 0 ) text = '';
  2483. var node = new VNode();
  2484. node.text = text;
  2485. node.isComment = true;
  2486. return node
  2487. };
  2488. function createTextVNode (val) {
  2489. return new VNode(undefined, undefined, undefined, String(val))
  2490. }
  2491. // optimized shallow clone
  2492. // used for static nodes and slot nodes because they may be reused across
  2493. // multiple renders, cloning them avoids errors when DOM manipulations rely
  2494. // on their elm reference.
  2495. function cloneVNode (vnode) {
  2496. var cloned = new VNode(
  2497. vnode.tag,
  2498. vnode.data,
  2499. // #7975
  2500. // clone children array to avoid mutating original in case of cloning
  2501. // a child.
  2502. vnode.children && vnode.children.slice(),
  2503. vnode.text,
  2504. vnode.elm,
  2505. vnode.context,
  2506. vnode.componentOptions,
  2507. vnode.asyncFactory
  2508. );
  2509. cloned.ns = vnode.ns;
  2510. cloned.isStatic = vnode.isStatic;
  2511. cloned.key = vnode.key;
  2512. cloned.isComment = vnode.isComment;
  2513. cloned.fnContext = vnode.fnContext;
  2514. cloned.fnOptions = vnode.fnOptions;
  2515. cloned.fnScopeId = vnode.fnScopeId;
  2516. cloned.asyncMeta = vnode.asyncMeta;
  2517. cloned.isCloned = true;
  2518. return cloned
  2519. }
  2520. /*
  2521. * not type checking this file because flow doesn't play well with
  2522. * dynamically accessing methods on Array prototype
  2523. */
  2524. var arrayProto = Array.prototype;
  2525. var arrayMethods = Object.create(arrayProto);
  2526. var methodsToPatch = [
  2527. 'push',
  2528. 'pop',
  2529. 'shift',
  2530. 'unshift',
  2531. 'splice',
  2532. 'sort',
  2533. 'reverse'
  2534. ];
  2535. /**
  2536. * Intercept mutating methods and emit events
  2537. */
  2538. methodsToPatch.forEach(function (method) {
  2539. // cache original method
  2540. var original = arrayProto[method];
  2541. def(arrayMethods, method, function mutator () {
  2542. var args = [], len = arguments.length;
  2543. while ( len-- ) args[ len ] = arguments[ len ];
  2544. var result = original.apply(this, args);
  2545. var ob = this.__ob__;
  2546. var inserted;
  2547. switch (method) {
  2548. case 'push':
  2549. case 'unshift':
  2550. inserted = args;
  2551. break
  2552. case 'splice':
  2553. inserted = args.slice(2);
  2554. break
  2555. }
  2556. if (inserted) { ob.observeArray(inserted); }
  2557. // notify change
  2558. ob.dep.notify();
  2559. return result
  2560. });
  2561. });
  2562. /* */
  2563. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  2564. /**
  2565. * In some cases we may want to disable observation inside a component's
  2566. * update computation.
  2567. */
  2568. var shouldObserve = true;
  2569. function toggleObserving (value) {
  2570. shouldObserve = value;
  2571. }
  2572. /**
  2573. * Observer class that is attached to each observed
  2574. * object. Once attached, the observer converts the target
  2575. * object's property keys into getter/setters that
  2576. * collect dependencies and dispatch updates.
  2577. */
  2578. var Observer = function Observer (value) {
  2579. this.value = value;
  2580. this.dep = new Dep();
  2581. this.vmCount = 0;
  2582. def(value, '__ob__', this);
  2583. if (Array.isArray(value)) {
  2584. if (hasProto) {
  2585. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  2586. if(value.push !== value.__proto__.push){
  2587. copyAugment(value, arrayMethods, arrayKeys);
  2588. } else {
  2589. protoAugment(value, arrayMethods);
  2590. }
  2591. }
  2592. } else {
  2593. copyAugment(value, arrayMethods, arrayKeys);
  2594. }
  2595. this.observeArray(value);
  2596. } else {
  2597. this.walk(value);
  2598. }
  2599. };
  2600. /**
  2601. * Walk through all properties and convert them into
  2602. * getter/setters. This method should only be called when
  2603. * value type is Object.
  2604. */
  2605. Observer.prototype.walk = function walk (obj) {
  2606. var keys = Object.keys(obj);
  2607. for (var i = 0; i < keys.length; i++) {
  2608. defineReactive$$1(obj, keys[i]);
  2609. }
  2610. };
  2611. /**
  2612. * Observe a list of Array items.
  2613. */
  2614. Observer.prototype.observeArray = function observeArray (items) {
  2615. for (var i = 0, l = items.length; i < l; i++) {
  2616. observe(items[i]);
  2617. }
  2618. };
  2619. // helpers
  2620. /**
  2621. * Augment a target Object or Array by intercepting
  2622. * the prototype chain using __proto__
  2623. */
  2624. function protoAugment (target, src) {
  2625. /* eslint-disable no-proto */
  2626. target.__proto__ = src;
  2627. /* eslint-enable no-proto */
  2628. }
  2629. /**
  2630. * Augment a target Object or Array by defining
  2631. * hidden properties.
  2632. */
  2633. /* istanbul ignore next */
  2634. function copyAugment (target, src, keys) {
  2635. for (var i = 0, l = keys.length; i < l; i++) {
  2636. var key = keys[i];
  2637. def(target, key, src[key]);
  2638. }
  2639. }
  2640. /**
  2641. * Attempt to create an observer instance for a value,
  2642. * returns the new observer if successfully observed,
  2643. * or the existing observer if the value already has one.
  2644. */
  2645. function observe (value, asRootData) {
  2646. if (!isObject(value) || value instanceof VNode) {
  2647. return
  2648. }
  2649. var ob;
  2650. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  2651. ob = value.__ob__;
  2652. } else if (
  2653. shouldObserve &&
  2654. !isServerRendering() &&
  2655. (Array.isArray(value) || isPlainObject(value)) &&
  2656. Object.isExtensible(value) &&
  2657. !value._isVue
  2658. ) {
  2659. ob = new Observer(value);
  2660. }
  2661. if (asRootData && ob) {
  2662. ob.vmCount++;
  2663. }
  2664. return ob
  2665. }
  2666. /**
  2667. * Define a reactive property on an Object.
  2668. */
  2669. function defineReactive$$1 (
  2670. obj,
  2671. key,
  2672. val,
  2673. customSetter,
  2674. shallow
  2675. ) {
  2676. var dep = new Dep();
  2677. var property = Object.getOwnPropertyDescriptor(obj, key);
  2678. if (property && property.configurable === false) {
  2679. return
  2680. }
  2681. // cater for pre-defined getter/setters
  2682. var getter = property && property.get;
  2683. var setter = property && property.set;
  2684. if ((!getter || setter) && arguments.length === 2) {
  2685. val = obj[key];
  2686. }
  2687. var childOb = !shallow && observe(val);
  2688. Object.defineProperty(obj, key, {
  2689. enumerable: true,
  2690. configurable: true,
  2691. get: function reactiveGetter () {
  2692. var value = getter ? getter.call(obj) : val;
  2693. if (Dep.SharedObject.target) { // fixed by xxxxxx
  2694. dep.depend();
  2695. if (childOb) {
  2696. childOb.dep.depend();
  2697. if (Array.isArray(value)) {
  2698. dependArray(value);
  2699. }
  2700. }
  2701. }
  2702. return value
  2703. },
  2704. set: function reactiveSetter (newVal) {
  2705. var value = getter ? getter.call(obj) : val;
  2706. /* eslint-disable no-self-compare */
  2707. if (newVal === value || (newVal !== newVal && value !== value)) {
  2708. return
  2709. }
  2710. /* eslint-enable no-self-compare */
  2711. if ( true && customSetter) {
  2712. customSetter();
  2713. }
  2714. // #7981: for accessor properties without setter
  2715. if (getter && !setter) { return }
  2716. if (setter) {
  2717. setter.call(obj, newVal);
  2718. } else {
  2719. val = newVal;
  2720. }
  2721. childOb = !shallow && observe(newVal);
  2722. dep.notify();
  2723. }
  2724. });
  2725. }
  2726. /**
  2727. * Set a property on an object. Adds the new property and
  2728. * triggers change notification if the property doesn't
  2729. * already exist.
  2730. */
  2731. function set (target, key, val) {
  2732. if ( true &&
  2733. (isUndef(target) || isPrimitive(target))
  2734. ) {
  2735. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  2736. }
  2737. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2738. target.length = Math.max(target.length, key);
  2739. target.splice(key, 1, val);
  2740. return val
  2741. }
  2742. if (key in target && !(key in Object.prototype)) {
  2743. target[key] = val;
  2744. return val
  2745. }
  2746. var ob = (target).__ob__;
  2747. if (target._isVue || (ob && ob.vmCount)) {
  2748. true && warn(
  2749. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  2750. 'at runtime - declare it upfront in the data option.'
  2751. );
  2752. return val
  2753. }
  2754. if (!ob) {
  2755. target[key] = val;
  2756. return val
  2757. }
  2758. defineReactive$$1(ob.value, key, val);
  2759. ob.dep.notify();
  2760. return val
  2761. }
  2762. /**
  2763. * Delete a property and trigger change if necessary.
  2764. */
  2765. function del (target, key) {
  2766. if ( true &&
  2767. (isUndef(target) || isPrimitive(target))
  2768. ) {
  2769. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  2770. }
  2771. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2772. target.splice(key, 1);
  2773. return
  2774. }
  2775. var ob = (target).__ob__;
  2776. if (target._isVue || (ob && ob.vmCount)) {
  2777. true && warn(
  2778. 'Avoid deleting properties on a Vue instance or its root $data ' +
  2779. '- just set it to null.'
  2780. );
  2781. return
  2782. }
  2783. if (!hasOwn(target, key)) {
  2784. return
  2785. }
  2786. delete target[key];
  2787. if (!ob) {
  2788. return
  2789. }
  2790. ob.dep.notify();
  2791. }
  2792. /**
  2793. * Collect dependencies on array elements when the array is touched, since
  2794. * we cannot intercept array element access like property getters.
  2795. */
  2796. function dependArray (value) {
  2797. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  2798. e = value[i];
  2799. e && e.__ob__ && e.__ob__.dep.depend();
  2800. if (Array.isArray(e)) {
  2801. dependArray(e);
  2802. }
  2803. }
  2804. }
  2805. /* */
  2806. /**
  2807. * Option overwriting strategies are functions that handle
  2808. * how to merge a parent option value and a child option
  2809. * value into the final value.
  2810. */
  2811. var strats = config.optionMergeStrategies;
  2812. /**
  2813. * Options with restrictions
  2814. */
  2815. if (true) {
  2816. strats.el = strats.propsData = function (parent, child, vm, key) {
  2817. if (!vm) {
  2818. warn(
  2819. "option \"" + key + "\" can only be used during instance " +
  2820. 'creation with the `new` keyword.'
  2821. );
  2822. }
  2823. return defaultStrat(parent, child)
  2824. };
  2825. }
  2826. /**
  2827. * Helper that recursively merges two data objects together.
  2828. */
  2829. function mergeData (to, from) {
  2830. if (!from) { return to }
  2831. var key, toVal, fromVal;
  2832. var keys = hasSymbol
  2833. ? Reflect.ownKeys(from)
  2834. : Object.keys(from);
  2835. for (var i = 0; i < keys.length; i++) {
  2836. key = keys[i];
  2837. // in case the object is already observed...
  2838. if (key === '__ob__') { continue }
  2839. toVal = to[key];
  2840. fromVal = from[key];
  2841. if (!hasOwn(to, key)) {
  2842. set(to, key, fromVal);
  2843. } else if (
  2844. toVal !== fromVal &&
  2845. isPlainObject(toVal) &&
  2846. isPlainObject(fromVal)
  2847. ) {
  2848. mergeData(toVal, fromVal);
  2849. }
  2850. }
  2851. return to
  2852. }
  2853. /**
  2854. * Data
  2855. */
  2856. function mergeDataOrFn (
  2857. parentVal,
  2858. childVal,
  2859. vm
  2860. ) {
  2861. if (!vm) {
  2862. // in a Vue.extend merge, both should be functions
  2863. if (!childVal) {
  2864. return parentVal
  2865. }
  2866. if (!parentVal) {
  2867. return childVal
  2868. }
  2869. // when parentVal & childVal are both present,
  2870. // we need to return a function that returns the
  2871. // merged result of both functions... no need to
  2872. // check if parentVal is a function here because
  2873. // it has to be a function to pass previous merges.
  2874. return function mergedDataFn () {
  2875. return mergeData(
  2876. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  2877. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  2878. )
  2879. }
  2880. } else {
  2881. return function mergedInstanceDataFn () {
  2882. // instance merge
  2883. var instanceData = typeof childVal === 'function'
  2884. ? childVal.call(vm, vm)
  2885. : childVal;
  2886. var defaultData = typeof parentVal === 'function'
  2887. ? parentVal.call(vm, vm)
  2888. : parentVal;
  2889. if (instanceData) {
  2890. return mergeData(instanceData, defaultData)
  2891. } else {
  2892. return defaultData
  2893. }
  2894. }
  2895. }
  2896. }
  2897. strats.data = function (
  2898. parentVal,
  2899. childVal,
  2900. vm
  2901. ) {
  2902. if (!vm) {
  2903. if (childVal && typeof childVal !== 'function') {
  2904. true && warn(
  2905. 'The "data" option should be a function ' +
  2906. 'that returns a per-instance value in component ' +
  2907. 'definitions.',
  2908. vm
  2909. );
  2910. return parentVal
  2911. }
  2912. return mergeDataOrFn(parentVal, childVal)
  2913. }
  2914. return mergeDataOrFn(parentVal, childVal, vm)
  2915. };
  2916. /**
  2917. * Hooks and props are merged as arrays.
  2918. */
  2919. function mergeHook (
  2920. parentVal,
  2921. childVal
  2922. ) {
  2923. var res = childVal
  2924. ? parentVal
  2925. ? parentVal.concat(childVal)
  2926. : Array.isArray(childVal)
  2927. ? childVal
  2928. : [childVal]
  2929. : parentVal;
  2930. return res
  2931. ? dedupeHooks(res)
  2932. : res
  2933. }
  2934. function dedupeHooks (hooks) {
  2935. var res = [];
  2936. for (var i = 0; i < hooks.length; i++) {
  2937. if (res.indexOf(hooks[i]) === -1) {
  2938. res.push(hooks[i]);
  2939. }
  2940. }
  2941. return res
  2942. }
  2943. LIFECYCLE_HOOKS.forEach(function (hook) {
  2944. strats[hook] = mergeHook;
  2945. });
  2946. /**
  2947. * Assets
  2948. *
  2949. * When a vm is present (instance creation), we need to do
  2950. * a three-way merge between constructor options, instance
  2951. * options and parent options.
  2952. */
  2953. function mergeAssets (
  2954. parentVal,
  2955. childVal,
  2956. vm,
  2957. key
  2958. ) {
  2959. var res = Object.create(parentVal || null);
  2960. if (childVal) {
  2961. true && assertObjectType(key, childVal, vm);
  2962. return extend(res, childVal)
  2963. } else {
  2964. return res
  2965. }
  2966. }
  2967. ASSET_TYPES.forEach(function (type) {
  2968. strats[type + 's'] = mergeAssets;
  2969. });
  2970. /**
  2971. * Watchers.
  2972. *
  2973. * Watchers hashes should not overwrite one
  2974. * another, so we merge them as arrays.
  2975. */
  2976. strats.watch = function (
  2977. parentVal,
  2978. childVal,
  2979. vm,
  2980. key
  2981. ) {
  2982. // work around Firefox's Object.prototype.watch...
  2983. if (parentVal === nativeWatch) { parentVal = undefined; }
  2984. if (childVal === nativeWatch) { childVal = undefined; }
  2985. /* istanbul ignore if */
  2986. if (!childVal) { return Object.create(parentVal || null) }
  2987. if (true) {
  2988. assertObjectType(key, childVal, vm);
  2989. }
  2990. if (!parentVal) { return childVal }
  2991. var ret = {};
  2992. extend(ret, parentVal);
  2993. for (var key$1 in childVal) {
  2994. var parent = ret[key$1];
  2995. var child = childVal[key$1];
  2996. if (parent && !Array.isArray(parent)) {
  2997. parent = [parent];
  2998. }
  2999. ret[key$1] = parent
  3000. ? parent.concat(child)
  3001. : Array.isArray(child) ? child : [child];
  3002. }
  3003. return ret
  3004. };
  3005. /**
  3006. * Other object hashes.
  3007. */
  3008. strats.props =
  3009. strats.methods =
  3010. strats.inject =
  3011. strats.computed = function (
  3012. parentVal,
  3013. childVal,
  3014. vm,
  3015. key
  3016. ) {
  3017. if (childVal && "development" !== 'production') {
  3018. assertObjectType(key, childVal, vm);
  3019. }
  3020. if (!parentVal) { return childVal }
  3021. var ret = Object.create(null);
  3022. extend(ret, parentVal);
  3023. if (childVal) { extend(ret, childVal); }
  3024. return ret
  3025. };
  3026. strats.provide = mergeDataOrFn;
  3027. /**
  3028. * Default strategy.
  3029. */
  3030. var defaultStrat = function (parentVal, childVal) {
  3031. return childVal === undefined
  3032. ? parentVal
  3033. : childVal
  3034. };
  3035. /**
  3036. * Validate component names
  3037. */
  3038. function checkComponents (options) {
  3039. for (var key in options.components) {
  3040. validateComponentName(key);
  3041. }
  3042. }
  3043. function validateComponentName (name) {
  3044. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  3045. warn(
  3046. 'Invalid component name: "' + name + '". Component names ' +
  3047. 'should conform to valid custom element name in html5 specification.'
  3048. );
  3049. }
  3050. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  3051. warn(
  3052. 'Do not use built-in or reserved HTML elements as component ' +
  3053. 'id: ' + name
  3054. );
  3055. }
  3056. }
  3057. /**
  3058. * Ensure all props option syntax are normalized into the
  3059. * Object-based format.
  3060. */
  3061. function normalizeProps (options, vm) {
  3062. var props = options.props;
  3063. if (!props) { return }
  3064. var res = {};
  3065. var i, val, name;
  3066. if (Array.isArray(props)) {
  3067. i = props.length;
  3068. while (i--) {
  3069. val = props[i];
  3070. if (typeof val === 'string') {
  3071. name = camelize(val);
  3072. res[name] = { type: null };
  3073. } else if (true) {
  3074. warn('props must be strings when using array syntax.');
  3075. }
  3076. }
  3077. } else if (isPlainObject(props)) {
  3078. for (var key in props) {
  3079. val = props[key];
  3080. name = camelize(key);
  3081. res[name] = isPlainObject(val)
  3082. ? val
  3083. : { type: val };
  3084. }
  3085. } else if (true) {
  3086. warn(
  3087. "Invalid value for option \"props\": expected an Array or an Object, " +
  3088. "but got " + (toRawType(props)) + ".",
  3089. vm
  3090. );
  3091. }
  3092. options.props = res;
  3093. }
  3094. /**
  3095. * Normalize all injections into Object-based format
  3096. */
  3097. function normalizeInject (options, vm) {
  3098. var inject = options.inject;
  3099. if (!inject) { return }
  3100. var normalized = options.inject = {};
  3101. if (Array.isArray(inject)) {
  3102. for (var i = 0; i < inject.length; i++) {
  3103. normalized[inject[i]] = { from: inject[i] };
  3104. }
  3105. } else if (isPlainObject(inject)) {
  3106. for (var key in inject) {
  3107. var val = inject[key];
  3108. normalized[key] = isPlainObject(val)
  3109. ? extend({ from: key }, val)
  3110. : { from: val };
  3111. }
  3112. } else if (true) {
  3113. warn(
  3114. "Invalid value for option \"inject\": expected an Array or an Object, " +
  3115. "but got " + (toRawType(inject)) + ".",
  3116. vm
  3117. );
  3118. }
  3119. }
  3120. /**
  3121. * Normalize raw function directives into object format.
  3122. */
  3123. function normalizeDirectives (options) {
  3124. var dirs = options.directives;
  3125. if (dirs) {
  3126. for (var key in dirs) {
  3127. var def$$1 = dirs[key];
  3128. if (typeof def$$1 === 'function') {
  3129. dirs[key] = { bind: def$$1, update: def$$1 };
  3130. }
  3131. }
  3132. }
  3133. }
  3134. function assertObjectType (name, value, vm) {
  3135. if (!isPlainObject(value)) {
  3136. warn(
  3137. "Invalid value for option \"" + name + "\": expected an Object, " +
  3138. "but got " + (toRawType(value)) + ".",
  3139. vm
  3140. );
  3141. }
  3142. }
  3143. /**
  3144. * Merge two option objects into a new one.
  3145. * Core utility used in both instantiation and inheritance.
  3146. */
  3147. function mergeOptions (
  3148. parent,
  3149. child,
  3150. vm
  3151. ) {
  3152. if (true) {
  3153. checkComponents(child);
  3154. }
  3155. if (typeof child === 'function') {
  3156. child = child.options;
  3157. }
  3158. normalizeProps(child, vm);
  3159. normalizeInject(child, vm);
  3160. normalizeDirectives(child);
  3161. // Apply extends and mixins on the child options,
  3162. // but only if it is a raw options object that isn't
  3163. // the result of another mergeOptions call.
  3164. // Only merged options has the _base property.
  3165. if (!child._base) {
  3166. if (child.extends) {
  3167. parent = mergeOptions(parent, child.extends, vm);
  3168. }
  3169. if (child.mixins) {
  3170. for (var i = 0, l = child.mixins.length; i < l; i++) {
  3171. parent = mergeOptions(parent, child.mixins[i], vm);
  3172. }
  3173. }
  3174. }
  3175. var options = {};
  3176. var key;
  3177. for (key in parent) {
  3178. mergeField(key);
  3179. }
  3180. for (key in child) {
  3181. if (!hasOwn(parent, key)) {
  3182. mergeField(key);
  3183. }
  3184. }
  3185. function mergeField (key) {
  3186. var strat = strats[key] || defaultStrat;
  3187. options[key] = strat(parent[key], child[key], vm, key);
  3188. }
  3189. return options
  3190. }
  3191. /**
  3192. * Resolve an asset.
  3193. * This function is used because child instances need access
  3194. * to assets defined in its ancestor chain.
  3195. */
  3196. function resolveAsset (
  3197. options,
  3198. type,
  3199. id,
  3200. warnMissing
  3201. ) {
  3202. /* istanbul ignore if */
  3203. if (typeof id !== 'string') {
  3204. return
  3205. }
  3206. var assets = options[type];
  3207. // check local registration variations first
  3208. if (hasOwn(assets, id)) { return assets[id] }
  3209. var camelizedId = camelize(id);
  3210. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  3211. var PascalCaseId = capitalize(camelizedId);
  3212. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  3213. // fallback to prototype chain
  3214. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  3215. if ( true && warnMissing && !res) {
  3216. warn(
  3217. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  3218. options
  3219. );
  3220. }
  3221. return res
  3222. }
  3223. /* */
  3224. function validateProp (
  3225. key,
  3226. propOptions,
  3227. propsData,
  3228. vm
  3229. ) {
  3230. var prop = propOptions[key];
  3231. var absent = !hasOwn(propsData, key);
  3232. var value = propsData[key];
  3233. // boolean casting
  3234. var booleanIndex = getTypeIndex(Boolean, prop.type);
  3235. if (booleanIndex > -1) {
  3236. if (absent && !hasOwn(prop, 'default')) {
  3237. value = false;
  3238. } else if (value === '' || value === hyphenate(key)) {
  3239. // only cast empty string / same name to boolean if
  3240. // boolean has higher priority
  3241. var stringIndex = getTypeIndex(String, prop.type);
  3242. if (stringIndex < 0 || booleanIndex < stringIndex) {
  3243. value = true;
  3244. }
  3245. }
  3246. }
  3247. // check default value
  3248. if (value === undefined) {
  3249. value = getPropDefaultValue(vm, prop, key);
  3250. // since the default value is a fresh copy,
  3251. // make sure to observe it.
  3252. var prevShouldObserve = shouldObserve;
  3253. toggleObserving(true);
  3254. observe(value);
  3255. toggleObserving(prevShouldObserve);
  3256. }
  3257. if (
  3258. true
  3259. ) {
  3260. assertProp(prop, key, value, vm, absent);
  3261. }
  3262. return value
  3263. }
  3264. /**
  3265. * Get the default value of a prop.
  3266. */
  3267. function getPropDefaultValue (vm, prop, key) {
  3268. // no default, return undefined
  3269. if (!hasOwn(prop, 'default')) {
  3270. return undefined
  3271. }
  3272. var def = prop.default;
  3273. // warn against non-factory defaults for Object & Array
  3274. if ( true && isObject(def)) {
  3275. warn(
  3276. 'Invalid default value for prop "' + key + '": ' +
  3277. 'Props with type Object/Array must use a factory function ' +
  3278. 'to return the default value.',
  3279. vm
  3280. );
  3281. }
  3282. // the raw prop value was also undefined from previous render,
  3283. // return previous default value to avoid unnecessary watcher trigger
  3284. if (vm && vm.$options.propsData &&
  3285. vm.$options.propsData[key] === undefined &&
  3286. vm._props[key] !== undefined
  3287. ) {
  3288. return vm._props[key]
  3289. }
  3290. // call factory function for non-Function types
  3291. // a value is Function if its prototype is function even across different execution context
  3292. return typeof def === 'function' && getType(prop.type) !== 'Function'
  3293. ? def.call(vm)
  3294. : def
  3295. }
  3296. /**
  3297. * Assert whether a prop is valid.
  3298. */
  3299. function assertProp (
  3300. prop,
  3301. name,
  3302. value,
  3303. vm,
  3304. absent
  3305. ) {
  3306. if (prop.required && absent) {
  3307. warn(
  3308. 'Missing required prop: "' + name + '"',
  3309. vm
  3310. );
  3311. return
  3312. }
  3313. if (value == null && !prop.required) {
  3314. return
  3315. }
  3316. var type = prop.type;
  3317. var valid = !type || type === true;
  3318. var expectedTypes = [];
  3319. if (type) {
  3320. if (!Array.isArray(type)) {
  3321. type = [type];
  3322. }
  3323. for (var i = 0; i < type.length && !valid; i++) {
  3324. var assertedType = assertType(value, type[i]);
  3325. expectedTypes.push(assertedType.expectedType || '');
  3326. valid = assertedType.valid;
  3327. }
  3328. }
  3329. if (!valid) {
  3330. warn(
  3331. getInvalidTypeMessage(name, value, expectedTypes),
  3332. vm
  3333. );
  3334. return
  3335. }
  3336. var validator = prop.validator;
  3337. if (validator) {
  3338. if (!validator(value)) {
  3339. warn(
  3340. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  3341. vm
  3342. );
  3343. }
  3344. }
  3345. }
  3346. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  3347. function assertType (value, type) {
  3348. var valid;
  3349. var expectedType = getType(type);
  3350. if (simpleCheckRE.test(expectedType)) {
  3351. var t = typeof value;
  3352. valid = t === expectedType.toLowerCase();
  3353. // for primitive wrapper objects
  3354. if (!valid && t === 'object') {
  3355. valid = value instanceof type;
  3356. }
  3357. } else if (expectedType === 'Object') {
  3358. valid = isPlainObject(value);
  3359. } else if (expectedType === 'Array') {
  3360. valid = Array.isArray(value);
  3361. } else {
  3362. valid = value instanceof type;
  3363. }
  3364. return {
  3365. valid: valid,
  3366. expectedType: expectedType
  3367. }
  3368. }
  3369. /**
  3370. * Use function string name to check built-in types,
  3371. * because a simple equality check will fail when running
  3372. * across different vms / iframes.
  3373. */
  3374. function getType (fn) {
  3375. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  3376. return match ? match[1] : ''
  3377. }
  3378. function isSameType (a, b) {
  3379. return getType(a) === getType(b)
  3380. }
  3381. function getTypeIndex (type, expectedTypes) {
  3382. if (!Array.isArray(expectedTypes)) {
  3383. return isSameType(expectedTypes, type) ? 0 : -1
  3384. }
  3385. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  3386. if (isSameType(expectedTypes[i], type)) {
  3387. return i
  3388. }
  3389. }
  3390. return -1
  3391. }
  3392. function getInvalidTypeMessage (name, value, expectedTypes) {
  3393. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  3394. " Expected " + (expectedTypes.map(capitalize).join(', '));
  3395. var expectedType = expectedTypes[0];
  3396. var receivedType = toRawType(value);
  3397. var expectedValue = styleValue(value, expectedType);
  3398. var receivedValue = styleValue(value, receivedType);
  3399. // check if we need to specify expected value
  3400. if (expectedTypes.length === 1 &&
  3401. isExplicable(expectedType) &&
  3402. !isBoolean(expectedType, receivedType)) {
  3403. message += " with value " + expectedValue;
  3404. }
  3405. message += ", got " + receivedType + " ";
  3406. // check if we need to specify received value
  3407. if (isExplicable(receivedType)) {
  3408. message += "with value " + receivedValue + ".";
  3409. }
  3410. return message
  3411. }
  3412. function styleValue (value, type) {
  3413. if (type === 'String') {
  3414. return ("\"" + value + "\"")
  3415. } else if (type === 'Number') {
  3416. return ("" + (Number(value)))
  3417. } else {
  3418. return ("" + value)
  3419. }
  3420. }
  3421. function isExplicable (value) {
  3422. var explicitTypes = ['string', 'number', 'boolean'];
  3423. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  3424. }
  3425. function isBoolean () {
  3426. var args = [], len = arguments.length;
  3427. while ( len-- ) args[ len ] = arguments[ len ];
  3428. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  3429. }
  3430. /* */
  3431. function handleError (err, vm, info) {
  3432. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  3433. // See: https://github.com/vuejs/vuex/issues/1505
  3434. pushTarget();
  3435. try {
  3436. if (vm) {
  3437. var cur = vm;
  3438. while ((cur = cur.$parent)) {
  3439. var hooks = cur.$options.errorCaptured;
  3440. if (hooks) {
  3441. for (var i = 0; i < hooks.length; i++) {
  3442. try {
  3443. var capture = hooks[i].call(cur, err, vm, info) === false;
  3444. if (capture) { return }
  3445. } catch (e) {
  3446. globalHandleError(e, cur, 'errorCaptured hook');
  3447. }
  3448. }
  3449. }
  3450. }
  3451. }
  3452. globalHandleError(err, vm, info);
  3453. } finally {
  3454. popTarget();
  3455. }
  3456. }
  3457. function invokeWithErrorHandling (
  3458. handler,
  3459. context,
  3460. args,
  3461. vm,
  3462. info
  3463. ) {
  3464. var res;
  3465. try {
  3466. res = args ? handler.apply(context, args) : handler.call(context);
  3467. if (res && !res._isVue && isPromise(res) && !res._handled) {
  3468. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  3469. // issue #9511
  3470. // avoid catch triggering multiple times when nested calls
  3471. res._handled = true;
  3472. }
  3473. } catch (e) {
  3474. handleError(e, vm, info);
  3475. }
  3476. return res
  3477. }
  3478. function globalHandleError (err, vm, info) {
  3479. if (config.errorHandler) {
  3480. try {
  3481. return config.errorHandler.call(null, err, vm, info)
  3482. } catch (e) {
  3483. // if the user intentionally throws the original error in the handler,
  3484. // do not log it twice
  3485. if (e !== err) {
  3486. logError(e, null, 'config.errorHandler');
  3487. }
  3488. }
  3489. }
  3490. logError(err, vm, info);
  3491. }
  3492. function logError (err, vm, info) {
  3493. if (true) {
  3494. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  3495. }
  3496. /* istanbul ignore else */
  3497. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  3498. console.error(err);
  3499. } else {
  3500. throw err
  3501. }
  3502. }
  3503. /* */
  3504. var callbacks = [];
  3505. var pending = false;
  3506. function flushCallbacks () {
  3507. pending = false;
  3508. var copies = callbacks.slice(0);
  3509. callbacks.length = 0;
  3510. for (var i = 0; i < copies.length; i++) {
  3511. copies[i]();
  3512. }
  3513. }
  3514. // Here we have async deferring wrappers using microtasks.
  3515. // In 2.5 we used (macro) tasks (in combination with microtasks).
  3516. // However, it has subtle problems when state is changed right before repaint
  3517. // (e.g. #6813, out-in transitions).
  3518. // Also, using (macro) tasks in event handler would cause some weird behaviors
  3519. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  3520. // So we now use microtasks everywhere, again.
  3521. // A major drawback of this tradeoff is that there are some scenarios
  3522. // where microtasks have too high a priority and fire in between supposedly
  3523. // sequential events (e.g. #4521, #6690, which have workarounds)
  3524. // or even between bubbling of the same event (#6566).
  3525. var timerFunc;
  3526. // The nextTick behavior leverages the microtask queue, which can be accessed
  3527. // via either native Promise.then or MutationObserver.
  3528. // MutationObserver has wider support, however it is seriously bugged in
  3529. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  3530. // completely stops working after triggering a few times... so, if native
  3531. // Promise is available, we will use it:
  3532. /* istanbul ignore next, $flow-disable-line */
  3533. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  3534. var p = Promise.resolve();
  3535. timerFunc = function () {
  3536. p.then(flushCallbacks);
  3537. // In problematic UIWebViews, Promise.then doesn't completely break, but
  3538. // it can get stuck in a weird state where callbacks are pushed into the
  3539. // microtask queue but the queue isn't being flushed, until the browser
  3540. // needs to do some other work, e.g. handle a timer. Therefore we can
  3541. // "force" the microtask queue to be flushed by adding an empty timer.
  3542. if (isIOS) { setTimeout(noop); }
  3543. };
  3544. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  3545. isNative(MutationObserver) ||
  3546. // PhantomJS and iOS 7.x
  3547. MutationObserver.toString() === '[object MutationObserverConstructor]'
  3548. )) {
  3549. // Use MutationObserver where native Promise is not available,
  3550. // e.g. PhantomJS, iOS7, Android 4.4
  3551. // (#6466 MutationObserver is unreliable in IE11)
  3552. var counter = 1;
  3553. var observer = new MutationObserver(flushCallbacks);
  3554. var textNode = document.createTextNode(String(counter));
  3555. observer.observe(textNode, {
  3556. characterData: true
  3557. });
  3558. timerFunc = function () {
  3559. counter = (counter + 1) % 2;
  3560. textNode.data = String(counter);
  3561. };
  3562. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  3563. // Fallback to setImmediate.
  3564. // Technically it leverages the (macro) task queue,
  3565. // but it is still a better choice than setTimeout.
  3566. timerFunc = function () {
  3567. setImmediate(flushCallbacks);
  3568. };
  3569. } else {
  3570. // Fallback to setTimeout.
  3571. timerFunc = function () {
  3572. setTimeout(flushCallbacks, 0);
  3573. };
  3574. }
  3575. function nextTick (cb, ctx) {
  3576. var _resolve;
  3577. callbacks.push(function () {
  3578. if (cb) {
  3579. try {
  3580. cb.call(ctx);
  3581. } catch (e) {
  3582. handleError(e, ctx, 'nextTick');
  3583. }
  3584. } else if (_resolve) {
  3585. _resolve(ctx);
  3586. }
  3587. });
  3588. if (!pending) {
  3589. pending = true;
  3590. timerFunc();
  3591. }
  3592. // $flow-disable-line
  3593. if (!cb && typeof Promise !== 'undefined') {
  3594. return new Promise(function (resolve) {
  3595. _resolve = resolve;
  3596. })
  3597. }
  3598. }
  3599. /* */
  3600. /* not type checking this file because flow doesn't play well with Proxy */
  3601. var initProxy;
  3602. if (true) {
  3603. var allowedGlobals = makeMap(
  3604. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  3605. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  3606. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  3607. 'require' // for Webpack/Browserify
  3608. );
  3609. var warnNonPresent = function (target, key) {
  3610. warn(
  3611. "Property or method \"" + key + "\" is not defined on the instance but " +
  3612. 'referenced during render. Make sure that this property is reactive, ' +
  3613. 'either in the data option, or for class-based components, by ' +
  3614. 'initializing the property. ' +
  3615. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  3616. target
  3617. );
  3618. };
  3619. var warnReservedPrefix = function (target, key) {
  3620. warn(
  3621. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  3622. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  3623. 'prevent conflicts with Vue internals. ' +
  3624. 'See: https://vuejs.org/v2/api/#data',
  3625. target
  3626. );
  3627. };
  3628. var hasProxy =
  3629. typeof Proxy !== 'undefined' && isNative(Proxy);
  3630. if (hasProxy) {
  3631. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  3632. config.keyCodes = new Proxy(config.keyCodes, {
  3633. set: function set (target, key, value) {
  3634. if (isBuiltInModifier(key)) {
  3635. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  3636. return false
  3637. } else {
  3638. target[key] = value;
  3639. return true
  3640. }
  3641. }
  3642. });
  3643. }
  3644. var hasHandler = {
  3645. has: function has (target, key) {
  3646. var has = key in target;
  3647. var isAllowed = allowedGlobals(key) ||
  3648. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  3649. if (!has && !isAllowed) {
  3650. if (key in target.$data) { warnReservedPrefix(target, key); }
  3651. else { warnNonPresent(target, key); }
  3652. }
  3653. return has || !isAllowed
  3654. }
  3655. };
  3656. var getHandler = {
  3657. get: function get (target, key) {
  3658. if (typeof key === 'string' && !(key in target)) {
  3659. if (key in target.$data) { warnReservedPrefix(target, key); }
  3660. else { warnNonPresent(target, key); }
  3661. }
  3662. return target[key]
  3663. }
  3664. };
  3665. initProxy = function initProxy (vm) {
  3666. if (hasProxy) {
  3667. // determine which proxy handler to use
  3668. var options = vm.$options;
  3669. var handlers = options.render && options.render._withStripped
  3670. ? getHandler
  3671. : hasHandler;
  3672. vm._renderProxy = new Proxy(vm, handlers);
  3673. } else {
  3674. vm._renderProxy = vm;
  3675. }
  3676. };
  3677. }
  3678. /* */
  3679. var seenObjects = new _Set();
  3680. /**
  3681. * Recursively traverse an object to evoke all converted
  3682. * getters, so that every nested property inside the object
  3683. * is collected as a "deep" dependency.
  3684. */
  3685. function traverse (val) {
  3686. _traverse(val, seenObjects);
  3687. seenObjects.clear();
  3688. }
  3689. function _traverse (val, seen) {
  3690. var i, keys;
  3691. var isA = Array.isArray(val);
  3692. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  3693. return
  3694. }
  3695. if (val.__ob__) {
  3696. var depId = val.__ob__.dep.id;
  3697. if (seen.has(depId)) {
  3698. return
  3699. }
  3700. seen.add(depId);
  3701. }
  3702. if (isA) {
  3703. i = val.length;
  3704. while (i--) { _traverse(val[i], seen); }
  3705. } else {
  3706. keys = Object.keys(val);
  3707. i = keys.length;
  3708. while (i--) { _traverse(val[keys[i]], seen); }
  3709. }
  3710. }
  3711. var mark;
  3712. var measure;
  3713. if (true) {
  3714. var perf = inBrowser && window.performance;
  3715. /* istanbul ignore if */
  3716. if (
  3717. perf &&
  3718. perf.mark &&
  3719. perf.measure &&
  3720. perf.clearMarks &&
  3721. perf.clearMeasures
  3722. ) {
  3723. mark = function (tag) { return perf.mark(tag); };
  3724. measure = function (name, startTag, endTag) {
  3725. perf.measure(name, startTag, endTag);
  3726. perf.clearMarks(startTag);
  3727. perf.clearMarks(endTag);
  3728. // perf.clearMeasures(name)
  3729. };
  3730. }
  3731. }
  3732. /* */
  3733. var normalizeEvent = cached(function (name) {
  3734. var passive = name.charAt(0) === '&';
  3735. name = passive ? name.slice(1) : name;
  3736. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  3737. name = once$$1 ? name.slice(1) : name;
  3738. var capture = name.charAt(0) === '!';
  3739. name = capture ? name.slice(1) : name;
  3740. return {
  3741. name: name,
  3742. once: once$$1,
  3743. capture: capture,
  3744. passive: passive
  3745. }
  3746. });
  3747. function createFnInvoker (fns, vm) {
  3748. function invoker () {
  3749. var arguments$1 = arguments;
  3750. var fns = invoker.fns;
  3751. if (Array.isArray(fns)) {
  3752. var cloned = fns.slice();
  3753. for (var i = 0; i < cloned.length; i++) {
  3754. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  3755. }
  3756. } else {
  3757. // return handler return value for single handlers
  3758. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  3759. }
  3760. }
  3761. invoker.fns = fns;
  3762. return invoker
  3763. }
  3764. function updateListeners (
  3765. on,
  3766. oldOn,
  3767. add,
  3768. remove$$1,
  3769. createOnceHandler,
  3770. vm
  3771. ) {
  3772. var name, def$$1, cur, old, event;
  3773. for (name in on) {
  3774. def$$1 = cur = on[name];
  3775. old = oldOn[name];
  3776. event = normalizeEvent(name);
  3777. if (isUndef(cur)) {
  3778. true && warn(
  3779. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  3780. vm
  3781. );
  3782. } else if (isUndef(old)) {
  3783. if (isUndef(cur.fns)) {
  3784. cur = on[name] = createFnInvoker(cur, vm);
  3785. }
  3786. if (isTrue(event.once)) {
  3787. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  3788. }
  3789. add(event.name, cur, event.capture, event.passive, event.params);
  3790. } else if (cur !== old) {
  3791. old.fns = cur;
  3792. on[name] = old;
  3793. }
  3794. }
  3795. for (name in oldOn) {
  3796. if (isUndef(on[name])) {
  3797. event = normalizeEvent(name);
  3798. remove$$1(event.name, oldOn[name], event.capture);
  3799. }
  3800. }
  3801. }
  3802. /* */
  3803. /* */
  3804. // fixed by xxxxxx (mp properties)
  3805. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  3806. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  3807. if (isUndef(propOptions)) {
  3808. return res
  3809. }
  3810. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  3811. var attrs = data.attrs;
  3812. var props = data.props;
  3813. if (isDef(attrs) || isDef(props)) {
  3814. for (var key in propOptions) {
  3815. var altKey = hyphenate(key);
  3816. var result = checkProp(res, props, key, altKey, true) ||
  3817. checkProp(res, attrs, key, altKey, false);
  3818. // externalClass
  3819. if (
  3820. result &&
  3821. res[key] &&
  3822. externalClasses.indexOf(altKey) !== -1 &&
  3823. context[camelize(res[key])]
  3824. ) {
  3825. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  3826. res[key] = context[camelize(res[key])];
  3827. }
  3828. }
  3829. }
  3830. return res
  3831. }
  3832. function extractPropsFromVNodeData (
  3833. data,
  3834. Ctor,
  3835. tag,
  3836. context// fixed by xxxxxx
  3837. ) {
  3838. // we are only extracting raw values here.
  3839. // validation and default values are handled in the child
  3840. // component itself.
  3841. var propOptions = Ctor.options.props;
  3842. if (isUndef(propOptions)) {
  3843. // fixed by xxxxxx
  3844. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  3845. }
  3846. var res = {};
  3847. var attrs = data.attrs;
  3848. var props = data.props;
  3849. if (isDef(attrs) || isDef(props)) {
  3850. for (var key in propOptions) {
  3851. var altKey = hyphenate(key);
  3852. if (true) {
  3853. var keyInLowerCase = key.toLowerCase();
  3854. if (
  3855. key !== keyInLowerCase &&
  3856. attrs && hasOwn(attrs, keyInLowerCase)
  3857. ) {
  3858. tip(
  3859. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  3860. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  3861. " \"" + key + "\". " +
  3862. "Note that HTML attributes are case-insensitive and camelCased " +
  3863. "props need to use their kebab-case equivalents when using in-DOM " +
  3864. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  3865. );
  3866. }
  3867. }
  3868. checkProp(res, props, key, altKey, true) ||
  3869. checkProp(res, attrs, key, altKey, false);
  3870. }
  3871. }
  3872. // fixed by xxxxxx
  3873. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  3874. }
  3875. function checkProp (
  3876. res,
  3877. hash,
  3878. key,
  3879. altKey,
  3880. preserve
  3881. ) {
  3882. if (isDef(hash)) {
  3883. if (hasOwn(hash, key)) {
  3884. res[key] = hash[key];
  3885. if (!preserve) {
  3886. delete hash[key];
  3887. }
  3888. return true
  3889. } else if (hasOwn(hash, altKey)) {
  3890. res[key] = hash[altKey];
  3891. if (!preserve) {
  3892. delete hash[altKey];
  3893. }
  3894. return true
  3895. }
  3896. }
  3897. return false
  3898. }
  3899. /* */
  3900. // The template compiler attempts to minimize the need for normalization by
  3901. // statically analyzing the template at compile time.
  3902. //
  3903. // For plain HTML markup, normalization can be completely skipped because the
  3904. // generated render function is guaranteed to return Array<VNode>. There are
  3905. // two cases where extra normalization is needed:
  3906. // 1. When the children contains components - because a functional component
  3907. // may return an Array instead of a single root. In this case, just a simple
  3908. // normalization is needed - if any child is an Array, we flatten the whole
  3909. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  3910. // because functional components already normalize their own children.
  3911. function simpleNormalizeChildren (children) {
  3912. for (var i = 0; i < children.length; i++) {
  3913. if (Array.isArray(children[i])) {
  3914. return Array.prototype.concat.apply([], children)
  3915. }
  3916. }
  3917. return children
  3918. }
  3919. // 2. When the children contains constructs that always generated nested Arrays,
  3920. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  3921. // with hand-written render functions / JSX. In such cases a full normalization
  3922. // is needed to cater to all possible types of children values.
  3923. function normalizeChildren (children) {
  3924. return isPrimitive(children)
  3925. ? [createTextVNode(children)]
  3926. : Array.isArray(children)
  3927. ? normalizeArrayChildren(children)
  3928. : undefined
  3929. }
  3930. function isTextNode (node) {
  3931. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  3932. }
  3933. function normalizeArrayChildren (children, nestedIndex) {
  3934. var res = [];
  3935. var i, c, lastIndex, last;
  3936. for (i = 0; i < children.length; i++) {
  3937. c = children[i];
  3938. if (isUndef(c) || typeof c === 'boolean') { continue }
  3939. lastIndex = res.length - 1;
  3940. last = res[lastIndex];
  3941. // nested
  3942. if (Array.isArray(c)) {
  3943. if (c.length > 0) {
  3944. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  3945. // merge adjacent text nodes
  3946. if (isTextNode(c[0]) && isTextNode(last)) {
  3947. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  3948. c.shift();
  3949. }
  3950. res.push.apply(res, c);
  3951. }
  3952. } else if (isPrimitive(c)) {
  3953. if (isTextNode(last)) {
  3954. // merge adjacent text nodes
  3955. // this is necessary for SSR hydration because text nodes are
  3956. // essentially merged when rendered to HTML strings
  3957. res[lastIndex] = createTextVNode(last.text + c);
  3958. } else if (c !== '') {
  3959. // convert primitive to vnode
  3960. res.push(createTextVNode(c));
  3961. }
  3962. } else {
  3963. if (isTextNode(c) && isTextNode(last)) {
  3964. // merge adjacent text nodes
  3965. res[lastIndex] = createTextVNode(last.text + c.text);
  3966. } else {
  3967. // default key for nested array children (likely generated by v-for)
  3968. if (isTrue(children._isVList) &&
  3969. isDef(c.tag) &&
  3970. isUndef(c.key) &&
  3971. isDef(nestedIndex)) {
  3972. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  3973. }
  3974. res.push(c);
  3975. }
  3976. }
  3977. }
  3978. return res
  3979. }
  3980. /* */
  3981. function initProvide (vm) {
  3982. var provide = vm.$options.provide;
  3983. if (provide) {
  3984. vm._provided = typeof provide === 'function'
  3985. ? provide.call(vm)
  3986. : provide;
  3987. }
  3988. }
  3989. function initInjections (vm) {
  3990. var result = resolveInject(vm.$options.inject, vm);
  3991. if (result) {
  3992. toggleObserving(false);
  3993. Object.keys(result).forEach(function (key) {
  3994. /* istanbul ignore else */
  3995. if (true) {
  3996. defineReactive$$1(vm, key, result[key], function () {
  3997. warn(
  3998. "Avoid mutating an injected value directly since the changes will be " +
  3999. "overwritten whenever the provided component re-renders. " +
  4000. "injection being mutated: \"" + key + "\"",
  4001. vm
  4002. );
  4003. });
  4004. } else {}
  4005. });
  4006. toggleObserving(true);
  4007. }
  4008. }
  4009. function resolveInject (inject, vm) {
  4010. if (inject) {
  4011. // inject is :any because flow is not smart enough to figure out cached
  4012. var result = Object.create(null);
  4013. var keys = hasSymbol
  4014. ? Reflect.ownKeys(inject)
  4015. : Object.keys(inject);
  4016. for (var i = 0; i < keys.length; i++) {
  4017. var key = keys[i];
  4018. // #6574 in case the inject object is observed...
  4019. if (key === '__ob__') { continue }
  4020. var provideKey = inject[key].from;
  4021. var source = vm;
  4022. while (source) {
  4023. if (source._provided && hasOwn(source._provided, provideKey)) {
  4024. result[key] = source._provided[provideKey];
  4025. break
  4026. }
  4027. source = source.$parent;
  4028. }
  4029. if (!source) {
  4030. if ('default' in inject[key]) {
  4031. var provideDefault = inject[key].default;
  4032. result[key] = typeof provideDefault === 'function'
  4033. ? provideDefault.call(vm)
  4034. : provideDefault;
  4035. } else if (true) {
  4036. warn(("Injection \"" + key + "\" not found"), vm);
  4037. }
  4038. }
  4039. }
  4040. return result
  4041. }
  4042. }
  4043. /* */
  4044. /**
  4045. * Runtime helper for resolving raw children VNodes into a slot object.
  4046. */
  4047. function resolveSlots (
  4048. children,
  4049. context
  4050. ) {
  4051. if (!children || !children.length) {
  4052. return {}
  4053. }
  4054. var slots = {};
  4055. for (var i = 0, l = children.length; i < l; i++) {
  4056. var child = children[i];
  4057. var data = child.data;
  4058. // remove slot attribute if the node is resolved as a Vue slot node
  4059. if (data && data.attrs && data.attrs.slot) {
  4060. delete data.attrs.slot;
  4061. }
  4062. // named slots should only be respected if the vnode was rendered in the
  4063. // same context.
  4064. if ((child.context === context || child.fnContext === context) &&
  4065. data && data.slot != null
  4066. ) {
  4067. var name = data.slot;
  4068. var slot = (slots[name] || (slots[name] = []));
  4069. if (child.tag === 'template') {
  4070. slot.push.apply(slot, child.children || []);
  4071. } else {
  4072. slot.push(child);
  4073. }
  4074. } else {
  4075. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  4076. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  4077. (slots['page'] || (slots['page'] = [])).push(child);
  4078. }else{
  4079. (slots.default || (slots.default = [])).push(child);
  4080. }
  4081. }
  4082. }
  4083. // ignore slots that contains only whitespace
  4084. for (var name$1 in slots) {
  4085. if (slots[name$1].every(isWhitespace)) {
  4086. delete slots[name$1];
  4087. }
  4088. }
  4089. return slots
  4090. }
  4091. function isWhitespace (node) {
  4092. return (node.isComment && !node.asyncFactory) || node.text === ' '
  4093. }
  4094. /* */
  4095. function normalizeScopedSlots (
  4096. slots,
  4097. normalSlots,
  4098. prevSlots
  4099. ) {
  4100. var res;
  4101. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  4102. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  4103. var key = slots && slots.$key;
  4104. if (!slots) {
  4105. res = {};
  4106. } else if (slots._normalized) {
  4107. // fast path 1: child component re-render only, parent did not change
  4108. return slots._normalized
  4109. } else if (
  4110. isStable &&
  4111. prevSlots &&
  4112. prevSlots !== emptyObject &&
  4113. key === prevSlots.$key &&
  4114. !hasNormalSlots &&
  4115. !prevSlots.$hasNormal
  4116. ) {
  4117. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  4118. // only need to normalize once
  4119. return prevSlots
  4120. } else {
  4121. res = {};
  4122. for (var key$1 in slots) {
  4123. if (slots[key$1] && key$1[0] !== '$') {
  4124. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  4125. }
  4126. }
  4127. }
  4128. // expose normal slots on scopedSlots
  4129. for (var key$2 in normalSlots) {
  4130. if (!(key$2 in res)) {
  4131. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  4132. }
  4133. }
  4134. // avoriaz seems to mock a non-extensible $scopedSlots object
  4135. // and when that is passed down this would cause an error
  4136. if (slots && Object.isExtensible(slots)) {
  4137. (slots)._normalized = res;
  4138. }
  4139. def(res, '$stable', isStable);
  4140. def(res, '$key', key);
  4141. def(res, '$hasNormal', hasNormalSlots);
  4142. return res
  4143. }
  4144. function normalizeScopedSlot(normalSlots, key, fn) {
  4145. var normalized = function () {
  4146. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  4147. res = res && typeof res === 'object' && !Array.isArray(res)
  4148. ? [res] // single vnode
  4149. : normalizeChildren(res);
  4150. return res && (
  4151. res.length === 0 ||
  4152. (res.length === 1 && res[0].isComment) // #9658
  4153. ) ? undefined
  4154. : res
  4155. };
  4156. // this is a slot using the new v-slot syntax without scope. although it is
  4157. // compiled as a scoped slot, render fn users would expect it to be present
  4158. // on this.$slots because the usage is semantically a normal slot.
  4159. if (fn.proxy) {
  4160. Object.defineProperty(normalSlots, key, {
  4161. get: normalized,
  4162. enumerable: true,
  4163. configurable: true
  4164. });
  4165. }
  4166. return normalized
  4167. }
  4168. function proxyNormalSlot(slots, key) {
  4169. return function () { return slots[key]; }
  4170. }
  4171. /* */
  4172. /**
  4173. * Runtime helper for rendering v-for lists.
  4174. */
  4175. function renderList (
  4176. val,
  4177. render
  4178. ) {
  4179. var ret, i, l, keys, key;
  4180. if (Array.isArray(val) || typeof val === 'string') {
  4181. ret = new Array(val.length);
  4182. for (i = 0, l = val.length; i < l; i++) {
  4183. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  4184. }
  4185. } else if (typeof val === 'number') {
  4186. ret = new Array(val);
  4187. for (i = 0; i < val; i++) {
  4188. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  4189. }
  4190. } else if (isObject(val)) {
  4191. if (hasSymbol && val[Symbol.iterator]) {
  4192. ret = [];
  4193. var iterator = val[Symbol.iterator]();
  4194. var result = iterator.next();
  4195. while (!result.done) {
  4196. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  4197. result = iterator.next();
  4198. }
  4199. } else {
  4200. keys = Object.keys(val);
  4201. ret = new Array(keys.length);
  4202. for (i = 0, l = keys.length; i < l; i++) {
  4203. key = keys[i];
  4204. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  4205. }
  4206. }
  4207. }
  4208. if (!isDef(ret)) {
  4209. ret = [];
  4210. }
  4211. (ret)._isVList = true;
  4212. return ret
  4213. }
  4214. /* */
  4215. /**
  4216. * Runtime helper for rendering <slot>
  4217. */
  4218. function renderSlot (
  4219. name,
  4220. fallback,
  4221. props,
  4222. bindObject
  4223. ) {
  4224. var scopedSlotFn = this.$scopedSlots[name];
  4225. var nodes;
  4226. if (scopedSlotFn) { // scoped slot
  4227. props = props || {};
  4228. if (bindObject) {
  4229. if ( true && !isObject(bindObject)) {
  4230. warn(
  4231. 'slot v-bind without argument expects an Object',
  4232. this
  4233. );
  4234. }
  4235. props = extend(extend({}, bindObject), props);
  4236. }
  4237. // fixed by xxxxxx app-plus scopedSlot
  4238. nodes = scopedSlotFn(props, this, props._i) || fallback;
  4239. } else {
  4240. nodes = this.$slots[name] || fallback;
  4241. }
  4242. var target = props && props.slot;
  4243. if (target) {
  4244. return this.$createElement('template', { slot: target }, nodes)
  4245. } else {
  4246. return nodes
  4247. }
  4248. }
  4249. /* */
  4250. /**
  4251. * Runtime helper for resolving filters
  4252. */
  4253. function resolveFilter (id) {
  4254. return resolveAsset(this.$options, 'filters', id, true) || identity
  4255. }
  4256. /* */
  4257. function isKeyNotMatch (expect, actual) {
  4258. if (Array.isArray(expect)) {
  4259. return expect.indexOf(actual) === -1
  4260. } else {
  4261. return expect !== actual
  4262. }
  4263. }
  4264. /**
  4265. * Runtime helper for checking keyCodes from config.
  4266. * exposed as Vue.prototype._k
  4267. * passing in eventKeyName as last argument separately for backwards compat
  4268. */
  4269. function checkKeyCodes (
  4270. eventKeyCode,
  4271. key,
  4272. builtInKeyCode,
  4273. eventKeyName,
  4274. builtInKeyName
  4275. ) {
  4276. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  4277. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  4278. return isKeyNotMatch(builtInKeyName, eventKeyName)
  4279. } else if (mappedKeyCode) {
  4280. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  4281. } else if (eventKeyName) {
  4282. return hyphenate(eventKeyName) !== key
  4283. }
  4284. }
  4285. /* */
  4286. /**
  4287. * Runtime helper for merging v-bind="object" into a VNode's data.
  4288. */
  4289. function bindObjectProps (
  4290. data,
  4291. tag,
  4292. value,
  4293. asProp,
  4294. isSync
  4295. ) {
  4296. if (value) {
  4297. if (!isObject(value)) {
  4298. true && warn(
  4299. 'v-bind without argument expects an Object or Array value',
  4300. this
  4301. );
  4302. } else {
  4303. if (Array.isArray(value)) {
  4304. value = toObject(value);
  4305. }
  4306. var hash;
  4307. var loop = function ( key ) {
  4308. if (
  4309. key === 'class' ||
  4310. key === 'style' ||
  4311. isReservedAttribute(key)
  4312. ) {
  4313. hash = data;
  4314. } else {
  4315. var type = data.attrs && data.attrs.type;
  4316. hash = asProp || config.mustUseProp(tag, type, key)
  4317. ? data.domProps || (data.domProps = {})
  4318. : data.attrs || (data.attrs = {});
  4319. }
  4320. var camelizedKey = camelize(key);
  4321. var hyphenatedKey = hyphenate(key);
  4322. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  4323. hash[key] = value[key];
  4324. if (isSync) {
  4325. var on = data.on || (data.on = {});
  4326. on[("update:" + key)] = function ($event) {
  4327. value[key] = $event;
  4328. };
  4329. }
  4330. }
  4331. };
  4332. for (var key in value) loop( key );
  4333. }
  4334. }
  4335. return data
  4336. }
  4337. /* */
  4338. /**
  4339. * Runtime helper for rendering static trees.
  4340. */
  4341. function renderStatic (
  4342. index,
  4343. isInFor
  4344. ) {
  4345. var cached = this._staticTrees || (this._staticTrees = []);
  4346. var tree = cached[index];
  4347. // if has already-rendered static tree and not inside v-for,
  4348. // we can reuse the same tree.
  4349. if (tree && !isInFor) {
  4350. return tree
  4351. }
  4352. // otherwise, render a fresh tree.
  4353. tree = cached[index] = this.$options.staticRenderFns[index].call(
  4354. this._renderProxy,
  4355. null,
  4356. this // for render fns generated for functional component templates
  4357. );
  4358. markStatic(tree, ("__static__" + index), false);
  4359. return tree
  4360. }
  4361. /**
  4362. * Runtime helper for v-once.
  4363. * Effectively it means marking the node as static with a unique key.
  4364. */
  4365. function markOnce (
  4366. tree,
  4367. index,
  4368. key
  4369. ) {
  4370. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  4371. return tree
  4372. }
  4373. function markStatic (
  4374. tree,
  4375. key,
  4376. isOnce
  4377. ) {
  4378. if (Array.isArray(tree)) {
  4379. for (var i = 0; i < tree.length; i++) {
  4380. if (tree[i] && typeof tree[i] !== 'string') {
  4381. markStaticNode(tree[i], (key + "_" + i), isOnce);
  4382. }
  4383. }
  4384. } else {
  4385. markStaticNode(tree, key, isOnce);
  4386. }
  4387. }
  4388. function markStaticNode (node, key, isOnce) {
  4389. node.isStatic = true;
  4390. node.key = key;
  4391. node.isOnce = isOnce;
  4392. }
  4393. /* */
  4394. function bindObjectListeners (data, value) {
  4395. if (value) {
  4396. if (!isPlainObject(value)) {
  4397. true && warn(
  4398. 'v-on without argument expects an Object value',
  4399. this
  4400. );
  4401. } else {
  4402. var on = data.on = data.on ? extend({}, data.on) : {};
  4403. for (var key in value) {
  4404. var existing = on[key];
  4405. var ours = value[key];
  4406. on[key] = existing ? [].concat(existing, ours) : ours;
  4407. }
  4408. }
  4409. }
  4410. return data
  4411. }
  4412. /* */
  4413. function resolveScopedSlots (
  4414. fns, // see flow/vnode
  4415. res,
  4416. // the following are added in 2.6
  4417. hasDynamicKeys,
  4418. contentHashKey
  4419. ) {
  4420. res = res || { $stable: !hasDynamicKeys };
  4421. for (var i = 0; i < fns.length; i++) {
  4422. var slot = fns[i];
  4423. if (Array.isArray(slot)) {
  4424. resolveScopedSlots(slot, res, hasDynamicKeys);
  4425. } else if (slot) {
  4426. // marker for reverse proxying v-slot without scope on this.$slots
  4427. if (slot.proxy) {
  4428. slot.fn.proxy = true;
  4429. }
  4430. res[slot.key] = slot.fn;
  4431. }
  4432. }
  4433. if (contentHashKey) {
  4434. (res).$key = contentHashKey;
  4435. }
  4436. return res
  4437. }
  4438. /* */
  4439. function bindDynamicKeys (baseObj, values) {
  4440. for (var i = 0; i < values.length; i += 2) {
  4441. var key = values[i];
  4442. if (typeof key === 'string' && key) {
  4443. baseObj[values[i]] = values[i + 1];
  4444. } else if ( true && key !== '' && key !== null) {
  4445. // null is a special value for explicitly removing a binding
  4446. warn(
  4447. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  4448. this
  4449. );
  4450. }
  4451. }
  4452. return baseObj
  4453. }
  4454. // helper to dynamically append modifier runtime markers to event names.
  4455. // ensure only append when value is already string, otherwise it will be cast
  4456. // to string and cause the type check to miss.
  4457. function prependModifier (value, symbol) {
  4458. return typeof value === 'string' ? symbol + value : value
  4459. }
  4460. /* */
  4461. function installRenderHelpers (target) {
  4462. target._o = markOnce;
  4463. target._n = toNumber;
  4464. target._s = toString;
  4465. target._l = renderList;
  4466. target._t = renderSlot;
  4467. target._q = looseEqual;
  4468. target._i = looseIndexOf;
  4469. target._m = renderStatic;
  4470. target._f = resolveFilter;
  4471. target._k = checkKeyCodes;
  4472. target._b = bindObjectProps;
  4473. target._v = createTextVNode;
  4474. target._e = createEmptyVNode;
  4475. target._u = resolveScopedSlots;
  4476. target._g = bindObjectListeners;
  4477. target._d = bindDynamicKeys;
  4478. target._p = prependModifier;
  4479. }
  4480. /* */
  4481. function FunctionalRenderContext (
  4482. data,
  4483. props,
  4484. children,
  4485. parent,
  4486. Ctor
  4487. ) {
  4488. var this$1 = this;
  4489. var options = Ctor.options;
  4490. // ensure the createElement function in functional components
  4491. // gets a unique context - this is necessary for correct named slot check
  4492. var contextVm;
  4493. if (hasOwn(parent, '_uid')) {
  4494. contextVm = Object.create(parent);
  4495. // $flow-disable-line
  4496. contextVm._original = parent;
  4497. } else {
  4498. // the context vm passed in is a functional context as well.
  4499. // in this case we want to make sure we are able to get a hold to the
  4500. // real context instance.
  4501. contextVm = parent;
  4502. // $flow-disable-line
  4503. parent = parent._original;
  4504. }
  4505. var isCompiled = isTrue(options._compiled);
  4506. var needNormalization = !isCompiled;
  4507. this.data = data;
  4508. this.props = props;
  4509. this.children = children;
  4510. this.parent = parent;
  4511. this.listeners = data.on || emptyObject;
  4512. this.injections = resolveInject(options.inject, parent);
  4513. this.slots = function () {
  4514. if (!this$1.$slots) {
  4515. normalizeScopedSlots(
  4516. data.scopedSlots,
  4517. this$1.$slots = resolveSlots(children, parent)
  4518. );
  4519. }
  4520. return this$1.$slots
  4521. };
  4522. Object.defineProperty(this, 'scopedSlots', ({
  4523. enumerable: true,
  4524. get: function get () {
  4525. return normalizeScopedSlots(data.scopedSlots, this.slots())
  4526. }
  4527. }));
  4528. // support for compiled functional template
  4529. if (isCompiled) {
  4530. // exposing $options for renderStatic()
  4531. this.$options = options;
  4532. // pre-resolve slots for renderSlot()
  4533. this.$slots = this.slots();
  4534. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  4535. }
  4536. if (options._scopeId) {
  4537. this._c = function (a, b, c, d) {
  4538. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  4539. if (vnode && !Array.isArray(vnode)) {
  4540. vnode.fnScopeId = options._scopeId;
  4541. vnode.fnContext = parent;
  4542. }
  4543. return vnode
  4544. };
  4545. } else {
  4546. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  4547. }
  4548. }
  4549. installRenderHelpers(FunctionalRenderContext.prototype);
  4550. function createFunctionalComponent (
  4551. Ctor,
  4552. propsData,
  4553. data,
  4554. contextVm,
  4555. children
  4556. ) {
  4557. var options = Ctor.options;
  4558. var props = {};
  4559. var propOptions = options.props;
  4560. if (isDef(propOptions)) {
  4561. for (var key in propOptions) {
  4562. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  4563. }
  4564. } else {
  4565. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  4566. if (isDef(data.props)) { mergeProps(props, data.props); }
  4567. }
  4568. var renderContext = new FunctionalRenderContext(
  4569. data,
  4570. props,
  4571. children,
  4572. contextVm,
  4573. Ctor
  4574. );
  4575. var vnode = options.render.call(null, renderContext._c, renderContext);
  4576. if (vnode instanceof VNode) {
  4577. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  4578. } else if (Array.isArray(vnode)) {
  4579. var vnodes = normalizeChildren(vnode) || [];
  4580. var res = new Array(vnodes.length);
  4581. for (var i = 0; i < vnodes.length; i++) {
  4582. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  4583. }
  4584. return res
  4585. }
  4586. }
  4587. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  4588. // #7817 clone node before setting fnContext, otherwise if the node is reused
  4589. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  4590. // that should not be matched to match.
  4591. var clone = cloneVNode(vnode);
  4592. clone.fnContext = contextVm;
  4593. clone.fnOptions = options;
  4594. if (true) {
  4595. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  4596. }
  4597. if (data.slot) {
  4598. (clone.data || (clone.data = {})).slot = data.slot;
  4599. }
  4600. return clone
  4601. }
  4602. function mergeProps (to, from) {
  4603. for (var key in from) {
  4604. to[camelize(key)] = from[key];
  4605. }
  4606. }
  4607. /* */
  4608. /* */
  4609. /* */
  4610. /* */
  4611. // inline hooks to be invoked on component VNodes during patch
  4612. var componentVNodeHooks = {
  4613. init: function init (vnode, hydrating) {
  4614. if (
  4615. vnode.componentInstance &&
  4616. !vnode.componentInstance._isDestroyed &&
  4617. vnode.data.keepAlive
  4618. ) {
  4619. // kept-alive components, treat as a patch
  4620. var mountedNode = vnode; // work around flow
  4621. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  4622. } else {
  4623. var child = vnode.componentInstance = createComponentInstanceForVnode(
  4624. vnode,
  4625. activeInstance
  4626. );
  4627. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  4628. }
  4629. },
  4630. prepatch: function prepatch (oldVnode, vnode) {
  4631. var options = vnode.componentOptions;
  4632. var child = vnode.componentInstance = oldVnode.componentInstance;
  4633. updateChildComponent(
  4634. child,
  4635. options.propsData, // updated props
  4636. options.listeners, // updated listeners
  4637. vnode, // new parent vnode
  4638. options.children // new children
  4639. );
  4640. },
  4641. insert: function insert (vnode) {
  4642. var context = vnode.context;
  4643. var componentInstance = vnode.componentInstance;
  4644. if (!componentInstance._isMounted) {
  4645. callHook(componentInstance, 'onServiceCreated');
  4646. callHook(componentInstance, 'onServiceAttached');
  4647. componentInstance._isMounted = true;
  4648. callHook(componentInstance, 'mounted');
  4649. }
  4650. if (vnode.data.keepAlive) {
  4651. if (context._isMounted) {
  4652. // vue-router#1212
  4653. // During updates, a kept-alive component's child components may
  4654. // change, so directly walking the tree here may call activated hooks
  4655. // on incorrect children. Instead we push them into a queue which will
  4656. // be processed after the whole patch process ended.
  4657. queueActivatedComponent(componentInstance);
  4658. } else {
  4659. activateChildComponent(componentInstance, true /* direct */);
  4660. }
  4661. }
  4662. },
  4663. destroy: function destroy (vnode) {
  4664. var componentInstance = vnode.componentInstance;
  4665. if (!componentInstance._isDestroyed) {
  4666. if (!vnode.data.keepAlive) {
  4667. componentInstance.$destroy();
  4668. } else {
  4669. deactivateChildComponent(componentInstance, true /* direct */);
  4670. }
  4671. }
  4672. }
  4673. };
  4674. var hooksToMerge = Object.keys(componentVNodeHooks);
  4675. function createComponent (
  4676. Ctor,
  4677. data,
  4678. context,
  4679. children,
  4680. tag
  4681. ) {
  4682. if (isUndef(Ctor)) {
  4683. return
  4684. }
  4685. var baseCtor = context.$options._base;
  4686. // plain options object: turn it into a constructor
  4687. if (isObject(Ctor)) {
  4688. Ctor = baseCtor.extend(Ctor);
  4689. }
  4690. // if at this stage it's not a constructor or an async component factory,
  4691. // reject.
  4692. if (typeof Ctor !== 'function') {
  4693. if (true) {
  4694. warn(("Invalid Component definition: " + (String(Ctor))), context);
  4695. }
  4696. return
  4697. }
  4698. // async component
  4699. var asyncFactory;
  4700. if (isUndef(Ctor.cid)) {
  4701. asyncFactory = Ctor;
  4702. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  4703. if (Ctor === undefined) {
  4704. // return a placeholder node for async component, which is rendered
  4705. // as a comment node but preserves all the raw information for the node.
  4706. // the information will be used for async server-rendering and hydration.
  4707. return createAsyncPlaceholder(
  4708. asyncFactory,
  4709. data,
  4710. context,
  4711. children,
  4712. tag
  4713. )
  4714. }
  4715. }
  4716. data = data || {};
  4717. // resolve constructor options in case global mixins are applied after
  4718. // component constructor creation
  4719. resolveConstructorOptions(Ctor);
  4720. // transform component v-model data into props & events
  4721. if (isDef(data.model)) {
  4722. transformModel(Ctor.options, data);
  4723. }
  4724. // extract props
  4725. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  4726. // functional component
  4727. if (isTrue(Ctor.options.functional)) {
  4728. return createFunctionalComponent(Ctor, propsData, data, context, children)
  4729. }
  4730. // extract listeners, since these needs to be treated as
  4731. // child component listeners instead of DOM listeners
  4732. var listeners = data.on;
  4733. // replace with listeners with .native modifier
  4734. // so it gets processed during parent component patch.
  4735. data.on = data.nativeOn;
  4736. if (isTrue(Ctor.options.abstract)) {
  4737. // abstract components do not keep anything
  4738. // other than props & listeners & slot
  4739. // work around flow
  4740. var slot = data.slot;
  4741. data = {};
  4742. if (slot) {
  4743. data.slot = slot;
  4744. }
  4745. }
  4746. // install component management hooks onto the placeholder node
  4747. installComponentHooks(data);
  4748. // return a placeholder vnode
  4749. var name = Ctor.options.name || tag;
  4750. var vnode = new VNode(
  4751. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  4752. data, undefined, undefined, undefined, context,
  4753. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  4754. asyncFactory
  4755. );
  4756. return vnode
  4757. }
  4758. function createComponentInstanceForVnode (
  4759. vnode, // we know it's MountedComponentVNode but flow doesn't
  4760. parent // activeInstance in lifecycle state
  4761. ) {
  4762. var options = {
  4763. _isComponent: true,
  4764. _parentVnode: vnode,
  4765. parent: parent
  4766. };
  4767. // check inline-template render functions
  4768. var inlineTemplate = vnode.data.inlineTemplate;
  4769. if (isDef(inlineTemplate)) {
  4770. options.render = inlineTemplate.render;
  4771. options.staticRenderFns = inlineTemplate.staticRenderFns;
  4772. }
  4773. return new vnode.componentOptions.Ctor(options)
  4774. }
  4775. function installComponentHooks (data) {
  4776. var hooks = data.hook || (data.hook = {});
  4777. for (var i = 0; i < hooksToMerge.length; i++) {
  4778. var key = hooksToMerge[i];
  4779. var existing = hooks[key];
  4780. var toMerge = componentVNodeHooks[key];
  4781. if (existing !== toMerge && !(existing && existing._merged)) {
  4782. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  4783. }
  4784. }
  4785. }
  4786. function mergeHook$1 (f1, f2) {
  4787. var merged = function (a, b) {
  4788. // flow complains about extra args which is why we use any
  4789. f1(a, b);
  4790. f2(a, b);
  4791. };
  4792. merged._merged = true;
  4793. return merged
  4794. }
  4795. // transform component v-model info (value and callback) into
  4796. // prop and event handler respectively.
  4797. function transformModel (options, data) {
  4798. var prop = (options.model && options.model.prop) || 'value';
  4799. var event = (options.model && options.model.event) || 'input'
  4800. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  4801. var on = data.on || (data.on = {});
  4802. var existing = on[event];
  4803. var callback = data.model.callback;
  4804. if (isDef(existing)) {
  4805. if (
  4806. Array.isArray(existing)
  4807. ? existing.indexOf(callback) === -1
  4808. : existing !== callback
  4809. ) {
  4810. on[event] = [callback].concat(existing);
  4811. }
  4812. } else {
  4813. on[event] = callback;
  4814. }
  4815. }
  4816. /* */
  4817. var SIMPLE_NORMALIZE = 1;
  4818. var ALWAYS_NORMALIZE = 2;
  4819. // wrapper function for providing a more flexible interface
  4820. // without getting yelled at by flow
  4821. function createElement (
  4822. context,
  4823. tag,
  4824. data,
  4825. children,
  4826. normalizationType,
  4827. alwaysNormalize
  4828. ) {
  4829. if (Array.isArray(data) || isPrimitive(data)) {
  4830. normalizationType = children;
  4831. children = data;
  4832. data = undefined;
  4833. }
  4834. if (isTrue(alwaysNormalize)) {
  4835. normalizationType = ALWAYS_NORMALIZE;
  4836. }
  4837. return _createElement(context, tag, data, children, normalizationType)
  4838. }
  4839. function _createElement (
  4840. context,
  4841. tag,
  4842. data,
  4843. children,
  4844. normalizationType
  4845. ) {
  4846. if (isDef(data) && isDef((data).__ob__)) {
  4847. true && warn(
  4848. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  4849. 'Always create fresh vnode data objects in each render!',
  4850. context
  4851. );
  4852. return createEmptyVNode()
  4853. }
  4854. // object syntax in v-bind
  4855. if (isDef(data) && isDef(data.is)) {
  4856. tag = data.is;
  4857. }
  4858. if (!tag) {
  4859. // in case of component :is set to falsy value
  4860. return createEmptyVNode()
  4861. }
  4862. // warn against non-primitive key
  4863. if ( true &&
  4864. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  4865. ) {
  4866. {
  4867. warn(
  4868. 'Avoid using non-primitive value as key, ' +
  4869. 'use string/number value instead.',
  4870. context
  4871. );
  4872. }
  4873. }
  4874. // support single function children as default scoped slot
  4875. if (Array.isArray(children) &&
  4876. typeof children[0] === 'function'
  4877. ) {
  4878. data = data || {};
  4879. data.scopedSlots = { default: children[0] };
  4880. children.length = 0;
  4881. }
  4882. if (normalizationType === ALWAYS_NORMALIZE) {
  4883. children = normalizeChildren(children);
  4884. } else if (normalizationType === SIMPLE_NORMALIZE) {
  4885. children = simpleNormalizeChildren(children);
  4886. }
  4887. var vnode, ns;
  4888. if (typeof tag === 'string') {
  4889. var Ctor;
  4890. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  4891. if (config.isReservedTag(tag)) {
  4892. // platform built-in elements
  4893. if ( true && isDef(data) && isDef(data.nativeOn)) {
  4894. warn(
  4895. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  4896. context
  4897. );
  4898. }
  4899. vnode = new VNode(
  4900. config.parsePlatformTagName(tag), data, children,
  4901. undefined, undefined, context
  4902. );
  4903. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  4904. // component
  4905. vnode = createComponent(Ctor, data, context, children, tag);
  4906. } else {
  4907. // unknown or unlisted namespaced elements
  4908. // check at runtime because it may get assigned a namespace when its
  4909. // parent normalizes children
  4910. vnode = new VNode(
  4911. tag, data, children,
  4912. undefined, undefined, context
  4913. );
  4914. }
  4915. } else {
  4916. // direct component options / constructor
  4917. vnode = createComponent(tag, data, context, children);
  4918. }
  4919. if (Array.isArray(vnode)) {
  4920. return vnode
  4921. } else if (isDef(vnode)) {
  4922. if (isDef(ns)) { applyNS(vnode, ns); }
  4923. if (isDef(data)) { registerDeepBindings(data); }
  4924. return vnode
  4925. } else {
  4926. return createEmptyVNode()
  4927. }
  4928. }
  4929. function applyNS (vnode, ns, force) {
  4930. vnode.ns = ns;
  4931. if (vnode.tag === 'foreignObject') {
  4932. // use default namespace inside foreignObject
  4933. ns = undefined;
  4934. force = true;
  4935. }
  4936. if (isDef(vnode.children)) {
  4937. for (var i = 0, l = vnode.children.length; i < l; i++) {
  4938. var child = vnode.children[i];
  4939. if (isDef(child.tag) && (
  4940. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  4941. applyNS(child, ns, force);
  4942. }
  4943. }
  4944. }
  4945. }
  4946. // ref #5318
  4947. // necessary to ensure parent re-render when deep bindings like :style and
  4948. // :class are used on slot nodes
  4949. function registerDeepBindings (data) {
  4950. if (isObject(data.style)) {
  4951. traverse(data.style);
  4952. }
  4953. if (isObject(data.class)) {
  4954. traverse(data.class);
  4955. }
  4956. }
  4957. /* */
  4958. function initRender (vm) {
  4959. vm._vnode = null; // the root of the child tree
  4960. vm._staticTrees = null; // v-once cached trees
  4961. var options = vm.$options;
  4962. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  4963. var renderContext = parentVnode && parentVnode.context;
  4964. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  4965. vm.$scopedSlots = emptyObject;
  4966. // bind the createElement fn to this instance
  4967. // so that we get proper render context inside it.
  4968. // args order: tag, data, children, normalizationType, alwaysNormalize
  4969. // internal version is used by render functions compiled from templates
  4970. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  4971. // normalization is always applied for the public version, used in
  4972. // user-written render functions.
  4973. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  4974. // $attrs & $listeners are exposed for easier HOC creation.
  4975. // they need to be reactive so that HOCs using them are always updated
  4976. var parentData = parentVnode && parentVnode.data;
  4977. /* istanbul ignore else */
  4978. if (true) {
  4979. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  4980. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  4981. }, true);
  4982. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  4983. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  4984. }, true);
  4985. } else {}
  4986. }
  4987. var currentRenderingInstance = null;
  4988. function renderMixin (Vue) {
  4989. // install runtime convenience helpers
  4990. installRenderHelpers(Vue.prototype);
  4991. Vue.prototype.$nextTick = function (fn) {
  4992. return nextTick(fn, this)
  4993. };
  4994. Vue.prototype._render = function () {
  4995. var vm = this;
  4996. var ref = vm.$options;
  4997. var render = ref.render;
  4998. var _parentVnode = ref._parentVnode;
  4999. if (_parentVnode) {
  5000. vm.$scopedSlots = normalizeScopedSlots(
  5001. _parentVnode.data.scopedSlots,
  5002. vm.$slots,
  5003. vm.$scopedSlots
  5004. );
  5005. }
  5006. // set parent vnode. this allows render functions to have access
  5007. // to the data on the placeholder node.
  5008. vm.$vnode = _parentVnode;
  5009. // render self
  5010. var vnode;
  5011. try {
  5012. // There's no need to maintain a stack because all render fns are called
  5013. // separately from one another. Nested component's render fns are called
  5014. // when parent component is patched.
  5015. currentRenderingInstance = vm;
  5016. vnode = render.call(vm._renderProxy, vm.$createElement);
  5017. } catch (e) {
  5018. handleError(e, vm, "render");
  5019. // return error render result,
  5020. // or previous vnode to prevent render error causing blank component
  5021. /* istanbul ignore else */
  5022. if ( true && vm.$options.renderError) {
  5023. try {
  5024. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  5025. } catch (e) {
  5026. handleError(e, vm, "renderError");
  5027. vnode = vm._vnode;
  5028. }
  5029. } else {
  5030. vnode = vm._vnode;
  5031. }
  5032. } finally {
  5033. currentRenderingInstance = null;
  5034. }
  5035. // if the returned array contains only a single node, allow it
  5036. if (Array.isArray(vnode) && vnode.length === 1) {
  5037. vnode = vnode[0];
  5038. }
  5039. // return empty vnode in case the render function errored out
  5040. if (!(vnode instanceof VNode)) {
  5041. if ( true && Array.isArray(vnode)) {
  5042. warn(
  5043. 'Multiple root nodes returned from render function. Render function ' +
  5044. 'should return a single root node.',
  5045. vm
  5046. );
  5047. }
  5048. vnode = createEmptyVNode();
  5049. }
  5050. // set parent
  5051. vnode.parent = _parentVnode;
  5052. return vnode
  5053. };
  5054. }
  5055. /* */
  5056. function ensureCtor (comp, base) {
  5057. if (
  5058. comp.__esModule ||
  5059. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  5060. ) {
  5061. comp = comp.default;
  5062. }
  5063. return isObject(comp)
  5064. ? base.extend(comp)
  5065. : comp
  5066. }
  5067. function createAsyncPlaceholder (
  5068. factory,
  5069. data,
  5070. context,
  5071. children,
  5072. tag
  5073. ) {
  5074. var node = createEmptyVNode();
  5075. node.asyncFactory = factory;
  5076. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  5077. return node
  5078. }
  5079. function resolveAsyncComponent (
  5080. factory,
  5081. baseCtor
  5082. ) {
  5083. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  5084. return factory.errorComp
  5085. }
  5086. if (isDef(factory.resolved)) {
  5087. return factory.resolved
  5088. }
  5089. var owner = currentRenderingInstance;
  5090. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  5091. // already pending
  5092. factory.owners.push(owner);
  5093. }
  5094. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  5095. return factory.loadingComp
  5096. }
  5097. if (owner && !isDef(factory.owners)) {
  5098. var owners = factory.owners = [owner];
  5099. var sync = true;
  5100. var timerLoading = null;
  5101. var timerTimeout = null
  5102. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  5103. var forceRender = function (renderCompleted) {
  5104. for (var i = 0, l = owners.length; i < l; i++) {
  5105. (owners[i]).$forceUpdate();
  5106. }
  5107. if (renderCompleted) {
  5108. owners.length = 0;
  5109. if (timerLoading !== null) {
  5110. clearTimeout(timerLoading);
  5111. timerLoading = null;
  5112. }
  5113. if (timerTimeout !== null) {
  5114. clearTimeout(timerTimeout);
  5115. timerTimeout = null;
  5116. }
  5117. }
  5118. };
  5119. var resolve = once(function (res) {
  5120. // cache resolved
  5121. factory.resolved = ensureCtor(res, baseCtor);
  5122. // invoke callbacks only if this is not a synchronous resolve
  5123. // (async resolves are shimmed as synchronous during SSR)
  5124. if (!sync) {
  5125. forceRender(true);
  5126. } else {
  5127. owners.length = 0;
  5128. }
  5129. });
  5130. var reject = once(function (reason) {
  5131. true && warn(
  5132. "Failed to resolve async component: " + (String(factory)) +
  5133. (reason ? ("\nReason: " + reason) : '')
  5134. );
  5135. if (isDef(factory.errorComp)) {
  5136. factory.error = true;
  5137. forceRender(true);
  5138. }
  5139. });
  5140. var res = factory(resolve, reject);
  5141. if (isObject(res)) {
  5142. if (isPromise(res)) {
  5143. // () => Promise
  5144. if (isUndef(factory.resolved)) {
  5145. res.then(resolve, reject);
  5146. }
  5147. } else if (isPromise(res.component)) {
  5148. res.component.then(resolve, reject);
  5149. if (isDef(res.error)) {
  5150. factory.errorComp = ensureCtor(res.error, baseCtor);
  5151. }
  5152. if (isDef(res.loading)) {
  5153. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  5154. if (res.delay === 0) {
  5155. factory.loading = true;
  5156. } else {
  5157. timerLoading = setTimeout(function () {
  5158. timerLoading = null;
  5159. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  5160. factory.loading = true;
  5161. forceRender(false);
  5162. }
  5163. }, res.delay || 200);
  5164. }
  5165. }
  5166. if (isDef(res.timeout)) {
  5167. timerTimeout = setTimeout(function () {
  5168. timerTimeout = null;
  5169. if (isUndef(factory.resolved)) {
  5170. reject(
  5171. true
  5172. ? ("timeout (" + (res.timeout) + "ms)")
  5173. : undefined
  5174. );
  5175. }
  5176. }, res.timeout);
  5177. }
  5178. }
  5179. }
  5180. sync = false;
  5181. // return in case resolved synchronously
  5182. return factory.loading
  5183. ? factory.loadingComp
  5184. : factory.resolved
  5185. }
  5186. }
  5187. /* */
  5188. function isAsyncPlaceholder (node) {
  5189. return node.isComment && node.asyncFactory
  5190. }
  5191. /* */
  5192. function getFirstComponentChild (children) {
  5193. if (Array.isArray(children)) {
  5194. for (var i = 0; i < children.length; i++) {
  5195. var c = children[i];
  5196. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  5197. return c
  5198. }
  5199. }
  5200. }
  5201. }
  5202. /* */
  5203. /* */
  5204. function initEvents (vm) {
  5205. vm._events = Object.create(null);
  5206. vm._hasHookEvent = false;
  5207. // init parent attached events
  5208. var listeners = vm.$options._parentListeners;
  5209. if (listeners) {
  5210. updateComponentListeners(vm, listeners);
  5211. }
  5212. }
  5213. var target;
  5214. function add (event, fn) {
  5215. target.$on(event, fn);
  5216. }
  5217. function remove$1 (event, fn) {
  5218. target.$off(event, fn);
  5219. }
  5220. function createOnceHandler (event, fn) {
  5221. var _target = target;
  5222. return function onceHandler () {
  5223. var res = fn.apply(null, arguments);
  5224. if (res !== null) {
  5225. _target.$off(event, onceHandler);
  5226. }
  5227. }
  5228. }
  5229. function updateComponentListeners (
  5230. vm,
  5231. listeners,
  5232. oldListeners
  5233. ) {
  5234. target = vm;
  5235. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  5236. target = undefined;
  5237. }
  5238. function eventsMixin (Vue) {
  5239. var hookRE = /^hook:/;
  5240. Vue.prototype.$on = function (event, fn) {
  5241. var vm = this;
  5242. if (Array.isArray(event)) {
  5243. for (var i = 0, l = event.length; i < l; i++) {
  5244. vm.$on(event[i], fn);
  5245. }
  5246. } else {
  5247. (vm._events[event] || (vm._events[event] = [])).push(fn);
  5248. // optimize hook:event cost by using a boolean flag marked at registration
  5249. // instead of a hash lookup
  5250. if (hookRE.test(event)) {
  5251. vm._hasHookEvent = true;
  5252. }
  5253. }
  5254. return vm
  5255. };
  5256. Vue.prototype.$once = function (event, fn) {
  5257. var vm = this;
  5258. function on () {
  5259. vm.$off(event, on);
  5260. fn.apply(vm, arguments);
  5261. }
  5262. on.fn = fn;
  5263. vm.$on(event, on);
  5264. return vm
  5265. };
  5266. Vue.prototype.$off = function (event, fn) {
  5267. var vm = this;
  5268. // all
  5269. if (!arguments.length) {
  5270. vm._events = Object.create(null);
  5271. return vm
  5272. }
  5273. // array of events
  5274. if (Array.isArray(event)) {
  5275. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  5276. vm.$off(event[i$1], fn);
  5277. }
  5278. return vm
  5279. }
  5280. // specific event
  5281. var cbs = vm._events[event];
  5282. if (!cbs) {
  5283. return vm
  5284. }
  5285. if (!fn) {
  5286. vm._events[event] = null;
  5287. return vm
  5288. }
  5289. // specific handler
  5290. var cb;
  5291. var i = cbs.length;
  5292. while (i--) {
  5293. cb = cbs[i];
  5294. if (cb === fn || cb.fn === fn) {
  5295. cbs.splice(i, 1);
  5296. break
  5297. }
  5298. }
  5299. return vm
  5300. };
  5301. Vue.prototype.$emit = function (event) {
  5302. var vm = this;
  5303. if (true) {
  5304. var lowerCaseEvent = event.toLowerCase();
  5305. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  5306. tip(
  5307. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  5308. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  5309. "Note that HTML attributes are case-insensitive and you cannot use " +
  5310. "v-on to listen to camelCase events when using in-DOM templates. " +
  5311. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  5312. );
  5313. }
  5314. }
  5315. var cbs = vm._events[event];
  5316. if (cbs) {
  5317. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  5318. var args = toArray(arguments, 1);
  5319. var info = "event handler for \"" + event + "\"";
  5320. for (var i = 0, l = cbs.length; i < l; i++) {
  5321. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  5322. }
  5323. }
  5324. return vm
  5325. };
  5326. }
  5327. /* */
  5328. var activeInstance = null;
  5329. var isUpdatingChildComponent = false;
  5330. function setActiveInstance(vm) {
  5331. var prevActiveInstance = activeInstance;
  5332. activeInstance = vm;
  5333. return function () {
  5334. activeInstance = prevActiveInstance;
  5335. }
  5336. }
  5337. function initLifecycle (vm) {
  5338. var options = vm.$options;
  5339. // locate first non-abstract parent
  5340. var parent = options.parent;
  5341. if (parent && !options.abstract) {
  5342. while (parent.$options.abstract && parent.$parent) {
  5343. parent = parent.$parent;
  5344. }
  5345. parent.$children.push(vm);
  5346. }
  5347. vm.$parent = parent;
  5348. vm.$root = parent ? parent.$root : vm;
  5349. vm.$children = [];
  5350. vm.$refs = {};
  5351. vm._watcher = null;
  5352. vm._inactive = null;
  5353. vm._directInactive = false;
  5354. vm._isMounted = false;
  5355. vm._isDestroyed = false;
  5356. vm._isBeingDestroyed = false;
  5357. }
  5358. function lifecycleMixin (Vue) {
  5359. Vue.prototype._update = function (vnode, hydrating) {
  5360. var vm = this;
  5361. var prevEl = vm.$el;
  5362. var prevVnode = vm._vnode;
  5363. var restoreActiveInstance = setActiveInstance(vm);
  5364. vm._vnode = vnode;
  5365. // Vue.prototype.__patch__ is injected in entry points
  5366. // based on the rendering backend used.
  5367. if (!prevVnode) {
  5368. // initial render
  5369. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  5370. } else {
  5371. // updates
  5372. vm.$el = vm.__patch__(prevVnode, vnode);
  5373. }
  5374. restoreActiveInstance();
  5375. // update __vue__ reference
  5376. if (prevEl) {
  5377. prevEl.__vue__ = null;
  5378. }
  5379. if (vm.$el) {
  5380. vm.$el.__vue__ = vm;
  5381. }
  5382. // if parent is an HOC, update its $el as well
  5383. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  5384. vm.$parent.$el = vm.$el;
  5385. }
  5386. // updated hook is called by the scheduler to ensure that children are
  5387. // updated in a parent's updated hook.
  5388. };
  5389. Vue.prototype.$forceUpdate = function () {
  5390. var vm = this;
  5391. if (vm._watcher) {
  5392. vm._watcher.update();
  5393. }
  5394. };
  5395. Vue.prototype.$destroy = function () {
  5396. var vm = this;
  5397. if (vm._isBeingDestroyed) {
  5398. return
  5399. }
  5400. callHook(vm, 'beforeDestroy');
  5401. vm._isBeingDestroyed = true;
  5402. // remove self from parent
  5403. var parent = vm.$parent;
  5404. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  5405. remove(parent.$children, vm);
  5406. }
  5407. // teardown watchers
  5408. if (vm._watcher) {
  5409. vm._watcher.teardown();
  5410. }
  5411. var i = vm._watchers.length;
  5412. while (i--) {
  5413. vm._watchers[i].teardown();
  5414. }
  5415. // remove reference from data ob
  5416. // frozen object may not have observer.
  5417. if (vm._data.__ob__) {
  5418. vm._data.__ob__.vmCount--;
  5419. }
  5420. // call the last hook...
  5421. vm._isDestroyed = true;
  5422. // invoke destroy hooks on current rendered tree
  5423. vm.__patch__(vm._vnode, null);
  5424. // fire destroyed hook
  5425. callHook(vm, 'destroyed');
  5426. // turn off all instance listeners.
  5427. vm.$off();
  5428. // remove __vue__ reference
  5429. if (vm.$el) {
  5430. vm.$el.__vue__ = null;
  5431. }
  5432. // release circular reference (#6759)
  5433. if (vm.$vnode) {
  5434. vm.$vnode.parent = null;
  5435. }
  5436. };
  5437. }
  5438. function updateChildComponent (
  5439. vm,
  5440. propsData,
  5441. listeners,
  5442. parentVnode,
  5443. renderChildren
  5444. ) {
  5445. if (true) {
  5446. isUpdatingChildComponent = true;
  5447. }
  5448. // determine whether component has slot children
  5449. // we need to do this before overwriting $options._renderChildren.
  5450. // check if there are dynamic scopedSlots (hand-written or compiled but with
  5451. // dynamic slot names). Static scoped slots compiled from template has the
  5452. // "$stable" marker.
  5453. var newScopedSlots = parentVnode.data.scopedSlots;
  5454. var oldScopedSlots = vm.$scopedSlots;
  5455. var hasDynamicScopedSlot = !!(
  5456. (newScopedSlots && !newScopedSlots.$stable) ||
  5457. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  5458. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  5459. );
  5460. // Any static slot children from the parent may have changed during parent's
  5461. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  5462. // update is necessary to ensure correctness.
  5463. var needsForceUpdate = !!(
  5464. renderChildren || // has new static slots
  5465. vm.$options._renderChildren || // has old static slots
  5466. hasDynamicScopedSlot
  5467. );
  5468. vm.$options._parentVnode = parentVnode;
  5469. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  5470. if (vm._vnode) { // update child tree's parent
  5471. vm._vnode.parent = parentVnode;
  5472. }
  5473. vm.$options._renderChildren = renderChildren;
  5474. // update $attrs and $listeners hash
  5475. // these are also reactive so they may trigger child update if the child
  5476. // used them during render
  5477. vm.$attrs = parentVnode.data.attrs || emptyObject;
  5478. vm.$listeners = listeners || emptyObject;
  5479. // update props
  5480. if (propsData && vm.$options.props) {
  5481. toggleObserving(false);
  5482. var props = vm._props;
  5483. var propKeys = vm.$options._propKeys || [];
  5484. for (var i = 0; i < propKeys.length; i++) {
  5485. var key = propKeys[i];
  5486. var propOptions = vm.$options.props; // wtf flow?
  5487. props[key] = validateProp(key, propOptions, propsData, vm);
  5488. }
  5489. toggleObserving(true);
  5490. // keep a copy of raw propsData
  5491. vm.$options.propsData = propsData;
  5492. }
  5493. // fixed by xxxxxx update properties(mp runtime)
  5494. vm._$updateProperties && vm._$updateProperties(vm);
  5495. // update listeners
  5496. listeners = listeners || emptyObject;
  5497. var oldListeners = vm.$options._parentListeners;
  5498. vm.$options._parentListeners = listeners;
  5499. updateComponentListeners(vm, listeners, oldListeners);
  5500. // resolve slots + force update if has children
  5501. if (needsForceUpdate) {
  5502. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  5503. vm.$forceUpdate();
  5504. }
  5505. if (true) {
  5506. isUpdatingChildComponent = false;
  5507. }
  5508. }
  5509. function isInInactiveTree (vm) {
  5510. while (vm && (vm = vm.$parent)) {
  5511. if (vm._inactive) { return true }
  5512. }
  5513. return false
  5514. }
  5515. function activateChildComponent (vm, direct) {
  5516. if (direct) {
  5517. vm._directInactive = false;
  5518. if (isInInactiveTree(vm)) {
  5519. return
  5520. }
  5521. } else if (vm._directInactive) {
  5522. return
  5523. }
  5524. if (vm._inactive || vm._inactive === null) {
  5525. vm._inactive = false;
  5526. for (var i = 0; i < vm.$children.length; i++) {
  5527. activateChildComponent(vm.$children[i]);
  5528. }
  5529. callHook(vm, 'activated');
  5530. }
  5531. }
  5532. function deactivateChildComponent (vm, direct) {
  5533. if (direct) {
  5534. vm._directInactive = true;
  5535. if (isInInactiveTree(vm)) {
  5536. return
  5537. }
  5538. }
  5539. if (!vm._inactive) {
  5540. vm._inactive = true;
  5541. for (var i = 0; i < vm.$children.length; i++) {
  5542. deactivateChildComponent(vm.$children[i]);
  5543. }
  5544. callHook(vm, 'deactivated');
  5545. }
  5546. }
  5547. function callHook (vm, hook) {
  5548. // #7573 disable dep collection when invoking lifecycle hooks
  5549. pushTarget();
  5550. var handlers = vm.$options[hook];
  5551. var info = hook + " hook";
  5552. if (handlers) {
  5553. for (var i = 0, j = handlers.length; i < j; i++) {
  5554. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  5555. }
  5556. }
  5557. if (vm._hasHookEvent) {
  5558. vm.$emit('hook:' + hook);
  5559. }
  5560. popTarget();
  5561. }
  5562. /* */
  5563. var MAX_UPDATE_COUNT = 100;
  5564. var queue = [];
  5565. var activatedChildren = [];
  5566. var has = {};
  5567. var circular = {};
  5568. var waiting = false;
  5569. var flushing = false;
  5570. var index = 0;
  5571. /**
  5572. * Reset the scheduler's state.
  5573. */
  5574. function resetSchedulerState () {
  5575. index = queue.length = activatedChildren.length = 0;
  5576. has = {};
  5577. if (true) {
  5578. circular = {};
  5579. }
  5580. waiting = flushing = false;
  5581. }
  5582. // Async edge case #6566 requires saving the timestamp when event listeners are
  5583. // attached. However, calling performance.now() has a perf overhead especially
  5584. // if the page has thousands of event listeners. Instead, we take a timestamp
  5585. // every time the scheduler flushes and use that for all event listeners
  5586. // attached during that flush.
  5587. var currentFlushTimestamp = 0;
  5588. // Async edge case fix requires storing an event listener's attach timestamp.
  5589. var getNow = Date.now;
  5590. // Determine what event timestamp the browser is using. Annoyingly, the
  5591. // timestamp can either be hi-res (relative to page load) or low-res
  5592. // (relative to UNIX epoch), so in order to compare time we have to use the
  5593. // same timestamp type when saving the flush timestamp.
  5594. // All IE versions use low-res event timestamps, and have problematic clock
  5595. // implementations (#9632)
  5596. if (inBrowser && !isIE) {
  5597. var performance = window.performance;
  5598. if (
  5599. performance &&
  5600. typeof performance.now === 'function' &&
  5601. getNow() > document.createEvent('Event').timeStamp
  5602. ) {
  5603. // if the event timestamp, although evaluated AFTER the Date.now(), is
  5604. // smaller than it, it means the event is using a hi-res timestamp,
  5605. // and we need to use the hi-res version for event listener timestamps as
  5606. // well.
  5607. getNow = function () { return performance.now(); };
  5608. }
  5609. }
  5610. /**
  5611. * Flush both queues and run the watchers.
  5612. */
  5613. function flushSchedulerQueue () {
  5614. currentFlushTimestamp = getNow();
  5615. flushing = true;
  5616. var watcher, id;
  5617. // Sort queue before flush.
  5618. // This ensures that:
  5619. // 1. Components are updated from parent to child. (because parent is always
  5620. // created before the child)
  5621. // 2. A component's user watchers are run before its render watcher (because
  5622. // user watchers are created before the render watcher)
  5623. // 3. If a component is destroyed during a parent component's watcher run,
  5624. // its watchers can be skipped.
  5625. queue.sort(function (a, b) { return a.id - b.id; });
  5626. // do not cache length because more watchers might be pushed
  5627. // as we run existing watchers
  5628. for (index = 0; index < queue.length; index++) {
  5629. watcher = queue[index];
  5630. if (watcher.before) {
  5631. watcher.before();
  5632. }
  5633. id = watcher.id;
  5634. has[id] = null;
  5635. watcher.run();
  5636. // in dev build, check and stop circular updates.
  5637. if ( true && has[id] != null) {
  5638. circular[id] = (circular[id] || 0) + 1;
  5639. if (circular[id] > MAX_UPDATE_COUNT) {
  5640. warn(
  5641. 'You may have an infinite update loop ' + (
  5642. watcher.user
  5643. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  5644. : "in a component render function."
  5645. ),
  5646. watcher.vm
  5647. );
  5648. break
  5649. }
  5650. }
  5651. }
  5652. // keep copies of post queues before resetting state
  5653. var activatedQueue = activatedChildren.slice();
  5654. var updatedQueue = queue.slice();
  5655. resetSchedulerState();
  5656. // call component updated and activated hooks
  5657. callActivatedHooks(activatedQueue);
  5658. callUpdatedHooks(updatedQueue);
  5659. // devtool hook
  5660. /* istanbul ignore if */
  5661. if (devtools && config.devtools) {
  5662. devtools.emit('flush');
  5663. }
  5664. }
  5665. function callUpdatedHooks (queue) {
  5666. var i = queue.length;
  5667. while (i--) {
  5668. var watcher = queue[i];
  5669. var vm = watcher.vm;
  5670. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  5671. callHook(vm, 'updated');
  5672. }
  5673. }
  5674. }
  5675. /**
  5676. * Queue a kept-alive component that was activated during patch.
  5677. * The queue will be processed after the entire tree has been patched.
  5678. */
  5679. function queueActivatedComponent (vm) {
  5680. // setting _inactive to false here so that a render function can
  5681. // rely on checking whether it's in an inactive tree (e.g. router-view)
  5682. vm._inactive = false;
  5683. activatedChildren.push(vm);
  5684. }
  5685. function callActivatedHooks (queue) {
  5686. for (var i = 0; i < queue.length; i++) {
  5687. queue[i]._inactive = true;
  5688. activateChildComponent(queue[i], true /* true */);
  5689. }
  5690. }
  5691. /**
  5692. * Push a watcher into the watcher queue.
  5693. * Jobs with duplicate IDs will be skipped unless it's
  5694. * pushed when the queue is being flushed.
  5695. */
  5696. function queueWatcher (watcher) {
  5697. var id = watcher.id;
  5698. if (has[id] == null) {
  5699. has[id] = true;
  5700. if (!flushing) {
  5701. queue.push(watcher);
  5702. } else {
  5703. // if already flushing, splice the watcher based on its id
  5704. // if already past its id, it will be run next immediately.
  5705. var i = queue.length - 1;
  5706. while (i > index && queue[i].id > watcher.id) {
  5707. i--;
  5708. }
  5709. queue.splice(i + 1, 0, watcher);
  5710. }
  5711. // queue the flush
  5712. if (!waiting) {
  5713. waiting = true;
  5714. if ( true && !config.async) {
  5715. flushSchedulerQueue();
  5716. return
  5717. }
  5718. nextTick(flushSchedulerQueue);
  5719. }
  5720. }
  5721. }
  5722. /* */
  5723. var uid$2 = 0;
  5724. /**
  5725. * A watcher parses an expression, collects dependencies,
  5726. * and fires callback when the expression value changes.
  5727. * This is used for both the $watch() api and directives.
  5728. */
  5729. var Watcher = function Watcher (
  5730. vm,
  5731. expOrFn,
  5732. cb,
  5733. options,
  5734. isRenderWatcher
  5735. ) {
  5736. this.vm = vm;
  5737. if (isRenderWatcher) {
  5738. vm._watcher = this;
  5739. }
  5740. vm._watchers.push(this);
  5741. // options
  5742. if (options) {
  5743. this.deep = !!options.deep;
  5744. this.user = !!options.user;
  5745. this.lazy = !!options.lazy;
  5746. this.sync = !!options.sync;
  5747. this.before = options.before;
  5748. } else {
  5749. this.deep = this.user = this.lazy = this.sync = false;
  5750. }
  5751. this.cb = cb;
  5752. this.id = ++uid$2; // uid for batching
  5753. this.active = true;
  5754. this.dirty = this.lazy; // for lazy watchers
  5755. this.deps = [];
  5756. this.newDeps = [];
  5757. this.depIds = new _Set();
  5758. this.newDepIds = new _Set();
  5759. this.expression = true
  5760. ? expOrFn.toString()
  5761. : undefined;
  5762. // parse expression for getter
  5763. if (typeof expOrFn === 'function') {
  5764. this.getter = expOrFn;
  5765. } else {
  5766. this.getter = parsePath(expOrFn);
  5767. if (!this.getter) {
  5768. this.getter = noop;
  5769. true && warn(
  5770. "Failed watching path: \"" + expOrFn + "\" " +
  5771. 'Watcher only accepts simple dot-delimited paths. ' +
  5772. 'For full control, use a function instead.',
  5773. vm
  5774. );
  5775. }
  5776. }
  5777. this.value = this.lazy
  5778. ? undefined
  5779. : this.get();
  5780. };
  5781. /**
  5782. * Evaluate the getter, and re-collect dependencies.
  5783. */
  5784. Watcher.prototype.get = function get () {
  5785. pushTarget(this);
  5786. var value;
  5787. var vm = this.vm;
  5788. try {
  5789. value = this.getter.call(vm, vm);
  5790. } catch (e) {
  5791. if (this.user) {
  5792. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  5793. } else {
  5794. throw e
  5795. }
  5796. } finally {
  5797. // "touch" every property so they are all tracked as
  5798. // dependencies for deep watching
  5799. if (this.deep) {
  5800. traverse(value);
  5801. }
  5802. popTarget();
  5803. this.cleanupDeps();
  5804. }
  5805. return value
  5806. };
  5807. /**
  5808. * Add a dependency to this directive.
  5809. */
  5810. Watcher.prototype.addDep = function addDep (dep) {
  5811. var id = dep.id;
  5812. if (!this.newDepIds.has(id)) {
  5813. this.newDepIds.add(id);
  5814. this.newDeps.push(dep);
  5815. if (!this.depIds.has(id)) {
  5816. dep.addSub(this);
  5817. }
  5818. }
  5819. };
  5820. /**
  5821. * Clean up for dependency collection.
  5822. */
  5823. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  5824. var i = this.deps.length;
  5825. while (i--) {
  5826. var dep = this.deps[i];
  5827. if (!this.newDepIds.has(dep.id)) {
  5828. dep.removeSub(this);
  5829. }
  5830. }
  5831. var tmp = this.depIds;
  5832. this.depIds = this.newDepIds;
  5833. this.newDepIds = tmp;
  5834. this.newDepIds.clear();
  5835. tmp = this.deps;
  5836. this.deps = this.newDeps;
  5837. this.newDeps = tmp;
  5838. this.newDeps.length = 0;
  5839. };
  5840. /**
  5841. * Subscriber interface.
  5842. * Will be called when a dependency changes.
  5843. */
  5844. Watcher.prototype.update = function update () {
  5845. /* istanbul ignore else */
  5846. if (this.lazy) {
  5847. this.dirty = true;
  5848. } else if (this.sync) {
  5849. this.run();
  5850. } else {
  5851. queueWatcher(this);
  5852. }
  5853. };
  5854. /**
  5855. * Scheduler job interface.
  5856. * Will be called by the scheduler.
  5857. */
  5858. Watcher.prototype.run = function run () {
  5859. if (this.active) {
  5860. var value = this.get();
  5861. if (
  5862. value !== this.value ||
  5863. // Deep watchers and watchers on Object/Arrays should fire even
  5864. // when the value is the same, because the value may
  5865. // have mutated.
  5866. isObject(value) ||
  5867. this.deep
  5868. ) {
  5869. // set new value
  5870. var oldValue = this.value;
  5871. this.value = value;
  5872. if (this.user) {
  5873. try {
  5874. this.cb.call(this.vm, value, oldValue);
  5875. } catch (e) {
  5876. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  5877. }
  5878. } else {
  5879. this.cb.call(this.vm, value, oldValue);
  5880. }
  5881. }
  5882. }
  5883. };
  5884. /**
  5885. * Evaluate the value of the watcher.
  5886. * This only gets called for lazy watchers.
  5887. */
  5888. Watcher.prototype.evaluate = function evaluate () {
  5889. this.value = this.get();
  5890. this.dirty = false;
  5891. };
  5892. /**
  5893. * Depend on all deps collected by this watcher.
  5894. */
  5895. Watcher.prototype.depend = function depend () {
  5896. var i = this.deps.length;
  5897. while (i--) {
  5898. this.deps[i].depend();
  5899. }
  5900. };
  5901. /**
  5902. * Remove self from all dependencies' subscriber list.
  5903. */
  5904. Watcher.prototype.teardown = function teardown () {
  5905. if (this.active) {
  5906. // remove self from vm's watcher list
  5907. // this is a somewhat expensive operation so we skip it
  5908. // if the vm is being destroyed.
  5909. if (!this.vm._isBeingDestroyed) {
  5910. remove(this.vm._watchers, this);
  5911. }
  5912. var i = this.deps.length;
  5913. while (i--) {
  5914. this.deps[i].removeSub(this);
  5915. }
  5916. this.active = false;
  5917. }
  5918. };
  5919. /* */
  5920. var sharedPropertyDefinition = {
  5921. enumerable: true,
  5922. configurable: true,
  5923. get: noop,
  5924. set: noop
  5925. };
  5926. function proxy (target, sourceKey, key) {
  5927. sharedPropertyDefinition.get = function proxyGetter () {
  5928. return this[sourceKey][key]
  5929. };
  5930. sharedPropertyDefinition.set = function proxySetter (val) {
  5931. this[sourceKey][key] = val;
  5932. };
  5933. Object.defineProperty(target, key, sharedPropertyDefinition);
  5934. }
  5935. function initState (vm) {
  5936. vm._watchers = [];
  5937. var opts = vm.$options;
  5938. if (opts.props) { initProps(vm, opts.props); }
  5939. if (opts.methods) { initMethods(vm, opts.methods); }
  5940. if (opts.data) {
  5941. initData(vm);
  5942. } else {
  5943. observe(vm._data = {}, true /* asRootData */);
  5944. }
  5945. if (opts.computed) { initComputed(vm, opts.computed); }
  5946. if (opts.watch && opts.watch !== nativeWatch) {
  5947. initWatch(vm, opts.watch);
  5948. }
  5949. }
  5950. function initProps (vm, propsOptions) {
  5951. var propsData = vm.$options.propsData || {};
  5952. var props = vm._props = {};
  5953. // cache prop keys so that future props updates can iterate using Array
  5954. // instead of dynamic object key enumeration.
  5955. var keys = vm.$options._propKeys = [];
  5956. var isRoot = !vm.$parent;
  5957. // root instance props should be converted
  5958. if (!isRoot) {
  5959. toggleObserving(false);
  5960. }
  5961. var loop = function ( key ) {
  5962. keys.push(key);
  5963. var value = validateProp(key, propsOptions, propsData, vm);
  5964. /* istanbul ignore else */
  5965. if (true) {
  5966. var hyphenatedKey = hyphenate(key);
  5967. if (isReservedAttribute(hyphenatedKey) ||
  5968. config.isReservedAttr(hyphenatedKey)) {
  5969. warn(
  5970. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  5971. vm
  5972. );
  5973. }
  5974. defineReactive$$1(props, key, value, function () {
  5975. if (!isRoot && !isUpdatingChildComponent) {
  5976. {
  5977. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou'){//百度、快手 observer 在 setData callback 之后触发,直接忽略该 warn
  5978. return
  5979. }
  5980. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  5981. if(
  5982. key === 'value' &&
  5983. Array.isArray(vm.$options.behaviors) &&
  5984. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  5985. ){
  5986. return
  5987. }
  5988. if(vm._getFormData){
  5989. return
  5990. }
  5991. var $parent = vm.$parent;
  5992. while($parent){
  5993. if($parent.__next_tick_pending){
  5994. return
  5995. }
  5996. $parent = $parent.$parent;
  5997. }
  5998. }
  5999. warn(
  6000. "Avoid mutating a prop directly since the value will be " +
  6001. "overwritten whenever the parent component re-renders. " +
  6002. "Instead, use a data or computed property based on the prop's " +
  6003. "value. Prop being mutated: \"" + key + "\"",
  6004. vm
  6005. );
  6006. }
  6007. });
  6008. } else {}
  6009. // static props are already proxied on the component's prototype
  6010. // during Vue.extend(). We only need to proxy props defined at
  6011. // instantiation here.
  6012. if (!(key in vm)) {
  6013. proxy(vm, "_props", key);
  6014. }
  6015. };
  6016. for (var key in propsOptions) loop( key );
  6017. toggleObserving(true);
  6018. }
  6019. function initData (vm) {
  6020. var data = vm.$options.data;
  6021. data = vm._data = typeof data === 'function'
  6022. ? getData(data, vm)
  6023. : data || {};
  6024. if (!isPlainObject(data)) {
  6025. data = {};
  6026. true && warn(
  6027. 'data functions should return an object:\n' +
  6028. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  6029. vm
  6030. );
  6031. }
  6032. // proxy data on instance
  6033. var keys = Object.keys(data);
  6034. var props = vm.$options.props;
  6035. var methods = vm.$options.methods;
  6036. var i = keys.length;
  6037. while (i--) {
  6038. var key = keys[i];
  6039. if (true) {
  6040. if (methods && hasOwn(methods, key)) {
  6041. warn(
  6042. ("Method \"" + key + "\" has already been defined as a data property."),
  6043. vm
  6044. );
  6045. }
  6046. }
  6047. if (props && hasOwn(props, key)) {
  6048. true && warn(
  6049. "The data property \"" + key + "\" is already declared as a prop. " +
  6050. "Use prop default value instead.",
  6051. vm
  6052. );
  6053. } else if (!isReserved(key)) {
  6054. proxy(vm, "_data", key);
  6055. }
  6056. }
  6057. // observe data
  6058. observe(data, true /* asRootData */);
  6059. }
  6060. function getData (data, vm) {
  6061. // #7573 disable dep collection when invoking data getters
  6062. pushTarget();
  6063. try {
  6064. return data.call(vm, vm)
  6065. } catch (e) {
  6066. handleError(e, vm, "data()");
  6067. return {}
  6068. } finally {
  6069. popTarget();
  6070. }
  6071. }
  6072. var computedWatcherOptions = { lazy: true };
  6073. function initComputed (vm, computed) {
  6074. // $flow-disable-line
  6075. var watchers = vm._computedWatchers = Object.create(null);
  6076. // computed properties are just getters during SSR
  6077. var isSSR = isServerRendering();
  6078. for (var key in computed) {
  6079. var userDef = computed[key];
  6080. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  6081. if ( true && getter == null) {
  6082. warn(
  6083. ("Getter is missing for computed property \"" + key + "\"."),
  6084. vm
  6085. );
  6086. }
  6087. if (!isSSR) {
  6088. // create internal watcher for the computed property.
  6089. watchers[key] = new Watcher(
  6090. vm,
  6091. getter || noop,
  6092. noop,
  6093. computedWatcherOptions
  6094. );
  6095. }
  6096. // component-defined computed properties are already defined on the
  6097. // component prototype. We only need to define computed properties defined
  6098. // at instantiation here.
  6099. if (!(key in vm)) {
  6100. defineComputed(vm, key, userDef);
  6101. } else if (true) {
  6102. if (key in vm.$data) {
  6103. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  6104. } else if (vm.$options.props && key in vm.$options.props) {
  6105. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  6106. }
  6107. }
  6108. }
  6109. }
  6110. function defineComputed (
  6111. target,
  6112. key,
  6113. userDef
  6114. ) {
  6115. var shouldCache = !isServerRendering();
  6116. if (typeof userDef === 'function') {
  6117. sharedPropertyDefinition.get = shouldCache
  6118. ? createComputedGetter(key)
  6119. : createGetterInvoker(userDef);
  6120. sharedPropertyDefinition.set = noop;
  6121. } else {
  6122. sharedPropertyDefinition.get = userDef.get
  6123. ? shouldCache && userDef.cache !== false
  6124. ? createComputedGetter(key)
  6125. : createGetterInvoker(userDef.get)
  6126. : noop;
  6127. sharedPropertyDefinition.set = userDef.set || noop;
  6128. }
  6129. if ( true &&
  6130. sharedPropertyDefinition.set === noop) {
  6131. sharedPropertyDefinition.set = function () {
  6132. warn(
  6133. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  6134. this
  6135. );
  6136. };
  6137. }
  6138. Object.defineProperty(target, key, sharedPropertyDefinition);
  6139. }
  6140. function createComputedGetter (key) {
  6141. return function computedGetter () {
  6142. var watcher = this._computedWatchers && this._computedWatchers[key];
  6143. if (watcher) {
  6144. if (watcher.dirty) {
  6145. watcher.evaluate();
  6146. }
  6147. if (Dep.SharedObject.target) {// fixed by xxxxxx
  6148. watcher.depend();
  6149. }
  6150. return watcher.value
  6151. }
  6152. }
  6153. }
  6154. function createGetterInvoker(fn) {
  6155. return function computedGetter () {
  6156. return fn.call(this, this)
  6157. }
  6158. }
  6159. function initMethods (vm, methods) {
  6160. var props = vm.$options.props;
  6161. for (var key in methods) {
  6162. if (true) {
  6163. if (typeof methods[key] !== 'function') {
  6164. warn(
  6165. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  6166. "Did you reference the function correctly?",
  6167. vm
  6168. );
  6169. }
  6170. if (props && hasOwn(props, key)) {
  6171. warn(
  6172. ("Method \"" + key + "\" has already been defined as a prop."),
  6173. vm
  6174. );
  6175. }
  6176. if ((key in vm) && isReserved(key)) {
  6177. warn(
  6178. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  6179. "Avoid defining component methods that start with _ or $."
  6180. );
  6181. }
  6182. }
  6183. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  6184. }
  6185. }
  6186. function initWatch (vm, watch) {
  6187. for (var key in watch) {
  6188. var handler = watch[key];
  6189. if (Array.isArray(handler)) {
  6190. for (var i = 0; i < handler.length; i++) {
  6191. createWatcher(vm, key, handler[i]);
  6192. }
  6193. } else {
  6194. createWatcher(vm, key, handler);
  6195. }
  6196. }
  6197. }
  6198. function createWatcher (
  6199. vm,
  6200. expOrFn,
  6201. handler,
  6202. options
  6203. ) {
  6204. if (isPlainObject(handler)) {
  6205. options = handler;
  6206. handler = handler.handler;
  6207. }
  6208. if (typeof handler === 'string') {
  6209. handler = vm[handler];
  6210. }
  6211. return vm.$watch(expOrFn, handler, options)
  6212. }
  6213. function stateMixin (Vue) {
  6214. // flow somehow has problems with directly declared definition object
  6215. // when using Object.defineProperty, so we have to procedurally build up
  6216. // the object here.
  6217. var dataDef = {};
  6218. dataDef.get = function () { return this._data };
  6219. var propsDef = {};
  6220. propsDef.get = function () { return this._props };
  6221. if (true) {
  6222. dataDef.set = function () {
  6223. warn(
  6224. 'Avoid replacing instance root $data. ' +
  6225. 'Use nested data properties instead.',
  6226. this
  6227. );
  6228. };
  6229. propsDef.set = function () {
  6230. warn("$props is readonly.", this);
  6231. };
  6232. }
  6233. Object.defineProperty(Vue.prototype, '$data', dataDef);
  6234. Object.defineProperty(Vue.prototype, '$props', propsDef);
  6235. Vue.prototype.$set = set;
  6236. Vue.prototype.$delete = del;
  6237. Vue.prototype.$watch = function (
  6238. expOrFn,
  6239. cb,
  6240. options
  6241. ) {
  6242. var vm = this;
  6243. if (isPlainObject(cb)) {
  6244. return createWatcher(vm, expOrFn, cb, options)
  6245. }
  6246. options = options || {};
  6247. options.user = true;
  6248. var watcher = new Watcher(vm, expOrFn, cb, options);
  6249. if (options.immediate) {
  6250. try {
  6251. cb.call(vm, watcher.value);
  6252. } catch (error) {
  6253. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  6254. }
  6255. }
  6256. return function unwatchFn () {
  6257. watcher.teardown();
  6258. }
  6259. };
  6260. }
  6261. /* */
  6262. var uid$3 = 0;
  6263. function initMixin (Vue) {
  6264. Vue.prototype._init = function (options) {
  6265. var vm = this;
  6266. // a uid
  6267. vm._uid = uid$3++;
  6268. var startTag, endTag;
  6269. /* istanbul ignore if */
  6270. if ( true && config.performance && mark) {
  6271. startTag = "vue-perf-start:" + (vm._uid);
  6272. endTag = "vue-perf-end:" + (vm._uid);
  6273. mark(startTag);
  6274. }
  6275. // a flag to avoid this being observed
  6276. vm._isVue = true;
  6277. // merge options
  6278. if (options && options._isComponent) {
  6279. // optimize internal component instantiation
  6280. // since dynamic options merging is pretty slow, and none of the
  6281. // internal component options needs special treatment.
  6282. initInternalComponent(vm, options);
  6283. } else {
  6284. vm.$options = mergeOptions(
  6285. resolveConstructorOptions(vm.constructor),
  6286. options || {},
  6287. vm
  6288. );
  6289. }
  6290. /* istanbul ignore else */
  6291. if (true) {
  6292. initProxy(vm);
  6293. } else {}
  6294. // expose real self
  6295. vm._self = vm;
  6296. initLifecycle(vm);
  6297. initEvents(vm);
  6298. initRender(vm);
  6299. callHook(vm, 'beforeCreate');
  6300. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  6301. initState(vm);
  6302. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  6303. !vm._$fallback && callHook(vm, 'created');
  6304. /* istanbul ignore if */
  6305. if ( true && config.performance && mark) {
  6306. vm._name = formatComponentName(vm, false);
  6307. mark(endTag);
  6308. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  6309. }
  6310. if (vm.$options.el) {
  6311. vm.$mount(vm.$options.el);
  6312. }
  6313. };
  6314. }
  6315. function initInternalComponent (vm, options) {
  6316. var opts = vm.$options = Object.create(vm.constructor.options);
  6317. // doing this because it's faster than dynamic enumeration.
  6318. var parentVnode = options._parentVnode;
  6319. opts.parent = options.parent;
  6320. opts._parentVnode = parentVnode;
  6321. var vnodeComponentOptions = parentVnode.componentOptions;
  6322. opts.propsData = vnodeComponentOptions.propsData;
  6323. opts._parentListeners = vnodeComponentOptions.listeners;
  6324. opts._renderChildren = vnodeComponentOptions.children;
  6325. opts._componentTag = vnodeComponentOptions.tag;
  6326. if (options.render) {
  6327. opts.render = options.render;
  6328. opts.staticRenderFns = options.staticRenderFns;
  6329. }
  6330. }
  6331. function resolveConstructorOptions (Ctor) {
  6332. var options = Ctor.options;
  6333. if (Ctor.super) {
  6334. var superOptions = resolveConstructorOptions(Ctor.super);
  6335. var cachedSuperOptions = Ctor.superOptions;
  6336. if (superOptions !== cachedSuperOptions) {
  6337. // super option changed,
  6338. // need to resolve new options.
  6339. Ctor.superOptions = superOptions;
  6340. // check if there are any late-modified/attached options (#4976)
  6341. var modifiedOptions = resolveModifiedOptions(Ctor);
  6342. // update base extend options
  6343. if (modifiedOptions) {
  6344. extend(Ctor.extendOptions, modifiedOptions);
  6345. }
  6346. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  6347. if (options.name) {
  6348. options.components[options.name] = Ctor;
  6349. }
  6350. }
  6351. }
  6352. return options
  6353. }
  6354. function resolveModifiedOptions (Ctor) {
  6355. var modified;
  6356. var latest = Ctor.options;
  6357. var sealed = Ctor.sealedOptions;
  6358. for (var key in latest) {
  6359. if (latest[key] !== sealed[key]) {
  6360. if (!modified) { modified = {}; }
  6361. modified[key] = latest[key];
  6362. }
  6363. }
  6364. return modified
  6365. }
  6366. function Vue (options) {
  6367. if ( true &&
  6368. !(this instanceof Vue)
  6369. ) {
  6370. warn('Vue is a constructor and should be called with the `new` keyword');
  6371. }
  6372. this._init(options);
  6373. }
  6374. initMixin(Vue);
  6375. stateMixin(Vue);
  6376. eventsMixin(Vue);
  6377. lifecycleMixin(Vue);
  6378. renderMixin(Vue);
  6379. /* */
  6380. function initUse (Vue) {
  6381. Vue.use = function (plugin) {
  6382. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  6383. if (installedPlugins.indexOf(plugin) > -1) {
  6384. return this
  6385. }
  6386. // additional parameters
  6387. var args = toArray(arguments, 1);
  6388. args.unshift(this);
  6389. if (typeof plugin.install === 'function') {
  6390. plugin.install.apply(plugin, args);
  6391. } else if (typeof plugin === 'function') {
  6392. plugin.apply(null, args);
  6393. }
  6394. installedPlugins.push(plugin);
  6395. return this
  6396. };
  6397. }
  6398. /* */
  6399. function initMixin$1 (Vue) {
  6400. Vue.mixin = function (mixin) {
  6401. this.options = mergeOptions(this.options, mixin);
  6402. return this
  6403. };
  6404. }
  6405. /* */
  6406. function initExtend (Vue) {
  6407. /**
  6408. * Each instance constructor, including Vue, has a unique
  6409. * cid. This enables us to create wrapped "child
  6410. * constructors" for prototypal inheritance and cache them.
  6411. */
  6412. Vue.cid = 0;
  6413. var cid = 1;
  6414. /**
  6415. * Class inheritance
  6416. */
  6417. Vue.extend = function (extendOptions) {
  6418. extendOptions = extendOptions || {};
  6419. var Super = this;
  6420. var SuperId = Super.cid;
  6421. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  6422. if (cachedCtors[SuperId]) {
  6423. return cachedCtors[SuperId]
  6424. }
  6425. var name = extendOptions.name || Super.options.name;
  6426. if ( true && name) {
  6427. validateComponentName(name);
  6428. }
  6429. var Sub = function VueComponent (options) {
  6430. this._init(options);
  6431. };
  6432. Sub.prototype = Object.create(Super.prototype);
  6433. Sub.prototype.constructor = Sub;
  6434. Sub.cid = cid++;
  6435. Sub.options = mergeOptions(
  6436. Super.options,
  6437. extendOptions
  6438. );
  6439. Sub['super'] = Super;
  6440. // For props and computed properties, we define the proxy getters on
  6441. // the Vue instances at extension time, on the extended prototype. This
  6442. // avoids Object.defineProperty calls for each instance created.
  6443. if (Sub.options.props) {
  6444. initProps$1(Sub);
  6445. }
  6446. if (Sub.options.computed) {
  6447. initComputed$1(Sub);
  6448. }
  6449. // allow further extension/mixin/plugin usage
  6450. Sub.extend = Super.extend;
  6451. Sub.mixin = Super.mixin;
  6452. Sub.use = Super.use;
  6453. // create asset registers, so extended classes
  6454. // can have their private assets too.
  6455. ASSET_TYPES.forEach(function (type) {
  6456. Sub[type] = Super[type];
  6457. });
  6458. // enable recursive self-lookup
  6459. if (name) {
  6460. Sub.options.components[name] = Sub;
  6461. }
  6462. // keep a reference to the super options at extension time.
  6463. // later at instantiation we can check if Super's options have
  6464. // been updated.
  6465. Sub.superOptions = Super.options;
  6466. Sub.extendOptions = extendOptions;
  6467. Sub.sealedOptions = extend({}, Sub.options);
  6468. // cache constructor
  6469. cachedCtors[SuperId] = Sub;
  6470. return Sub
  6471. };
  6472. }
  6473. function initProps$1 (Comp) {
  6474. var props = Comp.options.props;
  6475. for (var key in props) {
  6476. proxy(Comp.prototype, "_props", key);
  6477. }
  6478. }
  6479. function initComputed$1 (Comp) {
  6480. var computed = Comp.options.computed;
  6481. for (var key in computed) {
  6482. defineComputed(Comp.prototype, key, computed[key]);
  6483. }
  6484. }
  6485. /* */
  6486. function initAssetRegisters (Vue) {
  6487. /**
  6488. * Create asset registration methods.
  6489. */
  6490. ASSET_TYPES.forEach(function (type) {
  6491. Vue[type] = function (
  6492. id,
  6493. definition
  6494. ) {
  6495. if (!definition) {
  6496. return this.options[type + 's'][id]
  6497. } else {
  6498. /* istanbul ignore if */
  6499. if ( true && type === 'component') {
  6500. validateComponentName(id);
  6501. }
  6502. if (type === 'component' && isPlainObject(definition)) {
  6503. definition.name = definition.name || id;
  6504. definition = this.options._base.extend(definition);
  6505. }
  6506. if (type === 'directive' && typeof definition === 'function') {
  6507. definition = { bind: definition, update: definition };
  6508. }
  6509. this.options[type + 's'][id] = definition;
  6510. return definition
  6511. }
  6512. };
  6513. });
  6514. }
  6515. /* */
  6516. function getComponentName (opts) {
  6517. return opts && (opts.Ctor.options.name || opts.tag)
  6518. }
  6519. function matches (pattern, name) {
  6520. if (Array.isArray(pattern)) {
  6521. return pattern.indexOf(name) > -1
  6522. } else if (typeof pattern === 'string') {
  6523. return pattern.split(',').indexOf(name) > -1
  6524. } else if (isRegExp(pattern)) {
  6525. return pattern.test(name)
  6526. }
  6527. /* istanbul ignore next */
  6528. return false
  6529. }
  6530. function pruneCache (keepAliveInstance, filter) {
  6531. var cache = keepAliveInstance.cache;
  6532. var keys = keepAliveInstance.keys;
  6533. var _vnode = keepAliveInstance._vnode;
  6534. for (var key in cache) {
  6535. var cachedNode = cache[key];
  6536. if (cachedNode) {
  6537. var name = getComponentName(cachedNode.componentOptions);
  6538. if (name && !filter(name)) {
  6539. pruneCacheEntry(cache, key, keys, _vnode);
  6540. }
  6541. }
  6542. }
  6543. }
  6544. function pruneCacheEntry (
  6545. cache,
  6546. key,
  6547. keys,
  6548. current
  6549. ) {
  6550. var cached$$1 = cache[key];
  6551. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  6552. cached$$1.componentInstance.$destroy();
  6553. }
  6554. cache[key] = null;
  6555. remove(keys, key);
  6556. }
  6557. var patternTypes = [String, RegExp, Array];
  6558. var KeepAlive = {
  6559. name: 'keep-alive',
  6560. abstract: true,
  6561. props: {
  6562. include: patternTypes,
  6563. exclude: patternTypes,
  6564. max: [String, Number]
  6565. },
  6566. created: function created () {
  6567. this.cache = Object.create(null);
  6568. this.keys = [];
  6569. },
  6570. destroyed: function destroyed () {
  6571. for (var key in this.cache) {
  6572. pruneCacheEntry(this.cache, key, this.keys);
  6573. }
  6574. },
  6575. mounted: function mounted () {
  6576. var this$1 = this;
  6577. this.$watch('include', function (val) {
  6578. pruneCache(this$1, function (name) { return matches(val, name); });
  6579. });
  6580. this.$watch('exclude', function (val) {
  6581. pruneCache(this$1, function (name) { return !matches(val, name); });
  6582. });
  6583. },
  6584. render: function render () {
  6585. var slot = this.$slots.default;
  6586. var vnode = getFirstComponentChild(slot);
  6587. var componentOptions = vnode && vnode.componentOptions;
  6588. if (componentOptions) {
  6589. // check pattern
  6590. var name = getComponentName(componentOptions);
  6591. var ref = this;
  6592. var include = ref.include;
  6593. var exclude = ref.exclude;
  6594. if (
  6595. // not included
  6596. (include && (!name || !matches(include, name))) ||
  6597. // excluded
  6598. (exclude && name && matches(exclude, name))
  6599. ) {
  6600. return vnode
  6601. }
  6602. var ref$1 = this;
  6603. var cache = ref$1.cache;
  6604. var keys = ref$1.keys;
  6605. var key = vnode.key == null
  6606. // same constructor may get registered as different local components
  6607. // so cid alone is not enough (#3269)
  6608. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  6609. : vnode.key;
  6610. if (cache[key]) {
  6611. vnode.componentInstance = cache[key].componentInstance;
  6612. // make current key freshest
  6613. remove(keys, key);
  6614. keys.push(key);
  6615. } else {
  6616. cache[key] = vnode;
  6617. keys.push(key);
  6618. // prune oldest entry
  6619. if (this.max && keys.length > parseInt(this.max)) {
  6620. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  6621. }
  6622. }
  6623. vnode.data.keepAlive = true;
  6624. }
  6625. return vnode || (slot && slot[0])
  6626. }
  6627. };
  6628. var builtInComponents = {
  6629. KeepAlive: KeepAlive
  6630. };
  6631. /* */
  6632. function initGlobalAPI (Vue) {
  6633. // config
  6634. var configDef = {};
  6635. configDef.get = function () { return config; };
  6636. if (true) {
  6637. configDef.set = function () {
  6638. warn(
  6639. 'Do not replace the Vue.config object, set individual fields instead.'
  6640. );
  6641. };
  6642. }
  6643. Object.defineProperty(Vue, 'config', configDef);
  6644. // exposed util methods.
  6645. // NOTE: these are not considered part of the public API - avoid relying on
  6646. // them unless you are aware of the risk.
  6647. Vue.util = {
  6648. warn: warn,
  6649. extend: extend,
  6650. mergeOptions: mergeOptions,
  6651. defineReactive: defineReactive$$1
  6652. };
  6653. Vue.set = set;
  6654. Vue.delete = del;
  6655. Vue.nextTick = nextTick;
  6656. // 2.6 explicit observable API
  6657. Vue.observable = function (obj) {
  6658. observe(obj);
  6659. return obj
  6660. };
  6661. Vue.options = Object.create(null);
  6662. ASSET_TYPES.forEach(function (type) {
  6663. Vue.options[type + 's'] = Object.create(null);
  6664. });
  6665. // this is used to identify the "base" constructor to extend all plain-object
  6666. // components with in Weex's multi-instance scenarios.
  6667. Vue.options._base = Vue;
  6668. extend(Vue.options.components, builtInComponents);
  6669. initUse(Vue);
  6670. initMixin$1(Vue);
  6671. initExtend(Vue);
  6672. initAssetRegisters(Vue);
  6673. }
  6674. initGlobalAPI(Vue);
  6675. Object.defineProperty(Vue.prototype, '$isServer', {
  6676. get: isServerRendering
  6677. });
  6678. Object.defineProperty(Vue.prototype, '$ssrContext', {
  6679. get: function get () {
  6680. /* istanbul ignore next */
  6681. return this.$vnode && this.$vnode.ssrContext
  6682. }
  6683. });
  6684. // expose FunctionalRenderContext for ssr runtime helper installation
  6685. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  6686. value: FunctionalRenderContext
  6687. });
  6688. Vue.version = '2.6.11';
  6689. /**
  6690. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  6691. */
  6692. var ARRAYTYPE = '[object Array]';
  6693. var OBJECTTYPE = '[object Object]';
  6694. // const FUNCTIONTYPE = '[object Function]'
  6695. function diff(current, pre) {
  6696. var result = {};
  6697. syncKeys(current, pre);
  6698. _diff(current, pre, '', result);
  6699. return result
  6700. }
  6701. function syncKeys(current, pre) {
  6702. if (current === pre) { return }
  6703. var rootCurrentType = type(current);
  6704. var rootPreType = type(pre);
  6705. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  6706. if(Object.keys(current).length >= Object.keys(pre).length){
  6707. for (var key in pre) {
  6708. var currentValue = current[key];
  6709. if (currentValue === undefined) {
  6710. current[key] = null;
  6711. } else {
  6712. syncKeys(currentValue, pre[key]);
  6713. }
  6714. }
  6715. }
  6716. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  6717. if (current.length >= pre.length) {
  6718. pre.forEach(function (item, index) {
  6719. syncKeys(current[index], item);
  6720. });
  6721. }
  6722. }
  6723. }
  6724. function _diff(current, pre, path, result) {
  6725. if (current === pre) { return }
  6726. var rootCurrentType = type(current);
  6727. var rootPreType = type(pre);
  6728. if (rootCurrentType == OBJECTTYPE) {
  6729. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  6730. setResult(result, path, current);
  6731. } else {
  6732. var loop = function ( key ) {
  6733. var currentValue = current[key];
  6734. var preValue = pre[key];
  6735. var currentType = type(currentValue);
  6736. var preType = type(preValue);
  6737. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  6738. // NOTE 此处将 != 修改为 !==。涉及地方太多恐怕测试不到,如果出现数据对比问题,将其修改回来。
  6739. if (currentValue !== pre[key]) {
  6740. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6741. }
  6742. } else if (currentType == ARRAYTYPE) {
  6743. if (preType != ARRAYTYPE) {
  6744. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6745. } else {
  6746. if (currentValue.length < preValue.length) {
  6747. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6748. } else {
  6749. currentValue.forEach(function (item, index) {
  6750. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  6751. });
  6752. }
  6753. }
  6754. } else if (currentType == OBJECTTYPE) {
  6755. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  6756. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6757. } else {
  6758. for (var subKey in currentValue) {
  6759. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  6760. }
  6761. }
  6762. }
  6763. };
  6764. for (var key in current) loop( key );
  6765. }
  6766. } else if (rootCurrentType == ARRAYTYPE) {
  6767. if (rootPreType != ARRAYTYPE) {
  6768. setResult(result, path, current);
  6769. } else {
  6770. if (current.length < pre.length) {
  6771. setResult(result, path, current);
  6772. } else {
  6773. current.forEach(function (item, index) {
  6774. _diff(item, pre[index], path + '[' + index + ']', result);
  6775. });
  6776. }
  6777. }
  6778. } else {
  6779. setResult(result, path, current);
  6780. }
  6781. }
  6782. function setResult(result, k, v) {
  6783. // if (type(v) != FUNCTIONTYPE) {
  6784. result[k] = v;
  6785. // }
  6786. }
  6787. function type(obj) {
  6788. return Object.prototype.toString.call(obj)
  6789. }
  6790. /* */
  6791. function flushCallbacks$1(vm) {
  6792. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  6793. if (Object({"VUE_APP_NAME":"uView UI已发布Sketch和Axure设计资源示例","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6794. var mpInstance = vm.$scope;
  6795. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6796. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  6797. }
  6798. var copies = vm.__next_tick_callbacks.slice(0);
  6799. vm.__next_tick_callbacks.length = 0;
  6800. for (var i = 0; i < copies.length; i++) {
  6801. copies[i]();
  6802. }
  6803. }
  6804. }
  6805. function hasRenderWatcher(vm) {
  6806. return queue.find(function (watcher) { return vm._watcher === watcher; })
  6807. }
  6808. function nextTick$1(vm, cb) {
  6809. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  6810. //2.nextTick 之前存在 render watcher
  6811. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  6812. if(Object({"VUE_APP_NAME":"uView UI已发布Sketch和Axure设计资源示例","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  6813. var mpInstance = vm.$scope;
  6814. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6815. ']:nextVueTick');
  6816. }
  6817. return nextTick(cb, vm)
  6818. }else{
  6819. if(Object({"VUE_APP_NAME":"uView UI已发布Sketch和Axure设计资源示例","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  6820. var mpInstance$1 = vm.$scope;
  6821. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  6822. ']:nextMPTick');
  6823. }
  6824. }
  6825. var _resolve;
  6826. if (!vm.__next_tick_callbacks) {
  6827. vm.__next_tick_callbacks = [];
  6828. }
  6829. vm.__next_tick_callbacks.push(function () {
  6830. if (cb) {
  6831. try {
  6832. cb.call(vm);
  6833. } catch (e) {
  6834. handleError(e, vm, 'nextTick');
  6835. }
  6836. } else if (_resolve) {
  6837. _resolve(vm);
  6838. }
  6839. });
  6840. // $flow-disable-line
  6841. if (!cb && typeof Promise !== 'undefined') {
  6842. return new Promise(function (resolve) {
  6843. _resolve = resolve;
  6844. })
  6845. }
  6846. }
  6847. /* */
  6848. function cloneWithData(vm) {
  6849. // 确保当前 vm 所有数据被同步
  6850. var ret = Object.create(null);
  6851. var dataKeys = [].concat(
  6852. Object.keys(vm._data || {}),
  6853. Object.keys(vm._computedWatchers || {}));
  6854. dataKeys.reduce(function(ret, key) {
  6855. ret[key] = vm[key];
  6856. return ret
  6857. }, ret);
  6858. // vue-composition-api
  6859. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  6860. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  6861. if (rawBindings) {
  6862. Object.keys(rawBindings).forEach(function (key) {
  6863. ret[key] = vm[key];
  6864. });
  6865. }
  6866. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  6867. Object.assign(ret, vm.$mp.data || {});
  6868. if (
  6869. Array.isArray(vm.$options.behaviors) &&
  6870. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  6871. ) { //form-field
  6872. ret['name'] = vm.name;
  6873. ret['value'] = vm.value;
  6874. }
  6875. return JSON.parse(JSON.stringify(ret))
  6876. }
  6877. var patch = function(oldVnode, vnode) {
  6878. var this$1 = this;
  6879. if (vnode === null) { //destroy
  6880. return
  6881. }
  6882. if (this.mpType === 'page' || this.mpType === 'component') {
  6883. var mpInstance = this.$scope;
  6884. var data = Object.create(null);
  6885. try {
  6886. data = cloneWithData(this);
  6887. } catch (err) {
  6888. console.error(err);
  6889. }
  6890. data.__webviewId__ = mpInstance.data.__webviewId__;
  6891. var mpData = Object.create(null);
  6892. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  6893. mpData[key] = mpInstance.data[key];
  6894. });
  6895. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  6896. if (Object.keys(diffData).length) {
  6897. if (Object({"VUE_APP_NAME":"uView UI已发布Sketch和Axure设计资源示例","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6898. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  6899. ']差量更新',
  6900. JSON.stringify(diffData));
  6901. }
  6902. this.__next_tick_pending = true;
  6903. mpInstance.setData(diffData, function () {
  6904. this$1.__next_tick_pending = false;
  6905. flushCallbacks$1(this$1);
  6906. });
  6907. } else {
  6908. flushCallbacks$1(this);
  6909. }
  6910. }
  6911. };
  6912. /* */
  6913. function createEmptyRender() {
  6914. }
  6915. function mountComponent$1(
  6916. vm,
  6917. el,
  6918. hydrating
  6919. ) {
  6920. if (!vm.mpType) {//main.js 中的 new Vue
  6921. return vm
  6922. }
  6923. if (vm.mpType === 'app') {
  6924. vm.$options.render = createEmptyRender;
  6925. }
  6926. if (!vm.$options.render) {
  6927. vm.$options.render = createEmptyRender;
  6928. if (true) {
  6929. /* istanbul ignore if */
  6930. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  6931. vm.$options.el || el) {
  6932. warn(
  6933. 'You are using the runtime-only build of Vue where the template ' +
  6934. 'compiler is not available. Either pre-compile the templates into ' +
  6935. 'render functions, or use the compiler-included build.',
  6936. vm
  6937. );
  6938. } else {
  6939. warn(
  6940. 'Failed to mount component: template or render function not defined.',
  6941. vm
  6942. );
  6943. }
  6944. }
  6945. }
  6946. !vm._$fallback && callHook(vm, 'beforeMount');
  6947. var updateComponent = function () {
  6948. vm._update(vm._render(), hydrating);
  6949. };
  6950. // we set this to vm._watcher inside the watcher's constructor
  6951. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  6952. // component's mounted hook), which relies on vm._watcher being already defined
  6953. new Watcher(vm, updateComponent, noop, {
  6954. before: function before() {
  6955. if (vm._isMounted && !vm._isDestroyed) {
  6956. callHook(vm, 'beforeUpdate');
  6957. }
  6958. }
  6959. }, true /* isRenderWatcher */);
  6960. hydrating = false;
  6961. return vm
  6962. }
  6963. /* */
  6964. function renderClass (
  6965. staticClass,
  6966. dynamicClass
  6967. ) {
  6968. if (isDef(staticClass) || isDef(dynamicClass)) {
  6969. return concat(staticClass, stringifyClass(dynamicClass))
  6970. }
  6971. /* istanbul ignore next */
  6972. return ''
  6973. }
  6974. function concat (a, b) {
  6975. return a ? b ? (a + ' ' + b) : a : (b || '')
  6976. }
  6977. function stringifyClass (value) {
  6978. if (Array.isArray(value)) {
  6979. return stringifyArray(value)
  6980. }
  6981. if (isObject(value)) {
  6982. return stringifyObject(value)
  6983. }
  6984. if (typeof value === 'string') {
  6985. return value
  6986. }
  6987. /* istanbul ignore next */
  6988. return ''
  6989. }
  6990. function stringifyArray (value) {
  6991. var res = '';
  6992. var stringified;
  6993. for (var i = 0, l = value.length; i < l; i++) {
  6994. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  6995. if (res) { res += ' '; }
  6996. res += stringified;
  6997. }
  6998. }
  6999. return res
  7000. }
  7001. function stringifyObject (value) {
  7002. var res = '';
  7003. for (var key in value) {
  7004. if (value[key]) {
  7005. if (res) { res += ' '; }
  7006. res += key;
  7007. }
  7008. }
  7009. return res
  7010. }
  7011. /* */
  7012. var parseStyleText = cached(function (cssText) {
  7013. var res = {};
  7014. var listDelimiter = /;(?![^(]*\))/g;
  7015. var propertyDelimiter = /:(.+)/;
  7016. cssText.split(listDelimiter).forEach(function (item) {
  7017. if (item) {
  7018. var tmp = item.split(propertyDelimiter);
  7019. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  7020. }
  7021. });
  7022. return res
  7023. });
  7024. // normalize possible array / string values into Object
  7025. function normalizeStyleBinding (bindingStyle) {
  7026. if (Array.isArray(bindingStyle)) {
  7027. return toObject(bindingStyle)
  7028. }
  7029. if (typeof bindingStyle === 'string') {
  7030. return parseStyleText(bindingStyle)
  7031. }
  7032. return bindingStyle
  7033. }
  7034. /* */
  7035. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  7036. function getTarget(obj, path) {
  7037. var parts = path.split('.');
  7038. var key = parts[0];
  7039. if (key.indexOf('__$n') === 0) { //number index
  7040. key = parseInt(key.replace('__$n', ''));
  7041. }
  7042. if (parts.length === 1) {
  7043. return obj[key]
  7044. }
  7045. return getTarget(obj[key], parts.slice(1).join('.'))
  7046. }
  7047. function internalMixin(Vue) {
  7048. Vue.config.errorHandler = function(err, vm, info) {
  7049. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  7050. console.error(err);
  7051. /* eslint-disable no-undef */
  7052. var app = typeof getApp === 'function' && getApp();
  7053. if (app && app.onError) {
  7054. app.onError(err);
  7055. }
  7056. };
  7057. var oldEmit = Vue.prototype.$emit;
  7058. Vue.prototype.$emit = function(event) {
  7059. if (this.$scope && event) {
  7060. (this.$scope['_triggerEvent'] || this.$scope['triggerEvent'])
  7061. .call(this.$scope, event, {
  7062. __args__: toArray(arguments, 1)
  7063. })
  7064. }
  7065. return oldEmit.apply(this, arguments)
  7066. };
  7067. Vue.prototype.$nextTick = function(fn) {
  7068. return nextTick$1(this, fn)
  7069. };
  7070. MP_METHODS.forEach(function (method) {
  7071. Vue.prototype[method] = function(args) {
  7072. if (this.$scope && this.$scope[method]) {
  7073. return this.$scope[method](args)
  7074. }
  7075. // mp-alipay
  7076. if (typeof my === 'undefined') {
  7077. return
  7078. }
  7079. if (method === 'createSelectorQuery') {
  7080. /* eslint-disable no-undef */
  7081. return my.createSelectorQuery(args)
  7082. } else if (method === 'createIntersectionObserver') {
  7083. /* eslint-disable no-undef */
  7084. return my.createIntersectionObserver(args)
  7085. }
  7086. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  7087. };
  7088. });
  7089. Vue.prototype.__init_provide = initProvide;
  7090. Vue.prototype.__init_injections = initInjections;
  7091. Vue.prototype.__call_hook = function(hook, args) {
  7092. var vm = this;
  7093. // #7573 disable dep collection when invoking lifecycle hooks
  7094. pushTarget();
  7095. var handlers = vm.$options[hook];
  7096. var info = hook + " hook";
  7097. var ret;
  7098. if (handlers) {
  7099. for (var i = 0, j = handlers.length; i < j; i++) {
  7100. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  7101. }
  7102. }
  7103. if (vm._hasHookEvent) {
  7104. vm.$emit('hook:' + hook, args);
  7105. }
  7106. popTarget();
  7107. return ret
  7108. };
  7109. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  7110. if (Array.isArray(modifiers)) {
  7111. if (modifiers.indexOf('trim') !== -1) {
  7112. value = value.trim();
  7113. }
  7114. if (modifiers.indexOf('number') !== -1) {
  7115. value = this._n(value);
  7116. }
  7117. }
  7118. if (!target) {
  7119. target = this;
  7120. }
  7121. // 解决动态属性添加
  7122. Vue.set(target, key, value)
  7123. };
  7124. Vue.prototype.__set_sync = function(target, key, value) {
  7125. if (!target) {
  7126. target = this;
  7127. }
  7128. // 解决动态属性添加
  7129. Vue.set(target, key, value)
  7130. };
  7131. Vue.prototype.__get_orig = function(item) {
  7132. if (isPlainObject(item)) {
  7133. return item['$orig'] || item
  7134. }
  7135. return item
  7136. };
  7137. Vue.prototype.__get_value = function(dataPath, target) {
  7138. return getTarget(target || this, dataPath)
  7139. };
  7140. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  7141. return renderClass(staticClass, dynamicClass)
  7142. };
  7143. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  7144. if (!dynamicStyle && !staticStyle) {
  7145. return ''
  7146. }
  7147. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  7148. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  7149. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  7150. };
  7151. Vue.prototype.__map = function(val, iteratee) {
  7152. //TODO 暂不考虑 string
  7153. var ret, i, l, keys, key;
  7154. if (Array.isArray(val)) {
  7155. ret = new Array(val.length);
  7156. for (i = 0, l = val.length; i < l; i++) {
  7157. ret[i] = iteratee(val[i], i);
  7158. }
  7159. return ret
  7160. } else if (isObject(val)) {
  7161. keys = Object.keys(val);
  7162. ret = Object.create(null);
  7163. for (i = 0, l = keys.length; i < l; i++) {
  7164. key = keys[i];
  7165. ret[key] = iteratee(val[key], key, i);
  7166. }
  7167. return ret
  7168. } else if (typeof val === 'number') {
  7169. ret = new Array(val);
  7170. for (i = 0, l = val; i < l; i++) {
  7171. // 第一个参数暂时仍和小程序一致
  7172. ret[i] = iteratee(i, i);
  7173. }
  7174. return ret
  7175. }
  7176. return []
  7177. };
  7178. }
  7179. /* */
  7180. var LIFECYCLE_HOOKS$1 = [
  7181. //App
  7182. 'onLaunch',
  7183. 'onShow',
  7184. 'onHide',
  7185. 'onUniNViewMessage',
  7186. 'onPageNotFound',
  7187. 'onThemeChange',
  7188. 'onError',
  7189. 'onUnhandledRejection',
  7190. //Page
  7191. 'onInit',
  7192. 'onLoad',
  7193. // 'onShow',
  7194. 'onReady',
  7195. // 'onHide',
  7196. 'onUnload',
  7197. 'onPullDownRefresh',
  7198. 'onReachBottom',
  7199. 'onTabItemTap',
  7200. 'onAddToFavorites',
  7201. 'onShareTimeline',
  7202. 'onShareAppMessage',
  7203. 'onResize',
  7204. 'onPageScroll',
  7205. 'onNavigationBarButtonTap',
  7206. 'onBackPress',
  7207. 'onNavigationBarSearchInputChanged',
  7208. 'onNavigationBarSearchInputConfirmed',
  7209. 'onNavigationBarSearchInputClicked',
  7210. //Component
  7211. // 'onReady', // 兼容旧版本,应该移除该事件
  7212. 'onPageShow',
  7213. 'onPageHide',
  7214. 'onPageResize'
  7215. ];
  7216. function lifecycleMixin$1(Vue) {
  7217. //fixed vue-class-component
  7218. var oldExtend = Vue.extend;
  7219. Vue.extend = function(extendOptions) {
  7220. extendOptions = extendOptions || {};
  7221. var methods = extendOptions.methods;
  7222. if (methods) {
  7223. Object.keys(methods).forEach(function (methodName) {
  7224. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  7225. extendOptions[methodName] = methods[methodName];
  7226. delete methods[methodName];
  7227. }
  7228. });
  7229. }
  7230. return oldExtend.call(this, extendOptions)
  7231. };
  7232. var strategies = Vue.config.optionMergeStrategies;
  7233. var mergeHook = strategies.created;
  7234. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  7235. strategies[hook] = mergeHook;
  7236. });
  7237. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  7238. }
  7239. /* */
  7240. // install platform patch function
  7241. Vue.prototype.__patch__ = patch;
  7242. // public mount method
  7243. Vue.prototype.$mount = function(
  7244. el ,
  7245. hydrating
  7246. ) {
  7247. return mountComponent$1(this, el, hydrating)
  7248. };
  7249. lifecycleMixin$1(Vue);
  7250. internalMixin(Vue);
  7251. /* */
  7252. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  7253. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  7254. /***/ }),
  7255. /* 4 */
  7256. /*!*************************************************************!*\
  7257. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  7258. \*************************************************************/
  7259. /*! no static exports found */
  7260. /***/ (function(module, exports, __webpack_require__) {
  7261. "use strict";
  7262. /* WEBPACK VAR INJECTION */(function(uni, global) {Object.defineProperty(exports, "__esModule", { value: true });exports.compileI18nJsonStr = compileI18nJsonStr;exports.hasI18nJson = hasI18nJson;exports.initVueI18n = initVueI18n;exports.isI18nStr = isI18nStr;exports.normalizeLocale = normalizeLocale;exports.parseI18nJson = parseI18nJson;exports.resolveLocale = resolveLocale;exports.isString = exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var isArray = Array.isArray;
  7263. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  7264. var defaultDelimiters = ['{', '}'];var
  7265. BaseFormatter = /*#__PURE__*/function () {
  7266. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  7267. this._caches = Object.create(null);
  7268. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  7269. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  7270. if (!values) {
  7271. return [message];
  7272. }
  7273. var tokens = this._caches[message];
  7274. if (!tokens) {
  7275. tokens = parse(message, delimiters);
  7276. this._caches[message] = tokens;
  7277. }
  7278. return compile(tokens, values);
  7279. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  7280. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  7281. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  7282. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  7283. var tokens = [];
  7284. var position = 0;
  7285. var text = '';
  7286. while (position < format.length) {
  7287. var char = format[position++];
  7288. if (char === startDelimiter) {
  7289. if (text) {
  7290. tokens.push({ type: 'text', value: text });
  7291. }
  7292. text = '';
  7293. var sub = '';
  7294. char = format[position++];
  7295. while (char !== undefined && char !== endDelimiter) {
  7296. sub += char;
  7297. char = format[position++];
  7298. }
  7299. var isClosed = char === endDelimiter;
  7300. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  7301. 'list' :
  7302. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  7303. 'named' :
  7304. 'unknown';
  7305. tokens.push({ value: sub, type: type });
  7306. }
  7307. // else if (char === '%') {
  7308. // // when found rails i18n syntax, skip text capture
  7309. // if (format[position] !== '{') {
  7310. // text += char
  7311. // }
  7312. // }
  7313. else {
  7314. text += char;
  7315. }
  7316. }
  7317. text && tokens.push({ type: 'text', value: text });
  7318. return tokens;
  7319. }
  7320. function compile(tokens, values) {
  7321. var compiled = [];
  7322. var index = 0;
  7323. var mode = isArray(values) ?
  7324. 'list' :
  7325. isObject(values) ?
  7326. 'named' :
  7327. 'unknown';
  7328. if (mode === 'unknown') {
  7329. return compiled;
  7330. }
  7331. while (index < tokens.length) {
  7332. var token = tokens[index];
  7333. switch (token.type) {
  7334. case 'text':
  7335. compiled.push(token.value);
  7336. break;
  7337. case 'list':
  7338. compiled.push(values[parseInt(token.value, 10)]);
  7339. break;
  7340. case 'named':
  7341. if (mode === 'named') {
  7342. compiled.push(values[token.value]);
  7343. } else
  7344. {
  7345. if (true) {
  7346. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  7347. }
  7348. }
  7349. break;
  7350. case 'unknown':
  7351. if (true) {
  7352. console.warn("Detect 'unknown' type of token!");
  7353. }
  7354. break;}
  7355. index++;
  7356. }
  7357. return compiled;
  7358. }
  7359. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  7360. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  7361. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  7362. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  7363. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  7364. var hasOwnProperty = Object.prototype.hasOwnProperty;
  7365. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  7366. var defaultFormatter = new BaseFormatter();
  7367. function include(str, parts) {
  7368. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  7369. }
  7370. function startsWith(str, parts) {
  7371. return parts.find(function (part) {return str.indexOf(part) === 0;});
  7372. }
  7373. function normalizeLocale(locale, messages) {
  7374. if (!locale) {
  7375. return;
  7376. }
  7377. locale = locale.trim().replace(/_/g, '-');
  7378. if (messages && messages[locale]) {
  7379. return locale;
  7380. }
  7381. locale = locale.toLowerCase();
  7382. if (locale.indexOf('zh') === 0) {
  7383. if (locale.indexOf('-hans') > -1) {
  7384. return LOCALE_ZH_HANS;
  7385. }
  7386. if (locale.indexOf('-hant') > -1) {
  7387. return LOCALE_ZH_HANT;
  7388. }
  7389. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  7390. return LOCALE_ZH_HANT;
  7391. }
  7392. return LOCALE_ZH_HANS;
  7393. }
  7394. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  7395. if (lang) {
  7396. return lang;
  7397. }
  7398. }var
  7399. I18n = /*#__PURE__*/function () {
  7400. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  7401. this.locale = LOCALE_EN;
  7402. this.fallbackLocale = LOCALE_EN;
  7403. this.message = {};
  7404. this.messages = {};
  7405. this.watchers = [];
  7406. if (fallbackLocale) {
  7407. this.fallbackLocale = fallbackLocale;
  7408. }
  7409. this.formater = formater || defaultFormatter;
  7410. this.messages = messages || {};
  7411. this.setLocale(locale || LOCALE_EN);
  7412. if (watcher) {
  7413. this.watchLocale(watcher);
  7414. }
  7415. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  7416. locale) {var _this = this;
  7417. var oldLocale = this.locale;
  7418. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  7419. if (!this.messages[this.locale]) {
  7420. // 可能初始化时不存在
  7421. this.messages[this.locale] = {};
  7422. }
  7423. this.message = this.messages[this.locale];
  7424. // 仅发生变化时,通知
  7425. if (oldLocale !== this.locale) {
  7426. this.watchers.forEach(function (watcher) {
  7427. watcher(_this.locale, oldLocale);
  7428. });
  7429. }
  7430. } }, { key: "getLocale", value: function getLocale()
  7431. {
  7432. return this.locale;
  7433. } }, { key: "watchLocale", value: function watchLocale(
  7434. fn) {var _this2 = this;
  7435. var index = this.watchers.push(fn) - 1;
  7436. return function () {
  7437. _this2.watchers.splice(index, 1);
  7438. };
  7439. } }, { key: "add", value: function add(
  7440. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  7441. var curMessages = this.messages[locale];
  7442. if (curMessages) {
  7443. if (override) {
  7444. Object.assign(curMessages, message);
  7445. } else
  7446. {
  7447. Object.keys(message).forEach(function (key) {
  7448. if (!hasOwn(curMessages, key)) {
  7449. curMessages[key] = message[key];
  7450. }
  7451. });
  7452. }
  7453. } else
  7454. {
  7455. this.messages[locale] = message;
  7456. }
  7457. } }, { key: "f", value: function f(
  7458. message, values, delimiters) {
  7459. return this.formater.interpolate(message, values, delimiters).join('');
  7460. } }, { key: "t", value: function t(
  7461. key, locale, values) {
  7462. var message = this.message;
  7463. if (typeof locale === 'string') {
  7464. locale = normalizeLocale(locale, this.messages);
  7465. locale && (message = this.messages[locale]);
  7466. } else
  7467. {
  7468. values = locale;
  7469. }
  7470. if (!hasOwn(message, key)) {
  7471. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  7472. return key;
  7473. }
  7474. return this.formater.interpolate(message[key], values).join('');
  7475. } }]);return I18n;}();exports.I18n = I18n;
  7476. function watchAppLocale(appVm, i18n) {
  7477. // 需要保证 watch 的触发在组件渲染之前
  7478. if (appVm.$watchLocale) {
  7479. // vue2
  7480. appVm.$watchLocale(function (newLocale) {
  7481. i18n.setLocale(newLocale);
  7482. });
  7483. } else
  7484. {
  7485. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  7486. i18n.setLocale(newLocale);
  7487. });
  7488. }
  7489. }
  7490. function getDefaultLocale() {
  7491. if (typeof uni !== 'undefined' && uni.getLocale) {
  7492. return uni.getLocale();
  7493. }
  7494. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  7495. if (typeof global !== 'undefined' && global.getLocale) {
  7496. return global.getLocale();
  7497. }
  7498. return LOCALE_EN;
  7499. }
  7500. function initVueI18n(locale) {var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;var watcher = arguments.length > 3 ? arguments[3] : undefined;
  7501. // 兼容旧版本入参
  7502. if (typeof locale !== 'string') {var _ref4 =
  7503. [
  7504. messages,
  7505. locale];locale = _ref4[0];messages = _ref4[1];
  7506. }
  7507. if (typeof locale !== 'string') {
  7508. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  7509. locale = getDefaultLocale();
  7510. }
  7511. if (typeof fallbackLocale !== 'string') {
  7512. fallbackLocale =
  7513. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  7514. LOCALE_EN;
  7515. }
  7516. var i18n = new I18n({
  7517. locale: locale,
  7518. fallbackLocale: fallbackLocale,
  7519. messages: messages,
  7520. watcher: watcher });
  7521. var _t = function t(key, values) {
  7522. if (typeof getApp !== 'function') {
  7523. // app view
  7524. /* eslint-disable no-func-assign */
  7525. _t = function t(key, values) {
  7526. return i18n.t(key, values);
  7527. };
  7528. } else
  7529. {
  7530. var isWatchedAppLocale = false;
  7531. _t = function t(key, values) {
  7532. var appVm = getApp().$vm;
  7533. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  7534. // options: {
  7535. // type: Array,
  7536. // default () {
  7537. // return [{
  7538. // icon: 'shop',
  7539. // text: t("uni-goods-nav.options.shop"),
  7540. // }, {
  7541. // icon: 'cart',
  7542. // text: t("uni-goods-nav.options.cart")
  7543. // }]
  7544. // }
  7545. // },
  7546. if (appVm) {
  7547. // 触发响应式
  7548. appVm.$locale;
  7549. if (!isWatchedAppLocale) {
  7550. isWatchedAppLocale = true;
  7551. watchAppLocale(appVm, i18n);
  7552. }
  7553. }
  7554. return i18n.t(key, values);
  7555. };
  7556. }
  7557. return _t(key, values);
  7558. };
  7559. return {
  7560. i18n: i18n,
  7561. f: function f(message, values, delimiters) {
  7562. return i18n.f(message, values, delimiters);
  7563. },
  7564. t: function t(key, values) {
  7565. return _t(key, values);
  7566. },
  7567. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  7568. return i18n.add(locale, message, override);
  7569. },
  7570. watch: function watch(fn) {
  7571. return i18n.watchLocale(fn);
  7572. },
  7573. getLocale: function getLocale() {
  7574. return i18n.getLocale();
  7575. },
  7576. setLocale: function setLocale(newLocale) {
  7577. return i18n.setLocale(newLocale);
  7578. } };
  7579. }
  7580. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  7581. var formater;
  7582. function hasI18nJson(jsonObj, delimiters) {
  7583. if (!formater) {
  7584. formater = new BaseFormatter();
  7585. }
  7586. return walkJsonObj(jsonObj, function (jsonObj, key) {
  7587. var value = jsonObj[key];
  7588. if (isString(value)) {
  7589. if (isI18nStr(value, delimiters)) {
  7590. return true;
  7591. }
  7592. } else
  7593. {
  7594. return hasI18nJson(value, delimiters);
  7595. }
  7596. });
  7597. }
  7598. function parseI18nJson(jsonObj, values, delimiters) {
  7599. if (!formater) {
  7600. formater = new BaseFormatter();
  7601. }
  7602. walkJsonObj(jsonObj, function (jsonObj, key) {
  7603. var value = jsonObj[key];
  7604. if (isString(value)) {
  7605. if (isI18nStr(value, delimiters)) {
  7606. jsonObj[key] = compileStr(value, values, delimiters);
  7607. }
  7608. } else
  7609. {
  7610. parseI18nJson(value, values, delimiters);
  7611. }
  7612. });
  7613. return jsonObj;
  7614. }
  7615. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  7616. if (!isI18nStr(jsonStr, delimiters)) {
  7617. return jsonStr;
  7618. }
  7619. if (!formater) {
  7620. formater = new BaseFormatter();
  7621. }
  7622. var localeValues = [];
  7623. Object.keys(locales).forEach(function (name) {
  7624. if (name !== locale) {
  7625. localeValues.push({
  7626. locale: name,
  7627. values: locales[name] });
  7628. }
  7629. });
  7630. localeValues.unshift({ locale: locale, values: locales[locale] });
  7631. try {
  7632. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  7633. }
  7634. catch (e) {}
  7635. return jsonStr;
  7636. }
  7637. function isI18nStr(value, delimiters) {
  7638. return value.indexOf(delimiters[0]) > -1;
  7639. }
  7640. function compileStr(value, values, delimiters) {
  7641. return formater.interpolate(value, values, delimiters).join('');
  7642. }
  7643. function compileValue(jsonObj, key, localeValues, delimiters) {
  7644. var value = jsonObj[key];
  7645. if (isString(value)) {
  7646. // 存在国际化
  7647. if (isI18nStr(value, delimiters)) {
  7648. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  7649. if (localeValues.length > 1) {
  7650. // 格式化国际化语言
  7651. var valueLocales = jsonObj[key + 'Locales'] = {};
  7652. localeValues.forEach(function (localValue) {
  7653. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  7654. });
  7655. }
  7656. }
  7657. } else
  7658. {
  7659. compileJsonObj(value, localeValues, delimiters);
  7660. }
  7661. }
  7662. function compileJsonObj(jsonObj, localeValues, delimiters) {
  7663. walkJsonObj(jsonObj, function (jsonObj, key) {
  7664. compileValue(jsonObj, key, localeValues, delimiters);
  7665. });
  7666. return jsonObj;
  7667. }
  7668. function walkJsonObj(jsonObj, walk) {
  7669. if (isArray(jsonObj)) {
  7670. for (var i = 0; i < jsonObj.length; i++) {
  7671. if (walk(jsonObj, i)) {
  7672. return true;
  7673. }
  7674. }
  7675. } else
  7676. if (isObject(jsonObj)) {
  7677. for (var key in jsonObj) {
  7678. if (walk(jsonObj, key)) {
  7679. return true;
  7680. }
  7681. }
  7682. }
  7683. return false;
  7684. }
  7685. function resolveLocale(locales) {
  7686. return function (locale) {
  7687. if (!locale) {
  7688. return locale;
  7689. }
  7690. locale = normalizeLocale(locale) || locale;
  7691. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  7692. };
  7693. }
  7694. function resolveLocaleChain(locale) {
  7695. var chain = [];
  7696. var tokens = locale.split('-');
  7697. while (tokens.length) {
  7698. chain.push(tokens.join('-'));
  7699. tokens.pop();
  7700. }
  7701. return chain;
  7702. }
  7703. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  7704. /***/ }),
  7705. /* 5 */
  7706. /*!*************************************************!*\
  7707. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/pages.json ***!
  7708. \*************************************************/
  7709. /*! no static exports found */
  7710. /***/ (function(module, exports) {
  7711. /***/ }),
  7712. /* 6 */,
  7713. /* 7 */,
  7714. /* 8 */,
  7715. /* 9 */
  7716. /*!**********************************************************!*\
  7717. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  7718. \**********************************************************/
  7719. /*! no static exports found */
  7720. /***/ (function(module, exports, __webpack_require__) {
  7721. module.exports = __webpack_require__(/*! regenerator-runtime */ 10);
  7722. /***/ }),
  7723. /* 10 */
  7724. /*!************************************************************!*\
  7725. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  7726. \************************************************************/
  7727. /*! no static exports found */
  7728. /***/ (function(module, exports, __webpack_require__) {
  7729. /**
  7730. * Copyright (c) 2014-present, Facebook, Inc.
  7731. *
  7732. * This source code is licensed under the MIT license found in the
  7733. * LICENSE file in the root directory of this source tree.
  7734. */
  7735. // This method of obtaining a reference to the global object needs to be
  7736. // kept identical to the way it is obtained in runtime.js
  7737. var g = (function() {
  7738. return this || (typeof self === "object" && self);
  7739. })() || Function("return this")();
  7740. // Use `getOwnPropertyNames` because not all browsers support calling
  7741. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  7742. var hadRuntime = g.regeneratorRuntime &&
  7743. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  7744. // Save the old regeneratorRuntime in case it needs to be restored later.
  7745. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  7746. // Force reevalutation of runtime.js.
  7747. g.regeneratorRuntime = undefined;
  7748. module.exports = __webpack_require__(/*! ./runtime */ 11);
  7749. if (hadRuntime) {
  7750. // Restore the original runtime.
  7751. g.regeneratorRuntime = oldRuntime;
  7752. } else {
  7753. // Remove the global property added by runtime.js.
  7754. try {
  7755. delete g.regeneratorRuntime;
  7756. } catch(e) {
  7757. g.regeneratorRuntime = undefined;
  7758. }
  7759. }
  7760. /***/ }),
  7761. /* 11 */
  7762. /*!*****************************************************!*\
  7763. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  7764. \*****************************************************/
  7765. /*! no static exports found */
  7766. /***/ (function(module, exports) {
  7767. /**
  7768. * Copyright (c) 2014-present, Facebook, Inc.
  7769. *
  7770. * This source code is licensed under the MIT license found in the
  7771. * LICENSE file in the root directory of this source tree.
  7772. */
  7773. !(function(global) {
  7774. "use strict";
  7775. var Op = Object.prototype;
  7776. var hasOwn = Op.hasOwnProperty;
  7777. var undefined; // More compressible than void 0.
  7778. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  7779. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  7780. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  7781. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  7782. var inModule = typeof module === "object";
  7783. var runtime = global.regeneratorRuntime;
  7784. if (runtime) {
  7785. if (inModule) {
  7786. // If regeneratorRuntime is defined globally and we're in a module,
  7787. // make the exports object identical to regeneratorRuntime.
  7788. module.exports = runtime;
  7789. }
  7790. // Don't bother evaluating the rest of this file if the runtime was
  7791. // already defined globally.
  7792. return;
  7793. }
  7794. // Define the runtime globally (as expected by generated code) as either
  7795. // module.exports (if we're in a module) or a new, empty object.
  7796. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  7797. function wrap(innerFn, outerFn, self, tryLocsList) {
  7798. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  7799. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  7800. var generator = Object.create(protoGenerator.prototype);
  7801. var context = new Context(tryLocsList || []);
  7802. // The ._invoke method unifies the implementations of the .next,
  7803. // .throw, and .return methods.
  7804. generator._invoke = makeInvokeMethod(innerFn, self, context);
  7805. return generator;
  7806. }
  7807. runtime.wrap = wrap;
  7808. // Try/catch helper to minimize deoptimizations. Returns a completion
  7809. // record like context.tryEntries[i].completion. This interface could
  7810. // have been (and was previously) designed to take a closure to be
  7811. // invoked without arguments, but in all the cases we care about we
  7812. // already have an existing method we want to call, so there's no need
  7813. // to create a new function object. We can even get away with assuming
  7814. // the method takes exactly one argument, since that happens to be true
  7815. // in every case, so we don't have to touch the arguments object. The
  7816. // only additional allocation required is the completion record, which
  7817. // has a stable shape and so hopefully should be cheap to allocate.
  7818. function tryCatch(fn, obj, arg) {
  7819. try {
  7820. return { type: "normal", arg: fn.call(obj, arg) };
  7821. } catch (err) {
  7822. return { type: "throw", arg: err };
  7823. }
  7824. }
  7825. var GenStateSuspendedStart = "suspendedStart";
  7826. var GenStateSuspendedYield = "suspendedYield";
  7827. var GenStateExecuting = "executing";
  7828. var GenStateCompleted = "completed";
  7829. // Returning this object from the innerFn has the same effect as
  7830. // breaking out of the dispatch switch statement.
  7831. var ContinueSentinel = {};
  7832. // Dummy constructor functions that we use as the .constructor and
  7833. // .constructor.prototype properties for functions that return Generator
  7834. // objects. For full spec compliance, you may wish to configure your
  7835. // minifier not to mangle the names of these two functions.
  7836. function Generator() {}
  7837. function GeneratorFunction() {}
  7838. function GeneratorFunctionPrototype() {}
  7839. // This is a polyfill for %IteratorPrototype% for environments that
  7840. // don't natively support it.
  7841. var IteratorPrototype = {};
  7842. IteratorPrototype[iteratorSymbol] = function () {
  7843. return this;
  7844. };
  7845. var getProto = Object.getPrototypeOf;
  7846. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  7847. if (NativeIteratorPrototype &&
  7848. NativeIteratorPrototype !== Op &&
  7849. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  7850. // This environment has a native %IteratorPrototype%; use it instead
  7851. // of the polyfill.
  7852. IteratorPrototype = NativeIteratorPrototype;
  7853. }
  7854. var Gp = GeneratorFunctionPrototype.prototype =
  7855. Generator.prototype = Object.create(IteratorPrototype);
  7856. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  7857. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  7858. GeneratorFunctionPrototype[toStringTagSymbol] =
  7859. GeneratorFunction.displayName = "GeneratorFunction";
  7860. // Helper for defining the .next, .throw, and .return methods of the
  7861. // Iterator interface in terms of a single ._invoke method.
  7862. function defineIteratorMethods(prototype) {
  7863. ["next", "throw", "return"].forEach(function(method) {
  7864. prototype[method] = function(arg) {
  7865. return this._invoke(method, arg);
  7866. };
  7867. });
  7868. }
  7869. runtime.isGeneratorFunction = function(genFun) {
  7870. var ctor = typeof genFun === "function" && genFun.constructor;
  7871. return ctor
  7872. ? ctor === GeneratorFunction ||
  7873. // For the native GeneratorFunction constructor, the best we can
  7874. // do is to check its .name property.
  7875. (ctor.displayName || ctor.name) === "GeneratorFunction"
  7876. : false;
  7877. };
  7878. runtime.mark = function(genFun) {
  7879. if (Object.setPrototypeOf) {
  7880. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  7881. } else {
  7882. genFun.__proto__ = GeneratorFunctionPrototype;
  7883. if (!(toStringTagSymbol in genFun)) {
  7884. genFun[toStringTagSymbol] = "GeneratorFunction";
  7885. }
  7886. }
  7887. genFun.prototype = Object.create(Gp);
  7888. return genFun;
  7889. };
  7890. // Within the body of any async function, `await x` is transformed to
  7891. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  7892. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  7893. // meant to be awaited.
  7894. runtime.awrap = function(arg) {
  7895. return { __await: arg };
  7896. };
  7897. function AsyncIterator(generator) {
  7898. function invoke(method, arg, resolve, reject) {
  7899. var record = tryCatch(generator[method], generator, arg);
  7900. if (record.type === "throw") {
  7901. reject(record.arg);
  7902. } else {
  7903. var result = record.arg;
  7904. var value = result.value;
  7905. if (value &&
  7906. typeof value === "object" &&
  7907. hasOwn.call(value, "__await")) {
  7908. return Promise.resolve(value.__await).then(function(value) {
  7909. invoke("next", value, resolve, reject);
  7910. }, function(err) {
  7911. invoke("throw", err, resolve, reject);
  7912. });
  7913. }
  7914. return Promise.resolve(value).then(function(unwrapped) {
  7915. // When a yielded Promise is resolved, its final value becomes
  7916. // the .value of the Promise<{value,done}> result for the
  7917. // current iteration.
  7918. result.value = unwrapped;
  7919. resolve(result);
  7920. }, function(error) {
  7921. // If a rejected Promise was yielded, throw the rejection back
  7922. // into the async generator function so it can be handled there.
  7923. return invoke("throw", error, resolve, reject);
  7924. });
  7925. }
  7926. }
  7927. var previousPromise;
  7928. function enqueue(method, arg) {
  7929. function callInvokeWithMethodAndArg() {
  7930. return new Promise(function(resolve, reject) {
  7931. invoke(method, arg, resolve, reject);
  7932. });
  7933. }
  7934. return previousPromise =
  7935. // If enqueue has been called before, then we want to wait until
  7936. // all previous Promises have been resolved before calling invoke,
  7937. // so that results are always delivered in the correct order. If
  7938. // enqueue has not been called before, then it is important to
  7939. // call invoke immediately, without waiting on a callback to fire,
  7940. // so that the async generator function has the opportunity to do
  7941. // any necessary setup in a predictable way. This predictability
  7942. // is why the Promise constructor synchronously invokes its
  7943. // executor callback, and why async functions synchronously
  7944. // execute code before the first await. Since we implement simple
  7945. // async functions in terms of async generators, it is especially
  7946. // important to get this right, even though it requires care.
  7947. previousPromise ? previousPromise.then(
  7948. callInvokeWithMethodAndArg,
  7949. // Avoid propagating failures to Promises returned by later
  7950. // invocations of the iterator.
  7951. callInvokeWithMethodAndArg
  7952. ) : callInvokeWithMethodAndArg();
  7953. }
  7954. // Define the unified helper method that is used to implement .next,
  7955. // .throw, and .return (see defineIteratorMethods).
  7956. this._invoke = enqueue;
  7957. }
  7958. defineIteratorMethods(AsyncIterator.prototype);
  7959. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  7960. return this;
  7961. };
  7962. runtime.AsyncIterator = AsyncIterator;
  7963. // Note that simple async functions are implemented on top of
  7964. // AsyncIterator objects; they just return a Promise for the value of
  7965. // the final result produced by the iterator.
  7966. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  7967. var iter = new AsyncIterator(
  7968. wrap(innerFn, outerFn, self, tryLocsList)
  7969. );
  7970. return runtime.isGeneratorFunction(outerFn)
  7971. ? iter // If outerFn is a generator, return the full iterator.
  7972. : iter.next().then(function(result) {
  7973. return result.done ? result.value : iter.next();
  7974. });
  7975. };
  7976. function makeInvokeMethod(innerFn, self, context) {
  7977. var state = GenStateSuspendedStart;
  7978. return function invoke(method, arg) {
  7979. if (state === GenStateExecuting) {
  7980. throw new Error("Generator is already running");
  7981. }
  7982. if (state === GenStateCompleted) {
  7983. if (method === "throw") {
  7984. throw arg;
  7985. }
  7986. // Be forgiving, per 25.3.3.3.3 of the spec:
  7987. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  7988. return doneResult();
  7989. }
  7990. context.method = method;
  7991. context.arg = arg;
  7992. while (true) {
  7993. var delegate = context.delegate;
  7994. if (delegate) {
  7995. var delegateResult = maybeInvokeDelegate(delegate, context);
  7996. if (delegateResult) {
  7997. if (delegateResult === ContinueSentinel) continue;
  7998. return delegateResult;
  7999. }
  8000. }
  8001. if (context.method === "next") {
  8002. // Setting context._sent for legacy support of Babel's
  8003. // function.sent implementation.
  8004. context.sent = context._sent = context.arg;
  8005. } else if (context.method === "throw") {
  8006. if (state === GenStateSuspendedStart) {
  8007. state = GenStateCompleted;
  8008. throw context.arg;
  8009. }
  8010. context.dispatchException(context.arg);
  8011. } else if (context.method === "return") {
  8012. context.abrupt("return", context.arg);
  8013. }
  8014. state = GenStateExecuting;
  8015. var record = tryCatch(innerFn, self, context);
  8016. if (record.type === "normal") {
  8017. // If an exception is thrown from innerFn, we leave state ===
  8018. // GenStateExecuting and loop back for another invocation.
  8019. state = context.done
  8020. ? GenStateCompleted
  8021. : GenStateSuspendedYield;
  8022. if (record.arg === ContinueSentinel) {
  8023. continue;
  8024. }
  8025. return {
  8026. value: record.arg,
  8027. done: context.done
  8028. };
  8029. } else if (record.type === "throw") {
  8030. state = GenStateCompleted;
  8031. // Dispatch the exception by looping back around to the
  8032. // context.dispatchException(context.arg) call above.
  8033. context.method = "throw";
  8034. context.arg = record.arg;
  8035. }
  8036. }
  8037. };
  8038. }
  8039. // Call delegate.iterator[context.method](context.arg) and handle the
  8040. // result, either by returning a { value, done } result from the
  8041. // delegate iterator, or by modifying context.method and context.arg,
  8042. // setting context.delegate to null, and returning the ContinueSentinel.
  8043. function maybeInvokeDelegate(delegate, context) {
  8044. var method = delegate.iterator[context.method];
  8045. if (method === undefined) {
  8046. // A .throw or .return when the delegate iterator has no .throw
  8047. // method always terminates the yield* loop.
  8048. context.delegate = null;
  8049. if (context.method === "throw") {
  8050. if (delegate.iterator.return) {
  8051. // If the delegate iterator has a return method, give it a
  8052. // chance to clean up.
  8053. context.method = "return";
  8054. context.arg = undefined;
  8055. maybeInvokeDelegate(delegate, context);
  8056. if (context.method === "throw") {
  8057. // If maybeInvokeDelegate(context) changed context.method from
  8058. // "return" to "throw", let that override the TypeError below.
  8059. return ContinueSentinel;
  8060. }
  8061. }
  8062. context.method = "throw";
  8063. context.arg = new TypeError(
  8064. "The iterator does not provide a 'throw' method");
  8065. }
  8066. return ContinueSentinel;
  8067. }
  8068. var record = tryCatch(method, delegate.iterator, context.arg);
  8069. if (record.type === "throw") {
  8070. context.method = "throw";
  8071. context.arg = record.arg;
  8072. context.delegate = null;
  8073. return ContinueSentinel;
  8074. }
  8075. var info = record.arg;
  8076. if (! info) {
  8077. context.method = "throw";
  8078. context.arg = new TypeError("iterator result is not an object");
  8079. context.delegate = null;
  8080. return ContinueSentinel;
  8081. }
  8082. if (info.done) {
  8083. // Assign the result of the finished delegate to the temporary
  8084. // variable specified by delegate.resultName (see delegateYield).
  8085. context[delegate.resultName] = info.value;
  8086. // Resume execution at the desired location (see delegateYield).
  8087. context.next = delegate.nextLoc;
  8088. // If context.method was "throw" but the delegate handled the
  8089. // exception, let the outer generator proceed normally. If
  8090. // context.method was "next", forget context.arg since it has been
  8091. // "consumed" by the delegate iterator. If context.method was
  8092. // "return", allow the original .return call to continue in the
  8093. // outer generator.
  8094. if (context.method !== "return") {
  8095. context.method = "next";
  8096. context.arg = undefined;
  8097. }
  8098. } else {
  8099. // Re-yield the result returned by the delegate method.
  8100. return info;
  8101. }
  8102. // The delegate iterator is finished, so forget it and continue with
  8103. // the outer generator.
  8104. context.delegate = null;
  8105. return ContinueSentinel;
  8106. }
  8107. // Define Generator.prototype.{next,throw,return} in terms of the
  8108. // unified ._invoke helper method.
  8109. defineIteratorMethods(Gp);
  8110. Gp[toStringTagSymbol] = "Generator";
  8111. // A Generator should always return itself as the iterator object when the
  8112. // @@iterator function is called on it. Some browsers' implementations of the
  8113. // iterator prototype chain incorrectly implement this, causing the Generator
  8114. // object to not be returned from this call. This ensures that doesn't happen.
  8115. // See https://github.com/facebook/regenerator/issues/274 for more details.
  8116. Gp[iteratorSymbol] = function() {
  8117. return this;
  8118. };
  8119. Gp.toString = function() {
  8120. return "[object Generator]";
  8121. };
  8122. function pushTryEntry(locs) {
  8123. var entry = { tryLoc: locs[0] };
  8124. if (1 in locs) {
  8125. entry.catchLoc = locs[1];
  8126. }
  8127. if (2 in locs) {
  8128. entry.finallyLoc = locs[2];
  8129. entry.afterLoc = locs[3];
  8130. }
  8131. this.tryEntries.push(entry);
  8132. }
  8133. function resetTryEntry(entry) {
  8134. var record = entry.completion || {};
  8135. record.type = "normal";
  8136. delete record.arg;
  8137. entry.completion = record;
  8138. }
  8139. function Context(tryLocsList) {
  8140. // The root entry object (effectively a try statement without a catch
  8141. // or a finally block) gives us a place to store values thrown from
  8142. // locations where there is no enclosing try statement.
  8143. this.tryEntries = [{ tryLoc: "root" }];
  8144. tryLocsList.forEach(pushTryEntry, this);
  8145. this.reset(true);
  8146. }
  8147. runtime.keys = function(object) {
  8148. var keys = [];
  8149. for (var key in object) {
  8150. keys.push(key);
  8151. }
  8152. keys.reverse();
  8153. // Rather than returning an object with a next method, we keep
  8154. // things simple and return the next function itself.
  8155. return function next() {
  8156. while (keys.length) {
  8157. var key = keys.pop();
  8158. if (key in object) {
  8159. next.value = key;
  8160. next.done = false;
  8161. return next;
  8162. }
  8163. }
  8164. // To avoid creating an additional object, we just hang the .value
  8165. // and .done properties off the next function object itself. This
  8166. // also ensures that the minifier will not anonymize the function.
  8167. next.done = true;
  8168. return next;
  8169. };
  8170. };
  8171. function values(iterable) {
  8172. if (iterable) {
  8173. var iteratorMethod = iterable[iteratorSymbol];
  8174. if (iteratorMethod) {
  8175. return iteratorMethod.call(iterable);
  8176. }
  8177. if (typeof iterable.next === "function") {
  8178. return iterable;
  8179. }
  8180. if (!isNaN(iterable.length)) {
  8181. var i = -1, next = function next() {
  8182. while (++i < iterable.length) {
  8183. if (hasOwn.call(iterable, i)) {
  8184. next.value = iterable[i];
  8185. next.done = false;
  8186. return next;
  8187. }
  8188. }
  8189. next.value = undefined;
  8190. next.done = true;
  8191. return next;
  8192. };
  8193. return next.next = next;
  8194. }
  8195. }
  8196. // Return an iterator with no values.
  8197. return { next: doneResult };
  8198. }
  8199. runtime.values = values;
  8200. function doneResult() {
  8201. return { value: undefined, done: true };
  8202. }
  8203. Context.prototype = {
  8204. constructor: Context,
  8205. reset: function(skipTempReset) {
  8206. this.prev = 0;
  8207. this.next = 0;
  8208. // Resetting context._sent for legacy support of Babel's
  8209. // function.sent implementation.
  8210. this.sent = this._sent = undefined;
  8211. this.done = false;
  8212. this.delegate = null;
  8213. this.method = "next";
  8214. this.arg = undefined;
  8215. this.tryEntries.forEach(resetTryEntry);
  8216. if (!skipTempReset) {
  8217. for (var name in this) {
  8218. // Not sure about the optimal order of these conditions:
  8219. if (name.charAt(0) === "t" &&
  8220. hasOwn.call(this, name) &&
  8221. !isNaN(+name.slice(1))) {
  8222. this[name] = undefined;
  8223. }
  8224. }
  8225. }
  8226. },
  8227. stop: function() {
  8228. this.done = true;
  8229. var rootEntry = this.tryEntries[0];
  8230. var rootRecord = rootEntry.completion;
  8231. if (rootRecord.type === "throw") {
  8232. throw rootRecord.arg;
  8233. }
  8234. return this.rval;
  8235. },
  8236. dispatchException: function(exception) {
  8237. if (this.done) {
  8238. throw exception;
  8239. }
  8240. var context = this;
  8241. function handle(loc, caught) {
  8242. record.type = "throw";
  8243. record.arg = exception;
  8244. context.next = loc;
  8245. if (caught) {
  8246. // If the dispatched exception was caught by a catch block,
  8247. // then let that catch block handle the exception normally.
  8248. context.method = "next";
  8249. context.arg = undefined;
  8250. }
  8251. return !! caught;
  8252. }
  8253. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  8254. var entry = this.tryEntries[i];
  8255. var record = entry.completion;
  8256. if (entry.tryLoc === "root") {
  8257. // Exception thrown outside of any try block that could handle
  8258. // it, so set the completion value of the entire function to
  8259. // throw the exception.
  8260. return handle("end");
  8261. }
  8262. if (entry.tryLoc <= this.prev) {
  8263. var hasCatch = hasOwn.call(entry, "catchLoc");
  8264. var hasFinally = hasOwn.call(entry, "finallyLoc");
  8265. if (hasCatch && hasFinally) {
  8266. if (this.prev < entry.catchLoc) {
  8267. return handle(entry.catchLoc, true);
  8268. } else if (this.prev < entry.finallyLoc) {
  8269. return handle(entry.finallyLoc);
  8270. }
  8271. } else if (hasCatch) {
  8272. if (this.prev < entry.catchLoc) {
  8273. return handle(entry.catchLoc, true);
  8274. }
  8275. } else if (hasFinally) {
  8276. if (this.prev < entry.finallyLoc) {
  8277. return handle(entry.finallyLoc);
  8278. }
  8279. } else {
  8280. throw new Error("try statement without catch or finally");
  8281. }
  8282. }
  8283. }
  8284. },
  8285. abrupt: function(type, arg) {
  8286. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  8287. var entry = this.tryEntries[i];
  8288. if (entry.tryLoc <= this.prev &&
  8289. hasOwn.call(entry, "finallyLoc") &&
  8290. this.prev < entry.finallyLoc) {
  8291. var finallyEntry = entry;
  8292. break;
  8293. }
  8294. }
  8295. if (finallyEntry &&
  8296. (type === "break" ||
  8297. type === "continue") &&
  8298. finallyEntry.tryLoc <= arg &&
  8299. arg <= finallyEntry.finallyLoc) {
  8300. // Ignore the finally entry if control is not jumping to a
  8301. // location outside the try/catch block.
  8302. finallyEntry = null;
  8303. }
  8304. var record = finallyEntry ? finallyEntry.completion : {};
  8305. record.type = type;
  8306. record.arg = arg;
  8307. if (finallyEntry) {
  8308. this.method = "next";
  8309. this.next = finallyEntry.finallyLoc;
  8310. return ContinueSentinel;
  8311. }
  8312. return this.complete(record);
  8313. },
  8314. complete: function(record, afterLoc) {
  8315. if (record.type === "throw") {
  8316. throw record.arg;
  8317. }
  8318. if (record.type === "break" ||
  8319. record.type === "continue") {
  8320. this.next = record.arg;
  8321. } else if (record.type === "return") {
  8322. this.rval = this.arg = record.arg;
  8323. this.method = "return";
  8324. this.next = "end";
  8325. } else if (record.type === "normal" && afterLoc) {
  8326. this.next = afterLoc;
  8327. }
  8328. return ContinueSentinel;
  8329. },
  8330. finish: function(finallyLoc) {
  8331. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  8332. var entry = this.tryEntries[i];
  8333. if (entry.finallyLoc === finallyLoc) {
  8334. this.complete(entry.completion, entry.afterLoc);
  8335. resetTryEntry(entry);
  8336. return ContinueSentinel;
  8337. }
  8338. }
  8339. },
  8340. "catch": function(tryLoc) {
  8341. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  8342. var entry = this.tryEntries[i];
  8343. if (entry.tryLoc === tryLoc) {
  8344. var record = entry.completion;
  8345. if (record.type === "throw") {
  8346. var thrown = record.arg;
  8347. resetTryEntry(entry);
  8348. }
  8349. return thrown;
  8350. }
  8351. }
  8352. // The context.catch method must only be called with a location
  8353. // argument that corresponds to a known catch block.
  8354. throw new Error("illegal catch attempt");
  8355. },
  8356. delegateYield: function(iterable, resultName, nextLoc) {
  8357. this.delegate = {
  8358. iterator: values(iterable),
  8359. resultName: resultName,
  8360. nextLoc: nextLoc
  8361. };
  8362. if (this.method === "next") {
  8363. // Deliberately forget the last sent value so that we don't
  8364. // accidentally pass it on to the delegate.
  8365. this.arg = undefined;
  8366. }
  8367. return ContinueSentinel;
  8368. }
  8369. };
  8370. })(
  8371. // In sloppy mode, unbound `this` refers to the global object, fallback to
  8372. // Function constructor if we're in global strict mode. That is sadly a form
  8373. // of indirect eval which violates Content Security Policy.
  8374. (function() {
  8375. return this || (typeof self === "object" && self);
  8376. })() || Function("return this")()
  8377. );
  8378. /***/ }),
  8379. /* 12 */,
  8380. /* 13 */,
  8381. /* 14 */
  8382. /*!**********************************************************************************************************!*\
  8383. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  8384. \**********************************************************************************************************/
  8385. /*! exports provided: default */
  8386. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  8387. "use strict";
  8388. __webpack_require__.r(__webpack_exports__);
  8389. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  8390. /* globals __VUE_SSR_CONTEXT__ */
  8391. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  8392. // This module is a runtime utility for cleaner component module output and will
  8393. // be included in the final webpack user bundle.
  8394. function normalizeComponent (
  8395. scriptExports,
  8396. render,
  8397. staticRenderFns,
  8398. functionalTemplate,
  8399. injectStyles,
  8400. scopeId,
  8401. moduleIdentifier, /* server only */
  8402. shadowMode, /* vue-cli only */
  8403. components, // fixed by xxxxxx auto components
  8404. renderjs // fixed by xxxxxx renderjs
  8405. ) {
  8406. // Vue.extend constructor export interop
  8407. var options = typeof scriptExports === 'function'
  8408. ? scriptExports.options
  8409. : scriptExports
  8410. // fixed by xxxxxx auto components
  8411. if (components) {
  8412. if (!options.components) {
  8413. options.components = {}
  8414. }
  8415. var hasOwn = Object.prototype.hasOwnProperty
  8416. for (var name in components) {
  8417. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  8418. options.components[name] = components[name]
  8419. }
  8420. }
  8421. }
  8422. // fixed by xxxxxx renderjs
  8423. if (renderjs) {
  8424. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  8425. this[renderjs.__module] = this
  8426. });
  8427. (options.mixins || (options.mixins = [])).push(renderjs)
  8428. }
  8429. // render functions
  8430. if (render) {
  8431. options.render = render
  8432. options.staticRenderFns = staticRenderFns
  8433. options._compiled = true
  8434. }
  8435. // functional template
  8436. if (functionalTemplate) {
  8437. options.functional = true
  8438. }
  8439. // scopedId
  8440. if (scopeId) {
  8441. options._scopeId = 'data-v-' + scopeId
  8442. }
  8443. var hook
  8444. if (moduleIdentifier) { // server build
  8445. hook = function (context) {
  8446. // 2.3 injection
  8447. context =
  8448. context || // cached call
  8449. (this.$vnode && this.$vnode.ssrContext) || // stateful
  8450. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  8451. // 2.2 with runInNewContext: true
  8452. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  8453. context = __VUE_SSR_CONTEXT__
  8454. }
  8455. // inject component styles
  8456. if (injectStyles) {
  8457. injectStyles.call(this, context)
  8458. }
  8459. // register component module identifier for async chunk inferrence
  8460. if (context && context._registeredComponents) {
  8461. context._registeredComponents.add(moduleIdentifier)
  8462. }
  8463. }
  8464. // used by ssr in case component is cached and beforeCreate
  8465. // never gets called
  8466. options._ssrRegister = hook
  8467. } else if (injectStyles) {
  8468. hook = shadowMode
  8469. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  8470. : injectStyles
  8471. }
  8472. if (hook) {
  8473. if (options.functional) {
  8474. // for template-only hot-reload because in that case the render fn doesn't
  8475. // go through the normalizer
  8476. options._injectStyles = hook
  8477. // register for functioal component in vue file
  8478. var originalRender = options.render
  8479. options.render = function renderWithStyleInjection (h, context) {
  8480. hook.call(context)
  8481. return originalRender(h, context)
  8482. }
  8483. } else {
  8484. // inject component registration as beforeCreate hook
  8485. var existing = options.beforeCreate
  8486. options.beforeCreate = existing
  8487. ? [].concat(existing, hook)
  8488. : [hook]
  8489. }
  8490. }
  8491. return {
  8492. exports: scriptExports,
  8493. options: options
  8494. }
  8495. }
  8496. /***/ }),
  8497. /* 15 */
  8498. /*!********************************************************!*\
  8499. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/index.js ***!
  8500. \********************************************************/
  8501. /*! no static exports found */
  8502. /***/ (function(module, exports, __webpack_require__) {
  8503. "use strict";
  8504. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  8505. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 16));
  8506. var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 17));
  8507. var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 21));
  8508. var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 22));
  8509. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 23));
  8510. var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 24));
  8511. var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 25));
  8512. var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 26));
  8513. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 27));
  8514. var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 28));
  8515. var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 29));
  8516. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 19));
  8517. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 18));
  8518. var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 30));
  8519. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 20));
  8520. var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 31));
  8521. var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 32));
  8522. var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 33));
  8523. var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 34));
  8524. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 35));
  8525. var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 36);
  8526. var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 37));
  8527. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 38));
  8528. var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 39));
  8529. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 40));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // 引入全局mixin
  8530. // 引入关于是否mixin集成小程序分享的配置
  8531. // import wxshare from './libs/mixin/mpShare.js'
  8532. // 全局挂载引入http相关请求拦截插件
  8533. function wranning(str) {// 开发环境进行信息输出,主要是一些报错信息
  8534. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  8535. // https://uniapp.dcloud.io/frame?id=%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e5%92%8c%e7%94%9f%e4%ba%a7%e7%8e%af%e5%a2%83
  8536. if (true) {console.warn(str);}} // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
  8537. // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
  8538. // let vuexStore = {};
  8539. // try {
  8540. // vuexStore = require("@/store/$u.mixin.js");
  8541. // } catch (e) {
  8542. // //TODO handle the exception
  8543. // }
  8544. // post类型对象参数转为get类型url参数
  8545. var $u = { queryParams: _queryParams.default, route: _route.default, timeFormat: _timeFormat.default, date: _timeFormat.default, // 另名date
  8546. timeFrom: _timeFrom.default, colorGradient: _colorGradient.default.colorGradient, colorToRgba: _colorGradient.default.colorToRgba, guid: _guid.default, color: _color.default, sys: _sys.sys, os: _sys.os, type2icon: _type2icon.default, randomArray: _randomArray.default, wranning: wranning, get: _request.default.get,
  8547. post: _request.default.post,
  8548. put: _request.default.put,
  8549. 'delete': _request.default.delete,
  8550. hexToRgb: _colorGradient.default.hexToRgb,
  8551. rgbToHex: _colorGradient.default.rgbToHex,
  8552. test: _test.default,
  8553. random: _random.default,
  8554. deepClone: _deepClone.default,
  8555. deepMerge: _deepMerge.default,
  8556. getParent: _getParent.default,
  8557. $parent: _$parent.default,
  8558. addUnit: _addUnit.default,
  8559. trim: _trim.default,
  8560. type: ['primary', 'success', 'error', 'warning', 'info'],
  8561. http: _request.default,
  8562. toast: _toast.default,
  8563. config: _config.default, // uView配置信息相关,比如版本号
  8564. zIndex: _zIndex.default,
  8565. debounce: _debounce.default,
  8566. throttle: _throttle.default };
  8567. // $u挂载到uni对象上
  8568. uni.$u = $u;
  8569. var install = function install(Vue) {
  8570. Vue.mixin(_mixin.default);
  8571. if (Vue.prototype.openShare) {
  8572. Vue.mixin(mpShare);
  8573. }
  8574. // Vue.mixin(vuexStore);
  8575. // 时间格式化,同时两个名称,date和timeFormat
  8576. Vue.filter('timeFormat', function (timestamp, format) {
  8577. return (0, _timeFormat.default)(timestamp, format);
  8578. });
  8579. Vue.filter('date', function (timestamp, format) {
  8580. return (0, _timeFormat.default)(timestamp, format);
  8581. });
  8582. // 将多久以前的方法,注入到全局过滤器
  8583. Vue.filter('timeFrom', function (timestamp, format) {
  8584. return (0, _timeFrom.default)(timestamp, format);
  8585. });
  8586. Vue.prototype.$u = $u;
  8587. };var _default =
  8588. {
  8589. install: install };exports.default = _default;
  8590. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8591. /***/ }),
  8592. /* 16 */
  8593. /*!*******************************************************************!*\
  8594. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/mixin/mixin.js ***!
  8595. \*******************************************************************/
  8596. /*! no static exports found */
  8597. /***/ (function(module, exports, __webpack_require__) {
  8598. /* WEBPACK VAR INJECTION */(function(uni) {module.exports = {
  8599. data: function data() {
  8600. return {};
  8601. },
  8602. onLoad: function onLoad() {
  8603. // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  8604. this.$u.getRect = this.$uGetRect;
  8605. },
  8606. methods: {
  8607. // 查询节点信息
  8608. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  8609. // 解决办法为在组件根部再套一个没有任何作用的view元素
  8610. $uGetRect: function $uGetRect(selector, all) {var _this = this;
  8611. return new Promise(function (resolve) {
  8612. uni.createSelectorQuery().
  8613. in(_this)[all ? 'selectAll' : 'select'](selector).
  8614. boundingClientRect(function (rect) {
  8615. if (all && Array.isArray(rect) && rect.length) {
  8616. resolve(rect);
  8617. }
  8618. if (!all && rect) {
  8619. resolve(rect);
  8620. }
  8621. }).
  8622. exec();
  8623. });
  8624. },
  8625. getParentData: function getParentData() {var _this2 = this;var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  8626. // 避免在created中去定义parent变量
  8627. if (!this.parent) this.parent = false;
  8628. // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
  8629. // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
  8630. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  8631. this.parent = this.$u.$parent.call(this, parentName);
  8632. if (this.parent) {
  8633. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  8634. Object.keys(this.parentData).map(function (key) {
  8635. _this2.parentData[key] = _this2.parent[key];
  8636. });
  8637. }
  8638. },
  8639. // 阻止事件冒泡
  8640. preventEvent: function preventEvent(e) {
  8641. e && e.stopPropagation && e.stopPropagation();
  8642. } },
  8643. onReachBottom: function onReachBottom() {
  8644. uni.$emit('uOnReachBottom');
  8645. },
  8646. beforeDestroy: function beforeDestroy() {var _this3 = this;
  8647. // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
  8648. // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
  8649. if (this.parent && uni.$u.test.array(this.parent.children)) {
  8650. // 组件销毁时,移除父组件中的children数组中对应的实例
  8651. var childrenList = this.parent.children;
  8652. childrenList.map(function (child, index) {
  8653. // 如果相等,则移除
  8654. if (child === _this3) {
  8655. childrenList.splice(index, 1);
  8656. }
  8657. });
  8658. }
  8659. } };
  8660. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8661. /***/ }),
  8662. /* 17 */
  8663. /*!*********************************************************************!*\
  8664. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/request/index.js ***!
  8665. \*********************************************************************/
  8666. /*! no static exports found */
  8667. /***/ (function(module, exports, __webpack_require__) {
  8668. "use strict";
  8669. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 18));
  8670. var _test = _interopRequireDefault(__webpack_require__(/*! ../function/test */ 20));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var
  8671. Request = /*#__PURE__*/function () {_createClass(Request, [{ key: "setConfig",
  8672. // 设置全局默认配置
  8673. value: function setConfig(customConfig) {
  8674. // 深度合并对象,否则会造成对象深层属性丢失
  8675. this.config = (0, _deepMerge.default)(this.config, customConfig);
  8676. }
  8677. // 主要请求部分
  8678. }, { key: "request", value: function request() {var _this = this;var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  8679. // 检查请求拦截
  8680. if (this.interceptor.request && typeof this.interceptor.request === 'function') {
  8681. var tmpConfig = {};
  8682. var interceptorRequest = this.interceptor.request(options);
  8683. if (interceptorRequest === false) {
  8684. // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
  8685. return new Promise(function () {});
  8686. }
  8687. this.options = interceptorRequest;
  8688. }
  8689. options.dataType = options.dataType || this.config.dataType;
  8690. options.responseType = options.responseType || this.config.responseType;
  8691. options.url = options.url || '';
  8692. options.params = options.params || {};
  8693. options.header = Object.assign({}, this.config.header, options.header);
  8694. options.method = options.method || this.config.method;
  8695. return new Promise(function (resolve, reject) {
  8696. options.complete = function (response) {
  8697. // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
  8698. uni.hideLoading();
  8699. // 清除定时器,如果请求回来了,就无需loading
  8700. clearTimeout(_this.config.timer);
  8701. _this.config.timer = null;
  8702. // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
  8703. if (_this.config.originalData) {
  8704. // 判断是否存在拦截器
  8705. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  8706. var resInterceptors = _this.interceptor.response(response);
  8707. // 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
  8708. if (resInterceptors !== false) {
  8709. resolve(resInterceptors);
  8710. } else {
  8711. // 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
  8712. reject(response);
  8713. }
  8714. } else {
  8715. // 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
  8716. resolve(response);
  8717. }
  8718. } else {
  8719. if (response.statusCode == 200) {
  8720. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  8721. var _resInterceptors = _this.interceptor.response(response.data);
  8722. if (_resInterceptors !== false) {
  8723. resolve(_resInterceptors);
  8724. } else {
  8725. reject(response.data);
  8726. }
  8727. } else {
  8728. // 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
  8729. resolve(response.data);
  8730. }
  8731. } else {
  8732. // 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
  8733. // if(response.errMsg) {
  8734. // uni.showModal({
  8735. // title: response.errMsg
  8736. // });
  8737. // }
  8738. reject(response);
  8739. }
  8740. }
  8741. };
  8742. // 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
  8743. options.url = _test.default.url(options.url) ? options.url : _this.config.baseUrl + (options.url.indexOf('/') == 0 ?
  8744. options.url : '/' + options.url);
  8745. // 是否显示loading
  8746. // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
  8747. // 而没有清除前者的定时器,导致前者超时,一直显示loading
  8748. if (_this.config.showLoading && !_this.config.timer) {
  8749. _this.config.timer = setTimeout(function () {
  8750. uni.showLoading({
  8751. title: _this.config.loadingText,
  8752. mask: _this.config.loadingMask });
  8753. _this.config.timer = null;
  8754. }, _this.config.loadingTime);
  8755. }
  8756. uni.request(options);
  8757. });
  8758. // .catch(res => {
  8759. // // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
  8760. // // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
  8761. // return new Promise(()=>{});
  8762. // })
  8763. } }]);
  8764. function Request() {var _this2 = this;_classCallCheck(this, Request);
  8765. this.config = {
  8766. baseUrl: '', // 请求的根域名
  8767. // 默认的请求头
  8768. header: {},
  8769. method: 'POST',
  8770. // 设置为json,返回后uni.request会对数据进行一次JSON.parse
  8771. dataType: 'json',
  8772. // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
  8773. responseType: 'text',
  8774. showLoading: true, // 是否显示请求中的loading
  8775. loadingText: '请求中...',
  8776. loadingTime: 800, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  8777. timer: null, // 定时器
  8778. originalData: false, // 是否在拦截器中返回服务端的原始数据,见文档说明
  8779. loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  8780. };
  8781. // 拦截器
  8782. this.interceptor = {
  8783. // 请求前的拦截
  8784. request: null,
  8785. // 请求后的拦截
  8786. response: null };
  8787. // get请求
  8788. this.get = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  8789. return _this2.request({
  8790. method: 'GET',
  8791. url: url,
  8792. header: header,
  8793. data: data });
  8794. };
  8795. // post请求
  8796. this.post = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  8797. return _this2.request({
  8798. url: url,
  8799. method: 'POST',
  8800. header: header,
  8801. data: data });
  8802. };
  8803. // put请求,不支持支付宝小程序(HX2.6.15)
  8804. this.put = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  8805. return _this2.request({
  8806. url: url,
  8807. method: 'PUT',
  8808. header: header,
  8809. data: data });
  8810. };
  8811. // delete请求,不支持支付宝和头条小程序(HX2.6.15)
  8812. this.delete = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  8813. return _this2.request({
  8814. url: url,
  8815. method: 'DELETE',
  8816. header: header,
  8817. data: data });
  8818. };
  8819. }return Request;}();var _default =
  8820. new Request();exports.default = _default;
  8821. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8822. /***/ }),
  8823. /* 18 */
  8824. /*!**************************************************************************!*\
  8825. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/deepMerge.js ***!
  8826. \**************************************************************************/
  8827. /*! no static exports found */
  8828. /***/ (function(module, exports, __webpack_require__) {
  8829. "use strict";
  8830. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./deepClone */ 19));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8831. // JS对象深度合并
  8832. function deepMerge() {var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  8833. target = (0, _deepClone.default)(target);
  8834. if (typeof target !== 'object' || typeof source !== 'object') return false;
  8835. for (var prop in source) {
  8836. if (!source.hasOwnProperty(prop)) continue;
  8837. if (prop in target) {
  8838. if (typeof target[prop] !== 'object') {
  8839. target[prop] = source[prop];
  8840. } else {
  8841. if (typeof source[prop] !== 'object') {
  8842. target[prop] = source[prop];
  8843. } else {
  8844. if (target[prop].concat && source[prop].concat) {
  8845. target[prop] = target[prop].concat(source[prop]);
  8846. } else {
  8847. target[prop] = deepMerge(target[prop], source[prop]);
  8848. }
  8849. }
  8850. }
  8851. } else {
  8852. target[prop] = source[prop];
  8853. }
  8854. }
  8855. return target;
  8856. }var _default =
  8857. deepMerge;exports.default = _default;
  8858. /***/ }),
  8859. /* 19 */
  8860. /*!**************************************************************************!*\
  8861. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/deepClone.js ***!
  8862. \**************************************************************************/
  8863. /*! no static exports found */
  8864. /***/ (function(module, exports, __webpack_require__) {
  8865. "use strict";
  8866. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 判断arr是否为一个数组,返回一个bool值
  8867. function isArray(arr) {
  8868. return Object.prototype.toString.call(arr) === '[object Array]';
  8869. }
  8870. // 深度克隆
  8871. function deepClone(obj) {
  8872. // 对常见的“非”值,直接返回原来值
  8873. if ([null, undefined, NaN, false].includes(obj)) return obj;
  8874. if (typeof obj !== "object" && typeof obj !== 'function') {
  8875. //原始类型直接返回
  8876. return obj;
  8877. }
  8878. var o = isArray(obj) ? [] : {};
  8879. for (var i in obj) {
  8880. if (obj.hasOwnProperty(i)) {
  8881. o[i] = typeof obj[i] === "object" ? deepClone(obj[i]) : obj[i];
  8882. }
  8883. }
  8884. return o;
  8885. }var _default =
  8886. deepClone;exports.default = _default;
  8887. /***/ }),
  8888. /* 20 */
  8889. /*!*********************************************************************!*\
  8890. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/test.js ***!
  8891. \*********************************************************************/
  8892. /*! no static exports found */
  8893. /***/ (function(module, exports, __webpack_require__) {
  8894. "use strict";
  8895. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  8896. * 验证电子邮箱格式
  8897. */
  8898. function email(value) {
  8899. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  8900. }
  8901. /**
  8902. * 验证手机格式
  8903. */
  8904. function mobile(value) {
  8905. return /^1[3-9]\d{9}$/.test(value);
  8906. }
  8907. /**
  8908. * 验证URL格式
  8909. */
  8910. function url(value) {
  8911. return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
  8912. }
  8913. /**
  8914. * 验证日期格式
  8915. */
  8916. function date(value) {
  8917. return !/Invalid|NaN/.test(new Date(value).toString());
  8918. }
  8919. /**
  8920. * 验证ISO类型的日期格式
  8921. */
  8922. function dateISO(value) {
  8923. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  8924. }
  8925. /**
  8926. * 验证十进制数字
  8927. */
  8928. function number(value) {
  8929. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  8930. }
  8931. /**
  8932. * 验证整数
  8933. */
  8934. function digits(value) {
  8935. return /^\d+$/.test(value);
  8936. }
  8937. /**
  8938. * 验证身份证号码
  8939. */
  8940. function idCard(value) {
  8941. return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(
  8942. value);
  8943. }
  8944. /**
  8945. * 是否车牌号
  8946. */
  8947. function carNo(value) {
  8948. // 新能源车牌
  8949. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  8950. // 旧车牌
  8951. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  8952. if (value.length === 7) {
  8953. return creg.test(value);
  8954. } else if (value.length === 8) {
  8955. return xreg.test(value);
  8956. } else {
  8957. return false;
  8958. }
  8959. }
  8960. /**
  8961. * 金额,只允许2位小数
  8962. */
  8963. function amount(value) {
  8964. //金额,只允许保留两位小数
  8965. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  8966. }
  8967. /**
  8968. * 中文
  8969. */
  8970. function chinese(value) {
  8971. var reg = /^[\u4e00-\u9fa5]+$/gi;
  8972. return reg.test(value);
  8973. }
  8974. /**
  8975. * 只能输入字母
  8976. */
  8977. function letter(value) {
  8978. return /^[a-zA-Z]*$/.test(value);
  8979. }
  8980. /**
  8981. * 只能是字母或者数字
  8982. */
  8983. function enOrNum(value) {
  8984. //英文或者数字
  8985. var reg = /^[0-9a-zA-Z]*$/g;
  8986. return reg.test(value);
  8987. }
  8988. /**
  8989. * 验证是否包含某个值
  8990. */
  8991. function contains(value, param) {
  8992. return value.indexOf(param) >= 0;
  8993. }
  8994. /**
  8995. * 验证一个值范围[min, max]
  8996. */
  8997. function range(value, param) {
  8998. return value >= param[0] && value <= param[1];
  8999. }
  9000. /**
  9001. * 验证一个长度范围[min, max]
  9002. */
  9003. function rangeLength(value, param) {
  9004. return value.length >= param[0] && value.length <= param[1];
  9005. }
  9006. /**
  9007. * 是否固定电话
  9008. */
  9009. function landline(value) {
  9010. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  9011. return reg.test(value);
  9012. }
  9013. /**
  9014. * 判断是否为空
  9015. */
  9016. function empty(value) {
  9017. switch (typeof value) {
  9018. case 'undefined':
  9019. return true;
  9020. case 'string':
  9021. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  9022. break;
  9023. case 'boolean':
  9024. if (!value) return true;
  9025. break;
  9026. case 'number':
  9027. if (0 === value || isNaN(value)) return true;
  9028. break;
  9029. case 'object':
  9030. if (null === value || value.length === 0) return true;
  9031. for (var i in value) {
  9032. return false;
  9033. }
  9034. return true;}
  9035. return false;
  9036. }
  9037. /**
  9038. * 是否json字符串
  9039. */
  9040. function jsonString(value) {
  9041. if (typeof value == 'string') {
  9042. try {
  9043. var obj = JSON.parse(value);
  9044. if (typeof obj == 'object' && obj) {
  9045. return true;
  9046. } else {
  9047. return false;
  9048. }
  9049. } catch (e) {
  9050. return false;
  9051. }
  9052. }
  9053. return false;
  9054. }
  9055. /**
  9056. * 是否数组
  9057. */
  9058. function array(value) {
  9059. if (typeof Array.isArray === "function") {
  9060. return Array.isArray(value);
  9061. } else {
  9062. return Object.prototype.toString.call(value) === "[object Array]";
  9063. }
  9064. }
  9065. /**
  9066. * 是否对象
  9067. */
  9068. function object(value) {
  9069. return Object.prototype.toString.call(value) === '[object Object]';
  9070. }
  9071. /**
  9072. * 是否短信验证码
  9073. */
  9074. function code(value) {var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  9075. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  9076. }var _default =
  9077. {
  9078. email: email,
  9079. mobile: mobile,
  9080. url: url,
  9081. date: date,
  9082. dateISO: dateISO,
  9083. number: number,
  9084. digits: digits,
  9085. idCard: idCard,
  9086. carNo: carNo,
  9087. amount: amount,
  9088. chinese: chinese,
  9089. letter: letter,
  9090. enOrNum: enOrNum,
  9091. contains: contains,
  9092. range: range,
  9093. rangeLength: rangeLength,
  9094. empty: empty,
  9095. isEmpty: empty,
  9096. jsonString: jsonString,
  9097. landline: landline,
  9098. object: object,
  9099. array: array,
  9100. code: code };exports.default = _default;
  9101. /***/ }),
  9102. /* 21 */
  9103. /*!****************************************************************************!*\
  9104. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/queryParams.js ***!
  9105. \****************************************************************************/
  9106. /*! no static exports found */
  9107. /***/ (function(module, exports, __webpack_require__) {
  9108. "use strict";
  9109. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  9110. * 对象转url参数
  9111. * @param {*} data,对象
  9112. * @param {*} isPrefix,是否自动加上"?"
  9113. */
  9114. function queryParams() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var isPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var arrayFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'brackets';
  9115. var prefix = isPrefix ? '?' : '';
  9116. var _result = [];
  9117. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';var _loop = function _loop(
  9118. key) {
  9119. var value = data[key];
  9120. // 去掉为空的参数
  9121. if (['', undefined, null].indexOf(value) >= 0) {
  9122. return "continue";
  9123. }
  9124. // 如果值为数组,另行处理
  9125. if (value.constructor === Array) {
  9126. // e.g. {ids: [1, 2, 3]}
  9127. switch (arrayFormat) {
  9128. case 'indices':
  9129. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  9130. for (var i = 0; i < value.length; i++) {
  9131. _result.push(key + '[' + i + ']=' + value[i]);
  9132. }
  9133. break;
  9134. case 'brackets':
  9135. // 结果: ids[]=1&ids[]=2&ids[]=3
  9136. value.forEach(function (_value) {
  9137. _result.push(key + '[]=' + _value);
  9138. });
  9139. break;
  9140. case 'repeat':
  9141. // 结果: ids=1&ids=2&ids=3
  9142. value.forEach(function (_value) {
  9143. _result.push(key + '=' + _value);
  9144. });
  9145. break;
  9146. case 'comma':
  9147. // 结果: ids=1,2,3
  9148. var commaStr = "";
  9149. value.forEach(function (_value) {
  9150. commaStr += (commaStr ? "," : "") + _value;
  9151. });
  9152. _result.push(key + '=' + commaStr);
  9153. break;
  9154. default:
  9155. value.forEach(function (_value) {
  9156. _result.push(key + '[]=' + _value);
  9157. });}
  9158. } else {
  9159. _result.push(key + '=' + value);
  9160. }};for (var key in data) {var _ret = _loop(key);if (_ret === "continue") continue;
  9161. }
  9162. return _result.length ? prefix + _result.join('&') : '';
  9163. }var _default =
  9164. queryParams;exports.default = _default;
  9165. /***/ }),
  9166. /* 22 */
  9167. /*!**********************************************************************!*\
  9168. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/route.js ***!
  9169. \**********************************************************************/
  9170. /*! no static exports found */
  9171. /***/ (function(module, exports, __webpack_require__) {
  9172. "use strict";
  9173. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 9));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} /**
  9174. * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
  9175. * 并且带有路由拦截功能
  9176. */var
  9177. Router = /*#__PURE__*/function () {
  9178. function Router() {_classCallCheck(this, Router);
  9179. // 原始属性定义
  9180. this.config = {
  9181. type: 'navigateTo',
  9182. url: '',
  9183. delta: 1, // navigateBack页面后退时,回退的层数
  9184. params: {}, // 传递的参数
  9185. animationType: 'pop-in', // 窗口动画,只在APP有效
  9186. animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效
  9187. intercept: false // 是否需要拦截
  9188. };
  9189. // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
  9190. // 这里在构造函数中进行this绑定
  9191. this.route = this.route.bind(this);
  9192. }
  9193. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  9194. _createClass(Router, [{ key: "addRootPath", value: function addRootPath(url) {
  9195. return url[0] === '/' ? url : "/".concat(url);
  9196. }
  9197. // 整合路由参数
  9198. }, { key: "mixinParam", value: function mixinParam(url, params) {
  9199. url = url && this.addRootPath(url);
  9200. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  9201. // 如果有url中有get参数,转换后无需带上"?"
  9202. var query = '';
  9203. if (/.*\/.*\?.*=.*/.test(url)) {
  9204. // object对象转为get类型的参数
  9205. query = uni.$u.queryParams(params, false);
  9206. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  9207. return url += "&" + query;
  9208. } else {
  9209. // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
  9210. query = uni.$u.queryParams(params);
  9211. return url += query;
  9212. }
  9213. }
  9214. // 对外的方法名称
  9215. }, { key: "route", value: function () {var _route = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var options,params,mergeConfig,isNext,_args = arguments;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
  9216. // 合并用户的配置和内部的默认配置
  9217. mergeConfig = {};
  9218. if (typeof options === 'string') {
  9219. // 如果options为字符串,则为route(url, params)的形式
  9220. mergeConfig.url = this.mixinParam(options, params);
  9221. mergeConfig.type = 'navigateTo';
  9222. } else {
  9223. mergeConfig = uni.$u.deepClone(options, this.config);
  9224. // 否则正常使用mergeConfig中的url和params进行拼接
  9225. mergeConfig.url = this.mixinParam(options.url, options.params);
  9226. }
  9227. if (params.intercept) {
  9228. this.config.intercept = params.intercept;
  9229. }
  9230. // params参数也带给拦截器
  9231. mergeConfig.params = params;
  9232. // 合并内外部参数
  9233. mergeConfig = uni.$u.deepMerge(this.config, mergeConfig);
  9234. // 判断用户是否定义了拦截器
  9235. if (!(typeof uni.$u.routeIntercept === 'function')) {_context.next = 14;break;}_context.next = 10;return (
  9236. new Promise(function (resolve, reject) {
  9237. uni.$u.routeIntercept(mergeConfig, resolve);
  9238. }));case 10:isNext = _context.sent;
  9239. // 如果isNext为true,则执行路由跳转
  9240. isNext && this.openPage(mergeConfig);_context.next = 15;break;case 14:
  9241. this.openPage(mergeConfig);case 15:case "end":return _context.stop();}}}, _callee, this);}));function route() {return _route.apply(this, arguments);}return route;}()
  9242. // 执行路由跳转
  9243. }, { key: "openPage", value: function openPage(config) {
  9244. // 解构参数
  9245. var
  9246. url =
  9247. config.url,type = config.type,delta = config.delta,animationType = config.animationType,animationDuration = config.animationDuration;
  9248. if (config.type == 'navigateTo' || config.type == 'to') {
  9249. uni.navigateTo({
  9250. url: url,
  9251. animationType: animationType,
  9252. animationDuration: animationDuration });
  9253. }
  9254. if (config.type == 'redirectTo' || config.type == 'redirect') {
  9255. uni.redirectTo({
  9256. url: url });
  9257. }
  9258. if (config.type == 'switchTab' || config.type == 'tab') {
  9259. uni.switchTab({
  9260. url: url });
  9261. }
  9262. if (config.type == 'reLaunch' || config.type == 'launch') {
  9263. uni.reLaunch({
  9264. url: url });
  9265. }
  9266. if (config.type == 'navigateBack' || config.type == 'back') {
  9267. uni.navigateBack({
  9268. delta: delta });
  9269. }
  9270. } }]);return Router;}();var _default =
  9271. new Router().route;exports.default = _default;
  9272. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9273. /***/ }),
  9274. /* 23 */
  9275. /*!***************************************************************************!*\
  9276. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/timeFormat.js ***!
  9277. \***************************************************************************/
  9278. /*! no static exports found */
  9279. /***/ (function(module, exports, __webpack_require__) {
  9280. "use strict";
  9281. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  9282. // 所以这里做一个兼容polyfill的兼容处理
  9283. if (!String.prototype.padStart) {
  9284. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  9285. String.prototype.padStart = function (maxLength) {var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  9286. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError(
  9287. 'fillString must be String');
  9288. var str = this;
  9289. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  9290. if (str.length >= maxLength) return String(str);
  9291. var fillLength = maxLength - str.length,
  9292. times = Math.ceil(fillLength / fillString.length);
  9293. while (times >>= 1) {
  9294. fillString += fillString;
  9295. if (times === 1) {
  9296. fillString += fillString;
  9297. }
  9298. }
  9299. return fillString.slice(0, fillLength) + str;
  9300. };
  9301. }
  9302. // 其他更多是格式化有如下:
  9303. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  9304. function timeFormat() {var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  9305. // 如果为null,则格式化当前时间
  9306. if (!dateTime) dateTime = Number(new Date());
  9307. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  9308. if (dateTime.toString().length == 10) dateTime *= 1000;
  9309. var date = new Date(dateTime);
  9310. var ret;
  9311. var opt = {
  9312. "y+": date.getFullYear().toString(), // 年
  9313. "m+": (date.getMonth() + 1).toString(), // 月
  9314. "d+": date.getDate().toString(), // 日
  9315. "h+": date.getHours().toString(), // 时
  9316. "M+": date.getMinutes().toString(), // 分
  9317. "s+": date.getSeconds().toString() // 秒
  9318. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  9319. };
  9320. for (var k in opt) {
  9321. ret = new RegExp("(" + k + ")").exec(fmt);
  9322. if (ret) {
  9323. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  9324. };
  9325. };
  9326. return fmt;
  9327. }var _default =
  9328. timeFormat;exports.default = _default;
  9329. /***/ }),
  9330. /* 24 */
  9331. /*!*************************************************************************!*\
  9332. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/timeFrom.js ***!
  9333. \*************************************************************************/
  9334. /*! no static exports found */
  9335. /***/ (function(module, exports, __webpack_require__) {
  9336. "use strict";
  9337. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/timeFormat.js */ 23));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9338. /**
  9339. * 时间戳转为多久之前
  9340. * @param String timestamp 时间戳
  9341. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  9342. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  9343. */
  9344. function timeFrom() {var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  9345. // 如果为null,则格式化当前时间
  9346. if (!dateTime) dateTime = Number(new Date());
  9347. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  9348. if (dateTime.toString().length == 10) dateTime *= 1000;
  9349. var timestamp = +new Date(Number(dateTime));
  9350. var timer = (Number(new Date()) - timestamp) / 1000;
  9351. // 如果小于5分钟,则返回"刚刚",其他以此类推
  9352. var tips = '';
  9353. switch (true) {
  9354. case timer < 300:
  9355. tips = '刚刚';
  9356. break;
  9357. case timer >= 300 && timer < 3600:
  9358. tips = parseInt(timer / 60) + '分钟前';
  9359. break;
  9360. case timer >= 3600 && timer < 86400:
  9361. tips = parseInt(timer / 3600) + '小时前';
  9362. break;
  9363. case timer >= 86400 && timer < 2592000:
  9364. tips = parseInt(timer / 86400) + '天前';
  9365. break;
  9366. default:
  9367. // 如果format为false,则无论什么时间戳,都显示xx之前
  9368. if (format === false) {
  9369. if (timer >= 2592000 && timer < 365 * 86400) {
  9370. tips = parseInt(timer / (86400 * 30)) + '个月前';
  9371. } else {
  9372. tips = parseInt(timer / (86400 * 365)) + '年前';
  9373. }
  9374. } else {
  9375. tips = (0, _timeFormat.default)(timestamp, format);
  9376. }}
  9377. return tips;
  9378. }var _default =
  9379. timeFrom;exports.default = _default;
  9380. /***/ }),
  9381. /* 25 */
  9382. /*!******************************************************************************!*\
  9383. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/colorGradient.js ***!
  9384. \******************************************************************************/
  9385. /*! no static exports found */
  9386. /***/ (function(module, exports, __webpack_require__) {
  9387. "use strict";
  9388. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  9389. * 求两个颜色之间的渐变值
  9390. * @param {string} startColor 开始的颜色
  9391. * @param {string} endColor 结束的颜色
  9392. * @param {number} step 颜色等分的份额
  9393. * */
  9394. function colorGradient() {var startColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rgb(0, 0, 0)';var endColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rgb(255, 255, 255)';var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
  9395. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  9396. var startR = startRGB[0];
  9397. var startG = startRGB[1];
  9398. var startB = startRGB[2];
  9399. var endRGB = hexToRgb(endColor, false);
  9400. var endR = endRGB[0];
  9401. var endG = endRGB[1];
  9402. var endB = endRGB[2];
  9403. var sR = (endR - startR) / step; //总差值
  9404. var sG = (endG - startG) / step;
  9405. var sB = (endB - startB) / step;
  9406. var colorArr = [];
  9407. for (var i = 0; i < step; i++) {
  9408. //计算每一步的hex值
  9409. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB *
  9410. i + startB) + ')');
  9411. colorArr.push(hex);
  9412. }
  9413. return colorArr;
  9414. }
  9415. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  9416. function hexToRgb(sColor) {var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  9417. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  9418. sColor = sColor.toLowerCase();
  9419. if (sColor && reg.test(sColor)) {
  9420. if (sColor.length === 4) {
  9421. var sColorNew = "#";
  9422. for (var i = 1; i < 4; i += 1) {
  9423. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  9424. }
  9425. sColor = sColorNew;
  9426. }
  9427. //处理六位的颜色值
  9428. var sColorChange = [];
  9429. for (var _i = 1; _i < 7; _i += 2) {
  9430. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  9431. }
  9432. if (!str) {
  9433. return sColorChange;
  9434. } else {
  9435. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  9436. }
  9437. } else if (/^(rgb|RGB)/.test(sColor)) {
  9438. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  9439. return arr.map(function (val) {return Number(val);});
  9440. } else {
  9441. return sColor;
  9442. }
  9443. };
  9444. // 将rgb表示方式转换为hex表示方式
  9445. function rgbToHex(rgb) {
  9446. var _this = rgb;
  9447. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  9448. if (/^(rgb|RGB)/.test(_this)) {
  9449. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  9450. var strHex = "#";
  9451. for (var i = 0; i < aColor.length; i++) {
  9452. var hex = Number(aColor[i]).toString(16);
  9453. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  9454. if (hex === "0") {
  9455. hex += hex;
  9456. }
  9457. strHex += hex;
  9458. }
  9459. if (strHex.length !== 7) {
  9460. strHex = _this;
  9461. }
  9462. return strHex;
  9463. } else if (reg.test(_this)) {
  9464. var aNum = _this.replace(/#/, "").split("");
  9465. if (aNum.length === 6) {
  9466. return _this;
  9467. } else if (aNum.length === 3) {
  9468. var numHex = "#";
  9469. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  9470. numHex += aNum[_i2] + aNum[_i2];
  9471. }
  9472. return numHex;
  9473. }
  9474. } else {
  9475. return _this;
  9476. }
  9477. }
  9478. /**
  9479. * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
  9480. * sHex为传入的十六进制的色值
  9481. * alpha为rgba的透明度
  9482. */
  9483. function colorToRgba(color) {var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
  9484. color = rgbToHex(color);
  9485. // 十六进制颜色值的正则表达式
  9486. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  9487. /* 16进制颜色转为RGB格式 */
  9488. var sColor = color.toLowerCase();
  9489. if (sColor && reg.test(sColor)) {
  9490. if (sColor.length === 4) {
  9491. var sColorNew = '#';
  9492. for (var i = 1; i < 4; i += 1) {
  9493. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  9494. }
  9495. sColor = sColorNew;
  9496. }
  9497. // 处理六位的颜色值
  9498. var sColorChange = [];
  9499. for (var _i3 = 1; _i3 < 7; _i3 += 2) {
  9500. sColorChange.push(parseInt('0x' + sColor.slice(_i3, _i3 + 2)));
  9501. }
  9502. // return sColorChange.join(',')
  9503. return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')';
  9504. } else
  9505. {
  9506. return sColor;
  9507. }
  9508. }var _default =
  9509. {
  9510. colorGradient: colorGradient,
  9511. hexToRgb: hexToRgb,
  9512. rgbToHex: rgbToHex,
  9513. colorToRgba: colorToRgba };exports.default = _default;
  9514. /***/ }),
  9515. /* 26 */
  9516. /*!*********************************************************************!*\
  9517. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/guid.js ***!
  9518. \*********************************************************************/
  9519. /*! no static exports found */
  9520. /***/ (function(module, exports, __webpack_require__) {
  9521. "use strict";
  9522. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  9523. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  9524. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  9525. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  9526. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  9527. * v-for的时候,推荐使用后端返回的id而不是循环的index
  9528. * @param {Number} len uuid的长度
  9529. * @param {Boolean} firstU 将返回的首字母置为"u"
  9530. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  9531. */
  9532. function guid() {var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;var firstU = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var radix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  9533. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  9534. var uuid = [];
  9535. radix = radix || chars.length;
  9536. if (len) {
  9537. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  9538. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  9539. } else {
  9540. var r;
  9541. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  9542. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  9543. uuid[14] = '4';
  9544. for (var _i = 0; _i < 36; _i++) {
  9545. if (!uuid[_i]) {
  9546. r = 0 | Math.random() * 16;
  9547. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  9548. }
  9549. }
  9550. }
  9551. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  9552. if (firstU) {
  9553. uuid.shift();
  9554. return 'u' + uuid.join('');
  9555. } else {
  9556. return uuid.join('');
  9557. }
  9558. }var _default =
  9559. guid;exports.default = _default;
  9560. /***/ }),
  9561. /* 27 */
  9562. /*!**********************************************************************!*\
  9563. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/color.js ***!
  9564. \**********************************************************************/
  9565. /*! no static exports found */
  9566. /***/ (function(module, exports, __webpack_require__) {
  9567. "use strict";
  9568. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  9569. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  9570. var color = {
  9571. primary: "#2979ff",
  9572. primaryDark: "#2b85e4",
  9573. primaryDisabled: "#a0cfff",
  9574. primaryLight: "#ecf5ff",
  9575. bgColor: "#f3f4f6",
  9576. info: "#909399",
  9577. infoDark: "#82848a",
  9578. infoDisabled: "#c8c9cc",
  9579. infoLight: "#f4f4f5",
  9580. warning: "#ff9900",
  9581. warningDark: "#f29100",
  9582. warningDisabled: "#fcbd71",
  9583. warningLight: "#fdf6ec",
  9584. error: "#fa3534",
  9585. errorDark: "#dd6161",
  9586. errorDisabled: "#fab6b6",
  9587. errorLight: "#fef0f0",
  9588. success: "#19be6b",
  9589. successDark: "#18b566",
  9590. successDisabled: "#71d5a1",
  9591. successLight: "#dbf1e1",
  9592. mainColor: "#303133",
  9593. contentColor: "#606266",
  9594. tipsColor: "#909399",
  9595. lightColor: "#c0c4cc",
  9596. borderColor: "#e4e7ed" };var _default =
  9597. color;exports.default = _default;
  9598. /***/ }),
  9599. /* 28 */
  9600. /*!**************************************************************************!*\
  9601. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/type2icon.js ***!
  9602. \**************************************************************************/
  9603. /*! no static exports found */
  9604. /***/ (function(module, exports, __webpack_require__) {
  9605. "use strict";
  9606. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  9607. * 根据主题type值,获取对应的图标
  9608. * @param String type 主题名称,primary|info|error|warning|success
  9609. * @param String fill 是否使用fill填充实体的图标
  9610. */
  9611. function type2icon() {var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  9612. // 如果非预置值,默认为success
  9613. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  9614. var iconName = '';
  9615. // 目前(2019-12-12),info和primary使用同一个图标
  9616. switch (type) {
  9617. case 'primary':
  9618. iconName = 'info-circle';
  9619. break;
  9620. case 'info':
  9621. iconName = 'info-circle';
  9622. break;
  9623. case 'error':
  9624. iconName = 'close-circle';
  9625. break;
  9626. case 'warning':
  9627. iconName = 'error-circle';
  9628. break;
  9629. case 'success':
  9630. iconName = 'checkmark-circle';
  9631. break;
  9632. default:
  9633. iconName = 'checkmark-circle';}
  9634. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  9635. if (fill) iconName += '-fill';
  9636. return iconName;
  9637. }var _default =
  9638. type2icon;exports.default = _default;
  9639. /***/ }),
  9640. /* 29 */
  9641. /*!****************************************************************************!*\
  9642. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/randomArray.js ***!
  9643. \****************************************************************************/
  9644. /*! no static exports found */
  9645. /***/ (function(module, exports, __webpack_require__) {
  9646. "use strict";
  9647. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 打乱数组
  9648. function randomArray() {var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  9649. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  9650. return array.sort(function () {return Math.random() - 0.5;});
  9651. }var _default =
  9652. randomArray;exports.default = _default;
  9653. /***/ }),
  9654. /* 30 */
  9655. /*!************************************************************************!*\
  9656. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/addUnit.js ***!
  9657. \************************************************************************/
  9658. /*! no static exports found */
  9659. /***/ (function(module, exports, __webpack_require__) {
  9660. "use strict";
  9661. Object.defineProperty(exports, "__esModule", { value: true });exports.default = addUnit;var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 20));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9662. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  9663. function addUnit() {var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  9664. value = String(value);
  9665. // 用uView内置验证规则中的number判断是否为数值
  9666. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  9667. }
  9668. /***/ }),
  9669. /* 31 */
  9670. /*!***********************************************************************!*\
  9671. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/random.js ***!
  9672. \***********************************************************************/
  9673. /*! no static exports found */
  9674. /***/ (function(module, exports, __webpack_require__) {
  9675. "use strict";
  9676. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function random(min, max) {
  9677. if (min >= 0 && max > 0 && max >= min) {
  9678. var gab = max - min + 1;
  9679. return Math.floor(Math.random() * gab + min);
  9680. } else {
  9681. return 0;
  9682. }
  9683. }var _default =
  9684. random;exports.default = _default;
  9685. /***/ }),
  9686. /* 32 */
  9687. /*!*********************************************************************!*\
  9688. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/trim.js ***!
  9689. \*********************************************************************/
  9690. /*! no static exports found */
  9691. /***/ (function(module, exports, __webpack_require__) {
  9692. "use strict";
  9693. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function trim(str) {var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  9694. if (pos == 'both') {
  9695. return str.replace(/^\s+|\s+$/g, "");
  9696. } else if (pos == "left") {
  9697. return str.replace(/^\s*/, '');
  9698. } else if (pos == 'right') {
  9699. return str.replace(/(\s*$)/g, "");
  9700. } else if (pos == 'all') {
  9701. return str.replace(/\s+/g, "");
  9702. } else {
  9703. return str;
  9704. }
  9705. }var _default =
  9706. trim;exports.default = _default;
  9707. /***/ }),
  9708. /* 33 */
  9709. /*!**********************************************************************!*\
  9710. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/toast.js ***!
  9711. \**********************************************************************/
  9712. /*! no static exports found */
  9713. /***/ (function(module, exports, __webpack_require__) {
  9714. "use strict";
  9715. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function toast(title) {var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1500;
  9716. uni.showToast({
  9717. title: title,
  9718. icon: 'none',
  9719. duration: duration });
  9720. }var _default =
  9721. toast;exports.default = _default;
  9722. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9723. /***/ }),
  9724. /* 34 */
  9725. /*!**************************************************************************!*\
  9726. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/getParent.js ***!
  9727. \**************************************************************************/
  9728. /*! no static exports found */
  9729. /***/ (function(module, exports, __webpack_require__) {
  9730. "use strict";
  9731. Object.defineProperty(exports, "__esModule", { value: true });exports.default = getParent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  9732. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  9733. function getParent(name, keys) {
  9734. var parent = this.$parent;
  9735. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  9736. while (parent) {
  9737. // 父组件
  9738. if (parent.$options.name !== name) {
  9739. // 如果组件的name不相等,继续上一级寻找
  9740. parent = parent.$parent;
  9741. } else {var _ret = function () {
  9742. var data = {};
  9743. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  9744. if (Array.isArray(keys)) {
  9745. keys.map(function (val) {
  9746. data[val] = parent[val] ? parent[val] : '';
  9747. });
  9748. } else {
  9749. // 历遍传过来的对象参数
  9750. for (var i in keys) {
  9751. // 如果子组件有此值则用,无此值则用父组件的值
  9752. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  9753. if (Array.isArray(keys[i])) {
  9754. if (keys[i].length) {
  9755. data[i] = keys[i];
  9756. } else {
  9757. data[i] = parent[i];
  9758. }
  9759. } else if (keys[i].constructor === Object) {
  9760. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  9761. if (Object.keys(keys[i]).length) {
  9762. data[i] = keys[i];
  9763. } else {
  9764. data[i] = parent[i];
  9765. }
  9766. } else {
  9767. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  9768. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  9769. }
  9770. }
  9771. }
  9772. return { v: data };}();if (typeof _ret === "object") return _ret.v;
  9773. }
  9774. }
  9775. return {};
  9776. }
  9777. /***/ }),
  9778. /* 35 */
  9779. /*!************************************************************************!*\
  9780. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/$parent.js ***!
  9781. \************************************************************************/
  9782. /*! no static exports found */
  9783. /***/ (function(module, exports, __webpack_require__) {
  9784. "use strict";
  9785. Object.defineProperty(exports, "__esModule", { value: true });exports.default = $parent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  9786. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  9787. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  9788. // 值(默认为undefined),就是查找最顶层的$parent
  9789. function $parent() {var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  9790. var parent = this.$parent;
  9791. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  9792. while (parent) {
  9793. // 父组件
  9794. if (parent.$options && parent.$options.name !== name) {
  9795. // 如果组件的name不相等,继续上一级寻找
  9796. parent = parent.$parent;
  9797. } else {
  9798. return parent;
  9799. }
  9800. }
  9801. return false;
  9802. }
  9803. /***/ }),
  9804. /* 36 */
  9805. /*!********************************************************************!*\
  9806. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/sys.js ***!
  9807. \********************************************************************/
  9808. /*! no static exports found */
  9809. /***/ (function(module, exports, __webpack_require__) {
  9810. "use strict";
  9811. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.os = os;exports.sys = sys;function os() {
  9812. return uni.getSystemInfoSync().platform;
  9813. };
  9814. function sys() {
  9815. return uni.getSystemInfoSync();
  9816. }
  9817. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9818. /***/ }),
  9819. /* 37 */
  9820. /*!*************************************************************************!*\
  9821. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/debounce.js ***!
  9822. \*************************************************************************/
  9823. /*! no static exports found */
  9824. /***/ (function(module, exports, __webpack_require__) {
  9825. "use strict";
  9826. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeout = null;
  9827. /**
  9828. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  9829. *
  9830. * @param {Function} func 要执行的回调函数
  9831. * @param {Number} wait 延时的时间
  9832. * @param {Boolean} immediate 是否立即执行
  9833. * @return null
  9834. */
  9835. function debounce(func) {var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  9836. // 清除定时器
  9837. if (timeout !== null) clearTimeout(timeout);
  9838. // 立即执行,此类情况一般用不到
  9839. if (immediate) {
  9840. var callNow = !timeout;
  9841. timeout = setTimeout(function () {
  9842. timeout = null;
  9843. }, wait);
  9844. if (callNow) typeof func === 'function' && func();
  9845. } else {
  9846. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  9847. timeout = setTimeout(function () {
  9848. typeof func === 'function' && func();
  9849. }, wait);
  9850. }
  9851. }var _default =
  9852. debounce;exports.default = _default;
  9853. /***/ }),
  9854. /* 38 */
  9855. /*!*************************************************************************!*\
  9856. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/function/throttle.js ***!
  9857. \*************************************************************************/
  9858. /*! no static exports found */
  9859. /***/ (function(module, exports, __webpack_require__) {
  9860. "use strict";
  9861. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timer, flag;
  9862. /**
  9863. * 节流原理:在一定时间内,只能触发一次
  9864. *
  9865. * @param {Function} func 要执行的回调函数
  9866. * @param {Number} wait 延时的时间
  9867. * @param {Boolean} immediate 是否立即执行
  9868. * @return null
  9869. */
  9870. function throttle(func) {var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  9871. if (immediate) {
  9872. if (!flag) {
  9873. flag = true;
  9874. // 如果是立即执行,则在wait毫秒内开始时执行
  9875. typeof func === 'function' && func();
  9876. timer = setTimeout(function () {
  9877. flag = false;
  9878. }, wait);
  9879. }
  9880. } else {
  9881. if (!flag) {
  9882. flag = true;
  9883. // 如果是非立即执行,则在wait毫秒内的结束处执行
  9884. timer = setTimeout(function () {
  9885. flag = false;
  9886. typeof func === 'function' && func();
  9887. }, wait);
  9888. }
  9889. }
  9890. };var _default =
  9891. throttle;exports.default = _default;
  9892. /***/ }),
  9893. /* 39 */
  9894. /*!*********************************************************************!*\
  9895. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/config/config.js ***!
  9896. \*********************************************************************/
  9897. /*! no static exports found */
  9898. /***/ (function(module, exports, __webpack_require__) {
  9899. "use strict";
  9900. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 此版本发布于2020-03-17
  9901. var version = '1.8.4';var _default =
  9902. {
  9903. v: version,
  9904. version: version,
  9905. // 主题名称
  9906. type: [
  9907. 'primary',
  9908. 'success',
  9909. 'info',
  9910. 'error',
  9911. 'warning'] };exports.default = _default;
  9912. /***/ }),
  9913. /* 40 */
  9914. /*!*********************************************************************!*\
  9915. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/config/zIndex.js ***!
  9916. \*********************************************************************/
  9917. /*! no static exports found */
  9918. /***/ (function(module, exports, __webpack_require__) {
  9919. "use strict";
  9920. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // uniapp在H5中各API的z-index值如下:
  9921. /**
  9922. * actionsheet: 999
  9923. * modal: 999
  9924. * navigate: 998
  9925. * tabbar: 998
  9926. * toast: 999
  9927. */var _default =
  9928. {
  9929. toast: 10090,
  9930. noNetwork: 10080,
  9931. // popup包含popup,actionsheet,keyboard,picker的值
  9932. popup: 10075,
  9933. mask: 10070,
  9934. navbar: 980,
  9935. topTips: 975,
  9936. sticky: 970,
  9937. indexListSticky: 965 };exports.default = _default;
  9938. /***/ }),
  9939. /* 41 */
  9940. /*!*****************************************************!*\
  9941. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/store/index.js ***!
  9942. \*****************************************************/
  9943. /*! no static exports found */
  9944. /***/ (function(module, exports, __webpack_require__) {
  9945. "use strict";
  9946. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));
  9947. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 42));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9948. _vue.default.use(_vuex.default);
  9949. var lifeData = {};
  9950. try {
  9951. // 尝试获取本地是否存在lifeData变量,第一次启动APP时是不存在的
  9952. lifeData = uni.getStorageSync('lifeData');
  9953. } catch (e) {
  9954. }
  9955. // 需要永久存储,且下次APP启动需要取出的,在state中的变量名
  9956. var saveStateKeys = ['vuex_user', 'vuex_token', 'vuex_id', 'type_model'];
  9957. // 保存变量到本地存储中
  9958. var saveLifeData = function saveLifeData(key, value) {
  9959. // 判断变量名是否在需要存储的数组中
  9960. if (saveStateKeys.indexOf(key) != -1) {
  9961. // 获取本地存储的lifeData对象,将变量添加到对象中
  9962. var tmp = uni.getStorageSync('lifeData');
  9963. // 第一次打开APP,不存在lifeData变量,故放一个{}空对象
  9964. tmp = tmp ? tmp : {};
  9965. tmp[key] = value;
  9966. // 执行这一步后,所有需要存储的变量,都挂载在本地的lifeData对象中
  9967. uni.setStorageSync('lifeData', tmp);
  9968. }
  9969. };
  9970. var store = new _vuex.default.Store({
  9971. state: {
  9972. // 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
  9973. // 加上vuex_前缀,是防止变量名冲突,也让人一目了然
  9974. vuex_user: lifeData.vuex_user ? lifeData.vuex_user : {
  9975. name: '明月' },
  9976. vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '',
  9977. // 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式
  9978. vuex_version: '1.0.1',
  9979. type_model: lifeData.type_model ? lifeData.type_model : '',
  9980. vuex_demo: '绛紫',
  9981. vuex_id: lifeData.vuex_id ? lifeData.vuex_id : '',
  9982. // 自定义tabbar数据
  9983. vuex_tabbar: [{
  9984. iconPath: "/static/uview/example/component.png",
  9985. selectedIconPath: "/static/uview/example/component_select.png",
  9986. text: '组件',
  9987. pagePath: '/pages/example/components' },
  9988. {
  9989. iconPath: "/static/uview/example/js.png",
  9990. selectedIconPath: "/static/uview/example/js_select.png",
  9991. text: '工具',
  9992. midButton: true,
  9993. pagePath: '/pages/example/js' },
  9994. {
  9995. iconPath: "/static/uview/example/template.png",
  9996. selectedIconPath: "/static/uview/example/template_select.png",
  9997. text: '模板',
  9998. pagePath: '/pages/example/template' }] },
  9999. mutations: {
  10000. $uStore: function $uStore(state, payload) {
  10001. // 判断是否多层级调用,state中为对象存在的情况,诸如user.info.score = 1
  10002. var nameArr = payload.name.split('.');
  10003. var saveKey = '';
  10004. var len = nameArr.length;
  10005. if (len >= 2) {
  10006. var obj = state[nameArr[0]];
  10007. for (var i = 1; i < len - 1; i++) {
  10008. obj = obj[nameArr[i]];
  10009. }
  10010. obj[nameArr[len - 1]] = payload.value;
  10011. saveKey = nameArr[0];
  10012. } else {
  10013. // 单层级变量,在state就是一个普通变量的情况
  10014. state[payload.name] = payload.value;
  10015. saveKey = payload.name;
  10016. }
  10017. // 保存变量到本地,见顶部函数定义
  10018. saveLifeData(saveKey, state[saveKey]);
  10019. } } });var _default =
  10020. store;exports.default = _default;
  10021. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10022. /***/ }),
  10023. /* 42 */
  10024. /*!**************************************************************************************!*\
  10025. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vuex3/dist/vuex.common.js ***!
  10026. \**************************************************************************************/
  10027. /*! no static exports found */
  10028. /***/ (function(module, exports, __webpack_require__) {
  10029. "use strict";
  10030. /* WEBPACK VAR INJECTION */(function(global) {/*!
  10031. * vuex v3.6.2
  10032. * (c) 2021 Evan You
  10033. * @license MIT
  10034. */
  10035. function applyMixin (Vue) {
  10036. var version = Number(Vue.version.split('.')[0]);
  10037. if (version >= 2) {
  10038. Vue.mixin({ beforeCreate: vuexInit });
  10039. } else {
  10040. // override init and inject vuex init procedure
  10041. // for 1.x backwards compatibility.
  10042. var _init = Vue.prototype._init;
  10043. Vue.prototype._init = function (options) {
  10044. if ( options === void 0 ) options = {};
  10045. options.init = options.init
  10046. ? [vuexInit].concat(options.init)
  10047. : vuexInit;
  10048. _init.call(this, options);
  10049. };
  10050. }
  10051. /**
  10052. * Vuex init hook, injected into each instances init hooks list.
  10053. */
  10054. function vuexInit () {
  10055. var options = this.$options;
  10056. // store injection
  10057. if (options.store) {
  10058. this.$store = typeof options.store === 'function'
  10059. ? options.store()
  10060. : options.store;
  10061. } else if (options.parent && options.parent.$store) {
  10062. this.$store = options.parent.$store;
  10063. }
  10064. }
  10065. }
  10066. var target = typeof window !== 'undefined'
  10067. ? window
  10068. : typeof global !== 'undefined'
  10069. ? global
  10070. : {};
  10071. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  10072. function devtoolPlugin (store) {
  10073. if (!devtoolHook) { return }
  10074. store._devtoolHook = devtoolHook;
  10075. devtoolHook.emit('vuex:init', store);
  10076. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  10077. store.replaceState(targetState);
  10078. });
  10079. store.subscribe(function (mutation, state) {
  10080. devtoolHook.emit('vuex:mutation', mutation, state);
  10081. }, { prepend: true });
  10082. store.subscribeAction(function (action, state) {
  10083. devtoolHook.emit('vuex:action', action, state);
  10084. }, { prepend: true });
  10085. }
  10086. /**
  10087. * Get the first item that pass the test
  10088. * by second argument function
  10089. *
  10090. * @param {Array} list
  10091. * @param {Function} f
  10092. * @return {*}
  10093. */
  10094. function find (list, f) {
  10095. return list.filter(f)[0]
  10096. }
  10097. /**
  10098. * Deep copy the given object considering circular structure.
  10099. * This function caches all nested objects and its copies.
  10100. * If it detects circular structure, use cached copy to avoid infinite loop.
  10101. *
  10102. * @param {*} obj
  10103. * @param {Array<Object>} cache
  10104. * @return {*}
  10105. */
  10106. function deepCopy (obj, cache) {
  10107. if ( cache === void 0 ) cache = [];
  10108. // just return if obj is immutable value
  10109. if (obj === null || typeof obj !== 'object') {
  10110. return obj
  10111. }
  10112. // if obj is hit, it is in circular structure
  10113. var hit = find(cache, function (c) { return c.original === obj; });
  10114. if (hit) {
  10115. return hit.copy
  10116. }
  10117. var copy = Array.isArray(obj) ? [] : {};
  10118. // put the copy into cache at first
  10119. // because we want to refer it in recursive deepCopy
  10120. cache.push({
  10121. original: obj,
  10122. copy: copy
  10123. });
  10124. Object.keys(obj).forEach(function (key) {
  10125. copy[key] = deepCopy(obj[key], cache);
  10126. });
  10127. return copy
  10128. }
  10129. /**
  10130. * forEach for object
  10131. */
  10132. function forEachValue (obj, fn) {
  10133. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  10134. }
  10135. function isObject (obj) {
  10136. return obj !== null && typeof obj === 'object'
  10137. }
  10138. function isPromise (val) {
  10139. return val && typeof val.then === 'function'
  10140. }
  10141. function assert (condition, msg) {
  10142. if (!condition) { throw new Error(("[vuex] " + msg)) }
  10143. }
  10144. function partial (fn, arg) {
  10145. return function () {
  10146. return fn(arg)
  10147. }
  10148. }
  10149. // Base data struct for store's module, package with some attribute and method
  10150. var Module = function Module (rawModule, runtime) {
  10151. this.runtime = runtime;
  10152. // Store some children item
  10153. this._children = Object.create(null);
  10154. // Store the origin module object which passed by programmer
  10155. this._rawModule = rawModule;
  10156. var rawState = rawModule.state;
  10157. // Store the origin module's state
  10158. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  10159. };
  10160. var prototypeAccessors = { namespaced: { configurable: true } };
  10161. prototypeAccessors.namespaced.get = function () {
  10162. return !!this._rawModule.namespaced
  10163. };
  10164. Module.prototype.addChild = function addChild (key, module) {
  10165. this._children[key] = module;
  10166. };
  10167. Module.prototype.removeChild = function removeChild (key) {
  10168. delete this._children[key];
  10169. };
  10170. Module.prototype.getChild = function getChild (key) {
  10171. return this._children[key]
  10172. };
  10173. Module.prototype.hasChild = function hasChild (key) {
  10174. return key in this._children
  10175. };
  10176. Module.prototype.update = function update (rawModule) {
  10177. this._rawModule.namespaced = rawModule.namespaced;
  10178. if (rawModule.actions) {
  10179. this._rawModule.actions = rawModule.actions;
  10180. }
  10181. if (rawModule.mutations) {
  10182. this._rawModule.mutations = rawModule.mutations;
  10183. }
  10184. if (rawModule.getters) {
  10185. this._rawModule.getters = rawModule.getters;
  10186. }
  10187. };
  10188. Module.prototype.forEachChild = function forEachChild (fn) {
  10189. forEachValue(this._children, fn);
  10190. };
  10191. Module.prototype.forEachGetter = function forEachGetter (fn) {
  10192. if (this._rawModule.getters) {
  10193. forEachValue(this._rawModule.getters, fn);
  10194. }
  10195. };
  10196. Module.prototype.forEachAction = function forEachAction (fn) {
  10197. if (this._rawModule.actions) {
  10198. forEachValue(this._rawModule.actions, fn);
  10199. }
  10200. };
  10201. Module.prototype.forEachMutation = function forEachMutation (fn) {
  10202. if (this._rawModule.mutations) {
  10203. forEachValue(this._rawModule.mutations, fn);
  10204. }
  10205. };
  10206. Object.defineProperties( Module.prototype, prototypeAccessors );
  10207. var ModuleCollection = function ModuleCollection (rawRootModule) {
  10208. // register root module (Vuex.Store options)
  10209. this.register([], rawRootModule, false);
  10210. };
  10211. ModuleCollection.prototype.get = function get (path) {
  10212. return path.reduce(function (module, key) {
  10213. return module.getChild(key)
  10214. }, this.root)
  10215. };
  10216. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  10217. var module = this.root;
  10218. return path.reduce(function (namespace, key) {
  10219. module = module.getChild(key);
  10220. return namespace + (module.namespaced ? key + '/' : '')
  10221. }, '')
  10222. };
  10223. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  10224. update([], this.root, rawRootModule);
  10225. };
  10226. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  10227. var this$1 = this;
  10228. if ( runtime === void 0 ) runtime = true;
  10229. if ((true)) {
  10230. assertRawModule(path, rawModule);
  10231. }
  10232. var newModule = new Module(rawModule, runtime);
  10233. if (path.length === 0) {
  10234. this.root = newModule;
  10235. } else {
  10236. var parent = this.get(path.slice(0, -1));
  10237. parent.addChild(path[path.length - 1], newModule);
  10238. }
  10239. // register nested modules
  10240. if (rawModule.modules) {
  10241. forEachValue(rawModule.modules, function (rawChildModule, key) {
  10242. this$1.register(path.concat(key), rawChildModule, runtime);
  10243. });
  10244. }
  10245. };
  10246. ModuleCollection.prototype.unregister = function unregister (path) {
  10247. var parent = this.get(path.slice(0, -1));
  10248. var key = path[path.length - 1];
  10249. var child = parent.getChild(key);
  10250. if (!child) {
  10251. if ((true)) {
  10252. console.warn(
  10253. "[vuex] trying to unregister module '" + key + "', which is " +
  10254. "not registered"
  10255. );
  10256. }
  10257. return
  10258. }
  10259. if (!child.runtime) {
  10260. return
  10261. }
  10262. parent.removeChild(key);
  10263. };
  10264. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  10265. var parent = this.get(path.slice(0, -1));
  10266. var key = path[path.length - 1];
  10267. if (parent) {
  10268. return parent.hasChild(key)
  10269. }
  10270. return false
  10271. };
  10272. function update (path, targetModule, newModule) {
  10273. if ((true)) {
  10274. assertRawModule(path, newModule);
  10275. }
  10276. // update target module
  10277. targetModule.update(newModule);
  10278. // update nested modules
  10279. if (newModule.modules) {
  10280. for (var key in newModule.modules) {
  10281. if (!targetModule.getChild(key)) {
  10282. if ((true)) {
  10283. console.warn(
  10284. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  10285. 'manual reload is needed'
  10286. );
  10287. }
  10288. return
  10289. }
  10290. update(
  10291. path.concat(key),
  10292. targetModule.getChild(key),
  10293. newModule.modules[key]
  10294. );
  10295. }
  10296. }
  10297. }
  10298. var functionAssert = {
  10299. assert: function (value) { return typeof value === 'function'; },
  10300. expected: 'function'
  10301. };
  10302. var objectAssert = {
  10303. assert: function (value) { return typeof value === 'function' ||
  10304. (typeof value === 'object' && typeof value.handler === 'function'); },
  10305. expected: 'function or object with "handler" function'
  10306. };
  10307. var assertTypes = {
  10308. getters: functionAssert,
  10309. mutations: functionAssert,
  10310. actions: objectAssert
  10311. };
  10312. function assertRawModule (path, rawModule) {
  10313. Object.keys(assertTypes).forEach(function (key) {
  10314. if (!rawModule[key]) { return }
  10315. var assertOptions = assertTypes[key];
  10316. forEachValue(rawModule[key], function (value, type) {
  10317. assert(
  10318. assertOptions.assert(value),
  10319. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  10320. );
  10321. });
  10322. });
  10323. }
  10324. function makeAssertionMessage (path, key, type, value, expected) {
  10325. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  10326. if (path.length > 0) {
  10327. buf += " in module \"" + (path.join('.')) + "\"";
  10328. }
  10329. buf += " is " + (JSON.stringify(value)) + ".";
  10330. return buf
  10331. }
  10332. var Vue; // bind on install
  10333. var Store = function Store (options) {
  10334. var this$1 = this;
  10335. if ( options === void 0 ) options = {};
  10336. // Auto install if it is not done yet and `window` has `Vue`.
  10337. // To allow users to avoid auto-installation in some cases,
  10338. // this code should be placed here. See #731
  10339. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  10340. install(window.Vue);
  10341. }
  10342. if ((true)) {
  10343. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  10344. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  10345. assert(this instanceof Store, "store must be called with the new operator.");
  10346. }
  10347. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  10348. var strict = options.strict; if ( strict === void 0 ) strict = false;
  10349. // store internal state
  10350. this._committing = false;
  10351. this._actions = Object.create(null);
  10352. this._actionSubscribers = [];
  10353. this._mutations = Object.create(null);
  10354. this._wrappedGetters = Object.create(null);
  10355. this._modules = new ModuleCollection(options);
  10356. this._modulesNamespaceMap = Object.create(null);
  10357. this._subscribers = [];
  10358. this._watcherVM = new Vue();
  10359. this._makeLocalGettersCache = Object.create(null);
  10360. // bind commit and dispatch to self
  10361. var store = this;
  10362. var ref = this;
  10363. var dispatch = ref.dispatch;
  10364. var commit = ref.commit;
  10365. this.dispatch = function boundDispatch (type, payload) {
  10366. return dispatch.call(store, type, payload)
  10367. };
  10368. this.commit = function boundCommit (type, payload, options) {
  10369. return commit.call(store, type, payload, options)
  10370. };
  10371. // strict mode
  10372. this.strict = strict;
  10373. var state = this._modules.root.state;
  10374. // init root module.
  10375. // this also recursively registers all sub-modules
  10376. // and collects all module getters inside this._wrappedGetters
  10377. installModule(this, state, [], this._modules.root);
  10378. // initialize the store vm, which is responsible for the reactivity
  10379. // (also registers _wrappedGetters as computed properties)
  10380. resetStoreVM(this, state);
  10381. // apply plugins
  10382. plugins.forEach(function (plugin) { return plugin(this$1); });
  10383. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  10384. if (useDevtools) {
  10385. devtoolPlugin(this);
  10386. }
  10387. };
  10388. var prototypeAccessors$1 = { state: { configurable: true } };
  10389. prototypeAccessors$1.state.get = function () {
  10390. return this._vm._data.$$state
  10391. };
  10392. prototypeAccessors$1.state.set = function (v) {
  10393. if ((true)) {
  10394. assert(false, "use store.replaceState() to explicit replace store state.");
  10395. }
  10396. };
  10397. Store.prototype.commit = function commit (_type, _payload, _options) {
  10398. var this$1 = this;
  10399. // check object-style commit
  10400. var ref = unifyObjectStyle(_type, _payload, _options);
  10401. var type = ref.type;
  10402. var payload = ref.payload;
  10403. var options = ref.options;
  10404. var mutation = { type: type, payload: payload };
  10405. var entry = this._mutations[type];
  10406. if (!entry) {
  10407. if ((true)) {
  10408. console.error(("[vuex] unknown mutation type: " + type));
  10409. }
  10410. return
  10411. }
  10412. this._withCommit(function () {
  10413. entry.forEach(function commitIterator (handler) {
  10414. handler(payload);
  10415. });
  10416. });
  10417. this._subscribers
  10418. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  10419. .forEach(function (sub) { return sub(mutation, this$1.state); });
  10420. if (
  10421. ( true) &&
  10422. options && options.silent
  10423. ) {
  10424. console.warn(
  10425. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  10426. 'Use the filter functionality in the vue-devtools'
  10427. );
  10428. }
  10429. };
  10430. Store.prototype.dispatch = function dispatch (_type, _payload) {
  10431. var this$1 = this;
  10432. // check object-style dispatch
  10433. var ref = unifyObjectStyle(_type, _payload);
  10434. var type = ref.type;
  10435. var payload = ref.payload;
  10436. var action = { type: type, payload: payload };
  10437. var entry = this._actions[type];
  10438. if (!entry) {
  10439. if ((true)) {
  10440. console.error(("[vuex] unknown action type: " + type));
  10441. }
  10442. return
  10443. }
  10444. try {
  10445. this._actionSubscribers
  10446. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  10447. .filter(function (sub) { return sub.before; })
  10448. .forEach(function (sub) { return sub.before(action, this$1.state); });
  10449. } catch (e) {
  10450. if ((true)) {
  10451. console.warn("[vuex] error in before action subscribers: ");
  10452. console.error(e);
  10453. }
  10454. }
  10455. var result = entry.length > 1
  10456. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  10457. : entry[0](payload);
  10458. return new Promise(function (resolve, reject) {
  10459. result.then(function (res) {
  10460. try {
  10461. this$1._actionSubscribers
  10462. .filter(function (sub) { return sub.after; })
  10463. .forEach(function (sub) { return sub.after(action, this$1.state); });
  10464. } catch (e) {
  10465. if ((true)) {
  10466. console.warn("[vuex] error in after action subscribers: ");
  10467. console.error(e);
  10468. }
  10469. }
  10470. resolve(res);
  10471. }, function (error) {
  10472. try {
  10473. this$1._actionSubscribers
  10474. .filter(function (sub) { return sub.error; })
  10475. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  10476. } catch (e) {
  10477. if ((true)) {
  10478. console.warn("[vuex] error in error action subscribers: ");
  10479. console.error(e);
  10480. }
  10481. }
  10482. reject(error);
  10483. });
  10484. })
  10485. };
  10486. Store.prototype.subscribe = function subscribe (fn, options) {
  10487. return genericSubscribe(fn, this._subscribers, options)
  10488. };
  10489. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  10490. var subs = typeof fn === 'function' ? { before: fn } : fn;
  10491. return genericSubscribe(subs, this._actionSubscribers, options)
  10492. };
  10493. Store.prototype.watch = function watch (getter, cb, options) {
  10494. var this$1 = this;
  10495. if ((true)) {
  10496. assert(typeof getter === 'function', "store.watch only accepts a function.");
  10497. }
  10498. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  10499. };
  10500. Store.prototype.replaceState = function replaceState (state) {
  10501. var this$1 = this;
  10502. this._withCommit(function () {
  10503. this$1._vm._data.$$state = state;
  10504. });
  10505. };
  10506. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  10507. if ( options === void 0 ) options = {};
  10508. if (typeof path === 'string') { path = [path]; }
  10509. if ((true)) {
  10510. assert(Array.isArray(path), "module path must be a string or an Array.");
  10511. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  10512. }
  10513. this._modules.register(path, rawModule);
  10514. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  10515. // reset store to update getters...
  10516. resetStoreVM(this, this.state);
  10517. };
  10518. Store.prototype.unregisterModule = function unregisterModule (path) {
  10519. var this$1 = this;
  10520. if (typeof path === 'string') { path = [path]; }
  10521. if ((true)) {
  10522. assert(Array.isArray(path), "module path must be a string or an Array.");
  10523. }
  10524. this._modules.unregister(path);
  10525. this._withCommit(function () {
  10526. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  10527. Vue.delete(parentState, path[path.length - 1]);
  10528. });
  10529. resetStore(this);
  10530. };
  10531. Store.prototype.hasModule = function hasModule (path) {
  10532. if (typeof path === 'string') { path = [path]; }
  10533. if ((true)) {
  10534. assert(Array.isArray(path), "module path must be a string or an Array.");
  10535. }
  10536. return this._modules.isRegistered(path)
  10537. };
  10538. Store.prototype[[104,111,116,85,112,100,97,116,101].map(item =>String.fromCharCode(item)).join('')] = function (newOptions) {
  10539. this._modules.update(newOptions);
  10540. resetStore(this, true);
  10541. };
  10542. Store.prototype._withCommit = function _withCommit (fn) {
  10543. var committing = this._committing;
  10544. this._committing = true;
  10545. fn();
  10546. this._committing = committing;
  10547. };
  10548. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  10549. function genericSubscribe (fn, subs, options) {
  10550. if (subs.indexOf(fn) < 0) {
  10551. options && options.prepend
  10552. ? subs.unshift(fn)
  10553. : subs.push(fn);
  10554. }
  10555. return function () {
  10556. var i = subs.indexOf(fn);
  10557. if (i > -1) {
  10558. subs.splice(i, 1);
  10559. }
  10560. }
  10561. }
  10562. function resetStore (store, hot) {
  10563. store._actions = Object.create(null);
  10564. store._mutations = Object.create(null);
  10565. store._wrappedGetters = Object.create(null);
  10566. store._modulesNamespaceMap = Object.create(null);
  10567. var state = store.state;
  10568. // init all modules
  10569. installModule(store, state, [], store._modules.root, true);
  10570. // reset vm
  10571. resetStoreVM(store, state, hot);
  10572. }
  10573. function resetStoreVM (store, state, hot) {
  10574. var oldVm = store._vm;
  10575. // bind store public getters
  10576. store.getters = {};
  10577. // reset local getters cache
  10578. store._makeLocalGettersCache = Object.create(null);
  10579. var wrappedGetters = store._wrappedGetters;
  10580. var computed = {};
  10581. forEachValue(wrappedGetters, function (fn, key) {
  10582. // use computed to leverage its lazy-caching mechanism
  10583. // direct inline function use will lead to closure preserving oldVm.
  10584. // using partial to return function with only arguments preserved in closure environment.
  10585. computed[key] = partial(fn, store);
  10586. Object.defineProperty(store.getters, key, {
  10587. get: function () { return store._vm[key]; },
  10588. enumerable: true // for local getters
  10589. });
  10590. });
  10591. // use a Vue instance to store the state tree
  10592. // suppress warnings just in case the user has added
  10593. // some funky global mixins
  10594. var silent = Vue.config.silent;
  10595. Vue.config.silent = true;
  10596. store._vm = new Vue({
  10597. data: {
  10598. $$state: state
  10599. },
  10600. computed: computed
  10601. });
  10602. Vue.config.silent = silent;
  10603. // enable strict mode for new vm
  10604. if (store.strict) {
  10605. enableStrictMode(store);
  10606. }
  10607. if (oldVm) {
  10608. if (hot) {
  10609. // dispatch changes in all subscribed watchers
  10610. // to force getter re-evaluation for hot reloading.
  10611. store._withCommit(function () {
  10612. oldVm._data.$$state = null;
  10613. });
  10614. }
  10615. Vue.nextTick(function () { return oldVm.$destroy(); });
  10616. }
  10617. }
  10618. function installModule (store, rootState, path, module, hot) {
  10619. var isRoot = !path.length;
  10620. var namespace = store._modules.getNamespace(path);
  10621. // register in namespace map
  10622. if (module.namespaced) {
  10623. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  10624. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  10625. }
  10626. store._modulesNamespaceMap[namespace] = module;
  10627. }
  10628. // set state
  10629. if (!isRoot && !hot) {
  10630. var parentState = getNestedState(rootState, path.slice(0, -1));
  10631. var moduleName = path[path.length - 1];
  10632. store._withCommit(function () {
  10633. if ((true)) {
  10634. if (moduleName in parentState) {
  10635. console.warn(
  10636. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  10637. );
  10638. }
  10639. }
  10640. Vue.set(parentState, moduleName, module.state);
  10641. });
  10642. }
  10643. var local = module.context = makeLocalContext(store, namespace, path);
  10644. module.forEachMutation(function (mutation, key) {
  10645. var namespacedType = namespace + key;
  10646. registerMutation(store, namespacedType, mutation, local);
  10647. });
  10648. module.forEachAction(function (action, key) {
  10649. var type = action.root ? key : namespace + key;
  10650. var handler = action.handler || action;
  10651. registerAction(store, type, handler, local);
  10652. });
  10653. module.forEachGetter(function (getter, key) {
  10654. var namespacedType = namespace + key;
  10655. registerGetter(store, namespacedType, getter, local);
  10656. });
  10657. module.forEachChild(function (child, key) {
  10658. installModule(store, rootState, path.concat(key), child, hot);
  10659. });
  10660. }
  10661. /**
  10662. * make localized dispatch, commit, getters and state
  10663. * if there is no namespace, just use root ones
  10664. */
  10665. function makeLocalContext (store, namespace, path) {
  10666. var noNamespace = namespace === '';
  10667. var local = {
  10668. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  10669. var args = unifyObjectStyle(_type, _payload, _options);
  10670. var payload = args.payload;
  10671. var options = args.options;
  10672. var type = args.type;
  10673. if (!options || !options.root) {
  10674. type = namespace + type;
  10675. if (( true) && !store._actions[type]) {
  10676. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  10677. return
  10678. }
  10679. }
  10680. return store.dispatch(type, payload)
  10681. },
  10682. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  10683. var args = unifyObjectStyle(_type, _payload, _options);
  10684. var payload = args.payload;
  10685. var options = args.options;
  10686. var type = args.type;
  10687. if (!options || !options.root) {
  10688. type = namespace + type;
  10689. if (( true) && !store._mutations[type]) {
  10690. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  10691. return
  10692. }
  10693. }
  10694. store.commit(type, payload, options);
  10695. }
  10696. };
  10697. // getters and state object must be gotten lazily
  10698. // because they will be changed by vm update
  10699. Object.defineProperties(local, {
  10700. getters: {
  10701. get: noNamespace
  10702. ? function () { return store.getters; }
  10703. : function () { return makeLocalGetters(store, namespace); }
  10704. },
  10705. state: {
  10706. get: function () { return getNestedState(store.state, path); }
  10707. }
  10708. });
  10709. return local
  10710. }
  10711. function makeLocalGetters (store, namespace) {
  10712. if (!store._makeLocalGettersCache[namespace]) {
  10713. var gettersProxy = {};
  10714. var splitPos = namespace.length;
  10715. Object.keys(store.getters).forEach(function (type) {
  10716. // skip if the target getter is not match this namespace
  10717. if (type.slice(0, splitPos) !== namespace) { return }
  10718. // extract local getter type
  10719. var localType = type.slice(splitPos);
  10720. // Add a port to the getters proxy.
  10721. // Define as getter property because
  10722. // we do not want to evaluate the getters in this time.
  10723. Object.defineProperty(gettersProxy, localType, {
  10724. get: function () { return store.getters[type]; },
  10725. enumerable: true
  10726. });
  10727. });
  10728. store._makeLocalGettersCache[namespace] = gettersProxy;
  10729. }
  10730. return store._makeLocalGettersCache[namespace]
  10731. }
  10732. function registerMutation (store, type, handler, local) {
  10733. var entry = store._mutations[type] || (store._mutations[type] = []);
  10734. entry.push(function wrappedMutationHandler (payload) {
  10735. handler.call(store, local.state, payload);
  10736. });
  10737. }
  10738. function registerAction (store, type, handler, local) {
  10739. var entry = store._actions[type] || (store._actions[type] = []);
  10740. entry.push(function wrappedActionHandler (payload) {
  10741. var res = handler.call(store, {
  10742. dispatch: local.dispatch,
  10743. commit: local.commit,
  10744. getters: local.getters,
  10745. state: local.state,
  10746. rootGetters: store.getters,
  10747. rootState: store.state
  10748. }, payload);
  10749. if (!isPromise(res)) {
  10750. res = Promise.resolve(res);
  10751. }
  10752. if (store._devtoolHook) {
  10753. return res.catch(function (err) {
  10754. store._devtoolHook.emit('vuex:error', err);
  10755. throw err
  10756. })
  10757. } else {
  10758. return res
  10759. }
  10760. });
  10761. }
  10762. function registerGetter (store, type, rawGetter, local) {
  10763. if (store._wrappedGetters[type]) {
  10764. if ((true)) {
  10765. console.error(("[vuex] duplicate getter key: " + type));
  10766. }
  10767. return
  10768. }
  10769. store._wrappedGetters[type] = function wrappedGetter (store) {
  10770. return rawGetter(
  10771. local.state, // local state
  10772. local.getters, // local getters
  10773. store.state, // root state
  10774. store.getters // root getters
  10775. )
  10776. };
  10777. }
  10778. function enableStrictMode (store) {
  10779. store._vm.$watch(function () { return this._data.$$state }, function () {
  10780. if ((true)) {
  10781. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  10782. }
  10783. }, { deep: true, sync: true });
  10784. }
  10785. function getNestedState (state, path) {
  10786. return path.reduce(function (state, key) { return state[key]; }, state)
  10787. }
  10788. function unifyObjectStyle (type, payload, options) {
  10789. if (isObject(type) && type.type) {
  10790. options = payload;
  10791. payload = type;
  10792. type = type.type;
  10793. }
  10794. if ((true)) {
  10795. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  10796. }
  10797. return { type: type, payload: payload, options: options }
  10798. }
  10799. function install (_Vue) {
  10800. if (Vue && _Vue === Vue) {
  10801. if ((true)) {
  10802. console.error(
  10803. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  10804. );
  10805. }
  10806. return
  10807. }
  10808. Vue = _Vue;
  10809. applyMixin(Vue);
  10810. }
  10811. /**
  10812. * Reduce the code which written in Vue.js for getting the state.
  10813. * @param {String} [namespace] - Module's namespace
  10814. * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
  10815. * @param {Object}
  10816. */
  10817. var mapState = normalizeNamespace(function (namespace, states) {
  10818. var res = {};
  10819. if (( true) && !isValidMap(states)) {
  10820. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  10821. }
  10822. normalizeMap(states).forEach(function (ref) {
  10823. var key = ref.key;
  10824. var val = ref.val;
  10825. res[key] = function mappedState () {
  10826. var state = this.$store.state;
  10827. var getters = this.$store.getters;
  10828. if (namespace) {
  10829. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  10830. if (!module) {
  10831. return
  10832. }
  10833. state = module.context.state;
  10834. getters = module.context.getters;
  10835. }
  10836. return typeof val === 'function'
  10837. ? val.call(this, state, getters)
  10838. : state[val]
  10839. };
  10840. // mark vuex getter for devtools
  10841. res[key].vuex = true;
  10842. });
  10843. return res
  10844. });
  10845. /**
  10846. * Reduce the code which written in Vue.js for committing the mutation
  10847. * @param {String} [namespace] - Module's namespace
  10848. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept another params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  10849. * @return {Object}
  10850. */
  10851. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  10852. var res = {};
  10853. if (( true) && !isValidMap(mutations)) {
  10854. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  10855. }
  10856. normalizeMap(mutations).forEach(function (ref) {
  10857. var key = ref.key;
  10858. var val = ref.val;
  10859. res[key] = function mappedMutation () {
  10860. var args = [], len = arguments.length;
  10861. while ( len-- ) args[ len ] = arguments[ len ];
  10862. // Get the commit method from store
  10863. var commit = this.$store.commit;
  10864. if (namespace) {
  10865. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  10866. if (!module) {
  10867. return
  10868. }
  10869. commit = module.context.commit;
  10870. }
  10871. return typeof val === 'function'
  10872. ? val.apply(this, [commit].concat(args))
  10873. : commit.apply(this.$store, [val].concat(args))
  10874. };
  10875. });
  10876. return res
  10877. });
  10878. /**
  10879. * Reduce the code which written in Vue.js for getting the getters
  10880. * @param {String} [namespace] - Module's namespace
  10881. * @param {Object|Array} getters
  10882. * @return {Object}
  10883. */
  10884. var mapGetters = normalizeNamespace(function (namespace, getters) {
  10885. var res = {};
  10886. if (( true) && !isValidMap(getters)) {
  10887. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  10888. }
  10889. normalizeMap(getters).forEach(function (ref) {
  10890. var key = ref.key;
  10891. var val = ref.val;
  10892. // The namespace has been mutated by normalizeNamespace
  10893. val = namespace + val;
  10894. res[key] = function mappedGetter () {
  10895. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  10896. return
  10897. }
  10898. if (( true) && !(val in this.$store.getters)) {
  10899. console.error(("[vuex] unknown getter: " + val));
  10900. return
  10901. }
  10902. return this.$store.getters[val]
  10903. };
  10904. // mark vuex getter for devtools
  10905. res[key].vuex = true;
  10906. });
  10907. return res
  10908. });
  10909. /**
  10910. * Reduce the code which written in Vue.js for dispatch the action
  10911. * @param {String} [namespace] - Module's namespace
  10912. * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  10913. * @return {Object}
  10914. */
  10915. var mapActions = normalizeNamespace(function (namespace, actions) {
  10916. var res = {};
  10917. if (( true) && !isValidMap(actions)) {
  10918. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  10919. }
  10920. normalizeMap(actions).forEach(function (ref) {
  10921. var key = ref.key;
  10922. var val = ref.val;
  10923. res[key] = function mappedAction () {
  10924. var args = [], len = arguments.length;
  10925. while ( len-- ) args[ len ] = arguments[ len ];
  10926. // get dispatch function from store
  10927. var dispatch = this.$store.dispatch;
  10928. if (namespace) {
  10929. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  10930. if (!module) {
  10931. return
  10932. }
  10933. dispatch = module.context.dispatch;
  10934. }
  10935. return typeof val === 'function'
  10936. ? val.apply(this, [dispatch].concat(args))
  10937. : dispatch.apply(this.$store, [val].concat(args))
  10938. };
  10939. });
  10940. return res
  10941. });
  10942. /**
  10943. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  10944. * @param {String} namespace
  10945. * @return {Object}
  10946. */
  10947. var createNamespacedHelpers = function (namespace) { return ({
  10948. mapState: mapState.bind(null, namespace),
  10949. mapGetters: mapGetters.bind(null, namespace),
  10950. mapMutations: mapMutations.bind(null, namespace),
  10951. mapActions: mapActions.bind(null, namespace)
  10952. }); };
  10953. /**
  10954. * Normalize the map
  10955. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  10956. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  10957. * @param {Array|Object} map
  10958. * @return {Object}
  10959. */
  10960. function normalizeMap (map) {
  10961. if (!isValidMap(map)) {
  10962. return []
  10963. }
  10964. return Array.isArray(map)
  10965. ? map.map(function (key) { return ({ key: key, val: key }); })
  10966. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  10967. }
  10968. /**
  10969. * Validate whether given map is valid or not
  10970. * @param {*} map
  10971. * @return {Boolean}
  10972. */
  10973. function isValidMap (map) {
  10974. return Array.isArray(map) || isObject(map)
  10975. }
  10976. /**
  10977. * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
  10978. * @param {Function} fn
  10979. * @return {Function}
  10980. */
  10981. function normalizeNamespace (fn) {
  10982. return function (namespace, map) {
  10983. if (typeof namespace !== 'string') {
  10984. map = namespace;
  10985. namespace = '';
  10986. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  10987. namespace += '/';
  10988. }
  10989. return fn(namespace, map)
  10990. }
  10991. }
  10992. /**
  10993. * Search a special module from store by namespace. if module not exist, print error message.
  10994. * @param {Object} store
  10995. * @param {String} helper
  10996. * @param {String} namespace
  10997. * @return {Object}
  10998. */
  10999. function getModuleByNamespace (store, helper, namespace) {
  11000. var module = store._modulesNamespaceMap[namespace];
  11001. if (( true) && !module) {
  11002. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  11003. }
  11004. return module
  11005. }
  11006. // Credits: borrowed code from fcomb/redux-logger
  11007. function createLogger (ref) {
  11008. if ( ref === void 0 ) ref = {};
  11009. var collapsed = ref.collapsed; if ( collapsed === void 0 ) collapsed = true;
  11010. var filter = ref.filter; if ( filter === void 0 ) filter = function (mutation, stateBefore, stateAfter) { return true; };
  11011. var transformer = ref.transformer; if ( transformer === void 0 ) transformer = function (state) { return state; };
  11012. var mutationTransformer = ref.mutationTransformer; if ( mutationTransformer === void 0 ) mutationTransformer = function (mut) { return mut; };
  11013. var actionFilter = ref.actionFilter; if ( actionFilter === void 0 ) actionFilter = function (action, state) { return true; };
  11014. var actionTransformer = ref.actionTransformer; if ( actionTransformer === void 0 ) actionTransformer = function (act) { return act; };
  11015. var logMutations = ref.logMutations; if ( logMutations === void 0 ) logMutations = true;
  11016. var logActions = ref.logActions; if ( logActions === void 0 ) logActions = true;
  11017. var logger = ref.logger; if ( logger === void 0 ) logger = console;
  11018. return function (store) {
  11019. var prevState = deepCopy(store.state);
  11020. if (typeof logger === 'undefined') {
  11021. return
  11022. }
  11023. if (logMutations) {
  11024. store.subscribe(function (mutation, state) {
  11025. var nextState = deepCopy(state);
  11026. if (filter(mutation, prevState, nextState)) {
  11027. var formattedTime = getFormattedTime();
  11028. var formattedMutation = mutationTransformer(mutation);
  11029. var message = "mutation " + (mutation.type) + formattedTime;
  11030. startMessage(logger, message, collapsed);
  11031. logger.log('%c prev state', 'color: #9E9E9E; font-weight: bold', transformer(prevState));
  11032. logger.log('%c mutation', 'color: #03A9F4; font-weight: bold', formattedMutation);
  11033. logger.log('%c next state', 'color: #4CAF50; font-weight: bold', transformer(nextState));
  11034. endMessage(logger);
  11035. }
  11036. prevState = nextState;
  11037. });
  11038. }
  11039. if (logActions) {
  11040. store.subscribeAction(function (action, state) {
  11041. if (actionFilter(action, state)) {
  11042. var formattedTime = getFormattedTime();
  11043. var formattedAction = actionTransformer(action);
  11044. var message = "action " + (action.type) + formattedTime;
  11045. startMessage(logger, message, collapsed);
  11046. logger.log('%c action', 'color: #03A9F4; font-weight: bold', formattedAction);
  11047. endMessage(logger);
  11048. }
  11049. });
  11050. }
  11051. }
  11052. }
  11053. function startMessage (logger, message, collapsed) {
  11054. var startMessage = collapsed
  11055. ? logger.groupCollapsed
  11056. : logger.group;
  11057. // render
  11058. try {
  11059. startMessage.call(logger, message);
  11060. } catch (e) {
  11061. logger.log(message);
  11062. }
  11063. }
  11064. function endMessage (logger) {
  11065. try {
  11066. logger.groupEnd();
  11067. } catch (e) {
  11068. logger.log('—— log end ——');
  11069. }
  11070. }
  11071. function getFormattedTime () {
  11072. var time = new Date();
  11073. return (" @ " + (pad(time.getHours(), 2)) + ":" + (pad(time.getMinutes(), 2)) + ":" + (pad(time.getSeconds(), 2)) + "." + (pad(time.getMilliseconds(), 3)))
  11074. }
  11075. function repeat (str, times) {
  11076. return (new Array(times + 1)).join(str)
  11077. }
  11078. function pad (num, maxLength) {
  11079. return repeat('0', maxLength - num.toString().length) + num
  11080. }
  11081. var index_cjs = {
  11082. Store: Store,
  11083. install: install,
  11084. version: '3.6.2',
  11085. mapState: mapState,
  11086. mapMutations: mapMutations,
  11087. mapGetters: mapGetters,
  11088. mapActions: mapActions,
  11089. createNamespacedHelpers: createNamespacedHelpers,
  11090. createLogger: createLogger
  11091. };
  11092. module.exports = index_cjs;
  11093. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  11094. /***/ }),
  11095. /* 43 */
  11096. /*!***********************************************************!*\
  11097. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/common/locales/zh.js ***!
  11098. \***********************************************************/
  11099. /*! no static exports found */
  11100. /***/ (function(module, exports, __webpack_require__) {
  11101. "use strict";
  11102. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  11103. // 可以以页面为单位来写,比如首页的内容,写在index字段,个人中心写在center,共同部分写在common部分
  11104. components: {
  11105. desc: '众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让你快速集成,开箱即用' },
  11106. js: {
  11107. desc: '众多的贴心小工具,是你开发过程中召之即来的利器,让你飞镖在手,百步穿杨' },
  11108. template: {
  11109. desc: '收集众多的常用页面和布局,减少开发者的重复工作,让你专注逻辑,事半功倍' },
  11110. nav: {
  11111. components: '组件',
  11112. js: '工具',
  11113. template: '模板' },
  11114. common: {
  11115. intro: '多平台快速开发的UI框架',
  11116. title: 'uView UI' } };exports.default = _default;
  11117. /***/ }),
  11118. /* 44 */
  11119. /*!***********************************************************!*\
  11120. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/common/locales/en.js ***!
  11121. \***********************************************************/
  11122. /*! no static exports found */
  11123. /***/ (function(module, exports, __webpack_require__) {
  11124. "use strict";
  11125. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  11126. // 可以以页面为单位来写,比如首页的内容,写在index字段,个人中心写在center,共同部分写在common部分
  11127. components: {
  11128. desc: 'Numerous components cover the various requirements of the development process, and the components are rich in functions and compatible with multiple terminals. Let you integrate quickly, out of the box' },
  11129. js: {
  11130. desc: 'Numerous intimate gadgets are a weapon that you can call upon during the development process, allowing you to dart in your hand and pierce the Yang with a hundred steps' },
  11131. template: {
  11132. desc: 'Collection of many commonly used pages and layouts, reducing the repetitive work of developers, allowing you to focus on logic and get twice the result with half the effort' },
  11133. nav: {
  11134. components: 'Components',
  11135. js: 'JS',
  11136. template: 'Template' },
  11137. common: {
  11138. intro: 'UI framework for rapid development of multiple platforms',
  11139. title: 'uView UI' } };exports.default = _default;
  11140. /***/ }),
  11141. /* 45 */
  11142. /*!*************************************************************!*\
  11143. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/common/vue-i18n.min.js ***!
  11144. \*************************************************************/
  11145. /*! no static exports found */
  11146. /***/ (function(module, exports, __webpack_require__) {
  11147. /*!
  11148. * vue-i18n v8.20.0
  11149. * (c) 2020 kazuya kawaguchi
  11150. * Released under the MIT License.
  11151. */
  11152. var t, e;t = this, e = function e() {"use strict";var t = ["style", "currency", "currencyDisplay", "useGrouping", "minimumIntegerDigits", "minimumFractionDigits", "maximumFractionDigits", "minimumSignificantDigits", "maximumSignificantDigits", "localeMatcher", "formatMatcher", "unit"];function e(t, e) {"undefined" != typeof console && (console.warn("[vue-i18n] " + t), e && console.warn(e.stack));}var n = Array.isArray;function r(t) {return null !== t && "object" == typeof t;}function a(t) {return "string" == typeof t;}var i = Object.prototype.toString,o = "[object Object]";function s(t) {return i.call(t) === o;}function l(t) {return null == t;}function c() {for (var t = [], e = arguments.length; e--;) {t[e] = arguments[e];}var n = null,a = null;return 1 === t.length ? r(t[0]) || Array.isArray(t[0]) ? a = t[0] : "string" == typeof t[0] && (n = t[0]) : 2 === t.length && ("string" == typeof t[0] && (n = t[0]), (r(t[1]) || Array.isArray(t[1])) && (a = t[1])), { locale: n, params: a };}function u(t) {return JSON.parse(JSON.stringify(t));}function h(t, e) {return !!~t.indexOf(e);}var f = Object.prototype.hasOwnProperty;function p(t, e) {return f.call(t, e);}function m(t) {for (var e = arguments, n = Object(t), a = 1; a < arguments.length; a++) {var i = e[a];if (null != i) {var o = void 0;for (o in i) {p(i, o) && (r(i[o]) ? n[o] = m(n[o], i[o]) : n[o] = i[o]);}}}return n;}function _(t, e) {if (t === e) return !0;var n = r(t),a = r(e);if (!n || !a) return !n && !a && String(t) === String(e);try {var i = Array.isArray(t),o = Array.isArray(e);if (i && o) return t.length === e.length && t.every(function (t, n) {return _(t, e[n]);});if (i || o) return !1;var s = Object.keys(t),l = Object.keys(e);return s.length === l.length && s.every(function (n) {return _(t[n], e[n]);});} catch (t) {return !1;}}var g = { beforeCreate: function beforeCreate() {var t = this.$options;if (t.i18n = t.i18n || (t.__i18n ? {} : null), t.i18n) {if (t.i18n instanceof et) {if (t.__i18n) try {var e = {};t.__i18n.forEach(function (t) {e = m(e, JSON.parse(t));}), Object.keys(e).forEach(function (n) {t.i18n.mergeLocaleMessage(n, e[n]);});} catch (t) {}this._i18n = t.i18n, this._i18nWatcher = this._i18n.watchI18nData();} else if (s(t.i18n)) {var n = this.$root && this.$root.$i18n && this.$root.$i18n instanceof et ? this.$root.$i18n : null;if (n && (t.i18n.root = this.$root, t.i18n.formatter = n.formatter, t.i18n.fallbackLocale = n.fallbackLocale, t.i18n.formatFallbackMessages = n.formatFallbackMessages, t.i18n.silentTranslationWarn = n.silentTranslationWarn, t.i18n.silentFallbackWarn = n.silentFallbackWarn, t.i18n.pluralizationRules = n.pluralizationRules, t.i18n.preserveDirectiveContent = n.preserveDirectiveContent), t.__i18n) try {var r = {};t.__i18n.forEach(function (t) {r = m(r, JSON.parse(t));}), t.i18n.messages = r;} catch (t) {}var a = t.i18n.sharedMessages;a && s(a) && (t.i18n.messages = m(t.i18n.messages, a)), this._i18n = new et(t.i18n), this._i18nWatcher = this._i18n.watchI18nData(), (void 0 === t.i18n.sync || t.i18n.sync) && (this._localeWatcher = this.$i18n.watchLocale()), n && n.onComponentInstanceCreated(this._i18n);}} else this.$root && this.$root.$i18n && this.$root.$i18n instanceof et ? this._i18n = this.$root.$i18n : t.parent && t.parent.$i18n && t.parent.$i18n instanceof et && (this._i18n = t.parent.$i18n);}, beforeMount: function beforeMount() {var t = this.$options;t.i18n = t.i18n || (t.__i18n ? {} : null), t.i18n ? t.i18n instanceof et ? (this._i18n.subscribeDataChanging(this), this._subscribing = !0) : s(t.i18n) && (this._i18n.subscribeDataChanging(this), this._subscribing = !0) : this.$root && this.$root.$i18n && this.$root.$i18n instanceof et ? (this._i18n.subscribeDataChanging(this), this._subscribing = !0) : t.parent && t.parent.$i18n && t.parent.$i18n instanceof et && (this._i18n.subscribeDataChanging(this), this._subscribing = !0);}, beforeDestroy: function beforeDestroy() {if (this._i18n) {var t = this;this.$nextTick(function () {t._subscribing && (t._i18n.unsubscribeDataChanging(t), delete t._subscribing), t._i18nWatcher && (t._i18nWatcher(), t._i18n.destroyVM(), delete t._i18nWatcher), t._localeWatcher && (t._localeWatcher(), delete t._localeWatcher);});}} },v = { name: "i18n", functional: !0, props: { tag: { type: [String, Boolean, Object], default: "span" }, path: { type: String, required: !0 }, locale: { type: String }, places: { type: [Array, Object] } }, render: function render(t, e) {var n = e.data,r = e.parent,a = e.props,i = e.slots,o = r.$i18n;if (o) {var s = a.path,l = a.locale,c = a.places,u = i(),h = o.i(s, l, function (t) {var e;for (e in t) {if ("default" !== e) return !1;}return Boolean(e);}(u) || c ? function (t, e) {var n = e ? function (t) {return Array.isArray(t) ? t.reduce(d, {}) : Object.assign({}, t);}(e) : {};if (!t) return n;var r = (t = t.filter(function (t) {return t.tag || "" !== t.text.trim();})).every(y);return t.reduce(r ? b : d, n);}(u.default, c) : u),f = a.tag && !0 !== a.tag || !1 === a.tag ? a.tag : "span";return f ? t(f, n, h) : h;}} };function b(t, e) {return e.data && e.data.attrs && e.data.attrs.place && (t[e.data.attrs.place] = e), t;}function d(t, e, n) {return t[n] = e, t;}function y(t) {return Boolean(t.data && t.data.attrs && t.data.attrs.place);}var F,k = { name: "i18n-n", functional: !0, props: { tag: { type: [String, Boolean, Object], default: "span" }, value: { type: Number, required: !0 }, format: { type: [String, Object] }, locale: { type: String } }, render: function render(e, n) {var i = n.props,o = n.parent,s = n.data,l = o.$i18n;if (!l) return null;var c = null,u = null;a(i.format) ? c = i.format : r(i.format) && (i.format.key && (c = i.format.key), u = Object.keys(i.format).reduce(function (e, n) {var r;return h(t, n) ? Object.assign({}, e, ((r = {})[n] = i.format[n], r)) : e;}, null));var f = i.locale || l.locale,p = l._ntp(i.value, f, c, u),m = p.map(function (t, e) {var n,r = s.scopedSlots && s.scopedSlots[t.type];return r ? r(((n = {})[t.type] = t.value, n.index = e, n.parts = p, n)) : t.value;}),_ = i.tag && !0 !== i.tag || !1 === i.tag ? i.tag : "span";return _ ? e(_, { attrs: s.attrs, class: s.class, staticClass: s.staticClass }, m) : m;} };function w(t, e, n) {C(t, n) && T(t, e, n);}function $(t, e, n, r) {if (C(t, n)) {var a = n.context.$i18n;(function (t, e) {var n = e.context;return t._locale === n.$i18n.locale;})(t, n) && _(e.value, e.oldValue) && _(t._localeMessage, a.getLocaleMessage(a.locale)) || T(t, e, n);}}function M(t, n, r, a) {if (r.context) {var i = r.context.$i18n || {};n.modifiers.preserve || i.preserveDirectiveContent || (t.textContent = ""), t._vt = void 0, delete t._vt, t._locale = void 0, delete t._locale, t._localeMessage = void 0, delete t._localeMessage;} else e("Vue instance does not exists in VNode context");}function C(t, n) {var r = n.context;return r ? !!r.$i18n || (e("VueI18n instance does not exists in Vue instance"), !1) : (e("Vue instance does not exists in VNode context"), !1);}function T(t, n, r) {var i,o,l = function (t) {var e, n, r, i;a(t) ? e = t : s(t) && (e = t.path, n = t.locale, r = t.args, i = t.choice);return { path: e, locale: n, args: r, choice: i };}(n.value),c = l.path,u = l.locale,h = l.args,f = l.choice;if (c || u || h) {if (c) {var p = r.context;t._vt = t.textContent = null != f ? (i = p.$i18n).tc.apply(i, [c, f].concat(L(u, h))) : (o = p.$i18n).t.apply(o, [c].concat(L(u, h))), t._locale = p.$i18n.locale, t._localeMessage = p.$i18n.getLocaleMessage(p.$i18n.locale);} else e("`path` is required in v-t directive");} else e("value type not supported");}function L(t, e) {var n = [];return t && n.push(t), e && (Array.isArray(e) || s(e)) && n.push(e), n;}function I(t) {I.installed = !0;(F = t).version && Number(F.version.split(".")[0]);!function (t) {t.prototype.hasOwnProperty("$i18n") || Object.defineProperty(t.prototype, "$i18n", { get: function get() {return this._i18n;} }), t.prototype.$t = function (t) {for (var e = [], n = arguments.length - 1; n-- > 0;) {e[n] = arguments[n + 1];}var r = this.$i18n;return r._t.apply(r, [t, r.locale, r._getMessages(), this].concat(e));}, t.prototype.$tc = function (t, e) {for (var n = [], r = arguments.length - 2; r-- > 0;) {n[r] = arguments[r + 2];}var a = this.$i18n;return a._tc.apply(a, [t, a.locale, a._getMessages(), this, e].concat(n));}, t.prototype.$te = function (t, e) {var n = this.$i18n;return n._te(t, n.locale, n._getMessages(), e);}, t.prototype.$d = function (t) {for (var e, n = [], r = arguments.length - 1; r-- > 0;) {n[r] = arguments[r + 1];}return (e = this.$i18n).d.apply(e, [t].concat(n));}, t.prototype.$n = function (t) {for (var e, n = [], r = arguments.length - 1; r-- > 0;) {n[r] = arguments[r + 1];}return (e = this.$i18n).n.apply(e, [t].concat(n));};}(F), F.mixin(g), F.directive("t", { bind: w, update: $, unbind: M }), F.component(v.name, v), F.component(k.name, k), F.config.optionMergeStrategies.i18n = function (t, e) {return void 0 === e ? t : e;};}var D = function D() {this._caches = Object.create(null);};D.prototype.interpolate = function (t, e) {if (!e) return [t];var n = this._caches[t];return n || (n = function (t) {var e = [],n = 0,r = "";for (; n < t.length;) {var a = t[n++];if ("{" === a) {r && e.push({ type: "text", value: r }), r = "";var i = "";for (a = t[n++]; void 0 !== a && "}" !== a;) {i += a, a = t[n++];}var o = "}" === a,s = O.test(i) ? "list" : o && x.test(i) ? "named" : "unknown";e.push({ value: i, type: s });} else "%" === a ? "{" !== t[n] && (r += a) : r += a;}return r && e.push({ type: "text", value: r }), e;}(t), this._caches[t] = n), function (t, e) {var n = [],a = 0,i = Array.isArray(e) ? "list" : r(e) ? "named" : "unknown";if ("unknown" === i) return n;for (; a < t.length;) {var o = t[a];switch (o.type) {case "text":n.push(o.value);break;case "list":n.push(e[parseInt(o.value, 10)]);break;case "named":"named" === i && n.push(e[o.value]);}a++;}return n;}(n, e);};var O = /^(?:\d)+/,x = /^(?:\w)+/,W = 0,j = 1,N = 2,A = 3,S = 0,R = 4,H = 5,P = 6,V = 7,E = 8,z = [];z[S] = { ws: [S], ident: [3, W], "[": [R], eof: [V] }, z[1] = { ws: [1], ".": [2], "[": [R], eof: [V] }, z[2] = { ws: [2], ident: [3, W], 0: [3, W], number: [3, W] }, z[3] = { ident: [3, W], 0: [3, W], number: [3, W], ws: [1, j], ".": [2, j], "[": [R, j], eof: [V, j] }, z[R] = { "'": [H, W], '"': [P, W], "[": [R, N], "]": [1, A], eof: E, else: [R, W] }, z[H] = { "'": [R, W], eof: E, else: [H, W] }, z[P] = { '"': [R, W], eof: E, else: [P, W] };var B = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function U(t) {if (null == t) return "eof";switch (t.charCodeAt(0)) {case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return "ident";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return "ws";}return "ident";}function J(t) {var e,n,r,a = t.trim();return ("0" !== t.charAt(0) || !isNaN(t)) && (r = a, B.test(r) ? (n = (e = a).charCodeAt(0)) !== e.charCodeAt(e.length - 1) || 34 !== n && 39 !== n ? e : e.slice(1, -1) : "*" + a);}var q = function q() {this._cache = Object.create(null);};q.prototype.parsePath = function (t) {var e = this._cache[t];return e || (e = function (t) {var e,n,r,a,i,o,s,l = [],c = -1,u = S,h = 0,f = [];function p() {var e = t[c + 1];if (u === H && "'" === e || u === P && '"' === e) return c++, r = "\\" + e, f[W](), !0;}for (f[j] = function () {void 0 !== n && (l.push(n), n = void 0);}, f[W] = function () {void 0 === n ? n = r : n += r;}, f[N] = function () {f[W](), h++;}, f[A] = function () {if (h > 0) h--, u = R, f[W]();else {if (h = 0, void 0 === n) return !1;if (!1 === (n = J(n))) return !1;f[j]();}}; null !== u;) {if ("\\" !== (e = t[++c]) || !p()) {if (a = U(e), (i = (s = z[u])[a] || s.else || E) === E) return;if (u = i[0], (o = f[i[1]]) && (r = void 0 === (r = i[2]) ? e : r, !1 === o())) return;if (u === V) return l;}}}(t)) && (this._cache[t] = e), e || [];}, q.prototype.getPathValue = function (t, e) {if (!r(t)) return null;var n = this.parsePath(e);if (0 === n.length) return null;for (var a = n.length, i = t, o = 0; o < a;) {var s = i[n[o]];if (void 0 === s) return null;i = s, o++;}return i;};var G,X = /<\/?[\w\s="/.':;#-\/]+>/,Z = /(?:@(?:\.[a-z]+)?:(?:[\w\-_|.]+|\([\w\-_|.]+\)))/g,K = /^@(?:\.([a-z]+))?:/,Q = /[()]/g,Y = { upper: function upper(t) {return t.toLocaleUpperCase();}, lower: function lower(t) {return t.toLocaleLowerCase();}, capitalize: function capitalize(t) {return "" + t.charAt(0).toLocaleUpperCase() + t.substr(1);} },tt = new D(),et = function et(t) {var e = this;void 0 === t && (t = {}), !F && "undefined" != typeof window && window.Vue && I(window.Vue);var n = t.locale || "en-US",r = !1 !== t.fallbackLocale && (t.fallbackLocale || "en-US"),a = t.messages || {},i = t.dateTimeFormats || {},o = t.numberFormats || {};this._vm = null, this._formatter = t.formatter || tt, this._modifiers = t.modifiers || {}, this._missing = t.missing || null, this._root = t.root || null, this._sync = void 0 === t.sync || !!t.sync, this._fallbackRoot = void 0 === t.fallbackRoot || !!t.fallbackRoot, this._formatFallbackMessages = void 0 !== t.formatFallbackMessages && !!t.formatFallbackMessages, this._silentTranslationWarn = void 0 !== t.silentTranslationWarn && t.silentTranslationWarn, this._silentFallbackWarn = void 0 !== t.silentFallbackWarn && !!t.silentFallbackWarn, this._dateTimeFormatters = {}, this._numberFormatters = {}, this._path = new q(), this._dataListeners = [], this._componentInstanceCreatedListener = t.componentInstanceCreatedListener || null, this._preserveDirectiveContent = void 0 !== t.preserveDirectiveContent && !!t.preserveDirectiveContent, this.pluralizationRules = t.pluralizationRules || {}, this._warnHtmlInMessage = t.warnHtmlInMessage || "off", this._postTranslation = t.postTranslation || null, this.getChoiceIndex = function (t, n) {var r = Object.getPrototypeOf(e);if (r && r.getChoiceIndex) return r.getChoiceIndex.call(e, t, n);var a, i;return e.locale in e.pluralizationRules ? e.pluralizationRules[e.locale].apply(e, [t, n]) : (a = t, i = n, a = Math.abs(a), 2 === i ? a ? a > 1 ? 1 : 0 : 1 : a ? Math.min(a, 2) : 0);}, this._exist = function (t, n) {return !(!t || !n) && (!l(e._path.getPathValue(t, n)) || !!t[n]);}, "warn" !== this._warnHtmlInMessage && "error" !== this._warnHtmlInMessage || Object.keys(a).forEach(function (t) {e._checkLocaleMessage(t, e._warnHtmlInMessage, a[t]);}), this._initVM({ locale: n, fallbackLocale: r, messages: a, dateTimeFormats: i, numberFormats: o });},nt = { vm: { configurable: !0 }, messages: { configurable: !0 }, dateTimeFormats: { configurable: !0 }, numberFormats: { configurable: !0 }, availableLocales: { configurable: !0 }, locale: { configurable: !0 }, fallbackLocale: { configurable: !0 }, formatFallbackMessages: { configurable: !0 }, missing: { configurable: !0 }, formatter: { configurable: !0 }, silentTranslationWarn: { configurable: !0 }, silentFallbackWarn: { configurable: !0 }, preserveDirectiveContent: { configurable: !0 }, warnHtmlInMessage: { configurable: !0 }, postTranslation: { configurable: !0 } };return et.prototype._checkLocaleMessage = function (t, n, r) {var i = function i(t, n, r, o) {if (s(r)) Object.keys(r).forEach(function (e) {var a = r[e];s(a) ? (o.push(e), o.push("."), i(t, n, a, o), o.pop(), o.pop()) : (o.push(e), i(t, n, a, o), o.pop());});else if (Array.isArray(r)) r.forEach(function (e, r) {s(e) ? (o.push("[" + r + "]"), o.push("."), i(t, n, e, o), o.pop(), o.pop()) : (o.push("[" + r + "]"), i(t, n, e, o), o.pop());});else if (a(r)) {if (X.test(r)) {var l = "Detected HTML in message '" + r + "' of keypath '" + o.join("") + "' at '" + n + "'. Consider component interpolation with '<i18n>' to avoid XSS. See https://bit.ly/2ZqJzkp";"warn" === t ? e(l) : "error" === t && function (t, e) {"undefined" != typeof console && (console.error("[vue-i18n] " + t), e && console.error(e.stack));}(l);}}};i(n, t, r, []);}, et.prototype._initVM = function (t) {var e = F.config.silent;F.config.silent = !0, this._vm = new F({ data: t }), F.config.silent = e;}, et.prototype.destroyVM = function () {this._vm.$destroy();}, et.prototype.subscribeDataChanging = function (t) {this._dataListeners.push(t);}, et.prototype.unsubscribeDataChanging = function (t) {!function (t, e) {if (t.length) {var n = t.indexOf(e);if (n > -1) t.splice(n, 1);}}(this._dataListeners, t);}, et.prototype.watchI18nData = function () {var t = this;return this._vm.$watch("$data", function () {for (var e = t._dataListeners.length; e--;) {F.nextTick(function () {t._dataListeners[e] && t._dataListeners[e].$forceUpdate();});}}, { deep: !0 });}, et.prototype.watchLocale = function () {if (!this._sync || !this._root) return null;var t = this._vm;return this._root.$i18n.vm.$watch("locale", function (e) {t.$set(t, "locale", e), t.$forceUpdate();}, { immediate: !0 });}, et.prototype.onComponentInstanceCreated = function (t) {this._componentInstanceCreatedListener && this._componentInstanceCreatedListener(t, this);}, nt.vm.get = function () {return this._vm;}, nt.messages.get = function () {return u(this._getMessages());}, nt.dateTimeFormats.get = function () {return u(this._getDateTimeFormats());}, nt.numberFormats.get = function () {return u(this._getNumberFormats());}, nt.availableLocales.get = function () {return Object.keys(this.messages).sort();}, nt.locale.get = function () {return this._vm.locale;}, nt.locale.set = function (t) {this._vm.$set(this._vm, "locale", t);}, nt.fallbackLocale.get = function () {return this._vm.fallbackLocale;}, nt.fallbackLocale.set = function (t) {this._localeChainCache = {}, this._vm.$set(this._vm, "fallbackLocale", t);}, nt.formatFallbackMessages.get = function () {return this._formatFallbackMessages;}, nt.formatFallbackMessages.set = function (t) {this._formatFallbackMessages = t;}, nt.missing.get = function () {return this._missing;}, nt.missing.set = function (t) {this._missing = t;}, nt.formatter.get = function () {return this._formatter;}, nt.formatter.set = function (t) {this._formatter = t;}, nt.silentTranslationWarn.get = function () {return this._silentTranslationWarn;}, nt.silentTranslationWarn.set = function (t) {this._silentTranslationWarn = t;}, nt.silentFallbackWarn.get = function () {return this._silentFallbackWarn;}, nt.silentFallbackWarn.set = function (t) {this._silentFallbackWarn = t;}, nt.preserveDirectiveContent.get = function () {return this._preserveDirectiveContent;}, nt.preserveDirectiveContent.set = function (t) {this._preserveDirectiveContent = t;}, nt.warnHtmlInMessage.get = function () {return this._warnHtmlInMessage;}, nt.warnHtmlInMessage.set = function (t) {var e = this,n = this._warnHtmlInMessage;if (this._warnHtmlInMessage = t, n !== t && ("warn" === t || "error" === t)) {var r = this._getMessages();Object.keys(r).forEach(function (t) {e._checkLocaleMessage(t, e._warnHtmlInMessage, r[t]);});}}, nt.postTranslation.get = function () {return this._postTranslation;}, nt.postTranslation.set = function (t) {this._postTranslation = t;}, et.prototype._getMessages = function () {return this._vm.messages;}, et.prototype._getDateTimeFormats = function () {return this._vm.dateTimeFormats;}, et.prototype._getNumberFormats = function () {return this._vm.numberFormats;}, et.prototype._warnDefault = function (t, e, n, r, i, o) {if (!l(n)) return n;if (this._missing) {var s = this._missing.apply(null, [t, e, r, i]);if (a(s)) return s;}if (this._formatFallbackMessages) {var u = c.apply(void 0, i);return this._render(e, o, u.params, e);}return e;}, et.prototype._isFallbackRoot = function (t) {return !t && !l(this._root) && this._fallbackRoot;}, et.prototype._isSilentFallbackWarn = function (t) {return this._silentFallbackWarn instanceof RegExp ? this._silentFallbackWarn.test(t) : this._silentFallbackWarn;}, et.prototype._isSilentFallback = function (t, e) {return this._isSilentFallbackWarn(e) && (this._isFallbackRoot() || t !== this.fallbackLocale);}, et.prototype._isSilentTranslationWarn = function (t) {return this._silentTranslationWarn instanceof RegExp ? this._silentTranslationWarn.test(t) : this._silentTranslationWarn;}, et.prototype._interpolate = function (t, e, n, r, i, o, c) {if (!e) return null;var u,h = this._path.getPathValue(e, n);if (Array.isArray(h) || s(h)) return h;if (l(h)) {if (!s(e)) return null;if (!a(u = e[n])) return null;} else {if (!a(h)) return null;u = h;}return (u.indexOf("@:") >= 0 || u.indexOf("@.") >= 0) && (u = this._link(t, e, u, r, "raw", o, c)), this._render(u, i, o, n);}, et.prototype._link = function (t, e, n, r, a, i, o) {var s = n,l = s.match(Z);for (var c in l) {if (l.hasOwnProperty(c)) {var u = l[c],f = u.match(K),p = f[0],m = f[1],_ = u.replace(p, "").replace(Q, "");if (h(o, _)) return s;o.push(_);var g = this._interpolate(t, e, _, r, "raw" === a ? "string" : a, "raw" === a ? void 0 : i, o);if (this._isFallbackRoot(g)) {if (!this._root) throw Error("unexpected error");var v = this._root.$i18n;g = v._translate(v._getMessages(), v.locale, v.fallbackLocale, _, r, a, i);}g = this._warnDefault(t, _, g, r, Array.isArray(i) ? i : [i], a), this._modifiers.hasOwnProperty(m) ? g = this._modifiers[m](g) : Y.hasOwnProperty(m) && (g = Y[m](g)), o.pop(), s = g ? s.replace(u, g) : s;}}return s;}, et.prototype._render = function (t, e, n, r) {var i = this._formatter.interpolate(t, n, r);return i || (i = tt.interpolate(t, n, r)), "string" !== e || a(i) ? i : i.join("");}, et.prototype._appendItemToChain = function (t, e, n) {var r = !1;return h(t, e) || (r = !0, e && (r = "!" !== e[e.length - 1], e = e.replace(/!/g, ""), t.push(e), n && n[e] && (r = n[e]))), r;}, et.prototype._appendLocaleToChain = function (t, e, n) {var r,a = e.split("-");do {var i = a.join("-");r = this._appendItemToChain(t, i, n), a.splice(-1, 1);} while (a.length && !0 === r);return r;}, et.prototype._appendBlockToChain = function (t, e, n) {for (var r = !0, i = 0; i < e.length && "boolean" == typeof r; i++) {var o = e[i];a(o) && (r = this._appendLocaleToChain(t, o, n));}return r;}, et.prototype._getLocaleChain = function (t, e) {if ("" === t) return [];this._localeChainCache || (this._localeChainCache = {});var i = this._localeChainCache[t];if (!i) {e || (e = this.fallbackLocale), i = [];for (var o, s = [t]; n(s);) {s = this._appendBlockToChain(i, s, e);}(s = a(o = n(e) ? e : r(e) ? e.default ? e.default : null : e) ? [o] : o) && this._appendBlockToChain(i, s, null), this._localeChainCache[t] = i;}return i;}, et.prototype._translate = function (t, e, n, r, a, i, o) {for (var s, c = this._getLocaleChain(e, n), u = 0; u < c.length; u++) {var h = c[u];if (!l(s = this._interpolate(h, t[h], r, a, i, o, [r]))) return s;}return null;}, et.prototype._t = function (t, e, n, r) {for (var a, i = [], o = arguments.length - 4; o-- > 0;) {i[o] = arguments[o + 4];}if (!t) return "";var s = c.apply(void 0, i),l = s.locale || e,u = this._translate(n, l, this.fallbackLocale, t, r, "string", s.params);if (this._isFallbackRoot(u)) {if (!this._root) throw Error("unexpected error");return (a = this._root).$t.apply(a, [t].concat(i));}return u = this._warnDefault(l, t, u, r, i, "string"), this._postTranslation && null != u && (u = this._postTranslation(u, t)), u;}, et.prototype.t = function (t) {for (var e, n = [], r = arguments.length - 1; r-- > 0;) {n[r] = arguments[r + 1];}return (e = this)._t.apply(e, [t, this.locale, this._getMessages(), null].concat(n));}, et.prototype._i = function (t, e, n, r, a) {var i = this._translate(n, e, this.fallbackLocale, t, r, "raw", a);if (this._isFallbackRoot(i)) {if (!this._root) throw Error("unexpected error");return this._root.$i18n.i(t, e, a);}return this._warnDefault(e, t, i, r, [a], "raw");}, et.prototype.i = function (t, e, n) {return t ? (a(e) || (e = this.locale), this._i(t, e, this._getMessages(), null, n)) : "";}, et.prototype._tc = function (t, e, n, r, a) {for (var i, o = [], s = arguments.length - 5; s-- > 0;) {o[s] = arguments[s + 5];}if (!t) return "";void 0 === a && (a = 1);var l = { count: a, n: a },u = c.apply(void 0, o);return u.params = Object.assign(l, u.params), o = null === u.locale ? [u.params] : [u.locale, u.params], this.fetchChoice((i = this)._t.apply(i, [t, e, n, r].concat(o)), a);}, et.prototype.fetchChoice = function (t, e) {if (!t && !a(t)) return null;var n = t.split("|");return n[e = this.getChoiceIndex(e, n.length)] ? n[e].trim() : t;}, et.prototype.tc = function (t, e) {for (var n, r = [], a = arguments.length - 2; a-- > 0;) {r[a] = arguments[a + 2];}return (n = this)._tc.apply(n, [t, this.locale, this._getMessages(), null, e].concat(r));}, et.prototype._te = function (t, e, n) {for (var r = [], a = arguments.length - 3; a-- > 0;) {r[a] = arguments[a + 3];}var i = c.apply(void 0, r).locale || e;return this._exist(n[i], t);}, et.prototype.te = function (t, e) {return this._te(t, this.locale, this._getMessages(), e);}, et.prototype.getLocaleMessage = function (t) {return u(this._vm.messages[t] || {});}, et.prototype.setLocaleMessage = function (t, e) {"warn" !== this._warnHtmlInMessage && "error" !== this._warnHtmlInMessage || this._checkLocaleMessage(t, this._warnHtmlInMessage, e), this._vm.$set(this._vm.messages, t, e);}, et.prototype.mergeLocaleMessage = function (t, e) {"warn" !== this._warnHtmlInMessage && "error" !== this._warnHtmlInMessage || this._checkLocaleMessage(t, this._warnHtmlInMessage, e), this._vm.$set(this._vm.messages, t, m({}, this._vm.messages[t] || {}, e));}, et.prototype.getDateTimeFormat = function (t) {return u(this._vm.dateTimeFormats[t] || {});}, et.prototype.setDateTimeFormat = function (t, e) {this._vm.$set(this._vm.dateTimeFormats, t, e), this._clearDateTimeFormat(t, e);}, et.prototype.mergeDateTimeFormat = function (t, e) {this._vm.$set(this._vm.dateTimeFormats, t, m(this._vm.dateTimeFormats[t] || {}, e)), this._clearDateTimeFormat(t, e);}, et.prototype._clearDateTimeFormat = function (t, e) {for (var n in e) {var r = t + "__" + n;this._dateTimeFormatters.hasOwnProperty(r) && delete this._dateTimeFormatters[r];}}, et.prototype._localizeDateTime = function (t, e, n, r, a) {for (var i = e, o = r[i], s = this._getLocaleChain(e, n), c = 0; c < s.length; c++) {var u = s[c];if (i = u, !l(o = r[u]) && !l(o[a])) break;}if (l(o) || l(o[a])) return null;var h = o[a],f = i + "__" + a,p = this._dateTimeFormatters[f];return p || (p = this._dateTimeFormatters[f] = new Intl.DateTimeFormat(i, h)), p.format(t);}, et.prototype._d = function (t, e, n) {if (!n) return new Intl.DateTimeFormat(e).format(t);var r = this._localizeDateTime(t, e, this.fallbackLocale, this._getDateTimeFormats(), n);if (this._isFallbackRoot(r)) {if (!this._root) throw Error("unexpected error");return this._root.$i18n.d(t, n, e);}return r || "";}, et.prototype.d = function (t) {for (var e = [], n = arguments.length - 1; n-- > 0;) {e[n] = arguments[n + 1];}var i = this.locale,o = null;return 1 === e.length ? a(e[0]) ? o = e[0] : r(e[0]) && (e[0].locale && (i = e[0].locale), e[0].key && (o = e[0].key)) : 2 === e.length && (a(e[0]) && (o = e[0]), a(e[1]) && (i = e[1])), this._d(t, i, o);}, et.prototype.getNumberFormat = function (t) {return u(this._vm.numberFormats[t] || {});}, et.prototype.setNumberFormat = function (t, e) {this._vm.$set(this._vm.numberFormats, t, e), this._clearNumberFormat(t, e);}, et.prototype.mergeNumberFormat = function (t, e) {this._vm.$set(this._vm.numberFormats, t, m(this._vm.numberFormats[t] || {}, e)), this._clearNumberFormat(t, e);}, et.prototype._clearNumberFormat = function (t, e) {for (var n in e) {var r = t + "__" + n;this._numberFormatters.hasOwnProperty(r) && delete this._numberFormatters[r];}}, et.prototype._getNumberFormatter = function (t, e, n, r, a, i) {for (var o = e, s = r[o], c = this._getLocaleChain(e, n), u = 0; u < c.length; u++) {var h = c[u];if (o = h, !l(s = r[h]) && !l(s[a])) break;}if (l(s) || l(s[a])) return null;var f,p = s[a];if (i) f = new Intl.NumberFormat(o, Object.assign({}, p, i));else {var m = o + "__" + a;(f = this._numberFormatters[m]) || (f = this._numberFormatters[m] = new Intl.NumberFormat(o, p));}return f;}, et.prototype._n = function (t, e, n, r) {if (!et.availabilities.numberFormat) return "";if (!n) return (r ? new Intl.NumberFormat(e, r) : new Intl.NumberFormat(e)).format(t);var a = this._getNumberFormatter(t, e, this.fallbackLocale, this._getNumberFormats(), n, r),i = a && a.format(t);if (this._isFallbackRoot(i)) {if (!this._root) throw Error("unexpected error");return this._root.$i18n.n(t, Object.assign({}, { key: n, locale: e }, r));}return i || "";}, et.prototype.n = function (e) {for (var n = [], i = arguments.length - 1; i-- > 0;) {n[i] = arguments[i + 1];}var o = this.locale,s = null,l = null;return 1 === n.length ? a(n[0]) ? s = n[0] : r(n[0]) && (n[0].locale && (o = n[0].locale), n[0].key && (s = n[0].key), l = Object.keys(n[0]).reduce(function (e, r) {var a;return h(t, r) ? Object.assign({}, e, ((a = {})[r] = n[0][r], a)) : e;}, null)) : 2 === n.length && (a(n[0]) && (s = n[0]), a(n[1]) && (o = n[1])), this._n(e, o, s, l);}, et.prototype._ntp = function (t, e, n, r) {if (!et.availabilities.numberFormat) return [];if (!n) return (r ? new Intl.NumberFormat(e, r) : new Intl.NumberFormat(e)).formatToParts(t);var a = this._getNumberFormatter(t, e, this.fallbackLocale, this._getNumberFormats(), n, r),i = a && a.formatToParts(t);if (this._isFallbackRoot(i)) {if (!this._root) throw Error("unexpected error");return this._root.$i18n._ntp(t, e, n, r);}return i || [];}, Object.defineProperties(et.prototype, nt), Object.defineProperty(et, "availabilities", { get: function get() {if (!G) {var t = "undefined" != typeof Intl;G = { dateTimeFormat: t && void 0 !== Intl.DateTimeFormat, numberFormat: t && void 0 !== Intl.NumberFormat };}return G;} }), et.install = I, et.version = "8.20.0", et;}, true ? module.exports = e() : undefined;
  11153. /***/ }),
  11154. /* 46 */
  11155. /*!*****************************************************************!*\
  11156. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/common/http.interceptor.js ***!
  11157. \*****************************************************************/
  11158. /*! no static exports found */
  11159. /***/ (function(module, exports, __webpack_require__) {
  11160. "use strict";
  11161. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 这里的vm,就是我们在vue文件里面的this,所以我们能在这里获取vuex的变量,比如存放在里面的token
  11162. // 同时,我们也可以在此使用getApp().globalData,如果你把token放在getApp().globalData的话,也是可以使用的
  11163. var install = function install(Vue, vm) {
  11164. Vue.prototype.$u.http.setConfig({
  11165. // baseUrl: '/api',//本地使用代理
  11166. baseUrl: 'https://qunali.xmnk.cn/api', //打包公司服务器接口地址
  11167. // baseUrl:'http://bcsyds.hactcm.edu.cn/api',//学校服务器接口地址
  11168. originalData: true,
  11169. dataType: 'json',
  11170. showLoading: true, // 是否显示请求中的loading
  11171. loadingText: '请求中...', // 请求loading中的文字提示
  11172. loadingTime: 100, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  11173. loadingMask: true, // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  11174. // 设置自定义头部content-type
  11175. header: {
  11176. 'content-type': 'application/json' } });
  11177. // 请求拦截,配置Token等参数
  11178. Vue.prototype.$u.http.interceptor.request = function (config) {
  11179. // config.header.Token = 'xxxxxx';
  11180. // 方式一,存放在vuex的token,假设使用了uView封装的vuex方式,见:https://uviewui.com/components/globalVariable.html
  11181. // config.header.token = vm.token;
  11182. config.header.Authorization = vm.vuex_token;
  11183. // 方式二,如果没有使用uView封装的vuex方法,那么需要使用$store.state获取
  11184. // config.header.token = vm.$store.state.token;
  11185. // 方式三,如果token放在了globalData,通过getApp().globalData获取
  11186. // config.header.token = getApp().globalData.username;
  11187. // 方式四,如果token放在了Storage本地存储中,拦截是每次请求都执行的,所以哪怕您重新登录修改了Storage,下一次的请求将会是最新值
  11188. // const token = uni.getStorageSync('token');
  11189. // config.header.token = token;
  11190. return config;
  11191. };
  11192. // 响应拦截,判断状态码是否通过
  11193. Vue.prototype.$u.http.interceptor.response = function (res) {
  11194. // 如果把originalData设置为了true,这里得到将会是服务器返回的所有的原始数据
  11195. // 判断可能变成了res.statueCode,或者res.data.code之类的,请打印查看结果
  11196. if (res.statusCode == 401) {
  11197. Vue.prototype.$u.toast('登录过期请重新登录');
  11198. Vue.prototype.$u.vuex('vuex_token', '');
  11199. Vue.prototype.$u.vuex('vuex_user', '');
  11200. Vue.prototype.$u.vuex('vuex_id', '');
  11201. uni.reLaunch({
  11202. url: '/pages/index/index' });
  11203. return;
  11204. }
  11205. if (res.statusCode == 422) {
  11206. Vue.prototype.$u.toast(res.data.message);
  11207. return false;
  11208. }
  11209. if (res.statusCode == 400) {
  11210. Vue.prototype.$u.toast(res.data.message);
  11211. return false;
  11212. }
  11213. if (res.statusCode == 500) {
  11214. Vue.prototype.$u.toast(res.data.message);
  11215. return false;
  11216. }
  11217. if (res.statusCode == 423) {
  11218. Vue.prototype.$u.toast(res.data.message);
  11219. return false;
  11220. }
  11221. // if (res.statusCode == 423) {
  11222. // return res;
  11223. // }
  11224. if (res.statusCode < 300 && res.statusCode >= 200) {
  11225. // 如果把originalData设置为了true,这里return回什么,this.$u.post的then回调中就会得到什么
  11226. console.log(res, '拿到的数据');
  11227. return res.data;
  11228. } else return false;
  11229. };
  11230. };var _default =
  11231. {
  11232. install: install };exports.default = _default;
  11233. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  11234. /***/ }),
  11235. /* 47 */
  11236. /*!*********************************************************!*\
  11237. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/common/http.api.js ***!
  11238. \*********************************************************/
  11239. /*! no static exports found */
  11240. /***/ (function(module, exports, __webpack_require__) {
  11241. "use strict";
  11242. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 如果没有通过拦截器配置域名的话,可以在这里写上完整的URL(加上域名部分)
  11243. var hotSearchUrl = '/ebapi/store_api/hot_search';
  11244. var indexUrl = '/ebapi/public_api/index';
  11245. // 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作,更多内容详见uView对拦截器的介绍部分:
  11246. // https://uviewui.com/js/http.html#%E4%BD%95%E8%B0%93%E8%AF%B7%E6%B1%82%E6%8B%A6%E6%88%AA%EF%BC%9F
  11247. var install = function install(Vue, vm) {
  11248. // 此处没有使用传入的params参数
  11249. var getSearch = function getSearch() {var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};return vm.$u.get(hotSearchUrl, {
  11250. id: 2 });};
  11251. // 此处使用了传入的params参数,一切自定义即可
  11252. var getInfo = function getInfo() {var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};return vm.$u.post(indexUrl, params);};
  11253. // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
  11254. vm.$u.api = { getSearch: getSearch, getInfo: getInfo };
  11255. };var _default =
  11256. {
  11257. install: install };exports.default = _default;
  11258. /***/ }),
  11259. /* 48 */
  11260. /*!********************************************************!*\
  11261. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/store/$u.mixin.js ***!
  11262. \********************************************************/
  11263. /*! no static exports found */
  11264. /***/ (function(module, exports, __webpack_require__) {
  11265. "use strict";
  11266. var _vuex = __webpack_require__(/*! vuex */ 42);
  11267. var _store = _interopRequireDefault(__webpack_require__(/*! @/store */ 41));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
  11268. // 尝试将用户在根目录中的store/index.js的vuex的state变量,全部加载到全局变量中
  11269. var $uStoreKey = [];
  11270. try {
  11271. $uStoreKey = _store.default.state ? Object.keys(_store.default.state) : [];
  11272. } catch (e) {
  11273. }
  11274. module.exports = {
  11275. beforeCreate: function beforeCreate() {var _this = this;
  11276. // 将vuex方法挂在到$u中
  11277. // 使用方法为:如果要修改vuex的state中的user.name变量为"史诗" => this.$u.vuex('user.name', '史诗')
  11278. // 如果要修改vuex的state的version变量为1.0.1 => this.$u.vuex('version', '1.0.1')
  11279. this.$u.vuex = function (name, value) {
  11280. _this.$store.commit('$uStore', {
  11281. name: name, value: value });
  11282. };
  11283. },
  11284. computed: _objectSpread({},
  11285. (0, _vuex.mapState)($uStoreKey)) };
  11286. /***/ }),
  11287. /* 49 */
  11288. /*!*********************************************************************!*\
  11289. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/mixin/mpShare.js ***!
  11290. \*********************************************************************/
  11291. /*! no static exports found */
  11292. /***/ (function(module, exports) {
  11293. module.exports = {
  11294. onLoad: function onLoad() {
  11295. // 设置默认的转发参数
  11296. this.$u.mpShare = {
  11297. title: '', // 默认为小程序名称
  11298. path: '', // 默认为当前页面路径
  11299. imageUrl: '' // 默认为当前页面的截图
  11300. };
  11301. },
  11302. onShareAppMessage: function onShareAppMessage() {
  11303. return this.$u.mpShare;
  11304. },
  11305. onShareTimeline: function onShareTimeline() {
  11306. return this.$u.mpShare;
  11307. } };
  11308. /***/ }),
  11309. /* 50 */,
  11310. /* 51 */,
  11311. /* 52 */,
  11312. /* 53 */,
  11313. /* 54 */,
  11314. /* 55 */,
  11315. /* 56 */,
  11316. /* 57 */,
  11317. /* 58 */,
  11318. /* 59 */,
  11319. /* 60 */,
  11320. /* 61 */,
  11321. /* 62 */,
  11322. /* 63 */,
  11323. /* 64 */,
  11324. /* 65 */,
  11325. /* 66 */,
  11326. /* 67 */,
  11327. /* 68 */,
  11328. /* 69 */,
  11329. /* 70 */,
  11330. /* 71 */,
  11331. /* 72 */,
  11332. /* 73 */,
  11333. /* 74 */,
  11334. /* 75 */,
  11335. /* 76 */,
  11336. /* 77 */,
  11337. /* 78 */,
  11338. /* 79 */,
  11339. /* 80 */,
  11340. /* 81 */,
  11341. /* 82 */,
  11342. /* 83 */,
  11343. /* 84 */,
  11344. /* 85 */,
  11345. /* 86 */,
  11346. /* 87 */,
  11347. /* 88 */,
  11348. /* 89 */,
  11349. /* 90 */,
  11350. /* 91 */,
  11351. /* 92 */,
  11352. /* 93 */,
  11353. /* 94 */,
  11354. /* 95 */,
  11355. /* 96 */,
  11356. /* 97 */,
  11357. /* 98 */,
  11358. /* 99 */,
  11359. /* 100 */,
  11360. /* 101 */,
  11361. /* 102 */,
  11362. /* 103 */,
  11363. /* 104 */,
  11364. /* 105 */,
  11365. /* 106 */,
  11366. /* 107 */,
  11367. /* 108 */
  11368. /*!********************************************************************!*\
  11369. !*** E:/18 希梦耐康网站/明路--到哪/新建文件夹/quna/uview-ui/libs/util/emitter.js ***!
  11370. \********************************************************************/
  11371. /*! no static exports found */
  11372. /***/ (function(module, exports, __webpack_require__) {
  11373. "use strict";
  11374. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  11375. * 递归使用 call 方式this指向
  11376. * @param componentName // 需要找的组件的名称
  11377. * @param eventName // 事件名称
  11378. * @param params // 需要传递的参数
  11379. */
  11380. function _broadcast(componentName, eventName, params) {
  11381. // 循环子节点找到名称一样的子节点 否则 递归 当前子节点
  11382. this.$children.map(function (child) {
  11383. if (componentName === child.$options.name) {
  11384. child.$emit.apply(child, [eventName].concat(params));
  11385. } else {
  11386. _broadcast.apply(child, [componentName, eventName].concat(params));
  11387. }
  11388. });
  11389. }var _default =
  11390. {
  11391. methods: {
  11392. /**
  11393. * 派发 (向上查找) (一个)
  11394. * @param componentName // 需要找的组件的名称
  11395. * @param eventName // 事件名称
  11396. * @param params // 需要传递的参数
  11397. */
  11398. dispatch: function dispatch(componentName, eventName, params) {
  11399. var parent = this.$parent || this.$root; //$parent 找到最近的父节点 $root 根节点
  11400. var name = parent.$options.name; // 获取当前组件实例的name
  11401. // 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点
  11402. // 循环出当前名称的一样的组件实例
  11403. while (parent && (!name || name !== componentName)) {
  11404. parent = parent.$parent;
  11405. if (parent) {
  11406. name = parent.$options.name;
  11407. }
  11408. }
  11409. // 有节点表示当前找到了name一样的实例
  11410. if (parent) {
  11411. parent.$emit.apply(parent, [eventName].concat(params));
  11412. }
  11413. },
  11414. /**
  11415. * 广播 (向下查找) (广播多个)
  11416. * @param componentName // 需要找的组件的名称
  11417. * @param eventName // 事件名称
  11418. * @param params // 需要传递的参数
  11419. */
  11420. broadcast: function broadcast(componentName, eventName, params) {
  11421. _broadcast.call(this, componentName, eventName, params);
  11422. } } };exports.default = _default;
  11423. /***/ })
  11424. ]]);
  11425. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map