vendor.js 316 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!************************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  5. \************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. /* 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));
  10. 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;}
  11. var realAtob;
  12. var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
  13. var b64re = /^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;
  14. if (typeof atob !== 'function') {
  15. realAtob = function realAtob(str) {
  16. str = String(str).replace(/[\t\n\f\r ]+/g, '');
  17. if (!b64re.test(str)) {throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");}
  18. // Adding the padding if missing, for semplicity
  19. str += '=='.slice(2 - (str.length & 3));
  20. var bitmap;var result = '';var r1;var r2;var i = 0;
  21. for (; i < str.length;) {
  22. bitmap = b64.indexOf(str.charAt(i++)) << 18 | b64.indexOf(str.charAt(i++)) << 12 |
  23. (r1 = b64.indexOf(str.charAt(i++))) << 6 | (r2 = b64.indexOf(str.charAt(i++)));
  24. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  25. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  26. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  27. }
  28. return result;
  29. };
  30. } else {
  31. // 注意atob只能在全局对象上调用,例如:`const Base64 = {atob};Base64.atob('xxxx')`是错误的用法
  32. realAtob = atob;
  33. }
  34. function b64DecodeUnicode(str) {
  35. return decodeURIComponent(realAtob(str).split('').map(function (c) {
  36. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  37. }).join(''));
  38. }
  39. function getCurrentUserInfo() {
  40. var token = wx.getStorageSync('uni_id_token') || '';
  41. var tokenArr = token.split('.');
  42. if (!token || tokenArr.length !== 3) {
  43. return {
  44. uid: null,
  45. role: [],
  46. permission: [],
  47. tokenExpired: 0 };
  48. }
  49. var userInfo;
  50. try {
  51. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  52. } catch (error) {
  53. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  54. }
  55. userInfo.tokenExpired = userInfo.exp * 1000;
  56. delete userInfo.exp;
  57. delete userInfo.iat;
  58. return userInfo;
  59. }
  60. function uniIdMixin(Vue) {
  61. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  62. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  63. return role.indexOf(roleId) > -1;
  64. };
  65. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  66. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  67. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  68. };
  69. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  70. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  71. return tokenExpired > Date.now();
  72. };
  73. }
  74. var _toString = Object.prototype.toString;
  75. var hasOwnProperty = Object.prototype.hasOwnProperty;
  76. function isFn(fn) {
  77. return typeof fn === 'function';
  78. }
  79. function isStr(str) {
  80. return typeof str === 'string';
  81. }
  82. function isPlainObject(obj) {
  83. return _toString.call(obj) === '[object Object]';
  84. }
  85. function hasOwn(obj, key) {
  86. return hasOwnProperty.call(obj, key);
  87. }
  88. function noop() {}
  89. /**
  90. * Create a cached version of a pure function.
  91. */
  92. function cached(fn) {
  93. var cache = Object.create(null);
  94. return function cachedFn(str) {
  95. var hit = cache[str];
  96. return hit || (cache[str] = fn(str));
  97. };
  98. }
  99. /**
  100. * Camelize a hyphen-delimited string.
  101. */
  102. var camelizeRE = /-(\w)/g;
  103. var camelize = cached(function (str) {
  104. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  105. });
  106. var HOOKS = [
  107. 'invoke',
  108. 'success',
  109. 'fail',
  110. 'complete',
  111. 'returnValue'];
  112. var globalInterceptors = {};
  113. var scopedInterceptors = {};
  114. function mergeHook(parentVal, childVal) {
  115. var res = childVal ?
  116. parentVal ?
  117. parentVal.concat(childVal) :
  118. Array.isArray(childVal) ?
  119. childVal : [childVal] :
  120. parentVal;
  121. return res ?
  122. dedupeHooks(res) :
  123. res;
  124. }
  125. function dedupeHooks(hooks) {
  126. var res = [];
  127. for (var i = 0; i < hooks.length; i++) {
  128. if (res.indexOf(hooks[i]) === -1) {
  129. res.push(hooks[i]);
  130. }
  131. }
  132. return res;
  133. }
  134. function removeHook(hooks, hook) {
  135. var index = hooks.indexOf(hook);
  136. if (index !== -1) {
  137. hooks.splice(index, 1);
  138. }
  139. }
  140. function mergeInterceptorHook(interceptor, option) {
  141. Object.keys(option).forEach(function (hook) {
  142. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  143. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  144. }
  145. });
  146. }
  147. function removeInterceptorHook(interceptor, option) {
  148. if (!interceptor || !option) {
  149. return;
  150. }
  151. Object.keys(option).forEach(function (hook) {
  152. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  153. removeHook(interceptor[hook], option[hook]);
  154. }
  155. });
  156. }
  157. function addInterceptor(method, option) {
  158. if (typeof method === 'string' && isPlainObject(option)) {
  159. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  160. } else if (isPlainObject(method)) {
  161. mergeInterceptorHook(globalInterceptors, method);
  162. }
  163. }
  164. function removeInterceptor(method, option) {
  165. if (typeof method === 'string') {
  166. if (isPlainObject(option)) {
  167. removeInterceptorHook(scopedInterceptors[method], option);
  168. } else {
  169. delete scopedInterceptors[method];
  170. }
  171. } else if (isPlainObject(method)) {
  172. removeInterceptorHook(globalInterceptors, method);
  173. }
  174. }
  175. function wrapperHook(hook) {
  176. return function (data) {
  177. return hook(data) || data;
  178. };
  179. }
  180. function isPromise(obj) {
  181. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  182. }
  183. function queue(hooks, data) {
  184. var promise = false;
  185. for (var i = 0; i < hooks.length; i++) {
  186. var hook = hooks[i];
  187. if (promise) {
  188. promise = Promise.resolve(wrapperHook(hook));
  189. } else {
  190. var res = hook(data);
  191. if (isPromise(res)) {
  192. promise = Promise.resolve(res);
  193. }
  194. if (res === false) {
  195. return {
  196. then: function then() {} };
  197. }
  198. }
  199. }
  200. return promise || {
  201. then: function then(callback) {
  202. return callback(data);
  203. } };
  204. }
  205. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  206. ['success', 'fail', 'complete'].forEach(function (name) {
  207. if (Array.isArray(interceptor[name])) {
  208. var oldCallback = options[name];
  209. options[name] = function callbackInterceptor(res) {
  210. queue(interceptor[name], res).then(function (res) {
  211. /* eslint-disable no-mixed-operators */
  212. return isFn(oldCallback) && oldCallback(res) || res;
  213. });
  214. };
  215. }
  216. });
  217. return options;
  218. }
  219. function wrapperReturnValue(method, returnValue) {
  220. var returnValueHooks = [];
  221. if (Array.isArray(globalInterceptors.returnValue)) {
  222. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  223. }
  224. var interceptor = scopedInterceptors[method];
  225. if (interceptor && Array.isArray(interceptor.returnValue)) {
  226. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  227. }
  228. returnValueHooks.forEach(function (hook) {
  229. returnValue = hook(returnValue) || returnValue;
  230. });
  231. return returnValue;
  232. }
  233. function getApiInterceptorHooks(method) {
  234. var interceptor = Object.create(null);
  235. Object.keys(globalInterceptors).forEach(function (hook) {
  236. if (hook !== 'returnValue') {
  237. interceptor[hook] = globalInterceptors[hook].slice();
  238. }
  239. });
  240. var scopedInterceptor = scopedInterceptors[method];
  241. if (scopedInterceptor) {
  242. Object.keys(scopedInterceptor).forEach(function (hook) {
  243. if (hook !== 'returnValue') {
  244. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  245. }
  246. });
  247. }
  248. return interceptor;
  249. }
  250. 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];}
  251. var interceptor = getApiInterceptorHooks(method);
  252. if (interceptor && Object.keys(interceptor).length) {
  253. if (Array.isArray(interceptor.invoke)) {
  254. var res = queue(interceptor.invoke, options);
  255. return res.then(function (options) {
  256. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  257. });
  258. } else {
  259. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  260. }
  261. }
  262. return api.apply(void 0, [options].concat(params));
  263. }
  264. var promiseInterceptor = {
  265. returnValue: function returnValue(res) {
  266. if (!isPromise(res)) {
  267. return res;
  268. }
  269. return new Promise(function (resolve, reject) {
  270. res.then(function (res) {
  271. if (res[0]) {
  272. reject(res[0]);
  273. } else {
  274. resolve(res[1]);
  275. }
  276. });
  277. });
  278. } };
  279. var SYNC_API_RE =
  280. /^\$|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale/;
  281. var CONTEXT_API_RE = /^create|Manager$/;
  282. // Context例外情况
  283. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  284. // 同步例外情况
  285. var ASYNC_API = ['createBLEConnection'];
  286. var CALLBACK_API_RE = /^on|^off/;
  287. function isContextApi(name) {
  288. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  289. }
  290. function isSyncApi(name) {
  291. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  292. }
  293. function isCallbackApi(name) {
  294. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  295. }
  296. function handlePromise(promise) {
  297. return promise.then(function (data) {
  298. return [null, data];
  299. }).
  300. catch(function (err) {return [err];});
  301. }
  302. function shouldPromise(name) {
  303. if (
  304. isContextApi(name) ||
  305. isSyncApi(name) ||
  306. isCallbackApi(name))
  307. {
  308. return false;
  309. }
  310. return true;
  311. }
  312. /* eslint-disable no-extend-native */
  313. if (!Promise.prototype.finally) {
  314. Promise.prototype.finally = function (callback) {
  315. var promise = this.constructor;
  316. return this.then(
  317. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  318. function (reason) {return promise.resolve(callback()).then(function () {
  319. throw reason;
  320. });});
  321. };
  322. }
  323. function promisify(name, api) {
  324. if (!shouldPromise(name)) {
  325. return api;
  326. }
  327. 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];}
  328. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  329. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  330. }
  331. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  332. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  333. success: resolve,
  334. fail: reject })].concat(
  335. params));
  336. })));
  337. };
  338. }
  339. var EPS = 1e-4;
  340. var BASE_DEVICE_WIDTH = 750;
  341. var isIOS = false;
  342. var deviceWidth = 0;
  343. var deviceDPR = 0;
  344. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  345. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  346. deviceWidth = windowWidth;
  347. deviceDPR = pixelRatio;
  348. isIOS = platform === 'ios';
  349. }
  350. function upx2px(number, newDeviceWidth) {
  351. if (deviceWidth === 0) {
  352. checkDeviceWidth();
  353. }
  354. number = Number(number);
  355. if (number === 0) {
  356. return 0;
  357. }
  358. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  359. if (result < 0) {
  360. result = -result;
  361. }
  362. result = Math.floor(result + EPS);
  363. if (result === 0) {
  364. if (deviceDPR === 1 || !isIOS) {
  365. result = 1;
  366. } else {
  367. result = 0.5;
  368. }
  369. }
  370. return number < 0 ? -result : result;
  371. }
  372. function getLocale() {
  373. // 优先使用 $locale
  374. var app = getApp({
  375. allowDefault: true });
  376. if (app && app.$vm) {
  377. return app.$vm.$locale;
  378. }
  379. return wx.getSystemInfoSync().language || 'zh-Hans';
  380. }
  381. function setLocale(locale) {
  382. var app = getApp();
  383. if (!app) {
  384. return false;
  385. }
  386. var oldLocale = app.$vm.$locale;
  387. if (oldLocale !== locale) {
  388. app.$vm.$locale = locale;
  389. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  390. locale: locale });});
  391. return true;
  392. }
  393. return false;
  394. }
  395. var onLocaleChangeCallbacks = [];
  396. function onLocaleChange(fn) {
  397. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  398. onLocaleChangeCallbacks.push(fn);
  399. }
  400. }
  401. if (typeof global !== 'undefined') {
  402. global.getLocale = getLocale;
  403. }
  404. var interceptors = {
  405. promiseInterceptor: promiseInterceptor };
  406. var baseApi = /*#__PURE__*/Object.freeze({
  407. __proto__: null,
  408. upx2px: upx2px,
  409. getLocale: getLocale,
  410. setLocale: setLocale,
  411. onLocaleChange: onLocaleChange,
  412. addInterceptor: addInterceptor,
  413. removeInterceptor: removeInterceptor,
  414. interceptors: interceptors });
  415. function findExistsPageIndex(url) {
  416. var pages = getCurrentPages();
  417. var len = pages.length;
  418. while (len--) {
  419. var page = pages[len];
  420. if (page.$page && page.$page.fullPath === url) {
  421. return len;
  422. }
  423. }
  424. return -1;
  425. }
  426. var redirectTo = {
  427. name: function name(fromArgs) {
  428. if (fromArgs.exists === 'back' && fromArgs.delta) {
  429. return 'navigateBack';
  430. }
  431. return 'redirectTo';
  432. },
  433. args: function args(fromArgs) {
  434. if (fromArgs.exists === 'back' && fromArgs.url) {
  435. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  436. if (existsPageIndex !== -1) {
  437. var delta = getCurrentPages().length - 1 - existsPageIndex;
  438. if (delta > 0) {
  439. fromArgs.delta = delta;
  440. }
  441. }
  442. }
  443. } };
  444. var previewImage = {
  445. args: function args(fromArgs) {
  446. var currentIndex = parseInt(fromArgs.current);
  447. if (isNaN(currentIndex)) {
  448. return;
  449. }
  450. var urls = fromArgs.urls;
  451. if (!Array.isArray(urls)) {
  452. return;
  453. }
  454. var len = urls.length;
  455. if (!len) {
  456. return;
  457. }
  458. if (currentIndex < 0) {
  459. currentIndex = 0;
  460. } else if (currentIndex >= len) {
  461. currentIndex = len - 1;
  462. }
  463. if (currentIndex > 0) {
  464. fromArgs.current = urls[currentIndex];
  465. fromArgs.urls = urls.filter(
  466. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  467. } else {
  468. fromArgs.current = urls[0];
  469. }
  470. return {
  471. indicator: false,
  472. loop: false };
  473. } };
  474. var UUID_KEY = '__DC_STAT_UUID';
  475. var deviceId;
  476. function addUuid(result) {
  477. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  478. if (!deviceId) {
  479. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  480. wx.setStorage({
  481. key: UUID_KEY,
  482. data: deviceId });
  483. }
  484. result.deviceId = deviceId;
  485. }
  486. function addSafeAreaInsets(result) {
  487. if (result.safeArea) {
  488. var safeArea = result.safeArea;
  489. result.safeAreaInsets = {
  490. top: safeArea.top,
  491. left: safeArea.left,
  492. right: result.windowWidth - safeArea.right,
  493. bottom: result.windowHeight - safeArea.bottom };
  494. }
  495. }
  496. var getSystemInfo = {
  497. returnValue: function returnValue(result) {
  498. addUuid(result);
  499. addSafeAreaInsets(result);
  500. } };
  501. // import navigateTo from 'uni-helpers/navigate-to'
  502. var protocols = {
  503. redirectTo: redirectTo,
  504. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  505. previewImage: previewImage,
  506. getSystemInfo: getSystemInfo,
  507. getSystemInfoSync: getSystemInfo };
  508. var todos = [
  509. 'vibrate',
  510. 'preloadPage',
  511. 'unPreloadPage',
  512. 'loadSubPackage'];
  513. var canIUses = [];
  514. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  515. function processCallback(methodName, method, returnValue) {
  516. return function (res) {
  517. return method(processReturnValue(methodName, res, returnValue));
  518. };
  519. }
  520. 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;
  521. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  522. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  523. if (isFn(argsOption)) {
  524. argsOption = argsOption(fromArgs, toArgs) || {};
  525. }
  526. for (var key in fromArgs) {
  527. if (hasOwn(argsOption, key)) {
  528. var keyOption = argsOption[key];
  529. if (isFn(keyOption)) {
  530. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  531. }
  532. if (!keyOption) {// 不支持的参数
  533. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  534. } else if (isStr(keyOption)) {// 重写参数 key
  535. toArgs[keyOption] = fromArgs[key];
  536. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  537. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  538. }
  539. } else if (CALLBACKS.indexOf(key) !== -1) {
  540. if (isFn(fromArgs[key])) {
  541. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  542. }
  543. } else {
  544. if (!keepFromArgs) {
  545. toArgs[key] = fromArgs[key];
  546. }
  547. }
  548. }
  549. return toArgs;
  550. } else if (isFn(fromArgs)) {
  551. fromArgs = processCallback(methodName, fromArgs, returnValue);
  552. }
  553. return fromArgs;
  554. }
  555. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  556. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  557. res = protocols.returnValue(methodName, res);
  558. }
  559. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  560. }
  561. function wrapper(methodName, method) {
  562. if (hasOwn(protocols, methodName)) {
  563. var protocol = protocols[methodName];
  564. if (!protocol) {// 暂不支持的 api
  565. return function () {
  566. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  567. };
  568. }
  569. return function (arg1, arg2) {// 目前 api 最多两个参数
  570. var options = protocol;
  571. if (isFn(protocol)) {
  572. options = protocol(arg1);
  573. }
  574. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  575. var args = [arg1];
  576. if (typeof arg2 !== 'undefined') {
  577. args.push(arg2);
  578. }
  579. if (isFn(options.name)) {
  580. methodName = options.name(arg1);
  581. } else if (isStr(options.name)) {
  582. methodName = options.name;
  583. }
  584. var returnValue = wx[methodName].apply(wx, args);
  585. if (isSyncApi(methodName)) {// 同步 api
  586. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  587. }
  588. return returnValue;
  589. };
  590. }
  591. return method;
  592. }
  593. var todoApis = Object.create(null);
  594. var TODOS = [
  595. 'onTabBarMidButtonTap',
  596. 'subscribePush',
  597. 'unsubscribePush',
  598. 'onPush',
  599. 'offPush',
  600. 'share'];
  601. function createTodoApi(name) {
  602. return function todoApi(_ref)
  603. {var fail = _ref.fail,complete = _ref.complete;
  604. var res = {
  605. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  606. isFn(fail) && fail(res);
  607. isFn(complete) && complete(res);
  608. };
  609. }
  610. TODOS.forEach(function (name) {
  611. todoApis[name] = createTodoApi(name);
  612. });
  613. var providers = {
  614. oauth: ['weixin'],
  615. share: ['weixin'],
  616. payment: ['wxpay'],
  617. push: ['weixin'] };
  618. function getProvider(_ref2)
  619. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  620. var res = false;
  621. if (providers[service]) {
  622. res = {
  623. errMsg: 'getProvider:ok',
  624. service: service,
  625. provider: providers[service] };
  626. isFn(success) && success(res);
  627. } else {
  628. res = {
  629. errMsg: 'getProvider:fail service not found' };
  630. isFn(fail) && fail(res);
  631. }
  632. isFn(complete) && complete(res);
  633. }
  634. var extraApi = /*#__PURE__*/Object.freeze({
  635. __proto__: null,
  636. getProvider: getProvider });
  637. var getEmitter = function () {
  638. var Emitter;
  639. return function getUniEmitter() {
  640. if (!Emitter) {
  641. Emitter = new _vue.default();
  642. }
  643. return Emitter;
  644. };
  645. }();
  646. function apply(ctx, method, args) {
  647. return ctx[method].apply(ctx, args);
  648. }
  649. function $on() {
  650. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  651. }
  652. function $off() {
  653. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  654. }
  655. function $once() {
  656. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  657. }
  658. function $emit() {
  659. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  660. }
  661. var eventApi = /*#__PURE__*/Object.freeze({
  662. __proto__: null,
  663. $on: $on,
  664. $off: $off,
  665. $once: $once,
  666. $emit: $emit });
  667. var api = /*#__PURE__*/Object.freeze({
  668. __proto__: null });
  669. var MPPage = Page;
  670. var MPComponent = Component;
  671. var customizeRE = /:/g;
  672. var customize = cached(function (str) {
  673. return camelize(str.replace(customizeRE, '-'));
  674. });
  675. function initTriggerEvent(mpInstance) {
  676. var oldTriggerEvent = mpInstance.triggerEvent;
  677. mpInstance.triggerEvent = function (event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  678. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  679. };
  680. }
  681. function initHook(name, options, isComponent) {
  682. var oldHook = options[name];
  683. if (!oldHook) {
  684. options[name] = function () {
  685. initTriggerEvent(this);
  686. };
  687. } else {
  688. options[name] = function () {
  689. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  690. return oldHook.apply(this, args);
  691. };
  692. }
  693. }
  694. if (!MPPage.__$wrappered) {
  695. MPPage.__$wrappered = true;
  696. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  697. initHook('onLoad', options);
  698. return MPPage(options);
  699. };
  700. Page.after = MPPage.after;
  701. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  702. initHook('created', options);
  703. return MPComponent(options);
  704. };
  705. }
  706. var PAGE_EVENT_HOOKS = [
  707. 'onPullDownRefresh',
  708. 'onReachBottom',
  709. 'onAddToFavorites',
  710. 'onShareTimeline',
  711. 'onShareAppMessage',
  712. 'onPageScroll',
  713. 'onResize',
  714. 'onTabItemTap'];
  715. function initMocks(vm, mocks) {
  716. var mpInstance = vm.$mp[vm.mpType];
  717. mocks.forEach(function (mock) {
  718. if (hasOwn(mpInstance, mock)) {
  719. vm[mock] = mpInstance[mock];
  720. }
  721. });
  722. }
  723. function hasHook(hook, vueOptions) {
  724. if (!vueOptions) {
  725. return true;
  726. }
  727. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  728. return true;
  729. }
  730. vueOptions = vueOptions.default || vueOptions;
  731. if (isFn(vueOptions)) {
  732. if (isFn(vueOptions.extendOptions[hook])) {
  733. return true;
  734. }
  735. if (vueOptions.super &&
  736. vueOptions.super.options &&
  737. Array.isArray(vueOptions.super.options[hook])) {
  738. return true;
  739. }
  740. return false;
  741. }
  742. if (isFn(vueOptions[hook])) {
  743. return true;
  744. }
  745. var mixins = vueOptions.mixins;
  746. if (Array.isArray(mixins)) {
  747. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  748. }
  749. }
  750. function initHooks(mpOptions, hooks, vueOptions) {
  751. hooks.forEach(function (hook) {
  752. if (hasHook(hook, vueOptions)) {
  753. mpOptions[hook] = function (args) {
  754. return this.$vm && this.$vm.__call_hook(hook, args);
  755. };
  756. }
  757. });
  758. }
  759. function initVueComponent(Vue, vueOptions) {
  760. vueOptions = vueOptions.default || vueOptions;
  761. var VueComponent;
  762. if (isFn(vueOptions)) {
  763. VueComponent = vueOptions;
  764. } else {
  765. VueComponent = Vue.extend(vueOptions);
  766. }
  767. vueOptions = VueComponent.options;
  768. return [VueComponent, vueOptions];
  769. }
  770. function initSlots(vm, vueSlots) {
  771. if (Array.isArray(vueSlots) && vueSlots.length) {
  772. var $slots = Object.create(null);
  773. vueSlots.forEach(function (slotName) {
  774. $slots[slotName] = true;
  775. });
  776. vm.$scopedSlots = vm.$slots = $slots;
  777. }
  778. }
  779. function initVueIds(vueIds, mpInstance) {
  780. vueIds = (vueIds || '').split(',');
  781. var len = vueIds.length;
  782. if (len === 1) {
  783. mpInstance._$vueId = vueIds[0];
  784. } else if (len === 2) {
  785. mpInstance._$vueId = vueIds[0];
  786. mpInstance._$vuePid = vueIds[1];
  787. }
  788. }
  789. function initData(vueOptions, context) {
  790. var data = vueOptions.data || {};
  791. var methods = vueOptions.methods || {};
  792. if (typeof data === 'function') {
  793. try {
  794. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  795. } catch (e) {
  796. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"txCar","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  797. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  798. }
  799. }
  800. } else {
  801. try {
  802. // 对 data 格式化
  803. data = JSON.parse(JSON.stringify(data));
  804. } catch (e) {}
  805. }
  806. if (!isPlainObject(data)) {
  807. data = {};
  808. }
  809. Object.keys(methods).forEach(function (methodName) {
  810. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  811. data[methodName] = methods[methodName];
  812. }
  813. });
  814. return data;
  815. }
  816. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  817. function createObserver(name) {
  818. return function observer(newVal, oldVal) {
  819. if (this.$vm) {
  820. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  821. }
  822. };
  823. }
  824. function initBehaviors(vueOptions, initBehavior) {
  825. var vueBehaviors = vueOptions.behaviors;
  826. var vueExtends = vueOptions.extends;
  827. var vueMixins = vueOptions.mixins;
  828. var vueProps = vueOptions.props;
  829. if (!vueProps) {
  830. vueOptions.props = vueProps = [];
  831. }
  832. var behaviors = [];
  833. if (Array.isArray(vueBehaviors)) {
  834. vueBehaviors.forEach(function (behavior) {
  835. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  836. if (behavior === 'uni://form-field') {
  837. if (Array.isArray(vueProps)) {
  838. vueProps.push('name');
  839. vueProps.push('value');
  840. } else {
  841. vueProps.name = {
  842. type: String,
  843. default: '' };
  844. vueProps.value = {
  845. type: [String, Number, Boolean, Array, Object, Date],
  846. default: '' };
  847. }
  848. }
  849. });
  850. }
  851. if (isPlainObject(vueExtends) && vueExtends.props) {
  852. behaviors.push(
  853. initBehavior({
  854. properties: initProperties(vueExtends.props, true) }));
  855. }
  856. if (Array.isArray(vueMixins)) {
  857. vueMixins.forEach(function (vueMixin) {
  858. if (isPlainObject(vueMixin) && vueMixin.props) {
  859. behaviors.push(
  860. initBehavior({
  861. properties: initProperties(vueMixin.props, true) }));
  862. }
  863. });
  864. }
  865. return behaviors;
  866. }
  867. function parsePropType(key, type, defaultValue, file) {
  868. // [String]=>String
  869. if (Array.isArray(type) && type.length === 1) {
  870. return type[0];
  871. }
  872. return type;
  873. }
  874. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  875. var properties = {};
  876. if (!isBehavior) {
  877. properties.vueId = {
  878. type: String,
  879. value: '' };
  880. // 用于字节跳动小程序模拟抽象节点
  881. properties.generic = {
  882. type: Object,
  883. value: null };
  884. // scopedSlotsCompiler auto
  885. properties.scopedSlotsCompiler = {
  886. type: String,
  887. value: '' };
  888. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  889. type: null,
  890. value: [],
  891. observer: function observer(newVal, oldVal) {
  892. var $slots = Object.create(null);
  893. newVal.forEach(function (slotName) {
  894. $slots[slotName] = true;
  895. });
  896. this.setData({
  897. $slots: $slots });
  898. } };
  899. }
  900. if (Array.isArray(props)) {// ['title']
  901. props.forEach(function (key) {
  902. properties[key] = {
  903. type: null,
  904. observer: createObserver(key) };
  905. });
  906. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  907. Object.keys(props).forEach(function (key) {
  908. var opts = props[key];
  909. if (isPlainObject(opts)) {// title:{type:String,default:''}
  910. var value = opts.default;
  911. if (isFn(value)) {
  912. value = value();
  913. }
  914. opts.type = parsePropType(key, opts.type);
  915. properties[key] = {
  916. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  917. value: value,
  918. observer: createObserver(key) };
  919. } else {// content:String
  920. var type = parsePropType(key, opts);
  921. properties[key] = {
  922. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  923. observer: createObserver(key) };
  924. }
  925. });
  926. }
  927. return properties;
  928. }
  929. function wrapper$1(event) {
  930. // TODO 又得兼容 mpvue 的 mp 对象
  931. try {
  932. event.mp = JSON.parse(JSON.stringify(event));
  933. } catch (e) {}
  934. event.stopPropagation = noop;
  935. event.preventDefault = noop;
  936. event.target = event.target || {};
  937. if (!hasOwn(event, 'detail')) {
  938. event.detail = {};
  939. }
  940. if (hasOwn(event, 'markerId')) {
  941. event.detail = typeof event.detail === 'object' ? event.detail : {};
  942. event.detail.markerId = event.markerId;
  943. }
  944. if (isPlainObject(event.detail)) {
  945. event.target = Object.assign({}, event.target, event.detail);
  946. }
  947. return event;
  948. }
  949. function getExtraValue(vm, dataPathsArray) {
  950. var context = vm;
  951. dataPathsArray.forEach(function (dataPathArray) {
  952. var dataPath = dataPathArray[0];
  953. var value = dataPathArray[2];
  954. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  955. var propPath = dataPathArray[1];
  956. var valuePath = dataPathArray[3];
  957. var vFor;
  958. if (Number.isInteger(dataPath)) {
  959. vFor = dataPath;
  960. } else if (!dataPath) {
  961. vFor = context;
  962. } else if (typeof dataPath === 'string' && dataPath) {
  963. if (dataPath.indexOf('#s#') === 0) {
  964. vFor = dataPath.substr(3);
  965. } else {
  966. vFor = vm.__get_value(dataPath, context);
  967. }
  968. }
  969. if (Number.isInteger(vFor)) {
  970. context = value;
  971. } else if (!propPath) {
  972. context = vFor[value];
  973. } else {
  974. if (Array.isArray(vFor)) {
  975. context = vFor.find(function (vForItem) {
  976. return vm.__get_value(propPath, vForItem) === value;
  977. });
  978. } else if (isPlainObject(vFor)) {
  979. context = Object.keys(vFor).find(function (vForKey) {
  980. return vm.__get_value(propPath, vFor[vForKey]) === value;
  981. });
  982. } else {
  983. console.error('v-for 暂不支持循环数据:', vFor);
  984. }
  985. }
  986. if (valuePath) {
  987. context = vm.__get_value(valuePath, context);
  988. }
  989. }
  990. });
  991. return context;
  992. }
  993. function processEventExtra(vm, extra, event) {
  994. var extraObj = {};
  995. if (Array.isArray(extra) && extra.length) {
  996. /**
  997. *[
  998. * ['data.items', 'data.id', item.data.id],
  999. * ['metas', 'id', meta.id]
  1000. *],
  1001. *[
  1002. * ['data.items', 'data.id', item.data.id],
  1003. * ['metas', 'id', meta.id]
  1004. *],
  1005. *'test'
  1006. */
  1007. extra.forEach(function (dataPath, index) {
  1008. if (typeof dataPath === 'string') {
  1009. if (!dataPath) {// model,prop.sync
  1010. extraObj['$' + index] = vm;
  1011. } else {
  1012. if (dataPath === '$event') {// $event
  1013. extraObj['$' + index] = event;
  1014. } else if (dataPath === 'arguments') {
  1015. if (event.detail && event.detail.__args__) {
  1016. extraObj['$' + index] = event.detail.__args__;
  1017. } else {
  1018. extraObj['$' + index] = [event];
  1019. }
  1020. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1021. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1022. } else {
  1023. extraObj['$' + index] = vm.__get_value(dataPath);
  1024. }
  1025. }
  1026. } else {
  1027. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1028. }
  1029. });
  1030. }
  1031. return extraObj;
  1032. }
  1033. function getObjByArray(arr) {
  1034. var obj = {};
  1035. for (var i = 1; i < arr.length; i++) {
  1036. var element = arr[i];
  1037. obj[element[0]] = element[1];
  1038. }
  1039. return obj;
  1040. }
  1041. 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;
  1042. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1043. if (isCustom) {// 自定义事件
  1044. isCustomMPEvent = event.currentTarget &&
  1045. event.currentTarget.dataset &&
  1046. event.currentTarget.dataset.comType === 'wx';
  1047. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1048. if (isCustomMPEvent) {
  1049. return [event];
  1050. }
  1051. return event.detail.__args__ || event.detail;
  1052. }
  1053. }
  1054. var extraObj = processEventExtra(vm, extra, event);
  1055. var ret = [];
  1056. args.forEach(function (arg) {
  1057. if (arg === '$event') {
  1058. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1059. ret.push(event.target.value);
  1060. } else {
  1061. if (isCustom && !isCustomMPEvent) {
  1062. ret.push(event.detail.__args__[0]);
  1063. } else {// wxcomponent 组件或内置组件
  1064. ret.push(event);
  1065. }
  1066. }
  1067. } else {
  1068. if (Array.isArray(arg) && arg[0] === 'o') {
  1069. ret.push(getObjByArray(arg));
  1070. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1071. ret.push(extraObj[arg]);
  1072. } else {
  1073. ret.push(arg);
  1074. }
  1075. }
  1076. });
  1077. return ret;
  1078. }
  1079. var ONCE = '~';
  1080. var CUSTOM = '^';
  1081. function isMatchEventType(eventType, optType) {
  1082. return eventType === optType ||
  1083. optType === 'regionchange' && (
  1084. eventType === 'begin' ||
  1085. eventType === 'end');
  1086. }
  1087. function getContextVm(vm) {
  1088. var $parent = vm.$parent;
  1089. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1090. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1091. $parent = $parent.$parent;
  1092. }
  1093. return $parent && $parent.$parent;
  1094. }
  1095. function handleEvent(event) {var _this = this;
  1096. event = wrapper$1(event);
  1097. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1098. var dataset = (event.currentTarget || event.target).dataset;
  1099. if (!dataset) {
  1100. return console.warn('事件信息不存在');
  1101. }
  1102. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1103. if (!eventOpts) {
  1104. return console.warn('事件信息不存在');
  1105. }
  1106. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1107. var eventType = event.type;
  1108. var ret = [];
  1109. eventOpts.forEach(function (eventOpt) {
  1110. var type = eventOpt[0];
  1111. var eventsArray = eventOpt[1];
  1112. var isCustom = type.charAt(0) === CUSTOM;
  1113. type = isCustom ? type.slice(1) : type;
  1114. var isOnce = type.charAt(0) === ONCE;
  1115. type = isOnce ? type.slice(1) : type;
  1116. if (eventsArray && isMatchEventType(eventType, type)) {
  1117. eventsArray.forEach(function (eventArray) {
  1118. var methodName = eventArray[0];
  1119. if (methodName) {
  1120. var handlerCtx = _this.$vm;
  1121. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1122. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1123. }
  1124. if (methodName === '$emit') {
  1125. handlerCtx.$emit.apply(handlerCtx,
  1126. processEventArgs(
  1127. _this.$vm,
  1128. event,
  1129. eventArray[1],
  1130. eventArray[2],
  1131. isCustom,
  1132. methodName));
  1133. return;
  1134. }
  1135. var handler = handlerCtx[methodName];
  1136. if (!isFn(handler)) {
  1137. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1138. }
  1139. if (isOnce) {
  1140. if (handler.once) {
  1141. return;
  1142. }
  1143. handler.once = true;
  1144. }
  1145. var params = processEventArgs(
  1146. _this.$vm,
  1147. event,
  1148. eventArray[1],
  1149. eventArray[2],
  1150. isCustom,
  1151. methodName);
  1152. params = Array.isArray(params) ? params : [];
  1153. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1154. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1155. // eslint-disable-next-line no-sparse-arrays
  1156. params = params.concat([,,,,,,,,,, event]);
  1157. }
  1158. ret.push(handler.apply(handlerCtx, params));
  1159. }
  1160. });
  1161. }
  1162. });
  1163. if (
  1164. eventType === 'input' &&
  1165. ret.length === 1 &&
  1166. typeof ret[0] !== 'undefined')
  1167. {
  1168. return ret[0];
  1169. }
  1170. }
  1171. var locale;
  1172. {
  1173. locale = wx.getSystemInfoSync().language;
  1174. }
  1175. var i18n = (0, _uniI18n.initVueI18n)(
  1176. locale,
  1177. {});
  1178. var t = i18n.t;
  1179. var i18nMixin = i18n.mixin = {
  1180. beforeCreate: function beforeCreate() {var _this2 = this;
  1181. var unwatch = i18n.i18n.watchLocale(function () {
  1182. _this2.$forceUpdate();
  1183. });
  1184. this.$once('hook:beforeDestroy', function () {
  1185. unwatch();
  1186. });
  1187. },
  1188. methods: {
  1189. $$t: function $$t(key, values) {
  1190. return t(key, values);
  1191. } } };
  1192. var setLocale$1 = i18n.setLocale;
  1193. var getLocale$1 = i18n.getLocale;
  1194. function initAppLocale(Vue, appVm, locale) {
  1195. var state = Vue.observable({
  1196. locale: locale || i18n.getLocale() });
  1197. var localeWatchers = [];
  1198. appVm.$watchLocale = function (fn) {
  1199. localeWatchers.push(fn);
  1200. };
  1201. Object.defineProperty(appVm, '$locale', {
  1202. get: function get() {
  1203. return state.locale;
  1204. },
  1205. set: function set(v) {
  1206. state.locale = v;
  1207. localeWatchers.forEach(function (watch) {return watch(v);});
  1208. } });
  1209. }
  1210. var eventChannels = {};
  1211. var eventChannelStack = [];
  1212. function getEventChannel(id) {
  1213. if (id) {
  1214. var eventChannel = eventChannels[id];
  1215. delete eventChannels[id];
  1216. return eventChannel;
  1217. }
  1218. return eventChannelStack.shift();
  1219. }
  1220. var hooks = [
  1221. 'onShow',
  1222. 'onHide',
  1223. 'onError',
  1224. 'onPageNotFound',
  1225. 'onThemeChange',
  1226. 'onUnhandledRejection'];
  1227. function initEventChannel() {
  1228. _vue.default.prototype.getOpenerEventChannel = function () {
  1229. // 微信小程序使用自身getOpenerEventChannel
  1230. {
  1231. return this.$scope.getOpenerEventChannel();
  1232. }
  1233. };
  1234. var callHook = _vue.default.prototype.__call_hook;
  1235. _vue.default.prototype.__call_hook = function (hook, args) {
  1236. if (hook === 'onLoad' && args && args.__id__) {
  1237. this.__eventChannel__ = getEventChannel(args.__id__);
  1238. delete args.__id__;
  1239. }
  1240. return callHook.call(this, hook, args);
  1241. };
  1242. }
  1243. function initScopedSlotsParams() {
  1244. var center = {};
  1245. var parents = {};
  1246. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1247. var has = center[vueId];
  1248. if (!has) {
  1249. parents[vueId] = this;
  1250. this.$on('hook:destroyed', function () {
  1251. delete parents[vueId];
  1252. });
  1253. }
  1254. return has;
  1255. };
  1256. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1257. var data = center[vueId];
  1258. if (data) {
  1259. var object = data[name] || {};
  1260. return key ? object[key] : object;
  1261. } else {
  1262. parents[vueId] = this;
  1263. this.$on('hook:destroyed', function () {
  1264. delete parents[vueId];
  1265. });
  1266. }
  1267. };
  1268. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1269. var vueIds = this.$options.propsData.vueId;
  1270. if (vueIds) {
  1271. var vueId = vueIds.split(',')[0];
  1272. var object = center[vueId] = center[vueId] || {};
  1273. object[name] = value;
  1274. if (parents[vueId]) {
  1275. parents[vueId].$forceUpdate();
  1276. }
  1277. }
  1278. };
  1279. _vue.default.mixin({
  1280. destroyed: function destroyed() {
  1281. var propsData = this.$options.propsData;
  1282. var vueId = propsData && propsData.vueId;
  1283. if (vueId) {
  1284. delete center[vueId];
  1285. delete parents[vueId];
  1286. }
  1287. } });
  1288. }
  1289. function parseBaseApp(vm, _ref3)
  1290. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1291. initEventChannel();
  1292. {
  1293. initScopedSlotsParams();
  1294. }
  1295. if (vm.$options.store) {
  1296. _vue.default.prototype.$store = vm.$options.store;
  1297. }
  1298. uniIdMixin(_vue.default);
  1299. _vue.default.prototype.mpHost = "mp-weixin";
  1300. _vue.default.mixin({
  1301. beforeCreate: function beforeCreate() {
  1302. if (!this.$options.mpType) {
  1303. return;
  1304. }
  1305. this.mpType = this.$options.mpType;
  1306. this.$mp = _defineProperty({
  1307. data: {} },
  1308. this.mpType, this.$options.mpInstance);
  1309. this.$scope = this.$options.mpInstance;
  1310. delete this.$options.mpType;
  1311. delete this.$options.mpInstance;
  1312. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1313. var app = getApp();
  1314. if (app.$vm && app.$vm.$i18n) {
  1315. this._i18n = app.$vm.$i18n;
  1316. }
  1317. }
  1318. if (this.mpType !== 'app') {
  1319. initRefs(this);
  1320. initMocks(this, mocks);
  1321. }
  1322. } });
  1323. var appOptions = {
  1324. onLaunch: function onLaunch(args) {
  1325. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1326. return;
  1327. }
  1328. {
  1329. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1330. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1331. }
  1332. }
  1333. this.$vm = vm;
  1334. this.$vm.$mp = {
  1335. app: this };
  1336. this.$vm.$scope = this;
  1337. // vm 上也挂载 globalData
  1338. this.$vm.globalData = this.globalData;
  1339. this.$vm._isMounted = true;
  1340. this.$vm.__call_hook('mounted', args);
  1341. this.$vm.__call_hook('onLaunch', args);
  1342. } };
  1343. // 兼容旧版本 globalData
  1344. appOptions.globalData = vm.$options.globalData || {};
  1345. // 将 methods 中的方法挂在 getApp() 中
  1346. var methods = vm.$options.methods;
  1347. if (methods) {
  1348. Object.keys(methods).forEach(function (name) {
  1349. appOptions[name] = methods[name];
  1350. });
  1351. }
  1352. initAppLocale(_vue.default, vm, wx.getSystemInfoSync().language || 'zh-Hans');
  1353. initHooks(appOptions, hooks);
  1354. return appOptions;
  1355. }
  1356. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1357. function findVmByVueId(vm, vuePid) {
  1358. var $children = vm.$children;
  1359. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1360. for (var i = $children.length - 1; i >= 0; i--) {
  1361. var childVm = $children[i];
  1362. if (childVm.$scope._$vueId === vuePid) {
  1363. return childVm;
  1364. }
  1365. }
  1366. // 反向递归查找
  1367. var parentVm;
  1368. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1369. parentVm = findVmByVueId($children[_i], vuePid);
  1370. if (parentVm) {
  1371. return parentVm;
  1372. }
  1373. }
  1374. }
  1375. function initBehavior(options) {
  1376. return Behavior(options);
  1377. }
  1378. function isPage() {
  1379. return !!this.route;
  1380. }
  1381. function initRelation(detail) {
  1382. this.triggerEvent('__l', detail);
  1383. }
  1384. function selectAllComponents(mpInstance, selector, $refs) {
  1385. var components = mpInstance.selectAllComponents(selector);
  1386. components.forEach(function (component) {
  1387. var ref = component.dataset.ref;
  1388. $refs[ref] = component.$vm || component;
  1389. {
  1390. if (component.dataset.vueGeneric === 'scoped') {
  1391. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1392. selectAllComponents(scopedComponent, selector, $refs);
  1393. });
  1394. }
  1395. }
  1396. });
  1397. }
  1398. function initRefs(vm) {
  1399. var mpInstance = vm.$scope;
  1400. Object.defineProperty(vm, '$refs', {
  1401. get: function get() {
  1402. var $refs = {};
  1403. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1404. // TODO 暂不考虑 for 中的 scoped
  1405. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1406. forComponents.forEach(function (component) {
  1407. var ref = component.dataset.ref;
  1408. if (!$refs[ref]) {
  1409. $refs[ref] = [];
  1410. }
  1411. $refs[ref].push(component.$vm || component);
  1412. });
  1413. return $refs;
  1414. } });
  1415. }
  1416. function handleLink(event) {var _ref4 =
  1417. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1418. var parentVm;
  1419. if (vuePid) {
  1420. parentVm = findVmByVueId(this.$vm, vuePid);
  1421. }
  1422. if (!parentVm) {
  1423. parentVm = this.$vm;
  1424. }
  1425. vueOptions.parent = parentVm;
  1426. }
  1427. function parseApp(vm) {
  1428. return parseBaseApp(vm, {
  1429. mocks: mocks,
  1430. initRefs: initRefs });
  1431. }
  1432. function createApp(vm) {
  1433. App(parseApp(vm));
  1434. return vm;
  1435. }
  1436. var encodeReserveRE = /[!'()*]/g;
  1437. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1438. var commaRE = /%2C/g;
  1439. // fixed encodeURIComponent which is more conformant to RFC3986:
  1440. // - escapes [!'()*]
  1441. // - preserve commas
  1442. var encode = function encode(str) {return encodeURIComponent(str).
  1443. replace(encodeReserveRE, encodeReserveReplacer).
  1444. replace(commaRE, ',');};
  1445. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1446. var res = obj ? Object.keys(obj).map(function (key) {
  1447. var val = obj[key];
  1448. if (val === undefined) {
  1449. return '';
  1450. }
  1451. if (val === null) {
  1452. return encodeStr(key);
  1453. }
  1454. if (Array.isArray(val)) {
  1455. var result = [];
  1456. val.forEach(function (val2) {
  1457. if (val2 === undefined) {
  1458. return;
  1459. }
  1460. if (val2 === null) {
  1461. result.push(encodeStr(key));
  1462. } else {
  1463. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1464. }
  1465. });
  1466. return result.join('&');
  1467. }
  1468. return encodeStr(key) + '=' + encodeStr(val);
  1469. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1470. return res ? "?".concat(res) : '';
  1471. }
  1472. function parseBaseComponent(vueComponentOptions)
  1473. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1474. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1475. var options = _objectSpread({
  1476. multipleSlots: true,
  1477. addGlobalClass: true },
  1478. vueOptions.options || {});
  1479. {
  1480. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1481. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1482. Object.assign(options, vueOptions['mp-weixin'].options);
  1483. }
  1484. }
  1485. var componentOptions = {
  1486. options: options,
  1487. data: initData(vueOptions, _vue.default.prototype),
  1488. behaviors: initBehaviors(vueOptions, initBehavior),
  1489. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1490. lifetimes: {
  1491. attached: function attached() {
  1492. var properties = this.properties;
  1493. var options = {
  1494. mpType: isPage.call(this) ? 'page' : 'component',
  1495. mpInstance: this,
  1496. propsData: properties };
  1497. initVueIds(properties.vueId, this);
  1498. // 处理父子关系
  1499. initRelation.call(this, {
  1500. vuePid: this._$vuePid,
  1501. vueOptions: options });
  1502. // 初始化 vue 实例
  1503. this.$vm = new VueComponent(options);
  1504. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1505. initSlots(this.$vm, properties.vueSlots);
  1506. // 触发首次 setData
  1507. this.$vm.$mount();
  1508. },
  1509. ready: function ready() {
  1510. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1511. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1512. if (this.$vm) {
  1513. this.$vm._isMounted = true;
  1514. this.$vm.__call_hook('mounted');
  1515. this.$vm.__call_hook('onReady');
  1516. }
  1517. },
  1518. detached: function detached() {
  1519. this.$vm && this.$vm.$destroy();
  1520. } },
  1521. pageLifetimes: {
  1522. show: function show(args) {
  1523. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1524. },
  1525. hide: function hide() {
  1526. this.$vm && this.$vm.__call_hook('onPageHide');
  1527. },
  1528. resize: function resize(size) {
  1529. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1530. } },
  1531. methods: {
  1532. __l: handleLink,
  1533. __e: handleEvent } };
  1534. // externalClasses
  1535. if (vueOptions.externalClasses) {
  1536. componentOptions.externalClasses = vueOptions.externalClasses;
  1537. }
  1538. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1539. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1540. componentOptions.methods[callMethod] = function (args) {
  1541. return this.$vm[callMethod](args);
  1542. };
  1543. });
  1544. }
  1545. if (isPage) {
  1546. return componentOptions;
  1547. }
  1548. return [componentOptions, VueComponent];
  1549. }
  1550. function parseComponent(vueComponentOptions) {
  1551. return parseBaseComponent(vueComponentOptions, {
  1552. isPage: isPage,
  1553. initRelation: initRelation });
  1554. }
  1555. var hooks$1 = [
  1556. 'onShow',
  1557. 'onHide',
  1558. 'onUnload'];
  1559. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1560. function parseBasePage(vuePageOptions, _ref6)
  1561. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1562. var pageOptions = parseComponent(vuePageOptions);
  1563. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1564. pageOptions.methods.onLoad = function (query) {
  1565. this.options = query;
  1566. var copyQuery = Object.assign({}, query);
  1567. delete copyQuery.__id__;
  1568. this.$page = {
  1569. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1570. this.$vm.$mp.query = query; // 兼容 mpvue
  1571. this.$vm.__call_hook('onLoad', query);
  1572. };
  1573. return pageOptions;
  1574. }
  1575. function parsePage(vuePageOptions) {
  1576. return parseBasePage(vuePageOptions, {
  1577. isPage: isPage,
  1578. initRelation: initRelation });
  1579. }
  1580. function createPage(vuePageOptions) {
  1581. {
  1582. return Component(parsePage(vuePageOptions));
  1583. }
  1584. }
  1585. function createComponent(vueOptions) {
  1586. {
  1587. return Component(parseComponent(vueOptions));
  1588. }
  1589. }
  1590. function createSubpackageApp(vm) {
  1591. var appOptions = parseApp(vm);
  1592. var app = getApp({
  1593. allowDefault: true });
  1594. vm.$scope = app;
  1595. var globalData = app.globalData;
  1596. if (globalData) {
  1597. Object.keys(appOptions.globalData).forEach(function (name) {
  1598. if (!hasOwn(globalData, name)) {
  1599. globalData[name] = appOptions.globalData[name];
  1600. }
  1601. });
  1602. }
  1603. Object.keys(appOptions).forEach(function (name) {
  1604. if (!hasOwn(app, name)) {
  1605. app[name] = appOptions[name];
  1606. }
  1607. });
  1608. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1609. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1610. vm.__call_hook('onShow', args);
  1611. });
  1612. }
  1613. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1614. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1615. vm.__call_hook('onHide', args);
  1616. });
  1617. }
  1618. if (isFn(appOptions.onLaunch)) {
  1619. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1620. vm.__call_hook('onLaunch', args);
  1621. }
  1622. return vm;
  1623. }
  1624. function createPlugin(vm) {
  1625. var appOptions = parseApp(vm);
  1626. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1627. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1628. appOptions.onShow.apply(vm, args);
  1629. });
  1630. }
  1631. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1632. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1633. appOptions.onHide.apply(vm, args);
  1634. });
  1635. }
  1636. if (isFn(appOptions.onLaunch)) {
  1637. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1638. appOptions.onLaunch.call(vm, args);
  1639. }
  1640. return vm;
  1641. }
  1642. todos.forEach(function (todoApi) {
  1643. protocols[todoApi] = false;
  1644. });
  1645. canIUses.forEach(function (canIUseApi) {
  1646. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1647. canIUseApi;
  1648. if (!wx.canIUse(apiName)) {
  1649. protocols[canIUseApi] = false;
  1650. }
  1651. });
  1652. var uni = {};
  1653. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1654. uni = new Proxy({}, {
  1655. get: function get(target, name) {
  1656. if (hasOwn(target, name)) {
  1657. return target[name];
  1658. }
  1659. if (baseApi[name]) {
  1660. return baseApi[name];
  1661. }
  1662. if (api[name]) {
  1663. return promisify(name, api[name]);
  1664. }
  1665. {
  1666. if (extraApi[name]) {
  1667. return promisify(name, extraApi[name]);
  1668. }
  1669. if (todoApis[name]) {
  1670. return promisify(name, todoApis[name]);
  1671. }
  1672. }
  1673. if (eventApi[name]) {
  1674. return eventApi[name];
  1675. }
  1676. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1677. return;
  1678. }
  1679. return promisify(name, wrapper(name, wx[name]));
  1680. },
  1681. set: function set(target, name, value) {
  1682. target[name] = value;
  1683. return true;
  1684. } });
  1685. } else {
  1686. Object.keys(baseApi).forEach(function (name) {
  1687. uni[name] = baseApi[name];
  1688. });
  1689. {
  1690. Object.keys(todoApis).forEach(function (name) {
  1691. uni[name] = promisify(name, todoApis[name]);
  1692. });
  1693. Object.keys(extraApi).forEach(function (name) {
  1694. uni[name] = promisify(name, todoApis[name]);
  1695. });
  1696. }
  1697. Object.keys(eventApi).forEach(function (name) {
  1698. uni[name] = eventApi[name];
  1699. });
  1700. Object.keys(api).forEach(function (name) {
  1701. uni[name] = promisify(name, api[name]);
  1702. });
  1703. Object.keys(wx).forEach(function (name) {
  1704. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1705. uni[name] = promisify(name, wrapper(name, wx[name]));
  1706. }
  1707. });
  1708. }
  1709. wx.createApp = createApp;
  1710. wx.createPage = createPage;
  1711. wx.createComponent = createComponent;
  1712. wx.createSubpackageApp = createSubpackageApp;
  1713. wx.createPlugin = createPlugin;
  1714. var uni$1 = uni;var _default =
  1715. uni$1;exports.default = _default;
  1716. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2)))
  1717. /***/ }),
  1718. /***/ 11:
  1719. /*!**********************************************************************************************************!*\
  1720. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  1721. \**********************************************************************************************************/
  1722. /*! exports provided: default */
  1723. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1724. "use strict";
  1725. __webpack_require__.r(__webpack_exports__);
  1726. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  1727. /* globals __VUE_SSR_CONTEXT__ */
  1728. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  1729. // This module is a runtime utility for cleaner component module output and will
  1730. // be included in the final webpack user bundle.
  1731. function normalizeComponent (
  1732. scriptExports,
  1733. render,
  1734. staticRenderFns,
  1735. functionalTemplate,
  1736. injectStyles,
  1737. scopeId,
  1738. moduleIdentifier, /* server only */
  1739. shadowMode, /* vue-cli only */
  1740. components, // fixed by xxxxxx auto components
  1741. renderjs // fixed by xxxxxx renderjs
  1742. ) {
  1743. // Vue.extend constructor export interop
  1744. var options = typeof scriptExports === 'function'
  1745. ? scriptExports.options
  1746. : scriptExports
  1747. // fixed by xxxxxx auto components
  1748. if (components) {
  1749. if (!options.components) {
  1750. options.components = {}
  1751. }
  1752. var hasOwn = Object.prototype.hasOwnProperty
  1753. for (var name in components) {
  1754. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  1755. options.components[name] = components[name]
  1756. }
  1757. }
  1758. }
  1759. // fixed by xxxxxx renderjs
  1760. if (renderjs) {
  1761. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  1762. this[renderjs.__module] = this
  1763. });
  1764. (options.mixins || (options.mixins = [])).push(renderjs)
  1765. }
  1766. // render functions
  1767. if (render) {
  1768. options.render = render
  1769. options.staticRenderFns = staticRenderFns
  1770. options._compiled = true
  1771. }
  1772. // functional template
  1773. if (functionalTemplate) {
  1774. options.functional = true
  1775. }
  1776. // scopedId
  1777. if (scopeId) {
  1778. options._scopeId = 'data-v-' + scopeId
  1779. }
  1780. var hook
  1781. if (moduleIdentifier) { // server build
  1782. hook = function (context) {
  1783. // 2.3 injection
  1784. context =
  1785. context || // cached call
  1786. (this.$vnode && this.$vnode.ssrContext) || // stateful
  1787. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  1788. // 2.2 with runInNewContext: true
  1789. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  1790. context = __VUE_SSR_CONTEXT__
  1791. }
  1792. // inject component styles
  1793. if (injectStyles) {
  1794. injectStyles.call(this, context)
  1795. }
  1796. // register component module identifier for async chunk inferrence
  1797. if (context && context._registeredComponents) {
  1798. context._registeredComponents.add(moduleIdentifier)
  1799. }
  1800. }
  1801. // used by ssr in case component is cached and beforeCreate
  1802. // never gets called
  1803. options._ssrRegister = hook
  1804. } else if (injectStyles) {
  1805. hook = shadowMode
  1806. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  1807. : injectStyles
  1808. }
  1809. if (hook) {
  1810. if (options.functional) {
  1811. // for template-only hot-reload because in that case the render fn doesn't
  1812. // go through the normalizer
  1813. options._injectStyles = hook
  1814. // register for functioal component in vue file
  1815. var originalRender = options.render
  1816. options.render = function renderWithStyleInjection (h, context) {
  1817. hook.call(context)
  1818. return originalRender(h, context)
  1819. }
  1820. } else {
  1821. // inject component registration as beforeCreate hook
  1822. var existing = options.beforeCreate
  1823. options.beforeCreate = existing
  1824. ? [].concat(existing, hook)
  1825. : [hook]
  1826. }
  1827. }
  1828. return {
  1829. exports: scriptExports,
  1830. options: options
  1831. }
  1832. }
  1833. /***/ }),
  1834. /***/ 12:
  1835. /*!**************************************************!*\
  1836. !*** /Users/guo/Desktop/txCar/common/request.js ***!
  1837. \**************************************************/
  1838. /*! no static exports found */
  1839. /***/ (function(module, exports, __webpack_require__) {
  1840. "use strict";
  1841. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  1842. var _MD = _interopRequireDefault(__webpack_require__(/*! ./MD5.js */ 13));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}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;}var baseUrl = 'http://58.56.15.138:20201/';var burl2 = 'http://58.56.15.138:20201/'; //const baseUrl = 'http://58.56.15.138:20132/'
  1843. // const baseUrl = 'https://api.dms.66km.com/'
  1844. /* const http = (url = '', date = {}, type = 'POST', header = {
  1845. }) => {
  1846. return new Promise((resolve, reject) => {
  1847. console.log(burl2 + url)
  1848. //header['Content-Type']='application/x-www-form-urlencoded';
  1849. header['actionFromMiniApp']=1;
  1850. uni.request({
  1851. method: type,
  1852. url: burl2 + url,
  1853. data: date,
  1854. header: header,
  1855. dataType: 'json',
  1856. }).then((response) => {
  1857. setTimeout(function() {
  1858. uni.hideLoading();
  1859. }, 200);
  1860. let [error, res] = response;
  1861. if(res.data.code==403){
  1862. uni.showToast({
  1863. title: res.data.msg,
  1864. icon:'none',
  1865. duration: 3000,
  1866. });
  1867. uni.clearStorageSync()
  1868. uni.navigateTo({
  1869. url:'../login/login'
  1870. })
  1871. }else if(res.data.code==409){
  1872. getToken(url,date,type,header)
  1873. }
  1874. resolve(res.data);
  1875. }).catch(error => {
  1876. let [err, res] = error;
  1877. reject(err)
  1878. })
  1879. });
  1880. }
  1881. */
  1882. var http = function http()
  1883. {var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';var date = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'POST';var header = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
  1884. return new Promise(function (resolve, reject) {
  1885. console.log(burl2 + url);
  1886. header = {};
  1887. var logodata = uni.getStorageSync("logodata");
  1888. header['token'] = logodata.token;
  1889. header['uid'] = logodata.uid;
  1890. //header['token']='98A9FED8814B457288166BDF623F33D1';
  1891. //header['uid']='39415962-C9D3-466D-A73F-5B5429A8DB2A';
  1892. header['Content-Type'] = 'application/x-www-form-urlencoded';
  1893. //console.log(header)
  1894. uni.request({
  1895. method: type,
  1896. url: baseUrl + url,
  1897. data: date,
  1898. header: header,
  1899. dataType: 'json' }).
  1900. then(function (response) {
  1901. /* setTimeout(function() {
  1902. uni.hideLoading();
  1903. }, 200); */var _response = _slicedToArray(
  1904. response, 2),error = _response[0],res = _response[1];
  1905. if (res.data.code == 401 || res.data.code == 403) {
  1906. uni.showToast({
  1907. title: res.data.msg,
  1908. icon: 'none',
  1909. duration: 3000 });
  1910. uni.clearStorageSync();
  1911. uni.navigateTo({
  1912. url: '../login/login' });
  1913. } else if (res.data.code == 409) {
  1914. // getToken(url,date,type,header)
  1915. }
  1916. resolve(res.data);
  1917. }).catch(function (error) {var _error = _slicedToArray(
  1918. error, 2),err = _error[0],res = _error[1];
  1919. reject(err);
  1920. });
  1921. });
  1922. };
  1923. function getToken(url, date, type, header) {
  1924. var header = {};
  1925. //var userId=uni.getStorageSync("devData").userId;
  1926. //var devData=uni.getStorageSync("devData")
  1927. header['Content-Type'] = 'application/x-www-form-urlencoded';
  1928. uni.request({
  1929. method: "POST",
  1930. url: burl2 + '/sys/getTokenByUserID',
  1931. data: {
  1932. userId: userId },
  1933. header: header,
  1934. dataType: 'json' }).
  1935. then(function (response) {var _response2 = _slicedToArray(
  1936. response, 2),error = _response2[0],res = _response2[1];
  1937. var accessToken = res.data.data.accessToken.accessToken;
  1938. devData.accessToken = accessToken;
  1939. uni.setStorage({
  1940. key: 'devData',
  1941. data: devData,
  1942. success: function success() {
  1943. refresh(url, date, type, header); //刷新接口
  1944. } });
  1945. // console.log(accessToken)
  1946. }).catch(function (error) {
  1947. });
  1948. }
  1949. function refresh(url, date, type, header) {
  1950. uni.request({
  1951. method: type,
  1952. url: burl2 + url,
  1953. data: date,
  1954. header: header,
  1955. dataType: 'json' }).
  1956. then(function (response) {
  1957. setTimeout(function () {
  1958. uni.hideLoading();
  1959. }, 200);var _response3 = _slicedToArray(
  1960. response, 2),error = _response3[0],res = _response3[1];
  1961. if (res.data.code == 403) {
  1962. uni.showToast({
  1963. title: res.data.msg,
  1964. icon: 'none',
  1965. duration: 3000 });
  1966. uni.navigateTo({
  1967. url: '../login/login' });
  1968. }
  1969. resolve(res.data);
  1970. }).catch(function (error) {var _error2 = _slicedToArray(
  1971. error, 2),err = _error2[0],res = _error2[1];
  1972. reject(err);
  1973. });
  1974. }var _default =
  1975. {
  1976. http: http, baseUrl: baseUrl };exports.default = _default;
  1977. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  1978. /***/ }),
  1979. /***/ 13:
  1980. /*!**********************************************!*\
  1981. !*** /Users/guo/Desktop/txCar/common/MD5.js ***!
  1982. \**********************************************/
  1983. /*! no static exports found */
  1984. /***/ (function(module, exports, __webpack_require__) {
  1985. "use strict";
  1986. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function md5(string) {
  1987. var x = Array();
  1988. var k, AA, BB, CC, DD, a, b, c, d;
  1989. var S11 = 7,S12 = 12,S13 = 17,S14 = 22;
  1990. var S21 = 5,S22 = 9,S23 = 14,S24 = 20;
  1991. var S31 = 4,S32 = 11,S33 = 16,S34 = 23;
  1992. var S41 = 6,S42 = 10,S43 = 15,S44 = 21;
  1993. string = Utf8Encode(string);
  1994. x = ConvertToWordArray(string);
  1995. a = 0x67452301;
  1996. b = 0xEFCDAB89;
  1997. c = 0x98BADCFE;
  1998. d = 0x10325476;
  1999. for (k = 0; k < x.length; k += 16) {
  2000. AA = a;
  2001. BB = b;
  2002. CC = c;
  2003. DD = d;
  2004. a = FF(a, b, c, d, x[k + 0], S11, 0xD76AA478);
  2005. d = FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
  2006. c = FF(c, d, a, b, x[k + 2], S13, 0x242070DB);
  2007. b = FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
  2008. a = FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
  2009. d = FF(d, a, b, c, x[k + 5], S12, 0x4787C62A);
  2010. c = FF(c, d, a, b, x[k + 6], S13, 0xA8304613);
  2011. b = FF(b, c, d, a, x[k + 7], S14, 0xFD469501);
  2012. a = FF(a, b, c, d, x[k + 8], S11, 0x698098D8);
  2013. d = FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
  2014. c = FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
  2015. b = FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
  2016. a = FF(a, b, c, d, x[k + 12], S11, 0x6B901122);
  2017. d = FF(d, a, b, c, x[k + 13], S12, 0xFD987193);
  2018. c = FF(c, d, a, b, x[k + 14], S13, 0xA679438E);
  2019. b = FF(b, c, d, a, x[k + 15], S14, 0x49B40821);
  2020. a = GG(a, b, c, d, x[k + 1], S21, 0xF61E2562);
  2021. d = GG(d, a, b, c, x[k + 6], S22, 0xC040B340);
  2022. c = GG(c, d, a, b, x[k + 11], S23, 0x265E5A51);
  2023. b = GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
  2024. a = GG(a, b, c, d, x[k + 5], S21, 0xD62F105D);
  2025. d = GG(d, a, b, c, x[k + 10], S22, 0x2441453);
  2026. c = GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
  2027. b = GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8);
  2028. a = GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6);
  2029. d = GG(d, a, b, c, x[k + 14], S22, 0xC33707D6);
  2030. c = GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87);
  2031. b = GG(b, c, d, a, x[k + 8], S24, 0x455A14ED);
  2032. a = GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905);
  2033. d = GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8);
  2034. c = GG(c, d, a, b, x[k + 7], S23, 0x676F02D9);
  2035. b = GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A);
  2036. a = HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942);
  2037. d = HH(d, a, b, c, x[k + 8], S32, 0x8771F681);
  2038. c = HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122);
  2039. b = HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C);
  2040. a = HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44);
  2041. d = HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9);
  2042. c = HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60);
  2043. b = HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70);
  2044. a = HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6);
  2045. d = HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA);
  2046. c = HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085);
  2047. b = HH(b, c, d, a, x[k + 6], S34, 0x4881D05);
  2048. a = HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039);
  2049. d = HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5);
  2050. c = HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8);
  2051. b = HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665);
  2052. a = II(a, b, c, d, x[k + 0], S41, 0xF4292244);
  2053. d = II(d, a, b, c, x[k + 7], S42, 0x432AFF97);
  2054. c = II(c, d, a, b, x[k + 14], S43, 0xAB9423A7);
  2055. b = II(b, c, d, a, x[k + 5], S44, 0xFC93A039);
  2056. a = II(a, b, c, d, x[k + 12], S41, 0x655B59C3);
  2057. d = II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92);
  2058. c = II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D);
  2059. b = II(b, c, d, a, x[k + 1], S44, 0x85845DD1);
  2060. a = II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F);
  2061. d = II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0);
  2062. c = II(c, d, a, b, x[k + 6], S43, 0xA3014314);
  2063. b = II(b, c, d, a, x[k + 13], S44, 0x4E0811A1);
  2064. a = II(a, b, c, d, x[k + 4], S41, 0xF7537E82);
  2065. d = II(d, a, b, c, x[k + 11], S42, 0xBD3AF235);
  2066. c = II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB);
  2067. b = II(b, c, d, a, x[k + 9], S44, 0xEB86D391);
  2068. a = AddUnsigned(a, AA);
  2069. b = AddUnsigned(b, BB);
  2070. c = AddUnsigned(c, CC);
  2071. d = AddUnsigned(d, DD);
  2072. }
  2073. var temp = WordToHex(a) + WordToHex(b) + WordToHex(c) + WordToHex(d);
  2074. return temp.toUpperCase();
  2075. }
  2076. function RotateLeft(lValue, iShiftBits) {
  2077. return lValue << iShiftBits | lValue >>> 32 - iShiftBits;
  2078. }
  2079. function AddUnsigned(lX, lY) {
  2080. var lX4, lY4, lX8, lY8, lResult;
  2081. lX8 = lX & 0x80000000;
  2082. lY8 = lY & 0x80000000;
  2083. lX4 = lX & 0x40000000;
  2084. lY4 = lY & 0x40000000;
  2085. lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
  2086. if (lX4 & lY4) {
  2087. return lResult ^ 0x80000000 ^ lX8 ^ lY8;
  2088. }
  2089. if (lX4 | lY4) {
  2090. if (lResult & 0x40000000) {
  2091. return lResult ^ 0xC0000000 ^ lX8 ^ lY8;
  2092. } else {
  2093. return lResult ^ 0x40000000 ^ lX8 ^ lY8;
  2094. }
  2095. } else {
  2096. return lResult ^ lX8 ^ lY8;
  2097. }
  2098. }
  2099. function F(x, y, z) {
  2100. return x & y | ~x & z;
  2101. }
  2102. function G(x, y, z) {
  2103. return x & z | y & ~z;
  2104. }
  2105. function H(x, y, z) {
  2106. return x ^ y ^ z;
  2107. }
  2108. function I(x, y, z) {
  2109. return y ^ (x | ~z);
  2110. }
  2111. function FF(a, b, c, d, x, s, ac) {
  2112. a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac));
  2113. return AddUnsigned(RotateLeft(a, s), b);
  2114. }
  2115. function GG(a, b, c, d, x, s, ac) {
  2116. a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac));
  2117. return AddUnsigned(RotateLeft(a, s), b);
  2118. }
  2119. function HH(a, b, c, d, x, s, ac) {
  2120. a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac));
  2121. return AddUnsigned(RotateLeft(a, s), b);
  2122. }
  2123. function II(a, b, c, d, x, s, ac) {
  2124. a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac));
  2125. return AddUnsigned(RotateLeft(a, s), b);
  2126. }
  2127. function ConvertToWordArray(string) {
  2128. var lWordCount;
  2129. var lMessageLength = string.length;
  2130. var lNumberOfWords_temp1 = lMessageLength + 8;
  2131. var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - lNumberOfWords_temp1 % 64) / 64;
  2132. var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16;
  2133. var lWordArray = Array(lNumberOfWords - 1);
  2134. var lBytePosition = 0;
  2135. var lByteCount = 0;
  2136. while (lByteCount < lMessageLength) {
  2137. lWordCount = (lByteCount - lByteCount % 4) / 4;
  2138. lBytePosition = lByteCount % 4 * 8;
  2139. lWordArray[lWordCount] = lWordArray[lWordCount] | string.charCodeAt(lByteCount) << lBytePosition;
  2140. lByteCount++;
  2141. }
  2142. lWordCount = (lByteCount - lByteCount % 4) / 4;
  2143. lBytePosition = lByteCount % 4 * 8;
  2144. lWordArray[lWordCount] = lWordArray[lWordCount] | 0x80 << lBytePosition;
  2145. lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
  2146. lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
  2147. return lWordArray;
  2148. }
  2149. function WordToHex(lValue) {
  2150. var WordToHexValue = "",WordToHexValue_temp = "",lByte,lCount;
  2151. for (lCount = 0; lCount <= 3; lCount++) {
  2152. lByte = lValue >>> lCount * 8 & 255;
  2153. WordToHexValue_temp = "0" + lByte.toString(16);
  2154. WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2);
  2155. }
  2156. return WordToHexValue;
  2157. }
  2158. function Utf8Encode(string) {
  2159. var utftext = "";
  2160. for (var n = 0; n < string.length; n++) {
  2161. var c = string.charCodeAt(n);
  2162. if (c < 128) {
  2163. utftext += String.fromCharCode(c);
  2164. } else if (c > 127 && c < 2048) {
  2165. utftext += String.fromCharCode(c >> 6 | 192);
  2166. utftext += String.fromCharCode(c & 63 | 128);
  2167. } else {
  2168. utftext += String.fromCharCode(c >> 12 | 224);
  2169. utftext += String.fromCharCode(c >> 6 & 63 | 128);
  2170. utftext += String.fromCharCode(c & 63 | 128);
  2171. }
  2172. }
  2173. return utftext;
  2174. }var _default =
  2175. {
  2176. md5: md5 };exports.default = _default;
  2177. /***/ }),
  2178. /***/ 14:
  2179. /*!*************************************************!*\
  2180. !*** /Users/guo/Desktop/txCar/common/common.js ***!
  2181. \*************************************************/
  2182. /*! no static exports found */
  2183. /***/ (function(module, exports, __webpack_require__) {
  2184. "use strict";
  2185. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  2186. var isUserId = function isUserId() {
  2187. var userId = uni.getStorageSync("logodata").uid;
  2188. //console.log("userId---"+userId)
  2189. if (!userId) {
  2190. uni.navigateTo({
  2191. url: '../login/login' });
  2192. }
  2193. };
  2194. /* const uid =function() {
  2195. var userId=uni.getStorageSync("logodata").uid;
  2196. return
  2197. } */var _default =
  2198. {
  2199. commonData: {
  2200. companyType: 1 },
  2201. isUserId: isUserId };exports.default = _default;
  2202. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  2203. /***/ }),
  2204. /***/ 2:
  2205. /*!***********************************!*\
  2206. !*** (webpack)/buildin/global.js ***!
  2207. \***********************************/
  2208. /*! no static exports found */
  2209. /***/ (function(module, exports) {
  2210. var g;
  2211. // This works in non-strict mode
  2212. g = (function() {
  2213. return this;
  2214. })();
  2215. try {
  2216. // This works if eval is allowed (see CSP)
  2217. g = g || new Function("return this")();
  2218. } catch (e) {
  2219. // This works if the window reference is available
  2220. if (typeof window === "object") g = window;
  2221. }
  2222. // g can still be undefined, but nothing to do about it...
  2223. // We return undefined, instead of nothing here, so it's
  2224. // easier to handle this case. if(!global) { ...}
  2225. module.exports = g;
  2226. /***/ }),
  2227. /***/ 244:
  2228. /*!**********************************************************!*\
  2229. !*** /Users/guo/Desktop/txCar/static/dataJson/city.json ***!
  2230. \**********************************************************/
  2231. /*! exports provided: data, statistics, code, message, messageType, default */
  2232. /***/ (function(module) {
  2233. module.exports = JSON.parse("{\"data\":{\"list\":[{\"citycode\":513200,\"name\":\"阿坝\",\"pinyin\":\"AB\",\"ishot\":false},{\"citycode\":610900,\"name\":\"安康\",\"pinyin\":\"AK\",\"ishot\":false},{\"citycode\":652901,\"name\":\"阿克苏\",\"pinyin\":\"AKS\",\"ishot\":false},{\"citycode\":152900,\"name\":\"阿拉善\",\"pinyin\":\"ALS\",\"ishot\":false},{\"citycode\":340800,\"name\":\"安庆\",\"pinyin\":\"AQ\",\"ishot\":false},{\"citycode\":520400,\"name\":\"安顺\",\"pinyin\":\"AS\",\"ishot\":false},{\"citycode\":210300,\"name\":\"鞍山\",\"pinyin\":\"AS\",\"ishot\":false},{\"citycode\":410500,\"name\":\"安阳\",\"pinyin\":\"AY\",\"ishot\":false},{\"citycode\":340300,\"name\":\"蚌埠\",\"pinyin\":\"BB\",\"ishot\":false},{\"citycode\":220800,\"name\":\"白城\",\"pinyin\":\"BC\",\"ishot\":false},{\"citycode\":130600,\"name\":\"保定\",\"pinyin\":\"BD\",\"ishot\":false},{\"citycode\":450500,\"name\":\"北海\",\"pinyin\":\"BH\",\"ishot\":false},{\"citycode\":110100,\"name\":\"北京\",\"pinyin\":\"BJ\",\"ishot\":true},{\"citycode\":610300,\"name\":\"宝鸡\",\"pinyin\":\"BJ\",\"ishot\":false},{\"citycode\":522401,\"name\":\"毕节\",\"pinyin\":\"BJ\",\"ishot\":false},{\"citycode\":451000,\"name\":\"百色\",\"pinyin\":\"BS\",\"ishot\":false},{\"citycode\":220600,\"name\":\"白山\",\"pinyin\":\"BS\",\"ishot\":false},{\"citycode\":530500,\"name\":\"保山\",\"pinyin\":\"BS\",\"ishot\":false},{\"citycode\":150200,\"name\":\"包头\",\"pinyin\":\"BT\",\"ishot\":false},{\"citycode\":210500,\"name\":\"本溪\",\"pinyin\":\"BX\",\"ishot\":false},{\"citycode\":620400,\"name\":\"白银\",\"pinyin\":\"BY\",\"ishot\":false},{\"citycode\":652800,\"name\":\"巴音郭楞\",\"pinyin\":\"BYGL\",\"ishot\":false},{\"citycode\":150800,\"name\":\"巴彦淖尔\",\"pinyin\":\"BYNE\",\"ishot\":false},{\"citycode\":371600,\"name\":\"滨州\",\"pinyin\":\"BZ\",\"ishot\":false},{\"citycode\":511900,\"name\":\"巴中\",\"pinyin\":\"BZ\",\"ishot\":false},{\"citycode\":341600,\"name\":\"亳州\",\"pinyin\":\"BZ\",\"ishot\":false},{\"citycode\":220100,\"name\":\"长春\",\"pinyin\":\"CC\",\"ishot\":false},{\"citycode\":510100,\"name\":\"成都\",\"pinyin\":\"CD\",\"ishot\":true},{\"citycode\":130800,\"name\":\"承德\",\"pinyin\":\"CD\",\"ishot\":false},{\"citycode\":430700,\"name\":\"常德\",\"pinyin\":\"CD\",\"ishot\":false},{\"citycode\":150400,\"name\":\"赤峰\",\"pinyin\":\"CF\",\"ishot\":false},{\"citycode\":652301,\"name\":\"昌吉\",\"pinyin\":\"CJ\",\"ishot\":false},{\"citycode\":360202,\"name\":\"昌江\",\"pinyin\":\"CJ\",\"ishot\":false},{\"citycode\":469023,\"name\":\"澄迈县\",\"pinyin\":\"CMX\",\"ishot\":false},{\"citycode\":500100,\"name\":\"重庆\",\"pinyin\":\"CQ\",\"ishot\":true},{\"citycode\":430100,\"name\":\"长沙\",\"pinyin\":\"CS\",\"ishot\":false},{\"citycode\":532301,\"name\":\"楚雄\",\"pinyin\":\"CX\",\"ishot\":false},{\"citycode\":211300,\"name\":\"朝阳\",\"pinyin\":\"CY\",\"ishot\":false},{\"citycode\":341700,\"name\":\"池州\",\"pinyin\":\"CZ\",\"ishot\":false},{\"citycode\":341100,\"name\":\"滁州\",\"pinyin\":\"CZ\",\"ishot\":false},{\"citycode\":130900,\"name\":\"沧州\",\"pinyin\":\"CZ\",\"ishot\":false},{\"citycode\":431000,\"name\":\"郴州\",\"pinyin\":\"CZ\",\"ishot\":false},{\"citycode\":320400,\"name\":\"常州\",\"pinyin\":\"CZ\",\"ishot\":false},{\"citycode\":445100,\"name\":\"潮州\",\"pinyin\":\"CZ\",\"ishot\":false},{\"citycode\":451400,\"name\":\"崇左\",\"pinyin\":\"CZ\",\"ishot\":false},{\"citycode\":210600,\"name\":\"丹东\",\"pinyin\":\"DD\",\"ishot\":false},{\"citycode\":469007,\"name\":\"东方\",\"pinyin\":\"DF\",\"ishot\":false},{\"citycode\":441900,\"name\":\"东莞\",\"pinyin\":\"DG\",\"ishot\":false},{\"citycode\":533100,\"name\":\"德宏\",\"pinyin\":\"DH\",\"ishot\":false},{\"citycode\":210200,\"name\":\"大连\",\"pinyin\":\"DL\",\"ishot\":false},{\"citycode\":532901,\"name\":\"大理\",\"pinyin\":\"DL\",\"ishot\":false},{\"citycode\":230600,\"name\":\"大庆\",\"pinyin\":\"DQ\",\"ishot\":false},{\"citycode\":140200,\"name\":\"大同\",\"pinyin\":\"DT\",\"ishot\":false},{\"citycode\":621100,\"name\":\"定西\",\"pinyin\":\"DX\",\"ishot\":false},{\"citycode\":232700,\"name\":\"大兴安岭\",\"pinyin\":\"DXAL\",\"ishot\":false},{\"citycode\":370500,\"name\":\"东营\",\"pinyin\":\"DY\",\"ishot\":false},{\"citycode\":510600,\"name\":\"德阳\",\"pinyin\":\"DY\",\"ishot\":false},{\"citycode\":371400,\"name\":\"德州\",\"pinyin\":\"DZ\",\"ishot\":false},{\"citycode\":511700,\"name\":\"达州\",\"pinyin\":\"DZ\",\"ishot\":false},{\"citycode\":469003,\"name\":\"儋州\",\"pinyin\":\"DZ\",\"ishot\":false},{\"citycode\":150600,\"name\":\"鄂尔多斯\",\"pinyin\":\"EEDS\",\"ishot\":false},{\"citycode\":422800,\"name\":\"恩施\",\"pinyin\":\"ES\",\"ishot\":false},{\"citycode\":420700,\"name\":\"鄂州\",\"pinyin\":\"EZ\",\"ishot\":false},{\"citycode\":450600,\"name\":\"防城港\",\"pinyin\":\"FCG\",\"ishot\":false},{\"citycode\":440600,\"name\":\"佛山\",\"pinyin\":\"FS\",\"ishot\":false},{\"citycode\":210400,\"name\":\"抚顺\",\"pinyin\":\"FS\",\"ishot\":false},{\"citycode\":210900,\"name\":\"阜新\",\"pinyin\":\"FX\",\"ishot\":false},{\"citycode\":341200,\"name\":\"阜阳\",\"pinyin\":\"FY\",\"ishot\":false},{\"citycode\":350100,\"name\":\"福州\",\"pinyin\":\"FZ\",\"ishot\":false},{\"citycode\":361000,\"name\":\"抚州\",\"pinyin\":\"FZ\",\"ishot\":false},{\"citycode\":511600,\"name\":\"广安\",\"pinyin\":\"GA\",\"ishot\":false},{\"citycode\":450800,\"name\":\"贵港\",\"pinyin\":\"GG\",\"ishot\":false},{\"citycode\":450300,\"name\":\"桂林\",\"pinyin\":\"GL\",\"ishot\":false},{\"citycode\":623000,\"name\":\"甘南\",\"pinyin\":\"GN\",\"ishot\":false},{\"citycode\":520100,\"name\":\"贵阳\",\"pinyin\":\"GY\",\"ishot\":false},{\"citycode\":640400,\"name\":\"固原\",\"pinyin\":\"GY\",\"ishot\":false},{\"citycode\":510800,\"name\":\"广元\",\"pinyin\":\"GY\",\"ishot\":false},{\"citycode\":440100,\"name\":\"广州\",\"pinyin\":\"GZ\",\"ishot\":true},{\"citycode\":360700,\"name\":\"赣州\",\"pinyin\":\"GZ\",\"ishot\":false},{\"citycode\":513300,\"name\":\"甘孜\",\"pinyin\":\"GZ\",\"ishot\":false},{\"citycode\":320800,\"name\":\"淮安\",\"pinyin\":\"HA\",\"ishot\":false},{\"citycode\":410600,\"name\":\"鹤壁\",\"pinyin\":\"HB\",\"ishot\":false},{\"citycode\":340600,\"name\":\"淮北\",\"pinyin\":\"HB\",\"ishot\":false},{\"citycode\":451200,\"name\":\"河池\",\"pinyin\":\"HC\",\"ishot\":false},{\"citycode\":130400,\"name\":\"邯郸\",\"pinyin\":\"HD\",\"ishot\":false},{\"citycode\":630200,\"name\":\"海东\",\"pinyin\":\"HD\",\"ishot\":false},{\"citycode\":230100,\"name\":\"哈尔滨\",\"pinyin\":\"HEB\",\"ishot\":false},{\"citycode\":340100,\"name\":\"合肥\",\"pinyin\":\"HF\",\"ishot\":false},{\"citycode\":421100,\"name\":\"黄冈\",\"pinyin\":\"HG\",\"ishot\":false},{\"citycode\":230400,\"name\":\"鹤岗\",\"pinyin\":\"HG\",\"ishot\":false},{\"citycode\":431200,\"name\":\"怀化\",\"pinyin\":\"HH\",\"ishot\":false},{\"citycode\":532500,\"name\":\"红河\",\"pinyin\":\"HH\",\"ishot\":false},{\"citycode\":231100,\"name\":\"黑河\",\"pinyin\":\"HH\",\"ishot\":false},{\"citycode\":150100,\"name\":\"呼和浩特\",\"pinyin\":\"HHHT\",\"ishot\":false},{\"citycode\":460100,\"name\":\"海口\",\"pinyin\":\"HK\",\"ishot\":false},{\"citycode\":150700,\"name\":\"呼伦贝尔\",\"pinyin\":\"HLBE\",\"ishot\":false},{\"citycode\":211400,\"name\":\"葫芦岛\",\"pinyin\":\"HLD\",\"ishot\":false},{\"citycode\":652200,\"name\":\"哈密\",\"pinyin\":\"HM\",\"ishot\":false},{\"citycode\":340400,\"name\":\"淮南\",\"pinyin\":\"HN\",\"ishot\":false},{\"citycode\":632500,\"name\":\"海南州\",\"pinyin\":\"HNZ\",\"ishot\":false},{\"citycode\":341000,\"name\":\"黄山\",\"pinyin\":\"HS\",\"ishot\":false},{\"citycode\":420200,\"name\":\"黄石\",\"pinyin\":\"HS\",\"ishot\":false},{\"citycode\":131100,\"name\":\"衡水\",\"pinyin\":\"HS\",\"ishot\":false},{\"citycode\":653200,\"name\":\"和田\",\"pinyin\":\"HT\",\"ishot\":false},{\"citycode\":632800,\"name\":\"海西\",\"pinyin\":\"HX\",\"ishot\":false},{\"citycode\":441600,\"name\":\"河源\",\"pinyin\":\"HY\",\"ishot\":false},{\"citycode\":430400,\"name\":\"衡阳\",\"pinyin\":\"HY\",\"ishot\":false},{\"citycode\":330100,\"name\":\"杭州\",\"pinyin\":\"HZ\",\"ishot\":true},{\"citycode\":441300,\"name\":\"惠州\",\"pinyin\":\"HZ\",\"ishot\":false},{\"citycode\":330500,\"name\":\"湖州\",\"pinyin\":\"HZ\",\"ishot\":false},{\"citycode\":451100,\"name\":\"贺州\",\"pinyin\":\"HZ\",\"ishot\":false},{\"citycode\":371700,\"name\":\"菏泽\",\"pinyin\":\"HZ\",\"ishot\":false},{\"citycode\":610700,\"name\":\"汉中\",\"pinyin\":\"HZ\",\"ishot\":false},{\"citycode\":360800,\"name\":\"吉安\",\"pinyin\":\"JA\",\"ishot\":false},{\"citycode\":140500,\"name\":\"晋城\",\"pinyin\":\"JC\",\"ishot\":false},{\"citycode\":620300,\"name\":\"金昌\",\"pinyin\":\"JC\",\"ishot\":false},{\"citycode\":360200,\"name\":\"景德镇\",\"pinyin\":\"JDZ\",\"ishot\":false},{\"citycode\":330700,\"name\":\"金华\",\"pinyin\":\"JH\",\"ishot\":false},{\"citycode\":360400,\"name\":\"九江\",\"pinyin\":\"JJ\",\"ishot\":false},{\"citycode\":220200,\"name\":\"吉林\",\"pinyin\":\"JL\",\"ishot\":false},{\"citycode\":440700,\"name\":\"江门\",\"pinyin\":\"JM\",\"ishot\":false},{\"citycode\":420800,\"name\":\"荆门\",\"pinyin\":\"JM\",\"ishot\":false},{\"citycode\":230800,\"name\":\"佳木斯\",\"pinyin\":\"JMS\",\"ishot\":false},{\"citycode\":370100,\"name\":\"济南\",\"pinyin\":\"JN\",\"ishot\":false},{\"citycode\":370800,\"name\":\"济宁\",\"pinyin\":\"JN\",\"ishot\":false},{\"citycode\":620900,\"name\":\"酒泉\",\"pinyin\":\"JQ\",\"ishot\":false},{\"citycode\":330400,\"name\":\"嘉兴\",\"pinyin\":\"JX\",\"ishot\":false},{\"citycode\":230300,\"name\":\"鸡西\",\"pinyin\":\"JX\",\"ishot\":false},{\"citycode\":445200,\"name\":\"揭阳\",\"pinyin\":\"JY\",\"ishot\":false},{\"citycode\":410881,\"name\":\"济源\",\"pinyin\":\"JY\",\"ishot\":false},{\"citycode\":620200,\"name\":\"嘉峪关\",\"pinyin\":\"JYG\",\"ishot\":false},{\"citycode\":410800,\"name\":\"焦作\",\"pinyin\":\"JZ\",\"ishot\":false},{\"citycode\":421000,\"name\":\"荆州\",\"pinyin\":\"JZ\",\"ishot\":false},{\"citycode\":210700,\"name\":\"锦州\",\"pinyin\":\"JZ\",\"ishot\":false},{\"citycode\":140700,\"name\":\"晋中\",\"pinyin\":\"JZ\",\"ishot\":false},{\"citycode\":410200,\"name\":\"开封\",\"pinyin\":\"KF\",\"ishot\":false},{\"citycode\":650200,\"name\":\"克拉玛依\",\"pinyin\":\"KLMY\",\"ishot\":false},{\"citycode\":530100,\"name\":\"昆明\",\"pinyin\":\"KM\",\"ishot\":false},{\"citycode\":653000,\"name\":\"克孜勒苏柯尔克孜\",\"pinyin\":\"KZLSKEKZ\",\"ishot\":false},{\"citycode\":341500,\"name\":\"六安\",\"pinyin\":\"LA\",\"ishot\":false},{\"citycode\":451300,\"name\":\"来宾\",\"pinyin\":\"LB\",\"ishot\":false},{\"citycode\":371500,\"name\":\"聊城\",\"pinyin\":\"LC\",\"ishot\":false},{\"citycode\":530900,\"name\":\"临沧\",\"pinyin\":\"LC\",\"ishot\":false},{\"citycode\":431300,\"name\":\"娄底\",\"pinyin\":\"LD\",\"ishot\":false},{\"citycode\":131000,\"name\":\"廊坊\",\"pinyin\":\"LF\",\"ishot\":false},{\"citycode\":141000,\"name\":\"临汾\",\"pinyin\":\"LF\",\"ishot\":false},{\"citycode\":469024,\"name\":\"临高\",\"pinyin\":\"LG\",\"ishot\":false},{\"citycode\":411100,\"name\":\"漯河\",\"pinyin\":\"LH\",\"ishot\":false},{\"citycode\":530700,\"name\":\"丽江\",\"pinyin\":\"LJ\",\"ishot\":false},{\"citycode\":141100,\"name\":\"吕梁\",\"pinyin\":\"LL\",\"ishot\":false},{\"citycode\":621200,\"name\":\"陇南\",\"pinyin\":\"LN\",\"ishot\":false},{\"citycode\":520200,\"name\":\"六盘水\",\"pinyin\":\"LPS\",\"ishot\":false},{\"citycode\":511100,\"name\":\"乐山\",\"pinyin\":\"LS\",\"ishot\":false},{\"citycode\":540100,\"name\":\"拉萨\",\"pinyin\":\"LS\",\"ishot\":false},{\"citycode\":331100,\"name\":\"丽水\",\"pinyin\":\"LS\",\"ishot\":false},{\"citycode\":513400,\"name\":\"凉山\",\"pinyin\":\"LS\",\"ishot\":false},{\"citycode\":469028,\"name\":\"陵水\",\"pinyin\":\"LS\",\"ishot\":false},{\"citycode\":622900,\"name\":\"临夏\",\"pinyin\":\"LX\",\"ishot\":false},{\"citycode\":350800,\"name\":\"龙岩\",\"pinyin\":\"LY\",\"ishot\":false},{\"citycode\":410300,\"name\":\"洛阳\",\"pinyin\":\"LY\",\"ishot\":false},{\"citycode\":220400,\"name\":\"辽源\",\"pinyin\":\"LY\",\"ishot\":false},{\"citycode\":371300,\"name\":\"临沂\",\"pinyin\":\"LY\",\"ishot\":false},{\"citycode\":211000,\"name\":\"辽阳\",\"pinyin\":\"LY\",\"ishot\":false},{\"citycode\":320700,\"name\":\"连云港\",\"pinyin\":\"LYG\",\"ishot\":false},{\"citycode\":620100,\"name\":\"兰州\",\"pinyin\":\"LZ\",\"ishot\":false},{\"citycode\":450200,\"name\":\"柳州\",\"pinyin\":\"LZ\",\"ishot\":false},{\"citycode\":510500,\"name\":\"泸州\",\"pinyin\":\"LZ\",\"ishot\":false},{\"citycode\":542600,\"name\":\"林芝\",\"pinyin\":\"LZ\",\"ishot\":false},{\"citycode\":340500,\"name\":\"马鞍山\",\"pinyin\":\"MAS\",\"ishot\":false},{\"citycode\":231000,\"name\":\"牡丹江\",\"pinyin\":\"MDJ\",\"ishot\":false},{\"citycode\":440900,\"name\":\"茂名\",\"pinyin\":\"MM\",\"ishot\":false},{\"citycode\":511400,\"name\":\"眉山\",\"pinyin\":\"MS\",\"ishot\":false},{\"citycode\":510700,\"name\":\"绵阳\",\"pinyin\":\"MY\",\"ishot\":false},{\"citycode\":441400,\"name\":\"梅州\",\"pinyin\":\"MZ\",\"ishot\":false},{\"citycode\":330200,\"name\":\"宁波\",\"pinyin\":\"NB\",\"ishot\":false},{\"citycode\":360100,\"name\":\"南昌\",\"pinyin\":\"NC\",\"ishot\":false},{\"citycode\":511300,\"name\":\"南充\",\"pinyin\":\"NC\",\"ishot\":false},{\"citycode\":350900,\"name\":\"宁德\",\"pinyin\":\"ND\",\"ishot\":false},{\"citycode\":320100,\"name\":\"南京\",\"pinyin\":\"NJ\",\"ishot\":true},{\"citycode\":511000,\"name\":\"内江\",\"pinyin\":\"NJ\",\"ishot\":false},{\"citycode\":533300,\"name\":\"怒江\",\"pinyin\":\"NJ\",\"ishot\":false},{\"citycode\":450100,\"name\":\"南宁\",\"pinyin\":\"NN\",\"ishot\":false},{\"citycode\":350700,\"name\":\"南平\",\"pinyin\":\"NP\",\"ishot\":false},{\"citycode\":320600,\"name\":\"南通\",\"pinyin\":\"NT\",\"ishot\":false},{\"citycode\":411300,\"name\":\"南阳\",\"pinyin\":\"NY\",\"ishot\":false},{\"citycode\":410400,\"name\":\"平顶山\",\"pinyin\":\"PDS\",\"ishot\":false},{\"citycode\":530800,\"name\":\"普洱\",\"pinyin\":\"PE\",\"ishot\":false},{\"citycode\":211100,\"name\":\"盘锦\",\"pinyin\":\"PJ\",\"ishot\":false},{\"citycode\":620800,\"name\":\"平凉\",\"pinyin\":\"PL\",\"ishot\":false},{\"citycode\":350300,\"name\":\"莆田\",\"pinyin\":\"PT\",\"ishot\":false},{\"citycode\":360300,\"name\":\"萍乡\",\"pinyin\":\"PX\",\"ishot\":false},{\"citycode\":410900,\"name\":\"濮阳\",\"pinyin\":\"PY\",\"ishot\":false},{\"citycode\":510400,\"name\":\"攀枝花\",\"pinyin\":\"PZH\",\"ishot\":false},{\"citycode\":370200,\"name\":\"青岛\",\"pinyin\":\"QD\",\"ishot\":false},{\"citycode\":522600,\"name\":\"黔东南\",\"pinyin\":\"QDN\",\"ishot\":false},{\"citycode\":469002,\"name\":\"琼海\",\"pinyin\":\"QH\",\"ishot\":false},{\"citycode\":130300,\"name\":\"秦皇岛\",\"pinyin\":\"QHD\",\"ishot\":false},{\"citycode\":530300,\"name\":\"曲靖\",\"pinyin\":\"QJ\",\"ishot\":false},{\"citycode\":429005,\"name\":\"潜江\",\"pinyin\":\"QJ\",\"ishot\":false},{\"citycode\":522700,\"name\":\"黔南\",\"pinyin\":\"QN\",\"ishot\":false},{\"citycode\":230200,\"name\":\"齐齐哈尔\",\"pinyin\":\"QQHE\",\"ishot\":false},{\"citycode\":522300,\"name\":\"黔西南\",\"pinyin\":\"QXN\",\"ishot\":false},{\"citycode\":441800,\"name\":\"清远\",\"pinyin\":\"QY\",\"ishot\":false},{\"citycode\":621000,\"name\":\"庆阳\",\"pinyin\":\"QY\",\"ishot\":false},{\"citycode\":330800,\"name\":\"衢州\",\"pinyin\":\"QZ\",\"ishot\":false},{\"citycode\":350500,\"name\":\"泉州\",\"pinyin\":\"QZ\",\"ishot\":false},{\"citycode\":450700,\"name\":\"钦州\",\"pinyin\":\"QZ\",\"ishot\":false},{\"citycode\":469030,\"name\":\"琼中\",\"pinyin\":\"QZ\",\"ishot\":false},{\"citycode\":542300,\"name\":\"日喀则\",\"pinyin\":\"RKZ\",\"ishot\":false},{\"citycode\":371100,\"name\":\"日照\",\"pinyin\":\"RZ\",\"ishot\":false},{\"citycode\":440200,\"name\":\"韶关\",\"pinyin\":\"SG\",\"ishot\":false},{\"citycode\":310100,\"name\":\"上海\",\"pinyin\":\"SH\",\"ishot\":true},{\"citycode\":231200,\"name\":\"绥化\",\"pinyin\":\"SH\",\"ishot\":false},{\"citycode\":659001,\"name\":\"石河子\",\"pinyin\":\"SHZ\",\"ishot\":false},{\"citycode\":130100,\"name\":\"石家庄\",\"pinyin\":\"SJZ\",\"ishot\":false},{\"citycode\":611000,\"name\":\"商洛\",\"pinyin\":\"SL\",\"ishot\":false},{\"citycode\":350400,\"name\":\"三明\",\"pinyin\":\"SM\",\"ishot\":false},{\"citycode\":411200,\"name\":\"三门峡\",\"pinyin\":\"SMX\",\"ishot\":false},{\"citycode\":510900,\"name\":\"遂宁\",\"pinyin\":\"SN\",\"ishot\":false},{\"citycode\":220300,\"name\":\"四平\",\"pinyin\":\"SP\",\"ishot\":false},{\"citycode\":411400,\"name\":\"商丘\",\"pinyin\":\"SQ\",\"ishot\":false},{\"citycode\":321300,\"name\":\"宿迁\",\"pinyin\":\"SQ\",\"ishot\":false},{\"citycode\":361100,\"name\":\"上饶\",\"pinyin\":\"SR\",\"ishot\":false},{\"citycode\":440500,\"name\":\"汕头\",\"pinyin\":\"ST\",\"ishot\":false},{\"citycode\":441500,\"name\":\"汕尾\",\"pinyin\":\"SW\",\"ishot\":false},{\"citycode\":330600,\"name\":\"绍兴\",\"pinyin\":\"SX\",\"ishot\":false},{\"citycode\":420300,\"name\":\"十堰\",\"pinyin\":\"SY\",\"ishot\":false},{\"citycode\":210100,\"name\":\"沈阳\",\"pinyin\":\"SY\",\"ishot\":false},{\"citycode\":460200,\"name\":\"三亚\",\"pinyin\":\"SY\",\"ishot\":false},{\"citycode\":430500,\"name\":\"邵阳\",\"pinyin\":\"SY\",\"ishot\":false},{\"citycode\":220700,\"name\":\"松原\",\"pinyin\":\"SY\",\"ishot\":false},{\"citycode\":230500,\"name\":\"双鸭山\",\"pinyin\":\"SYS\",\"ishot\":false},{\"citycode\":440300,\"name\":\"深圳\",\"pinyin\":\"SZ\",\"ishot\":true},{\"citycode\":320500,\"name\":\"苏州\",\"pinyin\":\"SZ\",\"ishot\":false},{\"citycode\":341300,\"name\":\"宿州\",\"pinyin\":\"SZ\",\"ishot\":false},{\"citycode\":421300,\"name\":\"随州\",\"pinyin\":\"SZ\",\"ishot\":false},{\"citycode\":140600,\"name\":\"朔州\",\"pinyin\":\"SZ\",\"ishot\":false},{\"citycode\":640200,\"name\":\"石嘴山\",\"pinyin\":\"SZS\",\"ishot\":false},{\"citycode\":370900,\"name\":\"泰安\",\"pinyin\":\"TA\",\"ishot\":false},{\"citycode\":610200,\"name\":\"铜川\",\"pinyin\":\"TC\",\"ishot\":false},{\"citycode\":654200,\"name\":\"塔城\",\"pinyin\":\"TC\",\"ishot\":false},{\"citycode\":220500,\"name\":\"通化\",\"pinyin\":\"TH\",\"ishot\":false},{\"citycode\":120100,\"name\":\"天津\",\"pinyin\":\"TJ\",\"ishot\":false},{\"citycode\":340700,\"name\":\"铜陵\",\"pinyin\":\"TL\",\"ishot\":false},{\"citycode\":150500,\"name\":\"通辽\",\"pinyin\":\"TL\",\"ishot\":false},{\"citycode\":211200,\"name\":\"铁岭\",\"pinyin\":\"TL\",\"ishot\":false},{\"citycode\":652100,\"name\":\"吐鲁番\",\"pinyin\":\"TLF\",\"ishot\":false},{\"citycode\":429006,\"name\":\"天门\",\"pinyin\":\"TM\",\"ishot\":false},{\"citycode\":522201,\"name\":\"铜仁\",\"pinyin\":\"TR\",\"ishot\":false},{\"citycode\":130200,\"name\":\"唐山\",\"pinyin\":\"TS\",\"ishot\":false},{\"citycode\":620500,\"name\":\"天水\",\"pinyin\":\"TS\",\"ishot\":false},{\"citycode\":140100,\"name\":\"太原\",\"pinyin\":\"TY\",\"ishot\":false},{\"citycode\":331000,\"name\":\"台州\",\"pinyin\":\"TZ\",\"ishot\":false},{\"citycode\":321200,\"name\":\"泰州\",\"pinyin\":\"TZ\",\"ishot\":false},{\"citycode\":469005,\"name\":\"文昌\",\"pinyin\":\"WC\",\"ishot\":false},{\"citycode\":370700,\"name\":\"潍坊\",\"pinyin\":\"WF\",\"ishot\":false},{\"citycode\":420100,\"name\":\"武汉\",\"pinyin\":\"WH\",\"ishot\":true},{\"citycode\":340200,\"name\":\"芜湖\",\"pinyin\":\"WH\",\"ishot\":false},{\"citycode\":150300,\"name\":\"乌海\",\"pinyin\":\"WH\",\"ishot\":false},{\"citycode\":371000,\"name\":\"威海\",\"pinyin\":\"WH\",\"ishot\":false},{\"citycode\":659004,\"name\":\"五家渠\",\"pinyin\":\"WJQ\",\"ishot\":false},{\"citycode\":150900,\"name\":\"乌兰察布\",\"pinyin\":\"WLCB\",\"ishot\":false},{\"citycode\":650100,\"name\":\"乌鲁木齐\",\"pinyin\":\"WLMQ\",\"ishot\":false},{\"citycode\":610500,\"name\":\"渭南\",\"pinyin\":\"WN\",\"ishot\":false},{\"citycode\":469006,\"name\":\"万宁\",\"pinyin\":\"WN\",\"ishot\":false},{\"citycode\":532621,\"name\":\"文山\",\"pinyin\":\"WS\",\"ishot\":false},{\"citycode\":620600,\"name\":\"武威\",\"pinyin\":\"WW\",\"ishot\":false},{\"citycode\":320200,\"name\":\"无锡\",\"pinyin\":\"WX\",\"ishot\":false},{\"citycode\":450400,\"name\":\"梧州\",\"pinyin\":\"WZ\",\"ishot\":false},{\"citycode\":330300,\"name\":\"温州\",\"pinyin\":\"WZ\",\"ishot\":false},{\"citycode\":640300,\"name\":\"吴忠\",\"pinyin\":\"WZ\",\"ishot\":false},{\"citycode\":610100,\"name\":\"西安\",\"pinyin\":\"XA\",\"ishot\":true},{\"citycode\":152200,\"name\":\"兴安盟\",\"pinyin\":\"XAM\",\"ishot\":false},{\"citycode\":341800,\"name\":\"宣城\",\"pinyin\":\"XC\",\"ishot\":false},{\"citycode\":411000,\"name\":\"许昌\",\"pinyin\":\"XC\",\"ishot\":false},{\"citycode\":420900,\"name\":\"孝感\",\"pinyin\":\"XG\",\"ishot\":false},{\"citycode\":152500,\"name\":\"锡林郭勒\",\"pinyin\":\"XLGL\",\"ishot\":false},{\"citycode\":350200,\"name\":\"厦门\",\"pinyin\":\"XM\",\"ishot\":false},{\"citycode\":421200,\"name\":\"咸宁\",\"pinyin\":\"XN\",\"ishot\":false},{\"citycode\":630100,\"name\":\"西宁\",\"pinyin\":\"XN\",\"ishot\":false},{\"citycode\":532800,\"name\":\"西双版纳\",\"pinyin\":\"XSBN\",\"ishot\":false},{\"citycode\":130500,\"name\":\"邢台\",\"pinyin\":\"XT\",\"ishot\":false},{\"citycode\":429004,\"name\":\"仙桃\",\"pinyin\":\"XT\",\"ishot\":false},{\"citycode\":430300,\"name\":\"湘潭\",\"pinyin\":\"XT\",\"ishot\":false},{\"citycode\":410700,\"name\":\"新乡\",\"pinyin\":\"XX\",\"ishot\":false},{\"citycode\":433100,\"name\":\"湘西\",\"pinyin\":\"XX\",\"ishot\":false},{\"citycode\":411500,\"name\":\"信阳\",\"pinyin\":\"XY\",\"ishot\":false},{\"citycode\":420600,\"name\":\"襄阳\",\"pinyin\":\"XY\",\"ishot\":false},{\"citycode\":360500,\"name\":\"新余\",\"pinyin\":\"XY\",\"ishot\":false},{\"citycode\":610400,\"name\":\"咸阳\",\"pinyin\":\"XY\",\"ishot\":false},{\"citycode\":320300,\"name\":\"徐州\",\"pinyin\":\"XZ\",\"ishot\":false},{\"citycode\":140900,\"name\":\"忻州\",\"pinyin\":\"XZ\",\"ishot\":false},{\"citycode\":610600,\"name\":\"延安\",\"pinyin\":\"YA\",\"ishot\":false},{\"citycode\":511800,\"name\":\"雅安\",\"pinyin\":\"YA\",\"ishot\":false},{\"citycode\":511500,\"name\":\"宜宾\",\"pinyin\":\"YB\",\"ishot\":false},{\"citycode\":222400,\"name\":\"延边\",\"pinyin\":\"YB\",\"ishot\":false},{\"citycode\":420500,\"name\":\"宜昌\",\"pinyin\":\"YC\",\"ishot\":false},{\"citycode\":320900,\"name\":\"盐城\",\"pinyin\":\"YC\",\"ishot\":false},{\"citycode\":360900,\"name\":\"宜春\",\"pinyin\":\"YC\",\"ishot\":false},{\"citycode\":640100,\"name\":\"银川\",\"pinyin\":\"YC\",\"ishot\":false},{\"citycode\":140800,\"name\":\"运城\",\"pinyin\":\"YC\",\"ishot\":false},{\"citycode\":230700,\"name\":\"伊春\",\"pinyin\":\"YC\",\"ishot\":false},{\"citycode\":445300,\"name\":\"云浮\",\"pinyin\":\"YF\",\"ishot\":false},{\"citycode\":441700,\"name\":\"阳江\",\"pinyin\":\"YJ\",\"ishot\":false},{\"citycode\":210800,\"name\":\"营口\",\"pinyin\":\"YK\",\"ishot\":false},{\"citycode\":450900,\"name\":\"玉林\",\"pinyin\":\"YL\",\"ishot\":false},{\"citycode\":610800,\"name\":\"榆林\",\"pinyin\":\"YL\",\"ishot\":false},{\"citycode\":654000,\"name\":\"伊犁\",\"pinyin\":\"YL\",\"ishot\":false},{\"citycode\":140300,\"name\":\"阳泉\",\"pinyin\":\"YQ\",\"ishot\":false},{\"citycode\":370600,\"name\":\"烟台\",\"pinyin\":\"YT\",\"ishot\":false},{\"citycode\":360600,\"name\":\"鹰潭\",\"pinyin\":\"YT\",\"ishot\":false},{\"citycode\":530400,\"name\":\"玉溪\",\"pinyin\":\"YX\",\"ishot\":false},{\"citycode\":430900,\"name\":\"益阳\",\"pinyin\":\"YY\",\"ishot\":false},{\"citycode\":430600,\"name\":\"岳阳\",\"pinyin\":\"YY\",\"ishot\":false},{\"citycode\":321000,\"name\":\"扬州\",\"pinyin\":\"YZ\",\"ishot\":false},{\"citycode\":431100,\"name\":\"永州\",\"pinyin\":\"YZ\",\"ishot\":false},{\"citycode\":370300,\"name\":\"淄博\",\"pinyin\":\"ZB\",\"ishot\":false},{\"citycode\":510300,\"name\":\"自贡\",\"pinyin\":\"ZG\",\"ishot\":false},{\"citycode\":440400,\"name\":\"珠海\",\"pinyin\":\"ZH\",\"ishot\":false},{\"citycode\":440800,\"name\":\"湛江\",\"pinyin\":\"ZJ\",\"ishot\":false},{\"citycode\":321100,\"name\":\"镇江\",\"pinyin\":\"ZJ\",\"ishot\":false},{\"citycode\":430800,\"name\":\"张家界\",\"pinyin\":\"ZJJ\",\"ishot\":false},{\"citycode\":130700,\"name\":\"张家口\",\"pinyin\":\"ZJK\",\"ishot\":false},{\"citycode\":411600,\"name\":\"周口\",\"pinyin\":\"ZK\",\"ishot\":false},{\"citycode\":411700,\"name\":\"驻马店\",\"pinyin\":\"ZMD\",\"ishot\":false},{\"citycode\":441200,\"name\":\"肇庆\",\"pinyin\":\"ZQ\",\"ishot\":false},{\"citycode\":442000,\"name\":\"中山\",\"pinyin\":\"ZS\",\"ishot\":false},{\"citycode\":330900,\"name\":\"舟山\",\"pinyin\":\"ZS\",\"ishot\":false},{\"citycode\":530600,\"name\":\"昭通\",\"pinyin\":\"ZT\",\"ishot\":false},{\"citycode\":640500,\"name\":\"中卫\",\"pinyin\":\"ZW\",\"ishot\":false},{\"citycode\":620700,\"name\":\"张掖\",\"pinyin\":\"ZY\",\"ishot\":false},{\"citycode\":520300,\"name\":\"遵义\",\"pinyin\":\"ZY\",\"ishot\":false},{\"citycode\":512000,\"name\":\"资阳\",\"pinyin\":\"ZY\",\"ishot\":false},{\"citycode\":410100,\"name\":\"郑州\",\"pinyin\":\"ZZ\",\"ishot\":false},{\"citycode\":350600,\"name\":\"漳州\",\"pinyin\":\"ZZ\",\"ishot\":false},{\"citycode\":430200,\"name\":\"株洲\",\"pinyin\":\"ZZ\",\"ishot\":false},{\"citycode\":370400,\"name\":\"枣庄\",\"pinyin\":\"ZZ\",\"ishot\":false},{\"citycode\":140400,\"name\":\"长治\",\"pinyin\":\"ZZ\",\"ishot\":false}],\"recordList\":[{\"citycode\":420100,\"name\":\"武汉\"},{\"citycode\":330100,\"name\":\"杭州\"}],\"alphabet\":[\"area\",\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"J\",\"K\",\"L\",\"M\",\"N\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"W\",\"X\",\"Y\",\"Z\"]},\"statistics\":{\"total\":338},\"code\":\"1000\",\"message\":\"获取数据成功\",\"messageType\":1}");
  2234. /***/ }),
  2235. /***/ 273:
  2236. /*!****************************************************************!*\
  2237. !*** /Users/guo/Desktop/txCar/components/tki-qrcode/qrcode.js ***!
  2238. \****************************************************************/
  2239. /*! no static exports found */
  2240. /***/ (function(module, exports, __webpack_require__) {
  2241. "use strict";
  2242. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var QRCode = {};
  2243. (function () {
  2244. /**
  2245. * 获取单个字符的utf8编码
  2246. * unicode BMP平面约65535个字符
  2247. * @param {num} code
  2248. * return {array}
  2249. */
  2250. function unicodeFormat8(code) {
  2251. // 1 byte
  2252. var c0, c1, c2;
  2253. if (code < 128) {
  2254. return [code];
  2255. // 2 bytes
  2256. } else if (code < 2048) {
  2257. c0 = 192 + (code >> 6);
  2258. c1 = 128 + (code & 63);
  2259. return [c0, c1];
  2260. // 3 bytes
  2261. } else {
  2262. c0 = 224 + (code >> 12);
  2263. c1 = 128 + (code >> 6 & 63);
  2264. c2 = 128 + (code & 63);
  2265. return [c0, c1, c2];
  2266. }
  2267. }
  2268. /**
  2269. * 获取字符串的utf8编码字节串
  2270. * @param {string} string
  2271. * @return {array}
  2272. */
  2273. function getUTF8Bytes(string) {
  2274. var utf8codes = [];
  2275. for (var i = 0; i < string.length; i++) {
  2276. var code = string.charCodeAt(i);
  2277. var utf8 = unicodeFormat8(code);
  2278. for (var j = 0; j < utf8.length; j++) {
  2279. utf8codes.push(utf8[j]);
  2280. }
  2281. }
  2282. return utf8codes;
  2283. }
  2284. /**
  2285. * 二维码算法实现
  2286. * @param {string} data 要编码的信息字符串
  2287. * @param {num} errorCorrectLevel 纠错等级
  2288. */
  2289. function QRCodeAlg(data, errorCorrectLevel) {
  2290. this.typeNumber = -1; //版本
  2291. this.errorCorrectLevel = errorCorrectLevel;
  2292. this.modules = null; //二维矩阵,存放最终结果
  2293. this.moduleCount = 0; //矩阵大小
  2294. this.dataCache = null; //数据缓存
  2295. this.rsBlocks = null; //版本数据信息
  2296. this.totalDataCount = -1; //可使用的数据量
  2297. this.data = data;
  2298. this.utf8bytes = getUTF8Bytes(data);
  2299. this.make();
  2300. }
  2301. QRCodeAlg.prototype = {
  2302. constructor: QRCodeAlg,
  2303. /**
  2304. * 获取二维码矩阵大小
  2305. * @return {num} 矩阵大小
  2306. */
  2307. getModuleCount: function getModuleCount() {
  2308. return this.moduleCount;
  2309. },
  2310. /**
  2311. * 编码
  2312. */
  2313. make: function make() {
  2314. this.getRightType();
  2315. this.dataCache = this.createData();
  2316. this.createQrcode();
  2317. },
  2318. /**
  2319. * 设置二位矩阵功能图形
  2320. * @param {bool} test 表示是否在寻找最好掩膜阶段
  2321. * @param {num} maskPattern 掩膜的版本
  2322. */
  2323. makeImpl: function makeImpl(maskPattern) {
  2324. this.moduleCount = this.typeNumber * 4 + 17;
  2325. this.modules = new Array(this.moduleCount);
  2326. for (var row = 0; row < this.moduleCount; row++) {
  2327. this.modules[row] = new Array(this.moduleCount);
  2328. }
  2329. this.setupPositionProbePattern(0, 0);
  2330. this.setupPositionProbePattern(this.moduleCount - 7, 0);
  2331. this.setupPositionProbePattern(0, this.moduleCount - 7);
  2332. this.setupPositionAdjustPattern();
  2333. this.setupTimingPattern();
  2334. this.setupTypeInfo(true, maskPattern);
  2335. if (this.typeNumber >= 7) {
  2336. this.setupTypeNumber(true);
  2337. }
  2338. this.mapData(this.dataCache, maskPattern);
  2339. },
  2340. /**
  2341. * 设置二维码的位置探测图形
  2342. * @param {num} row 探测图形的中心横坐标
  2343. * @param {num} col 探测图形的中心纵坐标
  2344. */
  2345. setupPositionProbePattern: function setupPositionProbePattern(row, col) {
  2346. for (var r = -1; r <= 7; r++) {
  2347. if (row + r <= -1 || this.moduleCount <= row + r) continue;
  2348. for (var c = -1; c <= 7; c++) {
  2349. if (col + c <= -1 || this.moduleCount <= col + c) continue;
  2350. if (0 <= r && r <= 6 && (c == 0 || c == 6) || 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4) {
  2351. this.modules[row + r][col + c] = true;
  2352. } else {
  2353. this.modules[row + r][col + c] = false;
  2354. }
  2355. }
  2356. }
  2357. },
  2358. /**
  2359. * 创建二维码
  2360. * @return {[type]} [description]
  2361. */
  2362. createQrcode: function createQrcode() {
  2363. var minLostPoint = 0;
  2364. var pattern = 0;
  2365. var bestModules = null;
  2366. for (var i = 0; i < 8; i++) {
  2367. this.makeImpl(i);
  2368. var lostPoint = QRUtil.getLostPoint(this);
  2369. if (i == 0 || minLostPoint > lostPoint) {
  2370. minLostPoint = lostPoint;
  2371. pattern = i;
  2372. bestModules = this.modules;
  2373. }
  2374. }
  2375. this.modules = bestModules;
  2376. this.setupTypeInfo(false, pattern);
  2377. if (this.typeNumber >= 7) {
  2378. this.setupTypeNumber(false);
  2379. }
  2380. },
  2381. /**
  2382. * 设置定位图形
  2383. * @return {[type]} [description]
  2384. */
  2385. setupTimingPattern: function setupTimingPattern() {
  2386. for (var r = 8; r < this.moduleCount - 8; r++) {
  2387. if (this.modules[r][6] != null) {
  2388. continue;
  2389. }
  2390. this.modules[r][6] = r % 2 == 0;
  2391. if (this.modules[6][r] != null) {
  2392. continue;
  2393. }
  2394. this.modules[6][r] = r % 2 == 0;
  2395. }
  2396. },
  2397. /**
  2398. * 设置矫正图形
  2399. * @return {[type]} [description]
  2400. */
  2401. setupPositionAdjustPattern: function setupPositionAdjustPattern() {
  2402. var pos = QRUtil.getPatternPosition(this.typeNumber);
  2403. for (var i = 0; i < pos.length; i++) {
  2404. for (var j = 0; j < pos.length; j++) {
  2405. var row = pos[i];
  2406. var col = pos[j];
  2407. if (this.modules[row][col] != null) {
  2408. continue;
  2409. }
  2410. for (var r = -2; r <= 2; r++) {
  2411. for (var c = -2; c <= 2; c++) {
  2412. if (r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c == 0) {
  2413. this.modules[row + r][col + c] = true;
  2414. } else {
  2415. this.modules[row + r][col + c] = false;
  2416. }
  2417. }
  2418. }
  2419. }
  2420. }
  2421. },
  2422. /**
  2423. * 设置版本信息(7以上版本才有)
  2424. * @param {bool} test 是否处于判断最佳掩膜阶段
  2425. * @return {[type]} [description]
  2426. */
  2427. setupTypeNumber: function setupTypeNumber(test) {
  2428. var bits = QRUtil.getBCHTypeNumber(this.typeNumber);
  2429. for (var i = 0; i < 18; i++) {
  2430. var mod = !test && (bits >> i & 1) == 1;
  2431. this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;
  2432. this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;
  2433. }
  2434. },
  2435. /**
  2436. * 设置格式信息(纠错等级和掩膜版本)
  2437. * @param {bool} test
  2438. * @param {num} maskPattern 掩膜版本
  2439. * @return {}
  2440. */
  2441. setupTypeInfo: function setupTypeInfo(test, maskPattern) {
  2442. var data = QRErrorCorrectLevel[this.errorCorrectLevel] << 3 | maskPattern;
  2443. var bits = QRUtil.getBCHTypeInfo(data);
  2444. // vertical
  2445. for (var i = 0; i < 15; i++) {
  2446. var mod = !test && (bits >> i & 1) == 1;
  2447. if (i < 6) {
  2448. this.modules[i][8] = mod;
  2449. } else if (i < 8) {
  2450. this.modules[i + 1][8] = mod;
  2451. } else {
  2452. this.modules[this.moduleCount - 15 + i][8] = mod;
  2453. }
  2454. // horizontal
  2455. var mod = !test && (bits >> i & 1) == 1;
  2456. if (i < 8) {
  2457. this.modules[8][this.moduleCount - i - 1] = mod;
  2458. } else if (i < 9) {
  2459. this.modules[8][15 - i - 1 + 1] = mod;
  2460. } else {
  2461. this.modules[8][15 - i - 1] = mod;
  2462. }
  2463. }
  2464. // fixed module
  2465. this.modules[this.moduleCount - 8][8] = !test;
  2466. },
  2467. /**
  2468. * 数据编码
  2469. * @return {[type]} [description]
  2470. */
  2471. createData: function createData() {
  2472. var buffer = new QRBitBuffer();
  2473. var lengthBits = this.typeNumber > 9 ? 16 : 8;
  2474. buffer.put(4, 4); //添加模式
  2475. buffer.put(this.utf8bytes.length, lengthBits);
  2476. for (var i = 0, l = this.utf8bytes.length; i < l; i++) {
  2477. buffer.put(this.utf8bytes[i], 8);
  2478. }
  2479. if (buffer.length + 4 <= this.totalDataCount * 8) {
  2480. buffer.put(0, 4);
  2481. }
  2482. // padding
  2483. while (buffer.length % 8 != 0) {
  2484. buffer.putBit(false);
  2485. }
  2486. // padding
  2487. while (true) {
  2488. if (buffer.length >= this.totalDataCount * 8) {
  2489. break;
  2490. }
  2491. buffer.put(QRCodeAlg.PAD0, 8);
  2492. if (buffer.length >= this.totalDataCount * 8) {
  2493. break;
  2494. }
  2495. buffer.put(QRCodeAlg.PAD1, 8);
  2496. }
  2497. return this.createBytes(buffer);
  2498. },
  2499. /**
  2500. * 纠错码编码
  2501. * @param {buffer} buffer 数据编码
  2502. * @return {[type]}
  2503. */
  2504. createBytes: function createBytes(buffer) {
  2505. var offset = 0;
  2506. var maxDcCount = 0;
  2507. var maxEcCount = 0;
  2508. var length = this.rsBlock.length / 3;
  2509. var rsBlocks = new Array();
  2510. for (var i = 0; i < length; i++) {
  2511. var count = this.rsBlock[i * 3 + 0];
  2512. var totalCount = this.rsBlock[i * 3 + 1];
  2513. var dataCount = this.rsBlock[i * 3 + 2];
  2514. for (var j = 0; j < count; j++) {
  2515. rsBlocks.push([dataCount, totalCount]);
  2516. }
  2517. }
  2518. var dcdata = new Array(rsBlocks.length);
  2519. var ecdata = new Array(rsBlocks.length);
  2520. for (var r = 0; r < rsBlocks.length; r++) {
  2521. var dcCount = rsBlocks[r][0];
  2522. var ecCount = rsBlocks[r][1] - dcCount;
  2523. maxDcCount = Math.max(maxDcCount, dcCount);
  2524. maxEcCount = Math.max(maxEcCount, ecCount);
  2525. dcdata[r] = new Array(dcCount);
  2526. for (var i = 0; i < dcdata[r].length; i++) {
  2527. dcdata[r][i] = 0xff & buffer.buffer[i + offset];
  2528. }
  2529. offset += dcCount;
  2530. var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount);
  2531. var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1);
  2532. var modPoly = rawPoly.mod(rsPoly);
  2533. ecdata[r] = new Array(rsPoly.getLength() - 1);
  2534. for (var i = 0; i < ecdata[r].length; i++) {
  2535. var modIndex = i + modPoly.getLength() - ecdata[r].length;
  2536. ecdata[r][i] = modIndex >= 0 ? modPoly.get(modIndex) : 0;
  2537. }
  2538. }
  2539. var data = new Array(this.totalDataCount);
  2540. var index = 0;
  2541. for (var i = 0; i < maxDcCount; i++) {
  2542. for (var r = 0; r < rsBlocks.length; r++) {
  2543. if (i < dcdata[r].length) {
  2544. data[index++] = dcdata[r][i];
  2545. }
  2546. }
  2547. }
  2548. for (var i = 0; i < maxEcCount; i++) {
  2549. for (var r = 0; r < rsBlocks.length; r++) {
  2550. if (i < ecdata[r].length) {
  2551. data[index++] = ecdata[r][i];
  2552. }
  2553. }
  2554. }
  2555. return data;
  2556. },
  2557. /**
  2558. * 布置模块,构建最终信息
  2559. * @param {} data
  2560. * @param {} maskPattern
  2561. * @return {}
  2562. */
  2563. mapData: function mapData(data, maskPattern) {
  2564. var inc = -1;
  2565. var row = this.moduleCount - 1;
  2566. var bitIndex = 7;
  2567. var byteIndex = 0;
  2568. for (var col = this.moduleCount - 1; col > 0; col -= 2) {
  2569. if (col == 6) col--;
  2570. while (true) {
  2571. for (var c = 0; c < 2; c++) {
  2572. if (this.modules[row][col - c] == null) {
  2573. var dark = false;
  2574. if (byteIndex < data.length) {
  2575. dark = (data[byteIndex] >>> bitIndex & 1) == 1;
  2576. }
  2577. var mask = QRUtil.getMask(maskPattern, row, col - c);
  2578. if (mask) {
  2579. dark = !dark;
  2580. }
  2581. this.modules[row][col - c] = dark;
  2582. bitIndex--;
  2583. if (bitIndex == -1) {
  2584. byteIndex++;
  2585. bitIndex = 7;
  2586. }
  2587. }
  2588. }
  2589. row += inc;
  2590. if (row < 0 || this.moduleCount <= row) {
  2591. row -= inc;
  2592. inc = -inc;
  2593. break;
  2594. }
  2595. }
  2596. }
  2597. } };
  2598. /**
  2599. * 填充字段
  2600. */
  2601. QRCodeAlg.PAD0 = 0xEC;
  2602. QRCodeAlg.PAD1 = 0x11;
  2603. //---------------------------------------------------------------------
  2604. // 纠错等级对应的编码
  2605. //---------------------------------------------------------------------
  2606. var QRErrorCorrectLevel = [1, 0, 3, 2];
  2607. //---------------------------------------------------------------------
  2608. // 掩膜版本
  2609. //---------------------------------------------------------------------
  2610. var QRMaskPattern = {
  2611. PATTERN000: 0,
  2612. PATTERN001: 1,
  2613. PATTERN010: 2,
  2614. PATTERN011: 3,
  2615. PATTERN100: 4,
  2616. PATTERN101: 5,
  2617. PATTERN110: 6,
  2618. PATTERN111: 7 };
  2619. //---------------------------------------------------------------------
  2620. // 工具类
  2621. //---------------------------------------------------------------------
  2622. var QRUtil = {
  2623. /*
  2624. 每个版本矫正图形的位置
  2625. */
  2626. PATTERN_POSITION_TABLE: [
  2627. [],
  2628. [6, 18],
  2629. [6, 22],
  2630. [6, 26],
  2631. [6, 30],
  2632. [6, 34],
  2633. [6, 22, 38],
  2634. [6, 24, 42],
  2635. [6, 26, 46],
  2636. [6, 28, 50],
  2637. [6, 30, 54],
  2638. [6, 32, 58],
  2639. [6, 34, 62],
  2640. [6, 26, 46, 66],
  2641. [6, 26, 48, 70],
  2642. [6, 26, 50, 74],
  2643. [6, 30, 54, 78],
  2644. [6, 30, 56, 82],
  2645. [6, 30, 58, 86],
  2646. [6, 34, 62, 90],
  2647. [6, 28, 50, 72, 94],
  2648. [6, 26, 50, 74, 98],
  2649. [6, 30, 54, 78, 102],
  2650. [6, 28, 54, 80, 106],
  2651. [6, 32, 58, 84, 110],
  2652. [6, 30, 58, 86, 114],
  2653. [6, 34, 62, 90, 118],
  2654. [6, 26, 50, 74, 98, 122],
  2655. [6, 30, 54, 78, 102, 126],
  2656. [6, 26, 52, 78, 104, 130],
  2657. [6, 30, 56, 82, 108, 134],
  2658. [6, 34, 60, 86, 112, 138],
  2659. [6, 30, 58, 86, 114, 142],
  2660. [6, 34, 62, 90, 118, 146],
  2661. [6, 30, 54, 78, 102, 126, 150],
  2662. [6, 24, 50, 76, 102, 128, 154],
  2663. [6, 28, 54, 80, 106, 132, 158],
  2664. [6, 32, 58, 84, 110, 136, 162],
  2665. [6, 26, 54, 82, 110, 138, 166],
  2666. [6, 30, 58, 86, 114, 142, 170]],
  2667. G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0,
  2668. G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0,
  2669. G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1,
  2670. /*
  2671. BCH编码格式信息
  2672. */
  2673. getBCHTypeInfo: function getBCHTypeInfo(data) {
  2674. var d = data << 10;
  2675. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {
  2676. d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15);
  2677. }
  2678. return (data << 10 | d) ^ QRUtil.G15_MASK;
  2679. },
  2680. /*
  2681. BCH编码版本信息
  2682. */
  2683. getBCHTypeNumber: function getBCHTypeNumber(data) {
  2684. var d = data << 12;
  2685. while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {
  2686. d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18);
  2687. }
  2688. return data << 12 | d;
  2689. },
  2690. /*
  2691. 获取BCH位信息
  2692. */
  2693. getBCHDigit: function getBCHDigit(data) {
  2694. var digit = 0;
  2695. while (data != 0) {
  2696. digit++;
  2697. data >>>= 1;
  2698. }
  2699. return digit;
  2700. },
  2701. /*
  2702. 获取版本对应的矫正图形位置
  2703. */
  2704. getPatternPosition: function getPatternPosition(typeNumber) {
  2705. return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];
  2706. },
  2707. /*
  2708. 掩膜算法
  2709. */
  2710. getMask: function getMask(maskPattern, i, j) {
  2711. switch (maskPattern) {
  2712. case QRMaskPattern.PATTERN000:
  2713. return (i + j) % 2 == 0;
  2714. case QRMaskPattern.PATTERN001:
  2715. return i % 2 == 0;
  2716. case QRMaskPattern.PATTERN010:
  2717. return j % 3 == 0;
  2718. case QRMaskPattern.PATTERN011:
  2719. return (i + j) % 3 == 0;
  2720. case QRMaskPattern.PATTERN100:
  2721. return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0;
  2722. case QRMaskPattern.PATTERN101:
  2723. return i * j % 2 + i * j % 3 == 0;
  2724. case QRMaskPattern.PATTERN110:
  2725. return (i * j % 2 + i * j % 3) % 2 == 0;
  2726. case QRMaskPattern.PATTERN111:
  2727. return (i * j % 3 + (i + j) % 2) % 2 == 0;
  2728. default:
  2729. throw new Error("bad maskPattern:" + maskPattern);}
  2730. },
  2731. /*
  2732. 获取RS的纠错多项式
  2733. */
  2734. getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) {
  2735. var a = new QRPolynomial([1], 0);
  2736. for (var i = 0; i < errorCorrectLength; i++) {
  2737. a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0));
  2738. }
  2739. return a;
  2740. },
  2741. /*
  2742. 获取评价
  2743. */
  2744. getLostPoint: function getLostPoint(qrCode) {
  2745. var moduleCount = qrCode.getModuleCount(),
  2746. lostPoint = 0,
  2747. darkCount = 0;
  2748. for (var row = 0; row < moduleCount; row++) {
  2749. var sameCount = 0;
  2750. var head = qrCode.modules[row][0];
  2751. for (var col = 0; col < moduleCount; col++) {
  2752. var current = qrCode.modules[row][col];
  2753. //level 3 评价
  2754. if (col < moduleCount - 6) {
  2755. if (current && !qrCode.modules[row][col + 1] && qrCode.modules[row][col + 2] && qrCode.modules[row][col + 3] && qrCode.modules[row][col + 4] && !qrCode.modules[row][col + 5] && qrCode.modules[row][col + 6]) {
  2756. if (col < moduleCount - 10) {
  2757. if (qrCode.modules[row][col + 7] && qrCode.modules[row][col + 8] && qrCode.modules[row][col + 9] && qrCode.modules[row][col + 10]) {
  2758. lostPoint += 40;
  2759. }
  2760. } else if (col > 3) {
  2761. if (qrCode.modules[row][col - 1] && qrCode.modules[row][col - 2] && qrCode.modules[row][col - 3] && qrCode.modules[row][col - 4]) {
  2762. lostPoint += 40;
  2763. }
  2764. }
  2765. }
  2766. }
  2767. //level 2 评价
  2768. if (row < moduleCount - 1 && col < moduleCount - 1) {
  2769. var count = 0;
  2770. if (current) count++;
  2771. if (qrCode.modules[row + 1][col]) count++;
  2772. if (qrCode.modules[row][col + 1]) count++;
  2773. if (qrCode.modules[row + 1][col + 1]) count++;
  2774. if (count == 0 || count == 4) {
  2775. lostPoint += 3;
  2776. }
  2777. }
  2778. //level 1 评价
  2779. if (head ^ current) {
  2780. sameCount++;
  2781. } else {
  2782. head = current;
  2783. if (sameCount >= 5) {
  2784. lostPoint += 3 + sameCount - 5;
  2785. }
  2786. sameCount = 1;
  2787. }
  2788. //level 4 评价
  2789. if (current) {
  2790. darkCount++;
  2791. }
  2792. }
  2793. }
  2794. for (var col = 0; col < moduleCount; col++) {
  2795. var sameCount = 0;
  2796. var head = qrCode.modules[0][col];
  2797. for (var row = 0; row < moduleCount; row++) {
  2798. var current = qrCode.modules[row][col];
  2799. //level 3 评价
  2800. if (row < moduleCount - 6) {
  2801. if (current && !qrCode.modules[row + 1][col] && qrCode.modules[row + 2][col] && qrCode.modules[row + 3][col] && qrCode.modules[row + 4][col] && !qrCode.modules[row + 5][col] && qrCode.modules[row + 6][col]) {
  2802. if (row < moduleCount - 10) {
  2803. if (qrCode.modules[row + 7][col] && qrCode.modules[row + 8][col] && qrCode.modules[row + 9][col] && qrCode.modules[row + 10][col]) {
  2804. lostPoint += 40;
  2805. }
  2806. } else if (row > 3) {
  2807. if (qrCode.modules[row - 1][col] && qrCode.modules[row - 2][col] && qrCode.modules[row - 3][col] && qrCode.modules[row - 4][col]) {
  2808. lostPoint += 40;
  2809. }
  2810. }
  2811. }
  2812. }
  2813. //level 1 评价
  2814. if (head ^ current) {
  2815. sameCount++;
  2816. } else {
  2817. head = current;
  2818. if (sameCount >= 5) {
  2819. lostPoint += 3 + sameCount - 5;
  2820. }
  2821. sameCount = 1;
  2822. }
  2823. }
  2824. }
  2825. // LEVEL4
  2826. var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;
  2827. lostPoint += ratio * 10;
  2828. return lostPoint;
  2829. } };
  2830. //---------------------------------------------------------------------
  2831. // QRMath使用的数学工具
  2832. //---------------------------------------------------------------------
  2833. var QRMath = {
  2834. /*
  2835. 将n转化为a^m
  2836. */
  2837. glog: function glog(n) {
  2838. if (n < 1) {
  2839. throw new Error("glog(" + n + ")");
  2840. }
  2841. return QRMath.LOG_TABLE[n];
  2842. },
  2843. /*
  2844. 将a^m转化为n
  2845. */
  2846. gexp: function gexp(n) {
  2847. while (n < 0) {
  2848. n += 255;
  2849. }
  2850. while (n >= 256) {
  2851. n -= 255;
  2852. }
  2853. return QRMath.EXP_TABLE[n];
  2854. },
  2855. EXP_TABLE: new Array(256),
  2856. LOG_TABLE: new Array(256) };
  2857. for (var i = 0; i < 8; i++) {
  2858. QRMath.EXP_TABLE[i] = 1 << i;
  2859. }
  2860. for (var i = 8; i < 256; i++) {
  2861. QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8];
  2862. }
  2863. for (var i = 0; i < 255; i++) {
  2864. QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i;
  2865. }
  2866. //---------------------------------------------------------------------
  2867. // QRPolynomial 多项式
  2868. //---------------------------------------------------------------------
  2869. /**
  2870. * 多项式类
  2871. * @param {Array} num 系数
  2872. * @param {num} shift a^shift
  2873. */
  2874. function QRPolynomial(num, shift) {
  2875. if (num.length == undefined) {
  2876. throw new Error(num.length + "/" + shift);
  2877. }
  2878. var offset = 0;
  2879. while (offset < num.length && num[offset] == 0) {
  2880. offset++;
  2881. }
  2882. this.num = new Array(num.length - offset + shift);
  2883. for (var i = 0; i < num.length - offset; i++) {
  2884. this.num[i] = num[i + offset];
  2885. }
  2886. }
  2887. QRPolynomial.prototype = {
  2888. get: function get(index) {
  2889. return this.num[index];
  2890. },
  2891. getLength: function getLength() {
  2892. return this.num.length;
  2893. },
  2894. /**
  2895. * 多项式乘法
  2896. * @param {QRPolynomial} e 被乘多项式
  2897. * @return {[type]} [description]
  2898. */
  2899. multiply: function multiply(e) {
  2900. var num = new Array(this.getLength() + e.getLength() - 1);
  2901. for (var i = 0; i < this.getLength(); i++) {
  2902. for (var j = 0; j < e.getLength(); j++) {
  2903. num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j)));
  2904. }
  2905. }
  2906. return new QRPolynomial(num, 0);
  2907. },
  2908. /**
  2909. * 多项式模运算
  2910. * @param {QRPolynomial} e 模多项式
  2911. * @return {}
  2912. */
  2913. mod: function mod(e) {
  2914. var tl = this.getLength(),
  2915. el = e.getLength();
  2916. if (tl - el < 0) {
  2917. return this;
  2918. }
  2919. var num = new Array(tl);
  2920. for (var i = 0; i < tl; i++) {
  2921. num[i] = this.get(i);
  2922. }
  2923. while (num.length >= el) {
  2924. var ratio = QRMath.glog(num[0]) - QRMath.glog(e.get(0));
  2925. for (var i = 0; i < e.getLength(); i++) {
  2926. num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio);
  2927. }
  2928. while (num[0] == 0) {
  2929. num.shift();
  2930. }
  2931. }
  2932. return new QRPolynomial(num, 0);
  2933. } };
  2934. //---------------------------------------------------------------------
  2935. // RS_BLOCK_TABLE
  2936. //---------------------------------------------------------------------
  2937. /*
  2938. 二维码各个版本信息[块数, 每块中的数据块数, 每块中的信息块数]
  2939. */
  2940. var RS_BLOCK_TABLE = [
  2941. // L
  2942. // M
  2943. // Q
  2944. // H
  2945. // 1
  2946. [1, 26, 19],
  2947. [1, 26, 16],
  2948. [1, 26, 13],
  2949. [1, 26, 9],
  2950. // 2
  2951. [1, 44, 34],
  2952. [1, 44, 28],
  2953. [1, 44, 22],
  2954. [1, 44, 16],
  2955. // 3
  2956. [1, 70, 55],
  2957. [1, 70, 44],
  2958. [2, 35, 17],
  2959. [2, 35, 13],
  2960. // 4
  2961. [1, 100, 80],
  2962. [2, 50, 32],
  2963. [2, 50, 24],
  2964. [4, 25, 9],
  2965. // 5
  2966. [1, 134, 108],
  2967. [2, 67, 43],
  2968. [2, 33, 15, 2, 34, 16],
  2969. [2, 33, 11, 2, 34, 12],
  2970. // 6
  2971. [2, 86, 68],
  2972. [4, 43, 27],
  2973. [4, 43, 19],
  2974. [4, 43, 15],
  2975. // 7
  2976. [2, 98, 78],
  2977. [4, 49, 31],
  2978. [2, 32, 14, 4, 33, 15],
  2979. [4, 39, 13, 1, 40, 14],
  2980. // 8
  2981. [2, 121, 97],
  2982. [2, 60, 38, 2, 61, 39],
  2983. [4, 40, 18, 2, 41, 19],
  2984. [4, 40, 14, 2, 41, 15],
  2985. // 9
  2986. [2, 146, 116],
  2987. [3, 58, 36, 2, 59, 37],
  2988. [4, 36, 16, 4, 37, 17],
  2989. [4, 36, 12, 4, 37, 13],
  2990. // 10
  2991. [2, 86, 68, 2, 87, 69],
  2992. [4, 69, 43, 1, 70, 44],
  2993. [6, 43, 19, 2, 44, 20],
  2994. [6, 43, 15, 2, 44, 16],
  2995. // 11
  2996. [4, 101, 81],
  2997. [1, 80, 50, 4, 81, 51],
  2998. [4, 50, 22, 4, 51, 23],
  2999. [3, 36, 12, 8, 37, 13],
  3000. // 12
  3001. [2, 116, 92, 2, 117, 93],
  3002. [6, 58, 36, 2, 59, 37],
  3003. [4, 46, 20, 6, 47, 21],
  3004. [7, 42, 14, 4, 43, 15],
  3005. // 13
  3006. [4, 133, 107],
  3007. [8, 59, 37, 1, 60, 38],
  3008. [8, 44, 20, 4, 45, 21],
  3009. [12, 33, 11, 4, 34, 12],
  3010. // 14
  3011. [3, 145, 115, 1, 146, 116],
  3012. [4, 64, 40, 5, 65, 41],
  3013. [11, 36, 16, 5, 37, 17],
  3014. [11, 36, 12, 5, 37, 13],
  3015. // 15
  3016. [5, 109, 87, 1, 110, 88],
  3017. [5, 65, 41, 5, 66, 42],
  3018. [5, 54, 24, 7, 55, 25],
  3019. [11, 36, 12],
  3020. // 16
  3021. [5, 122, 98, 1, 123, 99],
  3022. [7, 73, 45, 3, 74, 46],
  3023. [15, 43, 19, 2, 44, 20],
  3024. [3, 45, 15, 13, 46, 16],
  3025. // 17
  3026. [1, 135, 107, 5, 136, 108],
  3027. [10, 74, 46, 1, 75, 47],
  3028. [1, 50, 22, 15, 51, 23],
  3029. [2, 42, 14, 17, 43, 15],
  3030. // 18
  3031. [5, 150, 120, 1, 151, 121],
  3032. [9, 69, 43, 4, 70, 44],
  3033. [17, 50, 22, 1, 51, 23],
  3034. [2, 42, 14, 19, 43, 15],
  3035. // 19
  3036. [3, 141, 113, 4, 142, 114],
  3037. [3, 70, 44, 11, 71, 45],
  3038. [17, 47, 21, 4, 48, 22],
  3039. [9, 39, 13, 16, 40, 14],
  3040. // 20
  3041. [3, 135, 107, 5, 136, 108],
  3042. [3, 67, 41, 13, 68, 42],
  3043. [15, 54, 24, 5, 55, 25],
  3044. [15, 43, 15, 10, 44, 16],
  3045. // 21
  3046. [4, 144, 116, 4, 145, 117],
  3047. [17, 68, 42],
  3048. [17, 50, 22, 6, 51, 23],
  3049. [19, 46, 16, 6, 47, 17],
  3050. // 22
  3051. [2, 139, 111, 7, 140, 112],
  3052. [17, 74, 46],
  3053. [7, 54, 24, 16, 55, 25],
  3054. [34, 37, 13],
  3055. // 23
  3056. [4, 151, 121, 5, 152, 122],
  3057. [4, 75, 47, 14, 76, 48],
  3058. [11, 54, 24, 14, 55, 25],
  3059. [16, 45, 15, 14, 46, 16],
  3060. // 24
  3061. [6, 147, 117, 4, 148, 118],
  3062. [6, 73, 45, 14, 74, 46],
  3063. [11, 54, 24, 16, 55, 25],
  3064. [30, 46, 16, 2, 47, 17],
  3065. // 25
  3066. [8, 132, 106, 4, 133, 107],
  3067. [8, 75, 47, 13, 76, 48],
  3068. [7, 54, 24, 22, 55, 25],
  3069. [22, 45, 15, 13, 46, 16],
  3070. // 26
  3071. [10, 142, 114, 2, 143, 115],
  3072. [19, 74, 46, 4, 75, 47],
  3073. [28, 50, 22, 6, 51, 23],
  3074. [33, 46, 16, 4, 47, 17],
  3075. // 27
  3076. [8, 152, 122, 4, 153, 123],
  3077. [22, 73, 45, 3, 74, 46],
  3078. [8, 53, 23, 26, 54, 24],
  3079. [12, 45, 15, 28, 46, 16],
  3080. // 28
  3081. [3, 147, 117, 10, 148, 118],
  3082. [3, 73, 45, 23, 74, 46],
  3083. [4, 54, 24, 31, 55, 25],
  3084. [11, 45, 15, 31, 46, 16],
  3085. // 29
  3086. [7, 146, 116, 7, 147, 117],
  3087. [21, 73, 45, 7, 74, 46],
  3088. [1, 53, 23, 37, 54, 24],
  3089. [19, 45, 15, 26, 46, 16],
  3090. // 30
  3091. [5, 145, 115, 10, 146, 116],
  3092. [19, 75, 47, 10, 76, 48],
  3093. [15, 54, 24, 25, 55, 25],
  3094. [23, 45, 15, 25, 46, 16],
  3095. // 31
  3096. [13, 145, 115, 3, 146, 116],
  3097. [2, 74, 46, 29, 75, 47],
  3098. [42, 54, 24, 1, 55, 25],
  3099. [23, 45, 15, 28, 46, 16],
  3100. // 32
  3101. [17, 145, 115],
  3102. [10, 74, 46, 23, 75, 47],
  3103. [10, 54, 24, 35, 55, 25],
  3104. [19, 45, 15, 35, 46, 16],
  3105. // 33
  3106. [17, 145, 115, 1, 146, 116],
  3107. [14, 74, 46, 21, 75, 47],
  3108. [29, 54, 24, 19, 55, 25],
  3109. [11, 45, 15, 46, 46, 16],
  3110. // 34
  3111. [13, 145, 115, 6, 146, 116],
  3112. [14, 74, 46, 23, 75, 47],
  3113. [44, 54, 24, 7, 55, 25],
  3114. [59, 46, 16, 1, 47, 17],
  3115. // 35
  3116. [12, 151, 121, 7, 152, 122],
  3117. [12, 75, 47, 26, 76, 48],
  3118. [39, 54, 24, 14, 55, 25],
  3119. [22, 45, 15, 41, 46, 16],
  3120. // 36
  3121. [6, 151, 121, 14, 152, 122],
  3122. [6, 75, 47, 34, 76, 48],
  3123. [46, 54, 24, 10, 55, 25],
  3124. [2, 45, 15, 64, 46, 16],
  3125. // 37
  3126. [17, 152, 122, 4, 153, 123],
  3127. [29, 74, 46, 14, 75, 47],
  3128. [49, 54, 24, 10, 55, 25],
  3129. [24, 45, 15, 46, 46, 16],
  3130. // 38
  3131. [4, 152, 122, 18, 153, 123],
  3132. [13, 74, 46, 32, 75, 47],
  3133. [48, 54, 24, 14, 55, 25],
  3134. [42, 45, 15, 32, 46, 16],
  3135. // 39
  3136. [20, 147, 117, 4, 148, 118],
  3137. [40, 75, 47, 7, 76, 48],
  3138. [43, 54, 24, 22, 55, 25],
  3139. [10, 45, 15, 67, 46, 16],
  3140. // 40
  3141. [19, 148, 118, 6, 149, 119],
  3142. [18, 75, 47, 31, 76, 48],
  3143. [34, 54, 24, 34, 55, 25],
  3144. [20, 45, 15, 61, 46, 16]];
  3145. /**
  3146. * 根据数据获取对应版本
  3147. * @return {[type]} [description]
  3148. */
  3149. QRCodeAlg.prototype.getRightType = function () {
  3150. for (var typeNumber = 1; typeNumber < 41; typeNumber++) {
  3151. var rsBlock = RS_BLOCK_TABLE[(typeNumber - 1) * 4 + this.errorCorrectLevel];
  3152. if (rsBlock == undefined) {
  3153. throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + this.errorCorrectLevel);
  3154. }
  3155. var length = rsBlock.length / 3;
  3156. var totalDataCount = 0;
  3157. for (var i = 0; i < length; i++) {
  3158. var count = rsBlock[i * 3 + 0];
  3159. var dataCount = rsBlock[i * 3 + 2];
  3160. totalDataCount += dataCount * count;
  3161. }
  3162. var lengthBytes = typeNumber > 9 ? 2 : 1;
  3163. if (this.utf8bytes.length + lengthBytes < totalDataCount || typeNumber == 40) {
  3164. this.typeNumber = typeNumber;
  3165. this.rsBlock = rsBlock;
  3166. this.totalDataCount = totalDataCount;
  3167. break;
  3168. }
  3169. }
  3170. };
  3171. //---------------------------------------------------------------------
  3172. // QRBitBuffer
  3173. //---------------------------------------------------------------------
  3174. function QRBitBuffer() {
  3175. this.buffer = new Array();
  3176. this.length = 0;
  3177. }
  3178. QRBitBuffer.prototype = {
  3179. get: function get(index) {
  3180. var bufIndex = Math.floor(index / 8);
  3181. return this.buffer[bufIndex] >>> 7 - index % 8 & 1;
  3182. },
  3183. put: function put(num, length) {
  3184. for (var i = 0; i < length; i++) {
  3185. this.putBit(num >>> length - i - 1 & 1);
  3186. }
  3187. },
  3188. putBit: function putBit(bit) {
  3189. var bufIndex = Math.floor(this.length / 8);
  3190. if (this.buffer.length <= bufIndex) {
  3191. this.buffer.push(0);
  3192. }
  3193. if (bit) {
  3194. this.buffer[bufIndex] |= 0x80 >>> this.length % 8;
  3195. }
  3196. this.length++;
  3197. } };
  3198. // xzedit
  3199. var qrcodeAlgObjCache = [];
  3200. /**
  3201. * 二维码构造函数,主要用于绘制
  3202. * @param {参数列表} opt 传递参数
  3203. * @return {}
  3204. */
  3205. QRCode = function QRCode(opt) {
  3206. //设置默认参数
  3207. this.options = {
  3208. text: '',
  3209. size: 256,
  3210. correctLevel: 3,
  3211. background: '#ffffff',
  3212. foreground: '#000000',
  3213. pdground: '#000000',
  3214. image: '',
  3215. imageSize: 30,
  3216. canvasId: opt.canvasId,
  3217. context: opt.context,
  3218. usingComponents: opt.usingComponents,
  3219. showLoading: opt.showLoading,
  3220. loadingText: opt.loadingText };
  3221. if (typeof opt === 'string') {// 只编码ASCII字符串
  3222. opt = {
  3223. text: opt };
  3224. }
  3225. if (opt) {
  3226. for (var i in opt) {
  3227. this.options[i] = opt[i];
  3228. }
  3229. }
  3230. //使用QRCodeAlg创建二维码结构
  3231. var qrCodeAlg = null;
  3232. for (var i = 0, l = qrcodeAlgObjCache.length; i < l; i++) {
  3233. if (qrcodeAlgObjCache[i].text == this.options.text && qrcodeAlgObjCache[i].text.correctLevel == this.options.correctLevel) {
  3234. qrCodeAlg = qrcodeAlgObjCache[i].obj;
  3235. break;
  3236. }
  3237. }
  3238. if (i == l) {
  3239. qrCodeAlg = new QRCodeAlg(this.options.text, this.options.correctLevel);
  3240. qrcodeAlgObjCache.push({
  3241. text: this.options.text,
  3242. correctLevel: this.options.correctLevel,
  3243. obj: qrCodeAlg });
  3244. }
  3245. /**
  3246. * 计算矩阵点的前景色
  3247. * @param {Obj} config
  3248. * @param {Number} config.row 点x坐标
  3249. * @param {Number} config.col 点y坐标
  3250. * @param {Number} config.count 矩阵大小
  3251. * @param {Number} config.options 组件的options
  3252. * @return {String}
  3253. */
  3254. var getForeGround = function getForeGround(config) {
  3255. var options = config.options;
  3256. if (options.pdground && (
  3257. config.row > 1 && config.row < 5 && config.col > 1 && config.col < 5 ||
  3258. config.row > config.count - 6 && config.row < config.count - 2 && config.col > 1 && config.col < 5 ||
  3259. config.row > 1 && config.row < 5 && config.col > config.count - 6 && config.col < config.count - 2))
  3260. {
  3261. return options.pdground;
  3262. }
  3263. return options.foreground;
  3264. };
  3265. // 创建canvas
  3266. var createCanvas = function createCanvas(options) {
  3267. if (options.showLoading) {
  3268. uni.showLoading({
  3269. title: options.loadingText,
  3270. mask: true });
  3271. }
  3272. var ctx = uni.createCanvasContext(options.canvasId, options.context);
  3273. var count = qrCodeAlg.getModuleCount();
  3274. var ratioSize = options.size;
  3275. var ratioImgSize = options.imageSize;
  3276. //计算每个点的长宽
  3277. var tileW = (ratioSize / count).toPrecision(4);
  3278. var tileH = (ratioSize / count).toPrecision(4);
  3279. //绘制
  3280. for (var row = 0; row < count; row++) {
  3281. for (var col = 0; col < count; col++) {
  3282. var w = Math.ceil((col + 1) * tileW) - Math.floor(col * tileW);
  3283. var h = Math.ceil((row + 1) * tileW) - Math.floor(row * tileW);
  3284. var foreground = getForeGround({
  3285. row: row,
  3286. col: col,
  3287. count: count,
  3288. options: options });
  3289. ctx.setFillStyle(qrCodeAlg.modules[row][col] ? foreground : options.background);
  3290. ctx.fillRect(Math.round(col * tileW), Math.round(row * tileH), w, h);
  3291. }
  3292. }
  3293. if (options.image) {
  3294. // 画圆角矩形
  3295. var drawRoundedRect = function drawRoundedRect(ctxi, x, y, width, height, r, lineWidth, fill, stroke) {
  3296. ctxi.setLineWidth(lineWidth);
  3297. ctxi.setFillStyle(options.background);
  3298. ctxi.setStrokeStyle(options.background);
  3299. ctxi.beginPath(); // draw top and top right corner
  3300. ctxi.moveTo(x + r, y);
  3301. ctxi.arcTo(x + width, y, x + width, y + r, r); // draw right side and bottom right corner
  3302. ctxi.arcTo(x + width, y + height, x + width - r, y + height, r); // draw bottom and bottom left corner
  3303. ctxi.arcTo(x, y + height, x, y + height - r, r); // draw left and top left corner
  3304. ctxi.arcTo(x, y, x + r, y, r);
  3305. ctxi.closePath();
  3306. if (fill) {
  3307. ctxi.fill();
  3308. }
  3309. if (stroke) {
  3310. ctxi.stroke();
  3311. }
  3312. };var x = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));var y = Number(((ratioSize - ratioImgSize) / 2).toFixed(2));drawRoundedRect(ctx, x, y, ratioImgSize, ratioImgSize, 2, 6, true, true);ctx.drawImage(options.image, x, y, ratioImgSize, ratioImgSize);
  3313. }
  3314. setTimeout(function () {
  3315. ctx.draw(true, function () {
  3316. // 保存到临时区域
  3317. setTimeout(function () {
  3318. uni.canvasToTempFilePath({
  3319. width: options.width,
  3320. height: options.height,
  3321. destWidth: options.width,
  3322. destHeight: options.height,
  3323. canvasId: options.canvasId,
  3324. quality: Number(1),
  3325. success: function success(res) {
  3326. if (options.cbResult) {
  3327. options.cbResult(res.tempFilePath);
  3328. }
  3329. },
  3330. fail: function fail(res) {
  3331. if (options.cbResult) {
  3332. options.cbResult(res);
  3333. }
  3334. },
  3335. complete: function complete() {
  3336. if (options.showLoading) {
  3337. uni.hideLoading();
  3338. }
  3339. } },
  3340. options.context);
  3341. }, options.text.length + 100);
  3342. });
  3343. }, options.usingComponents ? 0 : 150);
  3344. };
  3345. createCanvas(this.options);
  3346. // 空判定
  3347. var empty = function empty(v) {
  3348. var tp = typeof v,
  3349. rt = false;
  3350. if (tp == "number" && String(v) == "") {
  3351. rt = true;
  3352. } else if (tp == "undefined") {
  3353. rt = true;
  3354. } else if (tp == "object") {
  3355. if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true;
  3356. } else if (tp == "string") {
  3357. if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true;
  3358. } else if (tp == "function") {
  3359. rt = false;
  3360. }
  3361. return rt;
  3362. };
  3363. };
  3364. QRCode.prototype.clear = function (fn) {
  3365. var ctx = uni.createCanvasContext(this.options.canvasId, this.options.context);
  3366. ctx.clearRect(0, 0, this.options.size, this.options.size);
  3367. ctx.draw(false, function () {
  3368. if (fn) {
  3369. fn();
  3370. }
  3371. });
  3372. };
  3373. })();var _default =
  3374. QRCode;exports.default = _default;
  3375. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3376. /***/ }),
  3377. /***/ 281:
  3378. /*!********************************************************************************************************!*\
  3379. !*** /Users/guo/Desktop/txCar/uni_modules/uni-transition/components/uni-transition/createAnimation.js ***!
  3380. \********************************************************************************************************/
  3381. /*! no static exports found */
  3382. /***/ (function(module, exports, __webpack_require__) {
  3383. "use strict";
  3384. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.createAnimation = createAnimation;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;}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;} // const defaultOption = {
  3385. // duration: 300,
  3386. // timingFunction: 'linear',
  3387. // delay: 0,
  3388. // transformOrigin: '50% 50% 0'
  3389. // }
  3390. var
  3391. MPAnimation = /*#__PURE__*/function () {
  3392. function MPAnimation(options, _this) {_classCallCheck(this, MPAnimation);
  3393. this.options = options;
  3394. this.animation = uni.createAnimation(options);
  3395. this.currentStepAnimates = {};
  3396. this.next = 0;
  3397. this.$ = _this;
  3398. }_createClass(MPAnimation, [{ key: "_nvuePushAnimates", value: function _nvuePushAnimates(
  3399. type, args) {
  3400. var aniObj = this.currentStepAnimates[this.next];
  3401. var styles = {};
  3402. if (!aniObj) {
  3403. styles = {
  3404. styles: {},
  3405. config: {} };
  3406. } else {
  3407. styles = aniObj;
  3408. }
  3409. if (animateTypes1.includes(type)) {
  3410. if (!styles.styles.transform) {
  3411. styles.styles.transform = '';
  3412. }
  3413. var unit = '';
  3414. if (type === 'rotate') {
  3415. unit = 'deg';
  3416. }
  3417. styles.styles.transform += "".concat(type, "(").concat(args + unit, ") ");
  3418. } else {
  3419. styles.styles[type] = "".concat(args);
  3420. }
  3421. this.currentStepAnimates[this.next] = styles;
  3422. } }, { key: "_animateRun", value: function _animateRun()
  3423. {var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  3424. var ref = this.$.$refs['ani'].ref;
  3425. if (!ref) return;
  3426. return new Promise(function (resolve, reject) {
  3427. nvueAnimation.transition(ref, _objectSpread({
  3428. styles: styles },
  3429. config),
  3430. function (res) {
  3431. resolve();
  3432. });
  3433. });
  3434. } }, { key: "_nvueNextAnimate", value: function _nvueNextAnimate(
  3435. animates) {var _this2 = this;var step = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;var fn = arguments.length > 2 ? arguments[2] : undefined;
  3436. var obj = animates[step];
  3437. if (obj) {var
  3438. styles =
  3439. obj.styles,config = obj.config;
  3440. this._animateRun(styles, config).then(function () {
  3441. step += 1;
  3442. _this2._nvueNextAnimate(animates, step, fn);
  3443. });
  3444. } else {
  3445. this.currentStepAnimates = {};
  3446. typeof fn === 'function' && fn();
  3447. this.isEnd = true;
  3448. }
  3449. } }, { key: "step", value: function step()
  3450. {var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  3451. this.animation.step(config);
  3452. return this;
  3453. } }, { key: "run", value: function run(
  3454. fn) {
  3455. this.$.animationData = this.animation.export();
  3456. this.$.timer = setTimeout(function () {
  3457. typeof fn === 'function' && fn();
  3458. }, this.$.durationTime);
  3459. } }]);return MPAnimation;}();
  3460. var animateTypes1 = ['matrix', 'matrix3d', 'rotate', 'rotate3d', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scale3d',
  3461. 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'translate', 'translate3d', 'translateX', 'translateY',
  3462. 'translateZ'];
  3463. var animateTypes2 = ['opacity', 'backgroundColor'];
  3464. var animateTypes3 = ['width', 'height', 'left', 'right', 'top', 'bottom'];
  3465. animateTypes1.concat(animateTypes2, animateTypes3).forEach(function (type) {
  3466. MPAnimation.prototype[type] = function () {var _this$animation;
  3467. (_this$animation = this.animation)[type].apply(_this$animation, arguments);
  3468. return this;
  3469. };
  3470. });
  3471. function createAnimation(option, _this) {
  3472. if (!_this) return;
  3473. clearTimeout(_this.timer);
  3474. return new MPAnimation(option, _this);
  3475. }
  3476. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3477. /***/ }),
  3478. /***/ 3:
  3479. /*!******************************************************************************************!*\
  3480. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3481. \******************************************************************************************/
  3482. /*! exports provided: default */
  3483. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3484. "use strict";
  3485. __webpack_require__.r(__webpack_exports__);
  3486. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3487. * Vue.js v2.6.11
  3488. * (c) 2014-2021 Evan You
  3489. * Released under the MIT License.
  3490. */
  3491. /* */
  3492. var emptyObject = Object.freeze({});
  3493. // These helpers produce better VM code in JS engines due to their
  3494. // explicitness and function inlining.
  3495. function isUndef (v) {
  3496. return v === undefined || v === null
  3497. }
  3498. function isDef (v) {
  3499. return v !== undefined && v !== null
  3500. }
  3501. function isTrue (v) {
  3502. return v === true
  3503. }
  3504. function isFalse (v) {
  3505. return v === false
  3506. }
  3507. /**
  3508. * Check if value is primitive.
  3509. */
  3510. function isPrimitive (value) {
  3511. return (
  3512. typeof value === 'string' ||
  3513. typeof value === 'number' ||
  3514. // $flow-disable-line
  3515. typeof value === 'symbol' ||
  3516. typeof value === 'boolean'
  3517. )
  3518. }
  3519. /**
  3520. * Quick object check - this is primarily used to tell
  3521. * Objects from primitive values when we know the value
  3522. * is a JSON-compliant type.
  3523. */
  3524. function isObject (obj) {
  3525. return obj !== null && typeof obj === 'object'
  3526. }
  3527. /**
  3528. * Get the raw type string of a value, e.g., [object Object].
  3529. */
  3530. var _toString = Object.prototype.toString;
  3531. function toRawType (value) {
  3532. return _toString.call(value).slice(8, -1)
  3533. }
  3534. /**
  3535. * Strict object type check. Only returns true
  3536. * for plain JavaScript objects.
  3537. */
  3538. function isPlainObject (obj) {
  3539. return _toString.call(obj) === '[object Object]'
  3540. }
  3541. function isRegExp (v) {
  3542. return _toString.call(v) === '[object RegExp]'
  3543. }
  3544. /**
  3545. * Check if val is a valid array index.
  3546. */
  3547. function isValidArrayIndex (val) {
  3548. var n = parseFloat(String(val));
  3549. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3550. }
  3551. function isPromise (val) {
  3552. return (
  3553. isDef(val) &&
  3554. typeof val.then === 'function' &&
  3555. typeof val.catch === 'function'
  3556. )
  3557. }
  3558. /**
  3559. * Convert a value to a string that is actually rendered.
  3560. */
  3561. function toString (val) {
  3562. return val == null
  3563. ? ''
  3564. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3565. ? JSON.stringify(val, null, 2)
  3566. : String(val)
  3567. }
  3568. /**
  3569. * Convert an input value to a number for persistence.
  3570. * If the conversion fails, return original string.
  3571. */
  3572. function toNumber (val) {
  3573. var n = parseFloat(val);
  3574. return isNaN(n) ? val : n
  3575. }
  3576. /**
  3577. * Make a map and return a function for checking if a key
  3578. * is in that map.
  3579. */
  3580. function makeMap (
  3581. str,
  3582. expectsLowerCase
  3583. ) {
  3584. var map = Object.create(null);
  3585. var list = str.split(',');
  3586. for (var i = 0; i < list.length; i++) {
  3587. map[list[i]] = true;
  3588. }
  3589. return expectsLowerCase
  3590. ? function (val) { return map[val.toLowerCase()]; }
  3591. : function (val) { return map[val]; }
  3592. }
  3593. /**
  3594. * Check if a tag is a built-in tag.
  3595. */
  3596. var isBuiltInTag = makeMap('slot,component', true);
  3597. /**
  3598. * Check if an attribute is a reserved attribute.
  3599. */
  3600. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3601. /**
  3602. * Remove an item from an array.
  3603. */
  3604. function remove (arr, item) {
  3605. if (arr.length) {
  3606. var index = arr.indexOf(item);
  3607. if (index > -1) {
  3608. return arr.splice(index, 1)
  3609. }
  3610. }
  3611. }
  3612. /**
  3613. * Check whether an object has the property.
  3614. */
  3615. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3616. function hasOwn (obj, key) {
  3617. return hasOwnProperty.call(obj, key)
  3618. }
  3619. /**
  3620. * Create a cached version of a pure function.
  3621. */
  3622. function cached (fn) {
  3623. var cache = Object.create(null);
  3624. return (function cachedFn (str) {
  3625. var hit = cache[str];
  3626. return hit || (cache[str] = fn(str))
  3627. })
  3628. }
  3629. /**
  3630. * Camelize a hyphen-delimited string.
  3631. */
  3632. var camelizeRE = /-(\w)/g;
  3633. var camelize = cached(function (str) {
  3634. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3635. });
  3636. /**
  3637. * Capitalize a string.
  3638. */
  3639. var capitalize = cached(function (str) {
  3640. return str.charAt(0).toUpperCase() + str.slice(1)
  3641. });
  3642. /**
  3643. * Hyphenate a camelCase string.
  3644. */
  3645. var hyphenateRE = /\B([A-Z])/g;
  3646. var hyphenate = cached(function (str) {
  3647. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3648. });
  3649. /**
  3650. * Simple bind polyfill for environments that do not support it,
  3651. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3652. * since native bind is now performant enough in most browsers.
  3653. * But removing it would mean breaking code that was able to run in
  3654. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3655. */
  3656. /* istanbul ignore next */
  3657. function polyfillBind (fn, ctx) {
  3658. function boundFn (a) {
  3659. var l = arguments.length;
  3660. return l
  3661. ? l > 1
  3662. ? fn.apply(ctx, arguments)
  3663. : fn.call(ctx, a)
  3664. : fn.call(ctx)
  3665. }
  3666. boundFn._length = fn.length;
  3667. return boundFn
  3668. }
  3669. function nativeBind (fn, ctx) {
  3670. return fn.bind(ctx)
  3671. }
  3672. var bind = Function.prototype.bind
  3673. ? nativeBind
  3674. : polyfillBind;
  3675. /**
  3676. * Convert an Array-like object to a real Array.
  3677. */
  3678. function toArray (list, start) {
  3679. start = start || 0;
  3680. var i = list.length - start;
  3681. var ret = new Array(i);
  3682. while (i--) {
  3683. ret[i] = list[i + start];
  3684. }
  3685. return ret
  3686. }
  3687. /**
  3688. * Mix properties into target object.
  3689. */
  3690. function extend (to, _from) {
  3691. for (var key in _from) {
  3692. to[key] = _from[key];
  3693. }
  3694. return to
  3695. }
  3696. /**
  3697. * Merge an Array of Objects into a single Object.
  3698. */
  3699. function toObject (arr) {
  3700. var res = {};
  3701. for (var i = 0; i < arr.length; i++) {
  3702. if (arr[i]) {
  3703. extend(res, arr[i]);
  3704. }
  3705. }
  3706. return res
  3707. }
  3708. /* eslint-disable no-unused-vars */
  3709. /**
  3710. * Perform no operation.
  3711. * Stubbing args to make Flow happy without leaving useless transpiled code
  3712. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3713. */
  3714. function noop (a, b, c) {}
  3715. /**
  3716. * Always return false.
  3717. */
  3718. var no = function (a, b, c) { return false; };
  3719. /* eslint-enable no-unused-vars */
  3720. /**
  3721. * Return the same value.
  3722. */
  3723. var identity = function (_) { return _; };
  3724. /**
  3725. * Check if two values are loosely equal - that is,
  3726. * if they are plain objects, do they have the same shape?
  3727. */
  3728. function looseEqual (a, b) {
  3729. if (a === b) { return true }
  3730. var isObjectA = isObject(a);
  3731. var isObjectB = isObject(b);
  3732. if (isObjectA && isObjectB) {
  3733. try {
  3734. var isArrayA = Array.isArray(a);
  3735. var isArrayB = Array.isArray(b);
  3736. if (isArrayA && isArrayB) {
  3737. return a.length === b.length && a.every(function (e, i) {
  3738. return looseEqual(e, b[i])
  3739. })
  3740. } else if (a instanceof Date && b instanceof Date) {
  3741. return a.getTime() === b.getTime()
  3742. } else if (!isArrayA && !isArrayB) {
  3743. var keysA = Object.keys(a);
  3744. var keysB = Object.keys(b);
  3745. return keysA.length === keysB.length && keysA.every(function (key) {
  3746. return looseEqual(a[key], b[key])
  3747. })
  3748. } else {
  3749. /* istanbul ignore next */
  3750. return false
  3751. }
  3752. } catch (e) {
  3753. /* istanbul ignore next */
  3754. return false
  3755. }
  3756. } else if (!isObjectA && !isObjectB) {
  3757. return String(a) === String(b)
  3758. } else {
  3759. return false
  3760. }
  3761. }
  3762. /**
  3763. * Return the first index at which a loosely equal value can be
  3764. * found in the array (if value is a plain object, the array must
  3765. * contain an object of the same shape), or -1 if it is not present.
  3766. */
  3767. function looseIndexOf (arr, val) {
  3768. for (var i = 0; i < arr.length; i++) {
  3769. if (looseEqual(arr[i], val)) { return i }
  3770. }
  3771. return -1
  3772. }
  3773. /**
  3774. * Ensure a function is called only once.
  3775. */
  3776. function once (fn) {
  3777. var called = false;
  3778. return function () {
  3779. if (!called) {
  3780. called = true;
  3781. fn.apply(this, arguments);
  3782. }
  3783. }
  3784. }
  3785. var ASSET_TYPES = [
  3786. 'component',
  3787. 'directive',
  3788. 'filter'
  3789. ];
  3790. var LIFECYCLE_HOOKS = [
  3791. 'beforeCreate',
  3792. 'created',
  3793. 'beforeMount',
  3794. 'mounted',
  3795. 'beforeUpdate',
  3796. 'updated',
  3797. 'beforeDestroy',
  3798. 'destroyed',
  3799. 'activated',
  3800. 'deactivated',
  3801. 'errorCaptured',
  3802. 'serverPrefetch'
  3803. ];
  3804. /* */
  3805. var config = ({
  3806. /**
  3807. * Option merge strategies (used in core/util/options)
  3808. */
  3809. // $flow-disable-line
  3810. optionMergeStrategies: Object.create(null),
  3811. /**
  3812. * Whether to suppress warnings.
  3813. */
  3814. silent: false,
  3815. /**
  3816. * Show production mode tip message on boot?
  3817. */
  3818. productionTip: "development" !== 'production',
  3819. /**
  3820. * Whether to enable devtools
  3821. */
  3822. devtools: "development" !== 'production',
  3823. /**
  3824. * Whether to record perf
  3825. */
  3826. performance: false,
  3827. /**
  3828. * Error handler for watcher errors
  3829. */
  3830. errorHandler: null,
  3831. /**
  3832. * Warn handler for watcher warns
  3833. */
  3834. warnHandler: null,
  3835. /**
  3836. * Ignore certain custom elements
  3837. */
  3838. ignoredElements: [],
  3839. /**
  3840. * Custom user key aliases for v-on
  3841. */
  3842. // $flow-disable-line
  3843. keyCodes: Object.create(null),
  3844. /**
  3845. * Check if a tag is reserved so that it cannot be registered as a
  3846. * component. This is platform-dependent and may be overwritten.
  3847. */
  3848. isReservedTag: no,
  3849. /**
  3850. * Check if an attribute is reserved so that it cannot be used as a component
  3851. * prop. This is platform-dependent and may be overwritten.
  3852. */
  3853. isReservedAttr: no,
  3854. /**
  3855. * Check if a tag is an unknown element.
  3856. * Platform-dependent.
  3857. */
  3858. isUnknownElement: no,
  3859. /**
  3860. * Get the namespace of an element
  3861. */
  3862. getTagNamespace: noop,
  3863. /**
  3864. * Parse the real tag name for the specific platform.
  3865. */
  3866. parsePlatformTagName: identity,
  3867. /**
  3868. * Check if an attribute must be bound using property, e.g. value
  3869. * Platform-dependent.
  3870. */
  3871. mustUseProp: no,
  3872. /**
  3873. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3874. * This will significantly reduce performance if set to false.
  3875. */
  3876. async: true,
  3877. /**
  3878. * Exposed for legacy reasons
  3879. */
  3880. _lifecycleHooks: LIFECYCLE_HOOKS
  3881. });
  3882. /* */
  3883. /**
  3884. * unicode letters used for parsing html tags, component names and property paths.
  3885. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3886. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3887. */
  3888. 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/;
  3889. /**
  3890. * Check if a string starts with $ or _
  3891. */
  3892. function isReserved (str) {
  3893. var c = (str + '').charCodeAt(0);
  3894. return c === 0x24 || c === 0x5F
  3895. }
  3896. /**
  3897. * Define a property.
  3898. */
  3899. function def (obj, key, val, enumerable) {
  3900. Object.defineProperty(obj, key, {
  3901. value: val,
  3902. enumerable: !!enumerable,
  3903. writable: true,
  3904. configurable: true
  3905. });
  3906. }
  3907. /**
  3908. * Parse simple path.
  3909. */
  3910. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3911. function parsePath (path) {
  3912. if (bailRE.test(path)) {
  3913. return
  3914. }
  3915. var segments = path.split('.');
  3916. return function (obj) {
  3917. for (var i = 0; i < segments.length; i++) {
  3918. if (!obj) { return }
  3919. obj = obj[segments[i]];
  3920. }
  3921. return obj
  3922. }
  3923. }
  3924. /* */
  3925. // can we use __proto__?
  3926. var hasProto = '__proto__' in {};
  3927. // Browser environment sniffing
  3928. var inBrowser = typeof window !== 'undefined';
  3929. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3930. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3931. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3932. var isIE = UA && /msie|trident/.test(UA);
  3933. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3934. var isEdge = UA && UA.indexOf('edge/') > 0;
  3935. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  3936. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  3937. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  3938. var isPhantomJS = UA && /phantomjs/.test(UA);
  3939. var isFF = UA && UA.match(/firefox\/(\d+)/);
  3940. // Firefox has a "watch" function on Object.prototype...
  3941. var nativeWatch = ({}).watch;
  3942. if (inBrowser) {
  3943. try {
  3944. var opts = {};
  3945. Object.defineProperty(opts, 'passive', ({
  3946. get: function get () {
  3947. }
  3948. })); // https://github.com/facebook/flow/issues/285
  3949. window.addEventListener('test-passive', null, opts);
  3950. } catch (e) {}
  3951. }
  3952. // this needs to be lazy-evaled because vue may be required before
  3953. // vue-server-renderer can set VUE_ENV
  3954. var _isServer;
  3955. var isServerRendering = function () {
  3956. if (_isServer === undefined) {
  3957. /* istanbul ignore if */
  3958. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  3959. // detect presence of vue-server-renderer and avoid
  3960. // Webpack shimming the process
  3961. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  3962. } else {
  3963. _isServer = false;
  3964. }
  3965. }
  3966. return _isServer
  3967. };
  3968. // detect devtools
  3969. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  3970. /* istanbul ignore next */
  3971. function isNative (Ctor) {
  3972. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  3973. }
  3974. var hasSymbol =
  3975. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  3976. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  3977. var _Set;
  3978. /* istanbul ignore if */ // $flow-disable-line
  3979. if (typeof Set !== 'undefined' && isNative(Set)) {
  3980. // use native Set when available.
  3981. _Set = Set;
  3982. } else {
  3983. // a non-standard Set polyfill that only works with primitive keys.
  3984. _Set = /*@__PURE__*/(function () {
  3985. function Set () {
  3986. this.set = Object.create(null);
  3987. }
  3988. Set.prototype.has = function has (key) {
  3989. return this.set[key] === true
  3990. };
  3991. Set.prototype.add = function add (key) {
  3992. this.set[key] = true;
  3993. };
  3994. Set.prototype.clear = function clear () {
  3995. this.set = Object.create(null);
  3996. };
  3997. return Set;
  3998. }());
  3999. }
  4000. /* */
  4001. var warn = noop;
  4002. var tip = noop;
  4003. var generateComponentTrace = (noop); // work around flow check
  4004. var formatComponentName = (noop);
  4005. if (true) {
  4006. var hasConsole = typeof console !== 'undefined';
  4007. var classifyRE = /(?:^|[-_])(\w)/g;
  4008. var classify = function (str) { return str
  4009. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  4010. .replace(/[-_]/g, ''); };
  4011. warn = function (msg, vm) {
  4012. var trace = vm ? generateComponentTrace(vm) : '';
  4013. if (config.warnHandler) {
  4014. config.warnHandler.call(null, msg, vm, trace);
  4015. } else if (hasConsole && (!config.silent)) {
  4016. console.error(("[Vue warn]: " + msg + trace));
  4017. }
  4018. };
  4019. tip = function (msg, vm) {
  4020. if (hasConsole && (!config.silent)) {
  4021. console.warn("[Vue tip]: " + msg + (
  4022. vm ? generateComponentTrace(vm) : ''
  4023. ));
  4024. }
  4025. };
  4026. formatComponentName = function (vm, includeFile) {
  4027. if (vm.$root === vm) {
  4028. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  4029. return ('') + vm.$options.__file
  4030. }
  4031. return '<Root>'
  4032. }
  4033. var options = typeof vm === 'function' && vm.cid != null
  4034. ? vm.options
  4035. : vm._isVue
  4036. ? vm.$options || vm.constructor.options
  4037. : vm;
  4038. var name = options.name || options._componentTag;
  4039. var file = options.__file;
  4040. if (!name && file) {
  4041. var match = file.match(/([^/\\]+)\.vue$/);
  4042. name = match && match[1];
  4043. }
  4044. return (
  4045. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  4046. (file && includeFile !== false ? (" at " + file) : '')
  4047. )
  4048. };
  4049. var repeat = function (str, n) {
  4050. var res = '';
  4051. while (n) {
  4052. if (n % 2 === 1) { res += str; }
  4053. if (n > 1) { str += str; }
  4054. n >>= 1;
  4055. }
  4056. return res
  4057. };
  4058. generateComponentTrace = function (vm) {
  4059. if (vm._isVue && vm.$parent) {
  4060. var tree = [];
  4061. var currentRecursiveSequence = 0;
  4062. while (vm && vm.$options.name !== 'PageBody') {
  4063. if (tree.length > 0) {
  4064. var last = tree[tree.length - 1];
  4065. if (last.constructor === vm.constructor) {
  4066. currentRecursiveSequence++;
  4067. vm = vm.$parent;
  4068. continue
  4069. } else if (currentRecursiveSequence > 0) {
  4070. tree[tree.length - 1] = [last, currentRecursiveSequence];
  4071. currentRecursiveSequence = 0;
  4072. }
  4073. }
  4074. !vm.$options.isReserved && tree.push(vm);
  4075. vm = vm.$parent;
  4076. }
  4077. return '\n\nfound in\n\n' + tree
  4078. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  4079. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  4080. : formatComponentName(vm))); })
  4081. .join('\n')
  4082. } else {
  4083. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  4084. }
  4085. };
  4086. }
  4087. /* */
  4088. var uid = 0;
  4089. /**
  4090. * A dep is an observable that can have multiple
  4091. * directives subscribing to it.
  4092. */
  4093. var Dep = function Dep () {
  4094. this.id = uid++;
  4095. this.subs = [];
  4096. };
  4097. Dep.prototype.addSub = function addSub (sub) {
  4098. this.subs.push(sub);
  4099. };
  4100. Dep.prototype.removeSub = function removeSub (sub) {
  4101. remove(this.subs, sub);
  4102. };
  4103. Dep.prototype.depend = function depend () {
  4104. if (Dep.SharedObject.target) {
  4105. Dep.SharedObject.target.addDep(this);
  4106. }
  4107. };
  4108. Dep.prototype.notify = function notify () {
  4109. // stabilize the subscriber list first
  4110. var subs = this.subs.slice();
  4111. if ( true && !config.async) {
  4112. // subs aren't sorted in scheduler if not running async
  4113. // we need to sort them now to make sure they fire in correct
  4114. // order
  4115. subs.sort(function (a, b) { return a.id - b.id; });
  4116. }
  4117. for (var i = 0, l = subs.length; i < l; i++) {
  4118. subs[i].update();
  4119. }
  4120. };
  4121. // The current target watcher being evaluated.
  4122. // This is globally unique because only one watcher
  4123. // can be evaluated at a time.
  4124. // fixed by xxxxxx (nvue shared vuex)
  4125. /* eslint-disable no-undef */
  4126. Dep.SharedObject = {};
  4127. Dep.SharedObject.target = null;
  4128. Dep.SharedObject.targetStack = [];
  4129. function pushTarget (target) {
  4130. Dep.SharedObject.targetStack.push(target);
  4131. Dep.SharedObject.target = target;
  4132. Dep.target = target;
  4133. }
  4134. function popTarget () {
  4135. Dep.SharedObject.targetStack.pop();
  4136. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  4137. Dep.target = Dep.SharedObject.target;
  4138. }
  4139. /* */
  4140. var VNode = function VNode (
  4141. tag,
  4142. data,
  4143. children,
  4144. text,
  4145. elm,
  4146. context,
  4147. componentOptions,
  4148. asyncFactory
  4149. ) {
  4150. this.tag = tag;
  4151. this.data = data;
  4152. this.children = children;
  4153. this.text = text;
  4154. this.elm = elm;
  4155. this.ns = undefined;
  4156. this.context = context;
  4157. this.fnContext = undefined;
  4158. this.fnOptions = undefined;
  4159. this.fnScopeId = undefined;
  4160. this.key = data && data.key;
  4161. this.componentOptions = componentOptions;
  4162. this.componentInstance = undefined;
  4163. this.parent = undefined;
  4164. this.raw = false;
  4165. this.isStatic = false;
  4166. this.isRootInsert = true;
  4167. this.isComment = false;
  4168. this.isCloned = false;
  4169. this.isOnce = false;
  4170. this.asyncFactory = asyncFactory;
  4171. this.asyncMeta = undefined;
  4172. this.isAsyncPlaceholder = false;
  4173. };
  4174. var prototypeAccessors = { child: { configurable: true } };
  4175. // DEPRECATED: alias for componentInstance for backwards compat.
  4176. /* istanbul ignore next */
  4177. prototypeAccessors.child.get = function () {
  4178. return this.componentInstance
  4179. };
  4180. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4181. var createEmptyVNode = function (text) {
  4182. if ( text === void 0 ) text = '';
  4183. var node = new VNode();
  4184. node.text = text;
  4185. node.isComment = true;
  4186. return node
  4187. };
  4188. function createTextVNode (val) {
  4189. return new VNode(undefined, undefined, undefined, String(val))
  4190. }
  4191. // optimized shallow clone
  4192. // used for static nodes and slot nodes because they may be reused across
  4193. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4194. // on their elm reference.
  4195. function cloneVNode (vnode) {
  4196. var cloned = new VNode(
  4197. vnode.tag,
  4198. vnode.data,
  4199. // #7975
  4200. // clone children array to avoid mutating original in case of cloning
  4201. // a child.
  4202. vnode.children && vnode.children.slice(),
  4203. vnode.text,
  4204. vnode.elm,
  4205. vnode.context,
  4206. vnode.componentOptions,
  4207. vnode.asyncFactory
  4208. );
  4209. cloned.ns = vnode.ns;
  4210. cloned.isStatic = vnode.isStatic;
  4211. cloned.key = vnode.key;
  4212. cloned.isComment = vnode.isComment;
  4213. cloned.fnContext = vnode.fnContext;
  4214. cloned.fnOptions = vnode.fnOptions;
  4215. cloned.fnScopeId = vnode.fnScopeId;
  4216. cloned.asyncMeta = vnode.asyncMeta;
  4217. cloned.isCloned = true;
  4218. return cloned
  4219. }
  4220. /*
  4221. * not type checking this file because flow doesn't play well with
  4222. * dynamically accessing methods on Array prototype
  4223. */
  4224. var arrayProto = Array.prototype;
  4225. var arrayMethods = Object.create(arrayProto);
  4226. var methodsToPatch = [
  4227. 'push',
  4228. 'pop',
  4229. 'shift',
  4230. 'unshift',
  4231. 'splice',
  4232. 'sort',
  4233. 'reverse'
  4234. ];
  4235. /**
  4236. * Intercept mutating methods and emit events
  4237. */
  4238. methodsToPatch.forEach(function (method) {
  4239. // cache original method
  4240. var original = arrayProto[method];
  4241. def(arrayMethods, method, function mutator () {
  4242. var args = [], len = arguments.length;
  4243. while ( len-- ) args[ len ] = arguments[ len ];
  4244. var result = original.apply(this, args);
  4245. var ob = this.__ob__;
  4246. var inserted;
  4247. switch (method) {
  4248. case 'push':
  4249. case 'unshift':
  4250. inserted = args;
  4251. break
  4252. case 'splice':
  4253. inserted = args.slice(2);
  4254. break
  4255. }
  4256. if (inserted) { ob.observeArray(inserted); }
  4257. // notify change
  4258. ob.dep.notify();
  4259. return result
  4260. });
  4261. });
  4262. /* */
  4263. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4264. /**
  4265. * In some cases we may want to disable observation inside a component's
  4266. * update computation.
  4267. */
  4268. var shouldObserve = true;
  4269. function toggleObserving (value) {
  4270. shouldObserve = value;
  4271. }
  4272. /**
  4273. * Observer class that is attached to each observed
  4274. * object. Once attached, the observer converts the target
  4275. * object's property keys into getter/setters that
  4276. * collect dependencies and dispatch updates.
  4277. */
  4278. var Observer = function Observer (value) {
  4279. this.value = value;
  4280. this.dep = new Dep();
  4281. this.vmCount = 0;
  4282. def(value, '__ob__', this);
  4283. if (Array.isArray(value)) {
  4284. if (hasProto) {
  4285. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4286. if(value.push !== value.__proto__.push){
  4287. copyAugment(value, arrayMethods, arrayKeys);
  4288. } else {
  4289. protoAugment(value, arrayMethods);
  4290. }
  4291. }
  4292. } else {
  4293. copyAugment(value, arrayMethods, arrayKeys);
  4294. }
  4295. this.observeArray(value);
  4296. } else {
  4297. this.walk(value);
  4298. }
  4299. };
  4300. /**
  4301. * Walk through all properties and convert them into
  4302. * getter/setters. This method should only be called when
  4303. * value type is Object.
  4304. */
  4305. Observer.prototype.walk = function walk (obj) {
  4306. var keys = Object.keys(obj);
  4307. for (var i = 0; i < keys.length; i++) {
  4308. defineReactive$$1(obj, keys[i]);
  4309. }
  4310. };
  4311. /**
  4312. * Observe a list of Array items.
  4313. */
  4314. Observer.prototype.observeArray = function observeArray (items) {
  4315. for (var i = 0, l = items.length; i < l; i++) {
  4316. observe(items[i]);
  4317. }
  4318. };
  4319. // helpers
  4320. /**
  4321. * Augment a target Object or Array by intercepting
  4322. * the prototype chain using __proto__
  4323. */
  4324. function protoAugment (target, src) {
  4325. /* eslint-disable no-proto */
  4326. target.__proto__ = src;
  4327. /* eslint-enable no-proto */
  4328. }
  4329. /**
  4330. * Augment a target Object or Array by defining
  4331. * hidden properties.
  4332. */
  4333. /* istanbul ignore next */
  4334. function copyAugment (target, src, keys) {
  4335. for (var i = 0, l = keys.length; i < l; i++) {
  4336. var key = keys[i];
  4337. def(target, key, src[key]);
  4338. }
  4339. }
  4340. /**
  4341. * Attempt to create an observer instance for a value,
  4342. * returns the new observer if successfully observed,
  4343. * or the existing observer if the value already has one.
  4344. */
  4345. function observe (value, asRootData) {
  4346. if (!isObject(value) || value instanceof VNode) {
  4347. return
  4348. }
  4349. var ob;
  4350. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4351. ob = value.__ob__;
  4352. } else if (
  4353. shouldObserve &&
  4354. !isServerRendering() &&
  4355. (Array.isArray(value) || isPlainObject(value)) &&
  4356. Object.isExtensible(value) &&
  4357. !value._isVue
  4358. ) {
  4359. ob = new Observer(value);
  4360. }
  4361. if (asRootData && ob) {
  4362. ob.vmCount++;
  4363. }
  4364. return ob
  4365. }
  4366. /**
  4367. * Define a reactive property on an Object.
  4368. */
  4369. function defineReactive$$1 (
  4370. obj,
  4371. key,
  4372. val,
  4373. customSetter,
  4374. shallow
  4375. ) {
  4376. var dep = new Dep();
  4377. var property = Object.getOwnPropertyDescriptor(obj, key);
  4378. if (property && property.configurable === false) {
  4379. return
  4380. }
  4381. // cater for pre-defined getter/setters
  4382. var getter = property && property.get;
  4383. var setter = property && property.set;
  4384. if ((!getter || setter) && arguments.length === 2) {
  4385. val = obj[key];
  4386. }
  4387. var childOb = !shallow && observe(val);
  4388. Object.defineProperty(obj, key, {
  4389. enumerable: true,
  4390. configurable: true,
  4391. get: function reactiveGetter () {
  4392. var value = getter ? getter.call(obj) : val;
  4393. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4394. dep.depend();
  4395. if (childOb) {
  4396. childOb.dep.depend();
  4397. if (Array.isArray(value)) {
  4398. dependArray(value);
  4399. }
  4400. }
  4401. }
  4402. return value
  4403. },
  4404. set: function reactiveSetter (newVal) {
  4405. var value = getter ? getter.call(obj) : val;
  4406. /* eslint-disable no-self-compare */
  4407. if (newVal === value || (newVal !== newVal && value !== value)) {
  4408. return
  4409. }
  4410. /* eslint-enable no-self-compare */
  4411. if ( true && customSetter) {
  4412. customSetter();
  4413. }
  4414. // #7981: for accessor properties without setter
  4415. if (getter && !setter) { return }
  4416. if (setter) {
  4417. setter.call(obj, newVal);
  4418. } else {
  4419. val = newVal;
  4420. }
  4421. childOb = !shallow && observe(newVal);
  4422. dep.notify();
  4423. }
  4424. });
  4425. }
  4426. /**
  4427. * Set a property on an object. Adds the new property and
  4428. * triggers change notification if the property doesn't
  4429. * already exist.
  4430. */
  4431. function set (target, key, val) {
  4432. if ( true &&
  4433. (isUndef(target) || isPrimitive(target))
  4434. ) {
  4435. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4436. }
  4437. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4438. target.length = Math.max(target.length, key);
  4439. target.splice(key, 1, val);
  4440. return val
  4441. }
  4442. if (key in target && !(key in Object.prototype)) {
  4443. target[key] = val;
  4444. return val
  4445. }
  4446. var ob = (target).__ob__;
  4447. if (target._isVue || (ob && ob.vmCount)) {
  4448. true && warn(
  4449. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4450. 'at runtime - declare it upfront in the data option.'
  4451. );
  4452. return val
  4453. }
  4454. if (!ob) {
  4455. target[key] = val;
  4456. return val
  4457. }
  4458. defineReactive$$1(ob.value, key, val);
  4459. ob.dep.notify();
  4460. return val
  4461. }
  4462. /**
  4463. * Delete a property and trigger change if necessary.
  4464. */
  4465. function del (target, key) {
  4466. if ( true &&
  4467. (isUndef(target) || isPrimitive(target))
  4468. ) {
  4469. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4470. }
  4471. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4472. target.splice(key, 1);
  4473. return
  4474. }
  4475. var ob = (target).__ob__;
  4476. if (target._isVue || (ob && ob.vmCount)) {
  4477. true && warn(
  4478. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4479. '- just set it to null.'
  4480. );
  4481. return
  4482. }
  4483. if (!hasOwn(target, key)) {
  4484. return
  4485. }
  4486. delete target[key];
  4487. if (!ob) {
  4488. return
  4489. }
  4490. ob.dep.notify();
  4491. }
  4492. /**
  4493. * Collect dependencies on array elements when the array is touched, since
  4494. * we cannot intercept array element access like property getters.
  4495. */
  4496. function dependArray (value) {
  4497. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4498. e = value[i];
  4499. e && e.__ob__ && e.__ob__.dep.depend();
  4500. if (Array.isArray(e)) {
  4501. dependArray(e);
  4502. }
  4503. }
  4504. }
  4505. /* */
  4506. /**
  4507. * Option overwriting strategies are functions that handle
  4508. * how to merge a parent option value and a child option
  4509. * value into the final value.
  4510. */
  4511. var strats = config.optionMergeStrategies;
  4512. /**
  4513. * Options with restrictions
  4514. */
  4515. if (true) {
  4516. strats.el = strats.propsData = function (parent, child, vm, key) {
  4517. if (!vm) {
  4518. warn(
  4519. "option \"" + key + "\" can only be used during instance " +
  4520. 'creation with the `new` keyword.'
  4521. );
  4522. }
  4523. return defaultStrat(parent, child)
  4524. };
  4525. }
  4526. /**
  4527. * Helper that recursively merges two data objects together.
  4528. */
  4529. function mergeData (to, from) {
  4530. if (!from) { return to }
  4531. var key, toVal, fromVal;
  4532. var keys = hasSymbol
  4533. ? Reflect.ownKeys(from)
  4534. : Object.keys(from);
  4535. for (var i = 0; i < keys.length; i++) {
  4536. key = keys[i];
  4537. // in case the object is already observed...
  4538. if (key === '__ob__') { continue }
  4539. toVal = to[key];
  4540. fromVal = from[key];
  4541. if (!hasOwn(to, key)) {
  4542. set(to, key, fromVal);
  4543. } else if (
  4544. toVal !== fromVal &&
  4545. isPlainObject(toVal) &&
  4546. isPlainObject(fromVal)
  4547. ) {
  4548. mergeData(toVal, fromVal);
  4549. }
  4550. }
  4551. return to
  4552. }
  4553. /**
  4554. * Data
  4555. */
  4556. function mergeDataOrFn (
  4557. parentVal,
  4558. childVal,
  4559. vm
  4560. ) {
  4561. if (!vm) {
  4562. // in a Vue.extend merge, both should be functions
  4563. if (!childVal) {
  4564. return parentVal
  4565. }
  4566. if (!parentVal) {
  4567. return childVal
  4568. }
  4569. // when parentVal & childVal are both present,
  4570. // we need to return a function that returns the
  4571. // merged result of both functions... no need to
  4572. // check if parentVal is a function here because
  4573. // it has to be a function to pass previous merges.
  4574. return function mergedDataFn () {
  4575. return mergeData(
  4576. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4577. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4578. )
  4579. }
  4580. } else {
  4581. return function mergedInstanceDataFn () {
  4582. // instance merge
  4583. var instanceData = typeof childVal === 'function'
  4584. ? childVal.call(vm, vm)
  4585. : childVal;
  4586. var defaultData = typeof parentVal === 'function'
  4587. ? parentVal.call(vm, vm)
  4588. : parentVal;
  4589. if (instanceData) {
  4590. return mergeData(instanceData, defaultData)
  4591. } else {
  4592. return defaultData
  4593. }
  4594. }
  4595. }
  4596. }
  4597. strats.data = function (
  4598. parentVal,
  4599. childVal,
  4600. vm
  4601. ) {
  4602. if (!vm) {
  4603. if (childVal && typeof childVal !== 'function') {
  4604. true && warn(
  4605. 'The "data" option should be a function ' +
  4606. 'that returns a per-instance value in component ' +
  4607. 'definitions.',
  4608. vm
  4609. );
  4610. return parentVal
  4611. }
  4612. return mergeDataOrFn(parentVal, childVal)
  4613. }
  4614. return mergeDataOrFn(parentVal, childVal, vm)
  4615. };
  4616. /**
  4617. * Hooks and props are merged as arrays.
  4618. */
  4619. function mergeHook (
  4620. parentVal,
  4621. childVal
  4622. ) {
  4623. var res = childVal
  4624. ? parentVal
  4625. ? parentVal.concat(childVal)
  4626. : Array.isArray(childVal)
  4627. ? childVal
  4628. : [childVal]
  4629. : parentVal;
  4630. return res
  4631. ? dedupeHooks(res)
  4632. : res
  4633. }
  4634. function dedupeHooks (hooks) {
  4635. var res = [];
  4636. for (var i = 0; i < hooks.length; i++) {
  4637. if (res.indexOf(hooks[i]) === -1) {
  4638. res.push(hooks[i]);
  4639. }
  4640. }
  4641. return res
  4642. }
  4643. LIFECYCLE_HOOKS.forEach(function (hook) {
  4644. strats[hook] = mergeHook;
  4645. });
  4646. /**
  4647. * Assets
  4648. *
  4649. * When a vm is present (instance creation), we need to do
  4650. * a three-way merge between constructor options, instance
  4651. * options and parent options.
  4652. */
  4653. function mergeAssets (
  4654. parentVal,
  4655. childVal,
  4656. vm,
  4657. key
  4658. ) {
  4659. var res = Object.create(parentVal || null);
  4660. if (childVal) {
  4661. true && assertObjectType(key, childVal, vm);
  4662. return extend(res, childVal)
  4663. } else {
  4664. return res
  4665. }
  4666. }
  4667. ASSET_TYPES.forEach(function (type) {
  4668. strats[type + 's'] = mergeAssets;
  4669. });
  4670. /**
  4671. * Watchers.
  4672. *
  4673. * Watchers hashes should not overwrite one
  4674. * another, so we merge them as arrays.
  4675. */
  4676. strats.watch = function (
  4677. parentVal,
  4678. childVal,
  4679. vm,
  4680. key
  4681. ) {
  4682. // work around Firefox's Object.prototype.watch...
  4683. if (parentVal === nativeWatch) { parentVal = undefined; }
  4684. if (childVal === nativeWatch) { childVal = undefined; }
  4685. /* istanbul ignore if */
  4686. if (!childVal) { return Object.create(parentVal || null) }
  4687. if (true) {
  4688. assertObjectType(key, childVal, vm);
  4689. }
  4690. if (!parentVal) { return childVal }
  4691. var ret = {};
  4692. extend(ret, parentVal);
  4693. for (var key$1 in childVal) {
  4694. var parent = ret[key$1];
  4695. var child = childVal[key$1];
  4696. if (parent && !Array.isArray(parent)) {
  4697. parent = [parent];
  4698. }
  4699. ret[key$1] = parent
  4700. ? parent.concat(child)
  4701. : Array.isArray(child) ? child : [child];
  4702. }
  4703. return ret
  4704. };
  4705. /**
  4706. * Other object hashes.
  4707. */
  4708. strats.props =
  4709. strats.methods =
  4710. strats.inject =
  4711. strats.computed = function (
  4712. parentVal,
  4713. childVal,
  4714. vm,
  4715. key
  4716. ) {
  4717. if (childVal && "development" !== 'production') {
  4718. assertObjectType(key, childVal, vm);
  4719. }
  4720. if (!parentVal) { return childVal }
  4721. var ret = Object.create(null);
  4722. extend(ret, parentVal);
  4723. if (childVal) { extend(ret, childVal); }
  4724. return ret
  4725. };
  4726. strats.provide = mergeDataOrFn;
  4727. /**
  4728. * Default strategy.
  4729. */
  4730. var defaultStrat = function (parentVal, childVal) {
  4731. return childVal === undefined
  4732. ? parentVal
  4733. : childVal
  4734. };
  4735. /**
  4736. * Validate component names
  4737. */
  4738. function checkComponents (options) {
  4739. for (var key in options.components) {
  4740. validateComponentName(key);
  4741. }
  4742. }
  4743. function validateComponentName (name) {
  4744. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4745. warn(
  4746. 'Invalid component name: "' + name + '". Component names ' +
  4747. 'should conform to valid custom element name in html5 specification.'
  4748. );
  4749. }
  4750. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4751. warn(
  4752. 'Do not use built-in or reserved HTML elements as component ' +
  4753. 'id: ' + name
  4754. );
  4755. }
  4756. }
  4757. /**
  4758. * Ensure all props option syntax are normalized into the
  4759. * Object-based format.
  4760. */
  4761. function normalizeProps (options, vm) {
  4762. var props = options.props;
  4763. if (!props) { return }
  4764. var res = {};
  4765. var i, val, name;
  4766. if (Array.isArray(props)) {
  4767. i = props.length;
  4768. while (i--) {
  4769. val = props[i];
  4770. if (typeof val === 'string') {
  4771. name = camelize(val);
  4772. res[name] = { type: null };
  4773. } else if (true) {
  4774. warn('props must be strings when using array syntax.');
  4775. }
  4776. }
  4777. } else if (isPlainObject(props)) {
  4778. for (var key in props) {
  4779. val = props[key];
  4780. name = camelize(key);
  4781. res[name] = isPlainObject(val)
  4782. ? val
  4783. : { type: val };
  4784. }
  4785. } else if (true) {
  4786. warn(
  4787. "Invalid value for option \"props\": expected an Array or an Object, " +
  4788. "but got " + (toRawType(props)) + ".",
  4789. vm
  4790. );
  4791. }
  4792. options.props = res;
  4793. }
  4794. /**
  4795. * Normalize all injections into Object-based format
  4796. */
  4797. function normalizeInject (options, vm) {
  4798. var inject = options.inject;
  4799. if (!inject) { return }
  4800. var normalized = options.inject = {};
  4801. if (Array.isArray(inject)) {
  4802. for (var i = 0; i < inject.length; i++) {
  4803. normalized[inject[i]] = { from: inject[i] };
  4804. }
  4805. } else if (isPlainObject(inject)) {
  4806. for (var key in inject) {
  4807. var val = inject[key];
  4808. normalized[key] = isPlainObject(val)
  4809. ? extend({ from: key }, val)
  4810. : { from: val };
  4811. }
  4812. } else if (true) {
  4813. warn(
  4814. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4815. "but got " + (toRawType(inject)) + ".",
  4816. vm
  4817. );
  4818. }
  4819. }
  4820. /**
  4821. * Normalize raw function directives into object format.
  4822. */
  4823. function normalizeDirectives (options) {
  4824. var dirs = options.directives;
  4825. if (dirs) {
  4826. for (var key in dirs) {
  4827. var def$$1 = dirs[key];
  4828. if (typeof def$$1 === 'function') {
  4829. dirs[key] = { bind: def$$1, update: def$$1 };
  4830. }
  4831. }
  4832. }
  4833. }
  4834. function assertObjectType (name, value, vm) {
  4835. if (!isPlainObject(value)) {
  4836. warn(
  4837. "Invalid value for option \"" + name + "\": expected an Object, " +
  4838. "but got " + (toRawType(value)) + ".",
  4839. vm
  4840. );
  4841. }
  4842. }
  4843. /**
  4844. * Merge two option objects into a new one.
  4845. * Core utility used in both instantiation and inheritance.
  4846. */
  4847. function mergeOptions (
  4848. parent,
  4849. child,
  4850. vm
  4851. ) {
  4852. if (true) {
  4853. checkComponents(child);
  4854. }
  4855. if (typeof child === 'function') {
  4856. child = child.options;
  4857. }
  4858. normalizeProps(child, vm);
  4859. normalizeInject(child, vm);
  4860. normalizeDirectives(child);
  4861. // Apply extends and mixins on the child options,
  4862. // but only if it is a raw options object that isn't
  4863. // the result of another mergeOptions call.
  4864. // Only merged options has the _base property.
  4865. if (!child._base) {
  4866. if (child.extends) {
  4867. parent = mergeOptions(parent, child.extends, vm);
  4868. }
  4869. if (child.mixins) {
  4870. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4871. parent = mergeOptions(parent, child.mixins[i], vm);
  4872. }
  4873. }
  4874. }
  4875. var options = {};
  4876. var key;
  4877. for (key in parent) {
  4878. mergeField(key);
  4879. }
  4880. for (key in child) {
  4881. if (!hasOwn(parent, key)) {
  4882. mergeField(key);
  4883. }
  4884. }
  4885. function mergeField (key) {
  4886. var strat = strats[key] || defaultStrat;
  4887. options[key] = strat(parent[key], child[key], vm, key);
  4888. }
  4889. return options
  4890. }
  4891. /**
  4892. * Resolve an asset.
  4893. * This function is used because child instances need access
  4894. * to assets defined in its ancestor chain.
  4895. */
  4896. function resolveAsset (
  4897. options,
  4898. type,
  4899. id,
  4900. warnMissing
  4901. ) {
  4902. /* istanbul ignore if */
  4903. if (typeof id !== 'string') {
  4904. return
  4905. }
  4906. var assets = options[type];
  4907. // check local registration variations first
  4908. if (hasOwn(assets, id)) { return assets[id] }
  4909. var camelizedId = camelize(id);
  4910. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4911. var PascalCaseId = capitalize(camelizedId);
  4912. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4913. // fallback to prototype chain
  4914. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4915. if ( true && warnMissing && !res) {
  4916. warn(
  4917. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4918. options
  4919. );
  4920. }
  4921. return res
  4922. }
  4923. /* */
  4924. function validateProp (
  4925. key,
  4926. propOptions,
  4927. propsData,
  4928. vm
  4929. ) {
  4930. var prop = propOptions[key];
  4931. var absent = !hasOwn(propsData, key);
  4932. var value = propsData[key];
  4933. // boolean casting
  4934. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4935. if (booleanIndex > -1) {
  4936. if (absent && !hasOwn(prop, 'default')) {
  4937. value = false;
  4938. } else if (value === '' || value === hyphenate(key)) {
  4939. // only cast empty string / same name to boolean if
  4940. // boolean has higher priority
  4941. var stringIndex = getTypeIndex(String, prop.type);
  4942. if (stringIndex < 0 || booleanIndex < stringIndex) {
  4943. value = true;
  4944. }
  4945. }
  4946. }
  4947. // check default value
  4948. if (value === undefined) {
  4949. value = getPropDefaultValue(vm, prop, key);
  4950. // since the default value is a fresh copy,
  4951. // make sure to observe it.
  4952. var prevShouldObserve = shouldObserve;
  4953. toggleObserving(true);
  4954. observe(value);
  4955. toggleObserving(prevShouldObserve);
  4956. }
  4957. if (
  4958. true
  4959. ) {
  4960. assertProp(prop, key, value, vm, absent);
  4961. }
  4962. return value
  4963. }
  4964. /**
  4965. * Get the default value of a prop.
  4966. */
  4967. function getPropDefaultValue (vm, prop, key) {
  4968. // no default, return undefined
  4969. if (!hasOwn(prop, 'default')) {
  4970. return undefined
  4971. }
  4972. var def = prop.default;
  4973. // warn against non-factory defaults for Object & Array
  4974. if ( true && isObject(def)) {
  4975. warn(
  4976. 'Invalid default value for prop "' + key + '": ' +
  4977. 'Props with type Object/Array must use a factory function ' +
  4978. 'to return the default value.',
  4979. vm
  4980. );
  4981. }
  4982. // the raw prop value was also undefined from previous render,
  4983. // return previous default value to avoid unnecessary watcher trigger
  4984. if (vm && vm.$options.propsData &&
  4985. vm.$options.propsData[key] === undefined &&
  4986. vm._props[key] !== undefined
  4987. ) {
  4988. return vm._props[key]
  4989. }
  4990. // call factory function for non-Function types
  4991. // a value is Function if its prototype is function even across different execution context
  4992. return typeof def === 'function' && getType(prop.type) !== 'Function'
  4993. ? def.call(vm)
  4994. : def
  4995. }
  4996. /**
  4997. * Assert whether a prop is valid.
  4998. */
  4999. function assertProp (
  5000. prop,
  5001. name,
  5002. value,
  5003. vm,
  5004. absent
  5005. ) {
  5006. if (prop.required && absent) {
  5007. warn(
  5008. 'Missing required prop: "' + name + '"',
  5009. vm
  5010. );
  5011. return
  5012. }
  5013. if (value == null && !prop.required) {
  5014. return
  5015. }
  5016. var type = prop.type;
  5017. var valid = !type || type === true;
  5018. var expectedTypes = [];
  5019. if (type) {
  5020. if (!Array.isArray(type)) {
  5021. type = [type];
  5022. }
  5023. for (var i = 0; i < type.length && !valid; i++) {
  5024. var assertedType = assertType(value, type[i]);
  5025. expectedTypes.push(assertedType.expectedType || '');
  5026. valid = assertedType.valid;
  5027. }
  5028. }
  5029. if (!valid) {
  5030. warn(
  5031. getInvalidTypeMessage(name, value, expectedTypes),
  5032. vm
  5033. );
  5034. return
  5035. }
  5036. var validator = prop.validator;
  5037. if (validator) {
  5038. if (!validator(value)) {
  5039. warn(
  5040. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  5041. vm
  5042. );
  5043. }
  5044. }
  5045. }
  5046. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  5047. function assertType (value, type) {
  5048. var valid;
  5049. var expectedType = getType(type);
  5050. if (simpleCheckRE.test(expectedType)) {
  5051. var t = typeof value;
  5052. valid = t === expectedType.toLowerCase();
  5053. // for primitive wrapper objects
  5054. if (!valid && t === 'object') {
  5055. valid = value instanceof type;
  5056. }
  5057. } else if (expectedType === 'Object') {
  5058. valid = isPlainObject(value);
  5059. } else if (expectedType === 'Array') {
  5060. valid = Array.isArray(value);
  5061. } else {
  5062. valid = value instanceof type;
  5063. }
  5064. return {
  5065. valid: valid,
  5066. expectedType: expectedType
  5067. }
  5068. }
  5069. /**
  5070. * Use function string name to check built-in types,
  5071. * because a simple equality check will fail when running
  5072. * across different vms / iframes.
  5073. */
  5074. function getType (fn) {
  5075. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  5076. return match ? match[1] : ''
  5077. }
  5078. function isSameType (a, b) {
  5079. return getType(a) === getType(b)
  5080. }
  5081. function getTypeIndex (type, expectedTypes) {
  5082. if (!Array.isArray(expectedTypes)) {
  5083. return isSameType(expectedTypes, type) ? 0 : -1
  5084. }
  5085. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  5086. if (isSameType(expectedTypes[i], type)) {
  5087. return i
  5088. }
  5089. }
  5090. return -1
  5091. }
  5092. function getInvalidTypeMessage (name, value, expectedTypes) {
  5093. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  5094. " Expected " + (expectedTypes.map(capitalize).join(', '));
  5095. var expectedType = expectedTypes[0];
  5096. var receivedType = toRawType(value);
  5097. var expectedValue = styleValue(value, expectedType);
  5098. var receivedValue = styleValue(value, receivedType);
  5099. // check if we need to specify expected value
  5100. if (expectedTypes.length === 1 &&
  5101. isExplicable(expectedType) &&
  5102. !isBoolean(expectedType, receivedType)) {
  5103. message += " with value " + expectedValue;
  5104. }
  5105. message += ", got " + receivedType + " ";
  5106. // check if we need to specify received value
  5107. if (isExplicable(receivedType)) {
  5108. message += "with value " + receivedValue + ".";
  5109. }
  5110. return message
  5111. }
  5112. function styleValue (value, type) {
  5113. if (type === 'String') {
  5114. return ("\"" + value + "\"")
  5115. } else if (type === 'Number') {
  5116. return ("" + (Number(value)))
  5117. } else {
  5118. return ("" + value)
  5119. }
  5120. }
  5121. function isExplicable (value) {
  5122. var explicitTypes = ['string', 'number', 'boolean'];
  5123. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  5124. }
  5125. function isBoolean () {
  5126. var args = [], len = arguments.length;
  5127. while ( len-- ) args[ len ] = arguments[ len ];
  5128. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  5129. }
  5130. /* */
  5131. function handleError (err, vm, info) {
  5132. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  5133. // See: https://github.com/vuejs/vuex/issues/1505
  5134. pushTarget();
  5135. try {
  5136. if (vm) {
  5137. var cur = vm;
  5138. while ((cur = cur.$parent)) {
  5139. var hooks = cur.$options.errorCaptured;
  5140. if (hooks) {
  5141. for (var i = 0; i < hooks.length; i++) {
  5142. try {
  5143. var capture = hooks[i].call(cur, err, vm, info) === false;
  5144. if (capture) { return }
  5145. } catch (e) {
  5146. globalHandleError(e, cur, 'errorCaptured hook');
  5147. }
  5148. }
  5149. }
  5150. }
  5151. }
  5152. globalHandleError(err, vm, info);
  5153. } finally {
  5154. popTarget();
  5155. }
  5156. }
  5157. function invokeWithErrorHandling (
  5158. handler,
  5159. context,
  5160. args,
  5161. vm,
  5162. info
  5163. ) {
  5164. var res;
  5165. try {
  5166. res = args ? handler.apply(context, args) : handler.call(context);
  5167. if (res && !res._isVue && isPromise(res) && !res._handled) {
  5168. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  5169. // issue #9511
  5170. // avoid catch triggering multiple times when nested calls
  5171. res._handled = true;
  5172. }
  5173. } catch (e) {
  5174. handleError(e, vm, info);
  5175. }
  5176. return res
  5177. }
  5178. function globalHandleError (err, vm, info) {
  5179. if (config.errorHandler) {
  5180. try {
  5181. return config.errorHandler.call(null, err, vm, info)
  5182. } catch (e) {
  5183. // if the user intentionally throws the original error in the handler,
  5184. // do not log it twice
  5185. if (e !== err) {
  5186. logError(e, null, 'config.errorHandler');
  5187. }
  5188. }
  5189. }
  5190. logError(err, vm, info);
  5191. }
  5192. function logError (err, vm, info) {
  5193. if (true) {
  5194. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5195. }
  5196. /* istanbul ignore else */
  5197. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5198. console.error(err);
  5199. } else {
  5200. throw err
  5201. }
  5202. }
  5203. /* */
  5204. var callbacks = [];
  5205. var pending = false;
  5206. function flushCallbacks () {
  5207. pending = false;
  5208. var copies = callbacks.slice(0);
  5209. callbacks.length = 0;
  5210. for (var i = 0; i < copies.length; i++) {
  5211. copies[i]();
  5212. }
  5213. }
  5214. // Here we have async deferring wrappers using microtasks.
  5215. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5216. // However, it has subtle problems when state is changed right before repaint
  5217. // (e.g. #6813, out-in transitions).
  5218. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5219. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5220. // So we now use microtasks everywhere, again.
  5221. // A major drawback of this tradeoff is that there are some scenarios
  5222. // where microtasks have too high a priority and fire in between supposedly
  5223. // sequential events (e.g. #4521, #6690, which have workarounds)
  5224. // or even between bubbling of the same event (#6566).
  5225. var timerFunc;
  5226. // The nextTick behavior leverages the microtask queue, which can be accessed
  5227. // via either native Promise.then or MutationObserver.
  5228. // MutationObserver has wider support, however it is seriously bugged in
  5229. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5230. // completely stops working after triggering a few times... so, if native
  5231. // Promise is available, we will use it:
  5232. /* istanbul ignore next, $flow-disable-line */
  5233. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5234. var p = Promise.resolve();
  5235. timerFunc = function () {
  5236. p.then(flushCallbacks);
  5237. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5238. // it can get stuck in a weird state where callbacks are pushed into the
  5239. // microtask queue but the queue isn't being flushed, until the browser
  5240. // needs to do some other work, e.g. handle a timer. Therefore we can
  5241. // "force" the microtask queue to be flushed by adding an empty timer.
  5242. if (isIOS) { setTimeout(noop); }
  5243. };
  5244. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5245. isNative(MutationObserver) ||
  5246. // PhantomJS and iOS 7.x
  5247. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5248. )) {
  5249. // Use MutationObserver where native Promise is not available,
  5250. // e.g. PhantomJS, iOS7, Android 4.4
  5251. // (#6466 MutationObserver is unreliable in IE11)
  5252. var counter = 1;
  5253. var observer = new MutationObserver(flushCallbacks);
  5254. var textNode = document.createTextNode(String(counter));
  5255. observer.observe(textNode, {
  5256. characterData: true
  5257. });
  5258. timerFunc = function () {
  5259. counter = (counter + 1) % 2;
  5260. textNode.data = String(counter);
  5261. };
  5262. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5263. // Fallback to setImmediate.
  5264. // Technically it leverages the (macro) task queue,
  5265. // but it is still a better choice than setTimeout.
  5266. timerFunc = function () {
  5267. setImmediate(flushCallbacks);
  5268. };
  5269. } else {
  5270. // Fallback to setTimeout.
  5271. timerFunc = function () {
  5272. setTimeout(flushCallbacks, 0);
  5273. };
  5274. }
  5275. function nextTick (cb, ctx) {
  5276. var _resolve;
  5277. callbacks.push(function () {
  5278. if (cb) {
  5279. try {
  5280. cb.call(ctx);
  5281. } catch (e) {
  5282. handleError(e, ctx, 'nextTick');
  5283. }
  5284. } else if (_resolve) {
  5285. _resolve(ctx);
  5286. }
  5287. });
  5288. if (!pending) {
  5289. pending = true;
  5290. timerFunc();
  5291. }
  5292. // $flow-disable-line
  5293. if (!cb && typeof Promise !== 'undefined') {
  5294. return new Promise(function (resolve) {
  5295. _resolve = resolve;
  5296. })
  5297. }
  5298. }
  5299. /* */
  5300. /* not type checking this file because flow doesn't play well with Proxy */
  5301. var initProxy;
  5302. if (true) {
  5303. var allowedGlobals = makeMap(
  5304. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5305. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5306. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5307. 'require' // for Webpack/Browserify
  5308. );
  5309. var warnNonPresent = function (target, key) {
  5310. warn(
  5311. "Property or method \"" + key + "\" is not defined on the instance but " +
  5312. 'referenced during render. Make sure that this property is reactive, ' +
  5313. 'either in the data option, or for class-based components, by ' +
  5314. 'initializing the property. ' +
  5315. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5316. target
  5317. );
  5318. };
  5319. var warnReservedPrefix = function (target, key) {
  5320. warn(
  5321. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5322. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5323. 'prevent conflicts with Vue internals. ' +
  5324. 'See: https://vuejs.org/v2/api/#data',
  5325. target
  5326. );
  5327. };
  5328. var hasProxy =
  5329. typeof Proxy !== 'undefined' && isNative(Proxy);
  5330. if (hasProxy) {
  5331. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5332. config.keyCodes = new Proxy(config.keyCodes, {
  5333. set: function set (target, key, value) {
  5334. if (isBuiltInModifier(key)) {
  5335. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5336. return false
  5337. } else {
  5338. target[key] = value;
  5339. return true
  5340. }
  5341. }
  5342. });
  5343. }
  5344. var hasHandler = {
  5345. has: function has (target, key) {
  5346. var has = key in target;
  5347. var isAllowed = allowedGlobals(key) ||
  5348. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5349. if (!has && !isAllowed) {
  5350. if (key in target.$data) { warnReservedPrefix(target, key); }
  5351. else { warnNonPresent(target, key); }
  5352. }
  5353. return has || !isAllowed
  5354. }
  5355. };
  5356. var getHandler = {
  5357. get: function get (target, key) {
  5358. if (typeof key === 'string' && !(key in target)) {
  5359. if (key in target.$data) { warnReservedPrefix(target, key); }
  5360. else { warnNonPresent(target, key); }
  5361. }
  5362. return target[key]
  5363. }
  5364. };
  5365. initProxy = function initProxy (vm) {
  5366. if (hasProxy) {
  5367. // determine which proxy handler to use
  5368. var options = vm.$options;
  5369. var handlers = options.render && options.render._withStripped
  5370. ? getHandler
  5371. : hasHandler;
  5372. vm._renderProxy = new Proxy(vm, handlers);
  5373. } else {
  5374. vm._renderProxy = vm;
  5375. }
  5376. };
  5377. }
  5378. /* */
  5379. var seenObjects = new _Set();
  5380. /**
  5381. * Recursively traverse an object to evoke all converted
  5382. * getters, so that every nested property inside the object
  5383. * is collected as a "deep" dependency.
  5384. */
  5385. function traverse (val) {
  5386. _traverse(val, seenObjects);
  5387. seenObjects.clear();
  5388. }
  5389. function _traverse (val, seen) {
  5390. var i, keys;
  5391. var isA = Array.isArray(val);
  5392. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5393. return
  5394. }
  5395. if (val.__ob__) {
  5396. var depId = val.__ob__.dep.id;
  5397. if (seen.has(depId)) {
  5398. return
  5399. }
  5400. seen.add(depId);
  5401. }
  5402. if (isA) {
  5403. i = val.length;
  5404. while (i--) { _traverse(val[i], seen); }
  5405. } else {
  5406. keys = Object.keys(val);
  5407. i = keys.length;
  5408. while (i--) { _traverse(val[keys[i]], seen); }
  5409. }
  5410. }
  5411. var mark;
  5412. var measure;
  5413. if (true) {
  5414. var perf = inBrowser && window.performance;
  5415. /* istanbul ignore if */
  5416. if (
  5417. perf &&
  5418. perf.mark &&
  5419. perf.measure &&
  5420. perf.clearMarks &&
  5421. perf.clearMeasures
  5422. ) {
  5423. mark = function (tag) { return perf.mark(tag); };
  5424. measure = function (name, startTag, endTag) {
  5425. perf.measure(name, startTag, endTag);
  5426. perf.clearMarks(startTag);
  5427. perf.clearMarks(endTag);
  5428. // perf.clearMeasures(name)
  5429. };
  5430. }
  5431. }
  5432. /* */
  5433. var normalizeEvent = cached(function (name) {
  5434. var passive = name.charAt(0) === '&';
  5435. name = passive ? name.slice(1) : name;
  5436. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5437. name = once$$1 ? name.slice(1) : name;
  5438. var capture = name.charAt(0) === '!';
  5439. name = capture ? name.slice(1) : name;
  5440. return {
  5441. name: name,
  5442. once: once$$1,
  5443. capture: capture,
  5444. passive: passive
  5445. }
  5446. });
  5447. function createFnInvoker (fns, vm) {
  5448. function invoker () {
  5449. var arguments$1 = arguments;
  5450. var fns = invoker.fns;
  5451. if (Array.isArray(fns)) {
  5452. var cloned = fns.slice();
  5453. for (var i = 0; i < cloned.length; i++) {
  5454. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5455. }
  5456. } else {
  5457. // return handler return value for single handlers
  5458. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5459. }
  5460. }
  5461. invoker.fns = fns;
  5462. return invoker
  5463. }
  5464. function updateListeners (
  5465. on,
  5466. oldOn,
  5467. add,
  5468. remove$$1,
  5469. createOnceHandler,
  5470. vm
  5471. ) {
  5472. var name, def$$1, cur, old, event;
  5473. for (name in on) {
  5474. def$$1 = cur = on[name];
  5475. old = oldOn[name];
  5476. event = normalizeEvent(name);
  5477. if (isUndef(cur)) {
  5478. true && warn(
  5479. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5480. vm
  5481. );
  5482. } else if (isUndef(old)) {
  5483. if (isUndef(cur.fns)) {
  5484. cur = on[name] = createFnInvoker(cur, vm);
  5485. }
  5486. if (isTrue(event.once)) {
  5487. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5488. }
  5489. add(event.name, cur, event.capture, event.passive, event.params);
  5490. } else if (cur !== old) {
  5491. old.fns = cur;
  5492. on[name] = old;
  5493. }
  5494. }
  5495. for (name in oldOn) {
  5496. if (isUndef(on[name])) {
  5497. event = normalizeEvent(name);
  5498. remove$$1(event.name, oldOn[name], event.capture);
  5499. }
  5500. }
  5501. }
  5502. /* */
  5503. /* */
  5504. // fixed by xxxxxx (mp properties)
  5505. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5506. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5507. if (isUndef(propOptions)) {
  5508. return res
  5509. }
  5510. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5511. var attrs = data.attrs;
  5512. var props = data.props;
  5513. if (isDef(attrs) || isDef(props)) {
  5514. for (var key in propOptions) {
  5515. var altKey = hyphenate(key);
  5516. var result = checkProp(res, props, key, altKey, true) ||
  5517. checkProp(res, attrs, key, altKey, false);
  5518. // externalClass
  5519. if (
  5520. result &&
  5521. res[key] &&
  5522. externalClasses.indexOf(altKey) !== -1 &&
  5523. context[camelize(res[key])]
  5524. ) {
  5525. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5526. res[key] = context[camelize(res[key])];
  5527. }
  5528. }
  5529. }
  5530. return res
  5531. }
  5532. function extractPropsFromVNodeData (
  5533. data,
  5534. Ctor,
  5535. tag,
  5536. context// fixed by xxxxxx
  5537. ) {
  5538. // we are only extracting raw values here.
  5539. // validation and default values are handled in the child
  5540. // component itself.
  5541. var propOptions = Ctor.options.props;
  5542. if (isUndef(propOptions)) {
  5543. // fixed by xxxxxx
  5544. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5545. }
  5546. var res = {};
  5547. var attrs = data.attrs;
  5548. var props = data.props;
  5549. if (isDef(attrs) || isDef(props)) {
  5550. for (var key in propOptions) {
  5551. var altKey = hyphenate(key);
  5552. if (true) {
  5553. var keyInLowerCase = key.toLowerCase();
  5554. if (
  5555. key !== keyInLowerCase &&
  5556. attrs && hasOwn(attrs, keyInLowerCase)
  5557. ) {
  5558. tip(
  5559. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5560. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5561. " \"" + key + "\". " +
  5562. "Note that HTML attributes are case-insensitive and camelCased " +
  5563. "props need to use their kebab-case equivalents when using in-DOM " +
  5564. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5565. );
  5566. }
  5567. }
  5568. checkProp(res, props, key, altKey, true) ||
  5569. checkProp(res, attrs, key, altKey, false);
  5570. }
  5571. }
  5572. // fixed by xxxxxx
  5573. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5574. }
  5575. function checkProp (
  5576. res,
  5577. hash,
  5578. key,
  5579. altKey,
  5580. preserve
  5581. ) {
  5582. if (isDef(hash)) {
  5583. if (hasOwn(hash, key)) {
  5584. res[key] = hash[key];
  5585. if (!preserve) {
  5586. delete hash[key];
  5587. }
  5588. return true
  5589. } else if (hasOwn(hash, altKey)) {
  5590. res[key] = hash[altKey];
  5591. if (!preserve) {
  5592. delete hash[altKey];
  5593. }
  5594. return true
  5595. }
  5596. }
  5597. return false
  5598. }
  5599. /* */
  5600. // The template compiler attempts to minimize the need for normalization by
  5601. // statically analyzing the template at compile time.
  5602. //
  5603. // For plain HTML markup, normalization can be completely skipped because the
  5604. // generated render function is guaranteed to return Array<VNode>. There are
  5605. // two cases where extra normalization is needed:
  5606. // 1. When the children contains components - because a functional component
  5607. // may return an Array instead of a single root. In this case, just a simple
  5608. // normalization is needed - if any child is an Array, we flatten the whole
  5609. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5610. // because functional components already normalize their own children.
  5611. function simpleNormalizeChildren (children) {
  5612. for (var i = 0; i < children.length; i++) {
  5613. if (Array.isArray(children[i])) {
  5614. return Array.prototype.concat.apply([], children)
  5615. }
  5616. }
  5617. return children
  5618. }
  5619. // 2. When the children contains constructs that always generated nested Arrays,
  5620. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5621. // with hand-written render functions / JSX. In such cases a full normalization
  5622. // is needed to cater to all possible types of children values.
  5623. function normalizeChildren (children) {
  5624. return isPrimitive(children)
  5625. ? [createTextVNode(children)]
  5626. : Array.isArray(children)
  5627. ? normalizeArrayChildren(children)
  5628. : undefined
  5629. }
  5630. function isTextNode (node) {
  5631. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5632. }
  5633. function normalizeArrayChildren (children, nestedIndex) {
  5634. var res = [];
  5635. var i, c, lastIndex, last;
  5636. for (i = 0; i < children.length; i++) {
  5637. c = children[i];
  5638. if (isUndef(c) || typeof c === 'boolean') { continue }
  5639. lastIndex = res.length - 1;
  5640. last = res[lastIndex];
  5641. // nested
  5642. if (Array.isArray(c)) {
  5643. if (c.length > 0) {
  5644. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5645. // merge adjacent text nodes
  5646. if (isTextNode(c[0]) && isTextNode(last)) {
  5647. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5648. c.shift();
  5649. }
  5650. res.push.apply(res, c);
  5651. }
  5652. } else if (isPrimitive(c)) {
  5653. if (isTextNode(last)) {
  5654. // merge adjacent text nodes
  5655. // this is necessary for SSR hydration because text nodes are
  5656. // essentially merged when rendered to HTML strings
  5657. res[lastIndex] = createTextVNode(last.text + c);
  5658. } else if (c !== '') {
  5659. // convert primitive to vnode
  5660. res.push(createTextVNode(c));
  5661. }
  5662. } else {
  5663. if (isTextNode(c) && isTextNode(last)) {
  5664. // merge adjacent text nodes
  5665. res[lastIndex] = createTextVNode(last.text + c.text);
  5666. } else {
  5667. // default key for nested array children (likely generated by v-for)
  5668. if (isTrue(children._isVList) &&
  5669. isDef(c.tag) &&
  5670. isUndef(c.key) &&
  5671. isDef(nestedIndex)) {
  5672. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5673. }
  5674. res.push(c);
  5675. }
  5676. }
  5677. }
  5678. return res
  5679. }
  5680. /* */
  5681. function initProvide (vm) {
  5682. var provide = vm.$options.provide;
  5683. if (provide) {
  5684. vm._provided = typeof provide === 'function'
  5685. ? provide.call(vm)
  5686. : provide;
  5687. }
  5688. }
  5689. function initInjections (vm) {
  5690. var result = resolveInject(vm.$options.inject, vm);
  5691. if (result) {
  5692. toggleObserving(false);
  5693. Object.keys(result).forEach(function (key) {
  5694. /* istanbul ignore else */
  5695. if (true) {
  5696. defineReactive$$1(vm, key, result[key], function () {
  5697. warn(
  5698. "Avoid mutating an injected value directly since the changes will be " +
  5699. "overwritten whenever the provided component re-renders. " +
  5700. "injection being mutated: \"" + key + "\"",
  5701. vm
  5702. );
  5703. });
  5704. } else {}
  5705. });
  5706. toggleObserving(true);
  5707. }
  5708. }
  5709. function resolveInject (inject, vm) {
  5710. if (inject) {
  5711. // inject is :any because flow is not smart enough to figure out cached
  5712. var result = Object.create(null);
  5713. var keys = hasSymbol
  5714. ? Reflect.ownKeys(inject)
  5715. : Object.keys(inject);
  5716. for (var i = 0; i < keys.length; i++) {
  5717. var key = keys[i];
  5718. // #6574 in case the inject object is observed...
  5719. if (key === '__ob__') { continue }
  5720. var provideKey = inject[key].from;
  5721. var source = vm;
  5722. while (source) {
  5723. if (source._provided && hasOwn(source._provided, provideKey)) {
  5724. result[key] = source._provided[provideKey];
  5725. break
  5726. }
  5727. source = source.$parent;
  5728. }
  5729. if (!source) {
  5730. if ('default' in inject[key]) {
  5731. var provideDefault = inject[key].default;
  5732. result[key] = typeof provideDefault === 'function'
  5733. ? provideDefault.call(vm)
  5734. : provideDefault;
  5735. } else if (true) {
  5736. warn(("Injection \"" + key + "\" not found"), vm);
  5737. }
  5738. }
  5739. }
  5740. return result
  5741. }
  5742. }
  5743. /* */
  5744. /**
  5745. * Runtime helper for resolving raw children VNodes into a slot object.
  5746. */
  5747. function resolveSlots (
  5748. children,
  5749. context
  5750. ) {
  5751. if (!children || !children.length) {
  5752. return {}
  5753. }
  5754. var slots = {};
  5755. for (var i = 0, l = children.length; i < l; i++) {
  5756. var child = children[i];
  5757. var data = child.data;
  5758. // remove slot attribute if the node is resolved as a Vue slot node
  5759. if (data && data.attrs && data.attrs.slot) {
  5760. delete data.attrs.slot;
  5761. }
  5762. // named slots should only be respected if the vnode was rendered in the
  5763. // same context.
  5764. if ((child.context === context || child.fnContext === context) &&
  5765. data && data.slot != null
  5766. ) {
  5767. var name = data.slot;
  5768. var slot = (slots[name] || (slots[name] = []));
  5769. if (child.tag === 'template') {
  5770. slot.push.apply(slot, child.children || []);
  5771. } else {
  5772. slot.push(child);
  5773. }
  5774. } else {
  5775. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5776. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5777. (slots['page'] || (slots['page'] = [])).push(child);
  5778. }else{
  5779. (slots.default || (slots.default = [])).push(child);
  5780. }
  5781. }
  5782. }
  5783. // ignore slots that contains only whitespace
  5784. for (var name$1 in slots) {
  5785. if (slots[name$1].every(isWhitespace)) {
  5786. delete slots[name$1];
  5787. }
  5788. }
  5789. return slots
  5790. }
  5791. function isWhitespace (node) {
  5792. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5793. }
  5794. /* */
  5795. function normalizeScopedSlots (
  5796. slots,
  5797. normalSlots,
  5798. prevSlots
  5799. ) {
  5800. var res;
  5801. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5802. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5803. var key = slots && slots.$key;
  5804. if (!slots) {
  5805. res = {};
  5806. } else if (slots._normalized) {
  5807. // fast path 1: child component re-render only, parent did not change
  5808. return slots._normalized
  5809. } else if (
  5810. isStable &&
  5811. prevSlots &&
  5812. prevSlots !== emptyObject &&
  5813. key === prevSlots.$key &&
  5814. !hasNormalSlots &&
  5815. !prevSlots.$hasNormal
  5816. ) {
  5817. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5818. // only need to normalize once
  5819. return prevSlots
  5820. } else {
  5821. res = {};
  5822. for (var key$1 in slots) {
  5823. if (slots[key$1] && key$1[0] !== '$') {
  5824. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5825. }
  5826. }
  5827. }
  5828. // expose normal slots on scopedSlots
  5829. for (var key$2 in normalSlots) {
  5830. if (!(key$2 in res)) {
  5831. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5832. }
  5833. }
  5834. // avoriaz seems to mock a non-extensible $scopedSlots object
  5835. // and when that is passed down this would cause an error
  5836. if (slots && Object.isExtensible(slots)) {
  5837. (slots)._normalized = res;
  5838. }
  5839. def(res, '$stable', isStable);
  5840. def(res, '$key', key);
  5841. def(res, '$hasNormal', hasNormalSlots);
  5842. return res
  5843. }
  5844. function normalizeScopedSlot(normalSlots, key, fn) {
  5845. var normalized = function () {
  5846. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  5847. res = res && typeof res === 'object' && !Array.isArray(res)
  5848. ? [res] // single vnode
  5849. : normalizeChildren(res);
  5850. return res && (
  5851. res.length === 0 ||
  5852. (res.length === 1 && res[0].isComment) // #9658
  5853. ) ? undefined
  5854. : res
  5855. };
  5856. // this is a slot using the new v-slot syntax without scope. although it is
  5857. // compiled as a scoped slot, render fn users would expect it to be present
  5858. // on this.$slots because the usage is semantically a normal slot.
  5859. if (fn.proxy) {
  5860. Object.defineProperty(normalSlots, key, {
  5861. get: normalized,
  5862. enumerable: true,
  5863. configurable: true
  5864. });
  5865. }
  5866. return normalized
  5867. }
  5868. function proxyNormalSlot(slots, key) {
  5869. return function () { return slots[key]; }
  5870. }
  5871. /* */
  5872. /**
  5873. * Runtime helper for rendering v-for lists.
  5874. */
  5875. function renderList (
  5876. val,
  5877. render
  5878. ) {
  5879. var ret, i, l, keys, key;
  5880. if (Array.isArray(val) || typeof val === 'string') {
  5881. ret = new Array(val.length);
  5882. for (i = 0, l = val.length; i < l; i++) {
  5883. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5884. }
  5885. } else if (typeof val === 'number') {
  5886. ret = new Array(val);
  5887. for (i = 0; i < val; i++) {
  5888. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5889. }
  5890. } else if (isObject(val)) {
  5891. if (hasSymbol && val[Symbol.iterator]) {
  5892. ret = [];
  5893. var iterator = val[Symbol.iterator]();
  5894. var result = iterator.next();
  5895. while (!result.done) {
  5896. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  5897. result = iterator.next();
  5898. }
  5899. } else {
  5900. keys = Object.keys(val);
  5901. ret = new Array(keys.length);
  5902. for (i = 0, l = keys.length; i < l; i++) {
  5903. key = keys[i];
  5904. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5905. }
  5906. }
  5907. }
  5908. if (!isDef(ret)) {
  5909. ret = [];
  5910. }
  5911. (ret)._isVList = true;
  5912. return ret
  5913. }
  5914. /* */
  5915. /**
  5916. * Runtime helper for rendering <slot>
  5917. */
  5918. function renderSlot (
  5919. name,
  5920. fallback,
  5921. props,
  5922. bindObject
  5923. ) {
  5924. var scopedSlotFn = this.$scopedSlots[name];
  5925. var nodes;
  5926. if (scopedSlotFn) { // scoped slot
  5927. props = props || {};
  5928. if (bindObject) {
  5929. if ( true && !isObject(bindObject)) {
  5930. warn(
  5931. 'slot v-bind without argument expects an Object',
  5932. this
  5933. );
  5934. }
  5935. props = extend(extend({}, bindObject), props);
  5936. }
  5937. // fixed by xxxxxx app-plus scopedSlot
  5938. nodes = scopedSlotFn(props, this, props._i) || fallback;
  5939. } else {
  5940. nodes = this.$slots[name] || fallback;
  5941. }
  5942. var target = props && props.slot;
  5943. if (target) {
  5944. return this.$createElement('template', { slot: target }, nodes)
  5945. } else {
  5946. return nodes
  5947. }
  5948. }
  5949. /* */
  5950. /**
  5951. * Runtime helper for resolving filters
  5952. */
  5953. function resolveFilter (id) {
  5954. return resolveAsset(this.$options, 'filters', id, true) || identity
  5955. }
  5956. /* */
  5957. function isKeyNotMatch (expect, actual) {
  5958. if (Array.isArray(expect)) {
  5959. return expect.indexOf(actual) === -1
  5960. } else {
  5961. return expect !== actual
  5962. }
  5963. }
  5964. /**
  5965. * Runtime helper for checking keyCodes from config.
  5966. * exposed as Vue.prototype._k
  5967. * passing in eventKeyName as last argument separately for backwards compat
  5968. */
  5969. function checkKeyCodes (
  5970. eventKeyCode,
  5971. key,
  5972. builtInKeyCode,
  5973. eventKeyName,
  5974. builtInKeyName
  5975. ) {
  5976. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  5977. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  5978. return isKeyNotMatch(builtInKeyName, eventKeyName)
  5979. } else if (mappedKeyCode) {
  5980. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  5981. } else if (eventKeyName) {
  5982. return hyphenate(eventKeyName) !== key
  5983. }
  5984. }
  5985. /* */
  5986. /**
  5987. * Runtime helper for merging v-bind="object" into a VNode's data.
  5988. */
  5989. function bindObjectProps (
  5990. data,
  5991. tag,
  5992. value,
  5993. asProp,
  5994. isSync
  5995. ) {
  5996. if (value) {
  5997. if (!isObject(value)) {
  5998. true && warn(
  5999. 'v-bind without argument expects an Object or Array value',
  6000. this
  6001. );
  6002. } else {
  6003. if (Array.isArray(value)) {
  6004. value = toObject(value);
  6005. }
  6006. var hash;
  6007. var loop = function ( key ) {
  6008. if (
  6009. key === 'class' ||
  6010. key === 'style' ||
  6011. isReservedAttribute(key)
  6012. ) {
  6013. hash = data;
  6014. } else {
  6015. var type = data.attrs && data.attrs.type;
  6016. hash = asProp || config.mustUseProp(tag, type, key)
  6017. ? data.domProps || (data.domProps = {})
  6018. : data.attrs || (data.attrs = {});
  6019. }
  6020. var camelizedKey = camelize(key);
  6021. var hyphenatedKey = hyphenate(key);
  6022. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  6023. hash[key] = value[key];
  6024. if (isSync) {
  6025. var on = data.on || (data.on = {});
  6026. on[("update:" + key)] = function ($event) {
  6027. value[key] = $event;
  6028. };
  6029. }
  6030. }
  6031. };
  6032. for (var key in value) loop( key );
  6033. }
  6034. }
  6035. return data
  6036. }
  6037. /* */
  6038. /**
  6039. * Runtime helper for rendering static trees.
  6040. */
  6041. function renderStatic (
  6042. index,
  6043. isInFor
  6044. ) {
  6045. var cached = this._staticTrees || (this._staticTrees = []);
  6046. var tree = cached[index];
  6047. // if has already-rendered static tree and not inside v-for,
  6048. // we can reuse the same tree.
  6049. if (tree && !isInFor) {
  6050. return tree
  6051. }
  6052. // otherwise, render a fresh tree.
  6053. tree = cached[index] = this.$options.staticRenderFns[index].call(
  6054. this._renderProxy,
  6055. null,
  6056. this // for render fns generated for functional component templates
  6057. );
  6058. markStatic(tree, ("__static__" + index), false);
  6059. return tree
  6060. }
  6061. /**
  6062. * Runtime helper for v-once.
  6063. * Effectively it means marking the node as static with a unique key.
  6064. */
  6065. function markOnce (
  6066. tree,
  6067. index,
  6068. key
  6069. ) {
  6070. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  6071. return tree
  6072. }
  6073. function markStatic (
  6074. tree,
  6075. key,
  6076. isOnce
  6077. ) {
  6078. if (Array.isArray(tree)) {
  6079. for (var i = 0; i < tree.length; i++) {
  6080. if (tree[i] && typeof tree[i] !== 'string') {
  6081. markStaticNode(tree[i], (key + "_" + i), isOnce);
  6082. }
  6083. }
  6084. } else {
  6085. markStaticNode(tree, key, isOnce);
  6086. }
  6087. }
  6088. function markStaticNode (node, key, isOnce) {
  6089. node.isStatic = true;
  6090. node.key = key;
  6091. node.isOnce = isOnce;
  6092. }
  6093. /* */
  6094. function bindObjectListeners (data, value) {
  6095. if (value) {
  6096. if (!isPlainObject(value)) {
  6097. true && warn(
  6098. 'v-on without argument expects an Object value',
  6099. this
  6100. );
  6101. } else {
  6102. var on = data.on = data.on ? extend({}, data.on) : {};
  6103. for (var key in value) {
  6104. var existing = on[key];
  6105. var ours = value[key];
  6106. on[key] = existing ? [].concat(existing, ours) : ours;
  6107. }
  6108. }
  6109. }
  6110. return data
  6111. }
  6112. /* */
  6113. function resolveScopedSlots (
  6114. fns, // see flow/vnode
  6115. res,
  6116. // the following are added in 2.6
  6117. hasDynamicKeys,
  6118. contentHashKey
  6119. ) {
  6120. res = res || { $stable: !hasDynamicKeys };
  6121. for (var i = 0; i < fns.length; i++) {
  6122. var slot = fns[i];
  6123. if (Array.isArray(slot)) {
  6124. resolveScopedSlots(slot, res, hasDynamicKeys);
  6125. } else if (slot) {
  6126. // marker for reverse proxying v-slot without scope on this.$slots
  6127. if (slot.proxy) {
  6128. slot.fn.proxy = true;
  6129. }
  6130. res[slot.key] = slot.fn;
  6131. }
  6132. }
  6133. if (contentHashKey) {
  6134. (res).$key = contentHashKey;
  6135. }
  6136. return res
  6137. }
  6138. /* */
  6139. function bindDynamicKeys (baseObj, values) {
  6140. for (var i = 0; i < values.length; i += 2) {
  6141. var key = values[i];
  6142. if (typeof key === 'string' && key) {
  6143. baseObj[values[i]] = values[i + 1];
  6144. } else if ( true && key !== '' && key !== null) {
  6145. // null is a special value for explicitly removing a binding
  6146. warn(
  6147. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  6148. this
  6149. );
  6150. }
  6151. }
  6152. return baseObj
  6153. }
  6154. // helper to dynamically append modifier runtime markers to event names.
  6155. // ensure only append when value is already string, otherwise it will be cast
  6156. // to string and cause the type check to miss.
  6157. function prependModifier (value, symbol) {
  6158. return typeof value === 'string' ? symbol + value : value
  6159. }
  6160. /* */
  6161. function installRenderHelpers (target) {
  6162. target._o = markOnce;
  6163. target._n = toNumber;
  6164. target._s = toString;
  6165. target._l = renderList;
  6166. target._t = renderSlot;
  6167. target._q = looseEqual;
  6168. target._i = looseIndexOf;
  6169. target._m = renderStatic;
  6170. target._f = resolveFilter;
  6171. target._k = checkKeyCodes;
  6172. target._b = bindObjectProps;
  6173. target._v = createTextVNode;
  6174. target._e = createEmptyVNode;
  6175. target._u = resolveScopedSlots;
  6176. target._g = bindObjectListeners;
  6177. target._d = bindDynamicKeys;
  6178. target._p = prependModifier;
  6179. }
  6180. /* */
  6181. function FunctionalRenderContext (
  6182. data,
  6183. props,
  6184. children,
  6185. parent,
  6186. Ctor
  6187. ) {
  6188. var this$1 = this;
  6189. var options = Ctor.options;
  6190. // ensure the createElement function in functional components
  6191. // gets a unique context - this is necessary for correct named slot check
  6192. var contextVm;
  6193. if (hasOwn(parent, '_uid')) {
  6194. contextVm = Object.create(parent);
  6195. // $flow-disable-line
  6196. contextVm._original = parent;
  6197. } else {
  6198. // the context vm passed in is a functional context as well.
  6199. // in this case we want to make sure we are able to get a hold to the
  6200. // real context instance.
  6201. contextVm = parent;
  6202. // $flow-disable-line
  6203. parent = parent._original;
  6204. }
  6205. var isCompiled = isTrue(options._compiled);
  6206. var needNormalization = !isCompiled;
  6207. this.data = data;
  6208. this.props = props;
  6209. this.children = children;
  6210. this.parent = parent;
  6211. this.listeners = data.on || emptyObject;
  6212. this.injections = resolveInject(options.inject, parent);
  6213. this.slots = function () {
  6214. if (!this$1.$slots) {
  6215. normalizeScopedSlots(
  6216. data.scopedSlots,
  6217. this$1.$slots = resolveSlots(children, parent)
  6218. );
  6219. }
  6220. return this$1.$slots
  6221. };
  6222. Object.defineProperty(this, 'scopedSlots', ({
  6223. enumerable: true,
  6224. get: function get () {
  6225. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6226. }
  6227. }));
  6228. // support for compiled functional template
  6229. if (isCompiled) {
  6230. // exposing $options for renderStatic()
  6231. this.$options = options;
  6232. // pre-resolve slots for renderSlot()
  6233. this.$slots = this.slots();
  6234. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6235. }
  6236. if (options._scopeId) {
  6237. this._c = function (a, b, c, d) {
  6238. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6239. if (vnode && !Array.isArray(vnode)) {
  6240. vnode.fnScopeId = options._scopeId;
  6241. vnode.fnContext = parent;
  6242. }
  6243. return vnode
  6244. };
  6245. } else {
  6246. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6247. }
  6248. }
  6249. installRenderHelpers(FunctionalRenderContext.prototype);
  6250. function createFunctionalComponent (
  6251. Ctor,
  6252. propsData,
  6253. data,
  6254. contextVm,
  6255. children
  6256. ) {
  6257. var options = Ctor.options;
  6258. var props = {};
  6259. var propOptions = options.props;
  6260. if (isDef(propOptions)) {
  6261. for (var key in propOptions) {
  6262. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6263. }
  6264. } else {
  6265. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6266. if (isDef(data.props)) { mergeProps(props, data.props); }
  6267. }
  6268. var renderContext = new FunctionalRenderContext(
  6269. data,
  6270. props,
  6271. children,
  6272. contextVm,
  6273. Ctor
  6274. );
  6275. var vnode = options.render.call(null, renderContext._c, renderContext);
  6276. if (vnode instanceof VNode) {
  6277. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6278. } else if (Array.isArray(vnode)) {
  6279. var vnodes = normalizeChildren(vnode) || [];
  6280. var res = new Array(vnodes.length);
  6281. for (var i = 0; i < vnodes.length; i++) {
  6282. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6283. }
  6284. return res
  6285. }
  6286. }
  6287. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6288. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6289. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6290. // that should not be matched to match.
  6291. var clone = cloneVNode(vnode);
  6292. clone.fnContext = contextVm;
  6293. clone.fnOptions = options;
  6294. if (true) {
  6295. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6296. }
  6297. if (data.slot) {
  6298. (clone.data || (clone.data = {})).slot = data.slot;
  6299. }
  6300. return clone
  6301. }
  6302. function mergeProps (to, from) {
  6303. for (var key in from) {
  6304. to[camelize(key)] = from[key];
  6305. }
  6306. }
  6307. /* */
  6308. /* */
  6309. /* */
  6310. /* */
  6311. // inline hooks to be invoked on component VNodes during patch
  6312. var componentVNodeHooks = {
  6313. init: function init (vnode, hydrating) {
  6314. if (
  6315. vnode.componentInstance &&
  6316. !vnode.componentInstance._isDestroyed &&
  6317. vnode.data.keepAlive
  6318. ) {
  6319. // kept-alive components, treat as a patch
  6320. var mountedNode = vnode; // work around flow
  6321. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6322. } else {
  6323. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6324. vnode,
  6325. activeInstance
  6326. );
  6327. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6328. }
  6329. },
  6330. prepatch: function prepatch (oldVnode, vnode) {
  6331. var options = vnode.componentOptions;
  6332. var child = vnode.componentInstance = oldVnode.componentInstance;
  6333. updateChildComponent(
  6334. child,
  6335. options.propsData, // updated props
  6336. options.listeners, // updated listeners
  6337. vnode, // new parent vnode
  6338. options.children // new children
  6339. );
  6340. },
  6341. insert: function insert (vnode) {
  6342. var context = vnode.context;
  6343. var componentInstance = vnode.componentInstance;
  6344. if (!componentInstance._isMounted) {
  6345. callHook(componentInstance, 'onServiceCreated');
  6346. callHook(componentInstance, 'onServiceAttached');
  6347. componentInstance._isMounted = true;
  6348. callHook(componentInstance, 'mounted');
  6349. }
  6350. if (vnode.data.keepAlive) {
  6351. if (context._isMounted) {
  6352. // vue-router#1212
  6353. // During updates, a kept-alive component's child components may
  6354. // change, so directly walking the tree here may call activated hooks
  6355. // on incorrect children. Instead we push them into a queue which will
  6356. // be processed after the whole patch process ended.
  6357. queueActivatedComponent(componentInstance);
  6358. } else {
  6359. activateChildComponent(componentInstance, true /* direct */);
  6360. }
  6361. }
  6362. },
  6363. destroy: function destroy (vnode) {
  6364. var componentInstance = vnode.componentInstance;
  6365. if (!componentInstance._isDestroyed) {
  6366. if (!vnode.data.keepAlive) {
  6367. componentInstance.$destroy();
  6368. } else {
  6369. deactivateChildComponent(componentInstance, true /* direct */);
  6370. }
  6371. }
  6372. }
  6373. };
  6374. var hooksToMerge = Object.keys(componentVNodeHooks);
  6375. function createComponent (
  6376. Ctor,
  6377. data,
  6378. context,
  6379. children,
  6380. tag
  6381. ) {
  6382. if (isUndef(Ctor)) {
  6383. return
  6384. }
  6385. var baseCtor = context.$options._base;
  6386. // plain options object: turn it into a constructor
  6387. if (isObject(Ctor)) {
  6388. Ctor = baseCtor.extend(Ctor);
  6389. }
  6390. // if at this stage it's not a constructor or an async component factory,
  6391. // reject.
  6392. if (typeof Ctor !== 'function') {
  6393. if (true) {
  6394. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6395. }
  6396. return
  6397. }
  6398. // async component
  6399. var asyncFactory;
  6400. if (isUndef(Ctor.cid)) {
  6401. asyncFactory = Ctor;
  6402. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6403. if (Ctor === undefined) {
  6404. // return a placeholder node for async component, which is rendered
  6405. // as a comment node but preserves all the raw information for the node.
  6406. // the information will be used for async server-rendering and hydration.
  6407. return createAsyncPlaceholder(
  6408. asyncFactory,
  6409. data,
  6410. context,
  6411. children,
  6412. tag
  6413. )
  6414. }
  6415. }
  6416. data = data || {};
  6417. // resolve constructor options in case global mixins are applied after
  6418. // component constructor creation
  6419. resolveConstructorOptions(Ctor);
  6420. // transform component v-model data into props & events
  6421. if (isDef(data.model)) {
  6422. transformModel(Ctor.options, data);
  6423. }
  6424. // extract props
  6425. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6426. // functional component
  6427. if (isTrue(Ctor.options.functional)) {
  6428. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6429. }
  6430. // extract listeners, since these needs to be treated as
  6431. // child component listeners instead of DOM listeners
  6432. var listeners = data.on;
  6433. // replace with listeners with .native modifier
  6434. // so it gets processed during parent component patch.
  6435. data.on = data.nativeOn;
  6436. if (isTrue(Ctor.options.abstract)) {
  6437. // abstract components do not keep anything
  6438. // other than props & listeners & slot
  6439. // work around flow
  6440. var slot = data.slot;
  6441. data = {};
  6442. if (slot) {
  6443. data.slot = slot;
  6444. }
  6445. }
  6446. // install component management hooks onto the placeholder node
  6447. installComponentHooks(data);
  6448. // return a placeholder vnode
  6449. var name = Ctor.options.name || tag;
  6450. var vnode = new VNode(
  6451. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6452. data, undefined, undefined, undefined, context,
  6453. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6454. asyncFactory
  6455. );
  6456. return vnode
  6457. }
  6458. function createComponentInstanceForVnode (
  6459. vnode, // we know it's MountedComponentVNode but flow doesn't
  6460. parent // activeInstance in lifecycle state
  6461. ) {
  6462. var options = {
  6463. _isComponent: true,
  6464. _parentVnode: vnode,
  6465. parent: parent
  6466. };
  6467. // check inline-template render functions
  6468. var inlineTemplate = vnode.data.inlineTemplate;
  6469. if (isDef(inlineTemplate)) {
  6470. options.render = inlineTemplate.render;
  6471. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6472. }
  6473. return new vnode.componentOptions.Ctor(options)
  6474. }
  6475. function installComponentHooks (data) {
  6476. var hooks = data.hook || (data.hook = {});
  6477. for (var i = 0; i < hooksToMerge.length; i++) {
  6478. var key = hooksToMerge[i];
  6479. var existing = hooks[key];
  6480. var toMerge = componentVNodeHooks[key];
  6481. if (existing !== toMerge && !(existing && existing._merged)) {
  6482. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6483. }
  6484. }
  6485. }
  6486. function mergeHook$1 (f1, f2) {
  6487. var merged = function (a, b) {
  6488. // flow complains about extra args which is why we use any
  6489. f1(a, b);
  6490. f2(a, b);
  6491. };
  6492. merged._merged = true;
  6493. return merged
  6494. }
  6495. // transform component v-model info (value and callback) into
  6496. // prop and event handler respectively.
  6497. function transformModel (options, data) {
  6498. var prop = (options.model && options.model.prop) || 'value';
  6499. var event = (options.model && options.model.event) || 'input'
  6500. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6501. var on = data.on || (data.on = {});
  6502. var existing = on[event];
  6503. var callback = data.model.callback;
  6504. if (isDef(existing)) {
  6505. if (
  6506. Array.isArray(existing)
  6507. ? existing.indexOf(callback) === -1
  6508. : existing !== callback
  6509. ) {
  6510. on[event] = [callback].concat(existing);
  6511. }
  6512. } else {
  6513. on[event] = callback;
  6514. }
  6515. }
  6516. /* */
  6517. var SIMPLE_NORMALIZE = 1;
  6518. var ALWAYS_NORMALIZE = 2;
  6519. // wrapper function for providing a more flexible interface
  6520. // without getting yelled at by flow
  6521. function createElement (
  6522. context,
  6523. tag,
  6524. data,
  6525. children,
  6526. normalizationType,
  6527. alwaysNormalize
  6528. ) {
  6529. if (Array.isArray(data) || isPrimitive(data)) {
  6530. normalizationType = children;
  6531. children = data;
  6532. data = undefined;
  6533. }
  6534. if (isTrue(alwaysNormalize)) {
  6535. normalizationType = ALWAYS_NORMALIZE;
  6536. }
  6537. return _createElement(context, tag, data, children, normalizationType)
  6538. }
  6539. function _createElement (
  6540. context,
  6541. tag,
  6542. data,
  6543. children,
  6544. normalizationType
  6545. ) {
  6546. if (isDef(data) && isDef((data).__ob__)) {
  6547. true && warn(
  6548. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6549. 'Always create fresh vnode data objects in each render!',
  6550. context
  6551. );
  6552. return createEmptyVNode()
  6553. }
  6554. // object syntax in v-bind
  6555. if (isDef(data) && isDef(data.is)) {
  6556. tag = data.is;
  6557. }
  6558. if (!tag) {
  6559. // in case of component :is set to falsy value
  6560. return createEmptyVNode()
  6561. }
  6562. // warn against non-primitive key
  6563. if ( true &&
  6564. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6565. ) {
  6566. {
  6567. warn(
  6568. 'Avoid using non-primitive value as key, ' +
  6569. 'use string/number value instead.',
  6570. context
  6571. );
  6572. }
  6573. }
  6574. // support single function children as default scoped slot
  6575. if (Array.isArray(children) &&
  6576. typeof children[0] === 'function'
  6577. ) {
  6578. data = data || {};
  6579. data.scopedSlots = { default: children[0] };
  6580. children.length = 0;
  6581. }
  6582. if (normalizationType === ALWAYS_NORMALIZE) {
  6583. children = normalizeChildren(children);
  6584. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6585. children = simpleNormalizeChildren(children);
  6586. }
  6587. var vnode, ns;
  6588. if (typeof tag === 'string') {
  6589. var Ctor;
  6590. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6591. if (config.isReservedTag(tag)) {
  6592. // platform built-in elements
  6593. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6594. warn(
  6595. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6596. context
  6597. );
  6598. }
  6599. vnode = new VNode(
  6600. config.parsePlatformTagName(tag), data, children,
  6601. undefined, undefined, context
  6602. );
  6603. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6604. // component
  6605. vnode = createComponent(Ctor, data, context, children, tag);
  6606. } else {
  6607. // unknown or unlisted namespaced elements
  6608. // check at runtime because it may get assigned a namespace when its
  6609. // parent normalizes children
  6610. vnode = new VNode(
  6611. tag, data, children,
  6612. undefined, undefined, context
  6613. );
  6614. }
  6615. } else {
  6616. // direct component options / constructor
  6617. vnode = createComponent(tag, data, context, children);
  6618. }
  6619. if (Array.isArray(vnode)) {
  6620. return vnode
  6621. } else if (isDef(vnode)) {
  6622. if (isDef(ns)) { applyNS(vnode, ns); }
  6623. if (isDef(data)) { registerDeepBindings(data); }
  6624. return vnode
  6625. } else {
  6626. return createEmptyVNode()
  6627. }
  6628. }
  6629. function applyNS (vnode, ns, force) {
  6630. vnode.ns = ns;
  6631. if (vnode.tag === 'foreignObject') {
  6632. // use default namespace inside foreignObject
  6633. ns = undefined;
  6634. force = true;
  6635. }
  6636. if (isDef(vnode.children)) {
  6637. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6638. var child = vnode.children[i];
  6639. if (isDef(child.tag) && (
  6640. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6641. applyNS(child, ns, force);
  6642. }
  6643. }
  6644. }
  6645. }
  6646. // ref #5318
  6647. // necessary to ensure parent re-render when deep bindings like :style and
  6648. // :class are used on slot nodes
  6649. function registerDeepBindings (data) {
  6650. if (isObject(data.style)) {
  6651. traverse(data.style);
  6652. }
  6653. if (isObject(data.class)) {
  6654. traverse(data.class);
  6655. }
  6656. }
  6657. /* */
  6658. function initRender (vm) {
  6659. vm._vnode = null; // the root of the child tree
  6660. vm._staticTrees = null; // v-once cached trees
  6661. var options = vm.$options;
  6662. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6663. var renderContext = parentVnode && parentVnode.context;
  6664. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6665. vm.$scopedSlots = emptyObject;
  6666. // bind the createElement fn to this instance
  6667. // so that we get proper render context inside it.
  6668. // args order: tag, data, children, normalizationType, alwaysNormalize
  6669. // internal version is used by render functions compiled from templates
  6670. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6671. // normalization is always applied for the public version, used in
  6672. // user-written render functions.
  6673. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6674. // $attrs & $listeners are exposed for easier HOC creation.
  6675. // they need to be reactive so that HOCs using them are always updated
  6676. var parentData = parentVnode && parentVnode.data;
  6677. /* istanbul ignore else */
  6678. if (true) {
  6679. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6680. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6681. }, true);
  6682. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6683. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6684. }, true);
  6685. } else {}
  6686. }
  6687. var currentRenderingInstance = null;
  6688. function renderMixin (Vue) {
  6689. // install runtime convenience helpers
  6690. installRenderHelpers(Vue.prototype);
  6691. Vue.prototype.$nextTick = function (fn) {
  6692. return nextTick(fn, this)
  6693. };
  6694. Vue.prototype._render = function () {
  6695. var vm = this;
  6696. var ref = vm.$options;
  6697. var render = ref.render;
  6698. var _parentVnode = ref._parentVnode;
  6699. if (_parentVnode) {
  6700. vm.$scopedSlots = normalizeScopedSlots(
  6701. _parentVnode.data.scopedSlots,
  6702. vm.$slots,
  6703. vm.$scopedSlots
  6704. );
  6705. }
  6706. // set parent vnode. this allows render functions to have access
  6707. // to the data on the placeholder node.
  6708. vm.$vnode = _parentVnode;
  6709. // render self
  6710. var vnode;
  6711. try {
  6712. // There's no need to maintain a stack because all render fns are called
  6713. // separately from one another. Nested component's render fns are called
  6714. // when parent component is patched.
  6715. currentRenderingInstance = vm;
  6716. vnode = render.call(vm._renderProxy, vm.$createElement);
  6717. } catch (e) {
  6718. handleError(e, vm, "render");
  6719. // return error render result,
  6720. // or previous vnode to prevent render error causing blank component
  6721. /* istanbul ignore else */
  6722. if ( true && vm.$options.renderError) {
  6723. try {
  6724. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6725. } catch (e) {
  6726. handleError(e, vm, "renderError");
  6727. vnode = vm._vnode;
  6728. }
  6729. } else {
  6730. vnode = vm._vnode;
  6731. }
  6732. } finally {
  6733. currentRenderingInstance = null;
  6734. }
  6735. // if the returned array contains only a single node, allow it
  6736. if (Array.isArray(vnode) && vnode.length === 1) {
  6737. vnode = vnode[0];
  6738. }
  6739. // return empty vnode in case the render function errored out
  6740. if (!(vnode instanceof VNode)) {
  6741. if ( true && Array.isArray(vnode)) {
  6742. warn(
  6743. 'Multiple root nodes returned from render function. Render function ' +
  6744. 'should return a single root node.',
  6745. vm
  6746. );
  6747. }
  6748. vnode = createEmptyVNode();
  6749. }
  6750. // set parent
  6751. vnode.parent = _parentVnode;
  6752. return vnode
  6753. };
  6754. }
  6755. /* */
  6756. function ensureCtor (comp, base) {
  6757. if (
  6758. comp.__esModule ||
  6759. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6760. ) {
  6761. comp = comp.default;
  6762. }
  6763. return isObject(comp)
  6764. ? base.extend(comp)
  6765. : comp
  6766. }
  6767. function createAsyncPlaceholder (
  6768. factory,
  6769. data,
  6770. context,
  6771. children,
  6772. tag
  6773. ) {
  6774. var node = createEmptyVNode();
  6775. node.asyncFactory = factory;
  6776. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6777. return node
  6778. }
  6779. function resolveAsyncComponent (
  6780. factory,
  6781. baseCtor
  6782. ) {
  6783. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6784. return factory.errorComp
  6785. }
  6786. if (isDef(factory.resolved)) {
  6787. return factory.resolved
  6788. }
  6789. var owner = currentRenderingInstance;
  6790. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6791. // already pending
  6792. factory.owners.push(owner);
  6793. }
  6794. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6795. return factory.loadingComp
  6796. }
  6797. if (owner && !isDef(factory.owners)) {
  6798. var owners = factory.owners = [owner];
  6799. var sync = true;
  6800. var timerLoading = null;
  6801. var timerTimeout = null
  6802. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6803. var forceRender = function (renderCompleted) {
  6804. for (var i = 0, l = owners.length; i < l; i++) {
  6805. (owners[i]).$forceUpdate();
  6806. }
  6807. if (renderCompleted) {
  6808. owners.length = 0;
  6809. if (timerLoading !== null) {
  6810. clearTimeout(timerLoading);
  6811. timerLoading = null;
  6812. }
  6813. if (timerTimeout !== null) {
  6814. clearTimeout(timerTimeout);
  6815. timerTimeout = null;
  6816. }
  6817. }
  6818. };
  6819. var resolve = once(function (res) {
  6820. // cache resolved
  6821. factory.resolved = ensureCtor(res, baseCtor);
  6822. // invoke callbacks only if this is not a synchronous resolve
  6823. // (async resolves are shimmed as synchronous during SSR)
  6824. if (!sync) {
  6825. forceRender(true);
  6826. } else {
  6827. owners.length = 0;
  6828. }
  6829. });
  6830. var reject = once(function (reason) {
  6831. true && warn(
  6832. "Failed to resolve async component: " + (String(factory)) +
  6833. (reason ? ("\nReason: " + reason) : '')
  6834. );
  6835. if (isDef(factory.errorComp)) {
  6836. factory.error = true;
  6837. forceRender(true);
  6838. }
  6839. });
  6840. var res = factory(resolve, reject);
  6841. if (isObject(res)) {
  6842. if (isPromise(res)) {
  6843. // () => Promise
  6844. if (isUndef(factory.resolved)) {
  6845. res.then(resolve, reject);
  6846. }
  6847. } else if (isPromise(res.component)) {
  6848. res.component.then(resolve, reject);
  6849. if (isDef(res.error)) {
  6850. factory.errorComp = ensureCtor(res.error, baseCtor);
  6851. }
  6852. if (isDef(res.loading)) {
  6853. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  6854. if (res.delay === 0) {
  6855. factory.loading = true;
  6856. } else {
  6857. timerLoading = setTimeout(function () {
  6858. timerLoading = null;
  6859. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  6860. factory.loading = true;
  6861. forceRender(false);
  6862. }
  6863. }, res.delay || 200);
  6864. }
  6865. }
  6866. if (isDef(res.timeout)) {
  6867. timerTimeout = setTimeout(function () {
  6868. timerTimeout = null;
  6869. if (isUndef(factory.resolved)) {
  6870. reject(
  6871. true
  6872. ? ("timeout (" + (res.timeout) + "ms)")
  6873. : undefined
  6874. );
  6875. }
  6876. }, res.timeout);
  6877. }
  6878. }
  6879. }
  6880. sync = false;
  6881. // return in case resolved synchronously
  6882. return factory.loading
  6883. ? factory.loadingComp
  6884. : factory.resolved
  6885. }
  6886. }
  6887. /* */
  6888. function isAsyncPlaceholder (node) {
  6889. return node.isComment && node.asyncFactory
  6890. }
  6891. /* */
  6892. function getFirstComponentChild (children) {
  6893. if (Array.isArray(children)) {
  6894. for (var i = 0; i < children.length; i++) {
  6895. var c = children[i];
  6896. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6897. return c
  6898. }
  6899. }
  6900. }
  6901. }
  6902. /* */
  6903. /* */
  6904. function initEvents (vm) {
  6905. vm._events = Object.create(null);
  6906. vm._hasHookEvent = false;
  6907. // init parent attached events
  6908. var listeners = vm.$options._parentListeners;
  6909. if (listeners) {
  6910. updateComponentListeners(vm, listeners);
  6911. }
  6912. }
  6913. var target;
  6914. function add (event, fn) {
  6915. target.$on(event, fn);
  6916. }
  6917. function remove$1 (event, fn) {
  6918. target.$off(event, fn);
  6919. }
  6920. function createOnceHandler (event, fn) {
  6921. var _target = target;
  6922. return function onceHandler () {
  6923. var res = fn.apply(null, arguments);
  6924. if (res !== null) {
  6925. _target.$off(event, onceHandler);
  6926. }
  6927. }
  6928. }
  6929. function updateComponentListeners (
  6930. vm,
  6931. listeners,
  6932. oldListeners
  6933. ) {
  6934. target = vm;
  6935. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  6936. target = undefined;
  6937. }
  6938. function eventsMixin (Vue) {
  6939. var hookRE = /^hook:/;
  6940. Vue.prototype.$on = function (event, fn) {
  6941. var vm = this;
  6942. if (Array.isArray(event)) {
  6943. for (var i = 0, l = event.length; i < l; i++) {
  6944. vm.$on(event[i], fn);
  6945. }
  6946. } else {
  6947. (vm._events[event] || (vm._events[event] = [])).push(fn);
  6948. // optimize hook:event cost by using a boolean flag marked at registration
  6949. // instead of a hash lookup
  6950. if (hookRE.test(event)) {
  6951. vm._hasHookEvent = true;
  6952. }
  6953. }
  6954. return vm
  6955. };
  6956. Vue.prototype.$once = function (event, fn) {
  6957. var vm = this;
  6958. function on () {
  6959. vm.$off(event, on);
  6960. fn.apply(vm, arguments);
  6961. }
  6962. on.fn = fn;
  6963. vm.$on(event, on);
  6964. return vm
  6965. };
  6966. Vue.prototype.$off = function (event, fn) {
  6967. var vm = this;
  6968. // all
  6969. if (!arguments.length) {
  6970. vm._events = Object.create(null);
  6971. return vm
  6972. }
  6973. // array of events
  6974. if (Array.isArray(event)) {
  6975. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  6976. vm.$off(event[i$1], fn);
  6977. }
  6978. return vm
  6979. }
  6980. // specific event
  6981. var cbs = vm._events[event];
  6982. if (!cbs) {
  6983. return vm
  6984. }
  6985. if (!fn) {
  6986. vm._events[event] = null;
  6987. return vm
  6988. }
  6989. // specific handler
  6990. var cb;
  6991. var i = cbs.length;
  6992. while (i--) {
  6993. cb = cbs[i];
  6994. if (cb === fn || cb.fn === fn) {
  6995. cbs.splice(i, 1);
  6996. break
  6997. }
  6998. }
  6999. return vm
  7000. };
  7001. Vue.prototype.$emit = function (event) {
  7002. var vm = this;
  7003. if (true) {
  7004. var lowerCaseEvent = event.toLowerCase();
  7005. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  7006. tip(
  7007. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  7008. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  7009. "Note that HTML attributes are case-insensitive and you cannot use " +
  7010. "v-on to listen to camelCase events when using in-DOM templates. " +
  7011. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  7012. );
  7013. }
  7014. }
  7015. var cbs = vm._events[event];
  7016. if (cbs) {
  7017. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  7018. var args = toArray(arguments, 1);
  7019. var info = "event handler for \"" + event + "\"";
  7020. for (var i = 0, l = cbs.length; i < l; i++) {
  7021. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  7022. }
  7023. }
  7024. return vm
  7025. };
  7026. }
  7027. /* */
  7028. var activeInstance = null;
  7029. var isUpdatingChildComponent = false;
  7030. function setActiveInstance(vm) {
  7031. var prevActiveInstance = activeInstance;
  7032. activeInstance = vm;
  7033. return function () {
  7034. activeInstance = prevActiveInstance;
  7035. }
  7036. }
  7037. function initLifecycle (vm) {
  7038. var options = vm.$options;
  7039. // locate first non-abstract parent
  7040. var parent = options.parent;
  7041. if (parent && !options.abstract) {
  7042. while (parent.$options.abstract && parent.$parent) {
  7043. parent = parent.$parent;
  7044. }
  7045. parent.$children.push(vm);
  7046. }
  7047. vm.$parent = parent;
  7048. vm.$root = parent ? parent.$root : vm;
  7049. vm.$children = [];
  7050. vm.$refs = {};
  7051. vm._watcher = null;
  7052. vm._inactive = null;
  7053. vm._directInactive = false;
  7054. vm._isMounted = false;
  7055. vm._isDestroyed = false;
  7056. vm._isBeingDestroyed = false;
  7057. }
  7058. function lifecycleMixin (Vue) {
  7059. Vue.prototype._update = function (vnode, hydrating) {
  7060. var vm = this;
  7061. var prevEl = vm.$el;
  7062. var prevVnode = vm._vnode;
  7063. var restoreActiveInstance = setActiveInstance(vm);
  7064. vm._vnode = vnode;
  7065. // Vue.prototype.__patch__ is injected in entry points
  7066. // based on the rendering backend used.
  7067. if (!prevVnode) {
  7068. // initial render
  7069. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  7070. } else {
  7071. // updates
  7072. vm.$el = vm.__patch__(prevVnode, vnode);
  7073. }
  7074. restoreActiveInstance();
  7075. // update __vue__ reference
  7076. if (prevEl) {
  7077. prevEl.__vue__ = null;
  7078. }
  7079. if (vm.$el) {
  7080. vm.$el.__vue__ = vm;
  7081. }
  7082. // if parent is an HOC, update its $el as well
  7083. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  7084. vm.$parent.$el = vm.$el;
  7085. }
  7086. // updated hook is called by the scheduler to ensure that children are
  7087. // updated in a parent's updated hook.
  7088. };
  7089. Vue.prototype.$forceUpdate = function () {
  7090. var vm = this;
  7091. if (vm._watcher) {
  7092. vm._watcher.update();
  7093. }
  7094. };
  7095. Vue.prototype.$destroy = function () {
  7096. var vm = this;
  7097. if (vm._isBeingDestroyed) {
  7098. return
  7099. }
  7100. callHook(vm, 'beforeDestroy');
  7101. vm._isBeingDestroyed = true;
  7102. // remove self from parent
  7103. var parent = vm.$parent;
  7104. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  7105. remove(parent.$children, vm);
  7106. }
  7107. // teardown watchers
  7108. if (vm._watcher) {
  7109. vm._watcher.teardown();
  7110. }
  7111. var i = vm._watchers.length;
  7112. while (i--) {
  7113. vm._watchers[i].teardown();
  7114. }
  7115. // remove reference from data ob
  7116. // frozen object may not have observer.
  7117. if (vm._data.__ob__) {
  7118. vm._data.__ob__.vmCount--;
  7119. }
  7120. // call the last hook...
  7121. vm._isDestroyed = true;
  7122. // invoke destroy hooks on current rendered tree
  7123. vm.__patch__(vm._vnode, null);
  7124. // fire destroyed hook
  7125. callHook(vm, 'destroyed');
  7126. // turn off all instance listeners.
  7127. vm.$off();
  7128. // remove __vue__ reference
  7129. if (vm.$el) {
  7130. vm.$el.__vue__ = null;
  7131. }
  7132. // release circular reference (#6759)
  7133. if (vm.$vnode) {
  7134. vm.$vnode.parent = null;
  7135. }
  7136. };
  7137. }
  7138. function updateChildComponent (
  7139. vm,
  7140. propsData,
  7141. listeners,
  7142. parentVnode,
  7143. renderChildren
  7144. ) {
  7145. if (true) {
  7146. isUpdatingChildComponent = true;
  7147. }
  7148. // determine whether component has slot children
  7149. // we need to do this before overwriting $options._renderChildren.
  7150. // check if there are dynamic scopedSlots (hand-written or compiled but with
  7151. // dynamic slot names). Static scoped slots compiled from template has the
  7152. // "$stable" marker.
  7153. var newScopedSlots = parentVnode.data.scopedSlots;
  7154. var oldScopedSlots = vm.$scopedSlots;
  7155. var hasDynamicScopedSlot = !!(
  7156. (newScopedSlots && !newScopedSlots.$stable) ||
  7157. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  7158. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  7159. );
  7160. // Any static slot children from the parent may have changed during parent's
  7161. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  7162. // update is necessary to ensure correctness.
  7163. var needsForceUpdate = !!(
  7164. renderChildren || // has new static slots
  7165. vm.$options._renderChildren || // has old static slots
  7166. hasDynamicScopedSlot
  7167. );
  7168. vm.$options._parentVnode = parentVnode;
  7169. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  7170. if (vm._vnode) { // update child tree's parent
  7171. vm._vnode.parent = parentVnode;
  7172. }
  7173. vm.$options._renderChildren = renderChildren;
  7174. // update $attrs and $listeners hash
  7175. // these are also reactive so they may trigger child update if the child
  7176. // used them during render
  7177. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7178. vm.$listeners = listeners || emptyObject;
  7179. // update props
  7180. if (propsData && vm.$options.props) {
  7181. toggleObserving(false);
  7182. var props = vm._props;
  7183. var propKeys = vm.$options._propKeys || [];
  7184. for (var i = 0; i < propKeys.length; i++) {
  7185. var key = propKeys[i];
  7186. var propOptions = vm.$options.props; // wtf flow?
  7187. props[key] = validateProp(key, propOptions, propsData, vm);
  7188. }
  7189. toggleObserving(true);
  7190. // keep a copy of raw propsData
  7191. vm.$options.propsData = propsData;
  7192. }
  7193. // fixed by xxxxxx update properties(mp runtime)
  7194. vm._$updateProperties && vm._$updateProperties(vm);
  7195. // update listeners
  7196. listeners = listeners || emptyObject;
  7197. var oldListeners = vm.$options._parentListeners;
  7198. vm.$options._parentListeners = listeners;
  7199. updateComponentListeners(vm, listeners, oldListeners);
  7200. // resolve slots + force update if has children
  7201. if (needsForceUpdate) {
  7202. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7203. vm.$forceUpdate();
  7204. }
  7205. if (true) {
  7206. isUpdatingChildComponent = false;
  7207. }
  7208. }
  7209. function isInInactiveTree (vm) {
  7210. while (vm && (vm = vm.$parent)) {
  7211. if (vm._inactive) { return true }
  7212. }
  7213. return false
  7214. }
  7215. function activateChildComponent (vm, direct) {
  7216. if (direct) {
  7217. vm._directInactive = false;
  7218. if (isInInactiveTree(vm)) {
  7219. return
  7220. }
  7221. } else if (vm._directInactive) {
  7222. return
  7223. }
  7224. if (vm._inactive || vm._inactive === null) {
  7225. vm._inactive = false;
  7226. for (var i = 0; i < vm.$children.length; i++) {
  7227. activateChildComponent(vm.$children[i]);
  7228. }
  7229. callHook(vm, 'activated');
  7230. }
  7231. }
  7232. function deactivateChildComponent (vm, direct) {
  7233. if (direct) {
  7234. vm._directInactive = true;
  7235. if (isInInactiveTree(vm)) {
  7236. return
  7237. }
  7238. }
  7239. if (!vm._inactive) {
  7240. vm._inactive = true;
  7241. for (var i = 0; i < vm.$children.length; i++) {
  7242. deactivateChildComponent(vm.$children[i]);
  7243. }
  7244. callHook(vm, 'deactivated');
  7245. }
  7246. }
  7247. function callHook (vm, hook) {
  7248. // #7573 disable dep collection when invoking lifecycle hooks
  7249. pushTarget();
  7250. var handlers = vm.$options[hook];
  7251. var info = hook + " hook";
  7252. if (handlers) {
  7253. for (var i = 0, j = handlers.length; i < j; i++) {
  7254. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7255. }
  7256. }
  7257. if (vm._hasHookEvent) {
  7258. vm.$emit('hook:' + hook);
  7259. }
  7260. popTarget();
  7261. }
  7262. /* */
  7263. var MAX_UPDATE_COUNT = 100;
  7264. var queue = [];
  7265. var activatedChildren = [];
  7266. var has = {};
  7267. var circular = {};
  7268. var waiting = false;
  7269. var flushing = false;
  7270. var index = 0;
  7271. /**
  7272. * Reset the scheduler's state.
  7273. */
  7274. function resetSchedulerState () {
  7275. index = queue.length = activatedChildren.length = 0;
  7276. has = {};
  7277. if (true) {
  7278. circular = {};
  7279. }
  7280. waiting = flushing = false;
  7281. }
  7282. // Async edge case #6566 requires saving the timestamp when event listeners are
  7283. // attached. However, calling performance.now() has a perf overhead especially
  7284. // if the page has thousands of event listeners. Instead, we take a timestamp
  7285. // every time the scheduler flushes and use that for all event listeners
  7286. // attached during that flush.
  7287. var currentFlushTimestamp = 0;
  7288. // Async edge case fix requires storing an event listener's attach timestamp.
  7289. var getNow = Date.now;
  7290. // Determine what event timestamp the browser is using. Annoyingly, the
  7291. // timestamp can either be hi-res (relative to page load) or low-res
  7292. // (relative to UNIX epoch), so in order to compare time we have to use the
  7293. // same timestamp type when saving the flush timestamp.
  7294. // All IE versions use low-res event timestamps, and have problematic clock
  7295. // implementations (#9632)
  7296. if (inBrowser && !isIE) {
  7297. var performance = window.performance;
  7298. if (
  7299. performance &&
  7300. typeof performance.now === 'function' &&
  7301. getNow() > document.createEvent('Event').timeStamp
  7302. ) {
  7303. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7304. // smaller than it, it means the event is using a hi-res timestamp,
  7305. // and we need to use the hi-res version for event listener timestamps as
  7306. // well.
  7307. getNow = function () { return performance.now(); };
  7308. }
  7309. }
  7310. /**
  7311. * Flush both queues and run the watchers.
  7312. */
  7313. function flushSchedulerQueue () {
  7314. currentFlushTimestamp = getNow();
  7315. flushing = true;
  7316. var watcher, id;
  7317. // Sort queue before flush.
  7318. // This ensures that:
  7319. // 1. Components are updated from parent to child. (because parent is always
  7320. // created before the child)
  7321. // 2. A component's user watchers are run before its render watcher (because
  7322. // user watchers are created before the render watcher)
  7323. // 3. If a component is destroyed during a parent component's watcher run,
  7324. // its watchers can be skipped.
  7325. queue.sort(function (a, b) { return a.id - b.id; });
  7326. // do not cache length because more watchers might be pushed
  7327. // as we run existing watchers
  7328. for (index = 0; index < queue.length; index++) {
  7329. watcher = queue[index];
  7330. if (watcher.before) {
  7331. watcher.before();
  7332. }
  7333. id = watcher.id;
  7334. has[id] = null;
  7335. watcher.run();
  7336. // in dev build, check and stop circular updates.
  7337. if ( true && has[id] != null) {
  7338. circular[id] = (circular[id] || 0) + 1;
  7339. if (circular[id] > MAX_UPDATE_COUNT) {
  7340. warn(
  7341. 'You may have an infinite update loop ' + (
  7342. watcher.user
  7343. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7344. : "in a component render function."
  7345. ),
  7346. watcher.vm
  7347. );
  7348. break
  7349. }
  7350. }
  7351. }
  7352. // keep copies of post queues before resetting state
  7353. var activatedQueue = activatedChildren.slice();
  7354. var updatedQueue = queue.slice();
  7355. resetSchedulerState();
  7356. // call component updated and activated hooks
  7357. callActivatedHooks(activatedQueue);
  7358. callUpdatedHooks(updatedQueue);
  7359. // devtool hook
  7360. /* istanbul ignore if */
  7361. if (devtools && config.devtools) {
  7362. devtools.emit('flush');
  7363. }
  7364. }
  7365. function callUpdatedHooks (queue) {
  7366. var i = queue.length;
  7367. while (i--) {
  7368. var watcher = queue[i];
  7369. var vm = watcher.vm;
  7370. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7371. callHook(vm, 'updated');
  7372. }
  7373. }
  7374. }
  7375. /**
  7376. * Queue a kept-alive component that was activated during patch.
  7377. * The queue will be processed after the entire tree has been patched.
  7378. */
  7379. function queueActivatedComponent (vm) {
  7380. // setting _inactive to false here so that a render function can
  7381. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7382. vm._inactive = false;
  7383. activatedChildren.push(vm);
  7384. }
  7385. function callActivatedHooks (queue) {
  7386. for (var i = 0; i < queue.length; i++) {
  7387. queue[i]._inactive = true;
  7388. activateChildComponent(queue[i], true /* true */);
  7389. }
  7390. }
  7391. /**
  7392. * Push a watcher into the watcher queue.
  7393. * Jobs with duplicate IDs will be skipped unless it's
  7394. * pushed when the queue is being flushed.
  7395. */
  7396. function queueWatcher (watcher) {
  7397. var id = watcher.id;
  7398. if (has[id] == null) {
  7399. has[id] = true;
  7400. if (!flushing) {
  7401. queue.push(watcher);
  7402. } else {
  7403. // if already flushing, splice the watcher based on its id
  7404. // if already past its id, it will be run next immediately.
  7405. var i = queue.length - 1;
  7406. while (i > index && queue[i].id > watcher.id) {
  7407. i--;
  7408. }
  7409. queue.splice(i + 1, 0, watcher);
  7410. }
  7411. // queue the flush
  7412. if (!waiting) {
  7413. waiting = true;
  7414. if ( true && !config.async) {
  7415. flushSchedulerQueue();
  7416. return
  7417. }
  7418. nextTick(flushSchedulerQueue);
  7419. }
  7420. }
  7421. }
  7422. /* */
  7423. var uid$2 = 0;
  7424. /**
  7425. * A watcher parses an expression, collects dependencies,
  7426. * and fires callback when the expression value changes.
  7427. * This is used for both the $watch() api and directives.
  7428. */
  7429. var Watcher = function Watcher (
  7430. vm,
  7431. expOrFn,
  7432. cb,
  7433. options,
  7434. isRenderWatcher
  7435. ) {
  7436. this.vm = vm;
  7437. if (isRenderWatcher) {
  7438. vm._watcher = this;
  7439. }
  7440. vm._watchers.push(this);
  7441. // options
  7442. if (options) {
  7443. this.deep = !!options.deep;
  7444. this.user = !!options.user;
  7445. this.lazy = !!options.lazy;
  7446. this.sync = !!options.sync;
  7447. this.before = options.before;
  7448. } else {
  7449. this.deep = this.user = this.lazy = this.sync = false;
  7450. }
  7451. this.cb = cb;
  7452. this.id = ++uid$2; // uid for batching
  7453. this.active = true;
  7454. this.dirty = this.lazy; // for lazy watchers
  7455. this.deps = [];
  7456. this.newDeps = [];
  7457. this.depIds = new _Set();
  7458. this.newDepIds = new _Set();
  7459. this.expression = true
  7460. ? expOrFn.toString()
  7461. : undefined;
  7462. // parse expression for getter
  7463. if (typeof expOrFn === 'function') {
  7464. this.getter = expOrFn;
  7465. } else {
  7466. this.getter = parsePath(expOrFn);
  7467. if (!this.getter) {
  7468. this.getter = noop;
  7469. true && warn(
  7470. "Failed watching path: \"" + expOrFn + "\" " +
  7471. 'Watcher only accepts simple dot-delimited paths. ' +
  7472. 'For full control, use a function instead.',
  7473. vm
  7474. );
  7475. }
  7476. }
  7477. this.value = this.lazy
  7478. ? undefined
  7479. : this.get();
  7480. };
  7481. /**
  7482. * Evaluate the getter, and re-collect dependencies.
  7483. */
  7484. Watcher.prototype.get = function get () {
  7485. pushTarget(this);
  7486. var value;
  7487. var vm = this.vm;
  7488. try {
  7489. value = this.getter.call(vm, vm);
  7490. } catch (e) {
  7491. if (this.user) {
  7492. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7493. } else {
  7494. throw e
  7495. }
  7496. } finally {
  7497. // "touch" every property so they are all tracked as
  7498. // dependencies for deep watching
  7499. if (this.deep) {
  7500. traverse(value);
  7501. }
  7502. popTarget();
  7503. this.cleanupDeps();
  7504. }
  7505. return value
  7506. };
  7507. /**
  7508. * Add a dependency to this directive.
  7509. */
  7510. Watcher.prototype.addDep = function addDep (dep) {
  7511. var id = dep.id;
  7512. if (!this.newDepIds.has(id)) {
  7513. this.newDepIds.add(id);
  7514. this.newDeps.push(dep);
  7515. if (!this.depIds.has(id)) {
  7516. dep.addSub(this);
  7517. }
  7518. }
  7519. };
  7520. /**
  7521. * Clean up for dependency collection.
  7522. */
  7523. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7524. var i = this.deps.length;
  7525. while (i--) {
  7526. var dep = this.deps[i];
  7527. if (!this.newDepIds.has(dep.id)) {
  7528. dep.removeSub(this);
  7529. }
  7530. }
  7531. var tmp = this.depIds;
  7532. this.depIds = this.newDepIds;
  7533. this.newDepIds = tmp;
  7534. this.newDepIds.clear();
  7535. tmp = this.deps;
  7536. this.deps = this.newDeps;
  7537. this.newDeps = tmp;
  7538. this.newDeps.length = 0;
  7539. };
  7540. /**
  7541. * Subscriber interface.
  7542. * Will be called when a dependency changes.
  7543. */
  7544. Watcher.prototype.update = function update () {
  7545. /* istanbul ignore else */
  7546. if (this.lazy) {
  7547. this.dirty = true;
  7548. } else if (this.sync) {
  7549. this.run();
  7550. } else {
  7551. queueWatcher(this);
  7552. }
  7553. };
  7554. /**
  7555. * Scheduler job interface.
  7556. * Will be called by the scheduler.
  7557. */
  7558. Watcher.prototype.run = function run () {
  7559. if (this.active) {
  7560. var value = this.get();
  7561. if (
  7562. value !== this.value ||
  7563. // Deep watchers and watchers on Object/Arrays should fire even
  7564. // when the value is the same, because the value may
  7565. // have mutated.
  7566. isObject(value) ||
  7567. this.deep
  7568. ) {
  7569. // set new value
  7570. var oldValue = this.value;
  7571. this.value = value;
  7572. if (this.user) {
  7573. try {
  7574. this.cb.call(this.vm, value, oldValue);
  7575. } catch (e) {
  7576. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7577. }
  7578. } else {
  7579. this.cb.call(this.vm, value, oldValue);
  7580. }
  7581. }
  7582. }
  7583. };
  7584. /**
  7585. * Evaluate the value of the watcher.
  7586. * This only gets called for lazy watchers.
  7587. */
  7588. Watcher.prototype.evaluate = function evaluate () {
  7589. this.value = this.get();
  7590. this.dirty = false;
  7591. };
  7592. /**
  7593. * Depend on all deps collected by this watcher.
  7594. */
  7595. Watcher.prototype.depend = function depend () {
  7596. var i = this.deps.length;
  7597. while (i--) {
  7598. this.deps[i].depend();
  7599. }
  7600. };
  7601. /**
  7602. * Remove self from all dependencies' subscriber list.
  7603. */
  7604. Watcher.prototype.teardown = function teardown () {
  7605. if (this.active) {
  7606. // remove self from vm's watcher list
  7607. // this is a somewhat expensive operation so we skip it
  7608. // if the vm is being destroyed.
  7609. if (!this.vm._isBeingDestroyed) {
  7610. remove(this.vm._watchers, this);
  7611. }
  7612. var i = this.deps.length;
  7613. while (i--) {
  7614. this.deps[i].removeSub(this);
  7615. }
  7616. this.active = false;
  7617. }
  7618. };
  7619. /* */
  7620. var sharedPropertyDefinition = {
  7621. enumerable: true,
  7622. configurable: true,
  7623. get: noop,
  7624. set: noop
  7625. };
  7626. function proxy (target, sourceKey, key) {
  7627. sharedPropertyDefinition.get = function proxyGetter () {
  7628. return this[sourceKey][key]
  7629. };
  7630. sharedPropertyDefinition.set = function proxySetter (val) {
  7631. this[sourceKey][key] = val;
  7632. };
  7633. Object.defineProperty(target, key, sharedPropertyDefinition);
  7634. }
  7635. function initState (vm) {
  7636. vm._watchers = [];
  7637. var opts = vm.$options;
  7638. if (opts.props) { initProps(vm, opts.props); }
  7639. if (opts.methods) { initMethods(vm, opts.methods); }
  7640. if (opts.data) {
  7641. initData(vm);
  7642. } else {
  7643. observe(vm._data = {}, true /* asRootData */);
  7644. }
  7645. if (opts.computed) { initComputed(vm, opts.computed); }
  7646. if (opts.watch && opts.watch !== nativeWatch) {
  7647. initWatch(vm, opts.watch);
  7648. }
  7649. }
  7650. function initProps (vm, propsOptions) {
  7651. var propsData = vm.$options.propsData || {};
  7652. var props = vm._props = {};
  7653. // cache prop keys so that future props updates can iterate using Array
  7654. // instead of dynamic object key enumeration.
  7655. var keys = vm.$options._propKeys = [];
  7656. var isRoot = !vm.$parent;
  7657. // root instance props should be converted
  7658. if (!isRoot) {
  7659. toggleObserving(false);
  7660. }
  7661. var loop = function ( key ) {
  7662. keys.push(key);
  7663. var value = validateProp(key, propsOptions, propsData, vm);
  7664. /* istanbul ignore else */
  7665. if (true) {
  7666. var hyphenatedKey = hyphenate(key);
  7667. if (isReservedAttribute(hyphenatedKey) ||
  7668. config.isReservedAttr(hyphenatedKey)) {
  7669. warn(
  7670. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7671. vm
  7672. );
  7673. }
  7674. defineReactive$$1(props, key, value, function () {
  7675. if (!isRoot && !isUpdatingChildComponent) {
  7676. {
  7677. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou'){//百度、快手 observer 在 setData callback 之后触发,直接忽略该 warn
  7678. return
  7679. }
  7680. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7681. if(
  7682. key === 'value' &&
  7683. Array.isArray(vm.$options.behaviors) &&
  7684. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7685. ){
  7686. return
  7687. }
  7688. if(vm._getFormData){
  7689. return
  7690. }
  7691. var $parent = vm.$parent;
  7692. while($parent){
  7693. if($parent.__next_tick_pending){
  7694. return
  7695. }
  7696. $parent = $parent.$parent;
  7697. }
  7698. }
  7699. warn(
  7700. "Avoid mutating a prop directly since the value will be " +
  7701. "overwritten whenever the parent component re-renders. " +
  7702. "Instead, use a data or computed property based on the prop's " +
  7703. "value. Prop being mutated: \"" + key + "\"",
  7704. vm
  7705. );
  7706. }
  7707. });
  7708. } else {}
  7709. // static props are already proxied on the component's prototype
  7710. // during Vue.extend(). We only need to proxy props defined at
  7711. // instantiation here.
  7712. if (!(key in vm)) {
  7713. proxy(vm, "_props", key);
  7714. }
  7715. };
  7716. for (var key in propsOptions) loop( key );
  7717. toggleObserving(true);
  7718. }
  7719. function initData (vm) {
  7720. var data = vm.$options.data;
  7721. data = vm._data = typeof data === 'function'
  7722. ? getData(data, vm)
  7723. : data || {};
  7724. if (!isPlainObject(data)) {
  7725. data = {};
  7726. true && warn(
  7727. 'data functions should return an object:\n' +
  7728. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7729. vm
  7730. );
  7731. }
  7732. // proxy data on instance
  7733. var keys = Object.keys(data);
  7734. var props = vm.$options.props;
  7735. var methods = vm.$options.methods;
  7736. var i = keys.length;
  7737. while (i--) {
  7738. var key = keys[i];
  7739. if (true) {
  7740. if (methods && hasOwn(methods, key)) {
  7741. warn(
  7742. ("Method \"" + key + "\" has already been defined as a data property."),
  7743. vm
  7744. );
  7745. }
  7746. }
  7747. if (props && hasOwn(props, key)) {
  7748. true && warn(
  7749. "The data property \"" + key + "\" is already declared as a prop. " +
  7750. "Use prop default value instead.",
  7751. vm
  7752. );
  7753. } else if (!isReserved(key)) {
  7754. proxy(vm, "_data", key);
  7755. }
  7756. }
  7757. // observe data
  7758. observe(data, true /* asRootData */);
  7759. }
  7760. function getData (data, vm) {
  7761. // #7573 disable dep collection when invoking data getters
  7762. pushTarget();
  7763. try {
  7764. return data.call(vm, vm)
  7765. } catch (e) {
  7766. handleError(e, vm, "data()");
  7767. return {}
  7768. } finally {
  7769. popTarget();
  7770. }
  7771. }
  7772. var computedWatcherOptions = { lazy: true };
  7773. function initComputed (vm, computed) {
  7774. // $flow-disable-line
  7775. var watchers = vm._computedWatchers = Object.create(null);
  7776. // computed properties are just getters during SSR
  7777. var isSSR = isServerRendering();
  7778. for (var key in computed) {
  7779. var userDef = computed[key];
  7780. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7781. if ( true && getter == null) {
  7782. warn(
  7783. ("Getter is missing for computed property \"" + key + "\"."),
  7784. vm
  7785. );
  7786. }
  7787. if (!isSSR) {
  7788. // create internal watcher for the computed property.
  7789. watchers[key] = new Watcher(
  7790. vm,
  7791. getter || noop,
  7792. noop,
  7793. computedWatcherOptions
  7794. );
  7795. }
  7796. // component-defined computed properties are already defined on the
  7797. // component prototype. We only need to define computed properties defined
  7798. // at instantiation here.
  7799. if (!(key in vm)) {
  7800. defineComputed(vm, key, userDef);
  7801. } else if (true) {
  7802. if (key in vm.$data) {
  7803. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7804. } else if (vm.$options.props && key in vm.$options.props) {
  7805. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7806. }
  7807. }
  7808. }
  7809. }
  7810. function defineComputed (
  7811. target,
  7812. key,
  7813. userDef
  7814. ) {
  7815. var shouldCache = !isServerRendering();
  7816. if (typeof userDef === 'function') {
  7817. sharedPropertyDefinition.get = shouldCache
  7818. ? createComputedGetter(key)
  7819. : createGetterInvoker(userDef);
  7820. sharedPropertyDefinition.set = noop;
  7821. } else {
  7822. sharedPropertyDefinition.get = userDef.get
  7823. ? shouldCache && userDef.cache !== false
  7824. ? createComputedGetter(key)
  7825. : createGetterInvoker(userDef.get)
  7826. : noop;
  7827. sharedPropertyDefinition.set = userDef.set || noop;
  7828. }
  7829. if ( true &&
  7830. sharedPropertyDefinition.set === noop) {
  7831. sharedPropertyDefinition.set = function () {
  7832. warn(
  7833. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7834. this
  7835. );
  7836. };
  7837. }
  7838. Object.defineProperty(target, key, sharedPropertyDefinition);
  7839. }
  7840. function createComputedGetter (key) {
  7841. return function computedGetter () {
  7842. var watcher = this._computedWatchers && this._computedWatchers[key];
  7843. if (watcher) {
  7844. if (watcher.dirty) {
  7845. watcher.evaluate();
  7846. }
  7847. if (Dep.SharedObject.target) {// fixed by xxxxxx
  7848. watcher.depend();
  7849. }
  7850. return watcher.value
  7851. }
  7852. }
  7853. }
  7854. function createGetterInvoker(fn) {
  7855. return function computedGetter () {
  7856. return fn.call(this, this)
  7857. }
  7858. }
  7859. function initMethods (vm, methods) {
  7860. var props = vm.$options.props;
  7861. for (var key in methods) {
  7862. if (true) {
  7863. if (typeof methods[key] !== 'function') {
  7864. warn(
  7865. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  7866. "Did you reference the function correctly?",
  7867. vm
  7868. );
  7869. }
  7870. if (props && hasOwn(props, key)) {
  7871. warn(
  7872. ("Method \"" + key + "\" has already been defined as a prop."),
  7873. vm
  7874. );
  7875. }
  7876. if ((key in vm) && isReserved(key)) {
  7877. warn(
  7878. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7879. "Avoid defining component methods that start with _ or $."
  7880. );
  7881. }
  7882. }
  7883. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7884. }
  7885. }
  7886. function initWatch (vm, watch) {
  7887. for (var key in watch) {
  7888. var handler = watch[key];
  7889. if (Array.isArray(handler)) {
  7890. for (var i = 0; i < handler.length; i++) {
  7891. createWatcher(vm, key, handler[i]);
  7892. }
  7893. } else {
  7894. createWatcher(vm, key, handler);
  7895. }
  7896. }
  7897. }
  7898. function createWatcher (
  7899. vm,
  7900. expOrFn,
  7901. handler,
  7902. options
  7903. ) {
  7904. if (isPlainObject(handler)) {
  7905. options = handler;
  7906. handler = handler.handler;
  7907. }
  7908. if (typeof handler === 'string') {
  7909. handler = vm[handler];
  7910. }
  7911. return vm.$watch(expOrFn, handler, options)
  7912. }
  7913. function stateMixin (Vue) {
  7914. // flow somehow has problems with directly declared definition object
  7915. // when using Object.defineProperty, so we have to procedurally build up
  7916. // the object here.
  7917. var dataDef = {};
  7918. dataDef.get = function () { return this._data };
  7919. var propsDef = {};
  7920. propsDef.get = function () { return this._props };
  7921. if (true) {
  7922. dataDef.set = function () {
  7923. warn(
  7924. 'Avoid replacing instance root $data. ' +
  7925. 'Use nested data properties instead.',
  7926. this
  7927. );
  7928. };
  7929. propsDef.set = function () {
  7930. warn("$props is readonly.", this);
  7931. };
  7932. }
  7933. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7934. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7935. Vue.prototype.$set = set;
  7936. Vue.prototype.$delete = del;
  7937. Vue.prototype.$watch = function (
  7938. expOrFn,
  7939. cb,
  7940. options
  7941. ) {
  7942. var vm = this;
  7943. if (isPlainObject(cb)) {
  7944. return createWatcher(vm, expOrFn, cb, options)
  7945. }
  7946. options = options || {};
  7947. options.user = true;
  7948. var watcher = new Watcher(vm, expOrFn, cb, options);
  7949. if (options.immediate) {
  7950. try {
  7951. cb.call(vm, watcher.value);
  7952. } catch (error) {
  7953. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  7954. }
  7955. }
  7956. return function unwatchFn () {
  7957. watcher.teardown();
  7958. }
  7959. };
  7960. }
  7961. /* */
  7962. var uid$3 = 0;
  7963. function initMixin (Vue) {
  7964. Vue.prototype._init = function (options) {
  7965. var vm = this;
  7966. // a uid
  7967. vm._uid = uid$3++;
  7968. var startTag, endTag;
  7969. /* istanbul ignore if */
  7970. if ( true && config.performance && mark) {
  7971. startTag = "vue-perf-start:" + (vm._uid);
  7972. endTag = "vue-perf-end:" + (vm._uid);
  7973. mark(startTag);
  7974. }
  7975. // a flag to avoid this being observed
  7976. vm._isVue = true;
  7977. // merge options
  7978. if (options && options._isComponent) {
  7979. // optimize internal component instantiation
  7980. // since dynamic options merging is pretty slow, and none of the
  7981. // internal component options needs special treatment.
  7982. initInternalComponent(vm, options);
  7983. } else {
  7984. vm.$options = mergeOptions(
  7985. resolveConstructorOptions(vm.constructor),
  7986. options || {},
  7987. vm
  7988. );
  7989. }
  7990. /* istanbul ignore else */
  7991. if (true) {
  7992. initProxy(vm);
  7993. } else {}
  7994. // expose real self
  7995. vm._self = vm;
  7996. initLifecycle(vm);
  7997. initEvents(vm);
  7998. initRender(vm);
  7999. callHook(vm, 'beforeCreate');
  8000. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  8001. initState(vm);
  8002. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  8003. !vm._$fallback && callHook(vm, 'created');
  8004. /* istanbul ignore if */
  8005. if ( true && config.performance && mark) {
  8006. vm._name = formatComponentName(vm, false);
  8007. mark(endTag);
  8008. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  8009. }
  8010. if (vm.$options.el) {
  8011. vm.$mount(vm.$options.el);
  8012. }
  8013. };
  8014. }
  8015. function initInternalComponent (vm, options) {
  8016. var opts = vm.$options = Object.create(vm.constructor.options);
  8017. // doing this because it's faster than dynamic enumeration.
  8018. var parentVnode = options._parentVnode;
  8019. opts.parent = options.parent;
  8020. opts._parentVnode = parentVnode;
  8021. var vnodeComponentOptions = parentVnode.componentOptions;
  8022. opts.propsData = vnodeComponentOptions.propsData;
  8023. opts._parentListeners = vnodeComponentOptions.listeners;
  8024. opts._renderChildren = vnodeComponentOptions.children;
  8025. opts._componentTag = vnodeComponentOptions.tag;
  8026. if (options.render) {
  8027. opts.render = options.render;
  8028. opts.staticRenderFns = options.staticRenderFns;
  8029. }
  8030. }
  8031. function resolveConstructorOptions (Ctor) {
  8032. var options = Ctor.options;
  8033. if (Ctor.super) {
  8034. var superOptions = resolveConstructorOptions(Ctor.super);
  8035. var cachedSuperOptions = Ctor.superOptions;
  8036. if (superOptions !== cachedSuperOptions) {
  8037. // super option changed,
  8038. // need to resolve new options.
  8039. Ctor.superOptions = superOptions;
  8040. // check if there are any late-modified/attached options (#4976)
  8041. var modifiedOptions = resolveModifiedOptions(Ctor);
  8042. // update base extend options
  8043. if (modifiedOptions) {
  8044. extend(Ctor.extendOptions, modifiedOptions);
  8045. }
  8046. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  8047. if (options.name) {
  8048. options.components[options.name] = Ctor;
  8049. }
  8050. }
  8051. }
  8052. return options
  8053. }
  8054. function resolveModifiedOptions (Ctor) {
  8055. var modified;
  8056. var latest = Ctor.options;
  8057. var sealed = Ctor.sealedOptions;
  8058. for (var key in latest) {
  8059. if (latest[key] !== sealed[key]) {
  8060. if (!modified) { modified = {}; }
  8061. modified[key] = latest[key];
  8062. }
  8063. }
  8064. return modified
  8065. }
  8066. function Vue (options) {
  8067. if ( true &&
  8068. !(this instanceof Vue)
  8069. ) {
  8070. warn('Vue is a constructor and should be called with the `new` keyword');
  8071. }
  8072. this._init(options);
  8073. }
  8074. initMixin(Vue);
  8075. stateMixin(Vue);
  8076. eventsMixin(Vue);
  8077. lifecycleMixin(Vue);
  8078. renderMixin(Vue);
  8079. /* */
  8080. function initUse (Vue) {
  8081. Vue.use = function (plugin) {
  8082. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  8083. if (installedPlugins.indexOf(plugin) > -1) {
  8084. return this
  8085. }
  8086. // additional parameters
  8087. var args = toArray(arguments, 1);
  8088. args.unshift(this);
  8089. if (typeof plugin.install === 'function') {
  8090. plugin.install.apply(plugin, args);
  8091. } else if (typeof plugin === 'function') {
  8092. plugin.apply(null, args);
  8093. }
  8094. installedPlugins.push(plugin);
  8095. return this
  8096. };
  8097. }
  8098. /* */
  8099. function initMixin$1 (Vue) {
  8100. Vue.mixin = function (mixin) {
  8101. this.options = mergeOptions(this.options, mixin);
  8102. return this
  8103. };
  8104. }
  8105. /* */
  8106. function initExtend (Vue) {
  8107. /**
  8108. * Each instance constructor, including Vue, has a unique
  8109. * cid. This enables us to create wrapped "child
  8110. * constructors" for prototypal inheritance and cache them.
  8111. */
  8112. Vue.cid = 0;
  8113. var cid = 1;
  8114. /**
  8115. * Class inheritance
  8116. */
  8117. Vue.extend = function (extendOptions) {
  8118. extendOptions = extendOptions || {};
  8119. var Super = this;
  8120. var SuperId = Super.cid;
  8121. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  8122. if (cachedCtors[SuperId]) {
  8123. return cachedCtors[SuperId]
  8124. }
  8125. var name = extendOptions.name || Super.options.name;
  8126. if ( true && name) {
  8127. validateComponentName(name);
  8128. }
  8129. var Sub = function VueComponent (options) {
  8130. this._init(options);
  8131. };
  8132. Sub.prototype = Object.create(Super.prototype);
  8133. Sub.prototype.constructor = Sub;
  8134. Sub.cid = cid++;
  8135. Sub.options = mergeOptions(
  8136. Super.options,
  8137. extendOptions
  8138. );
  8139. Sub['super'] = Super;
  8140. // For props and computed properties, we define the proxy getters on
  8141. // the Vue instances at extension time, on the extended prototype. This
  8142. // avoids Object.defineProperty calls for each instance created.
  8143. if (Sub.options.props) {
  8144. initProps$1(Sub);
  8145. }
  8146. if (Sub.options.computed) {
  8147. initComputed$1(Sub);
  8148. }
  8149. // allow further extension/mixin/plugin usage
  8150. Sub.extend = Super.extend;
  8151. Sub.mixin = Super.mixin;
  8152. Sub.use = Super.use;
  8153. // create asset registers, so extended classes
  8154. // can have their private assets too.
  8155. ASSET_TYPES.forEach(function (type) {
  8156. Sub[type] = Super[type];
  8157. });
  8158. // enable recursive self-lookup
  8159. if (name) {
  8160. Sub.options.components[name] = Sub;
  8161. }
  8162. // keep a reference to the super options at extension time.
  8163. // later at instantiation we can check if Super's options have
  8164. // been updated.
  8165. Sub.superOptions = Super.options;
  8166. Sub.extendOptions = extendOptions;
  8167. Sub.sealedOptions = extend({}, Sub.options);
  8168. // cache constructor
  8169. cachedCtors[SuperId] = Sub;
  8170. return Sub
  8171. };
  8172. }
  8173. function initProps$1 (Comp) {
  8174. var props = Comp.options.props;
  8175. for (var key in props) {
  8176. proxy(Comp.prototype, "_props", key);
  8177. }
  8178. }
  8179. function initComputed$1 (Comp) {
  8180. var computed = Comp.options.computed;
  8181. for (var key in computed) {
  8182. defineComputed(Comp.prototype, key, computed[key]);
  8183. }
  8184. }
  8185. /* */
  8186. function initAssetRegisters (Vue) {
  8187. /**
  8188. * Create asset registration methods.
  8189. */
  8190. ASSET_TYPES.forEach(function (type) {
  8191. Vue[type] = function (
  8192. id,
  8193. definition
  8194. ) {
  8195. if (!definition) {
  8196. return this.options[type + 's'][id]
  8197. } else {
  8198. /* istanbul ignore if */
  8199. if ( true && type === 'component') {
  8200. validateComponentName(id);
  8201. }
  8202. if (type === 'component' && isPlainObject(definition)) {
  8203. definition.name = definition.name || id;
  8204. definition = this.options._base.extend(definition);
  8205. }
  8206. if (type === 'directive' && typeof definition === 'function') {
  8207. definition = { bind: definition, update: definition };
  8208. }
  8209. this.options[type + 's'][id] = definition;
  8210. return definition
  8211. }
  8212. };
  8213. });
  8214. }
  8215. /* */
  8216. function getComponentName (opts) {
  8217. return opts && (opts.Ctor.options.name || opts.tag)
  8218. }
  8219. function matches (pattern, name) {
  8220. if (Array.isArray(pattern)) {
  8221. return pattern.indexOf(name) > -1
  8222. } else if (typeof pattern === 'string') {
  8223. return pattern.split(',').indexOf(name) > -1
  8224. } else if (isRegExp(pattern)) {
  8225. return pattern.test(name)
  8226. }
  8227. /* istanbul ignore next */
  8228. return false
  8229. }
  8230. function pruneCache (keepAliveInstance, filter) {
  8231. var cache = keepAliveInstance.cache;
  8232. var keys = keepAliveInstance.keys;
  8233. var _vnode = keepAliveInstance._vnode;
  8234. for (var key in cache) {
  8235. var cachedNode = cache[key];
  8236. if (cachedNode) {
  8237. var name = getComponentName(cachedNode.componentOptions);
  8238. if (name && !filter(name)) {
  8239. pruneCacheEntry(cache, key, keys, _vnode);
  8240. }
  8241. }
  8242. }
  8243. }
  8244. function pruneCacheEntry (
  8245. cache,
  8246. key,
  8247. keys,
  8248. current
  8249. ) {
  8250. var cached$$1 = cache[key];
  8251. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8252. cached$$1.componentInstance.$destroy();
  8253. }
  8254. cache[key] = null;
  8255. remove(keys, key);
  8256. }
  8257. var patternTypes = [String, RegExp, Array];
  8258. var KeepAlive = {
  8259. name: 'keep-alive',
  8260. abstract: true,
  8261. props: {
  8262. include: patternTypes,
  8263. exclude: patternTypes,
  8264. max: [String, Number]
  8265. },
  8266. created: function created () {
  8267. this.cache = Object.create(null);
  8268. this.keys = [];
  8269. },
  8270. destroyed: function destroyed () {
  8271. for (var key in this.cache) {
  8272. pruneCacheEntry(this.cache, key, this.keys);
  8273. }
  8274. },
  8275. mounted: function mounted () {
  8276. var this$1 = this;
  8277. this.$watch('include', function (val) {
  8278. pruneCache(this$1, function (name) { return matches(val, name); });
  8279. });
  8280. this.$watch('exclude', function (val) {
  8281. pruneCache(this$1, function (name) { return !matches(val, name); });
  8282. });
  8283. },
  8284. render: function render () {
  8285. var slot = this.$slots.default;
  8286. var vnode = getFirstComponentChild(slot);
  8287. var componentOptions = vnode && vnode.componentOptions;
  8288. if (componentOptions) {
  8289. // check pattern
  8290. var name = getComponentName(componentOptions);
  8291. var ref = this;
  8292. var include = ref.include;
  8293. var exclude = ref.exclude;
  8294. if (
  8295. // not included
  8296. (include && (!name || !matches(include, name))) ||
  8297. // excluded
  8298. (exclude && name && matches(exclude, name))
  8299. ) {
  8300. return vnode
  8301. }
  8302. var ref$1 = this;
  8303. var cache = ref$1.cache;
  8304. var keys = ref$1.keys;
  8305. var key = vnode.key == null
  8306. // same constructor may get registered as different local components
  8307. // so cid alone is not enough (#3269)
  8308. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8309. : vnode.key;
  8310. if (cache[key]) {
  8311. vnode.componentInstance = cache[key].componentInstance;
  8312. // make current key freshest
  8313. remove(keys, key);
  8314. keys.push(key);
  8315. } else {
  8316. cache[key] = vnode;
  8317. keys.push(key);
  8318. // prune oldest entry
  8319. if (this.max && keys.length > parseInt(this.max)) {
  8320. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8321. }
  8322. }
  8323. vnode.data.keepAlive = true;
  8324. }
  8325. return vnode || (slot && slot[0])
  8326. }
  8327. };
  8328. var builtInComponents = {
  8329. KeepAlive: KeepAlive
  8330. };
  8331. /* */
  8332. function initGlobalAPI (Vue) {
  8333. // config
  8334. var configDef = {};
  8335. configDef.get = function () { return config; };
  8336. if (true) {
  8337. configDef.set = function () {
  8338. warn(
  8339. 'Do not replace the Vue.config object, set individual fields instead.'
  8340. );
  8341. };
  8342. }
  8343. Object.defineProperty(Vue, 'config', configDef);
  8344. // exposed util methods.
  8345. // NOTE: these are not considered part of the public API - avoid relying on
  8346. // them unless you are aware of the risk.
  8347. Vue.util = {
  8348. warn: warn,
  8349. extend: extend,
  8350. mergeOptions: mergeOptions,
  8351. defineReactive: defineReactive$$1
  8352. };
  8353. Vue.set = set;
  8354. Vue.delete = del;
  8355. Vue.nextTick = nextTick;
  8356. // 2.6 explicit observable API
  8357. Vue.observable = function (obj) {
  8358. observe(obj);
  8359. return obj
  8360. };
  8361. Vue.options = Object.create(null);
  8362. ASSET_TYPES.forEach(function (type) {
  8363. Vue.options[type + 's'] = Object.create(null);
  8364. });
  8365. // this is used to identify the "base" constructor to extend all plain-object
  8366. // components with in Weex's multi-instance scenarios.
  8367. Vue.options._base = Vue;
  8368. extend(Vue.options.components, builtInComponents);
  8369. initUse(Vue);
  8370. initMixin$1(Vue);
  8371. initExtend(Vue);
  8372. initAssetRegisters(Vue);
  8373. }
  8374. initGlobalAPI(Vue);
  8375. Object.defineProperty(Vue.prototype, '$isServer', {
  8376. get: isServerRendering
  8377. });
  8378. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8379. get: function get () {
  8380. /* istanbul ignore next */
  8381. return this.$vnode && this.$vnode.ssrContext
  8382. }
  8383. });
  8384. // expose FunctionalRenderContext for ssr runtime helper installation
  8385. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8386. value: FunctionalRenderContext
  8387. });
  8388. Vue.version = '2.6.11';
  8389. /**
  8390. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8391. */
  8392. var ARRAYTYPE = '[object Array]';
  8393. var OBJECTTYPE = '[object Object]';
  8394. // const FUNCTIONTYPE = '[object Function]'
  8395. function diff(current, pre) {
  8396. var result = {};
  8397. syncKeys(current, pre);
  8398. _diff(current, pre, '', result);
  8399. return result
  8400. }
  8401. function syncKeys(current, pre) {
  8402. if (current === pre) { return }
  8403. var rootCurrentType = type(current);
  8404. var rootPreType = type(pre);
  8405. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8406. if(Object.keys(current).length >= Object.keys(pre).length){
  8407. for (var key in pre) {
  8408. var currentValue = current[key];
  8409. if (currentValue === undefined) {
  8410. current[key] = null;
  8411. } else {
  8412. syncKeys(currentValue, pre[key]);
  8413. }
  8414. }
  8415. }
  8416. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8417. if (current.length >= pre.length) {
  8418. pre.forEach(function (item, index) {
  8419. syncKeys(current[index], item);
  8420. });
  8421. }
  8422. }
  8423. }
  8424. function _diff(current, pre, path, result) {
  8425. if (current === pre) { return }
  8426. var rootCurrentType = type(current);
  8427. var rootPreType = type(pre);
  8428. if (rootCurrentType == OBJECTTYPE) {
  8429. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8430. setResult(result, path, current);
  8431. } else {
  8432. var loop = function ( key ) {
  8433. var currentValue = current[key];
  8434. var preValue = pre[key];
  8435. var currentType = type(currentValue);
  8436. var preType = type(preValue);
  8437. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8438. // NOTE 此处将 != 修改为 !==。涉及地方太多恐怕测试不到,如果出现数据对比问题,将其修改回来。
  8439. if (currentValue !== pre[key]) {
  8440. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8441. }
  8442. } else if (currentType == ARRAYTYPE) {
  8443. if (preType != ARRAYTYPE) {
  8444. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8445. } else {
  8446. if (currentValue.length < preValue.length) {
  8447. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8448. } else {
  8449. currentValue.forEach(function (item, index) {
  8450. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8451. });
  8452. }
  8453. }
  8454. } else if (currentType == OBJECTTYPE) {
  8455. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8456. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8457. } else {
  8458. for (var subKey in currentValue) {
  8459. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8460. }
  8461. }
  8462. }
  8463. };
  8464. for (var key in current) loop( key );
  8465. }
  8466. } else if (rootCurrentType == ARRAYTYPE) {
  8467. if (rootPreType != ARRAYTYPE) {
  8468. setResult(result, path, current);
  8469. } else {
  8470. if (current.length < pre.length) {
  8471. setResult(result, path, current);
  8472. } else {
  8473. current.forEach(function (item, index) {
  8474. _diff(item, pre[index], path + '[' + index + ']', result);
  8475. });
  8476. }
  8477. }
  8478. } else {
  8479. setResult(result, path, current);
  8480. }
  8481. }
  8482. function setResult(result, k, v) {
  8483. // if (type(v) != FUNCTIONTYPE) {
  8484. result[k] = v;
  8485. // }
  8486. }
  8487. function type(obj) {
  8488. return Object.prototype.toString.call(obj)
  8489. }
  8490. /* */
  8491. function flushCallbacks$1(vm) {
  8492. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8493. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"txCar","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8494. var mpInstance = vm.$scope;
  8495. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8496. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8497. }
  8498. var copies = vm.__next_tick_callbacks.slice(0);
  8499. vm.__next_tick_callbacks.length = 0;
  8500. for (var i = 0; i < copies.length; i++) {
  8501. copies[i]();
  8502. }
  8503. }
  8504. }
  8505. function hasRenderWatcher(vm) {
  8506. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8507. }
  8508. function nextTick$1(vm, cb) {
  8509. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8510. //2.nextTick 之前存在 render watcher
  8511. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8512. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"txCar","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  8513. var mpInstance = vm.$scope;
  8514. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8515. ']:nextVueTick');
  8516. }
  8517. return nextTick(cb, vm)
  8518. }else{
  8519. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"txCar","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  8520. var mpInstance$1 = vm.$scope;
  8521. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8522. ']:nextMPTick');
  8523. }
  8524. }
  8525. var _resolve;
  8526. if (!vm.__next_tick_callbacks) {
  8527. vm.__next_tick_callbacks = [];
  8528. }
  8529. vm.__next_tick_callbacks.push(function () {
  8530. if (cb) {
  8531. try {
  8532. cb.call(vm);
  8533. } catch (e) {
  8534. handleError(e, vm, 'nextTick');
  8535. }
  8536. } else if (_resolve) {
  8537. _resolve(vm);
  8538. }
  8539. });
  8540. // $flow-disable-line
  8541. if (!cb && typeof Promise !== 'undefined') {
  8542. return new Promise(function (resolve) {
  8543. _resolve = resolve;
  8544. })
  8545. }
  8546. }
  8547. /* */
  8548. function cloneWithData(vm) {
  8549. // 确保当前 vm 所有数据被同步
  8550. var ret = Object.create(null);
  8551. var dataKeys = [].concat(
  8552. Object.keys(vm._data || {}),
  8553. Object.keys(vm._computedWatchers || {}));
  8554. dataKeys.reduce(function(ret, key) {
  8555. ret[key] = vm[key];
  8556. return ret
  8557. }, ret);
  8558. // vue-composition-api
  8559. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8560. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8561. if (rawBindings) {
  8562. Object.keys(rawBindings).forEach(function (key) {
  8563. ret[key] = vm[key];
  8564. });
  8565. }
  8566. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8567. Object.assign(ret, vm.$mp.data || {});
  8568. if (
  8569. Array.isArray(vm.$options.behaviors) &&
  8570. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8571. ) { //form-field
  8572. ret['name'] = vm.name;
  8573. ret['value'] = vm.value;
  8574. }
  8575. return JSON.parse(JSON.stringify(ret))
  8576. }
  8577. var patch = function(oldVnode, vnode) {
  8578. var this$1 = this;
  8579. if (vnode === null) { //destroy
  8580. return
  8581. }
  8582. if (this.mpType === 'page' || this.mpType === 'component') {
  8583. var mpInstance = this.$scope;
  8584. var data = Object.create(null);
  8585. try {
  8586. data = cloneWithData(this);
  8587. } catch (err) {
  8588. console.error(err);
  8589. }
  8590. data.__webviewId__ = mpInstance.data.__webviewId__;
  8591. var mpData = Object.create(null);
  8592. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8593. mpData[key] = mpInstance.data[key];
  8594. });
  8595. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8596. if (Object.keys(diffData).length) {
  8597. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"txCar","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8598. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8599. ']差量更新',
  8600. JSON.stringify(diffData));
  8601. }
  8602. this.__next_tick_pending = true;
  8603. mpInstance.setData(diffData, function () {
  8604. this$1.__next_tick_pending = false;
  8605. flushCallbacks$1(this$1);
  8606. });
  8607. } else {
  8608. flushCallbacks$1(this);
  8609. }
  8610. }
  8611. };
  8612. /* */
  8613. function createEmptyRender() {
  8614. }
  8615. function mountComponent$1(
  8616. vm,
  8617. el,
  8618. hydrating
  8619. ) {
  8620. if (!vm.mpType) {//main.js 中的 new Vue
  8621. return vm
  8622. }
  8623. if (vm.mpType === 'app') {
  8624. vm.$options.render = createEmptyRender;
  8625. }
  8626. if (!vm.$options.render) {
  8627. vm.$options.render = createEmptyRender;
  8628. if (true) {
  8629. /* istanbul ignore if */
  8630. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8631. vm.$options.el || el) {
  8632. warn(
  8633. 'You are using the runtime-only build of Vue where the template ' +
  8634. 'compiler is not available. Either pre-compile the templates into ' +
  8635. 'render functions, or use the compiler-included build.',
  8636. vm
  8637. );
  8638. } else {
  8639. warn(
  8640. 'Failed to mount component: template or render function not defined.',
  8641. vm
  8642. );
  8643. }
  8644. }
  8645. }
  8646. !vm._$fallback && callHook(vm, 'beforeMount');
  8647. var updateComponent = function () {
  8648. vm._update(vm._render(), hydrating);
  8649. };
  8650. // we set this to vm._watcher inside the watcher's constructor
  8651. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8652. // component's mounted hook), which relies on vm._watcher being already defined
  8653. new Watcher(vm, updateComponent, noop, {
  8654. before: function before() {
  8655. if (vm._isMounted && !vm._isDestroyed) {
  8656. callHook(vm, 'beforeUpdate');
  8657. }
  8658. }
  8659. }, true /* isRenderWatcher */);
  8660. hydrating = false;
  8661. return vm
  8662. }
  8663. /* */
  8664. function renderClass (
  8665. staticClass,
  8666. dynamicClass
  8667. ) {
  8668. if (isDef(staticClass) || isDef(dynamicClass)) {
  8669. return concat(staticClass, stringifyClass(dynamicClass))
  8670. }
  8671. /* istanbul ignore next */
  8672. return ''
  8673. }
  8674. function concat (a, b) {
  8675. return a ? b ? (a + ' ' + b) : a : (b || '')
  8676. }
  8677. function stringifyClass (value) {
  8678. if (Array.isArray(value)) {
  8679. return stringifyArray(value)
  8680. }
  8681. if (isObject(value)) {
  8682. return stringifyObject(value)
  8683. }
  8684. if (typeof value === 'string') {
  8685. return value
  8686. }
  8687. /* istanbul ignore next */
  8688. return ''
  8689. }
  8690. function stringifyArray (value) {
  8691. var res = '';
  8692. var stringified;
  8693. for (var i = 0, l = value.length; i < l; i++) {
  8694. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8695. if (res) { res += ' '; }
  8696. res += stringified;
  8697. }
  8698. }
  8699. return res
  8700. }
  8701. function stringifyObject (value) {
  8702. var res = '';
  8703. for (var key in value) {
  8704. if (value[key]) {
  8705. if (res) { res += ' '; }
  8706. res += key;
  8707. }
  8708. }
  8709. return res
  8710. }
  8711. /* */
  8712. var parseStyleText = cached(function (cssText) {
  8713. var res = {};
  8714. var listDelimiter = /;(?![^(]*\))/g;
  8715. var propertyDelimiter = /:(.+)/;
  8716. cssText.split(listDelimiter).forEach(function (item) {
  8717. if (item) {
  8718. var tmp = item.split(propertyDelimiter);
  8719. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8720. }
  8721. });
  8722. return res
  8723. });
  8724. // normalize possible array / string values into Object
  8725. function normalizeStyleBinding (bindingStyle) {
  8726. if (Array.isArray(bindingStyle)) {
  8727. return toObject(bindingStyle)
  8728. }
  8729. if (typeof bindingStyle === 'string') {
  8730. return parseStyleText(bindingStyle)
  8731. }
  8732. return bindingStyle
  8733. }
  8734. /* */
  8735. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8736. function getTarget(obj, path) {
  8737. var parts = path.split('.');
  8738. var key = parts[0];
  8739. if (key.indexOf('__$n') === 0) { //number index
  8740. key = parseInt(key.replace('__$n', ''));
  8741. }
  8742. if (parts.length === 1) {
  8743. return obj[key]
  8744. }
  8745. return getTarget(obj[key], parts.slice(1).join('.'))
  8746. }
  8747. function internalMixin(Vue) {
  8748. Vue.config.errorHandler = function(err, vm, info) {
  8749. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8750. console.error(err);
  8751. /* eslint-disable no-undef */
  8752. var app = typeof getApp === 'function' && getApp();
  8753. if (app && app.onError) {
  8754. app.onError(err);
  8755. }
  8756. };
  8757. var oldEmit = Vue.prototype.$emit;
  8758. Vue.prototype.$emit = function(event) {
  8759. if (this.$scope && event) {
  8760. this.$scope['triggerEvent'](event, {
  8761. __args__: toArray(arguments, 1)
  8762. });
  8763. }
  8764. return oldEmit.apply(this, arguments)
  8765. };
  8766. Vue.prototype.$nextTick = function(fn) {
  8767. return nextTick$1(this, fn)
  8768. };
  8769. MP_METHODS.forEach(function (method) {
  8770. Vue.prototype[method] = function(args) {
  8771. if (this.$scope && this.$scope[method]) {
  8772. return this.$scope[method](args)
  8773. }
  8774. // mp-alipay
  8775. if (typeof my === 'undefined') {
  8776. return
  8777. }
  8778. if (method === 'createSelectorQuery') {
  8779. /* eslint-disable no-undef */
  8780. return my.createSelectorQuery(args)
  8781. } else if (method === 'createIntersectionObserver') {
  8782. /* eslint-disable no-undef */
  8783. return my.createIntersectionObserver(args)
  8784. }
  8785. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8786. };
  8787. });
  8788. Vue.prototype.__init_provide = initProvide;
  8789. Vue.prototype.__init_injections = initInjections;
  8790. Vue.prototype.__call_hook = function(hook, args) {
  8791. var vm = this;
  8792. // #7573 disable dep collection when invoking lifecycle hooks
  8793. pushTarget();
  8794. var handlers = vm.$options[hook];
  8795. var info = hook + " hook";
  8796. var ret;
  8797. if (handlers) {
  8798. for (var i = 0, j = handlers.length; i < j; i++) {
  8799. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8800. }
  8801. }
  8802. if (vm._hasHookEvent) {
  8803. vm.$emit('hook:' + hook, args);
  8804. }
  8805. popTarget();
  8806. return ret
  8807. };
  8808. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8809. if (Array.isArray(modifiers)) {
  8810. if (modifiers.indexOf('trim') !== -1) {
  8811. value = value.trim();
  8812. }
  8813. if (modifiers.indexOf('number') !== -1) {
  8814. value = this._n(value);
  8815. }
  8816. }
  8817. if (!target) {
  8818. target = this;
  8819. }
  8820. target[key] = value;
  8821. };
  8822. Vue.prototype.__set_sync = function(target, key, value) {
  8823. if (!target) {
  8824. target = this;
  8825. }
  8826. target[key] = value;
  8827. };
  8828. Vue.prototype.__get_orig = function(item) {
  8829. if (isPlainObject(item)) {
  8830. return item['$orig'] || item
  8831. }
  8832. return item
  8833. };
  8834. Vue.prototype.__get_value = function(dataPath, target) {
  8835. return getTarget(target || this, dataPath)
  8836. };
  8837. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  8838. return renderClass(staticClass, dynamicClass)
  8839. };
  8840. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  8841. if (!dynamicStyle && !staticStyle) {
  8842. return ''
  8843. }
  8844. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  8845. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  8846. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  8847. };
  8848. Vue.prototype.__map = function(val, iteratee) {
  8849. //TODO 暂不考虑 string
  8850. var ret, i, l, keys, key;
  8851. if (Array.isArray(val)) {
  8852. ret = new Array(val.length);
  8853. for (i = 0, l = val.length; i < l; i++) {
  8854. ret[i] = iteratee(val[i], i);
  8855. }
  8856. return ret
  8857. } else if (isObject(val)) {
  8858. keys = Object.keys(val);
  8859. ret = Object.create(null);
  8860. for (i = 0, l = keys.length; i < l; i++) {
  8861. key = keys[i];
  8862. ret[key] = iteratee(val[key], key, i);
  8863. }
  8864. return ret
  8865. } else if (typeof val === 'number') {
  8866. ret = new Array(val);
  8867. for (i = 0, l = val; i < l; i++) {
  8868. // 第一个参数暂时仍和小程序一致
  8869. ret[i] = iteratee(i, i);
  8870. }
  8871. return ret
  8872. }
  8873. return []
  8874. };
  8875. }
  8876. /* */
  8877. var LIFECYCLE_HOOKS$1 = [
  8878. //App
  8879. 'onLaunch',
  8880. 'onShow',
  8881. 'onHide',
  8882. 'onUniNViewMessage',
  8883. 'onPageNotFound',
  8884. 'onThemeChange',
  8885. 'onError',
  8886. 'onUnhandledRejection',
  8887. //Page
  8888. 'onInit',
  8889. 'onLoad',
  8890. // 'onShow',
  8891. 'onReady',
  8892. // 'onHide',
  8893. 'onUnload',
  8894. 'onPullDownRefresh',
  8895. 'onReachBottom',
  8896. 'onTabItemTap',
  8897. 'onAddToFavorites',
  8898. 'onShareTimeline',
  8899. 'onShareAppMessage',
  8900. 'onResize',
  8901. 'onPageScroll',
  8902. 'onNavigationBarButtonTap',
  8903. 'onBackPress',
  8904. 'onNavigationBarSearchInputChanged',
  8905. 'onNavigationBarSearchInputConfirmed',
  8906. 'onNavigationBarSearchInputClicked',
  8907. //Component
  8908. // 'onReady', // 兼容旧版本,应该移除该事件
  8909. 'onPageShow',
  8910. 'onPageHide',
  8911. 'onPageResize'
  8912. ];
  8913. function lifecycleMixin$1(Vue) {
  8914. //fixed vue-class-component
  8915. var oldExtend = Vue.extend;
  8916. Vue.extend = function(extendOptions) {
  8917. extendOptions = extendOptions || {};
  8918. var methods = extendOptions.methods;
  8919. if (methods) {
  8920. Object.keys(methods).forEach(function (methodName) {
  8921. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8922. extendOptions[methodName] = methods[methodName];
  8923. delete methods[methodName];
  8924. }
  8925. });
  8926. }
  8927. return oldExtend.call(this, extendOptions)
  8928. };
  8929. var strategies = Vue.config.optionMergeStrategies;
  8930. var mergeHook = strategies.created;
  8931. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8932. strategies[hook] = mergeHook;
  8933. });
  8934. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8935. }
  8936. /* */
  8937. // install platform patch function
  8938. Vue.prototype.__patch__ = patch;
  8939. // public mount method
  8940. Vue.prototype.$mount = function(
  8941. el ,
  8942. hydrating
  8943. ) {
  8944. return mountComponent$1(this, el, hydrating)
  8945. };
  8946. lifecycleMixin$1(Vue);
  8947. internalMixin(Vue);
  8948. /* */
  8949. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  8950. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 2)))
  8951. /***/ }),
  8952. /***/ 4:
  8953. /*!*************************************************************!*\
  8954. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  8955. \*************************************************************/
  8956. /*! no static exports found */
  8957. /***/ (function(module, exports, __webpack_require__) {
  8958. "use strict";
  8959. /* 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;
  8960. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  8961. var defaultDelimiters = ['{', '}'];var
  8962. BaseFormatter = /*#__PURE__*/function () {
  8963. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  8964. this._caches = Object.create(null);
  8965. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  8966. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  8967. if (!values) {
  8968. return [message];
  8969. }
  8970. var tokens = this._caches[message];
  8971. if (!tokens) {
  8972. tokens = parse(message, delimiters);
  8973. this._caches[message] = tokens;
  8974. }
  8975. return compile(tokens, values);
  8976. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  8977. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  8978. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  8979. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  8980. var tokens = [];
  8981. var position = 0;
  8982. var text = '';
  8983. while (position < format.length) {
  8984. var char = format[position++];
  8985. if (char === startDelimiter) {
  8986. if (text) {
  8987. tokens.push({ type: 'text', value: text });
  8988. }
  8989. text = '';
  8990. var sub = '';
  8991. char = format[position++];
  8992. while (char !== undefined && char !== endDelimiter) {
  8993. sub += char;
  8994. char = format[position++];
  8995. }
  8996. var isClosed = char === endDelimiter;
  8997. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  8998. 'list' :
  8999. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  9000. 'named' :
  9001. 'unknown';
  9002. tokens.push({ value: sub, type: type });
  9003. }
  9004. // else if (char === '%') {
  9005. // // when found rails i18n syntax, skip text capture
  9006. // if (format[position] !== '{') {
  9007. // text += char
  9008. // }
  9009. // }
  9010. else {
  9011. text += char;
  9012. }
  9013. }
  9014. text && tokens.push({ type: 'text', value: text });
  9015. return tokens;
  9016. }
  9017. function compile(tokens, values) {
  9018. var compiled = [];
  9019. var index = 0;
  9020. var mode = isArray(values) ?
  9021. 'list' :
  9022. isObject(values) ?
  9023. 'named' :
  9024. 'unknown';
  9025. if (mode === 'unknown') {
  9026. return compiled;
  9027. }
  9028. while (index < tokens.length) {
  9029. var token = tokens[index];
  9030. switch (token.type) {
  9031. case 'text':
  9032. compiled.push(token.value);
  9033. break;
  9034. case 'list':
  9035. compiled.push(values[parseInt(token.value, 10)]);
  9036. break;
  9037. case 'named':
  9038. if (mode === 'named') {
  9039. compiled.push(values[token.value]);
  9040. } else
  9041. {
  9042. if (true) {
  9043. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  9044. }
  9045. }
  9046. break;
  9047. case 'unknown':
  9048. if (true) {
  9049. console.warn("Detect 'unknown' type of token!");
  9050. }
  9051. break;}
  9052. index++;
  9053. }
  9054. return compiled;
  9055. }
  9056. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  9057. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  9058. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  9059. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  9060. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  9061. var hasOwnProperty = Object.prototype.hasOwnProperty;
  9062. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  9063. var defaultFormatter = new BaseFormatter();
  9064. function include(str, parts) {
  9065. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  9066. }
  9067. function startsWith(str, parts) {
  9068. return parts.find(function (part) {return str.indexOf(part) === 0;});
  9069. }
  9070. function normalizeLocale(locale, messages) {
  9071. if (!locale) {
  9072. return;
  9073. }
  9074. locale = locale.trim().replace(/_/g, '-');
  9075. if (messages && messages[locale]) {
  9076. return locale;
  9077. }
  9078. locale = locale.toLowerCase();
  9079. if (locale.indexOf('zh') === 0) {
  9080. if (locale.indexOf('-hans') > -1) {
  9081. return LOCALE_ZH_HANS;
  9082. }
  9083. if (locale.indexOf('-hant') > -1) {
  9084. return LOCALE_ZH_HANT;
  9085. }
  9086. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  9087. return LOCALE_ZH_HANT;
  9088. }
  9089. return LOCALE_ZH_HANS;
  9090. }
  9091. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  9092. if (lang) {
  9093. return lang;
  9094. }
  9095. }var
  9096. I18n = /*#__PURE__*/function () {
  9097. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  9098. this.locale = LOCALE_EN;
  9099. this.fallbackLocale = LOCALE_EN;
  9100. this.message = {};
  9101. this.messages = {};
  9102. this.watchers = [];
  9103. if (fallbackLocale) {
  9104. this.fallbackLocale = fallbackLocale;
  9105. }
  9106. this.formater = formater || defaultFormatter;
  9107. this.messages = messages || {};
  9108. this.setLocale(locale || LOCALE_EN);
  9109. if (watcher) {
  9110. this.watchLocale(watcher);
  9111. }
  9112. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  9113. locale) {var _this = this;
  9114. var oldLocale = this.locale;
  9115. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  9116. if (!this.messages[this.locale]) {
  9117. // 可能初始化时不存在
  9118. this.messages[this.locale] = {};
  9119. }
  9120. this.message = this.messages[this.locale];
  9121. // 仅发生变化时,通知
  9122. if (oldLocale !== this.locale) {
  9123. this.watchers.forEach(function (watcher) {
  9124. watcher(_this.locale, oldLocale);
  9125. });
  9126. }
  9127. } }, { key: "getLocale", value: function getLocale()
  9128. {
  9129. return this.locale;
  9130. } }, { key: "watchLocale", value: function watchLocale(
  9131. fn) {var _this2 = this;
  9132. var index = this.watchers.push(fn) - 1;
  9133. return function () {
  9134. _this2.watchers.splice(index, 1);
  9135. };
  9136. } }, { key: "add", value: function add(
  9137. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  9138. var curMessages = this.messages[locale];
  9139. if (curMessages) {
  9140. if (override) {
  9141. Object.assign(curMessages, message);
  9142. } else
  9143. {
  9144. Object.keys(message).forEach(function (key) {
  9145. if (!hasOwn(curMessages, key)) {
  9146. curMessages[key] = message[key];
  9147. }
  9148. });
  9149. }
  9150. } else
  9151. {
  9152. this.messages[locale] = message;
  9153. }
  9154. } }, { key: "f", value: function f(
  9155. message, values, delimiters) {
  9156. return this.formater.interpolate(message, values, delimiters).join('');
  9157. } }, { key: "t", value: function t(
  9158. key, locale, values) {
  9159. var message = this.message;
  9160. if (typeof locale === 'string') {
  9161. locale = normalizeLocale(locale, this.messages);
  9162. locale && (message = this.messages[locale]);
  9163. } else
  9164. {
  9165. values = locale;
  9166. }
  9167. if (!hasOwn(message, key)) {
  9168. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  9169. return key;
  9170. }
  9171. return this.formater.interpolate(message[key], values).join('');
  9172. } }]);return I18n;}();exports.I18n = I18n;
  9173. function watchAppLocale(appVm, i18n) {
  9174. // 需要保证 watch 的触发在组件渲染之前
  9175. if (appVm.$watchLocale) {
  9176. // vue2
  9177. appVm.$watchLocale(function (newLocale) {
  9178. i18n.setLocale(newLocale);
  9179. });
  9180. } else
  9181. {
  9182. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  9183. i18n.setLocale(newLocale);
  9184. });
  9185. }
  9186. }
  9187. function getDefaultLocale() {
  9188. if (typeof uni !== 'undefined' && uni.getLocale) {
  9189. return uni.getLocale();
  9190. }
  9191. // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale
  9192. if (typeof global !== 'undefined' && global.getLocale) {
  9193. return global.getLocale();
  9194. }
  9195. return LOCALE_EN;
  9196. }
  9197. 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;
  9198. // 兼容旧版本入参
  9199. if (typeof locale !== 'string') {var _ref4 =
  9200. [
  9201. messages,
  9202. locale];locale = _ref4[0];messages = _ref4[1];
  9203. }
  9204. if (typeof locale !== 'string') {
  9205. // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined
  9206. locale = getDefaultLocale();
  9207. }
  9208. if (typeof fallbackLocale !== 'string') {
  9209. fallbackLocale =
  9210. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  9211. LOCALE_EN;
  9212. }
  9213. var i18n = new I18n({
  9214. locale: locale,
  9215. fallbackLocale: fallbackLocale,
  9216. messages: messages,
  9217. watcher: watcher });
  9218. var _t = function t(key, values) {
  9219. if (typeof getApp !== 'function') {
  9220. // app view
  9221. /* eslint-disable no-func-assign */
  9222. _t = function t(key, values) {
  9223. return i18n.t(key, values);
  9224. };
  9225. } else
  9226. {
  9227. var isWatchedAppLocale = false;
  9228. _t = function t(key, values) {
  9229. var appVm = getApp().$vm;
  9230. // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化
  9231. // options: {
  9232. // type: Array,
  9233. // default () {
  9234. // return [{
  9235. // icon: 'shop',
  9236. // text: t("uni-goods-nav.options.shop"),
  9237. // }, {
  9238. // icon: 'cart',
  9239. // text: t("uni-goods-nav.options.cart")
  9240. // }]
  9241. // }
  9242. // },
  9243. if (appVm) {
  9244. // 触发响应式
  9245. appVm.$locale;
  9246. if (!isWatchedAppLocale) {
  9247. isWatchedAppLocale = true;
  9248. watchAppLocale(appVm, i18n);
  9249. }
  9250. }
  9251. return i18n.t(key, values);
  9252. };
  9253. }
  9254. return _t(key, values);
  9255. };
  9256. return {
  9257. i18n: i18n,
  9258. f: function f(message, values, delimiters) {
  9259. return i18n.f(message, values, delimiters);
  9260. },
  9261. t: function t(key, values) {
  9262. return _t(key, values);
  9263. },
  9264. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  9265. return i18n.add(locale, message, override);
  9266. },
  9267. watch: function watch(fn) {
  9268. return i18n.watchLocale(fn);
  9269. },
  9270. getLocale: function getLocale() {
  9271. return i18n.getLocale();
  9272. },
  9273. setLocale: function setLocale(newLocale) {
  9274. return i18n.setLocale(newLocale);
  9275. } };
  9276. }
  9277. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  9278. var formater;
  9279. function hasI18nJson(jsonObj, delimiters) {
  9280. if (!formater) {
  9281. formater = new BaseFormatter();
  9282. }
  9283. return walkJsonObj(jsonObj, function (jsonObj, key) {
  9284. var value = jsonObj[key];
  9285. if (isString(value)) {
  9286. if (isI18nStr(value, delimiters)) {
  9287. return true;
  9288. }
  9289. } else
  9290. {
  9291. return hasI18nJson(value, delimiters);
  9292. }
  9293. });
  9294. }
  9295. function parseI18nJson(jsonObj, values, delimiters) {
  9296. if (!formater) {
  9297. formater = new BaseFormatter();
  9298. }
  9299. walkJsonObj(jsonObj, function (jsonObj, key) {
  9300. var value = jsonObj[key];
  9301. if (isString(value)) {
  9302. if (isI18nStr(value, delimiters)) {
  9303. jsonObj[key] = compileStr(value, values, delimiters);
  9304. }
  9305. } else
  9306. {
  9307. parseI18nJson(value, values, delimiters);
  9308. }
  9309. });
  9310. return jsonObj;
  9311. }
  9312. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  9313. if (!isI18nStr(jsonStr, delimiters)) {
  9314. return jsonStr;
  9315. }
  9316. if (!formater) {
  9317. formater = new BaseFormatter();
  9318. }
  9319. var localeValues = [];
  9320. Object.keys(locales).forEach(function (name) {
  9321. if (name !== locale) {
  9322. localeValues.push({
  9323. locale: name,
  9324. values: locales[name] });
  9325. }
  9326. });
  9327. localeValues.unshift({ locale: locale, values: locales[locale] });
  9328. try {
  9329. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  9330. }
  9331. catch (e) {}
  9332. return jsonStr;
  9333. }
  9334. function isI18nStr(value, delimiters) {
  9335. return value.indexOf(delimiters[0]) > -1;
  9336. }
  9337. function compileStr(value, values, delimiters) {
  9338. return formater.interpolate(value, values, delimiters).join('');
  9339. }
  9340. function compileValue(jsonObj, key, localeValues, delimiters) {
  9341. var value = jsonObj[key];
  9342. if (isString(value)) {
  9343. // 存在国际化
  9344. if (isI18nStr(value, delimiters)) {
  9345. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  9346. if (localeValues.length > 1) {
  9347. // 格式化国际化语言
  9348. var valueLocales = jsonObj[key + 'Locales'] = {};
  9349. localeValues.forEach(function (localValue) {
  9350. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  9351. });
  9352. }
  9353. }
  9354. } else
  9355. {
  9356. compileJsonObj(value, localeValues, delimiters);
  9357. }
  9358. }
  9359. function compileJsonObj(jsonObj, localeValues, delimiters) {
  9360. walkJsonObj(jsonObj, function (jsonObj, key) {
  9361. compileValue(jsonObj, key, localeValues, delimiters);
  9362. });
  9363. return jsonObj;
  9364. }
  9365. function walkJsonObj(jsonObj, walk) {
  9366. if (isArray(jsonObj)) {
  9367. for (var i = 0; i < jsonObj.length; i++) {
  9368. if (walk(jsonObj, i)) {
  9369. return true;
  9370. }
  9371. }
  9372. } else
  9373. if (isObject(jsonObj)) {
  9374. for (var key in jsonObj) {
  9375. if (walk(jsonObj, key)) {
  9376. return true;
  9377. }
  9378. }
  9379. }
  9380. return false;
  9381. }
  9382. function resolveLocale(locales) {
  9383. return function (locale) {
  9384. if (!locale) {
  9385. return locale;
  9386. }
  9387. locale = normalizeLocale(locale) || locale;
  9388. return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;});
  9389. };
  9390. }
  9391. function resolveLocaleChain(locale) {
  9392. var chain = [];
  9393. var tokens = locale.split('-');
  9394. while (tokens.length) {
  9395. chain.push(tokens.join('-'));
  9396. tokens.pop();
  9397. }
  9398. return chain;
  9399. }
  9400. /* 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)))
  9401. /***/ }),
  9402. /***/ 5:
  9403. /*!*******************************************!*\
  9404. !*** /Users/guo/Desktop/txCar/pages.json ***!
  9405. \*******************************************/
  9406. /*! no static exports found */
  9407. /***/ (function(module, exports) {
  9408. /***/ })
  9409. }]);
  9410. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map