vendor.js 341 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426
  1. (my["webpackJsonp"] = my["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!************************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-alipay/dist/index.js ***!
  5. \************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. 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 */ 2));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 _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 _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;}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;}
  10. var _toString = Object.prototype.toString;
  11. var hasOwnProperty = Object.prototype.hasOwnProperty;
  12. function isFn(fn) {
  13. return typeof fn === 'function';
  14. }
  15. function isStr(str) {
  16. return typeof str === 'string';
  17. }
  18. function isPlainObject(obj) {
  19. return _toString.call(obj) === '[object Object]';
  20. }
  21. function hasOwn(obj, key) {
  22. return hasOwnProperty.call(obj, key);
  23. }
  24. function noop() {}
  25. /**
  26. * Create a cached version of a pure function.
  27. */
  28. function cached(fn) {
  29. var cache = Object.create(null);
  30. return function cachedFn(str) {
  31. var hit = cache[str];
  32. return hit || (cache[str] = fn(str));
  33. };
  34. }
  35. /**
  36. * Camelize a hyphen-delimited string.
  37. */
  38. var camelizeRE = /-(\w)/g;
  39. var camelize = cached(function (str) {
  40. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  41. });
  42. var HOOKS = [
  43. 'invoke',
  44. 'success',
  45. 'fail',
  46. 'complete',
  47. 'returnValue'];
  48. var globalInterceptors = {};
  49. var scopedInterceptors = {};
  50. function mergeHook(parentVal, childVal) {
  51. var res = childVal ?
  52. parentVal ?
  53. parentVal.concat(childVal) :
  54. Array.isArray(childVal) ?
  55. childVal : [childVal] :
  56. parentVal;
  57. return res ?
  58. dedupeHooks(res) :
  59. res;
  60. }
  61. function dedupeHooks(hooks) {
  62. var res = [];
  63. for (var i = 0; i < hooks.length; i++) {
  64. if (res.indexOf(hooks[i]) === -1) {
  65. res.push(hooks[i]);
  66. }
  67. }
  68. return res;
  69. }
  70. function removeHook(hooks, hook) {
  71. var index = hooks.indexOf(hook);
  72. if (index !== -1) {
  73. hooks.splice(index, 1);
  74. }
  75. }
  76. function mergeInterceptorHook(interceptor, option) {
  77. Object.keys(option).forEach(function (hook) {
  78. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  79. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  80. }
  81. });
  82. }
  83. function removeInterceptorHook(interceptor, option) {
  84. if (!interceptor || !option) {
  85. return;
  86. }
  87. Object.keys(option).forEach(function (hook) {
  88. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  89. removeHook(interceptor[hook], option[hook]);
  90. }
  91. });
  92. }
  93. function addInterceptor(method, option) {
  94. if (typeof method === 'string' && isPlainObject(option)) {
  95. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  96. } else if (isPlainObject(method)) {
  97. mergeInterceptorHook(globalInterceptors, method);
  98. }
  99. }
  100. function removeInterceptor(method, option) {
  101. if (typeof method === 'string') {
  102. if (isPlainObject(option)) {
  103. removeInterceptorHook(scopedInterceptors[method], option);
  104. } else {
  105. delete scopedInterceptors[method];
  106. }
  107. } else if (isPlainObject(method)) {
  108. removeInterceptorHook(globalInterceptors, method);
  109. }
  110. }
  111. function wrapperHook(hook) {
  112. return function (data) {
  113. return hook(data) || data;
  114. };
  115. }
  116. function isPromise(obj) {
  117. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  118. }
  119. function queue(hooks, data) {
  120. var promise = false;
  121. for (var i = 0; i < hooks.length; i++) {
  122. var hook = hooks[i];
  123. if (promise) {
  124. promise = Promise.resolve(wrapperHook(hook));
  125. } else {
  126. var res = hook(data);
  127. if (isPromise(res)) {
  128. promise = Promise.resolve(res);
  129. }
  130. if (res === false) {
  131. return {
  132. then: function then() {} };
  133. }
  134. }
  135. }
  136. return promise || {
  137. then: function then(callback) {
  138. return callback(data);
  139. } };
  140. }
  141. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  142. ['success', 'fail', 'complete'].forEach(function (name) {
  143. if (Array.isArray(interceptor[name])) {
  144. var oldCallback = options[name];
  145. options[name] = function callbackInterceptor(res) {
  146. queue(interceptor[name], res).then(function (res) {
  147. /* eslint-disable no-mixed-operators */
  148. return isFn(oldCallback) && oldCallback(res) || res;
  149. });
  150. };
  151. }
  152. });
  153. return options;
  154. }
  155. function wrapperReturnValue(method, returnValue) {
  156. var returnValueHooks = [];
  157. if (Array.isArray(globalInterceptors.returnValue)) {
  158. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  159. }
  160. var interceptor = scopedInterceptors[method];
  161. if (interceptor && Array.isArray(interceptor.returnValue)) {
  162. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  163. }
  164. returnValueHooks.forEach(function (hook) {
  165. returnValue = hook(returnValue) || returnValue;
  166. });
  167. return returnValue;
  168. }
  169. function getApiInterceptorHooks(method) {
  170. var interceptor = Object.create(null);
  171. Object.keys(globalInterceptors).forEach(function (hook) {
  172. if (hook !== 'returnValue') {
  173. interceptor[hook] = globalInterceptors[hook].slice();
  174. }
  175. });
  176. var scopedInterceptor = scopedInterceptors[method];
  177. if (scopedInterceptor) {
  178. Object.keys(scopedInterceptor).forEach(function (hook) {
  179. if (hook !== 'returnValue') {
  180. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  181. }
  182. });
  183. }
  184. return interceptor;
  185. }
  186. 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];}
  187. var interceptor = getApiInterceptorHooks(method);
  188. if (interceptor && Object.keys(interceptor).length) {
  189. if (Array.isArray(interceptor.invoke)) {
  190. var res = queue(interceptor.invoke, options);
  191. return res.then(function (options) {
  192. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  193. });
  194. } else {
  195. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  196. }
  197. }
  198. return api.apply(void 0, [options].concat(params));
  199. }
  200. var promiseInterceptor = {
  201. returnValue: function returnValue(res) {
  202. if (!isPromise(res)) {
  203. return res;
  204. }
  205. return res.then(function (res) {
  206. return res[1];
  207. }).catch(function (res) {
  208. return res[0];
  209. });
  210. } };
  211. var SYNC_API_RE =
  212. /^\$|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
  213. var CONTEXT_API_RE = /^create|Manager$/;
  214. // Context例外情况
  215. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  216. // 同步例外情况
  217. var ASYNC_API = ['createBLEConnection'];
  218. var CALLBACK_API_RE = /^on|^off/;
  219. function isContextApi(name) {
  220. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  221. }
  222. function isSyncApi(name) {
  223. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  224. }
  225. function isCallbackApi(name) {
  226. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  227. }
  228. function handlePromise(promise) {
  229. return promise.then(function (data) {
  230. return [null, data];
  231. }).
  232. catch(function (err) {return [err];});
  233. }
  234. function shouldPromise(name) {
  235. if (
  236. isContextApi(name) ||
  237. isSyncApi(name) ||
  238. isCallbackApi(name))
  239. {
  240. return false;
  241. }
  242. return true;
  243. }
  244. /* eslint-disable no-extend-native */
  245. if (!Promise.prototype.finally) {
  246. Promise.prototype.finally = function (callback) {
  247. var promise = this.constructor;
  248. return this.then(
  249. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  250. function (reason) {return promise.resolve(callback()).then(function () {
  251. throw reason;
  252. });});
  253. };
  254. }
  255. function promisify(name, api) {
  256. if (!shouldPromise(name)) {
  257. return api;
  258. }
  259. 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];}
  260. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  261. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  262. }
  263. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  264. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  265. success: resolve,
  266. fail: reject })].concat(
  267. params));
  268. })));
  269. };
  270. }
  271. var EPS = 1e-4;
  272. var BASE_DEVICE_WIDTH = 750;
  273. var isIOS = false;
  274. var deviceWidth = 0;
  275. var deviceDPR = 0;
  276. function checkDeviceWidth() {var _my$getSystemInfoSync =
  277. my.getSystemInfoSync(),platform = _my$getSystemInfoSync.platform,pixelRatio = _my$getSystemInfoSync.pixelRatio,windowWidth = _my$getSystemInfoSync.windowWidth; // uni=>my runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  278. deviceWidth = windowWidth;
  279. deviceDPR = pixelRatio;
  280. isIOS = platform === 'ios';
  281. }
  282. function upx2px(number, newDeviceWidth) {
  283. if (deviceWidth === 0) {
  284. checkDeviceWidth();
  285. }
  286. number = Number(number);
  287. if (number === 0) {
  288. return 0;
  289. }
  290. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  291. if (result < 0) {
  292. result = -result;
  293. }
  294. result = Math.floor(result + EPS);
  295. if (result === 0) {
  296. if (deviceDPR === 1 || !isIOS) {
  297. result = 1;
  298. } else {
  299. result = 0.5;
  300. }
  301. }
  302. return number < 0 ? -result : result;
  303. }
  304. var interceptors = {
  305. promiseInterceptor: promiseInterceptor };
  306. var baseApi = /*#__PURE__*/Object.freeze({
  307. __proto__: null,
  308. upx2px: upx2px,
  309. addInterceptor: addInterceptor,
  310. removeInterceptor: removeInterceptor,
  311. interceptors: interceptors });var
  312. EventChannel = /*#__PURE__*/function () {
  313. function EventChannel(id, events) {var _this = this;_classCallCheck(this, EventChannel);
  314. this.id = id;
  315. this.listener = {};
  316. this.emitCache = {};
  317. if (events) {
  318. Object.keys(events).forEach(function (name) {
  319. _this.on(name, events[name]);
  320. });
  321. }
  322. }_createClass(EventChannel, [{ key: "emit", value: function emit(
  323. eventName) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  324. var fns = this.listener[eventName];
  325. if (!fns) {
  326. return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
  327. }
  328. fns.forEach(function (opt) {
  329. opt.fn.apply(opt.fn, args);
  330. });
  331. this.listener[eventName] = fns.filter(function (opt) {return opt.type !== 'once';});
  332. } }, { key: "on", value: function on(
  333. eventName, fn) {
  334. this._addListener(eventName, 'on', fn);
  335. this._clearCache(eventName);
  336. } }, { key: "once", value: function once(
  337. eventName, fn) {
  338. this._addListener(eventName, 'once', fn);
  339. this._clearCache(eventName);
  340. } }, { key: "off", value: function off(
  341. eventName, fn) {
  342. var fns = this.listener[eventName];
  343. if (!fns) {
  344. return;
  345. }
  346. if (fn) {
  347. for (var i = 0; i < fns.length;) {
  348. if (fns[i].fn === fn) {
  349. fns.splice(i, 1);
  350. i--;
  351. }
  352. i++;
  353. }
  354. } else {
  355. delete this.listener[eventName];
  356. }
  357. } }, { key: "_clearCache", value: function _clearCache(
  358. eventName) {
  359. var cacheArgs = this.emitCache[eventName];
  360. if (cacheArgs) {
  361. for (; cacheArgs.length > 0;) {
  362. this.emit.apply(this, [eventName].concat(cacheArgs.shift()));
  363. }
  364. }
  365. } }, { key: "_addListener", value: function _addListener(
  366. eventName, type, fn) {
  367. (this.listener[eventName] || (this.listener[eventName] = [])).push({
  368. fn: fn,
  369. type: type });
  370. } }]);return EventChannel;}();
  371. var eventChannels = {};
  372. var eventChannelStack = [];
  373. var id = 0;
  374. function initEventChannel(events) {var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  375. id++;
  376. var eventChannel = new EventChannel(id, events);
  377. if (cache) {
  378. eventChannels[id] = eventChannel;
  379. eventChannelStack.push(eventChannel);
  380. }
  381. return eventChannel;
  382. }
  383. function getEventChannel(id) {
  384. if (id) {
  385. var eventChannel = eventChannels[id];
  386. delete eventChannels[id];
  387. return eventChannel;
  388. }
  389. return eventChannelStack.shift();
  390. }
  391. var navigateTo = {
  392. args: function args(fromArgs, toArgs) {
  393. var id = initEventChannel(fromArgs.events).id;
  394. if (fromArgs.url) {
  395. fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + id;
  396. }
  397. },
  398. returnValue: function returnValue(fromRes, toRes) {
  399. fromRes.eventChannel = getEventChannel();
  400. } };
  401. function findExistsPageIndex(url) {
  402. var pages = getCurrentPages();
  403. var len = pages.length;
  404. while (len--) {
  405. var page = pages[len];
  406. if (page.$page && page.$page.fullPath === url) {
  407. return len;
  408. }
  409. }
  410. return -1;
  411. }
  412. var redirectTo = {
  413. name: function name(fromArgs) {
  414. if (fromArgs.exists === 'back' && fromArgs.delta) {
  415. return 'navigateBack';
  416. }
  417. return 'redirectTo';
  418. },
  419. args: function args(fromArgs) {
  420. if (fromArgs.exists === 'back' && fromArgs.url) {
  421. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  422. if (existsPageIndex !== -1) {
  423. var delta = getCurrentPages().length - 1 - existsPageIndex;
  424. if (delta > 0) {
  425. fromArgs.delta = delta;
  426. }
  427. }
  428. }
  429. } };
  430. function setStorageSync(key, data) {
  431. return my.setStorageSync({
  432. key: key,
  433. data: data });
  434. }
  435. function getStorageSync(key) {
  436. var result = my.getStorageSync({
  437. key: key });
  438. // 支付宝平台会返回一个 success 值,但是目前测试的结果这个始终是 true。当没有存储数据的时候,其它平台会返回空字符串。
  439. return result.data !== null ? result.data : '';
  440. }
  441. function removeStorageSync(key) {
  442. return my.removeStorageSync({
  443. key: key });
  444. }
  445. var UUID_KEY = '__DC_STAT_UUID';
  446. var deviceId;
  447. function addUuid(result) {
  448. deviceId = deviceId || getStorageSync(UUID_KEY);
  449. if (!deviceId) {
  450. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  451. my.setStorage({
  452. key: UUID_KEY,
  453. data: deviceId });
  454. }
  455. result.deviceId = deviceId;
  456. }
  457. function addSafeAreaInsets(result) {
  458. if (result.safeArea) {
  459. var safeArea = result.safeArea;
  460. result.safeAreaInsets = {
  461. top: safeArea.top,
  462. left: safeArea.left,
  463. right: result.windowWidth - safeArea.right,
  464. bottom: result.windowHeight - safeArea.bottom };
  465. }
  466. }
  467. function normalizePlatform(result) {
  468. var platform = result.platform ? result.platform.toLowerCase() : 'devtools';
  469. if (!~['android', 'ios'].indexOf(platform)) {
  470. platform = 'devtools';
  471. }
  472. result.platform = platform;
  473. }
  474. var getSystemInfo = {
  475. returnValue: function returnValue(result) {
  476. addUuid(result);
  477. addSafeAreaInsets(result);
  478. normalizePlatform(result);
  479. } };
  480. // 不支持的 API 列表
  481. var todos = [
  482. 'preloadPage',
  483. 'unPreloadPage',
  484. 'loadSubPackage'
  485. // 'getRecorderManager',
  486. // 'getBackgroundAudioManager',
  487. // 'createInnerAudioContext',
  488. // 'createCameraContext',
  489. // 'createLivePlayerContext',
  490. // 'startAccelerometer',
  491. // 'startCompass',
  492. // 'authorize',
  493. // 'chooseInvoiceTitle',
  494. // 'addTemplate',
  495. // 'deleteTemplate',
  496. // 'getTemplateLibraryById',
  497. // 'getTemplateLibraryList',
  498. // 'getTemplateList',
  499. // 'sendTemplateMessage',
  500. // 'setEnableDebug',
  501. // 'getExtConfig',
  502. // 'getExtConfigSync',
  503. // 'onWindowResize',
  504. // 'offWindowResize'
  505. ];
  506. // 存在兼容性的 API 列表
  507. var canIUses = [
  508. 'startPullDownRefresh',
  509. 'setTabBarItem',
  510. 'setTabBarStyle',
  511. 'hideTabBar',
  512. 'showTabBar',
  513. 'setTabBarBadge',
  514. 'removeTabBarBadge',
  515. 'showTabBarRedDot',
  516. 'hideTabBarRedDot',
  517. 'openSetting',
  518. 'getSetting',
  519. 'createIntersectionObserver',
  520. 'getUpdateManager',
  521. 'setBackgroundColor',
  522. 'setBackgroundTextStyle',
  523. 'checkIsSupportSoterAuthentication',
  524. 'startSoterAuthentication',
  525. 'checkIsSoterEnrolledInDevice',
  526. 'openDocument',
  527. 'createVideoContext',
  528. 'onMemoryWarning',
  529. 'addPhoneContact'];
  530. function _handleNetworkInfo(result) {
  531. switch (result.networkType) {
  532. case 'NOTREACHABLE':
  533. result.networkType = 'none';
  534. break;
  535. case 'WWAN':
  536. // TODO ?
  537. result.networkType = '3g';
  538. break;
  539. default:
  540. result.networkType = result.networkType.toLowerCase();
  541. break;}
  542. return {};
  543. }
  544. var protocols = { // 需要做转换的 API 列表
  545. navigateTo: navigateTo,
  546. redirectTo: redirectTo,
  547. returnValue: function returnValue(methodName) {var res = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; // 通用 returnValue 解析
  548. if (res.error || res.errorMessage) {
  549. res.errMsg = "".concat(methodName, ":fail ").concat(res.errorMessage || res.error);
  550. delete res.error;
  551. delete res.errorMessage;
  552. } else {
  553. res.errMsg = "".concat(methodName, ":ok");
  554. }
  555. return res;
  556. },
  557. request: {
  558. name: my.canIUse('request') ? 'request' : 'httpRequest',
  559. args: function args(fromArgs) {
  560. var method = fromArgs.method || 'GET';
  561. if (!fromArgs.header) {// 默认增加 header 参数,方便格式化 content-type
  562. fromArgs.header = {};
  563. }
  564. var headers = {
  565. 'content-type': 'application/json' };
  566. Object.keys(fromArgs.header).forEach(function (key) {
  567. headers[key.toLocaleLowerCase()] = fromArgs.header[key];
  568. });
  569. return {
  570. header: function header() {var header = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var toArgs = arguments.length > 1 ? arguments[1] : undefined;
  571. return {
  572. name: 'headers',
  573. value: headers };
  574. },
  575. data: function data(_data) {
  576. // 钉钉小程序在content-type为application/json时需上传字符串形式data,使用my.dd在真机运行钉钉小程序时不能正确判断
  577. if (my.canIUse('saveFileToDingTalk') && method.toUpperCase() === 'POST' && headers['content-type'].indexOf(
  578. 'application/json') === 0 && isPlainObject(_data)) {
  579. return {
  580. name: 'data',
  581. value: JSON.stringify(_data) };
  582. }
  583. return {
  584. name: 'data',
  585. value: _data };
  586. },
  587. method: 'method', // TODO 支付宝小程序仅支持 get,post
  588. responseType: false };
  589. },
  590. returnValue: {
  591. status: 'statusCode',
  592. headers: 'header' } },
  593. setNavigationBarColor: {
  594. name: 'setNavigationBar',
  595. args: {
  596. frontColor: false,
  597. animation: false } },
  598. setNavigationBarTitle: {
  599. name: 'setNavigationBar' },
  600. showModal: function showModal()
  601. {var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},_ref$showCancel = _ref.showCancel,showCancel = _ref$showCancel === void 0 ? true : _ref$showCancel;
  602. if (showCancel) {
  603. return {
  604. name: 'confirm',
  605. args: {
  606. cancelColor: false,
  607. confirmColor: false,
  608. cancelText: 'cancelButtonText',
  609. confirmText: 'confirmButtonText' },
  610. returnValue: function returnValue(fromRes, toRes) {
  611. toRes.confirm = fromRes.confirm;
  612. toRes.cancel = !fromRes.confirm;
  613. } };
  614. }
  615. return {
  616. name: 'alert',
  617. args: {
  618. confirmColor: false,
  619. confirmText: 'buttonText' },
  620. returnValue: function returnValue(fromRes, toRes) {
  621. toRes.confirm = true;
  622. toRes.cancel = false;
  623. } };
  624. },
  625. showToast: function showToast()
  626. {var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},_ref2$icon = _ref2.icon,icon = _ref2$icon === void 0 ? 'success' : _ref2$icon;
  627. var args = {
  628. title: 'content',
  629. icon: 'type',
  630. duration: false,
  631. image: false,
  632. mask: false };
  633. if (icon === 'loading') {
  634. return {
  635. name: 'showLoading',
  636. args: args };
  637. }
  638. return {
  639. name: 'showToast',
  640. args: args };
  641. },
  642. showActionSheet: {
  643. name: 'showActionSheet',
  644. args: {
  645. itemList: 'items',
  646. itemColor: false },
  647. returnValue: {
  648. index: 'tapIndex' } },
  649. showLoading: {
  650. args: {
  651. title: 'content',
  652. mask: false } },
  653. uploadFile: {
  654. args: {
  655. name: 'fileName' }
  656. // 从测试结果看,是有返回对象的,文档上没有说明。
  657. },
  658. downloadFile: {
  659. returnValue: {
  660. apFilePath: 'tempFilePath' } },
  661. getFileInfo: {
  662. args: {
  663. filePath: 'apFilePath' } },
  664. compressImage: {
  665. args: function args(fromArgs) {
  666. fromArgs.compressLevel = 4;
  667. if (fromArgs && fromArgs.quality) {
  668. fromArgs.compressLevel = Math.floor(fromArgs.quality / 26);
  669. }
  670. fromArgs.apFilePaths = [fromArgs.src];
  671. },
  672. returnValue: function returnValue(result) {
  673. if (result.apFilePaths && result.apFilePaths.length) {
  674. result.tempFilePath = result.apFilePaths[0];
  675. }
  676. } },
  677. chooseVideo: {
  678. // 支付宝小程序文档中未找到(仅在getSetting处提及),但实际可用
  679. returnValue: {
  680. apFilePath: 'tempFilePath' } },
  681. connectSocket: {
  682. args: {
  683. method: false,
  684. protocols: false }
  685. // TODO 有没有返回值还需要测试下
  686. },
  687. chooseImage: {
  688. returnValue: {
  689. apFilePaths: 'tempFilePaths' } },
  690. previewImage: {
  691. args: function args(fromArgs) {
  692. // 支付宝小程序的 current 是索引值,而非图片地址。
  693. var currentIndex = Number(fromArgs.current);
  694. if (isNaN(currentIndex)) {
  695. if (fromArgs.current && Array.isArray(fromArgs.urls)) {
  696. var index = fromArgs.urls.indexOf(fromArgs.current);
  697. fromArgs.current = ~index ? index : 0;
  698. }
  699. } else {
  700. fromArgs.current = currentIndex;
  701. }
  702. return {
  703. indicator: false,
  704. loop: false };
  705. } },
  706. saveFile: {
  707. args: {
  708. tempFilePath: 'apFilePath' },
  709. returnValue: {
  710. apFilePath: 'savedFilePath' } },
  711. getSavedFileInfo: {
  712. args: {
  713. filePath: 'apFilePath' } },
  714. getSavedFileList: {
  715. returnValue: function returnValue(result) {
  716. if (result.fileList && result.fileList.length) {
  717. result.fileList.forEach(function (file) {
  718. file.filePath = file.apFilePath;
  719. delete file.apFilePath;
  720. });
  721. }
  722. return {};
  723. } },
  724. removeSavedFile: {
  725. args: {
  726. filePath: 'apFilePath' } },
  727. getLocation: {
  728. args: {
  729. type: false,
  730. altitude: false } },
  731. openLocation: {
  732. args: {
  733. // TODO address 参数在阿里上是必传的
  734. } },
  735. getNetworkType: {
  736. returnValue: _handleNetworkInfo },
  737. onNetworkStatusChange: {
  738. returnValue: _handleNetworkInfo },
  739. stopAccelerometer: {
  740. name: 'offAccelerometerChange' },
  741. stopCompass: {
  742. name: 'offCompassChange' },
  743. scanCode: {
  744. name: 'scan',
  745. args: function args(fromArgs) {
  746. if (fromArgs.scanType) {
  747. switch (fromArgs.scanType[0]) {
  748. case 'qrCode':
  749. fromArgs.type = 'qr';
  750. break;
  751. case 'barCode':
  752. fromArgs.type = 'bar';
  753. break;}
  754. }
  755. return {
  756. onlyFromCamera: 'hideAlbum' };
  757. },
  758. returnValue: {
  759. code: 'result' } },
  760. setClipboardData: {
  761. name: 'setClipboard',
  762. args: {
  763. data: 'text' } },
  764. getClipboardData: {
  765. name: 'getClipboard',
  766. returnValue: {
  767. text: 'data' } },
  768. login: {
  769. name: 'getAuthCode',
  770. returnValue: function returnValue(result) {
  771. result.code = result.authCode;
  772. } },
  773. getUserInfo: {
  774. name: my.canIUse('getOpenUserInfo') ? 'getOpenUserInfo' : 'getAuthUserInfo',
  775. returnValue: function returnValue(result) {
  776. if (my.canIUse('getOpenUserInfo')) {
  777. var response = {};
  778. try {
  779. response = JSON.parse(result.response).response;
  780. } catch (e) {}
  781. result.nickName = response.nickName;
  782. result.avatar = response.avatar;
  783. }
  784. result.userInfo = {
  785. nickName: result.nickName,
  786. avatarUrl: result.avatar };
  787. } },
  788. requestPayment: {
  789. name: 'tradePay',
  790. args: {
  791. orderInfo: 'tradeNO' } },
  792. getBLEDeviceServices: {
  793. returnValue: function returnValue(result) {
  794. result.services.forEach(function (item) {
  795. item.uuid = item.serviceId;
  796. });
  797. } },
  798. createBLEConnection: {
  799. name: 'connectBLEDevice',
  800. args: {
  801. timeout: false } },
  802. closeBLEConnection: {
  803. name: 'disconnectBLEDevice' },
  804. onBLEConnectionStateChange: {
  805. name: 'onBLEConnectionStateChanged' },
  806. makePhoneCall: {
  807. args: {
  808. phoneNumber: 'number' } },
  809. stopGyroscope: {
  810. name: 'offGyroscopeChange' },
  811. getSystemInfo: getSystemInfo,
  812. getSystemInfoSync: getSystemInfo,
  813. // 文档没提到,但是实测可用。
  814. canvasToTempFilePath: {
  815. returnValue: function returnValue(result) {
  816. // 真机的情况下会有 tempFilePath 这个值,因此需要主动修改。
  817. result.tempFilePath = result.apFilePath;
  818. } },
  819. setScreenBrightness: {
  820. args: {
  821. value: 'brightness' } },
  822. getScreenBrightness: {
  823. returnValue: {
  824. brightness: 'value' } },
  825. showShareMenu: {
  826. name: 'showSharePanel' },
  827. hideHomeButton: {
  828. name: 'hideBackHome' },
  829. saveImageToPhotosAlbum: {
  830. name: 'saveImage',
  831. args: {
  832. filePath: 'url' } },
  833. saveVideoToPhotosAlbum: {
  834. args: {
  835. filePath: 'src' } },
  836. chooseAddress: {
  837. name: 'getAddress',
  838. returnValue: function returnValue(result) {
  839. var info = result.result || {};
  840. result.userName = info.fullname;
  841. result.provinceName = info.prov;
  842. result.cityName = info.city;
  843. result.countyName = info.area;
  844. result.detailInfo = info.address;
  845. result.telNumber = info.mobilePhone;
  846. result.errMsg = result.resultStatus;
  847. } } };
  848. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  849. function processCallback(methodName, method, returnValue) {
  850. return function (res) {
  851. return method(processReturnValue(methodName, res, returnValue));
  852. };
  853. }
  854. 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;
  855. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  856. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  857. if (isFn(argsOption)) {
  858. argsOption = argsOption(fromArgs, toArgs) || {};
  859. }
  860. for (var key in fromArgs) {
  861. if (hasOwn(argsOption, key)) {
  862. var keyOption = argsOption[key];
  863. if (isFn(keyOption)) {
  864. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  865. }
  866. if (!keyOption) {// 不支持的参数
  867. console.warn("The '".concat(methodName, "' method of platform '\u652F\u4ED8\u5B9D\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  868. } else if (isStr(keyOption)) {// 重写参数 key
  869. toArgs[keyOption] = fromArgs[key];
  870. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  871. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  872. }
  873. } else if (CALLBACKS.indexOf(key) !== -1) {
  874. if (isFn(fromArgs[key])) {
  875. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  876. }
  877. } else {
  878. if (!keepFromArgs) {
  879. toArgs[key] = fromArgs[key];
  880. }
  881. }
  882. }
  883. return toArgs;
  884. } else if (isFn(fromArgs)) {
  885. fromArgs = processCallback(methodName, fromArgs, returnValue);
  886. }
  887. return fromArgs;
  888. }
  889. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  890. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  891. res = protocols.returnValue(methodName, res);
  892. }
  893. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  894. }
  895. function wrapper(methodName, method) {
  896. if (hasOwn(protocols, methodName)) {
  897. var protocol = protocols[methodName];
  898. if (!protocol) {// 暂不支持的 api
  899. return function () {
  900. console.error("Platform '\u652F\u4ED8\u5B9D\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  901. };
  902. }
  903. return function (arg1, arg2) {// 目前 api 最多两个参数
  904. var options = protocol;
  905. if (isFn(protocol)) {
  906. options = protocol(arg1);
  907. }
  908. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  909. var args = [arg1];
  910. if (typeof arg2 !== 'undefined') {
  911. args.push(arg2);
  912. }
  913. if (isFn(options.name)) {
  914. methodName = options.name(arg1);
  915. } else if (isStr(options.name)) {
  916. methodName = options.name;
  917. }
  918. var returnValue = my[methodName].apply(my, args);
  919. if (isSyncApi(methodName)) {// 同步 api
  920. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  921. }
  922. return returnValue;
  923. };
  924. }
  925. return method;
  926. }
  927. var todoApis = Object.create(null);
  928. var TODOS = [
  929. 'onTabBarMidButtonTap',
  930. 'subscribePush',
  931. 'unsubscribePush',
  932. 'onPush',
  933. 'offPush',
  934. 'share'];
  935. function createTodoApi(name) {
  936. return function todoApi(_ref3)
  937. {var fail = _ref3.fail,complete = _ref3.complete;
  938. var res = {
  939. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  940. isFn(fail) && fail(res);
  941. isFn(complete) && complete(res);
  942. };
  943. }
  944. TODOS.forEach(function (name) {
  945. todoApis[name] = createTodoApi(name);
  946. });
  947. var providers = {
  948. oauth: ['alipay'],
  949. share: ['alipay'],
  950. payment: ['alipay'],
  951. push: ['alipay'] };
  952. function getProvider(_ref4)
  953. {var service = _ref4.service,success = _ref4.success,fail = _ref4.fail,complete = _ref4.complete;
  954. var res = false;
  955. if (providers[service]) {
  956. res = {
  957. errMsg: 'getProvider:ok',
  958. service: service,
  959. provider: providers[service] };
  960. isFn(success) && success(res);
  961. } else {
  962. res = {
  963. errMsg: 'getProvider:fail service not found' };
  964. isFn(fail) && fail(res);
  965. }
  966. isFn(complete) && complete(res);
  967. }
  968. var extraApi = /*#__PURE__*/Object.freeze({
  969. __proto__: null,
  970. getProvider: getProvider });
  971. var getEmitter = function () {
  972. var Emitter;
  973. return function getUniEmitter() {
  974. if (!Emitter) {
  975. Emitter = new _vue.default();
  976. }
  977. return Emitter;
  978. };
  979. }();
  980. function apply(ctx, method, args) {
  981. return ctx[method].apply(ctx, args);
  982. }
  983. function $on() {
  984. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  985. }
  986. function $off() {
  987. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  988. }
  989. function $once() {
  990. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  991. }
  992. function $emit() {
  993. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  994. }
  995. var eventApi = /*#__PURE__*/Object.freeze({
  996. __proto__: null,
  997. $on: $on,
  998. $off: $off,
  999. $once: $once,
  1000. $emit: $emit });
  1001. function createMediaQueryObserver() {
  1002. var mediaQueryObserver = {};var _my$getSystemInfoSync2 =
  1003. my.getSystemInfoSync(),windowWidth = _my$getSystemInfoSync2.windowWidth,windowHeight = _my$getSystemInfoSync2.windowHeight;
  1004. var orientation = windowWidth < windowHeight ? 'portrait' : 'landscape';
  1005. mediaQueryObserver.observe = function (options, callback) {
  1006. var matches = true;
  1007. for (var item in options) {
  1008. var itemValue = item === 'orientation' ? options[item] : Number(options[item]);
  1009. if (options[item] !== '') {
  1010. if (item === 'width') {
  1011. if (itemValue === windowWidth) {
  1012. matches = true;
  1013. } else {
  1014. matches = false;
  1015. callback(matches);
  1016. return matches;
  1017. }
  1018. }
  1019. if (item === 'minWidth') {
  1020. if (windowWidth >= itemValue) {
  1021. matches = true;
  1022. } else {
  1023. matches = false;
  1024. callback(matches);
  1025. return matches;
  1026. }
  1027. }
  1028. if (item === 'maxWidth') {
  1029. if (windowWidth <= itemValue) {
  1030. matches = true;
  1031. } else {
  1032. matches = false;
  1033. callback(matches);
  1034. return matches;
  1035. }
  1036. }
  1037. if (item === 'height') {
  1038. if (itemValue === windowHeight) {
  1039. matches = true;
  1040. } else {
  1041. matches = false;
  1042. callback(matches);
  1043. return matches;
  1044. }
  1045. }
  1046. if (item === 'minHeight') {
  1047. if (windowHeight >= itemValue) {
  1048. matches = true;
  1049. } else {
  1050. matches = false;
  1051. callback(matches);
  1052. return matches;
  1053. }
  1054. }
  1055. if (item === 'maxHeight') {
  1056. if (windowHeight <= itemValue) {
  1057. matches = true;
  1058. } else {
  1059. matches = false;
  1060. callback(matches);
  1061. return matches;
  1062. }
  1063. }
  1064. if (item === 'orientation') {
  1065. if (options[item] === orientation) {
  1066. matches = true;
  1067. } else {
  1068. matches = false;
  1069. callback(matches);
  1070. return matches;
  1071. }
  1072. }
  1073. }
  1074. }
  1075. callback(matches);
  1076. return matches;
  1077. };
  1078. mediaQueryObserver.disconnect = function () {
  1079. };
  1080. return mediaQueryObserver;
  1081. }
  1082. function startGyroscope(params) {
  1083. if (hasOwn(params, 'interval')) {
  1084. console.warn('支付宝小程序 startGyroscope暂不支持interval');
  1085. }
  1086. params.success && params.success({
  1087. errMsg: 'startGyroscope:ok' });
  1088. params.complete && params.complete({
  1089. errMsg: 'startGyroscope:ok' });
  1090. }
  1091. function createExecCallback(execCallback) {
  1092. return function wrapperExecCallback(res) {
  1093. this.actions.forEach(function (action, index) {
  1094. (action._$callbacks || []).forEach(function (callback) {
  1095. callback(res[index]);
  1096. });
  1097. });
  1098. if (isFn(execCallback)) {
  1099. execCallback(res);
  1100. }
  1101. };
  1102. }
  1103. function addCallback(callback) {
  1104. if (isFn(callback)) {
  1105. var action = this.actions[this.actions.length - 1];
  1106. if (action) {
  1107. (action._$callbacks || (action._$callbacks = [])).push(callback);
  1108. }
  1109. }
  1110. }
  1111. function createSelectorQuery() {
  1112. var query = my.createSelectorQuery();
  1113. var oldExec = query.exec;
  1114. var oldScrollOffset = query.scrollOffset;
  1115. var oldBoundingClientRect = query.boundingClientRect;
  1116. query.exec = function exec(callback) {
  1117. return oldExec.call(this, createExecCallback(callback).bind(this));
  1118. };
  1119. query.scrollOffset = function scrollOffset(callback) {
  1120. var ret = oldScrollOffset.call(this);
  1121. addCallback.call(this, callback);
  1122. return ret;
  1123. };
  1124. query.boundingClientRect = function boundingClientRect(callback) {
  1125. var ret = oldBoundingClientRect.call(this);
  1126. addCallback.call(this, callback);
  1127. return ret;
  1128. };
  1129. if (!query.fields) {
  1130. query.fields = function () {var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},rect = _ref5.rect,size = _ref5.size,scrollOffset = _ref5.scrollOffset;var callback = arguments.length > 1 ? arguments[1] : undefined;
  1131. if (rect || size) {
  1132. this.boundingClientRect();
  1133. }
  1134. if (scrollOffset) {
  1135. this.scrollOffset();
  1136. }
  1137. addCallback.call(this, callback);
  1138. return this;
  1139. };
  1140. }
  1141. if (!query.in) {
  1142. query.in = function () {
  1143. return this;
  1144. };
  1145. }
  1146. return query;
  1147. }
  1148. function createIntersectionObserver(component, options) {
  1149. if (options && options.observeAll) {
  1150. options.selectAll = options.observeAll;
  1151. delete options.observeAll;
  1152. }
  1153. return my.createIntersectionObserver(options);
  1154. }
  1155. var api = /*#__PURE__*/Object.freeze({
  1156. __proto__: null,
  1157. startGyroscope: startGyroscope,
  1158. createSelectorQuery: createSelectorQuery,
  1159. createIntersectionObserver: createIntersectionObserver,
  1160. createMediaQueryObserver: createMediaQueryObserver,
  1161. setStorageSync: setStorageSync,
  1162. getStorageSync: getStorageSync,
  1163. removeStorageSync: removeStorageSync });
  1164. var PAGE_EVENT_HOOKS = [
  1165. 'onPullDownRefresh',
  1166. 'onReachBottom',
  1167. 'onAddToFavorites',
  1168. 'onShareTimeline',
  1169. 'onShareAppMessage',
  1170. 'onPageScroll',
  1171. 'onResize',
  1172. 'onTabItemTap'];
  1173. function initMocks(vm, mocks) {
  1174. var mpInstance = vm.$mp[vm.mpType];
  1175. mocks.forEach(function (mock) {
  1176. if (hasOwn(mpInstance, mock)) {
  1177. vm[mock] = mpInstance[mock];
  1178. }
  1179. });
  1180. }
  1181. function hasHook(hook, vueOptions) {
  1182. if (!vueOptions) {
  1183. return true;
  1184. }
  1185. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  1186. return true;
  1187. }
  1188. vueOptions = vueOptions.default || vueOptions;
  1189. if (isFn(vueOptions)) {
  1190. if (isFn(vueOptions.extendOptions[hook])) {
  1191. return true;
  1192. }
  1193. if (vueOptions.super &&
  1194. vueOptions.super.options &&
  1195. Array.isArray(vueOptions.super.options[hook])) {
  1196. return true;
  1197. }
  1198. return false;
  1199. }
  1200. if (isFn(vueOptions[hook])) {
  1201. return true;
  1202. }
  1203. var mixins = vueOptions.mixins;
  1204. if (Array.isArray(mixins)) {
  1205. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  1206. }
  1207. }
  1208. function initHooks(mpOptions, hooks, vueOptions) {
  1209. hooks.forEach(function (hook) {
  1210. if (hasHook(hook, vueOptions)) {
  1211. mpOptions[hook] = function (args) {
  1212. return this.$vm && this.$vm.__call_hook(hook, args);
  1213. };
  1214. }
  1215. });
  1216. }
  1217. function initVueComponent(Vue, vueOptions) {
  1218. vueOptions = vueOptions.default || vueOptions;
  1219. var VueComponent;
  1220. if (isFn(vueOptions)) {
  1221. VueComponent = vueOptions;
  1222. } else {
  1223. VueComponent = Vue.extend(vueOptions);
  1224. }
  1225. vueOptions = VueComponent.options;
  1226. return [VueComponent, vueOptions];
  1227. }
  1228. function initVueIds(vueIds, mpInstance) {
  1229. vueIds = (vueIds || '').split(',');
  1230. var len = vueIds.length;
  1231. if (len === 1) {
  1232. mpInstance._$vueId = vueIds[0];
  1233. } else if (len === 2) {
  1234. mpInstance._$vueId = vueIds[0];
  1235. mpInstance._$vuePid = vueIds[1];
  1236. }
  1237. }
  1238. function initData(vueOptions, context) {
  1239. var data = vueOptions.data || {};
  1240. var methods = vueOptions.methods || {};
  1241. if (typeof data === 'function') {
  1242. try {
  1243. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  1244. } catch (e) {
  1245. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"小程序","VUE_APP_PLATFORM":"mp-alipay","BASE_URL":"/"}).VUE_APP_DEBUG) {
  1246. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  1247. }
  1248. }
  1249. } else {
  1250. try {
  1251. // 对 data 格式化
  1252. data = JSON.parse(JSON.stringify(data));
  1253. } catch (e) {}
  1254. }
  1255. if (!isPlainObject(data)) {
  1256. data = {};
  1257. }
  1258. Object.keys(methods).forEach(function (methodName) {
  1259. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  1260. data[methodName] = methods[methodName];
  1261. }
  1262. });
  1263. return data;
  1264. }
  1265. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  1266. function createObserver(name) {
  1267. return function observer(newVal, oldVal) {
  1268. if (this.$vm) {
  1269. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  1270. }
  1271. };
  1272. }
  1273. function initBehaviors(vueOptions, initBehavior) {
  1274. var vueBehaviors = vueOptions.behaviors;
  1275. var vueExtends = vueOptions.extends;
  1276. var vueMixins = vueOptions.mixins;
  1277. var vueProps = vueOptions.props;
  1278. if (!vueProps) {
  1279. vueOptions.props = vueProps = [];
  1280. }
  1281. var behaviors = [];
  1282. if (Array.isArray(vueBehaviors)) {
  1283. vueBehaviors.forEach(function (behavior) {
  1284. behaviors.push(behavior.replace('uni://', "my".concat("://")));
  1285. if (behavior === 'uni://form-field') {
  1286. if (Array.isArray(vueProps)) {
  1287. vueProps.push('name');
  1288. vueProps.push('value');
  1289. } else {
  1290. vueProps.name = {
  1291. type: String,
  1292. default: '' };
  1293. vueProps.value = {
  1294. type: [String, Number, Boolean, Array, Object, Date],
  1295. default: '' };
  1296. }
  1297. }
  1298. });
  1299. }
  1300. {// alipay 重复定义props会报错,下边的代码对于其他平台也没有意义,保险起见,仅对alipay做处理
  1301. return;
  1302. }
  1303. }
  1304. function parsePropType(key, type, defaultValue, file) {
  1305. // [String]=>String
  1306. if (Array.isArray(type) && type.length === 1) {
  1307. return type[0];
  1308. }
  1309. return type;
  1310. }
  1311. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  1312. var properties = {};
  1313. if (!isBehavior) {
  1314. properties.vueId = {
  1315. type: String,
  1316. value: '' };
  1317. // 用于字节跳动小程序模拟抽象节点
  1318. properties.generic = {
  1319. type: Object,
  1320. value: null };
  1321. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  1322. type: null,
  1323. value: [],
  1324. observer: function observer(newVal, oldVal) {
  1325. var $slots = Object.create(null);
  1326. newVal.forEach(function (slotName) {
  1327. $slots[slotName] = true;
  1328. });
  1329. this.setData({
  1330. $slots: $slots });
  1331. } };
  1332. }
  1333. if (Array.isArray(props)) {// ['title']
  1334. props.forEach(function (key) {
  1335. properties[key] = {
  1336. type: null,
  1337. observer: createObserver(key) };
  1338. });
  1339. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  1340. Object.keys(props).forEach(function (key) {
  1341. var opts = props[key];
  1342. if (isPlainObject(opts)) {// title:{type:String,default:''}
  1343. var value = opts.default;
  1344. if (isFn(value)) {
  1345. value = value();
  1346. }
  1347. opts.type = parsePropType(key, opts.type);
  1348. properties[key] = {
  1349. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  1350. value: value,
  1351. observer: createObserver(key) };
  1352. } else {// content:String
  1353. var type = parsePropType(key, opts);
  1354. properties[key] = {
  1355. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  1356. observer: createObserver(key) };
  1357. }
  1358. });
  1359. }
  1360. return properties;
  1361. }
  1362. function wrapper$1(event) {
  1363. // TODO 又得兼容 mpvue 的 mp 对象
  1364. try {
  1365. event.mp = JSON.parse(JSON.stringify(event));
  1366. } catch (e) {}
  1367. event.stopPropagation = noop;
  1368. event.preventDefault = noop;
  1369. event.target = event.target || {};
  1370. if (!hasOwn(event, 'detail')) {
  1371. event.detail = {};
  1372. }
  1373. if (hasOwn(event, 'markerId')) {
  1374. event.detail = typeof event.detail === 'object' ? event.detail : {};
  1375. event.detail.markerId = event.markerId;
  1376. }
  1377. if (isPlainObject(event.detail)) {
  1378. event.target = Object.assign({}, event.target, event.detail);
  1379. }
  1380. return event;
  1381. }
  1382. function getExtraValue(vm, dataPathsArray) {
  1383. var context = vm;
  1384. dataPathsArray.forEach(function (dataPathArray) {
  1385. var dataPath = dataPathArray[0];
  1386. var value = dataPathArray[2];
  1387. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  1388. var propPath = dataPathArray[1];
  1389. var valuePath = dataPathArray[3];
  1390. var vFor;
  1391. if (Number.isInteger(dataPath)) {
  1392. vFor = dataPath;
  1393. } else if (!dataPath) {
  1394. vFor = context;
  1395. } else if (typeof dataPath === 'string' && dataPath) {
  1396. if (dataPath.indexOf('#s#') === 0) {
  1397. vFor = dataPath.substr(3);
  1398. } else {
  1399. vFor = vm.__get_value(dataPath, context);
  1400. }
  1401. }
  1402. if (Number.isInteger(vFor)) {
  1403. context = value;
  1404. } else if (!propPath) {
  1405. context = vFor[value];
  1406. } else {
  1407. if (Array.isArray(vFor)) {
  1408. context = vFor.find(function (vForItem) {
  1409. return vm.__get_value(propPath, vForItem) === value;
  1410. });
  1411. } else if (isPlainObject(vFor)) {
  1412. context = Object.keys(vFor).find(function (vForKey) {
  1413. return vm.__get_value(propPath, vFor[vForKey]) === value;
  1414. });
  1415. } else {
  1416. console.error('v-for 暂不支持循环数据:', vFor);
  1417. }
  1418. }
  1419. if (valuePath) {
  1420. context = vm.__get_value(valuePath, context);
  1421. }
  1422. }
  1423. });
  1424. return context;
  1425. }
  1426. function processEventExtra(vm, extra, event) {
  1427. var extraObj = {};
  1428. if (Array.isArray(extra) && extra.length) {
  1429. /**
  1430. *[
  1431. * ['data.items', 'data.id', item.data.id],
  1432. * ['metas', 'id', meta.id]
  1433. *],
  1434. *[
  1435. * ['data.items', 'data.id', item.data.id],
  1436. * ['metas', 'id', meta.id]
  1437. *],
  1438. *'test'
  1439. */
  1440. extra.forEach(function (dataPath, index) {
  1441. if (typeof dataPath === 'string') {
  1442. if (!dataPath) {// model,prop.sync
  1443. extraObj['$' + index] = vm;
  1444. } else {
  1445. if (dataPath === '$event') {// $event
  1446. extraObj['$' + index] = event;
  1447. } else if (dataPath === 'arguments') {
  1448. if (event.detail && event.detail.__args__) {
  1449. extraObj['$' + index] = event.detail.__args__;
  1450. } else {
  1451. extraObj['$' + index] = [event];
  1452. }
  1453. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1454. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1455. } else {
  1456. extraObj['$' + index] = vm.__get_value(dataPath);
  1457. }
  1458. }
  1459. } else {
  1460. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1461. }
  1462. });
  1463. }
  1464. return extraObj;
  1465. }
  1466. function getObjByArray(arr) {
  1467. var obj = {};
  1468. for (var i = 1; i < arr.length; i++) {
  1469. var element = arr[i];
  1470. obj[element[0]] = element[1];
  1471. }
  1472. return obj;
  1473. }
  1474. 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;
  1475. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1476. if (isCustom) {// 自定义事件
  1477. isCustomMPEvent = event.currentTarget &&
  1478. event.currentTarget.dataset &&
  1479. event.currentTarget.dataset.comType === 'wx';
  1480. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1481. if (isCustomMPEvent) {
  1482. return [event];
  1483. }
  1484. return event.detail.__args__ || event.detail;
  1485. }
  1486. }
  1487. var extraObj = processEventExtra(vm, extra, event);
  1488. var ret = [];
  1489. args.forEach(function (arg) {
  1490. if (arg === '$event') {
  1491. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1492. ret.push(event.target.value);
  1493. } else {
  1494. if (isCustom && !isCustomMPEvent) {
  1495. ret.push(event.detail.__args__[0]);
  1496. } else {// wxcomponent 组件或内置组件
  1497. ret.push(event);
  1498. }
  1499. }
  1500. } else {
  1501. if (Array.isArray(arg) && arg[0] === 'o') {
  1502. ret.push(getObjByArray(arg));
  1503. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1504. ret.push(extraObj[arg]);
  1505. } else {
  1506. ret.push(arg);
  1507. }
  1508. }
  1509. });
  1510. return ret;
  1511. }
  1512. var ONCE = '~';
  1513. var CUSTOM = '^';
  1514. function isMatchEventType(eventType, optType) {
  1515. return eventType === optType ||
  1516. optType === 'regionchange' && (
  1517. eventType === 'begin' ||
  1518. eventType === 'end');
  1519. }
  1520. function getContextVm(vm) {
  1521. var $parent = vm.$parent;
  1522. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1523. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1524. $parent = $parent.$parent;
  1525. }
  1526. return $parent && $parent.$parent;
  1527. }
  1528. function handleEvent(event) {var _this2 = this;
  1529. event = wrapper$1(event);
  1530. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1531. var dataset = (event.currentTarget || event.target).dataset;
  1532. if (!dataset) {
  1533. return console.warn('事件信息不存在');
  1534. }
  1535. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1536. if (!eventOpts) {
  1537. return console.warn('事件信息不存在');
  1538. }
  1539. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1540. var eventType = event.type;
  1541. var ret = [];
  1542. eventOpts.forEach(function (eventOpt) {
  1543. var type = eventOpt[0];
  1544. var eventsArray = eventOpt[1];
  1545. var isCustom = type.charAt(0) === CUSTOM;
  1546. type = isCustom ? type.slice(1) : type;
  1547. var isOnce = type.charAt(0) === ONCE;
  1548. type = isOnce ? type.slice(1) : type;
  1549. if (eventsArray && isMatchEventType(eventType, type)) {
  1550. eventsArray.forEach(function (eventArray) {
  1551. var methodName = eventArray[0];
  1552. if (methodName) {
  1553. var handlerCtx = _this2.$vm;
  1554. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1555. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1556. }
  1557. if (methodName === '$emit') {
  1558. handlerCtx.$emit.apply(handlerCtx,
  1559. processEventArgs(
  1560. _this2.$vm,
  1561. event,
  1562. eventArray[1],
  1563. eventArray[2],
  1564. isCustom,
  1565. methodName));
  1566. return;
  1567. }
  1568. var handler = handlerCtx[methodName];
  1569. if (!isFn(handler)) {
  1570. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1571. }
  1572. if (isOnce) {
  1573. if (handler.once) {
  1574. return;
  1575. }
  1576. handler.once = true;
  1577. }
  1578. var params = processEventArgs(
  1579. _this2.$vm,
  1580. event,
  1581. eventArray[1],
  1582. eventArray[2],
  1583. isCustom,
  1584. methodName);
  1585. params = Array.isArray(params) ? params : [];
  1586. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1587. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1588. // eslint-disable-next-line no-sparse-arrays
  1589. params = params.concat([,,,,,,,,,, event]);
  1590. }
  1591. ret.push(handler.apply(handlerCtx, params));
  1592. }
  1593. });
  1594. }
  1595. });
  1596. if (
  1597. eventType === 'input' &&
  1598. ret.length === 1 &&
  1599. typeof ret[0] !== 'undefined')
  1600. {
  1601. return ret[0];
  1602. }
  1603. }
  1604. var hooks = [
  1605. 'onShow',
  1606. 'onHide',
  1607. 'onError',
  1608. 'onPageNotFound',
  1609. 'onThemeChange',
  1610. 'onUnhandledRejection'];
  1611. function initEventChannel$1() {
  1612. _vue.default.prototype.getOpenerEventChannel = function () {
  1613. if (!this.__eventChannel__) {
  1614. this.__eventChannel__ = new EventChannel();
  1615. }
  1616. return this.__eventChannel__;
  1617. };
  1618. var callHook = _vue.default.prototype.__call_hook;
  1619. _vue.default.prototype.__call_hook = function (hook, args) {
  1620. if (hook === 'onLoad' && args && args.__id__) {
  1621. this.__eventChannel__ = getEventChannel(args.__id__);
  1622. delete args.__id__;
  1623. }
  1624. return callHook.call(this, hook, args);
  1625. };
  1626. }
  1627. function initScopedSlotsParams() {
  1628. var center = {};
  1629. var parents = {};
  1630. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1631. var has = center[vueId];
  1632. if (!has) {
  1633. parents[vueId] = this;
  1634. this.$on('hook:destory', function () {
  1635. delete parents[vueId];
  1636. });
  1637. }
  1638. return has;
  1639. };
  1640. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1641. var data = center[vueId];
  1642. if (data) {
  1643. var object = data[name] || {};
  1644. return key ? object[key] : object;
  1645. } else {
  1646. parents[vueId] = this;
  1647. this.$on('hook:destory', function () {
  1648. delete parents[vueId];
  1649. });
  1650. }
  1651. };
  1652. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1653. var vueId = this.$options.propsData.vueId;
  1654. var object = center[vueId] = center[vueId] || {};
  1655. object[name] = value;
  1656. if (parents[vueId]) {
  1657. parents[vueId].$forceUpdate();
  1658. }
  1659. };
  1660. _vue.default.mixin({
  1661. destroyed: function destroyed() {
  1662. var propsData = this.$options.propsData;
  1663. var vueId = propsData && propsData.vueId;
  1664. if (vueId) {
  1665. delete center[vueId];
  1666. delete parents[vueId];
  1667. }
  1668. } });
  1669. }
  1670. function parseBaseApp(vm, _ref6)
  1671. {var mocks = _ref6.mocks,initRefs = _ref6.initRefs;
  1672. initEventChannel$1();
  1673. {
  1674. initScopedSlotsParams();
  1675. }
  1676. if (vm.$options.store) {
  1677. _vue.default.prototype.$store = vm.$options.store;
  1678. }
  1679. _vue.default.prototype.mpHost = "mp-alipay";
  1680. _vue.default.mixin({
  1681. beforeCreate: function beforeCreate() {
  1682. if (!this.$options.mpType) {
  1683. return;
  1684. }
  1685. this.mpType = this.$options.mpType;
  1686. this.$mp = _defineProperty({
  1687. data: {} },
  1688. this.mpType, this.$options.mpInstance);
  1689. this.$scope = this.$options.mpInstance;
  1690. delete this.$options.mpType;
  1691. delete this.$options.mpInstance;
  1692. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1693. var app = getApp();
  1694. if (app.$vm && app.$vm.$i18n) {
  1695. this._i18n = app.$vm.$i18n;
  1696. }
  1697. }
  1698. if (this.mpType !== 'app') {
  1699. initRefs(this);
  1700. initMocks(this, mocks);
  1701. }
  1702. } });
  1703. var appOptions = {
  1704. onLaunch: function onLaunch(args) {
  1705. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1706. return;
  1707. }
  1708. this.$vm = vm;
  1709. this.$vm.$mp = {
  1710. app: this };
  1711. this.$vm.$scope = this;
  1712. // vm 上也挂载 globalData
  1713. this.$vm.globalData = this.globalData;
  1714. this.$vm._isMounted = true;
  1715. this.$vm.__call_hook('mounted', args);
  1716. this.$vm.__call_hook('onLaunch', args);
  1717. } };
  1718. // 兼容旧版本 globalData
  1719. appOptions.globalData = vm.$options.globalData || {};
  1720. // 将 methods 中的方法挂在 getApp() 中
  1721. var methods = vm.$options.methods;
  1722. if (methods) {
  1723. Object.keys(methods).forEach(function (name) {
  1724. appOptions[name] = methods[name];
  1725. });
  1726. }
  1727. initHooks(appOptions, hooks);
  1728. return appOptions;
  1729. }
  1730. function findVmByVueId(vm, vuePid) {
  1731. var $children = vm.$children;
  1732. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1733. for (var i = $children.length - 1; i >= 0; i--) {
  1734. var childVm = $children[i];
  1735. if (childVm.$scope._$vueId === vuePid) {
  1736. return childVm;
  1737. }
  1738. }
  1739. // 反向递归查找
  1740. var parentVm;
  1741. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1742. parentVm = findVmByVueId($children[_i], vuePid);
  1743. if (parentVm) {
  1744. return parentVm;
  1745. }
  1746. }
  1747. }
  1748. function handleLink(event) {var _ref7 =
  1749. event.detail || event.value,vuePid = _ref7.vuePid,vueOptions = _ref7.vueOptions; // detail 是微信,value 是百度(dipatch)
  1750. var parentVm;
  1751. if (vuePid) {
  1752. parentVm = findVmByVueId(this.$vm, vuePid);
  1753. }
  1754. if (!parentVm) {
  1755. parentVm = this.$vm;
  1756. }
  1757. vueOptions.parent = parentVm;
  1758. }
  1759. var isArray = Array.isArray;
  1760. var keyList = Object.keys;
  1761. function equal(a, b) {
  1762. if (a === b) return true;
  1763. if (a && b && typeof a === 'object' && typeof b === 'object') {
  1764. var arrA = isArray(a);
  1765. var arrB = isArray(b);
  1766. var i, length, key;
  1767. if (arrA && arrB) {
  1768. length = a.length;
  1769. if (length !== b.length) return false;
  1770. for (i = length; i-- !== 0;) {
  1771. if (!equal(a[i], b[i])) return false;
  1772. }
  1773. return true;
  1774. }
  1775. if (arrA !== arrB) return false;
  1776. var dateA = a instanceof Date;
  1777. var dateB = b instanceof Date;
  1778. if (dateA !== dateB) return false;
  1779. if (dateA && dateB) return a.getTime() === b.getTime();
  1780. var regexpA = a instanceof RegExp;
  1781. var regexpB = b instanceof RegExp;
  1782. if (regexpA !== regexpB) return false;
  1783. if (regexpA && regexpB) return a.toString() === b.toString();
  1784. var keys = keyList(a);
  1785. length = keys.length;
  1786. if (length !== keyList(b).length) {
  1787. return false;
  1788. }
  1789. for (i = length; i-- !== 0;) {
  1790. if (!hasOwn.call(b, keys[i])) return false;
  1791. }
  1792. for (i = length; i-- !== 0;) {
  1793. key = keys[i];
  1794. if (!equal(a[key], b[key])) return false;
  1795. }
  1796. return true;
  1797. }
  1798. return false;
  1799. }
  1800. var customizeRE = /:/g;
  1801. var customize = cached(function (str) {
  1802. return camelize(str.replace(customizeRE, '-'));
  1803. });
  1804. var isComponent2 = my.canIUse('component2');
  1805. var mocks = ['$id'];
  1806. function initRefs() {
  1807. }
  1808. function initRelation(detail) {
  1809. this.props.onVueInit(detail);
  1810. }
  1811. function initSpecialMethods(mpInstance) {
  1812. if (!mpInstance.$vm) {
  1813. return;
  1814. }
  1815. var path = mpInstance.is || mpInstance.route;
  1816. if (!path) {
  1817. return;
  1818. }
  1819. if (path.indexOf('/') === 0) {
  1820. path = path.substr(1);
  1821. }
  1822. var specialMethods = my.specialMethods && my.specialMethods[path];
  1823. if (specialMethods) {
  1824. specialMethods.forEach(function (method) {
  1825. if (isFn(mpInstance.$vm[method])) {
  1826. mpInstance[method] = function (event) {
  1827. if (hasOwn(event, 'markerId')) {
  1828. event.detail = typeof event.detail === 'object' ? event.detail : {};
  1829. event.detail.markerId = event.markerId;
  1830. }
  1831. // TODO normalizeEvent
  1832. mpInstance.$vm[method](event);
  1833. };
  1834. }
  1835. });
  1836. }
  1837. }
  1838. function initChildVues(mpInstance) {
  1839. // 此时需保证当前 mpInstance 已经存在 $vm
  1840. if (!mpInstance.$vm) {
  1841. return;
  1842. }
  1843. mpInstance._$childVues && mpInstance._$childVues.forEach(function (_ref8)
  1844. {var vuePid = _ref8.vuePid,vueOptions = _ref8.vueOptions,VueComponent = _ref8.VueComponent,childMPInstance = _ref8.mpInstance;
  1845. // 父子关系
  1846. handleLink.call(mpInstance, {
  1847. detail: {
  1848. vuePid: vuePid,
  1849. vueOptions: vueOptions } });
  1850. childMPInstance.$vm = new VueComponent(vueOptions);
  1851. initSpecialMethods(childMPInstance);
  1852. handleRef.call(vueOptions.parent.$scope, childMPInstance);
  1853. childMPInstance.$vm.$mount();
  1854. initChildVues(childMPInstance);
  1855. childMPInstance.$vm._isMounted = true;
  1856. childMPInstance.$vm.__call_hook('mounted');
  1857. childMPInstance.$vm.__call_hook('onReady');
  1858. });
  1859. delete mpInstance._$childVues;
  1860. }
  1861. function handleRef(ref) {
  1862. if (!ref) {
  1863. return;
  1864. }
  1865. if (ref.props['data-com-type'] === 'wx') {
  1866. var eventProps = {};
  1867. var refProps = ref.props;
  1868. // 初始化支付宝小程序组件事件
  1869. Object.keys(refProps).forEach(function (key) {
  1870. var handler = refProps[key];
  1871. var res = key.match(/^on([A-Z])(\S*)/);
  1872. if (res && typeof handler === 'function' && handler.name === 'bound handleEvent') {
  1873. var event = res && res[1].toLowerCase() + res[2];
  1874. refProps[key] = eventProps[key] = function () {
  1875. var props = Object.assign({}, refProps);
  1876. props[key] = handler;
  1877. // 由于支付宝事件可能包含多个参数,不使用微信小程序事件格式
  1878. delete props['data-com-type'];
  1879. triggerEvent.bind({ props: props })(event, {
  1880. __args__: Array.prototype.slice.call(arguments) });
  1881. };
  1882. }
  1883. });
  1884. // 处理 props 重写
  1885. Object.defineProperty(ref, 'props', {
  1886. get: function get() {
  1887. return refProps;
  1888. },
  1889. set: function set(value) {
  1890. refProps = Object.assign(value, eventProps);
  1891. } });
  1892. }
  1893. var refName = ref.props['data-ref'];
  1894. var refInForName = ref.props['data-ref-in-for'];
  1895. if (refName) {
  1896. this.$vm.$refs[refName] = ref.$vm || ref;
  1897. } else if (refInForName) {
  1898. (this.$vm.$refs[refInForName] || (this.$vm.$refs[refInForName] = [])).push(ref.$vm || ref);
  1899. }
  1900. }
  1901. function triggerEvent(type, detail, options) {
  1902. var handler = this.props && this.props[customize('on-' + type)];
  1903. if (!handler) {
  1904. return;
  1905. }
  1906. var eventOpts = this.props['data-event-opts'];
  1907. var eventParams = this.props['data-event-params'];
  1908. var comType = this.props['data-com-type'];
  1909. var target = {
  1910. dataset: {
  1911. eventOpts: eventOpts,
  1912. eventParams: eventParams,
  1913. comType: comType } };
  1914. handler({
  1915. type: customize(type),
  1916. target: target,
  1917. currentTarget: target,
  1918. detail: detail });
  1919. }
  1920. var IGNORES = ['$slots', '$scopedSlots'];
  1921. function createObserver$1(isDidUpdate) {
  1922. return function observe(props) {var _this3 = this;
  1923. var prevProps = isDidUpdate ? props : this.props;
  1924. var nextProps = isDidUpdate ? this.props : props;
  1925. if (equal(prevProps, nextProps)) {
  1926. return;
  1927. }
  1928. Object.keys(prevProps).forEach(function (name) {
  1929. if (IGNORES.indexOf(name) === -1) {
  1930. var prevValue = prevProps[name];
  1931. var nextValue = nextProps[name];
  1932. if (!isFn(prevValue) && !isFn(nextValue) && !equal(prevValue, nextValue)) {
  1933. _this3.$vm[name] = nextProps[name];
  1934. }
  1935. }
  1936. });
  1937. };
  1938. }
  1939. var handleLink$1 = function () {
  1940. if (isComponent2) {
  1941. return function handleLink$1(detail) {
  1942. return handleLink.call(this, {
  1943. detail: detail });
  1944. };
  1945. }
  1946. return function handleLink$1(detail) {
  1947. if (this.$vm && this.$vm._isMounted) {// 父已初始化
  1948. return handleLink.call(this, {
  1949. detail: {
  1950. vuePid: detail.vuePid,
  1951. vueOptions: detail.vueOptions } });
  1952. }
  1953. // 支付宝通过 didMount 来实现,先子后父,故等父 ready 之后,统一初始化
  1954. (this._$childVues || (this._$childVues = [])).unshift(detail);
  1955. };
  1956. }();
  1957. function parseApp(vm) {
  1958. Object.defineProperty(_vue.default.prototype, '$slots', {
  1959. get: function get() {
  1960. return this.$scope && this.$scope.props.$slots;
  1961. },
  1962. set: function set() {
  1963. } });
  1964. Object.defineProperty(_vue.default.prototype, '$scopedSlots', {
  1965. get: function get() {
  1966. return this.$scope && this.$scope.props.$scopedSlots;
  1967. },
  1968. set: function set() {
  1969. } });
  1970. _vue.default.prototype.$onAliGetAuthorize = function onAliGetAuthorize(method, $event) {var _this4 = this;
  1971. my.getPhoneNumber({
  1972. success: function success(res) {
  1973. $event.type = 'getphonenumber';
  1974. var response = JSON.parse(res.response).response;
  1975. if (response.code === '10000') {// success
  1976. $event.detail.errMsg = 'getPhoneNumber:ok';
  1977. $event.detail.encryptedData = res.response;
  1978. } else {
  1979. $event.detail.errMsg = 'getPhoneNumber:fail Error: ' + res.response;
  1980. }
  1981. _this4[method]($event);
  1982. },
  1983. fail: function fail(res) {
  1984. $event.type = 'getphonenumber';
  1985. $event.detail.errMsg = 'getPhoneNumber:fail';
  1986. _this4[method]($event);
  1987. } });
  1988. };
  1989. _vue.default.prototype.$onAliAuthError = function $onAliAuthError(method, $event) {
  1990. $event.type = 'getphonenumber';
  1991. $event.detail.errMsg = 'getPhoneNumber:fail Error: ' + $event.detail.errorMessage;
  1992. this[method]($event);
  1993. };
  1994. return parseBaseApp(vm, {
  1995. mocks: mocks,
  1996. initRefs: initRefs });
  1997. }
  1998. function createApp(vm) {
  1999. App(parseApp(vm));
  2000. return vm;
  2001. }
  2002. var encodeReserveRE = /[!'()*]/g;
  2003. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  2004. var commaRE = /%2C/g;
  2005. // fixed encodeURIComponent which is more conformant to RFC3986:
  2006. // - escapes [!'()*]
  2007. // - preserve commas
  2008. var encode = function encode(str) {return encodeURIComponent(str).
  2009. replace(encodeReserveRE, encodeReserveReplacer).
  2010. replace(commaRE, ',');};
  2011. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  2012. var res = obj ? Object.keys(obj).map(function (key) {
  2013. var val = obj[key];
  2014. if (val === undefined) {
  2015. return '';
  2016. }
  2017. if (val === null) {
  2018. return encodeStr(key);
  2019. }
  2020. if (Array.isArray(val)) {
  2021. var result = [];
  2022. val.forEach(function (val2) {
  2023. if (val2 === undefined) {
  2024. return;
  2025. }
  2026. if (val2 === null) {
  2027. result.push(encodeStr(key));
  2028. } else {
  2029. result.push(encodeStr(key) + '=' + encodeStr(val2));
  2030. }
  2031. });
  2032. return result.join('&');
  2033. }
  2034. return encodeStr(key) + '=' + encodeStr(val);
  2035. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  2036. return res ? "?".concat(res) : '';
  2037. }
  2038. var hooks$1 = [
  2039. 'onShow',
  2040. 'onHide',
  2041. // mp-alipay 特有
  2042. 'onTitleClick',
  2043. 'onOptionMenuClick',
  2044. 'onPopMenuClick',
  2045. 'onPullIntercept'];
  2046. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  2047. function parsePage(vuePageOptions) {var _initVueComponent =
  2048. initVueComponent(_vue.default, vuePageOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  2049. var pageOptions = {
  2050. mixins: initBehaviors(vueOptions),
  2051. data: initData(vueOptions, _vue.default.prototype),
  2052. onLoad: function onLoad(query) {
  2053. var properties = this.props;
  2054. var options = {
  2055. mpType: 'page',
  2056. mpInstance: this,
  2057. propsData: properties };
  2058. // 初始化 vue 实例
  2059. this.$vm = new VueComponent(options);
  2060. initSpecialMethods(this);
  2061. // 触发首次 setData
  2062. this.$vm.$mount();
  2063. var copyQuery = Object.assign({}, query);
  2064. delete copyQuery.__id__;
  2065. this.$page = {
  2066. fullPath: '/' + this.route + stringifyQuery(copyQuery) };
  2067. this.options = query;
  2068. this.$vm.$mp.query = query; // 兼容 mpvue
  2069. this.$vm.__call_hook('onLoad', query);
  2070. },
  2071. onReady: function onReady() {
  2072. initChildVues(this);
  2073. this.$vm._isMounted = true;
  2074. this.$vm.__call_hook('mounted');
  2075. this.$vm.__call_hook('onReady');
  2076. },
  2077. onUnload: function onUnload() {
  2078. this.$vm.__call_hook('onUnload');
  2079. this.$vm.$destroy();
  2080. },
  2081. events: {
  2082. // 支付宝小程序有些页面事件只能放在events下
  2083. onBack: function onBack() {
  2084. this.$vm.__call_hook('onBackPress');
  2085. } },
  2086. __r: handleRef,
  2087. __e: handleEvent,
  2088. __l: handleLink$1,
  2089. triggerEvent: triggerEvent };
  2090. initHooks(pageOptions, hooks$1, vuePageOptions);
  2091. if (Array.isArray(vueOptions.wxsCallMethods)) {
  2092. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  2093. pageOptions[callMethod] = function (args) {
  2094. return this.$vm[callMethod](args);
  2095. };
  2096. });
  2097. }
  2098. return pageOptions;
  2099. }
  2100. function createPage(vuePageOptions) {
  2101. {
  2102. return Page(parsePage(vuePageOptions));
  2103. }
  2104. }
  2105. function initVm(VueComponent) {
  2106. if (this.$vm) {
  2107. return;
  2108. }
  2109. var properties = this.props;
  2110. var options = {
  2111. mpType: 'component',
  2112. mpInstance: this,
  2113. propsData: properties };
  2114. initVueIds(properties.vueId, this);
  2115. if (isComponent2) {
  2116. // 处理父子关系
  2117. initRelation.call(this, {
  2118. vuePid: this._$vuePid,
  2119. vueOptions: options });
  2120. // 初始化 vue 实例
  2121. this.$vm = new VueComponent(options);
  2122. // 触发首次 setData
  2123. this.$vm.$mount();
  2124. } else {
  2125. // 处理父子关系
  2126. initRelation.call(this, {
  2127. vuePid: this._$vuePid,
  2128. vueOptions: options,
  2129. VueComponent: VueComponent,
  2130. mpInstance: this });
  2131. if (options.parent) {// 父组件已经初始化,直接初始化子,否则放到父组件的 didMount 中处理
  2132. // 初始化 vue 实例
  2133. this.$vm = new VueComponent(options);
  2134. handleRef.call(options.parent.$scope, this);
  2135. // 触发首次 setData
  2136. this.$vm.$mount();
  2137. initChildVues(this);
  2138. this.$vm._isMounted = true;
  2139. this.$vm.__call_hook('mounted');
  2140. this.$vm.__call_hook('onReady');
  2141. }
  2142. }
  2143. }
  2144. function parseComponent(vueComponentOptions) {var _initVueComponent3 =
  2145. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent4 = _slicedToArray(_initVueComponent3, 2),VueComponent = _initVueComponent4[0],vueOptions = _initVueComponent4[1];
  2146. var properties = initProperties(vueOptions.props, false, vueOptions.__file);
  2147. var props = {
  2148. onVueInit: function onVueInit() {} };
  2149. Object.keys(properties).forEach(function (key) {
  2150. if (key !== 'vueSlots') {
  2151. props[key] = properties[key].value;
  2152. }
  2153. });
  2154. var componentOptions = {
  2155. mixins: initBehaviors(vueOptions),
  2156. data: initData(vueOptions, _vue.default.prototype),
  2157. props: props,
  2158. didMount: function didMount() {var _this5 = this;
  2159. if (my.dd) {// 钉钉小程序底层基础库有 bug,组件嵌套使用时,在 didMount 中无法及时调用 props 中的方法
  2160. setTimeout(function () {
  2161. initVm.call(_this5, VueComponent);
  2162. }, 4);
  2163. } else {
  2164. initVm.call(this, VueComponent);
  2165. }
  2166. initSpecialMethods(this);
  2167. if (isComponent2) {
  2168. this.$vm._isMounted = true;
  2169. this.$vm.__call_hook('mounted');
  2170. this.$vm.__call_hook('onReady');
  2171. }
  2172. },
  2173. didUnmount: function didUnmount() {
  2174. this.$vm && this.$vm.$destroy();
  2175. },
  2176. methods: {
  2177. __r: handleRef,
  2178. __e: handleEvent,
  2179. __l: handleLink$1,
  2180. triggerEvent: triggerEvent } };
  2181. if (isComponent2) {
  2182. componentOptions.onInit = function onInit() {
  2183. initVm.call(this, VueComponent);
  2184. };
  2185. componentOptions.deriveDataFromProps = createObserver$1();
  2186. } else {
  2187. componentOptions.didUpdate = createObserver$1(true);
  2188. }
  2189. if (Array.isArray(vueOptions.wxsCallMethods)) {
  2190. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  2191. componentOptions.methods[callMethod] = function (args) {
  2192. return this.$vm[callMethod](args);
  2193. };
  2194. });
  2195. }
  2196. return componentOptions;
  2197. }
  2198. function createComponent(vueOptions) {
  2199. {
  2200. return my.defineComponent(parseComponent(vueOptions));
  2201. }
  2202. }
  2203. function createSubpackageApp(vm) {
  2204. var appOptions = parseApp(vm);
  2205. var app = getApp({
  2206. allowDefault: true });
  2207. var globalData = app.globalData;
  2208. if (globalData) {
  2209. Object.keys(appOptions.globalData).forEach(function (name) {
  2210. if (!hasOwn(globalData, name)) {
  2211. globalData[name] = appOptions.globalData[name];
  2212. }
  2213. });
  2214. }
  2215. Object.keys(appOptions).forEach(function (name) {
  2216. if (!hasOwn(app, name)) {
  2217. app[name] = appOptions[name];
  2218. }
  2219. });
  2220. if (isFn(appOptions.onShow) && my.onAppShow) {
  2221. my.onAppShow(function () {for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  2222. appOptions.onShow.apply(app, args);
  2223. });
  2224. }
  2225. if (isFn(appOptions.onHide) && my.onAppHide) {
  2226. my.onAppHide(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  2227. appOptions.onHide.apply(app, args);
  2228. });
  2229. }
  2230. if (isFn(appOptions.onLaunch)) {
  2231. var args = my.getLaunchOptionsSync && my.getLaunchOptionsSync();
  2232. appOptions.onLaunch.call(app, args);
  2233. }
  2234. return vm;
  2235. }
  2236. function createPlugin(vm) {
  2237. var appOptions = parseApp(vm);
  2238. if (isFn(appOptions.onShow) && my.onAppShow) {
  2239. my.onAppShow(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  2240. appOptions.onShow.apply(vm, args);
  2241. });
  2242. }
  2243. if (isFn(appOptions.onHide) && my.onAppHide) {
  2244. my.onAppHide(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  2245. appOptions.onHide.apply(vm, args);
  2246. });
  2247. }
  2248. if (isFn(appOptions.onLaunch)) {
  2249. var args = my.getLaunchOptionsSync && my.getLaunchOptionsSync();
  2250. appOptions.onLaunch.call(vm, args);
  2251. }
  2252. return vm;
  2253. }
  2254. todos.forEach(function (todoApi) {
  2255. protocols[todoApi] = false;
  2256. });
  2257. canIUses.forEach(function (canIUseApi) {
  2258. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  2259. canIUseApi;
  2260. if (!my.canIUse(apiName)) {
  2261. protocols[canIUseApi] = false;
  2262. }
  2263. });
  2264. var uni = {};
  2265. if (typeof Proxy !== 'undefined' && "mp-alipay" !== 'app-plus') {
  2266. uni = new Proxy({}, {
  2267. get: function get(target, name) {
  2268. if (hasOwn(target, name)) {
  2269. return target[name];
  2270. }
  2271. if (baseApi[name]) {
  2272. return baseApi[name];
  2273. }
  2274. if (api[name]) {
  2275. return promisify(name, api[name]);
  2276. }
  2277. {
  2278. if (extraApi[name]) {
  2279. return promisify(name, extraApi[name]);
  2280. }
  2281. if (todoApis[name]) {
  2282. return promisify(name, todoApis[name]);
  2283. }
  2284. }
  2285. if (eventApi[name]) {
  2286. return eventApi[name];
  2287. }
  2288. if (!hasOwn(my, name) && !hasOwn(protocols, name)) {
  2289. return;
  2290. }
  2291. return promisify(name, wrapper(name, my[name]));
  2292. },
  2293. set: function set(target, name, value) {
  2294. target[name] = value;
  2295. return true;
  2296. } });
  2297. } else {
  2298. Object.keys(baseApi).forEach(function (name) {
  2299. uni[name] = baseApi[name];
  2300. });
  2301. {
  2302. Object.keys(todoApis).forEach(function (name) {
  2303. uni[name] = promisify(name, todoApis[name]);
  2304. });
  2305. Object.keys(extraApi).forEach(function (name) {
  2306. uni[name] = promisify(name, todoApis[name]);
  2307. });
  2308. }
  2309. Object.keys(eventApi).forEach(function (name) {
  2310. uni[name] = eventApi[name];
  2311. });
  2312. Object.keys(api).forEach(function (name) {
  2313. uni[name] = promisify(name, api[name]);
  2314. });
  2315. Object.keys(my).forEach(function (name) {
  2316. if (hasOwn(my, name) || hasOwn(protocols, name)) {
  2317. uni[name] = promisify(name, wrapper(name, my[name]));
  2318. }
  2319. });
  2320. }
  2321. my.createApp = createApp;
  2322. my.createPage = createPage;
  2323. my.createComponent = createComponent;
  2324. my.createSubpackageApp = createSubpackageApp;
  2325. my.createPlugin = createPlugin;
  2326. var uni$1 = uni;var _default =
  2327. uni$1;exports.default = _default;
  2328. /***/ }),
  2329. /***/ 14:
  2330. /*!**********************************************************************************************************!*\
  2331. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  2332. \**********************************************************************************************************/
  2333. /*! exports provided: default */
  2334. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2335. "use strict";
  2336. __webpack_require__.r(__webpack_exports__);
  2337. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  2338. /* globals __VUE_SSR_CONTEXT__ */
  2339. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  2340. // This module is a runtime utility for cleaner component module output and will
  2341. // be included in the final webpack user bundle.
  2342. function normalizeComponent (
  2343. scriptExports,
  2344. render,
  2345. staticRenderFns,
  2346. functionalTemplate,
  2347. injectStyles,
  2348. scopeId,
  2349. moduleIdentifier, /* server only */
  2350. shadowMode, /* vue-cli only */
  2351. components, // fixed by xxxxxx auto components
  2352. renderjs // fixed by xxxxxx renderjs
  2353. ) {
  2354. // Vue.extend constructor export interop
  2355. var options = typeof scriptExports === 'function'
  2356. ? scriptExports.options
  2357. : scriptExports
  2358. // fixed by xxxxxx auto components
  2359. if (components) {
  2360. if (!options.components) {
  2361. options.components = {}
  2362. }
  2363. var hasOwn = Object.prototype.hasOwnProperty
  2364. for (var name in components) {
  2365. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  2366. options.components[name] = components[name]
  2367. }
  2368. }
  2369. }
  2370. // fixed by xxxxxx renderjs
  2371. if (renderjs) {
  2372. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  2373. this[renderjs.__module] = this
  2374. });
  2375. (options.mixins || (options.mixins = [])).push(renderjs)
  2376. }
  2377. // render functions
  2378. if (render) {
  2379. options.render = render
  2380. options.staticRenderFns = staticRenderFns
  2381. options._compiled = true
  2382. }
  2383. // functional template
  2384. if (functionalTemplate) {
  2385. options.functional = true
  2386. }
  2387. // scopedId
  2388. if (scopeId) {
  2389. options._scopeId = 'data-v-' + scopeId
  2390. }
  2391. var hook
  2392. if (moduleIdentifier) { // server build
  2393. hook = function (context) {
  2394. // 2.3 injection
  2395. context =
  2396. context || // cached call
  2397. (this.$vnode && this.$vnode.ssrContext) || // stateful
  2398. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  2399. // 2.2 with runInNewContext: true
  2400. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  2401. context = __VUE_SSR_CONTEXT__
  2402. }
  2403. // inject component styles
  2404. if (injectStyles) {
  2405. injectStyles.call(this, context)
  2406. }
  2407. // register component module identifier for async chunk inferrence
  2408. if (context && context._registeredComponents) {
  2409. context._registeredComponents.add(moduleIdentifier)
  2410. }
  2411. }
  2412. // used by ssr in case component is cached and beforeCreate
  2413. // never gets called
  2414. options._ssrRegister = hook
  2415. } else if (injectStyles) {
  2416. hook = shadowMode
  2417. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  2418. : injectStyles
  2419. }
  2420. if (hook) {
  2421. if (options.functional) {
  2422. // for template-only hot-reload because in that case the render fn doesn't
  2423. // go through the normalizer
  2424. options._injectStyles = hook
  2425. // register for functioal component in vue file
  2426. var originalRender = options.render
  2427. options.render = function renderWithStyleInjection (h, context) {
  2428. hook.call(context)
  2429. return originalRender(h, context)
  2430. }
  2431. } else {
  2432. // inject component registration as beforeCreate hook
  2433. var existing = options.beforeCreate
  2434. options.beforeCreate = existing
  2435. ? [].concat(existing, hook)
  2436. : [hook]
  2437. }
  2438. }
  2439. return {
  2440. exports: scriptExports,
  2441. options: options
  2442. }
  2443. }
  2444. /***/ }),
  2445. /***/ 15:
  2446. /*!********************************************************************!*\
  2447. !*** C:/Users/first/Documents/HBuilderProjects/小程序/store/index.js ***!
  2448. \********************************************************************/
  2449. /*! no static exports found */
  2450. /***/ (function(module, exports, __webpack_require__) {
  2451. "use strict";
  2452. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
  2453. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 16));
  2454. var _settings = _interopRequireDefault(__webpack_require__(/*! @/settings.js */ 17));
  2455. var _moduleA = _interopRequireDefault(__webpack_require__(/*! @/store/modules/moduleA */ 18));
  2456. var _moduleB = _interopRequireDefault(__webpack_require__(/*! @/store/modules/moduleB */ 19));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  2457. _vue.default.use(_vuex.default);var _default =
  2458. new _vuex.default.Store({
  2459. state: {
  2460. text: "我是moduleA模块下state.text的值",
  2461. appId: _settings.default.appId,
  2462. stationId: _settings.default.stationId,
  2463. phoneNumber: uni.getStorageSync('phoneNumber') || "",
  2464. countryCode: uni.getStorageSync('countryCode') || "",
  2465. purePhoneNumber: uni.getStorageSync('purePhoneNumber') || "",
  2466. openId: uni.getStorageSync('openId') || "",
  2467. unionId: uni.getStorageSync('unionId') || "",
  2468. userInfo: !uni.getStorageSync('userInfo') ? {} : JSON.parse(uni.getStorageSync('userInfo')),
  2469. orderInfo: undefined,
  2470. selectedGas: undefined },
  2471. getters: {},
  2472. mutations: {
  2473. updatePhoneNumber: function updatePhoneNumber(state, phoneNumber) {
  2474. uni.setStorageSync('phoneNumber', phoneNumber);
  2475. state.phoneNumber = phoneNumber;
  2476. },
  2477. updateCountryCode: function updateCountryCode(state, countryCode) {
  2478. uni.setStorageSync('countryCode', countryCode);
  2479. state.countryCode = countryCode;
  2480. },
  2481. updatePurePhoneNumber: function updatePurePhoneNumber(state, purePhoneNumber) {
  2482. uni.setStorageSync('phoneNumber', phoneNumber);
  2483. state.purePhoneNumber = purePhoneNumber;
  2484. },
  2485. updateOpenId: function updateOpenId(state, openId) {
  2486. uni.setStorageSync('openId', openId);
  2487. state.openId = openId;
  2488. },
  2489. updateUnionId: function updateUnionId(state, unionId) {
  2490. uni.setStorageSync('unionId', unionId);
  2491. state.unionId = unionId;
  2492. },
  2493. updateUserInfo: function updateUserInfo(state, userInfo) {
  2494. uni.setStorageSync('userInfo', JSON.stringify(userInfo));
  2495. state.userInfo = userInfo;
  2496. },
  2497. updateOrderInfo: function updateOrderInfo(state, orderInfo) {
  2498. state.orderInfo = orderInfo;
  2499. },
  2500. updateSelectedGas: function updateSelectedGas(state, selectedGas) {
  2501. state.selectedGas = selectedGas;
  2502. } },
  2503. actions: {},
  2504. modules: {
  2505. moduleA: _moduleA.default,
  2506. moduleB: _moduleB.default } });exports.default = _default;
  2507. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-alipay/dist/index.js */ 1)["default"]))
  2508. /***/ }),
  2509. /***/ 16:
  2510. /*!********************************************!*\
  2511. !*** ./node_modules/vuex/dist/vuex.esm.js ***!
  2512. \********************************************/
  2513. /*! exports provided: default, Store, createNamespacedHelpers, install, mapActions, mapGetters, mapMutations, mapState */
  2514. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2515. "use strict";
  2516. __webpack_require__.r(__webpack_exports__);
  2517. /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Store", function() { return Store; });
  2518. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNamespacedHelpers", function() { return createNamespacedHelpers; });
  2519. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "install", function() { return install; });
  2520. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapActions", function() { return mapActions; });
  2521. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapGetters", function() { return mapGetters; });
  2522. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapMutations", function() { return mapMutations; });
  2523. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapState", function() { return mapState; });
  2524. /*!
  2525. * vuex v3.4.0
  2526. * (c) 2020 Evan You
  2527. * @license MIT
  2528. */
  2529. function applyMixin (Vue) {
  2530. var version = Number(Vue.version.split('.')[0]);
  2531. if (version >= 2) {
  2532. Vue.mixin({ beforeCreate: vuexInit });
  2533. } else {
  2534. // override init and inject vuex init procedure
  2535. // for 1.x backwards compatibility.
  2536. var _init = Vue.prototype._init;
  2537. Vue.prototype._init = function (options) {
  2538. if ( options === void 0 ) options = {};
  2539. options.init = options.init
  2540. ? [vuexInit].concat(options.init)
  2541. : vuexInit;
  2542. _init.call(this, options);
  2543. };
  2544. }
  2545. /**
  2546. * Vuex init hook, injected into each instances init hooks list.
  2547. */
  2548. function vuexInit () {
  2549. var options = this.$options;
  2550. // store injection
  2551. if (options.store) {
  2552. this.$store = typeof options.store === 'function'
  2553. ? options.store()
  2554. : options.store;
  2555. } else if (options.parent && options.parent.$store) {
  2556. this.$store = options.parent.$store;
  2557. }
  2558. }
  2559. }
  2560. var target = typeof window !== 'undefined'
  2561. ? window
  2562. : typeof global !== 'undefined'
  2563. ? global
  2564. : {};
  2565. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  2566. function devtoolPlugin (store) {
  2567. if (!devtoolHook) { return }
  2568. store._devtoolHook = devtoolHook;
  2569. devtoolHook.emit('vuex:init', store);
  2570. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  2571. store.replaceState(targetState);
  2572. });
  2573. store.subscribe(function (mutation, state) {
  2574. devtoolHook.emit('vuex:mutation', mutation, state);
  2575. }, { prepend: true });
  2576. store.subscribeAction(function (action, state) {
  2577. devtoolHook.emit('vuex:action', action, state);
  2578. }, { prepend: true });
  2579. }
  2580. /**
  2581. * Get the first item that pass the test
  2582. * by second argument function
  2583. *
  2584. * @param {Array} list
  2585. * @param {Function} f
  2586. * @return {*}
  2587. */
  2588. /**
  2589. * forEach for object
  2590. */
  2591. function forEachValue (obj, fn) {
  2592. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  2593. }
  2594. function isObject (obj) {
  2595. return obj !== null && typeof obj === 'object'
  2596. }
  2597. function isPromise (val) {
  2598. return val && typeof val.then === 'function'
  2599. }
  2600. function assert (condition, msg) {
  2601. if (!condition) { throw new Error(("[vuex] " + msg)) }
  2602. }
  2603. function partial (fn, arg) {
  2604. return function () {
  2605. return fn(arg)
  2606. }
  2607. }
  2608. // Base data struct for store's module, package with some attribute and method
  2609. var Module = function Module (rawModule, runtime) {
  2610. this.runtime = runtime;
  2611. // Store some children item
  2612. this._children = Object.create(null);
  2613. // Store the origin module object which passed by programmer
  2614. this._rawModule = rawModule;
  2615. var rawState = rawModule.state;
  2616. // Store the origin module's state
  2617. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  2618. };
  2619. var prototypeAccessors = { namespaced: { configurable: true } };
  2620. prototypeAccessors.namespaced.get = function () {
  2621. return !!this._rawModule.namespaced
  2622. };
  2623. Module.prototype.addChild = function addChild (key, module) {
  2624. this._children[key] = module;
  2625. };
  2626. Module.prototype.removeChild = function removeChild (key) {
  2627. delete this._children[key];
  2628. };
  2629. Module.prototype.getChild = function getChild (key) {
  2630. return this._children[key]
  2631. };
  2632. Module.prototype.hasChild = function hasChild (key) {
  2633. return key in this._children
  2634. };
  2635. Module.prototype.update = function update (rawModule) {
  2636. this._rawModule.namespaced = rawModule.namespaced;
  2637. if (rawModule.actions) {
  2638. this._rawModule.actions = rawModule.actions;
  2639. }
  2640. if (rawModule.mutations) {
  2641. this._rawModule.mutations = rawModule.mutations;
  2642. }
  2643. if (rawModule.getters) {
  2644. this._rawModule.getters = rawModule.getters;
  2645. }
  2646. };
  2647. Module.prototype.forEachChild = function forEachChild (fn) {
  2648. forEachValue(this._children, fn);
  2649. };
  2650. Module.prototype.forEachGetter = function forEachGetter (fn) {
  2651. if (this._rawModule.getters) {
  2652. forEachValue(this._rawModule.getters, fn);
  2653. }
  2654. };
  2655. Module.prototype.forEachAction = function forEachAction (fn) {
  2656. if (this._rawModule.actions) {
  2657. forEachValue(this._rawModule.actions, fn);
  2658. }
  2659. };
  2660. Module.prototype.forEachMutation = function forEachMutation (fn) {
  2661. if (this._rawModule.mutations) {
  2662. forEachValue(this._rawModule.mutations, fn);
  2663. }
  2664. };
  2665. Object.defineProperties( Module.prototype, prototypeAccessors );
  2666. var ModuleCollection = function ModuleCollection (rawRootModule) {
  2667. // register root module (Vuex.Store options)
  2668. this.register([], rawRootModule, false);
  2669. };
  2670. ModuleCollection.prototype.get = function get (path) {
  2671. return path.reduce(function (module, key) {
  2672. return module.getChild(key)
  2673. }, this.root)
  2674. };
  2675. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  2676. var module = this.root;
  2677. return path.reduce(function (namespace, key) {
  2678. module = module.getChild(key);
  2679. return namespace + (module.namespaced ? key + '/' : '')
  2680. }, '')
  2681. };
  2682. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  2683. update([], this.root, rawRootModule);
  2684. };
  2685. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  2686. var this$1 = this;
  2687. if ( runtime === void 0 ) runtime = true;
  2688. if ((true)) {
  2689. assertRawModule(path, rawModule);
  2690. }
  2691. var newModule = new Module(rawModule, runtime);
  2692. if (path.length === 0) {
  2693. this.root = newModule;
  2694. } else {
  2695. var parent = this.get(path.slice(0, -1));
  2696. parent.addChild(path[path.length - 1], newModule);
  2697. }
  2698. // register nested modules
  2699. if (rawModule.modules) {
  2700. forEachValue(rawModule.modules, function (rawChildModule, key) {
  2701. this$1.register(path.concat(key), rawChildModule, runtime);
  2702. });
  2703. }
  2704. };
  2705. ModuleCollection.prototype.unregister = function unregister (path) {
  2706. var parent = this.get(path.slice(0, -1));
  2707. var key = path[path.length - 1];
  2708. if (!parent.getChild(key).runtime) { return }
  2709. parent.removeChild(key);
  2710. };
  2711. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  2712. var parent = this.get(path.slice(0, -1));
  2713. var key = path[path.length - 1];
  2714. return parent.hasChild(key)
  2715. };
  2716. function update (path, targetModule, newModule) {
  2717. if ((true)) {
  2718. assertRawModule(path, newModule);
  2719. }
  2720. // update target module
  2721. targetModule.update(newModule);
  2722. // update nested modules
  2723. if (newModule.modules) {
  2724. for (var key in newModule.modules) {
  2725. if (!targetModule.getChild(key)) {
  2726. if ((true)) {
  2727. console.warn(
  2728. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  2729. 'manual reload is needed'
  2730. );
  2731. }
  2732. return
  2733. }
  2734. update(
  2735. path.concat(key),
  2736. targetModule.getChild(key),
  2737. newModule.modules[key]
  2738. );
  2739. }
  2740. }
  2741. }
  2742. var functionAssert = {
  2743. assert: function (value) { return typeof value === 'function'; },
  2744. expected: 'function'
  2745. };
  2746. var objectAssert = {
  2747. assert: function (value) { return typeof value === 'function' ||
  2748. (typeof value === 'object' && typeof value.handler === 'function'); },
  2749. expected: 'function or object with "handler" function'
  2750. };
  2751. var assertTypes = {
  2752. getters: functionAssert,
  2753. mutations: functionAssert,
  2754. actions: objectAssert
  2755. };
  2756. function assertRawModule (path, rawModule) {
  2757. Object.keys(assertTypes).forEach(function (key) {
  2758. if (!rawModule[key]) { return }
  2759. var assertOptions = assertTypes[key];
  2760. forEachValue(rawModule[key], function (value, type) {
  2761. assert(
  2762. assertOptions.assert(value),
  2763. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  2764. );
  2765. });
  2766. });
  2767. }
  2768. function makeAssertionMessage (path, key, type, value, expected) {
  2769. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  2770. if (path.length > 0) {
  2771. buf += " in module \"" + (path.join('.')) + "\"";
  2772. }
  2773. buf += " is " + (JSON.stringify(value)) + ".";
  2774. return buf
  2775. }
  2776. var Vue; // bind on install
  2777. var Store = function Store (options) {
  2778. var this$1 = this;
  2779. if ( options === void 0 ) options = {};
  2780. // Auto install if it is not done yet and `window` has `Vue`.
  2781. // To allow users to avoid auto-installation in some cases,
  2782. // this code should be placed here. See #731
  2783. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  2784. install(window.Vue);
  2785. }
  2786. if ((true)) {
  2787. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  2788. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  2789. assert(this instanceof Store, "store must be called with the new operator.");
  2790. }
  2791. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  2792. var strict = options.strict; if ( strict === void 0 ) strict = false;
  2793. // store internal state
  2794. this._committing = false;
  2795. this._actions = Object.create(null);
  2796. this._actionSubscribers = [];
  2797. this._mutations = Object.create(null);
  2798. this._wrappedGetters = Object.create(null);
  2799. this._modules = new ModuleCollection(options);
  2800. this._modulesNamespaceMap = Object.create(null);
  2801. this._subscribers = [];
  2802. this._watcherVM = new Vue();
  2803. this._makeLocalGettersCache = Object.create(null);
  2804. // bind commit and dispatch to self
  2805. var store = this;
  2806. var ref = this;
  2807. var dispatch = ref.dispatch;
  2808. var commit = ref.commit;
  2809. this.dispatch = function boundDispatch (type, payload) {
  2810. return dispatch.call(store, type, payload)
  2811. };
  2812. this.commit = function boundCommit (type, payload, options) {
  2813. return commit.call(store, type, payload, options)
  2814. };
  2815. // strict mode
  2816. this.strict = strict;
  2817. var state = this._modules.root.state;
  2818. // init root module.
  2819. // this also recursively registers all sub-modules
  2820. // and collects all module getters inside this._wrappedGetters
  2821. installModule(this, state, [], this._modules.root);
  2822. // initialize the store vm, which is responsible for the reactivity
  2823. // (also registers _wrappedGetters as computed properties)
  2824. resetStoreVM(this, state);
  2825. // apply plugins
  2826. plugins.forEach(function (plugin) { return plugin(this$1); });
  2827. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  2828. if (useDevtools) {
  2829. devtoolPlugin(this);
  2830. }
  2831. };
  2832. var prototypeAccessors$1 = { state: { configurable: true } };
  2833. prototypeAccessors$1.state.get = function () {
  2834. return this._vm._data.$$state
  2835. };
  2836. prototypeAccessors$1.state.set = function (v) {
  2837. if ((true)) {
  2838. assert(false, "use store.replaceState() to explicit replace store state.");
  2839. }
  2840. };
  2841. Store.prototype.commit = function commit (_type, _payload, _options) {
  2842. var this$1 = this;
  2843. // check object-style commit
  2844. var ref = unifyObjectStyle(_type, _payload, _options);
  2845. var type = ref.type;
  2846. var payload = ref.payload;
  2847. var options = ref.options;
  2848. var mutation = { type: type, payload: payload };
  2849. var entry = this._mutations[type];
  2850. if (!entry) {
  2851. if ((true)) {
  2852. console.error(("[vuex] unknown mutation type: " + type));
  2853. }
  2854. return
  2855. }
  2856. this._withCommit(function () {
  2857. entry.forEach(function commitIterator (handler) {
  2858. handler(payload);
  2859. });
  2860. });
  2861. this._subscribers
  2862. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  2863. .forEach(function (sub) { return sub(mutation, this$1.state); });
  2864. if (
  2865. ( true) &&
  2866. options && options.silent
  2867. ) {
  2868. console.warn(
  2869. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  2870. 'Use the filter functionality in the vue-devtools'
  2871. );
  2872. }
  2873. };
  2874. Store.prototype.dispatch = function dispatch (_type, _payload) {
  2875. var this$1 = this;
  2876. // check object-style dispatch
  2877. var ref = unifyObjectStyle(_type, _payload);
  2878. var type = ref.type;
  2879. var payload = ref.payload;
  2880. var action = { type: type, payload: payload };
  2881. var entry = this._actions[type];
  2882. if (!entry) {
  2883. if ((true)) {
  2884. console.error(("[vuex] unknown action type: " + type));
  2885. }
  2886. return
  2887. }
  2888. try {
  2889. this._actionSubscribers
  2890. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  2891. .filter(function (sub) { return sub.before; })
  2892. .forEach(function (sub) { return sub.before(action, this$1.state); });
  2893. } catch (e) {
  2894. if ((true)) {
  2895. console.warn("[vuex] error in before action subscribers: ");
  2896. console.error(e);
  2897. }
  2898. }
  2899. var result = entry.length > 1
  2900. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  2901. : entry[0](payload);
  2902. return new Promise(function (resolve, reject) {
  2903. result.then(function (res) {
  2904. try {
  2905. this$1._actionSubscribers
  2906. .filter(function (sub) { return sub.after; })
  2907. .forEach(function (sub) { return sub.after(action, this$1.state); });
  2908. } catch (e) {
  2909. if ((true)) {
  2910. console.warn("[vuex] error in after action subscribers: ");
  2911. console.error(e);
  2912. }
  2913. }
  2914. resolve(res);
  2915. }, function (error) {
  2916. try {
  2917. this$1._actionSubscribers
  2918. .filter(function (sub) { return sub.error; })
  2919. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  2920. } catch (e) {
  2921. if ((true)) {
  2922. console.warn("[vuex] error in error action subscribers: ");
  2923. console.error(e);
  2924. }
  2925. }
  2926. reject(error);
  2927. });
  2928. })
  2929. };
  2930. Store.prototype.subscribe = function subscribe (fn, options) {
  2931. return genericSubscribe(fn, this._subscribers, options)
  2932. };
  2933. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  2934. var subs = typeof fn === 'function' ? { before: fn } : fn;
  2935. return genericSubscribe(subs, this._actionSubscribers, options)
  2936. };
  2937. Store.prototype.watch = function watch (getter, cb, options) {
  2938. var this$1 = this;
  2939. if ((true)) {
  2940. assert(typeof getter === 'function', "store.watch only accepts a function.");
  2941. }
  2942. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  2943. };
  2944. Store.prototype.replaceState = function replaceState (state) {
  2945. var this$1 = this;
  2946. this._withCommit(function () {
  2947. this$1._vm._data.$$state = state;
  2948. });
  2949. };
  2950. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  2951. if ( options === void 0 ) options = {};
  2952. if (typeof path === 'string') { path = [path]; }
  2953. if ((true)) {
  2954. assert(Array.isArray(path), "module path must be a string or an Array.");
  2955. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  2956. }
  2957. this._modules.register(path, rawModule);
  2958. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  2959. // reset store to update getters...
  2960. resetStoreVM(this, this.state);
  2961. };
  2962. Store.prototype.unregisterModule = function unregisterModule (path) {
  2963. var this$1 = this;
  2964. if (typeof path === 'string') { path = [path]; }
  2965. if ((true)) {
  2966. assert(Array.isArray(path), "module path must be a string or an Array.");
  2967. }
  2968. this._modules.unregister(path);
  2969. this._withCommit(function () {
  2970. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  2971. Vue.delete(parentState, path[path.length - 1]);
  2972. });
  2973. resetStore(this);
  2974. };
  2975. Store.prototype.hasModule = function hasModule (path) {
  2976. if (typeof path === 'string') { path = [path]; }
  2977. if ((true)) {
  2978. assert(Array.isArray(path), "module path must be a string or an Array.");
  2979. }
  2980. return this._modules.isRegistered(path)
  2981. };
  2982. Store.prototype.hotUpdate = function hotUpdate (newOptions) {
  2983. this._modules.update(newOptions);
  2984. resetStore(this, true);
  2985. };
  2986. Store.prototype._withCommit = function _withCommit (fn) {
  2987. var committing = this._committing;
  2988. this._committing = true;
  2989. fn();
  2990. this._committing = committing;
  2991. };
  2992. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  2993. function genericSubscribe (fn, subs, options) {
  2994. if (subs.indexOf(fn) < 0) {
  2995. options && options.prepend
  2996. ? subs.unshift(fn)
  2997. : subs.push(fn);
  2998. }
  2999. return function () {
  3000. var i = subs.indexOf(fn);
  3001. if (i > -1) {
  3002. subs.splice(i, 1);
  3003. }
  3004. }
  3005. }
  3006. function resetStore (store, hot) {
  3007. store._actions = Object.create(null);
  3008. store._mutations = Object.create(null);
  3009. store._wrappedGetters = Object.create(null);
  3010. store._modulesNamespaceMap = Object.create(null);
  3011. var state = store.state;
  3012. // init all modules
  3013. installModule(store, state, [], store._modules.root, true);
  3014. // reset vm
  3015. resetStoreVM(store, state, hot);
  3016. }
  3017. function resetStoreVM (store, state, hot) {
  3018. var oldVm = store._vm;
  3019. // bind store public getters
  3020. store.getters = {};
  3021. // reset local getters cache
  3022. store._makeLocalGettersCache = Object.create(null);
  3023. var wrappedGetters = store._wrappedGetters;
  3024. var computed = {};
  3025. forEachValue(wrappedGetters, function (fn, key) {
  3026. // use computed to leverage its lazy-caching mechanism
  3027. // direct inline function use will lead to closure preserving oldVm.
  3028. // using partial to return function with only arguments preserved in closure environment.
  3029. computed[key] = partial(fn, store);
  3030. Object.defineProperty(store.getters, key, {
  3031. get: function () { return store._vm[key]; },
  3032. enumerable: true // for local getters
  3033. });
  3034. });
  3035. // use a Vue instance to store the state tree
  3036. // suppress warnings just in case the user has added
  3037. // some funky global mixins
  3038. var silent = Vue.config.silent;
  3039. Vue.config.silent = true;
  3040. store._vm = new Vue({
  3041. data: {
  3042. $$state: state
  3043. },
  3044. computed: computed
  3045. });
  3046. Vue.config.silent = silent;
  3047. // enable strict mode for new vm
  3048. if (store.strict) {
  3049. enableStrictMode(store);
  3050. }
  3051. if (oldVm) {
  3052. if (hot) {
  3053. // dispatch changes in all subscribed watchers
  3054. // to force getter re-evaluation for hot reloading.
  3055. store._withCommit(function () {
  3056. oldVm._data.$$state = null;
  3057. });
  3058. }
  3059. Vue.nextTick(function () { return oldVm.$destroy(); });
  3060. }
  3061. }
  3062. function installModule (store, rootState, path, module, hot) {
  3063. var isRoot = !path.length;
  3064. var namespace = store._modules.getNamespace(path);
  3065. // register in namespace map
  3066. if (module.namespaced) {
  3067. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  3068. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  3069. }
  3070. store._modulesNamespaceMap[namespace] = module;
  3071. }
  3072. // set state
  3073. if (!isRoot && !hot) {
  3074. var parentState = getNestedState(rootState, path.slice(0, -1));
  3075. var moduleName = path[path.length - 1];
  3076. store._withCommit(function () {
  3077. if ((true)) {
  3078. if (moduleName in parentState) {
  3079. console.warn(
  3080. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  3081. );
  3082. }
  3083. }
  3084. Vue.set(parentState, moduleName, module.state);
  3085. });
  3086. }
  3087. var local = module.context = makeLocalContext(store, namespace, path);
  3088. module.forEachMutation(function (mutation, key) {
  3089. var namespacedType = namespace + key;
  3090. registerMutation(store, namespacedType, mutation, local);
  3091. });
  3092. module.forEachAction(function (action, key) {
  3093. var type = action.root ? key : namespace + key;
  3094. var handler = action.handler || action;
  3095. registerAction(store, type, handler, local);
  3096. });
  3097. module.forEachGetter(function (getter, key) {
  3098. var namespacedType = namespace + key;
  3099. registerGetter(store, namespacedType, getter, local);
  3100. });
  3101. module.forEachChild(function (child, key) {
  3102. installModule(store, rootState, path.concat(key), child, hot);
  3103. });
  3104. }
  3105. /**
  3106. * make localized dispatch, commit, getters and state
  3107. * if there is no namespace, just use root ones
  3108. */
  3109. function makeLocalContext (store, namespace, path) {
  3110. var noNamespace = namespace === '';
  3111. var local = {
  3112. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  3113. var args = unifyObjectStyle(_type, _payload, _options);
  3114. var payload = args.payload;
  3115. var options = args.options;
  3116. var type = args.type;
  3117. if (!options || !options.root) {
  3118. type = namespace + type;
  3119. if (( true) && !store._actions[type]) {
  3120. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  3121. return
  3122. }
  3123. }
  3124. return store.dispatch(type, payload)
  3125. },
  3126. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  3127. var args = unifyObjectStyle(_type, _payload, _options);
  3128. var payload = args.payload;
  3129. var options = args.options;
  3130. var type = args.type;
  3131. if (!options || !options.root) {
  3132. type = namespace + type;
  3133. if (( true) && !store._mutations[type]) {
  3134. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  3135. return
  3136. }
  3137. }
  3138. store.commit(type, payload, options);
  3139. }
  3140. };
  3141. // getters and state object must be gotten lazily
  3142. // because they will be changed by vm update
  3143. Object.defineProperties(local, {
  3144. getters: {
  3145. get: noNamespace
  3146. ? function () { return store.getters; }
  3147. : function () { return makeLocalGetters(store, namespace); }
  3148. },
  3149. state: {
  3150. get: function () { return getNestedState(store.state, path); }
  3151. }
  3152. });
  3153. return local
  3154. }
  3155. function makeLocalGetters (store, namespace) {
  3156. if (!store._makeLocalGettersCache[namespace]) {
  3157. var gettersProxy = {};
  3158. var splitPos = namespace.length;
  3159. Object.keys(store.getters).forEach(function (type) {
  3160. // skip if the target getter is not match this namespace
  3161. if (type.slice(0, splitPos) !== namespace) { return }
  3162. // extract local getter type
  3163. var localType = type.slice(splitPos);
  3164. // Add a port to the getters proxy.
  3165. // Define as getter property because
  3166. // we do not want to evaluate the getters in this time.
  3167. Object.defineProperty(gettersProxy, localType, {
  3168. get: function () { return store.getters[type]; },
  3169. enumerable: true
  3170. });
  3171. });
  3172. store._makeLocalGettersCache[namespace] = gettersProxy;
  3173. }
  3174. return store._makeLocalGettersCache[namespace]
  3175. }
  3176. function registerMutation (store, type, handler, local) {
  3177. var entry = store._mutations[type] || (store._mutations[type] = []);
  3178. entry.push(function wrappedMutationHandler (payload) {
  3179. handler.call(store, local.state, payload);
  3180. });
  3181. }
  3182. function registerAction (store, type, handler, local) {
  3183. var entry = store._actions[type] || (store._actions[type] = []);
  3184. entry.push(function wrappedActionHandler (payload) {
  3185. var res = handler.call(store, {
  3186. dispatch: local.dispatch,
  3187. commit: local.commit,
  3188. getters: local.getters,
  3189. state: local.state,
  3190. rootGetters: store.getters,
  3191. rootState: store.state
  3192. }, payload);
  3193. if (!isPromise(res)) {
  3194. res = Promise.resolve(res);
  3195. }
  3196. if (store._devtoolHook) {
  3197. return res.catch(function (err) {
  3198. store._devtoolHook.emit('vuex:error', err);
  3199. throw err
  3200. })
  3201. } else {
  3202. return res
  3203. }
  3204. });
  3205. }
  3206. function registerGetter (store, type, rawGetter, local) {
  3207. if (store._wrappedGetters[type]) {
  3208. if ((true)) {
  3209. console.error(("[vuex] duplicate getter key: " + type));
  3210. }
  3211. return
  3212. }
  3213. store._wrappedGetters[type] = function wrappedGetter (store) {
  3214. return rawGetter(
  3215. local.state, // local state
  3216. local.getters, // local getters
  3217. store.state, // root state
  3218. store.getters // root getters
  3219. )
  3220. };
  3221. }
  3222. function enableStrictMode (store) {
  3223. store._vm.$watch(function () { return this._data.$$state }, function () {
  3224. if ((true)) {
  3225. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  3226. }
  3227. }, { deep: true, sync: true });
  3228. }
  3229. function getNestedState (state, path) {
  3230. return path.reduce(function (state, key) { return state[key]; }, state)
  3231. }
  3232. function unifyObjectStyle (type, payload, options) {
  3233. if (isObject(type) && type.type) {
  3234. options = payload;
  3235. payload = type;
  3236. type = type.type;
  3237. }
  3238. if ((true)) {
  3239. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  3240. }
  3241. return { type: type, payload: payload, options: options }
  3242. }
  3243. function install (_Vue) {
  3244. if (Vue && _Vue === Vue) {
  3245. if ((true)) {
  3246. console.error(
  3247. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  3248. );
  3249. }
  3250. return
  3251. }
  3252. Vue = _Vue;
  3253. applyMixin(Vue);
  3254. }
  3255. /**
  3256. * Reduce the code which written in Vue.js for getting the state.
  3257. * @param {String} [namespace] - Module's namespace
  3258. * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
  3259. * @param {Object}
  3260. */
  3261. var mapState = normalizeNamespace(function (namespace, states) {
  3262. var res = {};
  3263. if (( true) && !isValidMap(states)) {
  3264. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  3265. }
  3266. normalizeMap(states).forEach(function (ref) {
  3267. var key = ref.key;
  3268. var val = ref.val;
  3269. res[key] = function mappedState () {
  3270. var state = this.$store.state;
  3271. var getters = this.$store.getters;
  3272. if (namespace) {
  3273. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  3274. if (!module) {
  3275. return
  3276. }
  3277. state = module.context.state;
  3278. getters = module.context.getters;
  3279. }
  3280. return typeof val === 'function'
  3281. ? val.call(this, state, getters)
  3282. : state[val]
  3283. };
  3284. // mark vuex getter for devtools
  3285. res[key].vuex = true;
  3286. });
  3287. return res
  3288. });
  3289. /**
  3290. * Reduce the code which written in Vue.js for committing the mutation
  3291. * @param {String} [namespace] - Module's namespace
  3292. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept anthor params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  3293. * @return {Object}
  3294. */
  3295. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  3296. var res = {};
  3297. if (( true) && !isValidMap(mutations)) {
  3298. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  3299. }
  3300. normalizeMap(mutations).forEach(function (ref) {
  3301. var key = ref.key;
  3302. var val = ref.val;
  3303. res[key] = function mappedMutation () {
  3304. var args = [], len = arguments.length;
  3305. while ( len-- ) args[ len ] = arguments[ len ];
  3306. // Get the commit method from store
  3307. var commit = this.$store.commit;
  3308. if (namespace) {
  3309. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  3310. if (!module) {
  3311. return
  3312. }
  3313. commit = module.context.commit;
  3314. }
  3315. return typeof val === 'function'
  3316. ? val.apply(this, [commit].concat(args))
  3317. : commit.apply(this.$store, [val].concat(args))
  3318. };
  3319. });
  3320. return res
  3321. });
  3322. /**
  3323. * Reduce the code which written in Vue.js for getting the getters
  3324. * @param {String} [namespace] - Module's namespace
  3325. * @param {Object|Array} getters
  3326. * @return {Object}
  3327. */
  3328. var mapGetters = normalizeNamespace(function (namespace, getters) {
  3329. var res = {};
  3330. if (( true) && !isValidMap(getters)) {
  3331. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  3332. }
  3333. normalizeMap(getters).forEach(function (ref) {
  3334. var key = ref.key;
  3335. var val = ref.val;
  3336. // The namespace has been mutated by normalizeNamespace
  3337. val = namespace + val;
  3338. res[key] = function mappedGetter () {
  3339. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  3340. return
  3341. }
  3342. if (( true) && !(val in this.$store.getters)) {
  3343. console.error(("[vuex] unknown getter: " + val));
  3344. return
  3345. }
  3346. return this.$store.getters[val]
  3347. };
  3348. // mark vuex getter for devtools
  3349. res[key].vuex = true;
  3350. });
  3351. return res
  3352. });
  3353. /**
  3354. * Reduce the code which written in Vue.js for dispatch the action
  3355. * @param {String} [namespace] - Module's namespace
  3356. * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  3357. * @return {Object}
  3358. */
  3359. var mapActions = normalizeNamespace(function (namespace, actions) {
  3360. var res = {};
  3361. if (( true) && !isValidMap(actions)) {
  3362. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  3363. }
  3364. normalizeMap(actions).forEach(function (ref) {
  3365. var key = ref.key;
  3366. var val = ref.val;
  3367. res[key] = function mappedAction () {
  3368. var args = [], len = arguments.length;
  3369. while ( len-- ) args[ len ] = arguments[ len ];
  3370. // get dispatch function from store
  3371. var dispatch = this.$store.dispatch;
  3372. if (namespace) {
  3373. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  3374. if (!module) {
  3375. return
  3376. }
  3377. dispatch = module.context.dispatch;
  3378. }
  3379. return typeof val === 'function'
  3380. ? val.apply(this, [dispatch].concat(args))
  3381. : dispatch.apply(this.$store, [val].concat(args))
  3382. };
  3383. });
  3384. return res
  3385. });
  3386. /**
  3387. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  3388. * @param {String} namespace
  3389. * @return {Object}
  3390. */
  3391. var createNamespacedHelpers = function (namespace) { return ({
  3392. mapState: mapState.bind(null, namespace),
  3393. mapGetters: mapGetters.bind(null, namespace),
  3394. mapMutations: mapMutations.bind(null, namespace),
  3395. mapActions: mapActions.bind(null, namespace)
  3396. }); };
  3397. /**
  3398. * Normalize the map
  3399. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  3400. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  3401. * @param {Array|Object} map
  3402. * @return {Object}
  3403. */
  3404. function normalizeMap (map) {
  3405. if (!isValidMap(map)) {
  3406. return []
  3407. }
  3408. return Array.isArray(map)
  3409. ? map.map(function (key) { return ({ key: key, val: key }); })
  3410. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  3411. }
  3412. /**
  3413. * Validate whether given map is valid or not
  3414. * @param {*} map
  3415. * @return {Boolean}
  3416. */
  3417. function isValidMap (map) {
  3418. return Array.isArray(map) || isObject(map)
  3419. }
  3420. /**
  3421. * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
  3422. * @param {Function} fn
  3423. * @return {Function}
  3424. */
  3425. function normalizeNamespace (fn) {
  3426. return function (namespace, map) {
  3427. if (typeof namespace !== 'string') {
  3428. map = namespace;
  3429. namespace = '';
  3430. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  3431. namespace += '/';
  3432. }
  3433. return fn(namespace, map)
  3434. }
  3435. }
  3436. /**
  3437. * Search a special module from store by namespace. if module not exist, print error message.
  3438. * @param {Object} store
  3439. * @param {String} helper
  3440. * @param {String} namespace
  3441. * @return {Object}
  3442. */
  3443. function getModuleByNamespace (store, helper, namespace) {
  3444. var module = store._modulesNamespaceMap[namespace];
  3445. if (( true) && !module) {
  3446. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  3447. }
  3448. return module
  3449. }
  3450. var index = {
  3451. Store: Store,
  3452. install: install,
  3453. version: '3.4.0',
  3454. mapState: mapState,
  3455. mapMutations: mapMutations,
  3456. mapGetters: mapGetters,
  3457. mapActions: mapActions,
  3458. createNamespacedHelpers: createNamespacedHelpers
  3459. };
  3460. /* harmony default export */ __webpack_exports__["default"] = (index);
  3461. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3)))
  3462. /***/ }),
  3463. /***/ 17:
  3464. /*!*****************************************************************!*\
  3465. !*** C:/Users/first/Documents/HBuilderProjects/小程序/settings.js ***!
  3466. \*****************************************************************/
  3467. /*! no static exports found */
  3468. /***/ (function(module, exports, __webpack_require__) {
  3469. "use strict";
  3470. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 接口 定义接口前缀:demo-演示版 api-正式版
  3471. // export const showIndex = false;
  3472. // export const gasupList = true;
  3473. // 是否开始
  3474. // appid
  3475. // 站点Id
  3476. // 智慧油驿站
  3477. // 山东石化879站
  3478. // export const isDemo = true;
  3479. // export const prefix='demo';
  3480. // export const appId = 'wxe1135cd390b38a54'
  3481. // export const stationId = 1
  3482. // export const isDemo = false;
  3483. // export const prefix='api';
  3484. // export const appId = 'wx5285c34adff1069d'
  3485. // export const stationId = 5;
  3486. // export const isDemo = false;
  3487. // export const prefix='demo';
  3488. // export const appId = 'wxe1135cd390b38a54'
  3489. // export const stationId = 118;
  3490. // const BASE_URL = 'http://localhost:8082'
  3491. var _default =
  3492. {
  3493. prefix: "/demo",
  3494. appId: "wxe1135cd390b38a54",
  3495. stationId: 1,
  3496. base_url: "https://www.huijy.net" };exports.default = _default;
  3497. /***/ }),
  3498. /***/ 18:
  3499. /*!******************************************************************************!*\
  3500. !*** C:/Users/first/Documents/HBuilderProjects/小程序/store/modules/moduleA.js ***!
  3501. \******************************************************************************/
  3502. /*! no static exports found */
  3503. /***/ (function(module, exports, __webpack_require__) {
  3504. "use strict";
  3505. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  3506. state: {
  3507. text: "我是moduleA模块下state.text的值" },
  3508. getters: {},
  3509. mutations: {},
  3510. actions: {} };exports.default = _default;
  3511. /***/ }),
  3512. /***/ 19:
  3513. /*!******************************************************************************!*\
  3514. !*** C:/Users/first/Documents/HBuilderProjects/小程序/store/modules/moduleB.js ***!
  3515. \******************************************************************************/
  3516. /*! no static exports found */
  3517. /***/ (function(module, exports, __webpack_require__) {
  3518. "use strict";
  3519. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  3520. state: {
  3521. timestamp: 1608820295 //初始时间戳
  3522. },
  3523. getters: {
  3524. timeString: function timeString(state) {//时间戳转换后的时间
  3525. var date = new Date(state.timestamp);
  3526. var year = date.getFullYear();
  3527. var mon = date.getMonth() + 1;
  3528. var day = date.getDate();
  3529. var hours = date.getHours();
  3530. var minu = date.getMinutes();
  3531. var sec = date.getSeconds();
  3532. var trMon = mon < 10 ? '0' + mon : mon;
  3533. var trDay = day < 10 ? '0' + day : day;
  3534. return year + '-' + trMon + '-' + trDay + " " + hours + ":" + minu + ":" + sec;
  3535. } },
  3536. mutations: {
  3537. updateTime: function updateTime(state) {//更新当前时间戳
  3538. state.timestamp = Date.now();
  3539. } },
  3540. actions: {} };exports.default = _default;
  3541. /***/ }),
  3542. /***/ 2:
  3543. /*!******************************************************************************************!*\
  3544. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3545. \******************************************************************************************/
  3546. /*! exports provided: default */
  3547. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3548. "use strict";
  3549. __webpack_require__.r(__webpack_exports__);
  3550. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3551. * Vue.js v2.6.11
  3552. * (c) 2014-2021 Evan You
  3553. * Released under the MIT License.
  3554. */
  3555. /* */
  3556. var emptyObject = Object.freeze({});
  3557. // These helpers produce better VM code in JS engines due to their
  3558. // explicitness and function inlining.
  3559. function isUndef (v) {
  3560. return v === undefined || v === null
  3561. }
  3562. function isDef (v) {
  3563. return v !== undefined && v !== null
  3564. }
  3565. function isTrue (v) {
  3566. return v === true
  3567. }
  3568. function isFalse (v) {
  3569. return v === false
  3570. }
  3571. /**
  3572. * Check if value is primitive.
  3573. */
  3574. function isPrimitive (value) {
  3575. return (
  3576. typeof value === 'string' ||
  3577. typeof value === 'number' ||
  3578. // $flow-disable-line
  3579. typeof value === 'symbol' ||
  3580. typeof value === 'boolean'
  3581. )
  3582. }
  3583. /**
  3584. * Quick object check - this is primarily used to tell
  3585. * Objects from primitive values when we know the value
  3586. * is a JSON-compliant type.
  3587. */
  3588. function isObject (obj) {
  3589. return obj !== null && typeof obj === 'object'
  3590. }
  3591. /**
  3592. * Get the raw type string of a value, e.g., [object Object].
  3593. */
  3594. var _toString = Object.prototype.toString;
  3595. function toRawType (value) {
  3596. return _toString.call(value).slice(8, -1)
  3597. }
  3598. /**
  3599. * Strict object type check. Only returns true
  3600. * for plain JavaScript objects.
  3601. */
  3602. function isPlainObject (obj) {
  3603. return _toString.call(obj) === '[object Object]'
  3604. }
  3605. function isRegExp (v) {
  3606. return _toString.call(v) === '[object RegExp]'
  3607. }
  3608. /**
  3609. * Check if val is a valid array index.
  3610. */
  3611. function isValidArrayIndex (val) {
  3612. var n = parseFloat(String(val));
  3613. return n >= 0 && Math.floor(n) === n && isFinite(val)
  3614. }
  3615. function isPromise (val) {
  3616. return (
  3617. isDef(val) &&
  3618. typeof val.then === 'function' &&
  3619. typeof val.catch === 'function'
  3620. )
  3621. }
  3622. /**
  3623. * Convert a value to a string that is actually rendered.
  3624. */
  3625. function toString (val) {
  3626. return val == null
  3627. ? ''
  3628. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  3629. ? JSON.stringify(val, null, 2)
  3630. : String(val)
  3631. }
  3632. /**
  3633. * Convert an input value to a number for persistence.
  3634. * If the conversion fails, return original string.
  3635. */
  3636. function toNumber (val) {
  3637. var n = parseFloat(val);
  3638. return isNaN(n) ? val : n
  3639. }
  3640. /**
  3641. * Make a map and return a function for checking if a key
  3642. * is in that map.
  3643. */
  3644. function makeMap (
  3645. str,
  3646. expectsLowerCase
  3647. ) {
  3648. var map = Object.create(null);
  3649. var list = str.split(',');
  3650. for (var i = 0; i < list.length; i++) {
  3651. map[list[i]] = true;
  3652. }
  3653. return expectsLowerCase
  3654. ? function (val) { return map[val.toLowerCase()]; }
  3655. : function (val) { return map[val]; }
  3656. }
  3657. /**
  3658. * Check if a tag is a built-in tag.
  3659. */
  3660. var isBuiltInTag = makeMap('slot,component', true);
  3661. /**
  3662. * Check if an attribute is a reserved attribute.
  3663. */
  3664. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  3665. /**
  3666. * Remove an item from an array.
  3667. */
  3668. function remove (arr, item) {
  3669. if (arr.length) {
  3670. var index = arr.indexOf(item);
  3671. if (index > -1) {
  3672. return arr.splice(index, 1)
  3673. }
  3674. }
  3675. }
  3676. /**
  3677. * Check whether an object has the property.
  3678. */
  3679. var hasOwnProperty = Object.prototype.hasOwnProperty;
  3680. function hasOwn (obj, key) {
  3681. return hasOwnProperty.call(obj, key)
  3682. }
  3683. /**
  3684. * Create a cached version of a pure function.
  3685. */
  3686. function cached (fn) {
  3687. var cache = Object.create(null);
  3688. return (function cachedFn (str) {
  3689. var hit = cache[str];
  3690. return hit || (cache[str] = fn(str))
  3691. })
  3692. }
  3693. /**
  3694. * Camelize a hyphen-delimited string.
  3695. */
  3696. var camelizeRE = /-(\w)/g;
  3697. var camelize = cached(function (str) {
  3698. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  3699. });
  3700. /**
  3701. * Capitalize a string.
  3702. */
  3703. var capitalize = cached(function (str) {
  3704. return str.charAt(0).toUpperCase() + str.slice(1)
  3705. });
  3706. /**
  3707. * Hyphenate a camelCase string.
  3708. */
  3709. var hyphenateRE = /\B([A-Z])/g;
  3710. var hyphenate = cached(function (str) {
  3711. return str.replace(hyphenateRE, '-$1').toLowerCase()
  3712. });
  3713. /**
  3714. * Simple bind polyfill for environments that do not support it,
  3715. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  3716. * since native bind is now performant enough in most browsers.
  3717. * But removing it would mean breaking code that was able to run in
  3718. * PhantomJS 1.x, so this must be kept for backward compatibility.
  3719. */
  3720. /* istanbul ignore next */
  3721. function polyfillBind (fn, ctx) {
  3722. function boundFn (a) {
  3723. var l = arguments.length;
  3724. return l
  3725. ? l > 1
  3726. ? fn.apply(ctx, arguments)
  3727. : fn.call(ctx, a)
  3728. : fn.call(ctx)
  3729. }
  3730. boundFn._length = fn.length;
  3731. return boundFn
  3732. }
  3733. function nativeBind (fn, ctx) {
  3734. return fn.bind(ctx)
  3735. }
  3736. var bind = Function.prototype.bind
  3737. ? nativeBind
  3738. : polyfillBind;
  3739. /**
  3740. * Convert an Array-like object to a real Array.
  3741. */
  3742. function toArray (list, start) {
  3743. start = start || 0;
  3744. var i = list.length - start;
  3745. var ret = new Array(i);
  3746. while (i--) {
  3747. ret[i] = list[i + start];
  3748. }
  3749. return ret
  3750. }
  3751. /**
  3752. * Mix properties into target object.
  3753. */
  3754. function extend (to, _from) {
  3755. for (var key in _from) {
  3756. to[key] = _from[key];
  3757. }
  3758. return to
  3759. }
  3760. /**
  3761. * Merge an Array of Objects into a single Object.
  3762. */
  3763. function toObject (arr) {
  3764. var res = {};
  3765. for (var i = 0; i < arr.length; i++) {
  3766. if (arr[i]) {
  3767. extend(res, arr[i]);
  3768. }
  3769. }
  3770. return res
  3771. }
  3772. /* eslint-disable no-unused-vars */
  3773. /**
  3774. * Perform no operation.
  3775. * Stubbing args to make Flow happy without leaving useless transpiled code
  3776. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  3777. */
  3778. function noop (a, b, c) {}
  3779. /**
  3780. * Always return false.
  3781. */
  3782. var no = function (a, b, c) { return false; };
  3783. /* eslint-enable no-unused-vars */
  3784. /**
  3785. * Return the same value.
  3786. */
  3787. var identity = function (_) { return _; };
  3788. /**
  3789. * Check if two values are loosely equal - that is,
  3790. * if they are plain objects, do they have the same shape?
  3791. */
  3792. function looseEqual (a, b) {
  3793. if (a === b) { return true }
  3794. var isObjectA = isObject(a);
  3795. var isObjectB = isObject(b);
  3796. if (isObjectA && isObjectB) {
  3797. try {
  3798. var isArrayA = Array.isArray(a);
  3799. var isArrayB = Array.isArray(b);
  3800. if (isArrayA && isArrayB) {
  3801. return a.length === b.length && a.every(function (e, i) {
  3802. return looseEqual(e, b[i])
  3803. })
  3804. } else if (a instanceof Date && b instanceof Date) {
  3805. return a.getTime() === b.getTime()
  3806. } else if (!isArrayA && !isArrayB) {
  3807. var keysA = Object.keys(a);
  3808. var keysB = Object.keys(b);
  3809. return keysA.length === keysB.length && keysA.every(function (key) {
  3810. return looseEqual(a[key], b[key])
  3811. })
  3812. } else {
  3813. /* istanbul ignore next */
  3814. return false
  3815. }
  3816. } catch (e) {
  3817. /* istanbul ignore next */
  3818. return false
  3819. }
  3820. } else if (!isObjectA && !isObjectB) {
  3821. return String(a) === String(b)
  3822. } else {
  3823. return false
  3824. }
  3825. }
  3826. /**
  3827. * Return the first index at which a loosely equal value can be
  3828. * found in the array (if value is a plain object, the array must
  3829. * contain an object of the same shape), or -1 if it is not present.
  3830. */
  3831. function looseIndexOf (arr, val) {
  3832. for (var i = 0; i < arr.length; i++) {
  3833. if (looseEqual(arr[i], val)) { return i }
  3834. }
  3835. return -1
  3836. }
  3837. /**
  3838. * Ensure a function is called only once.
  3839. */
  3840. function once (fn) {
  3841. var called = false;
  3842. return function () {
  3843. if (!called) {
  3844. called = true;
  3845. fn.apply(this, arguments);
  3846. }
  3847. }
  3848. }
  3849. var ASSET_TYPES = [
  3850. 'component',
  3851. 'directive',
  3852. 'filter'
  3853. ];
  3854. var LIFECYCLE_HOOKS = [
  3855. 'beforeCreate',
  3856. 'created',
  3857. 'beforeMount',
  3858. 'mounted',
  3859. 'beforeUpdate',
  3860. 'updated',
  3861. 'beforeDestroy',
  3862. 'destroyed',
  3863. 'activated',
  3864. 'deactivated',
  3865. 'errorCaptured',
  3866. 'serverPrefetch'
  3867. ];
  3868. /* */
  3869. var config = ({
  3870. /**
  3871. * Option merge strategies (used in core/util/options)
  3872. */
  3873. // $flow-disable-line
  3874. optionMergeStrategies: Object.create(null),
  3875. /**
  3876. * Whether to suppress warnings.
  3877. */
  3878. silent: false,
  3879. /**
  3880. * Show production mode tip message on boot?
  3881. */
  3882. productionTip: "development" !== 'production',
  3883. /**
  3884. * Whether to enable devtools
  3885. */
  3886. devtools: "development" !== 'production',
  3887. /**
  3888. * Whether to record perf
  3889. */
  3890. performance: false,
  3891. /**
  3892. * Error handler for watcher errors
  3893. */
  3894. errorHandler: null,
  3895. /**
  3896. * Warn handler for watcher warns
  3897. */
  3898. warnHandler: null,
  3899. /**
  3900. * Ignore certain custom elements
  3901. */
  3902. ignoredElements: [],
  3903. /**
  3904. * Custom user key aliases for v-on
  3905. */
  3906. // $flow-disable-line
  3907. keyCodes: Object.create(null),
  3908. /**
  3909. * Check if a tag is reserved so that it cannot be registered as a
  3910. * component. This is platform-dependent and may be overwritten.
  3911. */
  3912. isReservedTag: no,
  3913. /**
  3914. * Check if an attribute is reserved so that it cannot be used as a component
  3915. * prop. This is platform-dependent and may be overwritten.
  3916. */
  3917. isReservedAttr: no,
  3918. /**
  3919. * Check if a tag is an unknown element.
  3920. * Platform-dependent.
  3921. */
  3922. isUnknownElement: no,
  3923. /**
  3924. * Get the namespace of an element
  3925. */
  3926. getTagNamespace: noop,
  3927. /**
  3928. * Parse the real tag name for the specific platform.
  3929. */
  3930. parsePlatformTagName: identity,
  3931. /**
  3932. * Check if an attribute must be bound using property, e.g. value
  3933. * Platform-dependent.
  3934. */
  3935. mustUseProp: no,
  3936. /**
  3937. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  3938. * This will significantly reduce performance if set to false.
  3939. */
  3940. async: true,
  3941. /**
  3942. * Exposed for legacy reasons
  3943. */
  3944. _lifecycleHooks: LIFECYCLE_HOOKS
  3945. });
  3946. /* */
  3947. /**
  3948. * unicode letters used for parsing html tags, component names and property paths.
  3949. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  3950. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  3951. */
  3952. 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/;
  3953. /**
  3954. * Check if a string starts with $ or _
  3955. */
  3956. function isReserved (str) {
  3957. var c = (str + '').charCodeAt(0);
  3958. return c === 0x24 || c === 0x5F
  3959. }
  3960. /**
  3961. * Define a property.
  3962. */
  3963. function def (obj, key, val, enumerable) {
  3964. Object.defineProperty(obj, key, {
  3965. value: val,
  3966. enumerable: !!enumerable,
  3967. writable: true,
  3968. configurable: true
  3969. });
  3970. }
  3971. /**
  3972. * Parse simple path.
  3973. */
  3974. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  3975. function parsePath (path) {
  3976. if (bailRE.test(path)) {
  3977. return
  3978. }
  3979. var segments = path.split('.');
  3980. return function (obj) {
  3981. for (var i = 0; i < segments.length; i++) {
  3982. if (!obj) { return }
  3983. obj = obj[segments[i]];
  3984. }
  3985. return obj
  3986. }
  3987. }
  3988. /* */
  3989. // can we use __proto__?
  3990. var hasProto = '__proto__' in {};
  3991. // Browser environment sniffing
  3992. var inBrowser = typeof window !== 'undefined';
  3993. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  3994. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  3995. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  3996. var isIE = UA && /msie|trident/.test(UA);
  3997. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  3998. var isEdge = UA && UA.indexOf('edge/') > 0;
  3999. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  4000. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  4001. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  4002. var isPhantomJS = UA && /phantomjs/.test(UA);
  4003. var isFF = UA && UA.match(/firefox\/(\d+)/);
  4004. // Firefox has a "watch" function on Object.prototype...
  4005. var nativeWatch = ({}).watch;
  4006. if (inBrowser) {
  4007. try {
  4008. var opts = {};
  4009. Object.defineProperty(opts, 'passive', ({
  4010. get: function get () {
  4011. }
  4012. })); // https://github.com/facebook/flow/issues/285
  4013. window.addEventListener('test-passive', null, opts);
  4014. } catch (e) {}
  4015. }
  4016. // this needs to be lazy-evaled because vue may be required before
  4017. // vue-server-renderer can set VUE_ENV
  4018. var _isServer;
  4019. var isServerRendering = function () {
  4020. if (_isServer === undefined) {
  4021. /* istanbul ignore if */
  4022. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  4023. // detect presence of vue-server-renderer and avoid
  4024. // Webpack shimming the process
  4025. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  4026. } else {
  4027. _isServer = false;
  4028. }
  4029. }
  4030. return _isServer
  4031. };
  4032. // detect devtools
  4033. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4034. /* istanbul ignore next */
  4035. function isNative (Ctor) {
  4036. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  4037. }
  4038. var hasSymbol =
  4039. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  4040. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  4041. var _Set;
  4042. /* istanbul ignore if */ // $flow-disable-line
  4043. if (typeof Set !== 'undefined' && isNative(Set)) {
  4044. // use native Set when available.
  4045. _Set = Set;
  4046. } else {
  4047. // a non-standard Set polyfill that only works with primitive keys.
  4048. _Set = /*@__PURE__*/(function () {
  4049. function Set () {
  4050. this.set = Object.create(null);
  4051. }
  4052. Set.prototype.has = function has (key) {
  4053. return this.set[key] === true
  4054. };
  4055. Set.prototype.add = function add (key) {
  4056. this.set[key] = true;
  4057. };
  4058. Set.prototype.clear = function clear () {
  4059. this.set = Object.create(null);
  4060. };
  4061. return Set;
  4062. }());
  4063. }
  4064. /* */
  4065. var warn = noop;
  4066. var tip = noop;
  4067. var generateComponentTrace = (noop); // work around flow check
  4068. var formatComponentName = (noop);
  4069. if (true) {
  4070. var hasConsole = typeof console !== 'undefined';
  4071. var classifyRE = /(?:^|[-_])(\w)/g;
  4072. var classify = function (str) { return str
  4073. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  4074. .replace(/[-_]/g, ''); };
  4075. warn = function (msg, vm) {
  4076. var trace = vm ? generateComponentTrace(vm) : '';
  4077. if (config.warnHandler) {
  4078. config.warnHandler.call(null, msg, vm, trace);
  4079. } else if (hasConsole && (!config.silent)) {
  4080. console.error(("[Vue warn]: " + msg + trace));
  4081. }
  4082. };
  4083. tip = function (msg, vm) {
  4084. if (hasConsole && (!config.silent)) {
  4085. console.warn("[Vue tip]: " + msg + (
  4086. vm ? generateComponentTrace(vm) : ''
  4087. ));
  4088. }
  4089. };
  4090. formatComponentName = function (vm, includeFile) {
  4091. if (vm.$root === vm) {
  4092. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  4093. return ('') + vm.$options.__file
  4094. }
  4095. return '<Root>'
  4096. }
  4097. var options = typeof vm === 'function' && vm.cid != null
  4098. ? vm.options
  4099. : vm._isVue
  4100. ? vm.$options || vm.constructor.options
  4101. : vm;
  4102. var name = options.name || options._componentTag;
  4103. var file = options.__file;
  4104. if (!name && file) {
  4105. var match = file.match(/([^/\\]+)\.vue$/);
  4106. name = match && match[1];
  4107. }
  4108. return (
  4109. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  4110. (file && includeFile !== false ? (" at " + file) : '')
  4111. )
  4112. };
  4113. var repeat = function (str, n) {
  4114. var res = '';
  4115. while (n) {
  4116. if (n % 2 === 1) { res += str; }
  4117. if (n > 1) { str += str; }
  4118. n >>= 1;
  4119. }
  4120. return res
  4121. };
  4122. generateComponentTrace = function (vm) {
  4123. if (vm._isVue && vm.$parent) {
  4124. var tree = [];
  4125. var currentRecursiveSequence = 0;
  4126. while (vm && vm.$options.name !== 'PageBody') {
  4127. if (tree.length > 0) {
  4128. var last = tree[tree.length - 1];
  4129. if (last.constructor === vm.constructor) {
  4130. currentRecursiveSequence++;
  4131. vm = vm.$parent;
  4132. continue
  4133. } else if (currentRecursiveSequence > 0) {
  4134. tree[tree.length - 1] = [last, currentRecursiveSequence];
  4135. currentRecursiveSequence = 0;
  4136. }
  4137. }
  4138. !vm.$options.isReserved && tree.push(vm);
  4139. vm = vm.$parent;
  4140. }
  4141. return '\n\nfound in\n\n' + tree
  4142. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  4143. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  4144. : formatComponentName(vm))); })
  4145. .join('\n')
  4146. } else {
  4147. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  4148. }
  4149. };
  4150. }
  4151. /* */
  4152. var uid = 0;
  4153. /**
  4154. * A dep is an observable that can have multiple
  4155. * directives subscribing to it.
  4156. */
  4157. var Dep = function Dep () {
  4158. this.id = uid++;
  4159. this.subs = [];
  4160. };
  4161. Dep.prototype.addSub = function addSub (sub) {
  4162. this.subs.push(sub);
  4163. };
  4164. Dep.prototype.removeSub = function removeSub (sub) {
  4165. remove(this.subs, sub);
  4166. };
  4167. Dep.prototype.depend = function depend () {
  4168. if (Dep.SharedObject.target) {
  4169. Dep.SharedObject.target.addDep(this);
  4170. }
  4171. };
  4172. Dep.prototype.notify = function notify () {
  4173. // stabilize the subscriber list first
  4174. var subs = this.subs.slice();
  4175. if ( true && !config.async) {
  4176. // subs aren't sorted in scheduler if not running async
  4177. // we need to sort them now to make sure they fire in correct
  4178. // order
  4179. subs.sort(function (a, b) { return a.id - b.id; });
  4180. }
  4181. for (var i = 0, l = subs.length; i < l; i++) {
  4182. subs[i].update();
  4183. }
  4184. };
  4185. // The current target watcher being evaluated.
  4186. // This is globally unique because only one watcher
  4187. // can be evaluated at a time.
  4188. // fixed by xxxxxx (nvue shared vuex)
  4189. /* eslint-disable no-undef */
  4190. Dep.SharedObject = {};
  4191. Dep.SharedObject.target = null;
  4192. Dep.SharedObject.targetStack = [];
  4193. function pushTarget (target) {
  4194. Dep.SharedObject.targetStack.push(target);
  4195. Dep.SharedObject.target = target;
  4196. Dep.target = target;
  4197. }
  4198. function popTarget () {
  4199. Dep.SharedObject.targetStack.pop();
  4200. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  4201. Dep.target = Dep.SharedObject.target;
  4202. }
  4203. /* */
  4204. var VNode = function VNode (
  4205. tag,
  4206. data,
  4207. children,
  4208. text,
  4209. elm,
  4210. context,
  4211. componentOptions,
  4212. asyncFactory
  4213. ) {
  4214. this.tag = tag;
  4215. this.data = data;
  4216. this.children = children;
  4217. this.text = text;
  4218. this.elm = elm;
  4219. this.ns = undefined;
  4220. this.context = context;
  4221. this.fnContext = undefined;
  4222. this.fnOptions = undefined;
  4223. this.fnScopeId = undefined;
  4224. this.key = data && data.key;
  4225. this.componentOptions = componentOptions;
  4226. this.componentInstance = undefined;
  4227. this.parent = undefined;
  4228. this.raw = false;
  4229. this.isStatic = false;
  4230. this.isRootInsert = true;
  4231. this.isComment = false;
  4232. this.isCloned = false;
  4233. this.isOnce = false;
  4234. this.asyncFactory = asyncFactory;
  4235. this.asyncMeta = undefined;
  4236. this.isAsyncPlaceholder = false;
  4237. };
  4238. var prototypeAccessors = { child: { configurable: true } };
  4239. // DEPRECATED: alias for componentInstance for backwards compat.
  4240. /* istanbul ignore next */
  4241. prototypeAccessors.child.get = function () {
  4242. return this.componentInstance
  4243. };
  4244. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4245. var createEmptyVNode = function (text) {
  4246. if ( text === void 0 ) text = '';
  4247. var node = new VNode();
  4248. node.text = text;
  4249. node.isComment = true;
  4250. return node
  4251. };
  4252. function createTextVNode (val) {
  4253. return new VNode(undefined, undefined, undefined, String(val))
  4254. }
  4255. // optimized shallow clone
  4256. // used for static nodes and slot nodes because they may be reused across
  4257. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4258. // on their elm reference.
  4259. function cloneVNode (vnode) {
  4260. var cloned = new VNode(
  4261. vnode.tag,
  4262. vnode.data,
  4263. // #7975
  4264. // clone children array to avoid mutating original in case of cloning
  4265. // a child.
  4266. vnode.children && vnode.children.slice(),
  4267. vnode.text,
  4268. vnode.elm,
  4269. vnode.context,
  4270. vnode.componentOptions,
  4271. vnode.asyncFactory
  4272. );
  4273. cloned.ns = vnode.ns;
  4274. cloned.isStatic = vnode.isStatic;
  4275. cloned.key = vnode.key;
  4276. cloned.isComment = vnode.isComment;
  4277. cloned.fnContext = vnode.fnContext;
  4278. cloned.fnOptions = vnode.fnOptions;
  4279. cloned.fnScopeId = vnode.fnScopeId;
  4280. cloned.asyncMeta = vnode.asyncMeta;
  4281. cloned.isCloned = true;
  4282. return cloned
  4283. }
  4284. /*
  4285. * not type checking this file because flow doesn't play well with
  4286. * dynamically accessing methods on Array prototype
  4287. */
  4288. var arrayProto = Array.prototype;
  4289. var arrayMethods = Object.create(arrayProto);
  4290. var methodsToPatch = [
  4291. 'push',
  4292. 'pop',
  4293. 'shift',
  4294. 'unshift',
  4295. 'splice',
  4296. 'sort',
  4297. 'reverse'
  4298. ];
  4299. /**
  4300. * Intercept mutating methods and emit events
  4301. */
  4302. methodsToPatch.forEach(function (method) {
  4303. // cache original method
  4304. var original = arrayProto[method];
  4305. def(arrayMethods, method, function mutator () {
  4306. var args = [], len = arguments.length;
  4307. while ( len-- ) args[ len ] = arguments[ len ];
  4308. var result = original.apply(this, args);
  4309. var ob = this.__ob__;
  4310. var inserted;
  4311. switch (method) {
  4312. case 'push':
  4313. case 'unshift':
  4314. inserted = args;
  4315. break
  4316. case 'splice':
  4317. inserted = args.slice(2);
  4318. break
  4319. }
  4320. if (inserted) { ob.observeArray(inserted); }
  4321. // notify change
  4322. ob.dep.notify();
  4323. return result
  4324. });
  4325. });
  4326. /* */
  4327. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4328. /**
  4329. * In some cases we may want to disable observation inside a component's
  4330. * update computation.
  4331. */
  4332. var shouldObserve = true;
  4333. function toggleObserving (value) {
  4334. shouldObserve = value;
  4335. }
  4336. /**
  4337. * Observer class that is attached to each observed
  4338. * object. Once attached, the observer converts the target
  4339. * object's property keys into getter/setters that
  4340. * collect dependencies and dispatch updates.
  4341. */
  4342. var Observer = function Observer (value) {
  4343. this.value = value;
  4344. this.dep = new Dep();
  4345. this.vmCount = 0;
  4346. def(value, '__ob__', this);
  4347. if (Array.isArray(value)) {
  4348. if (hasProto) {
  4349. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4350. if(value.push !== value.__proto__.push){
  4351. copyAugment(value, arrayMethods, arrayKeys);
  4352. } else {
  4353. protoAugment(value, arrayMethods);
  4354. }
  4355. }
  4356. } else {
  4357. copyAugment(value, arrayMethods, arrayKeys);
  4358. }
  4359. this.observeArray(value);
  4360. } else {
  4361. this.walk(value);
  4362. }
  4363. };
  4364. /**
  4365. * Walk through all properties and convert them into
  4366. * getter/setters. This method should only be called when
  4367. * value type is Object.
  4368. */
  4369. Observer.prototype.walk = function walk (obj) {
  4370. var keys = Object.keys(obj);
  4371. for (var i = 0; i < keys.length; i++) {
  4372. defineReactive$$1(obj, keys[i]);
  4373. }
  4374. };
  4375. /**
  4376. * Observe a list of Array items.
  4377. */
  4378. Observer.prototype.observeArray = function observeArray (items) {
  4379. for (var i = 0, l = items.length; i < l; i++) {
  4380. observe(items[i]);
  4381. }
  4382. };
  4383. // helpers
  4384. /**
  4385. * Augment a target Object or Array by intercepting
  4386. * the prototype chain using __proto__
  4387. */
  4388. function protoAugment (target, src) {
  4389. /* eslint-disable no-proto */
  4390. target.__proto__ = src;
  4391. /* eslint-enable no-proto */
  4392. }
  4393. /**
  4394. * Augment a target Object or Array by defining
  4395. * hidden properties.
  4396. */
  4397. /* istanbul ignore next */
  4398. function copyAugment (target, src, keys) {
  4399. for (var i = 0, l = keys.length; i < l; i++) {
  4400. var key = keys[i];
  4401. def(target, key, src[key]);
  4402. }
  4403. }
  4404. /**
  4405. * Attempt to create an observer instance for a value,
  4406. * returns the new observer if successfully observed,
  4407. * or the existing observer if the value already has one.
  4408. */
  4409. function observe (value, asRootData) {
  4410. if (!isObject(value) || value instanceof VNode) {
  4411. return
  4412. }
  4413. var ob;
  4414. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4415. ob = value.__ob__;
  4416. } else if (
  4417. shouldObserve &&
  4418. !isServerRendering() &&
  4419. (Array.isArray(value) || isPlainObject(value)) &&
  4420. Object.isExtensible(value) &&
  4421. !value._isVue
  4422. ) {
  4423. ob = new Observer(value);
  4424. }
  4425. if (asRootData && ob) {
  4426. ob.vmCount++;
  4427. }
  4428. return ob
  4429. }
  4430. /**
  4431. * Define a reactive property on an Object.
  4432. */
  4433. function defineReactive$$1 (
  4434. obj,
  4435. key,
  4436. val,
  4437. customSetter,
  4438. shallow
  4439. ) {
  4440. var dep = new Dep();
  4441. var property = Object.getOwnPropertyDescriptor(obj, key);
  4442. if (property && property.configurable === false) {
  4443. return
  4444. }
  4445. // cater for pre-defined getter/setters
  4446. var getter = property && property.get;
  4447. var setter = property && property.set;
  4448. if ((!getter || setter) && arguments.length === 2) {
  4449. val = obj[key];
  4450. }
  4451. var childOb = !shallow && observe(val);
  4452. Object.defineProperty(obj, key, {
  4453. enumerable: true,
  4454. configurable: true,
  4455. get: function reactiveGetter () {
  4456. var value = getter ? getter.call(obj) : val;
  4457. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4458. dep.depend();
  4459. if (childOb) {
  4460. childOb.dep.depend();
  4461. if (Array.isArray(value)) {
  4462. dependArray(value);
  4463. }
  4464. }
  4465. }
  4466. return value
  4467. },
  4468. set: function reactiveSetter (newVal) {
  4469. var value = getter ? getter.call(obj) : val;
  4470. /* eslint-disable no-self-compare */
  4471. if (newVal === value || (newVal !== newVal && value !== value)) {
  4472. return
  4473. }
  4474. /* eslint-enable no-self-compare */
  4475. if ( true && customSetter) {
  4476. customSetter();
  4477. }
  4478. // #7981: for accessor properties without setter
  4479. if (getter && !setter) { return }
  4480. if (setter) {
  4481. setter.call(obj, newVal);
  4482. } else {
  4483. val = newVal;
  4484. }
  4485. childOb = !shallow && observe(newVal);
  4486. dep.notify();
  4487. }
  4488. });
  4489. }
  4490. /**
  4491. * Set a property on an object. Adds the new property and
  4492. * triggers change notification if the property doesn't
  4493. * already exist.
  4494. */
  4495. function set (target, key, val) {
  4496. if ( true &&
  4497. (isUndef(target) || isPrimitive(target))
  4498. ) {
  4499. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4500. }
  4501. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4502. target.length = Math.max(target.length, key);
  4503. target.splice(key, 1, val);
  4504. return val
  4505. }
  4506. if (key in target && !(key in Object.prototype)) {
  4507. target[key] = val;
  4508. return val
  4509. }
  4510. var ob = (target).__ob__;
  4511. if (target._isVue || (ob && ob.vmCount)) {
  4512. true && warn(
  4513. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4514. 'at runtime - declare it upfront in the data option.'
  4515. );
  4516. return val
  4517. }
  4518. if (!ob) {
  4519. target[key] = val;
  4520. return val
  4521. }
  4522. defineReactive$$1(ob.value, key, val);
  4523. ob.dep.notify();
  4524. return val
  4525. }
  4526. /**
  4527. * Delete a property and trigger change if necessary.
  4528. */
  4529. function del (target, key) {
  4530. if ( true &&
  4531. (isUndef(target) || isPrimitive(target))
  4532. ) {
  4533. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4534. }
  4535. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4536. target.splice(key, 1);
  4537. return
  4538. }
  4539. var ob = (target).__ob__;
  4540. if (target._isVue || (ob && ob.vmCount)) {
  4541. true && warn(
  4542. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4543. '- just set it to null.'
  4544. );
  4545. return
  4546. }
  4547. if (!hasOwn(target, key)) {
  4548. return
  4549. }
  4550. delete target[key];
  4551. if (!ob) {
  4552. return
  4553. }
  4554. ob.dep.notify();
  4555. }
  4556. /**
  4557. * Collect dependencies on array elements when the array is touched, since
  4558. * we cannot intercept array element access like property getters.
  4559. */
  4560. function dependArray (value) {
  4561. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4562. e = value[i];
  4563. e && e.__ob__ && e.__ob__.dep.depend();
  4564. if (Array.isArray(e)) {
  4565. dependArray(e);
  4566. }
  4567. }
  4568. }
  4569. /* */
  4570. /**
  4571. * Option overwriting strategies are functions that handle
  4572. * how to merge a parent option value and a child option
  4573. * value into the final value.
  4574. */
  4575. var strats = config.optionMergeStrategies;
  4576. /**
  4577. * Options with restrictions
  4578. */
  4579. if (true) {
  4580. strats.el = strats.propsData = function (parent, child, vm, key) {
  4581. if (!vm) {
  4582. warn(
  4583. "option \"" + key + "\" can only be used during instance " +
  4584. 'creation with the `new` keyword.'
  4585. );
  4586. }
  4587. return defaultStrat(parent, child)
  4588. };
  4589. }
  4590. /**
  4591. * Helper that recursively merges two data objects together.
  4592. */
  4593. function mergeData (to, from) {
  4594. if (!from) { return to }
  4595. var key, toVal, fromVal;
  4596. var keys = hasSymbol
  4597. ? Reflect.ownKeys(from)
  4598. : Object.keys(from);
  4599. for (var i = 0; i < keys.length; i++) {
  4600. key = keys[i];
  4601. // in case the object is already observed...
  4602. if (key === '__ob__') { continue }
  4603. toVal = to[key];
  4604. fromVal = from[key];
  4605. if (!hasOwn(to, key)) {
  4606. set(to, key, fromVal);
  4607. } else if (
  4608. toVal !== fromVal &&
  4609. isPlainObject(toVal) &&
  4610. isPlainObject(fromVal)
  4611. ) {
  4612. mergeData(toVal, fromVal);
  4613. }
  4614. }
  4615. return to
  4616. }
  4617. /**
  4618. * Data
  4619. */
  4620. function mergeDataOrFn (
  4621. parentVal,
  4622. childVal,
  4623. vm
  4624. ) {
  4625. if (!vm) {
  4626. // in a Vue.extend merge, both should be functions
  4627. if (!childVal) {
  4628. return parentVal
  4629. }
  4630. if (!parentVal) {
  4631. return childVal
  4632. }
  4633. // when parentVal & childVal are both present,
  4634. // we need to return a function that returns the
  4635. // merged result of both functions... no need to
  4636. // check if parentVal is a function here because
  4637. // it has to be a function to pass previous merges.
  4638. return function mergedDataFn () {
  4639. return mergeData(
  4640. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  4641. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  4642. )
  4643. }
  4644. } else {
  4645. return function mergedInstanceDataFn () {
  4646. // instance merge
  4647. var instanceData = typeof childVal === 'function'
  4648. ? childVal.call(vm, vm)
  4649. : childVal;
  4650. var defaultData = typeof parentVal === 'function'
  4651. ? parentVal.call(vm, vm)
  4652. : parentVal;
  4653. if (instanceData) {
  4654. return mergeData(instanceData, defaultData)
  4655. } else {
  4656. return defaultData
  4657. }
  4658. }
  4659. }
  4660. }
  4661. strats.data = function (
  4662. parentVal,
  4663. childVal,
  4664. vm
  4665. ) {
  4666. if (!vm) {
  4667. if (childVal && typeof childVal !== 'function') {
  4668. true && warn(
  4669. 'The "data" option should be a function ' +
  4670. 'that returns a per-instance value in component ' +
  4671. 'definitions.',
  4672. vm
  4673. );
  4674. return parentVal
  4675. }
  4676. return mergeDataOrFn(parentVal, childVal)
  4677. }
  4678. return mergeDataOrFn(parentVal, childVal, vm)
  4679. };
  4680. /**
  4681. * Hooks and props are merged as arrays.
  4682. */
  4683. function mergeHook (
  4684. parentVal,
  4685. childVal
  4686. ) {
  4687. var res = childVal
  4688. ? parentVal
  4689. ? parentVal.concat(childVal)
  4690. : Array.isArray(childVal)
  4691. ? childVal
  4692. : [childVal]
  4693. : parentVal;
  4694. return res
  4695. ? dedupeHooks(res)
  4696. : res
  4697. }
  4698. function dedupeHooks (hooks) {
  4699. var res = [];
  4700. for (var i = 0; i < hooks.length; i++) {
  4701. if (res.indexOf(hooks[i]) === -1) {
  4702. res.push(hooks[i]);
  4703. }
  4704. }
  4705. return res
  4706. }
  4707. LIFECYCLE_HOOKS.forEach(function (hook) {
  4708. strats[hook] = mergeHook;
  4709. });
  4710. /**
  4711. * Assets
  4712. *
  4713. * When a vm is present (instance creation), we need to do
  4714. * a three-way merge between constructor options, instance
  4715. * options and parent options.
  4716. */
  4717. function mergeAssets (
  4718. parentVal,
  4719. childVal,
  4720. vm,
  4721. key
  4722. ) {
  4723. var res = Object.create(parentVal || null);
  4724. if (childVal) {
  4725. true && assertObjectType(key, childVal, vm);
  4726. return extend(res, childVal)
  4727. } else {
  4728. return res
  4729. }
  4730. }
  4731. ASSET_TYPES.forEach(function (type) {
  4732. strats[type + 's'] = mergeAssets;
  4733. });
  4734. /**
  4735. * Watchers.
  4736. *
  4737. * Watchers hashes should not overwrite one
  4738. * another, so we merge them as arrays.
  4739. */
  4740. strats.watch = function (
  4741. parentVal,
  4742. childVal,
  4743. vm,
  4744. key
  4745. ) {
  4746. // work around Firefox's Object.prototype.watch...
  4747. if (parentVal === nativeWatch) { parentVal = undefined; }
  4748. if (childVal === nativeWatch) { childVal = undefined; }
  4749. /* istanbul ignore if */
  4750. if (!childVal) { return Object.create(parentVal || null) }
  4751. if (true) {
  4752. assertObjectType(key, childVal, vm);
  4753. }
  4754. if (!parentVal) { return childVal }
  4755. var ret = {};
  4756. extend(ret, parentVal);
  4757. for (var key$1 in childVal) {
  4758. var parent = ret[key$1];
  4759. var child = childVal[key$1];
  4760. if (parent && !Array.isArray(parent)) {
  4761. parent = [parent];
  4762. }
  4763. ret[key$1] = parent
  4764. ? parent.concat(child)
  4765. : Array.isArray(child) ? child : [child];
  4766. }
  4767. return ret
  4768. };
  4769. /**
  4770. * Other object hashes.
  4771. */
  4772. strats.props =
  4773. strats.methods =
  4774. strats.inject =
  4775. strats.computed = function (
  4776. parentVal,
  4777. childVal,
  4778. vm,
  4779. key
  4780. ) {
  4781. if (childVal && "development" !== 'production') {
  4782. assertObjectType(key, childVal, vm);
  4783. }
  4784. if (!parentVal) { return childVal }
  4785. var ret = Object.create(null);
  4786. extend(ret, parentVal);
  4787. if (childVal) { extend(ret, childVal); }
  4788. return ret
  4789. };
  4790. strats.provide = mergeDataOrFn;
  4791. /**
  4792. * Default strategy.
  4793. */
  4794. var defaultStrat = function (parentVal, childVal) {
  4795. return childVal === undefined
  4796. ? parentVal
  4797. : childVal
  4798. };
  4799. /**
  4800. * Validate component names
  4801. */
  4802. function checkComponents (options) {
  4803. for (var key in options.components) {
  4804. validateComponentName(key);
  4805. }
  4806. }
  4807. function validateComponentName (name) {
  4808. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  4809. warn(
  4810. 'Invalid component name: "' + name + '". Component names ' +
  4811. 'should conform to valid custom element name in html5 specification.'
  4812. );
  4813. }
  4814. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  4815. warn(
  4816. 'Do not use built-in or reserved HTML elements as component ' +
  4817. 'id: ' + name
  4818. );
  4819. }
  4820. }
  4821. /**
  4822. * Ensure all props option syntax are normalized into the
  4823. * Object-based format.
  4824. */
  4825. function normalizeProps (options, vm) {
  4826. var props = options.props;
  4827. if (!props) { return }
  4828. var res = {};
  4829. var i, val, name;
  4830. if (Array.isArray(props)) {
  4831. i = props.length;
  4832. while (i--) {
  4833. val = props[i];
  4834. if (typeof val === 'string') {
  4835. name = camelize(val);
  4836. res[name] = { type: null };
  4837. } else if (true) {
  4838. warn('props must be strings when using array syntax.');
  4839. }
  4840. }
  4841. } else if (isPlainObject(props)) {
  4842. for (var key in props) {
  4843. val = props[key];
  4844. name = camelize(key);
  4845. res[name] = isPlainObject(val)
  4846. ? val
  4847. : { type: val };
  4848. }
  4849. } else if (true) {
  4850. warn(
  4851. "Invalid value for option \"props\": expected an Array or an Object, " +
  4852. "but got " + (toRawType(props)) + ".",
  4853. vm
  4854. );
  4855. }
  4856. options.props = res;
  4857. }
  4858. /**
  4859. * Normalize all injections into Object-based format
  4860. */
  4861. function normalizeInject (options, vm) {
  4862. var inject = options.inject;
  4863. if (!inject) { return }
  4864. var normalized = options.inject = {};
  4865. if (Array.isArray(inject)) {
  4866. for (var i = 0; i < inject.length; i++) {
  4867. normalized[inject[i]] = { from: inject[i] };
  4868. }
  4869. } else if (isPlainObject(inject)) {
  4870. for (var key in inject) {
  4871. var val = inject[key];
  4872. normalized[key] = isPlainObject(val)
  4873. ? extend({ from: key }, val)
  4874. : { from: val };
  4875. }
  4876. } else if (true) {
  4877. warn(
  4878. "Invalid value for option \"inject\": expected an Array or an Object, " +
  4879. "but got " + (toRawType(inject)) + ".",
  4880. vm
  4881. );
  4882. }
  4883. }
  4884. /**
  4885. * Normalize raw function directives into object format.
  4886. */
  4887. function normalizeDirectives (options) {
  4888. var dirs = options.directives;
  4889. if (dirs) {
  4890. for (var key in dirs) {
  4891. var def$$1 = dirs[key];
  4892. if (typeof def$$1 === 'function') {
  4893. dirs[key] = { bind: def$$1, update: def$$1 };
  4894. }
  4895. }
  4896. }
  4897. }
  4898. function assertObjectType (name, value, vm) {
  4899. if (!isPlainObject(value)) {
  4900. warn(
  4901. "Invalid value for option \"" + name + "\": expected an Object, " +
  4902. "but got " + (toRawType(value)) + ".",
  4903. vm
  4904. );
  4905. }
  4906. }
  4907. /**
  4908. * Merge two option objects into a new one.
  4909. * Core utility used in both instantiation and inheritance.
  4910. */
  4911. function mergeOptions (
  4912. parent,
  4913. child,
  4914. vm
  4915. ) {
  4916. if (true) {
  4917. checkComponents(child);
  4918. }
  4919. if (typeof child === 'function') {
  4920. child = child.options;
  4921. }
  4922. normalizeProps(child, vm);
  4923. normalizeInject(child, vm);
  4924. normalizeDirectives(child);
  4925. // Apply extends and mixins on the child options,
  4926. // but only if it is a raw options object that isn't
  4927. // the result of another mergeOptions call.
  4928. // Only merged options has the _base property.
  4929. if (!child._base) {
  4930. if (child.extends) {
  4931. parent = mergeOptions(parent, child.extends, vm);
  4932. }
  4933. if (child.mixins) {
  4934. for (var i = 0, l = child.mixins.length; i < l; i++) {
  4935. parent = mergeOptions(parent, child.mixins[i], vm);
  4936. }
  4937. }
  4938. }
  4939. var options = {};
  4940. var key;
  4941. for (key in parent) {
  4942. mergeField(key);
  4943. }
  4944. for (key in child) {
  4945. if (!hasOwn(parent, key)) {
  4946. mergeField(key);
  4947. }
  4948. }
  4949. function mergeField (key) {
  4950. var strat = strats[key] || defaultStrat;
  4951. options[key] = strat(parent[key], child[key], vm, key);
  4952. }
  4953. return options
  4954. }
  4955. /**
  4956. * Resolve an asset.
  4957. * This function is used because child instances need access
  4958. * to assets defined in its ancestor chain.
  4959. */
  4960. function resolveAsset (
  4961. options,
  4962. type,
  4963. id,
  4964. warnMissing
  4965. ) {
  4966. /* istanbul ignore if */
  4967. if (typeof id !== 'string') {
  4968. return
  4969. }
  4970. var assets = options[type];
  4971. // check local registration variations first
  4972. if (hasOwn(assets, id)) { return assets[id] }
  4973. var camelizedId = camelize(id);
  4974. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  4975. var PascalCaseId = capitalize(camelizedId);
  4976. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  4977. // fallback to prototype chain
  4978. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  4979. if ( true && warnMissing && !res) {
  4980. warn(
  4981. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  4982. options
  4983. );
  4984. }
  4985. return res
  4986. }
  4987. /* */
  4988. function validateProp (
  4989. key,
  4990. propOptions,
  4991. propsData,
  4992. vm
  4993. ) {
  4994. var prop = propOptions[key];
  4995. var absent = !hasOwn(propsData, key);
  4996. var value = propsData[key];
  4997. // boolean casting
  4998. var booleanIndex = getTypeIndex(Boolean, prop.type);
  4999. if (booleanIndex > -1) {
  5000. if (absent && !hasOwn(prop, 'default')) {
  5001. value = false;
  5002. } else if (value === '' || value === hyphenate(key)) {
  5003. // only cast empty string / same name to boolean if
  5004. // boolean has higher priority
  5005. var stringIndex = getTypeIndex(String, prop.type);
  5006. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5007. value = true;
  5008. }
  5009. }
  5010. }
  5011. // check default value
  5012. if (value === undefined) {
  5013. value = getPropDefaultValue(vm, prop, key);
  5014. // since the default value is a fresh copy,
  5015. // make sure to observe it.
  5016. var prevShouldObserve = shouldObserve;
  5017. toggleObserving(true);
  5018. observe(value);
  5019. toggleObserving(prevShouldObserve);
  5020. }
  5021. if (
  5022. true
  5023. ) {
  5024. assertProp(prop, key, value, vm, absent);
  5025. }
  5026. return value
  5027. }
  5028. /**
  5029. * Get the default value of a prop.
  5030. */
  5031. function getPropDefaultValue (vm, prop, key) {
  5032. // no default, return undefined
  5033. if (!hasOwn(prop, 'default')) {
  5034. return undefined
  5035. }
  5036. var def = prop.default;
  5037. // warn against non-factory defaults for Object & Array
  5038. if ( true && isObject(def)) {
  5039. warn(
  5040. 'Invalid default value for prop "' + key + '": ' +
  5041. 'Props with type Object/Array must use a factory function ' +
  5042. 'to return the default value.',
  5043. vm
  5044. );
  5045. }
  5046. // the raw prop value was also undefined from previous render,
  5047. // return previous default value to avoid unnecessary watcher trigger
  5048. if (vm && vm.$options.propsData &&
  5049. vm.$options.propsData[key] === undefined &&
  5050. vm._props[key] !== undefined
  5051. ) {
  5052. return vm._props[key]
  5053. }
  5054. // call factory function for non-Function types
  5055. // a value is Function if its prototype is function even across different execution context
  5056. return typeof def === 'function' && getType(prop.type) !== 'Function'
  5057. ? def.call(vm)
  5058. : def
  5059. }
  5060. /**
  5061. * Assert whether a prop is valid.
  5062. */
  5063. function assertProp (
  5064. prop,
  5065. name,
  5066. value,
  5067. vm,
  5068. absent
  5069. ) {
  5070. if (prop.required && absent) {
  5071. warn(
  5072. 'Missing required prop: "' + name + '"',
  5073. vm
  5074. );
  5075. return
  5076. }
  5077. if (value == null && !prop.required) {
  5078. return
  5079. }
  5080. var type = prop.type;
  5081. var valid = !type || type === true;
  5082. var expectedTypes = [];
  5083. if (type) {
  5084. if (!Array.isArray(type)) {
  5085. type = [type];
  5086. }
  5087. for (var i = 0; i < type.length && !valid; i++) {
  5088. var assertedType = assertType(value, type[i]);
  5089. expectedTypes.push(assertedType.expectedType || '');
  5090. valid = assertedType.valid;
  5091. }
  5092. }
  5093. if (!valid) {
  5094. warn(
  5095. getInvalidTypeMessage(name, value, expectedTypes),
  5096. vm
  5097. );
  5098. return
  5099. }
  5100. var validator = prop.validator;
  5101. if (validator) {
  5102. if (!validator(value)) {
  5103. warn(
  5104. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  5105. vm
  5106. );
  5107. }
  5108. }
  5109. }
  5110. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  5111. function assertType (value, type) {
  5112. var valid;
  5113. var expectedType = getType(type);
  5114. if (simpleCheckRE.test(expectedType)) {
  5115. var t = typeof value;
  5116. valid = t === expectedType.toLowerCase();
  5117. // for primitive wrapper objects
  5118. if (!valid && t === 'object') {
  5119. valid = value instanceof type;
  5120. }
  5121. } else if (expectedType === 'Object') {
  5122. valid = isPlainObject(value);
  5123. } else if (expectedType === 'Array') {
  5124. valid = Array.isArray(value);
  5125. } else {
  5126. valid = value instanceof type;
  5127. }
  5128. return {
  5129. valid: valid,
  5130. expectedType: expectedType
  5131. }
  5132. }
  5133. /**
  5134. * Use function string name to check built-in types,
  5135. * because a simple equality check will fail when running
  5136. * across different vms / iframes.
  5137. */
  5138. function getType (fn) {
  5139. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  5140. return match ? match[1] : ''
  5141. }
  5142. function isSameType (a, b) {
  5143. return getType(a) === getType(b)
  5144. }
  5145. function getTypeIndex (type, expectedTypes) {
  5146. if (!Array.isArray(expectedTypes)) {
  5147. return isSameType(expectedTypes, type) ? 0 : -1
  5148. }
  5149. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  5150. if (isSameType(expectedTypes[i], type)) {
  5151. return i
  5152. }
  5153. }
  5154. return -1
  5155. }
  5156. function getInvalidTypeMessage (name, value, expectedTypes) {
  5157. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  5158. " Expected " + (expectedTypes.map(capitalize).join(', '));
  5159. var expectedType = expectedTypes[0];
  5160. var receivedType = toRawType(value);
  5161. var expectedValue = styleValue(value, expectedType);
  5162. var receivedValue = styleValue(value, receivedType);
  5163. // check if we need to specify expected value
  5164. if (expectedTypes.length === 1 &&
  5165. isExplicable(expectedType) &&
  5166. !isBoolean(expectedType, receivedType)) {
  5167. message += " with value " + expectedValue;
  5168. }
  5169. message += ", got " + receivedType + " ";
  5170. // check if we need to specify received value
  5171. if (isExplicable(receivedType)) {
  5172. message += "with value " + receivedValue + ".";
  5173. }
  5174. return message
  5175. }
  5176. function styleValue (value, type) {
  5177. if (type === 'String') {
  5178. return ("\"" + value + "\"")
  5179. } else if (type === 'Number') {
  5180. return ("" + (Number(value)))
  5181. } else {
  5182. return ("" + value)
  5183. }
  5184. }
  5185. function isExplicable (value) {
  5186. var explicitTypes = ['string', 'number', 'boolean'];
  5187. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  5188. }
  5189. function isBoolean () {
  5190. var args = [], len = arguments.length;
  5191. while ( len-- ) args[ len ] = arguments[ len ];
  5192. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  5193. }
  5194. /* */
  5195. function handleError (err, vm, info) {
  5196. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  5197. // See: https://github.com/vuejs/vuex/issues/1505
  5198. pushTarget();
  5199. try {
  5200. if (vm) {
  5201. var cur = vm;
  5202. while ((cur = cur.$parent)) {
  5203. var hooks = cur.$options.errorCaptured;
  5204. if (hooks) {
  5205. for (var i = 0; i < hooks.length; i++) {
  5206. try {
  5207. var capture = hooks[i].call(cur, err, vm, info) === false;
  5208. if (capture) { return }
  5209. } catch (e) {
  5210. globalHandleError(e, cur, 'errorCaptured hook');
  5211. }
  5212. }
  5213. }
  5214. }
  5215. }
  5216. globalHandleError(err, vm, info);
  5217. } finally {
  5218. popTarget();
  5219. }
  5220. }
  5221. function invokeWithErrorHandling (
  5222. handler,
  5223. context,
  5224. args,
  5225. vm,
  5226. info
  5227. ) {
  5228. var res;
  5229. try {
  5230. res = args ? handler.apply(context, args) : handler.call(context);
  5231. if (res && !res._isVue && isPromise(res) && !res._handled) {
  5232. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  5233. // issue #9511
  5234. // avoid catch triggering multiple times when nested calls
  5235. res._handled = true;
  5236. }
  5237. } catch (e) {
  5238. handleError(e, vm, info);
  5239. }
  5240. return res
  5241. }
  5242. function globalHandleError (err, vm, info) {
  5243. if (config.errorHandler) {
  5244. try {
  5245. return config.errorHandler.call(null, err, vm, info)
  5246. } catch (e) {
  5247. // if the user intentionally throws the original error in the handler,
  5248. // do not log it twice
  5249. if (e !== err) {
  5250. logError(e, null, 'config.errorHandler');
  5251. }
  5252. }
  5253. }
  5254. logError(err, vm, info);
  5255. }
  5256. function logError (err, vm, info) {
  5257. if (true) {
  5258. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5259. }
  5260. /* istanbul ignore else */
  5261. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5262. console.error(err);
  5263. } else {
  5264. throw err
  5265. }
  5266. }
  5267. /* */
  5268. var callbacks = [];
  5269. var pending = false;
  5270. function flushCallbacks () {
  5271. pending = false;
  5272. var copies = callbacks.slice(0);
  5273. callbacks.length = 0;
  5274. for (var i = 0; i < copies.length; i++) {
  5275. copies[i]();
  5276. }
  5277. }
  5278. // Here we have async deferring wrappers using microtasks.
  5279. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5280. // However, it has subtle problems when state is changed right before repaint
  5281. // (e.g. #6813, out-in transitions).
  5282. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5283. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5284. // So we now use microtasks everywhere, again.
  5285. // A major drawback of this tradeoff is that there are some scenarios
  5286. // where microtasks have too high a priority and fire in between supposedly
  5287. // sequential events (e.g. #4521, #6690, which have workarounds)
  5288. // or even between bubbling of the same event (#6566).
  5289. var timerFunc;
  5290. // The nextTick behavior leverages the microtask queue, which can be accessed
  5291. // via either native Promise.then or MutationObserver.
  5292. // MutationObserver has wider support, however it is seriously bugged in
  5293. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5294. // completely stops working after triggering a few times... so, if native
  5295. // Promise is available, we will use it:
  5296. /* istanbul ignore next, $flow-disable-line */
  5297. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5298. var p = Promise.resolve();
  5299. timerFunc = function () {
  5300. p.then(flushCallbacks);
  5301. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5302. // it can get stuck in a weird state where callbacks are pushed into the
  5303. // microtask queue but the queue isn't being flushed, until the browser
  5304. // needs to do some other work, e.g. handle a timer. Therefore we can
  5305. // "force" the microtask queue to be flushed by adding an empty timer.
  5306. if (isIOS) { setTimeout(noop); }
  5307. };
  5308. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5309. isNative(MutationObserver) ||
  5310. // PhantomJS and iOS 7.x
  5311. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5312. )) {
  5313. // Use MutationObserver where native Promise is not available,
  5314. // e.g. PhantomJS, iOS7, Android 4.4
  5315. // (#6466 MutationObserver is unreliable in IE11)
  5316. var counter = 1;
  5317. var observer = new MutationObserver(flushCallbacks);
  5318. var textNode = document.createTextNode(String(counter));
  5319. observer.observe(textNode, {
  5320. characterData: true
  5321. });
  5322. timerFunc = function () {
  5323. counter = (counter + 1) % 2;
  5324. textNode.data = String(counter);
  5325. };
  5326. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5327. // Fallback to setImmediate.
  5328. // Technically it leverages the (macro) task queue,
  5329. // but it is still a better choice than setTimeout.
  5330. timerFunc = function () {
  5331. setImmediate(flushCallbacks);
  5332. };
  5333. } else {
  5334. // Fallback to setTimeout.
  5335. timerFunc = function () {
  5336. setTimeout(flushCallbacks, 0);
  5337. };
  5338. }
  5339. function nextTick (cb, ctx) {
  5340. var _resolve;
  5341. callbacks.push(function () {
  5342. if (cb) {
  5343. try {
  5344. cb.call(ctx);
  5345. } catch (e) {
  5346. handleError(e, ctx, 'nextTick');
  5347. }
  5348. } else if (_resolve) {
  5349. _resolve(ctx);
  5350. }
  5351. });
  5352. if (!pending) {
  5353. pending = true;
  5354. timerFunc();
  5355. }
  5356. // $flow-disable-line
  5357. if (!cb && typeof Promise !== 'undefined') {
  5358. return new Promise(function (resolve) {
  5359. _resolve = resolve;
  5360. })
  5361. }
  5362. }
  5363. /* */
  5364. /* not type checking this file because flow doesn't play well with Proxy */
  5365. var initProxy;
  5366. if (true) {
  5367. var allowedGlobals = makeMap(
  5368. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5369. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5370. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5371. 'require' // for Webpack/Browserify
  5372. );
  5373. var warnNonPresent = function (target, key) {
  5374. warn(
  5375. "Property or method \"" + key + "\" is not defined on the instance but " +
  5376. 'referenced during render. Make sure that this property is reactive, ' +
  5377. 'either in the data option, or for class-based components, by ' +
  5378. 'initializing the property. ' +
  5379. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5380. target
  5381. );
  5382. };
  5383. var warnReservedPrefix = function (target, key) {
  5384. warn(
  5385. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5386. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5387. 'prevent conflicts with Vue internals. ' +
  5388. 'See: https://vuejs.org/v2/api/#data',
  5389. target
  5390. );
  5391. };
  5392. var hasProxy =
  5393. typeof Proxy !== 'undefined' && isNative(Proxy);
  5394. if (hasProxy) {
  5395. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5396. config.keyCodes = new Proxy(config.keyCodes, {
  5397. set: function set (target, key, value) {
  5398. if (isBuiltInModifier(key)) {
  5399. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5400. return false
  5401. } else {
  5402. target[key] = value;
  5403. return true
  5404. }
  5405. }
  5406. });
  5407. }
  5408. var hasHandler = {
  5409. has: function has (target, key) {
  5410. var has = key in target;
  5411. var isAllowed = allowedGlobals(key) ||
  5412. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5413. if (!has && !isAllowed) {
  5414. if (key in target.$data) { warnReservedPrefix(target, key); }
  5415. else { warnNonPresent(target, key); }
  5416. }
  5417. return has || !isAllowed
  5418. }
  5419. };
  5420. var getHandler = {
  5421. get: function get (target, key) {
  5422. if (typeof key === 'string' && !(key in target)) {
  5423. if (key in target.$data) { warnReservedPrefix(target, key); }
  5424. else { warnNonPresent(target, key); }
  5425. }
  5426. return target[key]
  5427. }
  5428. };
  5429. initProxy = function initProxy (vm) {
  5430. if (hasProxy) {
  5431. // determine which proxy handler to use
  5432. var options = vm.$options;
  5433. var handlers = options.render && options.render._withStripped
  5434. ? getHandler
  5435. : hasHandler;
  5436. vm._renderProxy = new Proxy(vm, handlers);
  5437. } else {
  5438. vm._renderProxy = vm;
  5439. }
  5440. };
  5441. }
  5442. /* */
  5443. var seenObjects = new _Set();
  5444. /**
  5445. * Recursively traverse an object to evoke all converted
  5446. * getters, so that every nested property inside the object
  5447. * is collected as a "deep" dependency.
  5448. */
  5449. function traverse (val) {
  5450. _traverse(val, seenObjects);
  5451. seenObjects.clear();
  5452. }
  5453. function _traverse (val, seen) {
  5454. var i, keys;
  5455. var isA = Array.isArray(val);
  5456. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5457. return
  5458. }
  5459. if (val.__ob__) {
  5460. var depId = val.__ob__.dep.id;
  5461. if (seen.has(depId)) {
  5462. return
  5463. }
  5464. seen.add(depId);
  5465. }
  5466. if (isA) {
  5467. i = val.length;
  5468. while (i--) { _traverse(val[i], seen); }
  5469. } else {
  5470. keys = Object.keys(val);
  5471. i = keys.length;
  5472. while (i--) { _traverse(val[keys[i]], seen); }
  5473. }
  5474. }
  5475. var mark;
  5476. var measure;
  5477. if (true) {
  5478. var perf = inBrowser && window.performance;
  5479. /* istanbul ignore if */
  5480. if (
  5481. perf &&
  5482. perf.mark &&
  5483. perf.measure &&
  5484. perf.clearMarks &&
  5485. perf.clearMeasures
  5486. ) {
  5487. mark = function (tag) { return perf.mark(tag); };
  5488. measure = function (name, startTag, endTag) {
  5489. perf.measure(name, startTag, endTag);
  5490. perf.clearMarks(startTag);
  5491. perf.clearMarks(endTag);
  5492. // perf.clearMeasures(name)
  5493. };
  5494. }
  5495. }
  5496. /* */
  5497. var normalizeEvent = cached(function (name) {
  5498. var passive = name.charAt(0) === '&';
  5499. name = passive ? name.slice(1) : name;
  5500. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5501. name = once$$1 ? name.slice(1) : name;
  5502. var capture = name.charAt(0) === '!';
  5503. name = capture ? name.slice(1) : name;
  5504. return {
  5505. name: name,
  5506. once: once$$1,
  5507. capture: capture,
  5508. passive: passive
  5509. }
  5510. });
  5511. function createFnInvoker (fns, vm) {
  5512. function invoker () {
  5513. var arguments$1 = arguments;
  5514. var fns = invoker.fns;
  5515. if (Array.isArray(fns)) {
  5516. var cloned = fns.slice();
  5517. for (var i = 0; i < cloned.length; i++) {
  5518. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5519. }
  5520. } else {
  5521. // return handler return value for single handlers
  5522. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5523. }
  5524. }
  5525. invoker.fns = fns;
  5526. return invoker
  5527. }
  5528. function updateListeners (
  5529. on,
  5530. oldOn,
  5531. add,
  5532. remove$$1,
  5533. createOnceHandler,
  5534. vm
  5535. ) {
  5536. var name, def$$1, cur, old, event;
  5537. for (name in on) {
  5538. def$$1 = cur = on[name];
  5539. old = oldOn[name];
  5540. event = normalizeEvent(name);
  5541. if (isUndef(cur)) {
  5542. true && warn(
  5543. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5544. vm
  5545. );
  5546. } else if (isUndef(old)) {
  5547. if (isUndef(cur.fns)) {
  5548. cur = on[name] = createFnInvoker(cur, vm);
  5549. }
  5550. if (isTrue(event.once)) {
  5551. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5552. }
  5553. add(event.name, cur, event.capture, event.passive, event.params);
  5554. } else if (cur !== old) {
  5555. old.fns = cur;
  5556. on[name] = old;
  5557. }
  5558. }
  5559. for (name in oldOn) {
  5560. if (isUndef(on[name])) {
  5561. event = normalizeEvent(name);
  5562. remove$$1(event.name, oldOn[name], event.capture);
  5563. }
  5564. }
  5565. }
  5566. /* */
  5567. /* */
  5568. // fixed by xxxxxx (mp properties)
  5569. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5570. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5571. if (isUndef(propOptions)) {
  5572. return res
  5573. }
  5574. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5575. var attrs = data.attrs;
  5576. var props = data.props;
  5577. if (isDef(attrs) || isDef(props)) {
  5578. for (var key in propOptions) {
  5579. var altKey = hyphenate(key);
  5580. var result = checkProp(res, props, key, altKey, true) ||
  5581. checkProp(res, attrs, key, altKey, false);
  5582. // externalClass
  5583. if (
  5584. result &&
  5585. res[key] &&
  5586. externalClasses.indexOf(altKey) !== -1 &&
  5587. context[camelize(res[key])]
  5588. ) {
  5589. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5590. res[key] = context[camelize(res[key])];
  5591. }
  5592. }
  5593. }
  5594. return res
  5595. }
  5596. function extractPropsFromVNodeData (
  5597. data,
  5598. Ctor,
  5599. tag,
  5600. context// fixed by xxxxxx
  5601. ) {
  5602. // we are only extracting raw values here.
  5603. // validation and default values are handled in the child
  5604. // component itself.
  5605. var propOptions = Ctor.options.props;
  5606. if (isUndef(propOptions)) {
  5607. // fixed by xxxxxx
  5608. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5609. }
  5610. var res = {};
  5611. var attrs = data.attrs;
  5612. var props = data.props;
  5613. if (isDef(attrs) || isDef(props)) {
  5614. for (var key in propOptions) {
  5615. var altKey = hyphenate(key);
  5616. if (true) {
  5617. var keyInLowerCase = key.toLowerCase();
  5618. if (
  5619. key !== keyInLowerCase &&
  5620. attrs && hasOwn(attrs, keyInLowerCase)
  5621. ) {
  5622. tip(
  5623. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  5624. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  5625. " \"" + key + "\". " +
  5626. "Note that HTML attributes are case-insensitive and camelCased " +
  5627. "props need to use their kebab-case equivalents when using in-DOM " +
  5628. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  5629. );
  5630. }
  5631. }
  5632. checkProp(res, props, key, altKey, true) ||
  5633. checkProp(res, attrs, key, altKey, false);
  5634. }
  5635. }
  5636. // fixed by xxxxxx
  5637. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  5638. }
  5639. function checkProp (
  5640. res,
  5641. hash,
  5642. key,
  5643. altKey,
  5644. preserve
  5645. ) {
  5646. if (isDef(hash)) {
  5647. if (hasOwn(hash, key)) {
  5648. res[key] = hash[key];
  5649. if (!preserve) {
  5650. delete hash[key];
  5651. }
  5652. return true
  5653. } else if (hasOwn(hash, altKey)) {
  5654. res[key] = hash[altKey];
  5655. if (!preserve) {
  5656. delete hash[altKey];
  5657. }
  5658. return true
  5659. }
  5660. }
  5661. return false
  5662. }
  5663. /* */
  5664. // The template compiler attempts to minimize the need for normalization by
  5665. // statically analyzing the template at compile time.
  5666. //
  5667. // For plain HTML markup, normalization can be completely skipped because the
  5668. // generated render function is guaranteed to return Array<VNode>. There are
  5669. // two cases where extra normalization is needed:
  5670. // 1. When the children contains components - because a functional component
  5671. // may return an Array instead of a single root. In this case, just a simple
  5672. // normalization is needed - if any child is an Array, we flatten the whole
  5673. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  5674. // because functional components already normalize their own children.
  5675. function simpleNormalizeChildren (children) {
  5676. for (var i = 0; i < children.length; i++) {
  5677. if (Array.isArray(children[i])) {
  5678. return Array.prototype.concat.apply([], children)
  5679. }
  5680. }
  5681. return children
  5682. }
  5683. // 2. When the children contains constructs that always generated nested Arrays,
  5684. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  5685. // with hand-written render functions / JSX. In such cases a full normalization
  5686. // is needed to cater to all possible types of children values.
  5687. function normalizeChildren (children) {
  5688. return isPrimitive(children)
  5689. ? [createTextVNode(children)]
  5690. : Array.isArray(children)
  5691. ? normalizeArrayChildren(children)
  5692. : undefined
  5693. }
  5694. function isTextNode (node) {
  5695. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  5696. }
  5697. function normalizeArrayChildren (children, nestedIndex) {
  5698. var res = [];
  5699. var i, c, lastIndex, last;
  5700. for (i = 0; i < children.length; i++) {
  5701. c = children[i];
  5702. if (isUndef(c) || typeof c === 'boolean') { continue }
  5703. lastIndex = res.length - 1;
  5704. last = res[lastIndex];
  5705. // nested
  5706. if (Array.isArray(c)) {
  5707. if (c.length > 0) {
  5708. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  5709. // merge adjacent text nodes
  5710. if (isTextNode(c[0]) && isTextNode(last)) {
  5711. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  5712. c.shift();
  5713. }
  5714. res.push.apply(res, c);
  5715. }
  5716. } else if (isPrimitive(c)) {
  5717. if (isTextNode(last)) {
  5718. // merge adjacent text nodes
  5719. // this is necessary for SSR hydration because text nodes are
  5720. // essentially merged when rendered to HTML strings
  5721. res[lastIndex] = createTextVNode(last.text + c);
  5722. } else if (c !== '') {
  5723. // convert primitive to vnode
  5724. res.push(createTextVNode(c));
  5725. }
  5726. } else {
  5727. if (isTextNode(c) && isTextNode(last)) {
  5728. // merge adjacent text nodes
  5729. res[lastIndex] = createTextVNode(last.text + c.text);
  5730. } else {
  5731. // default key for nested array children (likely generated by v-for)
  5732. if (isTrue(children._isVList) &&
  5733. isDef(c.tag) &&
  5734. isUndef(c.key) &&
  5735. isDef(nestedIndex)) {
  5736. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  5737. }
  5738. res.push(c);
  5739. }
  5740. }
  5741. }
  5742. return res
  5743. }
  5744. /* */
  5745. function initProvide (vm) {
  5746. var provide = vm.$options.provide;
  5747. if (provide) {
  5748. vm._provided = typeof provide === 'function'
  5749. ? provide.call(vm)
  5750. : provide;
  5751. }
  5752. }
  5753. function initInjections (vm) {
  5754. var result = resolveInject(vm.$options.inject, vm);
  5755. if (result) {
  5756. toggleObserving(false);
  5757. Object.keys(result).forEach(function (key) {
  5758. /* istanbul ignore else */
  5759. if (true) {
  5760. defineReactive$$1(vm, key, result[key], function () {
  5761. warn(
  5762. "Avoid mutating an injected value directly since the changes will be " +
  5763. "overwritten whenever the provided component re-renders. " +
  5764. "injection being mutated: \"" + key + "\"",
  5765. vm
  5766. );
  5767. });
  5768. } else {}
  5769. });
  5770. toggleObserving(true);
  5771. }
  5772. }
  5773. function resolveInject (inject, vm) {
  5774. if (inject) {
  5775. // inject is :any because flow is not smart enough to figure out cached
  5776. var result = Object.create(null);
  5777. var keys = hasSymbol
  5778. ? Reflect.ownKeys(inject)
  5779. : Object.keys(inject);
  5780. for (var i = 0; i < keys.length; i++) {
  5781. var key = keys[i];
  5782. // #6574 in case the inject object is observed...
  5783. if (key === '__ob__') { continue }
  5784. var provideKey = inject[key].from;
  5785. var source = vm;
  5786. while (source) {
  5787. if (source._provided && hasOwn(source._provided, provideKey)) {
  5788. result[key] = source._provided[provideKey];
  5789. break
  5790. }
  5791. source = source.$parent;
  5792. }
  5793. if (!source) {
  5794. if ('default' in inject[key]) {
  5795. var provideDefault = inject[key].default;
  5796. result[key] = typeof provideDefault === 'function'
  5797. ? provideDefault.call(vm)
  5798. : provideDefault;
  5799. } else if (true) {
  5800. warn(("Injection \"" + key + "\" not found"), vm);
  5801. }
  5802. }
  5803. }
  5804. return result
  5805. }
  5806. }
  5807. /* */
  5808. /**
  5809. * Runtime helper for resolving raw children VNodes into a slot object.
  5810. */
  5811. function resolveSlots (
  5812. children,
  5813. context
  5814. ) {
  5815. if (!children || !children.length) {
  5816. return {}
  5817. }
  5818. var slots = {};
  5819. for (var i = 0, l = children.length; i < l; i++) {
  5820. var child = children[i];
  5821. var data = child.data;
  5822. // remove slot attribute if the node is resolved as a Vue slot node
  5823. if (data && data.attrs && data.attrs.slot) {
  5824. delete data.attrs.slot;
  5825. }
  5826. // named slots should only be respected if the vnode was rendered in the
  5827. // same context.
  5828. if ((child.context === context || child.fnContext === context) &&
  5829. data && data.slot != null
  5830. ) {
  5831. var name = data.slot;
  5832. var slot = (slots[name] || (slots[name] = []));
  5833. if (child.tag === 'template') {
  5834. slot.push.apply(slot, child.children || []);
  5835. } else {
  5836. slot.push(child);
  5837. }
  5838. } else {
  5839. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  5840. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  5841. (slots['page'] || (slots['page'] = [])).push(child);
  5842. }else{
  5843. (slots.default || (slots.default = [])).push(child);
  5844. }
  5845. }
  5846. }
  5847. // ignore slots that contains only whitespace
  5848. for (var name$1 in slots) {
  5849. if (slots[name$1].every(isWhitespace)) {
  5850. delete slots[name$1];
  5851. }
  5852. }
  5853. return slots
  5854. }
  5855. function isWhitespace (node) {
  5856. return (node.isComment && !node.asyncFactory) || node.text === ' '
  5857. }
  5858. /* */
  5859. function normalizeScopedSlots (
  5860. slots,
  5861. normalSlots,
  5862. prevSlots
  5863. ) {
  5864. var res;
  5865. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  5866. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  5867. var key = slots && slots.$key;
  5868. if (!slots) {
  5869. res = {};
  5870. } else if (slots._normalized) {
  5871. // fast path 1: child component re-render only, parent did not change
  5872. return slots._normalized
  5873. } else if (
  5874. isStable &&
  5875. prevSlots &&
  5876. prevSlots !== emptyObject &&
  5877. key === prevSlots.$key &&
  5878. !hasNormalSlots &&
  5879. !prevSlots.$hasNormal
  5880. ) {
  5881. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  5882. // only need to normalize once
  5883. return prevSlots
  5884. } else {
  5885. res = {};
  5886. for (var key$1 in slots) {
  5887. if (slots[key$1] && key$1[0] !== '$') {
  5888. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  5889. }
  5890. }
  5891. }
  5892. // expose normal slots on scopedSlots
  5893. for (var key$2 in normalSlots) {
  5894. if (!(key$2 in res)) {
  5895. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  5896. }
  5897. }
  5898. // avoriaz seems to mock a non-extensible $scopedSlots object
  5899. // and when that is passed down this would cause an error
  5900. if (slots && Object.isExtensible(slots)) {
  5901. (slots)._normalized = res;
  5902. }
  5903. def(res, '$stable', isStable);
  5904. def(res, '$key', key);
  5905. def(res, '$hasNormal', hasNormalSlots);
  5906. return res
  5907. }
  5908. function normalizeScopedSlot(normalSlots, key, fn) {
  5909. var normalized = function () {
  5910. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  5911. res = res && typeof res === 'object' && !Array.isArray(res)
  5912. ? [res] // single vnode
  5913. : normalizeChildren(res);
  5914. return res && (
  5915. res.length === 0 ||
  5916. (res.length === 1 && res[0].isComment) // #9658
  5917. ) ? undefined
  5918. : res
  5919. };
  5920. // this is a slot using the new v-slot syntax without scope. although it is
  5921. // compiled as a scoped slot, render fn users would expect it to be present
  5922. // on this.$slots because the usage is semantically a normal slot.
  5923. if (fn.proxy) {
  5924. Object.defineProperty(normalSlots, key, {
  5925. get: normalized,
  5926. enumerable: true,
  5927. configurable: true
  5928. });
  5929. }
  5930. return normalized
  5931. }
  5932. function proxyNormalSlot(slots, key) {
  5933. return function () { return slots[key]; }
  5934. }
  5935. /* */
  5936. /**
  5937. * Runtime helper for rendering v-for lists.
  5938. */
  5939. function renderList (
  5940. val,
  5941. render
  5942. ) {
  5943. var ret, i, l, keys, key;
  5944. if (Array.isArray(val) || typeof val === 'string') {
  5945. ret = new Array(val.length);
  5946. for (i = 0, l = val.length; i < l; i++) {
  5947. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  5948. }
  5949. } else if (typeof val === 'number') {
  5950. ret = new Array(val);
  5951. for (i = 0; i < val; i++) {
  5952. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  5953. }
  5954. } else if (isObject(val)) {
  5955. if (hasSymbol && val[Symbol.iterator]) {
  5956. ret = [];
  5957. var iterator = val[Symbol.iterator]();
  5958. var result = iterator.next();
  5959. while (!result.done) {
  5960. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  5961. result = iterator.next();
  5962. }
  5963. } else {
  5964. keys = Object.keys(val);
  5965. ret = new Array(keys.length);
  5966. for (i = 0, l = keys.length; i < l; i++) {
  5967. key = keys[i];
  5968. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  5969. }
  5970. }
  5971. }
  5972. if (!isDef(ret)) {
  5973. ret = [];
  5974. }
  5975. (ret)._isVList = true;
  5976. return ret
  5977. }
  5978. /* */
  5979. /**
  5980. * Runtime helper for rendering <slot>
  5981. */
  5982. function renderSlot (
  5983. name,
  5984. fallback,
  5985. props,
  5986. bindObject
  5987. ) {
  5988. var scopedSlotFn = this.$scopedSlots[name];
  5989. var nodes;
  5990. if (scopedSlotFn) { // scoped slot
  5991. props = props || {};
  5992. if (bindObject) {
  5993. if ( true && !isObject(bindObject)) {
  5994. warn(
  5995. 'slot v-bind without argument expects an Object',
  5996. this
  5997. );
  5998. }
  5999. props = extend(extend({}, bindObject), props);
  6000. }
  6001. // fixed by xxxxxx app-plus scopedSlot
  6002. nodes = scopedSlotFn(props, this, props._i) || fallback;
  6003. } else {
  6004. nodes = this.$slots[name] || fallback;
  6005. }
  6006. var target = props && props.slot;
  6007. if (target) {
  6008. return this.$createElement('template', { slot: target }, nodes)
  6009. } else {
  6010. return nodes
  6011. }
  6012. }
  6013. /* */
  6014. /**
  6015. * Runtime helper for resolving filters
  6016. */
  6017. function resolveFilter (id) {
  6018. return resolveAsset(this.$options, 'filters', id, true) || identity
  6019. }
  6020. /* */
  6021. function isKeyNotMatch (expect, actual) {
  6022. if (Array.isArray(expect)) {
  6023. return expect.indexOf(actual) === -1
  6024. } else {
  6025. return expect !== actual
  6026. }
  6027. }
  6028. /**
  6029. * Runtime helper for checking keyCodes from config.
  6030. * exposed as Vue.prototype._k
  6031. * passing in eventKeyName as last argument separately for backwards compat
  6032. */
  6033. function checkKeyCodes (
  6034. eventKeyCode,
  6035. key,
  6036. builtInKeyCode,
  6037. eventKeyName,
  6038. builtInKeyName
  6039. ) {
  6040. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  6041. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  6042. return isKeyNotMatch(builtInKeyName, eventKeyName)
  6043. } else if (mappedKeyCode) {
  6044. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  6045. } else if (eventKeyName) {
  6046. return hyphenate(eventKeyName) !== key
  6047. }
  6048. }
  6049. /* */
  6050. /**
  6051. * Runtime helper for merging v-bind="object" into a VNode's data.
  6052. */
  6053. function bindObjectProps (
  6054. data,
  6055. tag,
  6056. value,
  6057. asProp,
  6058. isSync
  6059. ) {
  6060. if (value) {
  6061. if (!isObject(value)) {
  6062. true && warn(
  6063. 'v-bind without argument expects an Object or Array value',
  6064. this
  6065. );
  6066. } else {
  6067. if (Array.isArray(value)) {
  6068. value = toObject(value);
  6069. }
  6070. var hash;
  6071. var loop = function ( key ) {
  6072. if (
  6073. key === 'class' ||
  6074. key === 'style' ||
  6075. isReservedAttribute(key)
  6076. ) {
  6077. hash = data;
  6078. } else {
  6079. var type = data.attrs && data.attrs.type;
  6080. hash = asProp || config.mustUseProp(tag, type, key)
  6081. ? data.domProps || (data.domProps = {})
  6082. : data.attrs || (data.attrs = {});
  6083. }
  6084. var camelizedKey = camelize(key);
  6085. var hyphenatedKey = hyphenate(key);
  6086. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  6087. hash[key] = value[key];
  6088. if (isSync) {
  6089. var on = data.on || (data.on = {});
  6090. on[("update:" + key)] = function ($event) {
  6091. value[key] = $event;
  6092. };
  6093. }
  6094. }
  6095. };
  6096. for (var key in value) loop( key );
  6097. }
  6098. }
  6099. return data
  6100. }
  6101. /* */
  6102. /**
  6103. * Runtime helper for rendering static trees.
  6104. */
  6105. function renderStatic (
  6106. index,
  6107. isInFor
  6108. ) {
  6109. var cached = this._staticTrees || (this._staticTrees = []);
  6110. var tree = cached[index];
  6111. // if has already-rendered static tree and not inside v-for,
  6112. // we can reuse the same tree.
  6113. if (tree && !isInFor) {
  6114. return tree
  6115. }
  6116. // otherwise, render a fresh tree.
  6117. tree = cached[index] = this.$options.staticRenderFns[index].call(
  6118. this._renderProxy,
  6119. null,
  6120. this // for render fns generated for functional component templates
  6121. );
  6122. markStatic(tree, ("__static__" + index), false);
  6123. return tree
  6124. }
  6125. /**
  6126. * Runtime helper for v-once.
  6127. * Effectively it means marking the node as static with a unique key.
  6128. */
  6129. function markOnce (
  6130. tree,
  6131. index,
  6132. key
  6133. ) {
  6134. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  6135. return tree
  6136. }
  6137. function markStatic (
  6138. tree,
  6139. key,
  6140. isOnce
  6141. ) {
  6142. if (Array.isArray(tree)) {
  6143. for (var i = 0; i < tree.length; i++) {
  6144. if (tree[i] && typeof tree[i] !== 'string') {
  6145. markStaticNode(tree[i], (key + "_" + i), isOnce);
  6146. }
  6147. }
  6148. } else {
  6149. markStaticNode(tree, key, isOnce);
  6150. }
  6151. }
  6152. function markStaticNode (node, key, isOnce) {
  6153. node.isStatic = true;
  6154. node.key = key;
  6155. node.isOnce = isOnce;
  6156. }
  6157. /* */
  6158. function bindObjectListeners (data, value) {
  6159. if (value) {
  6160. if (!isPlainObject(value)) {
  6161. true && warn(
  6162. 'v-on without argument expects an Object value',
  6163. this
  6164. );
  6165. } else {
  6166. var on = data.on = data.on ? extend({}, data.on) : {};
  6167. for (var key in value) {
  6168. var existing = on[key];
  6169. var ours = value[key];
  6170. on[key] = existing ? [].concat(existing, ours) : ours;
  6171. }
  6172. }
  6173. }
  6174. return data
  6175. }
  6176. /* */
  6177. function resolveScopedSlots (
  6178. fns, // see flow/vnode
  6179. res,
  6180. // the following are added in 2.6
  6181. hasDynamicKeys,
  6182. contentHashKey
  6183. ) {
  6184. res = res || { $stable: !hasDynamicKeys };
  6185. for (var i = 0; i < fns.length; i++) {
  6186. var slot = fns[i];
  6187. if (Array.isArray(slot)) {
  6188. resolveScopedSlots(slot, res, hasDynamicKeys);
  6189. } else if (slot) {
  6190. // marker for reverse proxying v-slot without scope on this.$slots
  6191. if (slot.proxy) {
  6192. slot.fn.proxy = true;
  6193. }
  6194. res[slot.key] = slot.fn;
  6195. }
  6196. }
  6197. if (contentHashKey) {
  6198. (res).$key = contentHashKey;
  6199. }
  6200. return res
  6201. }
  6202. /* */
  6203. function bindDynamicKeys (baseObj, values) {
  6204. for (var i = 0; i < values.length; i += 2) {
  6205. var key = values[i];
  6206. if (typeof key === 'string' && key) {
  6207. baseObj[values[i]] = values[i + 1];
  6208. } else if ( true && key !== '' && key !== null) {
  6209. // null is a special value for explicitly removing a binding
  6210. warn(
  6211. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  6212. this
  6213. );
  6214. }
  6215. }
  6216. return baseObj
  6217. }
  6218. // helper to dynamically append modifier runtime markers to event names.
  6219. // ensure only append when value is already string, otherwise it will be cast
  6220. // to string and cause the type check to miss.
  6221. function prependModifier (value, symbol) {
  6222. return typeof value === 'string' ? symbol + value : value
  6223. }
  6224. /* */
  6225. function installRenderHelpers (target) {
  6226. target._o = markOnce;
  6227. target._n = toNumber;
  6228. target._s = toString;
  6229. target._l = renderList;
  6230. target._t = renderSlot;
  6231. target._q = looseEqual;
  6232. target._i = looseIndexOf;
  6233. target._m = renderStatic;
  6234. target._f = resolveFilter;
  6235. target._k = checkKeyCodes;
  6236. target._b = bindObjectProps;
  6237. target._v = createTextVNode;
  6238. target._e = createEmptyVNode;
  6239. target._u = resolveScopedSlots;
  6240. target._g = bindObjectListeners;
  6241. target._d = bindDynamicKeys;
  6242. target._p = prependModifier;
  6243. }
  6244. /* */
  6245. function FunctionalRenderContext (
  6246. data,
  6247. props,
  6248. children,
  6249. parent,
  6250. Ctor
  6251. ) {
  6252. var this$1 = this;
  6253. var options = Ctor.options;
  6254. // ensure the createElement function in functional components
  6255. // gets a unique context - this is necessary for correct named slot check
  6256. var contextVm;
  6257. if (hasOwn(parent, '_uid')) {
  6258. contextVm = Object.create(parent);
  6259. // $flow-disable-line
  6260. contextVm._original = parent;
  6261. } else {
  6262. // the context vm passed in is a functional context as well.
  6263. // in this case we want to make sure we are able to get a hold to the
  6264. // real context instance.
  6265. contextVm = parent;
  6266. // $flow-disable-line
  6267. parent = parent._original;
  6268. }
  6269. var isCompiled = isTrue(options._compiled);
  6270. var needNormalization = !isCompiled;
  6271. this.data = data;
  6272. this.props = props;
  6273. this.children = children;
  6274. this.parent = parent;
  6275. this.listeners = data.on || emptyObject;
  6276. this.injections = resolveInject(options.inject, parent);
  6277. this.slots = function () {
  6278. if (!this$1.$slots) {
  6279. normalizeScopedSlots(
  6280. data.scopedSlots,
  6281. this$1.$slots = resolveSlots(children, parent)
  6282. );
  6283. }
  6284. return this$1.$slots
  6285. };
  6286. Object.defineProperty(this, 'scopedSlots', ({
  6287. enumerable: true,
  6288. get: function get () {
  6289. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6290. }
  6291. }));
  6292. // support for compiled functional template
  6293. if (isCompiled) {
  6294. // exposing $options for renderStatic()
  6295. this.$options = options;
  6296. // pre-resolve slots for renderSlot()
  6297. this.$slots = this.slots();
  6298. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6299. }
  6300. if (options._scopeId) {
  6301. this._c = function (a, b, c, d) {
  6302. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6303. if (vnode && !Array.isArray(vnode)) {
  6304. vnode.fnScopeId = options._scopeId;
  6305. vnode.fnContext = parent;
  6306. }
  6307. return vnode
  6308. };
  6309. } else {
  6310. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6311. }
  6312. }
  6313. installRenderHelpers(FunctionalRenderContext.prototype);
  6314. function createFunctionalComponent (
  6315. Ctor,
  6316. propsData,
  6317. data,
  6318. contextVm,
  6319. children
  6320. ) {
  6321. var options = Ctor.options;
  6322. var props = {};
  6323. var propOptions = options.props;
  6324. if (isDef(propOptions)) {
  6325. for (var key in propOptions) {
  6326. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6327. }
  6328. } else {
  6329. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6330. if (isDef(data.props)) { mergeProps(props, data.props); }
  6331. }
  6332. var renderContext = new FunctionalRenderContext(
  6333. data,
  6334. props,
  6335. children,
  6336. contextVm,
  6337. Ctor
  6338. );
  6339. var vnode = options.render.call(null, renderContext._c, renderContext);
  6340. if (vnode instanceof VNode) {
  6341. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6342. } else if (Array.isArray(vnode)) {
  6343. var vnodes = normalizeChildren(vnode) || [];
  6344. var res = new Array(vnodes.length);
  6345. for (var i = 0; i < vnodes.length; i++) {
  6346. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6347. }
  6348. return res
  6349. }
  6350. }
  6351. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6352. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6353. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6354. // that should not be matched to match.
  6355. var clone = cloneVNode(vnode);
  6356. clone.fnContext = contextVm;
  6357. clone.fnOptions = options;
  6358. if (true) {
  6359. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6360. }
  6361. if (data.slot) {
  6362. (clone.data || (clone.data = {})).slot = data.slot;
  6363. }
  6364. return clone
  6365. }
  6366. function mergeProps (to, from) {
  6367. for (var key in from) {
  6368. to[camelize(key)] = from[key];
  6369. }
  6370. }
  6371. /* */
  6372. /* */
  6373. /* */
  6374. /* */
  6375. // inline hooks to be invoked on component VNodes during patch
  6376. var componentVNodeHooks = {
  6377. init: function init (vnode, hydrating) {
  6378. if (
  6379. vnode.componentInstance &&
  6380. !vnode.componentInstance._isDestroyed &&
  6381. vnode.data.keepAlive
  6382. ) {
  6383. // kept-alive components, treat as a patch
  6384. var mountedNode = vnode; // work around flow
  6385. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6386. } else {
  6387. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6388. vnode,
  6389. activeInstance
  6390. );
  6391. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6392. }
  6393. },
  6394. prepatch: function prepatch (oldVnode, vnode) {
  6395. var options = vnode.componentOptions;
  6396. var child = vnode.componentInstance = oldVnode.componentInstance;
  6397. updateChildComponent(
  6398. child,
  6399. options.propsData, // updated props
  6400. options.listeners, // updated listeners
  6401. vnode, // new parent vnode
  6402. options.children // new children
  6403. );
  6404. },
  6405. insert: function insert (vnode) {
  6406. var context = vnode.context;
  6407. var componentInstance = vnode.componentInstance;
  6408. if (!componentInstance._isMounted) {
  6409. callHook(componentInstance, 'onServiceCreated');
  6410. callHook(componentInstance, 'onServiceAttached');
  6411. componentInstance._isMounted = true;
  6412. callHook(componentInstance, 'mounted');
  6413. }
  6414. if (vnode.data.keepAlive) {
  6415. if (context._isMounted) {
  6416. // vue-router#1212
  6417. // During updates, a kept-alive component's child components may
  6418. // change, so directly walking the tree here may call activated hooks
  6419. // on incorrect children. Instead we push them into a queue which will
  6420. // be processed after the whole patch process ended.
  6421. queueActivatedComponent(componentInstance);
  6422. } else {
  6423. activateChildComponent(componentInstance, true /* direct */);
  6424. }
  6425. }
  6426. },
  6427. destroy: function destroy (vnode) {
  6428. var componentInstance = vnode.componentInstance;
  6429. if (!componentInstance._isDestroyed) {
  6430. if (!vnode.data.keepAlive) {
  6431. componentInstance.$destroy();
  6432. } else {
  6433. deactivateChildComponent(componentInstance, true /* direct */);
  6434. }
  6435. }
  6436. }
  6437. };
  6438. var hooksToMerge = Object.keys(componentVNodeHooks);
  6439. function createComponent (
  6440. Ctor,
  6441. data,
  6442. context,
  6443. children,
  6444. tag
  6445. ) {
  6446. if (isUndef(Ctor)) {
  6447. return
  6448. }
  6449. var baseCtor = context.$options._base;
  6450. // plain options object: turn it into a constructor
  6451. if (isObject(Ctor)) {
  6452. Ctor = baseCtor.extend(Ctor);
  6453. }
  6454. // if at this stage it's not a constructor or an async component factory,
  6455. // reject.
  6456. if (typeof Ctor !== 'function') {
  6457. if (true) {
  6458. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6459. }
  6460. return
  6461. }
  6462. // async component
  6463. var asyncFactory;
  6464. if (isUndef(Ctor.cid)) {
  6465. asyncFactory = Ctor;
  6466. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6467. if (Ctor === undefined) {
  6468. // return a placeholder node for async component, which is rendered
  6469. // as a comment node but preserves all the raw information for the node.
  6470. // the information will be used for async server-rendering and hydration.
  6471. return createAsyncPlaceholder(
  6472. asyncFactory,
  6473. data,
  6474. context,
  6475. children,
  6476. tag
  6477. )
  6478. }
  6479. }
  6480. data = data || {};
  6481. // resolve constructor options in case global mixins are applied after
  6482. // component constructor creation
  6483. resolveConstructorOptions(Ctor);
  6484. // transform component v-model data into props & events
  6485. if (isDef(data.model)) {
  6486. transformModel(Ctor.options, data);
  6487. }
  6488. // extract props
  6489. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6490. // functional component
  6491. if (isTrue(Ctor.options.functional)) {
  6492. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6493. }
  6494. // extract listeners, since these needs to be treated as
  6495. // child component listeners instead of DOM listeners
  6496. var listeners = data.on;
  6497. // replace with listeners with .native modifier
  6498. // so it gets processed during parent component patch.
  6499. data.on = data.nativeOn;
  6500. if (isTrue(Ctor.options.abstract)) {
  6501. // abstract components do not keep anything
  6502. // other than props & listeners & slot
  6503. // work around flow
  6504. var slot = data.slot;
  6505. data = {};
  6506. if (slot) {
  6507. data.slot = slot;
  6508. }
  6509. }
  6510. // install component management hooks onto the placeholder node
  6511. installComponentHooks(data);
  6512. // return a placeholder vnode
  6513. var name = Ctor.options.name || tag;
  6514. var vnode = new VNode(
  6515. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6516. data, undefined, undefined, undefined, context,
  6517. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6518. asyncFactory
  6519. );
  6520. return vnode
  6521. }
  6522. function createComponentInstanceForVnode (
  6523. vnode, // we know it's MountedComponentVNode but flow doesn't
  6524. parent // activeInstance in lifecycle state
  6525. ) {
  6526. var options = {
  6527. _isComponent: true,
  6528. _parentVnode: vnode,
  6529. parent: parent
  6530. };
  6531. // check inline-template render functions
  6532. var inlineTemplate = vnode.data.inlineTemplate;
  6533. if (isDef(inlineTemplate)) {
  6534. options.render = inlineTemplate.render;
  6535. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6536. }
  6537. return new vnode.componentOptions.Ctor(options)
  6538. }
  6539. function installComponentHooks (data) {
  6540. var hooks = data.hook || (data.hook = {});
  6541. for (var i = 0; i < hooksToMerge.length; i++) {
  6542. var key = hooksToMerge[i];
  6543. var existing = hooks[key];
  6544. var toMerge = componentVNodeHooks[key];
  6545. if (existing !== toMerge && !(existing && existing._merged)) {
  6546. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6547. }
  6548. }
  6549. }
  6550. function mergeHook$1 (f1, f2) {
  6551. var merged = function (a, b) {
  6552. // flow complains about extra args which is why we use any
  6553. f1(a, b);
  6554. f2(a, b);
  6555. };
  6556. merged._merged = true;
  6557. return merged
  6558. }
  6559. // transform component v-model info (value and callback) into
  6560. // prop and event handler respectively.
  6561. function transformModel (options, data) {
  6562. var prop = (options.model && options.model.prop) || 'value';
  6563. var event = (options.model && options.model.event) || 'input'
  6564. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6565. var on = data.on || (data.on = {});
  6566. var existing = on[event];
  6567. var callback = data.model.callback;
  6568. if (isDef(existing)) {
  6569. if (
  6570. Array.isArray(existing)
  6571. ? existing.indexOf(callback) === -1
  6572. : existing !== callback
  6573. ) {
  6574. on[event] = [callback].concat(existing);
  6575. }
  6576. } else {
  6577. on[event] = callback;
  6578. }
  6579. }
  6580. /* */
  6581. var SIMPLE_NORMALIZE = 1;
  6582. var ALWAYS_NORMALIZE = 2;
  6583. // wrapper function for providing a more flexible interface
  6584. // without getting yelled at by flow
  6585. function createElement (
  6586. context,
  6587. tag,
  6588. data,
  6589. children,
  6590. normalizationType,
  6591. alwaysNormalize
  6592. ) {
  6593. if (Array.isArray(data) || isPrimitive(data)) {
  6594. normalizationType = children;
  6595. children = data;
  6596. data = undefined;
  6597. }
  6598. if (isTrue(alwaysNormalize)) {
  6599. normalizationType = ALWAYS_NORMALIZE;
  6600. }
  6601. return _createElement(context, tag, data, children, normalizationType)
  6602. }
  6603. function _createElement (
  6604. context,
  6605. tag,
  6606. data,
  6607. children,
  6608. normalizationType
  6609. ) {
  6610. if (isDef(data) && isDef((data).__ob__)) {
  6611. true && warn(
  6612. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6613. 'Always create fresh vnode data objects in each render!',
  6614. context
  6615. );
  6616. return createEmptyVNode()
  6617. }
  6618. // object syntax in v-bind
  6619. if (isDef(data) && isDef(data.is)) {
  6620. tag = data.is;
  6621. }
  6622. if (!tag) {
  6623. // in case of component :is set to falsy value
  6624. return createEmptyVNode()
  6625. }
  6626. // warn against non-primitive key
  6627. if ( true &&
  6628. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  6629. ) {
  6630. {
  6631. warn(
  6632. 'Avoid using non-primitive value as key, ' +
  6633. 'use string/number value instead.',
  6634. context
  6635. );
  6636. }
  6637. }
  6638. // support single function children as default scoped slot
  6639. if (Array.isArray(children) &&
  6640. typeof children[0] === 'function'
  6641. ) {
  6642. data = data || {};
  6643. data.scopedSlots = { default: children[0] };
  6644. children.length = 0;
  6645. }
  6646. if (normalizationType === ALWAYS_NORMALIZE) {
  6647. children = normalizeChildren(children);
  6648. } else if (normalizationType === SIMPLE_NORMALIZE) {
  6649. children = simpleNormalizeChildren(children);
  6650. }
  6651. var vnode, ns;
  6652. if (typeof tag === 'string') {
  6653. var Ctor;
  6654. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  6655. if (config.isReservedTag(tag)) {
  6656. // platform built-in elements
  6657. if ( true && isDef(data) && isDef(data.nativeOn)) {
  6658. warn(
  6659. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  6660. context
  6661. );
  6662. }
  6663. vnode = new VNode(
  6664. config.parsePlatformTagName(tag), data, children,
  6665. undefined, undefined, context
  6666. );
  6667. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  6668. // component
  6669. vnode = createComponent(Ctor, data, context, children, tag);
  6670. } else {
  6671. // unknown or unlisted namespaced elements
  6672. // check at runtime because it may get assigned a namespace when its
  6673. // parent normalizes children
  6674. vnode = new VNode(
  6675. tag, data, children,
  6676. undefined, undefined, context
  6677. );
  6678. }
  6679. } else {
  6680. // direct component options / constructor
  6681. vnode = createComponent(tag, data, context, children);
  6682. }
  6683. if (Array.isArray(vnode)) {
  6684. return vnode
  6685. } else if (isDef(vnode)) {
  6686. if (isDef(ns)) { applyNS(vnode, ns); }
  6687. if (isDef(data)) { registerDeepBindings(data); }
  6688. return vnode
  6689. } else {
  6690. return createEmptyVNode()
  6691. }
  6692. }
  6693. function applyNS (vnode, ns, force) {
  6694. vnode.ns = ns;
  6695. if (vnode.tag === 'foreignObject') {
  6696. // use default namespace inside foreignObject
  6697. ns = undefined;
  6698. force = true;
  6699. }
  6700. if (isDef(vnode.children)) {
  6701. for (var i = 0, l = vnode.children.length; i < l; i++) {
  6702. var child = vnode.children[i];
  6703. if (isDef(child.tag) && (
  6704. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  6705. applyNS(child, ns, force);
  6706. }
  6707. }
  6708. }
  6709. }
  6710. // ref #5318
  6711. // necessary to ensure parent re-render when deep bindings like :style and
  6712. // :class are used on slot nodes
  6713. function registerDeepBindings (data) {
  6714. if (isObject(data.style)) {
  6715. traverse(data.style);
  6716. }
  6717. if (isObject(data.class)) {
  6718. traverse(data.class);
  6719. }
  6720. }
  6721. /* */
  6722. function initRender (vm) {
  6723. vm._vnode = null; // the root of the child tree
  6724. vm._staticTrees = null; // v-once cached trees
  6725. var options = vm.$options;
  6726. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  6727. var renderContext = parentVnode && parentVnode.context;
  6728. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  6729. vm.$scopedSlots = emptyObject;
  6730. // bind the createElement fn to this instance
  6731. // so that we get proper render context inside it.
  6732. // args order: tag, data, children, normalizationType, alwaysNormalize
  6733. // internal version is used by render functions compiled from templates
  6734. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  6735. // normalization is always applied for the public version, used in
  6736. // user-written render functions.
  6737. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  6738. // $attrs & $listeners are exposed for easier HOC creation.
  6739. // they need to be reactive so that HOCs using them are always updated
  6740. var parentData = parentVnode && parentVnode.data;
  6741. /* istanbul ignore else */
  6742. if (true) {
  6743. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  6744. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  6745. }, true);
  6746. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  6747. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  6748. }, true);
  6749. } else {}
  6750. }
  6751. var currentRenderingInstance = null;
  6752. function renderMixin (Vue) {
  6753. // install runtime convenience helpers
  6754. installRenderHelpers(Vue.prototype);
  6755. Vue.prototype.$nextTick = function (fn) {
  6756. return nextTick(fn, this)
  6757. };
  6758. Vue.prototype._render = function () {
  6759. var vm = this;
  6760. var ref = vm.$options;
  6761. var render = ref.render;
  6762. var _parentVnode = ref._parentVnode;
  6763. if (_parentVnode) {
  6764. vm.$scopedSlots = normalizeScopedSlots(
  6765. _parentVnode.data.scopedSlots,
  6766. vm.$slots,
  6767. vm.$scopedSlots
  6768. );
  6769. }
  6770. // set parent vnode. this allows render functions to have access
  6771. // to the data on the placeholder node.
  6772. vm.$vnode = _parentVnode;
  6773. // render self
  6774. var vnode;
  6775. try {
  6776. // There's no need to maintain a stack because all render fns are called
  6777. // separately from one another. Nested component's render fns are called
  6778. // when parent component is patched.
  6779. currentRenderingInstance = vm;
  6780. vnode = render.call(vm._renderProxy, vm.$createElement);
  6781. } catch (e) {
  6782. handleError(e, vm, "render");
  6783. // return error render result,
  6784. // or previous vnode to prevent render error causing blank component
  6785. /* istanbul ignore else */
  6786. if ( true && vm.$options.renderError) {
  6787. try {
  6788. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  6789. } catch (e) {
  6790. handleError(e, vm, "renderError");
  6791. vnode = vm._vnode;
  6792. }
  6793. } else {
  6794. vnode = vm._vnode;
  6795. }
  6796. } finally {
  6797. currentRenderingInstance = null;
  6798. }
  6799. // if the returned array contains only a single node, allow it
  6800. if (Array.isArray(vnode) && vnode.length === 1) {
  6801. vnode = vnode[0];
  6802. }
  6803. // return empty vnode in case the render function errored out
  6804. if (!(vnode instanceof VNode)) {
  6805. if ( true && Array.isArray(vnode)) {
  6806. warn(
  6807. 'Multiple root nodes returned from render function. Render function ' +
  6808. 'should return a single root node.',
  6809. vm
  6810. );
  6811. }
  6812. vnode = createEmptyVNode();
  6813. }
  6814. // set parent
  6815. vnode.parent = _parentVnode;
  6816. return vnode
  6817. };
  6818. }
  6819. /* */
  6820. function ensureCtor (comp, base) {
  6821. if (
  6822. comp.__esModule ||
  6823. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  6824. ) {
  6825. comp = comp.default;
  6826. }
  6827. return isObject(comp)
  6828. ? base.extend(comp)
  6829. : comp
  6830. }
  6831. function createAsyncPlaceholder (
  6832. factory,
  6833. data,
  6834. context,
  6835. children,
  6836. tag
  6837. ) {
  6838. var node = createEmptyVNode();
  6839. node.asyncFactory = factory;
  6840. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  6841. return node
  6842. }
  6843. function resolveAsyncComponent (
  6844. factory,
  6845. baseCtor
  6846. ) {
  6847. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  6848. return factory.errorComp
  6849. }
  6850. if (isDef(factory.resolved)) {
  6851. return factory.resolved
  6852. }
  6853. var owner = currentRenderingInstance;
  6854. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  6855. // already pending
  6856. factory.owners.push(owner);
  6857. }
  6858. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  6859. return factory.loadingComp
  6860. }
  6861. if (owner && !isDef(factory.owners)) {
  6862. var owners = factory.owners = [owner];
  6863. var sync = true;
  6864. var timerLoading = null;
  6865. var timerTimeout = null
  6866. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  6867. var forceRender = function (renderCompleted) {
  6868. for (var i = 0, l = owners.length; i < l; i++) {
  6869. (owners[i]).$forceUpdate();
  6870. }
  6871. if (renderCompleted) {
  6872. owners.length = 0;
  6873. if (timerLoading !== null) {
  6874. clearTimeout(timerLoading);
  6875. timerLoading = null;
  6876. }
  6877. if (timerTimeout !== null) {
  6878. clearTimeout(timerTimeout);
  6879. timerTimeout = null;
  6880. }
  6881. }
  6882. };
  6883. var resolve = once(function (res) {
  6884. // cache resolved
  6885. factory.resolved = ensureCtor(res, baseCtor);
  6886. // invoke callbacks only if this is not a synchronous resolve
  6887. // (async resolves are shimmed as synchronous during SSR)
  6888. if (!sync) {
  6889. forceRender(true);
  6890. } else {
  6891. owners.length = 0;
  6892. }
  6893. });
  6894. var reject = once(function (reason) {
  6895. true && warn(
  6896. "Failed to resolve async component: " + (String(factory)) +
  6897. (reason ? ("\nReason: " + reason) : '')
  6898. );
  6899. if (isDef(factory.errorComp)) {
  6900. factory.error = true;
  6901. forceRender(true);
  6902. }
  6903. });
  6904. var res = factory(resolve, reject);
  6905. if (isObject(res)) {
  6906. if (isPromise(res)) {
  6907. // () => Promise
  6908. if (isUndef(factory.resolved)) {
  6909. res.then(resolve, reject);
  6910. }
  6911. } else if (isPromise(res.component)) {
  6912. res.component.then(resolve, reject);
  6913. if (isDef(res.error)) {
  6914. factory.errorComp = ensureCtor(res.error, baseCtor);
  6915. }
  6916. if (isDef(res.loading)) {
  6917. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  6918. if (res.delay === 0) {
  6919. factory.loading = true;
  6920. } else {
  6921. timerLoading = setTimeout(function () {
  6922. timerLoading = null;
  6923. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  6924. factory.loading = true;
  6925. forceRender(false);
  6926. }
  6927. }, res.delay || 200);
  6928. }
  6929. }
  6930. if (isDef(res.timeout)) {
  6931. timerTimeout = setTimeout(function () {
  6932. timerTimeout = null;
  6933. if (isUndef(factory.resolved)) {
  6934. reject(
  6935. true
  6936. ? ("timeout (" + (res.timeout) + "ms)")
  6937. : undefined
  6938. );
  6939. }
  6940. }, res.timeout);
  6941. }
  6942. }
  6943. }
  6944. sync = false;
  6945. // return in case resolved synchronously
  6946. return factory.loading
  6947. ? factory.loadingComp
  6948. : factory.resolved
  6949. }
  6950. }
  6951. /* */
  6952. function isAsyncPlaceholder (node) {
  6953. return node.isComment && node.asyncFactory
  6954. }
  6955. /* */
  6956. function getFirstComponentChild (children) {
  6957. if (Array.isArray(children)) {
  6958. for (var i = 0; i < children.length; i++) {
  6959. var c = children[i];
  6960. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  6961. return c
  6962. }
  6963. }
  6964. }
  6965. }
  6966. /* */
  6967. /* */
  6968. function initEvents (vm) {
  6969. vm._events = Object.create(null);
  6970. vm._hasHookEvent = false;
  6971. // init parent attached events
  6972. var listeners = vm.$options._parentListeners;
  6973. if (listeners) {
  6974. updateComponentListeners(vm, listeners);
  6975. }
  6976. }
  6977. var target;
  6978. function add (event, fn) {
  6979. target.$on(event, fn);
  6980. }
  6981. function remove$1 (event, fn) {
  6982. target.$off(event, fn);
  6983. }
  6984. function createOnceHandler (event, fn) {
  6985. var _target = target;
  6986. return function onceHandler () {
  6987. var res = fn.apply(null, arguments);
  6988. if (res !== null) {
  6989. _target.$off(event, onceHandler);
  6990. }
  6991. }
  6992. }
  6993. function updateComponentListeners (
  6994. vm,
  6995. listeners,
  6996. oldListeners
  6997. ) {
  6998. target = vm;
  6999. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  7000. target = undefined;
  7001. }
  7002. function eventsMixin (Vue) {
  7003. var hookRE = /^hook:/;
  7004. Vue.prototype.$on = function (event, fn) {
  7005. var vm = this;
  7006. if (Array.isArray(event)) {
  7007. for (var i = 0, l = event.length; i < l; i++) {
  7008. vm.$on(event[i], fn);
  7009. }
  7010. } else {
  7011. (vm._events[event] || (vm._events[event] = [])).push(fn);
  7012. // optimize hook:event cost by using a boolean flag marked at registration
  7013. // instead of a hash lookup
  7014. if (hookRE.test(event)) {
  7015. vm._hasHookEvent = true;
  7016. }
  7017. }
  7018. return vm
  7019. };
  7020. Vue.prototype.$once = function (event, fn) {
  7021. var vm = this;
  7022. function on () {
  7023. vm.$off(event, on);
  7024. fn.apply(vm, arguments);
  7025. }
  7026. on.fn = fn;
  7027. vm.$on(event, on);
  7028. return vm
  7029. };
  7030. Vue.prototype.$off = function (event, fn) {
  7031. var vm = this;
  7032. // all
  7033. if (!arguments.length) {
  7034. vm._events = Object.create(null);
  7035. return vm
  7036. }
  7037. // array of events
  7038. if (Array.isArray(event)) {
  7039. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  7040. vm.$off(event[i$1], fn);
  7041. }
  7042. return vm
  7043. }
  7044. // specific event
  7045. var cbs = vm._events[event];
  7046. if (!cbs) {
  7047. return vm
  7048. }
  7049. if (!fn) {
  7050. vm._events[event] = null;
  7051. return vm
  7052. }
  7053. // specific handler
  7054. var cb;
  7055. var i = cbs.length;
  7056. while (i--) {
  7057. cb = cbs[i];
  7058. if (cb === fn || cb.fn === fn) {
  7059. cbs.splice(i, 1);
  7060. break
  7061. }
  7062. }
  7063. return vm
  7064. };
  7065. Vue.prototype.$emit = function (event) {
  7066. var vm = this;
  7067. if (true) {
  7068. var lowerCaseEvent = event.toLowerCase();
  7069. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  7070. tip(
  7071. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  7072. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  7073. "Note that HTML attributes are case-insensitive and you cannot use " +
  7074. "v-on to listen to camelCase events when using in-DOM templates. " +
  7075. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  7076. );
  7077. }
  7078. }
  7079. var cbs = vm._events[event];
  7080. if (cbs) {
  7081. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  7082. var args = toArray(arguments, 1);
  7083. var info = "event handler for \"" + event + "\"";
  7084. for (var i = 0, l = cbs.length; i < l; i++) {
  7085. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  7086. }
  7087. }
  7088. return vm
  7089. };
  7090. }
  7091. /* */
  7092. var activeInstance = null;
  7093. var isUpdatingChildComponent = false;
  7094. function setActiveInstance(vm) {
  7095. var prevActiveInstance = activeInstance;
  7096. activeInstance = vm;
  7097. return function () {
  7098. activeInstance = prevActiveInstance;
  7099. }
  7100. }
  7101. function initLifecycle (vm) {
  7102. var options = vm.$options;
  7103. // locate first non-abstract parent
  7104. var parent = options.parent;
  7105. if (parent && !options.abstract) {
  7106. while (parent.$options.abstract && parent.$parent) {
  7107. parent = parent.$parent;
  7108. }
  7109. parent.$children.push(vm);
  7110. }
  7111. vm.$parent = parent;
  7112. vm.$root = parent ? parent.$root : vm;
  7113. vm.$children = [];
  7114. vm.$refs = {};
  7115. vm._watcher = null;
  7116. vm._inactive = null;
  7117. vm._directInactive = false;
  7118. vm._isMounted = false;
  7119. vm._isDestroyed = false;
  7120. vm._isBeingDestroyed = false;
  7121. }
  7122. function lifecycleMixin (Vue) {
  7123. Vue.prototype._update = function (vnode, hydrating) {
  7124. var vm = this;
  7125. var prevEl = vm.$el;
  7126. var prevVnode = vm._vnode;
  7127. var restoreActiveInstance = setActiveInstance(vm);
  7128. vm._vnode = vnode;
  7129. // Vue.prototype.__patch__ is injected in entry points
  7130. // based on the rendering backend used.
  7131. if (!prevVnode) {
  7132. // initial render
  7133. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  7134. } else {
  7135. // updates
  7136. vm.$el = vm.__patch__(prevVnode, vnode);
  7137. }
  7138. restoreActiveInstance();
  7139. // update __vue__ reference
  7140. if (prevEl) {
  7141. prevEl.__vue__ = null;
  7142. }
  7143. if (vm.$el) {
  7144. vm.$el.__vue__ = vm;
  7145. }
  7146. // if parent is an HOC, update its $el as well
  7147. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  7148. vm.$parent.$el = vm.$el;
  7149. }
  7150. // updated hook is called by the scheduler to ensure that children are
  7151. // updated in a parent's updated hook.
  7152. };
  7153. Vue.prototype.$forceUpdate = function () {
  7154. var vm = this;
  7155. if (vm._watcher) {
  7156. vm._watcher.update();
  7157. }
  7158. };
  7159. Vue.prototype.$destroy = function () {
  7160. var vm = this;
  7161. if (vm._isBeingDestroyed) {
  7162. return
  7163. }
  7164. callHook(vm, 'beforeDestroy');
  7165. vm._isBeingDestroyed = true;
  7166. // remove self from parent
  7167. var parent = vm.$parent;
  7168. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  7169. remove(parent.$children, vm);
  7170. }
  7171. // teardown watchers
  7172. if (vm._watcher) {
  7173. vm._watcher.teardown();
  7174. }
  7175. var i = vm._watchers.length;
  7176. while (i--) {
  7177. vm._watchers[i].teardown();
  7178. }
  7179. // remove reference from data ob
  7180. // frozen object may not have observer.
  7181. if (vm._data.__ob__) {
  7182. vm._data.__ob__.vmCount--;
  7183. }
  7184. // call the last hook...
  7185. vm._isDestroyed = true;
  7186. // invoke destroy hooks on current rendered tree
  7187. vm.__patch__(vm._vnode, null);
  7188. // fire destroyed hook
  7189. callHook(vm, 'destroyed');
  7190. // turn off all instance listeners.
  7191. vm.$off();
  7192. // remove __vue__ reference
  7193. if (vm.$el) {
  7194. vm.$el.__vue__ = null;
  7195. }
  7196. // release circular reference (#6759)
  7197. if (vm.$vnode) {
  7198. vm.$vnode.parent = null;
  7199. }
  7200. };
  7201. }
  7202. function updateChildComponent (
  7203. vm,
  7204. propsData,
  7205. listeners,
  7206. parentVnode,
  7207. renderChildren
  7208. ) {
  7209. if (true) {
  7210. isUpdatingChildComponent = true;
  7211. }
  7212. // determine whether component has slot children
  7213. // we need to do this before overwriting $options._renderChildren.
  7214. // check if there are dynamic scopedSlots (hand-written or compiled but with
  7215. // dynamic slot names). Static scoped slots compiled from template has the
  7216. // "$stable" marker.
  7217. var newScopedSlots = parentVnode.data.scopedSlots;
  7218. var oldScopedSlots = vm.$scopedSlots;
  7219. var hasDynamicScopedSlot = !!(
  7220. (newScopedSlots && !newScopedSlots.$stable) ||
  7221. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  7222. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  7223. );
  7224. // Any static slot children from the parent may have changed during parent's
  7225. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  7226. // update is necessary to ensure correctness.
  7227. var needsForceUpdate = !!(
  7228. renderChildren || // has new static slots
  7229. vm.$options._renderChildren || // has old static slots
  7230. hasDynamicScopedSlot
  7231. );
  7232. vm.$options._parentVnode = parentVnode;
  7233. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  7234. if (vm._vnode) { // update child tree's parent
  7235. vm._vnode.parent = parentVnode;
  7236. }
  7237. vm.$options._renderChildren = renderChildren;
  7238. // update $attrs and $listeners hash
  7239. // these are also reactive so they may trigger child update if the child
  7240. // used them during render
  7241. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7242. vm.$listeners = listeners || emptyObject;
  7243. // update props
  7244. if (propsData && vm.$options.props) {
  7245. toggleObserving(false);
  7246. var props = vm._props;
  7247. var propKeys = vm.$options._propKeys || [];
  7248. for (var i = 0; i < propKeys.length; i++) {
  7249. var key = propKeys[i];
  7250. var propOptions = vm.$options.props; // wtf flow?
  7251. props[key] = validateProp(key, propOptions, propsData, vm);
  7252. }
  7253. toggleObserving(true);
  7254. // keep a copy of raw propsData
  7255. vm.$options.propsData = propsData;
  7256. }
  7257. // fixed by xxxxxx update properties(mp runtime)
  7258. vm._$updateProperties && vm._$updateProperties(vm);
  7259. // update listeners
  7260. listeners = listeners || emptyObject;
  7261. var oldListeners = vm.$options._parentListeners;
  7262. vm.$options._parentListeners = listeners;
  7263. updateComponentListeners(vm, listeners, oldListeners);
  7264. // resolve slots + force update if has children
  7265. if (needsForceUpdate) {
  7266. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7267. vm.$forceUpdate();
  7268. }
  7269. if (true) {
  7270. isUpdatingChildComponent = false;
  7271. }
  7272. }
  7273. function isInInactiveTree (vm) {
  7274. while (vm && (vm = vm.$parent)) {
  7275. if (vm._inactive) { return true }
  7276. }
  7277. return false
  7278. }
  7279. function activateChildComponent (vm, direct) {
  7280. if (direct) {
  7281. vm._directInactive = false;
  7282. if (isInInactiveTree(vm)) {
  7283. return
  7284. }
  7285. } else if (vm._directInactive) {
  7286. return
  7287. }
  7288. if (vm._inactive || vm._inactive === null) {
  7289. vm._inactive = false;
  7290. for (var i = 0; i < vm.$children.length; i++) {
  7291. activateChildComponent(vm.$children[i]);
  7292. }
  7293. callHook(vm, 'activated');
  7294. }
  7295. }
  7296. function deactivateChildComponent (vm, direct) {
  7297. if (direct) {
  7298. vm._directInactive = true;
  7299. if (isInInactiveTree(vm)) {
  7300. return
  7301. }
  7302. }
  7303. if (!vm._inactive) {
  7304. vm._inactive = true;
  7305. for (var i = 0; i < vm.$children.length; i++) {
  7306. deactivateChildComponent(vm.$children[i]);
  7307. }
  7308. callHook(vm, 'deactivated');
  7309. }
  7310. }
  7311. function callHook (vm, hook) {
  7312. // #7573 disable dep collection when invoking lifecycle hooks
  7313. pushTarget();
  7314. var handlers = vm.$options[hook];
  7315. var info = hook + " hook";
  7316. if (handlers) {
  7317. for (var i = 0, j = handlers.length; i < j; i++) {
  7318. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7319. }
  7320. }
  7321. if (vm._hasHookEvent) {
  7322. vm.$emit('hook:' + hook);
  7323. }
  7324. popTarget();
  7325. }
  7326. /* */
  7327. var MAX_UPDATE_COUNT = 100;
  7328. var queue = [];
  7329. var activatedChildren = [];
  7330. var has = {};
  7331. var circular = {};
  7332. var waiting = false;
  7333. var flushing = false;
  7334. var index = 0;
  7335. /**
  7336. * Reset the scheduler's state.
  7337. */
  7338. function resetSchedulerState () {
  7339. index = queue.length = activatedChildren.length = 0;
  7340. has = {};
  7341. if (true) {
  7342. circular = {};
  7343. }
  7344. waiting = flushing = false;
  7345. }
  7346. // Async edge case #6566 requires saving the timestamp when event listeners are
  7347. // attached. However, calling performance.now() has a perf overhead especially
  7348. // if the page has thousands of event listeners. Instead, we take a timestamp
  7349. // every time the scheduler flushes and use that for all event listeners
  7350. // attached during that flush.
  7351. var currentFlushTimestamp = 0;
  7352. // Async edge case fix requires storing an event listener's attach timestamp.
  7353. var getNow = Date.now;
  7354. // Determine what event timestamp the browser is using. Annoyingly, the
  7355. // timestamp can either be hi-res (relative to page load) or low-res
  7356. // (relative to UNIX epoch), so in order to compare time we have to use the
  7357. // same timestamp type when saving the flush timestamp.
  7358. // All IE versions use low-res event timestamps, and have problematic clock
  7359. // implementations (#9632)
  7360. if (inBrowser && !isIE) {
  7361. var performance = window.performance;
  7362. if (
  7363. performance &&
  7364. typeof performance.now === 'function' &&
  7365. getNow() > document.createEvent('Event').timeStamp
  7366. ) {
  7367. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7368. // smaller than it, it means the event is using a hi-res timestamp,
  7369. // and we need to use the hi-res version for event listener timestamps as
  7370. // well.
  7371. getNow = function () { return performance.now(); };
  7372. }
  7373. }
  7374. /**
  7375. * Flush both queues and run the watchers.
  7376. */
  7377. function flushSchedulerQueue () {
  7378. currentFlushTimestamp = getNow();
  7379. flushing = true;
  7380. var watcher, id;
  7381. // Sort queue before flush.
  7382. // This ensures that:
  7383. // 1. Components are updated from parent to child. (because parent is always
  7384. // created before the child)
  7385. // 2. A component's user watchers are run before its render watcher (because
  7386. // user watchers are created before the render watcher)
  7387. // 3. If a component is destroyed during a parent component's watcher run,
  7388. // its watchers can be skipped.
  7389. queue.sort(function (a, b) { return a.id - b.id; });
  7390. // do not cache length because more watchers might be pushed
  7391. // as we run existing watchers
  7392. for (index = 0; index < queue.length; index++) {
  7393. watcher = queue[index];
  7394. if (watcher.before) {
  7395. watcher.before();
  7396. }
  7397. id = watcher.id;
  7398. has[id] = null;
  7399. watcher.run();
  7400. // in dev build, check and stop circular updates.
  7401. if ( true && has[id] != null) {
  7402. circular[id] = (circular[id] || 0) + 1;
  7403. if (circular[id] > MAX_UPDATE_COUNT) {
  7404. warn(
  7405. 'You may have an infinite update loop ' + (
  7406. watcher.user
  7407. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7408. : "in a component render function."
  7409. ),
  7410. watcher.vm
  7411. );
  7412. break
  7413. }
  7414. }
  7415. }
  7416. // keep copies of post queues before resetting state
  7417. var activatedQueue = activatedChildren.slice();
  7418. var updatedQueue = queue.slice();
  7419. resetSchedulerState();
  7420. // call component updated and activated hooks
  7421. callActivatedHooks(activatedQueue);
  7422. callUpdatedHooks(updatedQueue);
  7423. // devtool hook
  7424. /* istanbul ignore if */
  7425. if (devtools && config.devtools) {
  7426. devtools.emit('flush');
  7427. }
  7428. }
  7429. function callUpdatedHooks (queue) {
  7430. var i = queue.length;
  7431. while (i--) {
  7432. var watcher = queue[i];
  7433. var vm = watcher.vm;
  7434. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7435. callHook(vm, 'updated');
  7436. }
  7437. }
  7438. }
  7439. /**
  7440. * Queue a kept-alive component that was activated during patch.
  7441. * The queue will be processed after the entire tree has been patched.
  7442. */
  7443. function queueActivatedComponent (vm) {
  7444. // setting _inactive to false here so that a render function can
  7445. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7446. vm._inactive = false;
  7447. activatedChildren.push(vm);
  7448. }
  7449. function callActivatedHooks (queue) {
  7450. for (var i = 0; i < queue.length; i++) {
  7451. queue[i]._inactive = true;
  7452. activateChildComponent(queue[i], true /* true */);
  7453. }
  7454. }
  7455. /**
  7456. * Push a watcher into the watcher queue.
  7457. * Jobs with duplicate IDs will be skipped unless it's
  7458. * pushed when the queue is being flushed.
  7459. */
  7460. function queueWatcher (watcher) {
  7461. var id = watcher.id;
  7462. if (has[id] == null) {
  7463. has[id] = true;
  7464. if (!flushing) {
  7465. queue.push(watcher);
  7466. } else {
  7467. // if already flushing, splice the watcher based on its id
  7468. // if already past its id, it will be run next immediately.
  7469. var i = queue.length - 1;
  7470. while (i > index && queue[i].id > watcher.id) {
  7471. i--;
  7472. }
  7473. queue.splice(i + 1, 0, watcher);
  7474. }
  7475. // queue the flush
  7476. if (!waiting) {
  7477. waiting = true;
  7478. if ( true && !config.async) {
  7479. flushSchedulerQueue();
  7480. return
  7481. }
  7482. nextTick(flushSchedulerQueue);
  7483. }
  7484. }
  7485. }
  7486. /* */
  7487. var uid$2 = 0;
  7488. /**
  7489. * A watcher parses an expression, collects dependencies,
  7490. * and fires callback when the expression value changes.
  7491. * This is used for both the $watch() api and directives.
  7492. */
  7493. var Watcher = function Watcher (
  7494. vm,
  7495. expOrFn,
  7496. cb,
  7497. options,
  7498. isRenderWatcher
  7499. ) {
  7500. this.vm = vm;
  7501. if (isRenderWatcher) {
  7502. vm._watcher = this;
  7503. }
  7504. vm._watchers.push(this);
  7505. // options
  7506. if (options) {
  7507. this.deep = !!options.deep;
  7508. this.user = !!options.user;
  7509. this.lazy = !!options.lazy;
  7510. this.sync = !!options.sync;
  7511. this.before = options.before;
  7512. } else {
  7513. this.deep = this.user = this.lazy = this.sync = false;
  7514. }
  7515. this.cb = cb;
  7516. this.id = ++uid$2; // uid for batching
  7517. this.active = true;
  7518. this.dirty = this.lazy; // for lazy watchers
  7519. this.deps = [];
  7520. this.newDeps = [];
  7521. this.depIds = new _Set();
  7522. this.newDepIds = new _Set();
  7523. this.expression = true
  7524. ? expOrFn.toString()
  7525. : undefined;
  7526. // parse expression for getter
  7527. if (typeof expOrFn === 'function') {
  7528. this.getter = expOrFn;
  7529. } else {
  7530. this.getter = parsePath(expOrFn);
  7531. if (!this.getter) {
  7532. this.getter = noop;
  7533. true && warn(
  7534. "Failed watching path: \"" + expOrFn + "\" " +
  7535. 'Watcher only accepts simple dot-delimited paths. ' +
  7536. 'For full control, use a function instead.',
  7537. vm
  7538. );
  7539. }
  7540. }
  7541. this.value = this.lazy
  7542. ? undefined
  7543. : this.get();
  7544. };
  7545. /**
  7546. * Evaluate the getter, and re-collect dependencies.
  7547. */
  7548. Watcher.prototype.get = function get () {
  7549. pushTarget(this);
  7550. var value;
  7551. var vm = this.vm;
  7552. try {
  7553. value = this.getter.call(vm, vm);
  7554. } catch (e) {
  7555. if (this.user) {
  7556. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7557. } else {
  7558. throw e
  7559. }
  7560. } finally {
  7561. // "touch" every property so they are all tracked as
  7562. // dependencies for deep watching
  7563. if (this.deep) {
  7564. traverse(value);
  7565. }
  7566. popTarget();
  7567. this.cleanupDeps();
  7568. }
  7569. return value
  7570. };
  7571. /**
  7572. * Add a dependency to this directive.
  7573. */
  7574. Watcher.prototype.addDep = function addDep (dep) {
  7575. var id = dep.id;
  7576. if (!this.newDepIds.has(id)) {
  7577. this.newDepIds.add(id);
  7578. this.newDeps.push(dep);
  7579. if (!this.depIds.has(id)) {
  7580. dep.addSub(this);
  7581. }
  7582. }
  7583. };
  7584. /**
  7585. * Clean up for dependency collection.
  7586. */
  7587. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7588. var i = this.deps.length;
  7589. while (i--) {
  7590. var dep = this.deps[i];
  7591. if (!this.newDepIds.has(dep.id)) {
  7592. dep.removeSub(this);
  7593. }
  7594. }
  7595. var tmp = this.depIds;
  7596. this.depIds = this.newDepIds;
  7597. this.newDepIds = tmp;
  7598. this.newDepIds.clear();
  7599. tmp = this.deps;
  7600. this.deps = this.newDeps;
  7601. this.newDeps = tmp;
  7602. this.newDeps.length = 0;
  7603. };
  7604. /**
  7605. * Subscriber interface.
  7606. * Will be called when a dependency changes.
  7607. */
  7608. Watcher.prototype.update = function update () {
  7609. /* istanbul ignore else */
  7610. if (this.lazy) {
  7611. this.dirty = true;
  7612. } else if (this.sync) {
  7613. this.run();
  7614. } else {
  7615. queueWatcher(this);
  7616. }
  7617. };
  7618. /**
  7619. * Scheduler job interface.
  7620. * Will be called by the scheduler.
  7621. */
  7622. Watcher.prototype.run = function run () {
  7623. if (this.active) {
  7624. var value = this.get();
  7625. if (
  7626. value !== this.value ||
  7627. // Deep watchers and watchers on Object/Arrays should fire even
  7628. // when the value is the same, because the value may
  7629. // have mutated.
  7630. isObject(value) ||
  7631. this.deep
  7632. ) {
  7633. // set new value
  7634. var oldValue = this.value;
  7635. this.value = value;
  7636. if (this.user) {
  7637. try {
  7638. this.cb.call(this.vm, value, oldValue);
  7639. } catch (e) {
  7640. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  7641. }
  7642. } else {
  7643. this.cb.call(this.vm, value, oldValue);
  7644. }
  7645. }
  7646. }
  7647. };
  7648. /**
  7649. * Evaluate the value of the watcher.
  7650. * This only gets called for lazy watchers.
  7651. */
  7652. Watcher.prototype.evaluate = function evaluate () {
  7653. this.value = this.get();
  7654. this.dirty = false;
  7655. };
  7656. /**
  7657. * Depend on all deps collected by this watcher.
  7658. */
  7659. Watcher.prototype.depend = function depend () {
  7660. var i = this.deps.length;
  7661. while (i--) {
  7662. this.deps[i].depend();
  7663. }
  7664. };
  7665. /**
  7666. * Remove self from all dependencies' subscriber list.
  7667. */
  7668. Watcher.prototype.teardown = function teardown () {
  7669. if (this.active) {
  7670. // remove self from vm's watcher list
  7671. // this is a somewhat expensive operation so we skip it
  7672. // if the vm is being destroyed.
  7673. if (!this.vm._isBeingDestroyed) {
  7674. remove(this.vm._watchers, this);
  7675. }
  7676. var i = this.deps.length;
  7677. while (i--) {
  7678. this.deps[i].removeSub(this);
  7679. }
  7680. this.active = false;
  7681. }
  7682. };
  7683. /* */
  7684. var sharedPropertyDefinition = {
  7685. enumerable: true,
  7686. configurable: true,
  7687. get: noop,
  7688. set: noop
  7689. };
  7690. function proxy (target, sourceKey, key) {
  7691. sharedPropertyDefinition.get = function proxyGetter () {
  7692. return this[sourceKey][key]
  7693. };
  7694. sharedPropertyDefinition.set = function proxySetter (val) {
  7695. this[sourceKey][key] = val;
  7696. };
  7697. Object.defineProperty(target, key, sharedPropertyDefinition);
  7698. }
  7699. function initState (vm) {
  7700. vm._watchers = [];
  7701. var opts = vm.$options;
  7702. if (opts.props) { initProps(vm, opts.props); }
  7703. if (opts.methods) { initMethods(vm, opts.methods); }
  7704. if (opts.data) {
  7705. initData(vm);
  7706. } else {
  7707. observe(vm._data = {}, true /* asRootData */);
  7708. }
  7709. if (opts.computed) { initComputed(vm, opts.computed); }
  7710. if (opts.watch && opts.watch !== nativeWatch) {
  7711. initWatch(vm, opts.watch);
  7712. }
  7713. }
  7714. function initProps (vm, propsOptions) {
  7715. var propsData = vm.$options.propsData || {};
  7716. var props = vm._props = {};
  7717. // cache prop keys so that future props updates can iterate using Array
  7718. // instead of dynamic object key enumeration.
  7719. var keys = vm.$options._propKeys = [];
  7720. var isRoot = !vm.$parent;
  7721. // root instance props should be converted
  7722. if (!isRoot) {
  7723. toggleObserving(false);
  7724. }
  7725. var loop = function ( key ) {
  7726. keys.push(key);
  7727. var value = validateProp(key, propsOptions, propsData, vm);
  7728. /* istanbul ignore else */
  7729. if (true) {
  7730. var hyphenatedKey = hyphenate(key);
  7731. if (isReservedAttribute(hyphenatedKey) ||
  7732. config.isReservedAttr(hyphenatedKey)) {
  7733. warn(
  7734. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  7735. vm
  7736. );
  7737. }
  7738. defineReactive$$1(props, key, value, function () {
  7739. if (!isRoot && !isUpdatingChildComponent) {
  7740. {
  7741. if(vm.mpHost === 'mp-baidu'){//百度 observer 在 setData callback 之后触发,直接忽略该 warn
  7742. return
  7743. }
  7744. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  7745. if(
  7746. key === 'value' &&
  7747. Array.isArray(vm.$options.behaviors) &&
  7748. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  7749. ){
  7750. return
  7751. }
  7752. if(vm._getFormData){
  7753. return
  7754. }
  7755. var $parent = vm.$parent;
  7756. while($parent){
  7757. if($parent.__next_tick_pending){
  7758. return
  7759. }
  7760. $parent = $parent.$parent;
  7761. }
  7762. }
  7763. warn(
  7764. "Avoid mutating a prop directly since the value will be " +
  7765. "overwritten whenever the parent component re-renders. " +
  7766. "Instead, use a data or computed property based on the prop's " +
  7767. "value. Prop being mutated: \"" + key + "\"",
  7768. vm
  7769. );
  7770. }
  7771. });
  7772. } else {}
  7773. // static props are already proxied on the component's prototype
  7774. // during Vue.extend(). We only need to proxy props defined at
  7775. // instantiation here.
  7776. if (!(key in vm)) {
  7777. proxy(vm, "_props", key);
  7778. }
  7779. };
  7780. for (var key in propsOptions) loop( key );
  7781. toggleObserving(true);
  7782. }
  7783. function initData (vm) {
  7784. var data = vm.$options.data;
  7785. data = vm._data = typeof data === 'function'
  7786. ? getData(data, vm)
  7787. : data || {};
  7788. if (!isPlainObject(data)) {
  7789. data = {};
  7790. true && warn(
  7791. 'data functions should return an object:\n' +
  7792. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  7793. vm
  7794. );
  7795. }
  7796. // proxy data on instance
  7797. var keys = Object.keys(data);
  7798. var props = vm.$options.props;
  7799. var methods = vm.$options.methods;
  7800. var i = keys.length;
  7801. while (i--) {
  7802. var key = keys[i];
  7803. if (true) {
  7804. if (methods && hasOwn(methods, key)) {
  7805. warn(
  7806. ("Method \"" + key + "\" has already been defined as a data property."),
  7807. vm
  7808. );
  7809. }
  7810. }
  7811. if (props && hasOwn(props, key)) {
  7812. true && warn(
  7813. "The data property \"" + key + "\" is already declared as a prop. " +
  7814. "Use prop default value instead.",
  7815. vm
  7816. );
  7817. } else if (!isReserved(key)) {
  7818. proxy(vm, "_data", key);
  7819. }
  7820. }
  7821. // observe data
  7822. observe(data, true /* asRootData */);
  7823. }
  7824. function getData (data, vm) {
  7825. // #7573 disable dep collection when invoking data getters
  7826. pushTarget();
  7827. try {
  7828. return data.call(vm, vm)
  7829. } catch (e) {
  7830. handleError(e, vm, "data()");
  7831. return {}
  7832. } finally {
  7833. popTarget();
  7834. }
  7835. }
  7836. var computedWatcherOptions = { lazy: true };
  7837. function initComputed (vm, computed) {
  7838. // $flow-disable-line
  7839. var watchers = vm._computedWatchers = Object.create(null);
  7840. // computed properties are just getters during SSR
  7841. var isSSR = isServerRendering();
  7842. for (var key in computed) {
  7843. var userDef = computed[key];
  7844. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  7845. if ( true && getter == null) {
  7846. warn(
  7847. ("Getter is missing for computed property \"" + key + "\"."),
  7848. vm
  7849. );
  7850. }
  7851. if (!isSSR) {
  7852. // create internal watcher for the computed property.
  7853. watchers[key] = new Watcher(
  7854. vm,
  7855. getter || noop,
  7856. noop,
  7857. computedWatcherOptions
  7858. );
  7859. }
  7860. // component-defined computed properties are already defined on the
  7861. // component prototype. We only need to define computed properties defined
  7862. // at instantiation here.
  7863. if (!(key in vm)) {
  7864. defineComputed(vm, key, userDef);
  7865. } else if (true) {
  7866. if (key in vm.$data) {
  7867. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  7868. } else if (vm.$options.props && key in vm.$options.props) {
  7869. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  7870. }
  7871. }
  7872. }
  7873. }
  7874. function defineComputed (
  7875. target,
  7876. key,
  7877. userDef
  7878. ) {
  7879. var shouldCache = !isServerRendering();
  7880. if (typeof userDef === 'function') {
  7881. sharedPropertyDefinition.get = shouldCache
  7882. ? createComputedGetter(key)
  7883. : createGetterInvoker(userDef);
  7884. sharedPropertyDefinition.set = noop;
  7885. } else {
  7886. sharedPropertyDefinition.get = userDef.get
  7887. ? shouldCache && userDef.cache !== false
  7888. ? createComputedGetter(key)
  7889. : createGetterInvoker(userDef.get)
  7890. : noop;
  7891. sharedPropertyDefinition.set = userDef.set || noop;
  7892. }
  7893. if ( true &&
  7894. sharedPropertyDefinition.set === noop) {
  7895. sharedPropertyDefinition.set = function () {
  7896. warn(
  7897. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  7898. this
  7899. );
  7900. };
  7901. }
  7902. Object.defineProperty(target, key, sharedPropertyDefinition);
  7903. }
  7904. function createComputedGetter (key) {
  7905. return function computedGetter () {
  7906. var watcher = this._computedWatchers && this._computedWatchers[key];
  7907. if (watcher) {
  7908. if (watcher.dirty) {
  7909. watcher.evaluate();
  7910. }
  7911. if (Dep.SharedObject.target) {// fixed by xxxxxx
  7912. watcher.depend();
  7913. }
  7914. return watcher.value
  7915. }
  7916. }
  7917. }
  7918. function createGetterInvoker(fn) {
  7919. return function computedGetter () {
  7920. return fn.call(this, this)
  7921. }
  7922. }
  7923. function initMethods (vm, methods) {
  7924. var props = vm.$options.props;
  7925. for (var key in methods) {
  7926. if (true) {
  7927. if (typeof methods[key] !== 'function') {
  7928. warn(
  7929. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  7930. "Did you reference the function correctly?",
  7931. vm
  7932. );
  7933. }
  7934. if (props && hasOwn(props, key)) {
  7935. warn(
  7936. ("Method \"" + key + "\" has already been defined as a prop."),
  7937. vm
  7938. );
  7939. }
  7940. if ((key in vm) && isReserved(key)) {
  7941. warn(
  7942. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  7943. "Avoid defining component methods that start with _ or $."
  7944. );
  7945. }
  7946. }
  7947. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  7948. }
  7949. }
  7950. function initWatch (vm, watch) {
  7951. for (var key in watch) {
  7952. var handler = watch[key];
  7953. if (Array.isArray(handler)) {
  7954. for (var i = 0; i < handler.length; i++) {
  7955. createWatcher(vm, key, handler[i]);
  7956. }
  7957. } else {
  7958. createWatcher(vm, key, handler);
  7959. }
  7960. }
  7961. }
  7962. function createWatcher (
  7963. vm,
  7964. expOrFn,
  7965. handler,
  7966. options
  7967. ) {
  7968. if (isPlainObject(handler)) {
  7969. options = handler;
  7970. handler = handler.handler;
  7971. }
  7972. if (typeof handler === 'string') {
  7973. handler = vm[handler];
  7974. }
  7975. return vm.$watch(expOrFn, handler, options)
  7976. }
  7977. function stateMixin (Vue) {
  7978. // flow somehow has problems with directly declared definition object
  7979. // when using Object.defineProperty, so we have to procedurally build up
  7980. // the object here.
  7981. var dataDef = {};
  7982. dataDef.get = function () { return this._data };
  7983. var propsDef = {};
  7984. propsDef.get = function () { return this._props };
  7985. if (true) {
  7986. dataDef.set = function () {
  7987. warn(
  7988. 'Avoid replacing instance root $data. ' +
  7989. 'Use nested data properties instead.',
  7990. this
  7991. );
  7992. };
  7993. propsDef.set = function () {
  7994. warn("$props is readonly.", this);
  7995. };
  7996. }
  7997. Object.defineProperty(Vue.prototype, '$data', dataDef);
  7998. Object.defineProperty(Vue.prototype, '$props', propsDef);
  7999. Vue.prototype.$set = set;
  8000. Vue.prototype.$delete = del;
  8001. Vue.prototype.$watch = function (
  8002. expOrFn,
  8003. cb,
  8004. options
  8005. ) {
  8006. var vm = this;
  8007. if (isPlainObject(cb)) {
  8008. return createWatcher(vm, expOrFn, cb, options)
  8009. }
  8010. options = options || {};
  8011. options.user = true;
  8012. var watcher = new Watcher(vm, expOrFn, cb, options);
  8013. if (options.immediate) {
  8014. try {
  8015. cb.call(vm, watcher.value);
  8016. } catch (error) {
  8017. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  8018. }
  8019. }
  8020. return function unwatchFn () {
  8021. watcher.teardown();
  8022. }
  8023. };
  8024. }
  8025. /* */
  8026. var uid$3 = 0;
  8027. function initMixin (Vue) {
  8028. Vue.prototype._init = function (options) {
  8029. var vm = this;
  8030. // a uid
  8031. vm._uid = uid$3++;
  8032. var startTag, endTag;
  8033. /* istanbul ignore if */
  8034. if ( true && config.performance && mark) {
  8035. startTag = "vue-perf-start:" + (vm._uid);
  8036. endTag = "vue-perf-end:" + (vm._uid);
  8037. mark(startTag);
  8038. }
  8039. // a flag to avoid this being observed
  8040. vm._isVue = true;
  8041. // merge options
  8042. if (options && options._isComponent) {
  8043. // optimize internal component instantiation
  8044. // since dynamic options merging is pretty slow, and none of the
  8045. // internal component options needs special treatment.
  8046. initInternalComponent(vm, options);
  8047. } else {
  8048. vm.$options = mergeOptions(
  8049. resolveConstructorOptions(vm.constructor),
  8050. options || {},
  8051. vm
  8052. );
  8053. }
  8054. /* istanbul ignore else */
  8055. if (true) {
  8056. initProxy(vm);
  8057. } else {}
  8058. // expose real self
  8059. vm._self = vm;
  8060. initLifecycle(vm);
  8061. initEvents(vm);
  8062. initRender(vm);
  8063. callHook(vm, 'beforeCreate');
  8064. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  8065. initState(vm);
  8066. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  8067. !vm._$fallback && callHook(vm, 'created');
  8068. /* istanbul ignore if */
  8069. if ( true && config.performance && mark) {
  8070. vm._name = formatComponentName(vm, false);
  8071. mark(endTag);
  8072. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  8073. }
  8074. if (vm.$options.el) {
  8075. vm.$mount(vm.$options.el);
  8076. }
  8077. };
  8078. }
  8079. function initInternalComponent (vm, options) {
  8080. var opts = vm.$options = Object.create(vm.constructor.options);
  8081. // doing this because it's faster than dynamic enumeration.
  8082. var parentVnode = options._parentVnode;
  8083. opts.parent = options.parent;
  8084. opts._parentVnode = parentVnode;
  8085. var vnodeComponentOptions = parentVnode.componentOptions;
  8086. opts.propsData = vnodeComponentOptions.propsData;
  8087. opts._parentListeners = vnodeComponentOptions.listeners;
  8088. opts._renderChildren = vnodeComponentOptions.children;
  8089. opts._componentTag = vnodeComponentOptions.tag;
  8090. if (options.render) {
  8091. opts.render = options.render;
  8092. opts.staticRenderFns = options.staticRenderFns;
  8093. }
  8094. }
  8095. function resolveConstructorOptions (Ctor) {
  8096. var options = Ctor.options;
  8097. if (Ctor.super) {
  8098. var superOptions = resolveConstructorOptions(Ctor.super);
  8099. var cachedSuperOptions = Ctor.superOptions;
  8100. if (superOptions !== cachedSuperOptions) {
  8101. // super option changed,
  8102. // need to resolve new options.
  8103. Ctor.superOptions = superOptions;
  8104. // check if there are any late-modified/attached options (#4976)
  8105. var modifiedOptions = resolveModifiedOptions(Ctor);
  8106. // update base extend options
  8107. if (modifiedOptions) {
  8108. extend(Ctor.extendOptions, modifiedOptions);
  8109. }
  8110. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  8111. if (options.name) {
  8112. options.components[options.name] = Ctor;
  8113. }
  8114. }
  8115. }
  8116. return options
  8117. }
  8118. function resolveModifiedOptions (Ctor) {
  8119. var modified;
  8120. var latest = Ctor.options;
  8121. var sealed = Ctor.sealedOptions;
  8122. for (var key in latest) {
  8123. if (latest[key] !== sealed[key]) {
  8124. if (!modified) { modified = {}; }
  8125. modified[key] = latest[key];
  8126. }
  8127. }
  8128. return modified
  8129. }
  8130. function Vue (options) {
  8131. if ( true &&
  8132. !(this instanceof Vue)
  8133. ) {
  8134. warn('Vue is a constructor and should be called with the `new` keyword');
  8135. }
  8136. this._init(options);
  8137. }
  8138. initMixin(Vue);
  8139. stateMixin(Vue);
  8140. eventsMixin(Vue);
  8141. lifecycleMixin(Vue);
  8142. renderMixin(Vue);
  8143. /* */
  8144. function initUse (Vue) {
  8145. Vue.use = function (plugin) {
  8146. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  8147. if (installedPlugins.indexOf(plugin) > -1) {
  8148. return this
  8149. }
  8150. // additional parameters
  8151. var args = toArray(arguments, 1);
  8152. args.unshift(this);
  8153. if (typeof plugin.install === 'function') {
  8154. plugin.install.apply(plugin, args);
  8155. } else if (typeof plugin === 'function') {
  8156. plugin.apply(null, args);
  8157. }
  8158. installedPlugins.push(plugin);
  8159. return this
  8160. };
  8161. }
  8162. /* */
  8163. function initMixin$1 (Vue) {
  8164. Vue.mixin = function (mixin) {
  8165. this.options = mergeOptions(this.options, mixin);
  8166. return this
  8167. };
  8168. }
  8169. /* */
  8170. function initExtend (Vue) {
  8171. /**
  8172. * Each instance constructor, including Vue, has a unique
  8173. * cid. This enables us to create wrapped "child
  8174. * constructors" for prototypal inheritance and cache them.
  8175. */
  8176. Vue.cid = 0;
  8177. var cid = 1;
  8178. /**
  8179. * Class inheritance
  8180. */
  8181. Vue.extend = function (extendOptions) {
  8182. extendOptions = extendOptions || {};
  8183. var Super = this;
  8184. var SuperId = Super.cid;
  8185. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  8186. if (cachedCtors[SuperId]) {
  8187. return cachedCtors[SuperId]
  8188. }
  8189. var name = extendOptions.name || Super.options.name;
  8190. if ( true && name) {
  8191. validateComponentName(name);
  8192. }
  8193. var Sub = function VueComponent (options) {
  8194. this._init(options);
  8195. };
  8196. Sub.prototype = Object.create(Super.prototype);
  8197. Sub.prototype.constructor = Sub;
  8198. Sub.cid = cid++;
  8199. Sub.options = mergeOptions(
  8200. Super.options,
  8201. extendOptions
  8202. );
  8203. Sub['super'] = Super;
  8204. // For props and computed properties, we define the proxy getters on
  8205. // the Vue instances at extension time, on the extended prototype. This
  8206. // avoids Object.defineProperty calls for each instance created.
  8207. if (Sub.options.props) {
  8208. initProps$1(Sub);
  8209. }
  8210. if (Sub.options.computed) {
  8211. initComputed$1(Sub);
  8212. }
  8213. // allow further extension/mixin/plugin usage
  8214. Sub.extend = Super.extend;
  8215. Sub.mixin = Super.mixin;
  8216. Sub.use = Super.use;
  8217. // create asset registers, so extended classes
  8218. // can have their private assets too.
  8219. ASSET_TYPES.forEach(function (type) {
  8220. Sub[type] = Super[type];
  8221. });
  8222. // enable recursive self-lookup
  8223. if (name) {
  8224. Sub.options.components[name] = Sub;
  8225. }
  8226. // keep a reference to the super options at extension time.
  8227. // later at instantiation we can check if Super's options have
  8228. // been updated.
  8229. Sub.superOptions = Super.options;
  8230. Sub.extendOptions = extendOptions;
  8231. Sub.sealedOptions = extend({}, Sub.options);
  8232. // cache constructor
  8233. cachedCtors[SuperId] = Sub;
  8234. return Sub
  8235. };
  8236. }
  8237. function initProps$1 (Comp) {
  8238. var props = Comp.options.props;
  8239. for (var key in props) {
  8240. proxy(Comp.prototype, "_props", key);
  8241. }
  8242. }
  8243. function initComputed$1 (Comp) {
  8244. var computed = Comp.options.computed;
  8245. for (var key in computed) {
  8246. defineComputed(Comp.prototype, key, computed[key]);
  8247. }
  8248. }
  8249. /* */
  8250. function initAssetRegisters (Vue) {
  8251. /**
  8252. * Create asset registration methods.
  8253. */
  8254. ASSET_TYPES.forEach(function (type) {
  8255. Vue[type] = function (
  8256. id,
  8257. definition
  8258. ) {
  8259. if (!definition) {
  8260. return this.options[type + 's'][id]
  8261. } else {
  8262. /* istanbul ignore if */
  8263. if ( true && type === 'component') {
  8264. validateComponentName(id);
  8265. }
  8266. if (type === 'component' && isPlainObject(definition)) {
  8267. definition.name = definition.name || id;
  8268. definition = this.options._base.extend(definition);
  8269. }
  8270. if (type === 'directive' && typeof definition === 'function') {
  8271. definition = { bind: definition, update: definition };
  8272. }
  8273. this.options[type + 's'][id] = definition;
  8274. return definition
  8275. }
  8276. };
  8277. });
  8278. }
  8279. /* */
  8280. function getComponentName (opts) {
  8281. return opts && (opts.Ctor.options.name || opts.tag)
  8282. }
  8283. function matches (pattern, name) {
  8284. if (Array.isArray(pattern)) {
  8285. return pattern.indexOf(name) > -1
  8286. } else if (typeof pattern === 'string') {
  8287. return pattern.split(',').indexOf(name) > -1
  8288. } else if (isRegExp(pattern)) {
  8289. return pattern.test(name)
  8290. }
  8291. /* istanbul ignore next */
  8292. return false
  8293. }
  8294. function pruneCache (keepAliveInstance, filter) {
  8295. var cache = keepAliveInstance.cache;
  8296. var keys = keepAliveInstance.keys;
  8297. var _vnode = keepAliveInstance._vnode;
  8298. for (var key in cache) {
  8299. var cachedNode = cache[key];
  8300. if (cachedNode) {
  8301. var name = getComponentName(cachedNode.componentOptions);
  8302. if (name && !filter(name)) {
  8303. pruneCacheEntry(cache, key, keys, _vnode);
  8304. }
  8305. }
  8306. }
  8307. }
  8308. function pruneCacheEntry (
  8309. cache,
  8310. key,
  8311. keys,
  8312. current
  8313. ) {
  8314. var cached$$1 = cache[key];
  8315. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8316. cached$$1.componentInstance.$destroy();
  8317. }
  8318. cache[key] = null;
  8319. remove(keys, key);
  8320. }
  8321. var patternTypes = [String, RegExp, Array];
  8322. var KeepAlive = {
  8323. name: 'keep-alive',
  8324. abstract: true,
  8325. props: {
  8326. include: patternTypes,
  8327. exclude: patternTypes,
  8328. max: [String, Number]
  8329. },
  8330. created: function created () {
  8331. this.cache = Object.create(null);
  8332. this.keys = [];
  8333. },
  8334. destroyed: function destroyed () {
  8335. for (var key in this.cache) {
  8336. pruneCacheEntry(this.cache, key, this.keys);
  8337. }
  8338. },
  8339. mounted: function mounted () {
  8340. var this$1 = this;
  8341. this.$watch('include', function (val) {
  8342. pruneCache(this$1, function (name) { return matches(val, name); });
  8343. });
  8344. this.$watch('exclude', function (val) {
  8345. pruneCache(this$1, function (name) { return !matches(val, name); });
  8346. });
  8347. },
  8348. render: function render () {
  8349. var slot = this.$slots.default;
  8350. var vnode = getFirstComponentChild(slot);
  8351. var componentOptions = vnode && vnode.componentOptions;
  8352. if (componentOptions) {
  8353. // check pattern
  8354. var name = getComponentName(componentOptions);
  8355. var ref = this;
  8356. var include = ref.include;
  8357. var exclude = ref.exclude;
  8358. if (
  8359. // not included
  8360. (include && (!name || !matches(include, name))) ||
  8361. // excluded
  8362. (exclude && name && matches(exclude, name))
  8363. ) {
  8364. return vnode
  8365. }
  8366. var ref$1 = this;
  8367. var cache = ref$1.cache;
  8368. var keys = ref$1.keys;
  8369. var key = vnode.key == null
  8370. // same constructor may get registered as different local components
  8371. // so cid alone is not enough (#3269)
  8372. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8373. : vnode.key;
  8374. if (cache[key]) {
  8375. vnode.componentInstance = cache[key].componentInstance;
  8376. // make current key freshest
  8377. remove(keys, key);
  8378. keys.push(key);
  8379. } else {
  8380. cache[key] = vnode;
  8381. keys.push(key);
  8382. // prune oldest entry
  8383. if (this.max && keys.length > parseInt(this.max)) {
  8384. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8385. }
  8386. }
  8387. vnode.data.keepAlive = true;
  8388. }
  8389. return vnode || (slot && slot[0])
  8390. }
  8391. };
  8392. var builtInComponents = {
  8393. KeepAlive: KeepAlive
  8394. };
  8395. /* */
  8396. function initGlobalAPI (Vue) {
  8397. // config
  8398. var configDef = {};
  8399. configDef.get = function () { return config; };
  8400. if (true) {
  8401. configDef.set = function () {
  8402. warn(
  8403. 'Do not replace the Vue.config object, set individual fields instead.'
  8404. );
  8405. };
  8406. }
  8407. Object.defineProperty(Vue, 'config', configDef);
  8408. // exposed util methods.
  8409. // NOTE: these are not considered part of the public API - avoid relying on
  8410. // them unless you are aware of the risk.
  8411. Vue.util = {
  8412. warn: warn,
  8413. extend: extend,
  8414. mergeOptions: mergeOptions,
  8415. defineReactive: defineReactive$$1
  8416. };
  8417. Vue.set = set;
  8418. Vue.delete = del;
  8419. Vue.nextTick = nextTick;
  8420. // 2.6 explicit observable API
  8421. Vue.observable = function (obj) {
  8422. observe(obj);
  8423. return obj
  8424. };
  8425. Vue.options = Object.create(null);
  8426. ASSET_TYPES.forEach(function (type) {
  8427. Vue.options[type + 's'] = Object.create(null);
  8428. });
  8429. // this is used to identify the "base" constructor to extend all plain-object
  8430. // components with in Weex's multi-instance scenarios.
  8431. Vue.options._base = Vue;
  8432. extend(Vue.options.components, builtInComponents);
  8433. initUse(Vue);
  8434. initMixin$1(Vue);
  8435. initExtend(Vue);
  8436. initAssetRegisters(Vue);
  8437. }
  8438. initGlobalAPI(Vue);
  8439. Object.defineProperty(Vue.prototype, '$isServer', {
  8440. get: isServerRendering
  8441. });
  8442. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8443. get: function get () {
  8444. /* istanbul ignore next */
  8445. return this.$vnode && this.$vnode.ssrContext
  8446. }
  8447. });
  8448. // expose FunctionalRenderContext for ssr runtime helper installation
  8449. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8450. value: FunctionalRenderContext
  8451. });
  8452. Vue.version = '2.6.11';
  8453. /**
  8454. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8455. */
  8456. var ARRAYTYPE = '[object Array]';
  8457. var OBJECTTYPE = '[object Object]';
  8458. // const FUNCTIONTYPE = '[object Function]'
  8459. function diff(current, pre) {
  8460. var result = {};
  8461. syncKeys(current, pre);
  8462. _diff(current, pre, '', result);
  8463. return result
  8464. }
  8465. function syncKeys(current, pre) {
  8466. if (current === pre) { return }
  8467. var rootCurrentType = type(current);
  8468. var rootPreType = type(pre);
  8469. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8470. if(Object.keys(current).length >= Object.keys(pre).length){
  8471. for (var key in pre) {
  8472. var currentValue = current[key];
  8473. if (currentValue === undefined) {
  8474. current[key] = null;
  8475. } else {
  8476. syncKeys(currentValue, pre[key]);
  8477. }
  8478. }
  8479. }
  8480. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8481. if (current.length >= pre.length) {
  8482. pre.forEach(function (item, index) {
  8483. syncKeys(current[index], item);
  8484. });
  8485. }
  8486. }
  8487. }
  8488. function _diff(current, pre, path, result) {
  8489. if (current === pre) { return }
  8490. var rootCurrentType = type(current);
  8491. var rootPreType = type(pre);
  8492. if (rootCurrentType == OBJECTTYPE) {
  8493. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8494. setResult(result, path, current);
  8495. } else {
  8496. var loop = function ( key ) {
  8497. var currentValue = current[key];
  8498. var preValue = pre[key];
  8499. var currentType = type(currentValue);
  8500. var preType = type(preValue);
  8501. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8502. if (currentValue != pre[key]) {
  8503. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8504. }
  8505. } else if (currentType == ARRAYTYPE) {
  8506. if (preType != ARRAYTYPE) {
  8507. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8508. } else {
  8509. if (currentValue.length < preValue.length) {
  8510. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8511. } else {
  8512. currentValue.forEach(function (item, index) {
  8513. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8514. });
  8515. }
  8516. }
  8517. } else if (currentType == OBJECTTYPE) {
  8518. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8519. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8520. } else {
  8521. for (var subKey in currentValue) {
  8522. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8523. }
  8524. }
  8525. }
  8526. };
  8527. for (var key in current) loop( key );
  8528. }
  8529. } else if (rootCurrentType == ARRAYTYPE) {
  8530. if (rootPreType != ARRAYTYPE) {
  8531. setResult(result, path, current);
  8532. } else {
  8533. if (current.length < pre.length) {
  8534. setResult(result, path, current);
  8535. } else {
  8536. current.forEach(function (item, index) {
  8537. _diff(item, pre[index], path + '[' + index + ']', result);
  8538. });
  8539. }
  8540. }
  8541. } else {
  8542. setResult(result, path, current);
  8543. }
  8544. }
  8545. function setResult(result, k, v) {
  8546. // if (type(v) != FUNCTIONTYPE) {
  8547. result[k] = v;
  8548. // }
  8549. }
  8550. function type(obj) {
  8551. return Object.prototype.toString.call(obj)
  8552. }
  8553. /* */
  8554. function flushCallbacks$1(vm) {
  8555. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8556. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"小程序","VUE_APP_PLATFORM":"mp-alipay","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8557. var mpInstance = vm.$scope;
  8558. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8559. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8560. }
  8561. var copies = vm.__next_tick_callbacks.slice(0);
  8562. vm.__next_tick_callbacks.length = 0;
  8563. for (var i = 0; i < copies.length; i++) {
  8564. copies[i]();
  8565. }
  8566. }
  8567. }
  8568. function hasRenderWatcher(vm) {
  8569. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8570. }
  8571. function nextTick$1(vm, cb) {
  8572. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8573. //2.nextTick 之前存在 render watcher
  8574. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8575. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"小程序","VUE_APP_PLATFORM":"mp-alipay","BASE_URL":"/"}).VUE_APP_DEBUG){
  8576. var mpInstance = vm.$scope;
  8577. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8578. ']:nextVueTick');
  8579. }
  8580. return nextTick(cb, vm)
  8581. }else{
  8582. if(Object({"NODE_ENV":"development","VUE_APP_NAME":"小程序","VUE_APP_PLATFORM":"mp-alipay","BASE_URL":"/"}).VUE_APP_DEBUG){
  8583. var mpInstance$1 = vm.$scope;
  8584. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8585. ']:nextMPTick');
  8586. }
  8587. }
  8588. var _resolve;
  8589. if (!vm.__next_tick_callbacks) {
  8590. vm.__next_tick_callbacks = [];
  8591. }
  8592. vm.__next_tick_callbacks.push(function () {
  8593. if (cb) {
  8594. try {
  8595. cb.call(vm);
  8596. } catch (e) {
  8597. handleError(e, vm, 'nextTick');
  8598. }
  8599. } else if (_resolve) {
  8600. _resolve(vm);
  8601. }
  8602. });
  8603. // $flow-disable-line
  8604. if (!cb && typeof Promise !== 'undefined') {
  8605. return new Promise(function (resolve) {
  8606. _resolve = resolve;
  8607. })
  8608. }
  8609. }
  8610. /* */
  8611. function cloneWithData(vm) {
  8612. // 确保当前 vm 所有数据被同步
  8613. var ret = Object.create(null);
  8614. var dataKeys = [].concat(
  8615. Object.keys(vm._data || {}),
  8616. Object.keys(vm._computedWatchers || {}));
  8617. dataKeys.reduce(function(ret, key) {
  8618. ret[key] = vm[key];
  8619. return ret
  8620. }, ret);
  8621. // vue-composition-api
  8622. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  8623. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  8624. if (rawBindings) {
  8625. Object.keys(rawBindings).forEach(function (key) {
  8626. ret[key] = vm[key];
  8627. });
  8628. }
  8629. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  8630. Object.assign(ret, vm.$mp.data || {});
  8631. if (
  8632. Array.isArray(vm.$options.behaviors) &&
  8633. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8634. ) { //form-field
  8635. ret['name'] = vm.name;
  8636. ret['value'] = vm.value;
  8637. }
  8638. return JSON.parse(JSON.stringify(ret))
  8639. }
  8640. var patch = function(oldVnode, vnode) {
  8641. var this$1 = this;
  8642. if (vnode === null) { //destroy
  8643. return
  8644. }
  8645. if (this.mpType === 'page' || this.mpType === 'component') {
  8646. var mpInstance = this.$scope;
  8647. var data = Object.create(null);
  8648. try {
  8649. data = cloneWithData(this);
  8650. } catch (err) {
  8651. console.error(err);
  8652. }
  8653. data.__webviewId__ = mpInstance.data.__webviewId__;
  8654. var mpData = Object.create(null);
  8655. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  8656. mpData[key] = mpInstance.data[key];
  8657. });
  8658. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  8659. if (Object.keys(diffData).length) {
  8660. if (Object({"NODE_ENV":"development","VUE_APP_NAME":"小程序","VUE_APP_PLATFORM":"mp-alipay","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8661. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  8662. ']差量更新',
  8663. JSON.stringify(diffData));
  8664. }
  8665. this.__next_tick_pending = true;
  8666. mpInstance.setData(diffData, function () {
  8667. this$1.__next_tick_pending = false;
  8668. flushCallbacks$1(this$1);
  8669. });
  8670. } else {
  8671. flushCallbacks$1(this);
  8672. }
  8673. }
  8674. };
  8675. /* */
  8676. function createEmptyRender() {
  8677. }
  8678. function mountComponent$1(
  8679. vm,
  8680. el,
  8681. hydrating
  8682. ) {
  8683. if (!vm.mpType) {//main.js 中的 new Vue
  8684. return vm
  8685. }
  8686. if (vm.mpType === 'app') {
  8687. vm.$options.render = createEmptyRender;
  8688. }
  8689. if (!vm.$options.render) {
  8690. vm.$options.render = createEmptyRender;
  8691. if (true) {
  8692. /* istanbul ignore if */
  8693. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  8694. vm.$options.el || el) {
  8695. warn(
  8696. 'You are using the runtime-only build of Vue where the template ' +
  8697. 'compiler is not available. Either pre-compile the templates into ' +
  8698. 'render functions, or use the compiler-included build.',
  8699. vm
  8700. );
  8701. } else {
  8702. warn(
  8703. 'Failed to mount component: template or render function not defined.',
  8704. vm
  8705. );
  8706. }
  8707. }
  8708. }
  8709. !vm._$fallback && callHook(vm, 'beforeMount');
  8710. var updateComponent = function () {
  8711. vm._update(vm._render(), hydrating);
  8712. };
  8713. // we set this to vm._watcher inside the watcher's constructor
  8714. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  8715. // component's mounted hook), which relies on vm._watcher being already defined
  8716. new Watcher(vm, updateComponent, noop, {
  8717. before: function before() {
  8718. if (vm._isMounted && !vm._isDestroyed) {
  8719. callHook(vm, 'beforeUpdate');
  8720. }
  8721. }
  8722. }, true /* isRenderWatcher */);
  8723. hydrating = false;
  8724. return vm
  8725. }
  8726. /* */
  8727. function renderClass (
  8728. staticClass,
  8729. dynamicClass
  8730. ) {
  8731. if (isDef(staticClass) || isDef(dynamicClass)) {
  8732. return concat(staticClass, stringifyClass(dynamicClass))
  8733. }
  8734. /* istanbul ignore next */
  8735. return ''
  8736. }
  8737. function concat (a, b) {
  8738. return a ? b ? (a + ' ' + b) : a : (b || '')
  8739. }
  8740. function stringifyClass (value) {
  8741. if (Array.isArray(value)) {
  8742. return stringifyArray(value)
  8743. }
  8744. if (isObject(value)) {
  8745. return stringifyObject(value)
  8746. }
  8747. if (typeof value === 'string') {
  8748. return value
  8749. }
  8750. /* istanbul ignore next */
  8751. return ''
  8752. }
  8753. function stringifyArray (value) {
  8754. var res = '';
  8755. var stringified;
  8756. for (var i = 0, l = value.length; i < l; i++) {
  8757. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  8758. if (res) { res += ' '; }
  8759. res += stringified;
  8760. }
  8761. }
  8762. return res
  8763. }
  8764. function stringifyObject (value) {
  8765. var res = '';
  8766. for (var key in value) {
  8767. if (value[key]) {
  8768. if (res) { res += ' '; }
  8769. res += key;
  8770. }
  8771. }
  8772. return res
  8773. }
  8774. /* */
  8775. var parseStyleText = cached(function (cssText) {
  8776. var res = {};
  8777. var listDelimiter = /;(?![^(]*\))/g;
  8778. var propertyDelimiter = /:(.+)/;
  8779. cssText.split(listDelimiter).forEach(function (item) {
  8780. if (item) {
  8781. var tmp = item.split(propertyDelimiter);
  8782. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  8783. }
  8784. });
  8785. return res
  8786. });
  8787. // normalize possible array / string values into Object
  8788. function normalizeStyleBinding (bindingStyle) {
  8789. if (Array.isArray(bindingStyle)) {
  8790. return toObject(bindingStyle)
  8791. }
  8792. if (typeof bindingStyle === 'string') {
  8793. return parseStyleText(bindingStyle)
  8794. }
  8795. return bindingStyle
  8796. }
  8797. /* */
  8798. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  8799. function getTarget(obj, path) {
  8800. var parts = path.split('.');
  8801. var key = parts[0];
  8802. if (key.indexOf('__$n') === 0) { //number index
  8803. key = parseInt(key.replace('__$n', ''));
  8804. }
  8805. if (parts.length === 1) {
  8806. return obj[key]
  8807. }
  8808. return getTarget(obj[key], parts.slice(1).join('.'))
  8809. }
  8810. function internalMixin(Vue) {
  8811. Vue.config.errorHandler = function(err, vm, info) {
  8812. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  8813. console.error(err);
  8814. /* eslint-disable no-undef */
  8815. var app = typeof getApp === 'function' && getApp();
  8816. if (app && app.onError) {
  8817. app.onError(err);
  8818. }
  8819. };
  8820. var oldEmit = Vue.prototype.$emit;
  8821. Vue.prototype.$emit = function(event) {
  8822. if (this.$scope && event) {
  8823. this.$scope['triggerEvent'](event, {
  8824. __args__: toArray(arguments, 1)
  8825. });
  8826. }
  8827. return oldEmit.apply(this, arguments)
  8828. };
  8829. Vue.prototype.$nextTick = function(fn) {
  8830. return nextTick$1(this, fn)
  8831. };
  8832. MP_METHODS.forEach(function (method) {
  8833. Vue.prototype[method] = function(args) {
  8834. if (this.$scope && this.$scope[method]) {
  8835. return this.$scope[method](args)
  8836. }
  8837. // mp-alipay
  8838. if (typeof my === 'undefined') {
  8839. return
  8840. }
  8841. if (method === 'createSelectorQuery') {
  8842. /* eslint-disable no-undef */
  8843. return my.createSelectorQuery(args)
  8844. } else if (method === 'createIntersectionObserver') {
  8845. /* eslint-disable no-undef */
  8846. return my.createIntersectionObserver(args)
  8847. }
  8848. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  8849. };
  8850. });
  8851. Vue.prototype.__init_provide = initProvide;
  8852. Vue.prototype.__init_injections = initInjections;
  8853. Vue.prototype.__call_hook = function(hook, args) {
  8854. var vm = this;
  8855. // #7573 disable dep collection when invoking lifecycle hooks
  8856. pushTarget();
  8857. var handlers = vm.$options[hook];
  8858. var info = hook + " hook";
  8859. var ret;
  8860. if (handlers) {
  8861. for (var i = 0, j = handlers.length; i < j; i++) {
  8862. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  8863. }
  8864. }
  8865. if (vm._hasHookEvent) {
  8866. vm.$emit('hook:' + hook, args);
  8867. }
  8868. popTarget();
  8869. return ret
  8870. };
  8871. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  8872. if (Array.isArray(modifiers)) {
  8873. if (modifiers.indexOf('trim') !== -1) {
  8874. value = value.trim();
  8875. }
  8876. if (modifiers.indexOf('number') !== -1) {
  8877. value = this._n(value);
  8878. }
  8879. }
  8880. if (!target) {
  8881. target = this;
  8882. }
  8883. target[key] = value;
  8884. };
  8885. Vue.prototype.__set_sync = function(target, key, value) {
  8886. if (!target) {
  8887. target = this;
  8888. }
  8889. target[key] = value;
  8890. };
  8891. Vue.prototype.__get_orig = function(item) {
  8892. if (isPlainObject(item)) {
  8893. return item['$orig'] || item
  8894. }
  8895. return item
  8896. };
  8897. Vue.prototype.__get_value = function(dataPath, target) {
  8898. return getTarget(target || this, dataPath)
  8899. };
  8900. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  8901. return renderClass(staticClass, dynamicClass)
  8902. };
  8903. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  8904. if (!dynamicStyle && !staticStyle) {
  8905. return ''
  8906. }
  8907. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  8908. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  8909. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  8910. };
  8911. Vue.prototype.__map = function(val, iteratee) {
  8912. //TODO 暂不考虑 string
  8913. var ret, i, l, keys, key;
  8914. if (Array.isArray(val)) {
  8915. ret = new Array(val.length);
  8916. for (i = 0, l = val.length; i < l; i++) {
  8917. ret[i] = iteratee(val[i], i);
  8918. }
  8919. return ret
  8920. } else if (isObject(val)) {
  8921. keys = Object.keys(val);
  8922. ret = Object.create(null);
  8923. for (i = 0, l = keys.length; i < l; i++) {
  8924. key = keys[i];
  8925. ret[key] = iteratee(val[key], key, i);
  8926. }
  8927. return ret
  8928. } else if (typeof val === 'number') {
  8929. ret = new Array(val);
  8930. for (i = 0, l = val; i < l; i++) {
  8931. // 第一个参数暂时仍和小程序一致
  8932. ret[i] = iteratee(i, i);
  8933. }
  8934. return ret
  8935. }
  8936. return []
  8937. };
  8938. }
  8939. /* */
  8940. var LIFECYCLE_HOOKS$1 = [
  8941. //App
  8942. 'onLaunch',
  8943. 'onShow',
  8944. 'onHide',
  8945. 'onUniNViewMessage',
  8946. 'onPageNotFound',
  8947. 'onThemeChange',
  8948. 'onError',
  8949. 'onUnhandledRejection',
  8950. //Page
  8951. 'onInit',
  8952. 'onLoad',
  8953. // 'onShow',
  8954. 'onReady',
  8955. // 'onHide',
  8956. 'onUnload',
  8957. 'onPullDownRefresh',
  8958. 'onReachBottom',
  8959. 'onTabItemTap',
  8960. 'onAddToFavorites',
  8961. 'onShareTimeline',
  8962. 'onShareAppMessage',
  8963. 'onResize',
  8964. 'onPageScroll',
  8965. 'onNavigationBarButtonTap',
  8966. 'onBackPress',
  8967. 'onNavigationBarSearchInputChanged',
  8968. 'onNavigationBarSearchInputConfirmed',
  8969. 'onNavigationBarSearchInputClicked',
  8970. //Component
  8971. // 'onReady', // 兼容旧版本,应该移除该事件
  8972. 'onPageShow',
  8973. 'onPageHide',
  8974. 'onPageResize'
  8975. ];
  8976. function lifecycleMixin$1(Vue) {
  8977. //fixed vue-class-component
  8978. var oldExtend = Vue.extend;
  8979. Vue.extend = function(extendOptions) {
  8980. extendOptions = extendOptions || {};
  8981. var methods = extendOptions.methods;
  8982. if (methods) {
  8983. Object.keys(methods).forEach(function (methodName) {
  8984. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  8985. extendOptions[methodName] = methods[methodName];
  8986. delete methods[methodName];
  8987. }
  8988. });
  8989. }
  8990. return oldExtend.call(this, extendOptions)
  8991. };
  8992. var strategies = Vue.config.optionMergeStrategies;
  8993. var mergeHook = strategies.created;
  8994. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  8995. strategies[hook] = mergeHook;
  8996. });
  8997. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  8998. }
  8999. /* */
  9000. // install platform patch function
  9001. Vue.prototype.__patch__ = patch;
  9002. // public mount method
  9003. Vue.prototype.$mount = function(
  9004. el ,
  9005. hydrating
  9006. ) {
  9007. return mountComponent$1(this, el, hydrating)
  9008. };
  9009. lifecycleMixin$1(Vue);
  9010. internalMixin(Vue);
  9011. /* */
  9012. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  9013. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  9014. /***/ }),
  9015. /***/ 20:
  9016. /*!*****************************************************************!*\
  9017. !*** C:/Users/first/Documents/HBuilderProjects/小程序/util/api.js ***!
  9018. \*****************************************************************/
  9019. /*! no static exports found */
  9020. /***/ (function(module, exports, __webpack_require__) {
  9021. "use strict";
  9022. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.myRequest = void 0;var _settings = _interopRequireDefault(__webpack_require__(/*! @/settings.js */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9023. var myRequest = function myRequest(options) {
  9024. return new Promise(function (resolve, reject) {
  9025. uni.request({
  9026. url: _settings.default.base_url + "/" + _settings.default.prefix + options.url,
  9027. method: options.method || 'GET',
  9028. data: options.data || {},
  9029. success: function success(res) {
  9030. if (res.statusCode !== 200) {
  9031. return uni.showToast({
  9032. title: '获取数据失败' });
  9033. }
  9034. resolve(res.data);
  9035. },
  9036. fail: function fail(err) {
  9037. uni.showToast({
  9038. title: '请求接口失败' });
  9039. reject(err);
  9040. } });
  9041. });
  9042. };exports.myRequest = myRequest;
  9043. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-alipay/dist/index.js */ 1)["default"]))
  9044. /***/ }),
  9045. /***/ 27:
  9046. /*!************************************************************************!*\
  9047. !*** C:/Users/first/Documents/HBuilderProjects/小程序/util/permission.js ***!
  9048. \************************************************************************/
  9049. /*! no static exports found */
  9050. /***/ (function(module, exports, __webpack_require__) {
  9051. "use strict";
  9052. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = _default;var _index = _interopRequireDefault(__webpack_require__(/*! ../store/index.js */ 15));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9053. function _default() {
  9054. if (_index.default.state.userInfo.nickName === undefined) {
  9055. uni.navigateTo({
  9056. url: "/pages/authen/identity" });
  9057. return false;
  9058. }
  9059. if (_index.default.state.phoneNumber === '' || _index.default.state.openId === '' || _index.default.state.unionId === '') {
  9060. uni.navigateTo({
  9061. url: "/pages/authen/login" });
  9062. return false;
  9063. }
  9064. return true;
  9065. }
  9066. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-alipay/dist/index.js */ 1)["default"]))
  9067. /***/ }),
  9068. /***/ 3:
  9069. /*!***********************************!*\
  9070. !*** (webpack)/buildin/global.js ***!
  9071. \***********************************/
  9072. /*! no static exports found */
  9073. /***/ (function(module, exports) {
  9074. var g;
  9075. // This works in non-strict mode
  9076. g = (function() {
  9077. return this;
  9078. })();
  9079. try {
  9080. // This works if eval is allowed (see CSP)
  9081. g = g || new Function("return this")();
  9082. } catch (e) {
  9083. // This works if the window reference is available
  9084. if (typeof window === "object") g = window;
  9085. }
  9086. // g can still be undefined, but nothing to do about it...
  9087. // We return undefined, instead of nothing here, so it's
  9088. // easier to handle this case. if(!global) { ...}
  9089. module.exports = g;
  9090. /***/ }),
  9091. /***/ 36:
  9092. /*!**********************************************************!*\
  9093. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  9094. \**********************************************************/
  9095. /*! no static exports found */
  9096. /***/ (function(module, exports, __webpack_require__) {
  9097. module.exports = __webpack_require__(/*! regenerator-runtime */ 37);
  9098. /***/ }),
  9099. /***/ 37:
  9100. /*!************************************************************!*\
  9101. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  9102. \************************************************************/
  9103. /*! no static exports found */
  9104. /***/ (function(module, exports, __webpack_require__) {
  9105. /**
  9106. * Copyright (c) 2014-present, Facebook, Inc.
  9107. *
  9108. * This source code is licensed under the MIT license found in the
  9109. * LICENSE file in the root directory of this source tree.
  9110. */
  9111. // This method of obtaining a reference to the global object needs to be
  9112. // kept identical to the way it is obtained in runtime.js
  9113. var g = (function() {
  9114. return this || (typeof self === "object" && self);
  9115. })() || Function("return this")();
  9116. // Use `getOwnPropertyNames` because not all browsers support calling
  9117. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  9118. var hadRuntime = g.regeneratorRuntime &&
  9119. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  9120. // Save the old regeneratorRuntime in case it needs to be restored later.
  9121. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  9122. // Force reevalutation of runtime.js.
  9123. g.regeneratorRuntime = undefined;
  9124. module.exports = __webpack_require__(/*! ./runtime */ 38);
  9125. if (hadRuntime) {
  9126. // Restore the original runtime.
  9127. g.regeneratorRuntime = oldRuntime;
  9128. } else {
  9129. // Remove the global property added by runtime.js.
  9130. try {
  9131. delete g.regeneratorRuntime;
  9132. } catch(e) {
  9133. g.regeneratorRuntime = undefined;
  9134. }
  9135. }
  9136. /***/ }),
  9137. /***/ 38:
  9138. /*!*****************************************************!*\
  9139. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  9140. \*****************************************************/
  9141. /*! no static exports found */
  9142. /***/ (function(module, exports) {
  9143. /**
  9144. * Copyright (c) 2014-present, Facebook, Inc.
  9145. *
  9146. * This source code is licensed under the MIT license found in the
  9147. * LICENSE file in the root directory of this source tree.
  9148. */
  9149. !(function(global) {
  9150. "use strict";
  9151. var Op = Object.prototype;
  9152. var hasOwn = Op.hasOwnProperty;
  9153. var undefined; // More compressible than void 0.
  9154. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  9155. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  9156. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  9157. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  9158. var inModule = typeof module === "object";
  9159. var runtime = global.regeneratorRuntime;
  9160. if (runtime) {
  9161. if (inModule) {
  9162. // If regeneratorRuntime is defined globally and we're in a module,
  9163. // make the exports object identical to regeneratorRuntime.
  9164. module.exports = runtime;
  9165. }
  9166. // Don't bother evaluating the rest of this file if the runtime was
  9167. // already defined globally.
  9168. return;
  9169. }
  9170. // Define the runtime globally (as expected by generated code) as either
  9171. // module.exports (if we're in a module) or a new, empty object.
  9172. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  9173. function wrap(innerFn, outerFn, self, tryLocsList) {
  9174. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  9175. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  9176. var generator = Object.create(protoGenerator.prototype);
  9177. var context = new Context(tryLocsList || []);
  9178. // The ._invoke method unifies the implementations of the .next,
  9179. // .throw, and .return methods.
  9180. generator._invoke = makeInvokeMethod(innerFn, self, context);
  9181. return generator;
  9182. }
  9183. runtime.wrap = wrap;
  9184. // Try/catch helper to minimize deoptimizations. Returns a completion
  9185. // record like context.tryEntries[i].completion. This interface could
  9186. // have been (and was previously) designed to take a closure to be
  9187. // invoked without arguments, but in all the cases we care about we
  9188. // already have an existing method we want to call, so there's no need
  9189. // to create a new function object. We can even get away with assuming
  9190. // the method takes exactly one argument, since that happens to be true
  9191. // in every case, so we don't have to touch the arguments object. The
  9192. // only additional allocation required is the completion record, which
  9193. // has a stable shape and so hopefully should be cheap to allocate.
  9194. function tryCatch(fn, obj, arg) {
  9195. try {
  9196. return { type: "normal", arg: fn.call(obj, arg) };
  9197. } catch (err) {
  9198. return { type: "throw", arg: err };
  9199. }
  9200. }
  9201. var GenStateSuspendedStart = "suspendedStart";
  9202. var GenStateSuspendedYield = "suspendedYield";
  9203. var GenStateExecuting = "executing";
  9204. var GenStateCompleted = "completed";
  9205. // Returning this object from the innerFn has the same effect as
  9206. // breaking out of the dispatch switch statement.
  9207. var ContinueSentinel = {};
  9208. // Dummy constructor functions that we use as the .constructor and
  9209. // .constructor.prototype properties for functions that return Generator
  9210. // objects. For full spec compliance, you may wish to configure your
  9211. // minifier not to mangle the names of these two functions.
  9212. function Generator() {}
  9213. function GeneratorFunction() {}
  9214. function GeneratorFunctionPrototype() {}
  9215. // This is a polyfill for %IteratorPrototype% for environments that
  9216. // don't natively support it.
  9217. var IteratorPrototype = {};
  9218. IteratorPrototype[iteratorSymbol] = function () {
  9219. return this;
  9220. };
  9221. var getProto = Object.getPrototypeOf;
  9222. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  9223. if (NativeIteratorPrototype &&
  9224. NativeIteratorPrototype !== Op &&
  9225. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  9226. // This environment has a native %IteratorPrototype%; use it instead
  9227. // of the polyfill.
  9228. IteratorPrototype = NativeIteratorPrototype;
  9229. }
  9230. var Gp = GeneratorFunctionPrototype.prototype =
  9231. Generator.prototype = Object.create(IteratorPrototype);
  9232. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  9233. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  9234. GeneratorFunctionPrototype[toStringTagSymbol] =
  9235. GeneratorFunction.displayName = "GeneratorFunction";
  9236. // Helper for defining the .next, .throw, and .return methods of the
  9237. // Iterator interface in terms of a single ._invoke method.
  9238. function defineIteratorMethods(prototype) {
  9239. ["next", "throw", "return"].forEach(function(method) {
  9240. prototype[method] = function(arg) {
  9241. return this._invoke(method, arg);
  9242. };
  9243. });
  9244. }
  9245. runtime.isGeneratorFunction = function(genFun) {
  9246. var ctor = typeof genFun === "function" && genFun.constructor;
  9247. return ctor
  9248. ? ctor === GeneratorFunction ||
  9249. // For the native GeneratorFunction constructor, the best we can
  9250. // do is to check its .name property.
  9251. (ctor.displayName || ctor.name) === "GeneratorFunction"
  9252. : false;
  9253. };
  9254. runtime.mark = function(genFun) {
  9255. if (Object.setPrototypeOf) {
  9256. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  9257. } else {
  9258. genFun.__proto__ = GeneratorFunctionPrototype;
  9259. if (!(toStringTagSymbol in genFun)) {
  9260. genFun[toStringTagSymbol] = "GeneratorFunction";
  9261. }
  9262. }
  9263. genFun.prototype = Object.create(Gp);
  9264. return genFun;
  9265. };
  9266. // Within the body of any async function, `await x` is transformed to
  9267. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  9268. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  9269. // meant to be awaited.
  9270. runtime.awrap = function(arg) {
  9271. return { __await: arg };
  9272. };
  9273. function AsyncIterator(generator) {
  9274. function invoke(method, arg, resolve, reject) {
  9275. var record = tryCatch(generator[method], generator, arg);
  9276. if (record.type === "throw") {
  9277. reject(record.arg);
  9278. } else {
  9279. var result = record.arg;
  9280. var value = result.value;
  9281. if (value &&
  9282. typeof value === "object" &&
  9283. hasOwn.call(value, "__await")) {
  9284. return Promise.resolve(value.__await).then(function(value) {
  9285. invoke("next", value, resolve, reject);
  9286. }, function(err) {
  9287. invoke("throw", err, resolve, reject);
  9288. });
  9289. }
  9290. return Promise.resolve(value).then(function(unwrapped) {
  9291. // When a yielded Promise is resolved, its final value becomes
  9292. // the .value of the Promise<{value,done}> result for the
  9293. // current iteration.
  9294. result.value = unwrapped;
  9295. resolve(result);
  9296. }, function(error) {
  9297. // If a rejected Promise was yielded, throw the rejection back
  9298. // into the async generator function so it can be handled there.
  9299. return invoke("throw", error, resolve, reject);
  9300. });
  9301. }
  9302. }
  9303. var previousPromise;
  9304. function enqueue(method, arg) {
  9305. function callInvokeWithMethodAndArg() {
  9306. return new Promise(function(resolve, reject) {
  9307. invoke(method, arg, resolve, reject);
  9308. });
  9309. }
  9310. return previousPromise =
  9311. // If enqueue has been called before, then we want to wait until
  9312. // all previous Promises have been resolved before calling invoke,
  9313. // so that results are always delivered in the correct order. If
  9314. // enqueue has not been called before, then it is important to
  9315. // call invoke immediately, without waiting on a callback to fire,
  9316. // so that the async generator function has the opportunity to do
  9317. // any necessary setup in a predictable way. This predictability
  9318. // is why the Promise constructor synchronously invokes its
  9319. // executor callback, and why async functions synchronously
  9320. // execute code before the first await. Since we implement simple
  9321. // async functions in terms of async generators, it is especially
  9322. // important to get this right, even though it requires care.
  9323. previousPromise ? previousPromise.then(
  9324. callInvokeWithMethodAndArg,
  9325. // Avoid propagating failures to Promises returned by later
  9326. // invocations of the iterator.
  9327. callInvokeWithMethodAndArg
  9328. ) : callInvokeWithMethodAndArg();
  9329. }
  9330. // Define the unified helper method that is used to implement .next,
  9331. // .throw, and .return (see defineIteratorMethods).
  9332. this._invoke = enqueue;
  9333. }
  9334. defineIteratorMethods(AsyncIterator.prototype);
  9335. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  9336. return this;
  9337. };
  9338. runtime.AsyncIterator = AsyncIterator;
  9339. // Note that simple async functions are implemented on top of
  9340. // AsyncIterator objects; they just return a Promise for the value of
  9341. // the final result produced by the iterator.
  9342. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  9343. var iter = new AsyncIterator(
  9344. wrap(innerFn, outerFn, self, tryLocsList)
  9345. );
  9346. return runtime.isGeneratorFunction(outerFn)
  9347. ? iter // If outerFn is a generator, return the full iterator.
  9348. : iter.next().then(function(result) {
  9349. return result.done ? result.value : iter.next();
  9350. });
  9351. };
  9352. function makeInvokeMethod(innerFn, self, context) {
  9353. var state = GenStateSuspendedStart;
  9354. return function invoke(method, arg) {
  9355. if (state === GenStateExecuting) {
  9356. throw new Error("Generator is already running");
  9357. }
  9358. if (state === GenStateCompleted) {
  9359. if (method === "throw") {
  9360. throw arg;
  9361. }
  9362. // Be forgiving, per 25.3.3.3.3 of the spec:
  9363. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  9364. return doneResult();
  9365. }
  9366. context.method = method;
  9367. context.arg = arg;
  9368. while (true) {
  9369. var delegate = context.delegate;
  9370. if (delegate) {
  9371. var delegateResult = maybeInvokeDelegate(delegate, context);
  9372. if (delegateResult) {
  9373. if (delegateResult === ContinueSentinel) continue;
  9374. return delegateResult;
  9375. }
  9376. }
  9377. if (context.method === "next") {
  9378. // Setting context._sent for legacy support of Babel's
  9379. // function.sent implementation.
  9380. context.sent = context._sent = context.arg;
  9381. } else if (context.method === "throw") {
  9382. if (state === GenStateSuspendedStart) {
  9383. state = GenStateCompleted;
  9384. throw context.arg;
  9385. }
  9386. context.dispatchException(context.arg);
  9387. } else if (context.method === "return") {
  9388. context.abrupt("return", context.arg);
  9389. }
  9390. state = GenStateExecuting;
  9391. var record = tryCatch(innerFn, self, context);
  9392. if (record.type === "normal") {
  9393. // If an exception is thrown from innerFn, we leave state ===
  9394. // GenStateExecuting and loop back for another invocation.
  9395. state = context.done
  9396. ? GenStateCompleted
  9397. : GenStateSuspendedYield;
  9398. if (record.arg === ContinueSentinel) {
  9399. continue;
  9400. }
  9401. return {
  9402. value: record.arg,
  9403. done: context.done
  9404. };
  9405. } else if (record.type === "throw") {
  9406. state = GenStateCompleted;
  9407. // Dispatch the exception by looping back around to the
  9408. // context.dispatchException(context.arg) call above.
  9409. context.method = "throw";
  9410. context.arg = record.arg;
  9411. }
  9412. }
  9413. };
  9414. }
  9415. // Call delegate.iterator[context.method](context.arg) and handle the
  9416. // result, either by returning a { value, done } result from the
  9417. // delegate iterator, or by modifying context.method and context.arg,
  9418. // setting context.delegate to null, and returning the ContinueSentinel.
  9419. function maybeInvokeDelegate(delegate, context) {
  9420. var method = delegate.iterator[context.method];
  9421. if (method === undefined) {
  9422. // A .throw or .return when the delegate iterator has no .throw
  9423. // method always terminates the yield* loop.
  9424. context.delegate = null;
  9425. if (context.method === "throw") {
  9426. if (delegate.iterator.return) {
  9427. // If the delegate iterator has a return method, give it a
  9428. // chance to clean up.
  9429. context.method = "return";
  9430. context.arg = undefined;
  9431. maybeInvokeDelegate(delegate, context);
  9432. if (context.method === "throw") {
  9433. // If maybeInvokeDelegate(context) changed context.method from
  9434. // "return" to "throw", let that override the TypeError below.
  9435. return ContinueSentinel;
  9436. }
  9437. }
  9438. context.method = "throw";
  9439. context.arg = new TypeError(
  9440. "The iterator does not provide a 'throw' method");
  9441. }
  9442. return ContinueSentinel;
  9443. }
  9444. var record = tryCatch(method, delegate.iterator, context.arg);
  9445. if (record.type === "throw") {
  9446. context.method = "throw";
  9447. context.arg = record.arg;
  9448. context.delegate = null;
  9449. return ContinueSentinel;
  9450. }
  9451. var info = record.arg;
  9452. if (! info) {
  9453. context.method = "throw";
  9454. context.arg = new TypeError("iterator result is not an object");
  9455. context.delegate = null;
  9456. return ContinueSentinel;
  9457. }
  9458. if (info.done) {
  9459. // Assign the result of the finished delegate to the temporary
  9460. // variable specified by delegate.resultName (see delegateYield).
  9461. context[delegate.resultName] = info.value;
  9462. // Resume execution at the desired location (see delegateYield).
  9463. context.next = delegate.nextLoc;
  9464. // If context.method was "throw" but the delegate handled the
  9465. // exception, let the outer generator proceed normally. If
  9466. // context.method was "next", forget context.arg since it has been
  9467. // "consumed" by the delegate iterator. If context.method was
  9468. // "return", allow the original .return call to continue in the
  9469. // outer generator.
  9470. if (context.method !== "return") {
  9471. context.method = "next";
  9472. context.arg = undefined;
  9473. }
  9474. } else {
  9475. // Re-yield the result returned by the delegate method.
  9476. return info;
  9477. }
  9478. // The delegate iterator is finished, so forget it and continue with
  9479. // the outer generator.
  9480. context.delegate = null;
  9481. return ContinueSentinel;
  9482. }
  9483. // Define Generator.prototype.{next,throw,return} in terms of the
  9484. // unified ._invoke helper method.
  9485. defineIteratorMethods(Gp);
  9486. Gp[toStringTagSymbol] = "Generator";
  9487. // A Generator should always return itself as the iterator object when the
  9488. // @@iterator function is called on it. Some browsers' implementations of the
  9489. // iterator prototype chain incorrectly implement this, causing the Generator
  9490. // object to not be returned from this call. This ensures that doesn't happen.
  9491. // See https://github.com/facebook/regenerator/issues/274 for more details.
  9492. Gp[iteratorSymbol] = function() {
  9493. return this;
  9494. };
  9495. Gp.toString = function() {
  9496. return "[object Generator]";
  9497. };
  9498. function pushTryEntry(locs) {
  9499. var entry = { tryLoc: locs[0] };
  9500. if (1 in locs) {
  9501. entry.catchLoc = locs[1];
  9502. }
  9503. if (2 in locs) {
  9504. entry.finallyLoc = locs[2];
  9505. entry.afterLoc = locs[3];
  9506. }
  9507. this.tryEntries.push(entry);
  9508. }
  9509. function resetTryEntry(entry) {
  9510. var record = entry.completion || {};
  9511. record.type = "normal";
  9512. delete record.arg;
  9513. entry.completion = record;
  9514. }
  9515. function Context(tryLocsList) {
  9516. // The root entry object (effectively a try statement without a catch
  9517. // or a finally block) gives us a place to store values thrown from
  9518. // locations where there is no enclosing try statement.
  9519. this.tryEntries = [{ tryLoc: "root" }];
  9520. tryLocsList.forEach(pushTryEntry, this);
  9521. this.reset(true);
  9522. }
  9523. runtime.keys = function(object) {
  9524. var keys = [];
  9525. for (var key in object) {
  9526. keys.push(key);
  9527. }
  9528. keys.reverse();
  9529. // Rather than returning an object with a next method, we keep
  9530. // things simple and return the next function itself.
  9531. return function next() {
  9532. while (keys.length) {
  9533. var key = keys.pop();
  9534. if (key in object) {
  9535. next.value = key;
  9536. next.done = false;
  9537. return next;
  9538. }
  9539. }
  9540. // To avoid creating an additional object, we just hang the .value
  9541. // and .done properties off the next function object itself. This
  9542. // also ensures that the minifier will not anonymize the function.
  9543. next.done = true;
  9544. return next;
  9545. };
  9546. };
  9547. function values(iterable) {
  9548. if (iterable) {
  9549. var iteratorMethod = iterable[iteratorSymbol];
  9550. if (iteratorMethod) {
  9551. return iteratorMethod.call(iterable);
  9552. }
  9553. if (typeof iterable.next === "function") {
  9554. return iterable;
  9555. }
  9556. if (!isNaN(iterable.length)) {
  9557. var i = -1, next = function next() {
  9558. while (++i < iterable.length) {
  9559. if (hasOwn.call(iterable, i)) {
  9560. next.value = iterable[i];
  9561. next.done = false;
  9562. return next;
  9563. }
  9564. }
  9565. next.value = undefined;
  9566. next.done = true;
  9567. return next;
  9568. };
  9569. return next.next = next;
  9570. }
  9571. }
  9572. // Return an iterator with no values.
  9573. return { next: doneResult };
  9574. }
  9575. runtime.values = values;
  9576. function doneResult() {
  9577. return { value: undefined, done: true };
  9578. }
  9579. Context.prototype = {
  9580. constructor: Context,
  9581. reset: function(skipTempReset) {
  9582. this.prev = 0;
  9583. this.next = 0;
  9584. // Resetting context._sent for legacy support of Babel's
  9585. // function.sent implementation.
  9586. this.sent = this._sent = undefined;
  9587. this.done = false;
  9588. this.delegate = null;
  9589. this.method = "next";
  9590. this.arg = undefined;
  9591. this.tryEntries.forEach(resetTryEntry);
  9592. if (!skipTempReset) {
  9593. for (var name in this) {
  9594. // Not sure about the optimal order of these conditions:
  9595. if (name.charAt(0) === "t" &&
  9596. hasOwn.call(this, name) &&
  9597. !isNaN(+name.slice(1))) {
  9598. this[name] = undefined;
  9599. }
  9600. }
  9601. }
  9602. },
  9603. stop: function() {
  9604. this.done = true;
  9605. var rootEntry = this.tryEntries[0];
  9606. var rootRecord = rootEntry.completion;
  9607. if (rootRecord.type === "throw") {
  9608. throw rootRecord.arg;
  9609. }
  9610. return this.rval;
  9611. },
  9612. dispatchException: function(exception) {
  9613. if (this.done) {
  9614. throw exception;
  9615. }
  9616. var context = this;
  9617. function handle(loc, caught) {
  9618. record.type = "throw";
  9619. record.arg = exception;
  9620. context.next = loc;
  9621. if (caught) {
  9622. // If the dispatched exception was caught by a catch block,
  9623. // then let that catch block handle the exception normally.
  9624. context.method = "next";
  9625. context.arg = undefined;
  9626. }
  9627. return !! caught;
  9628. }
  9629. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9630. var entry = this.tryEntries[i];
  9631. var record = entry.completion;
  9632. if (entry.tryLoc === "root") {
  9633. // Exception thrown outside of any try block that could handle
  9634. // it, so set the completion value of the entire function to
  9635. // throw the exception.
  9636. return handle("end");
  9637. }
  9638. if (entry.tryLoc <= this.prev) {
  9639. var hasCatch = hasOwn.call(entry, "catchLoc");
  9640. var hasFinally = hasOwn.call(entry, "finallyLoc");
  9641. if (hasCatch && hasFinally) {
  9642. if (this.prev < entry.catchLoc) {
  9643. return handle(entry.catchLoc, true);
  9644. } else if (this.prev < entry.finallyLoc) {
  9645. return handle(entry.finallyLoc);
  9646. }
  9647. } else if (hasCatch) {
  9648. if (this.prev < entry.catchLoc) {
  9649. return handle(entry.catchLoc, true);
  9650. }
  9651. } else if (hasFinally) {
  9652. if (this.prev < entry.finallyLoc) {
  9653. return handle(entry.finallyLoc);
  9654. }
  9655. } else {
  9656. throw new Error("try statement without catch or finally");
  9657. }
  9658. }
  9659. }
  9660. },
  9661. abrupt: function(type, arg) {
  9662. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9663. var entry = this.tryEntries[i];
  9664. if (entry.tryLoc <= this.prev &&
  9665. hasOwn.call(entry, "finallyLoc") &&
  9666. this.prev < entry.finallyLoc) {
  9667. var finallyEntry = entry;
  9668. break;
  9669. }
  9670. }
  9671. if (finallyEntry &&
  9672. (type === "break" ||
  9673. type === "continue") &&
  9674. finallyEntry.tryLoc <= arg &&
  9675. arg <= finallyEntry.finallyLoc) {
  9676. // Ignore the finally entry if control is not jumping to a
  9677. // location outside the try/catch block.
  9678. finallyEntry = null;
  9679. }
  9680. var record = finallyEntry ? finallyEntry.completion : {};
  9681. record.type = type;
  9682. record.arg = arg;
  9683. if (finallyEntry) {
  9684. this.method = "next";
  9685. this.next = finallyEntry.finallyLoc;
  9686. return ContinueSentinel;
  9687. }
  9688. return this.complete(record);
  9689. },
  9690. complete: function(record, afterLoc) {
  9691. if (record.type === "throw") {
  9692. throw record.arg;
  9693. }
  9694. if (record.type === "break" ||
  9695. record.type === "continue") {
  9696. this.next = record.arg;
  9697. } else if (record.type === "return") {
  9698. this.rval = this.arg = record.arg;
  9699. this.method = "return";
  9700. this.next = "end";
  9701. } else if (record.type === "normal" && afterLoc) {
  9702. this.next = afterLoc;
  9703. }
  9704. return ContinueSentinel;
  9705. },
  9706. finish: function(finallyLoc) {
  9707. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9708. var entry = this.tryEntries[i];
  9709. if (entry.finallyLoc === finallyLoc) {
  9710. this.complete(entry.completion, entry.afterLoc);
  9711. resetTryEntry(entry);
  9712. return ContinueSentinel;
  9713. }
  9714. }
  9715. },
  9716. "catch": function(tryLoc) {
  9717. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9718. var entry = this.tryEntries[i];
  9719. if (entry.tryLoc === tryLoc) {
  9720. var record = entry.completion;
  9721. if (record.type === "throw") {
  9722. var thrown = record.arg;
  9723. resetTryEntry(entry);
  9724. }
  9725. return thrown;
  9726. }
  9727. }
  9728. // The context.catch method must only be called with a location
  9729. // argument that corresponds to a known catch block.
  9730. throw new Error("illegal catch attempt");
  9731. },
  9732. delegateYield: function(iterable, resultName, nextLoc) {
  9733. this.delegate = {
  9734. iterator: values(iterable),
  9735. resultName: resultName,
  9736. nextLoc: nextLoc
  9737. };
  9738. if (this.method === "next") {
  9739. // Deliberately forget the last sent value so that we don't
  9740. // accidentally pass it on to the delegate.
  9741. this.arg = undefined;
  9742. }
  9743. return ContinueSentinel;
  9744. }
  9745. };
  9746. })(
  9747. // In sloppy mode, unbound `this` refers to the global object, fallback to
  9748. // Function constructor if we're in global strict mode. That is sadly a form
  9749. // of indirect eval which violates Content Security Policy.
  9750. (function() {
  9751. return this || (typeof self === "object" && self);
  9752. })() || Function("return this")()
  9753. );
  9754. /***/ }),
  9755. /***/ 4:
  9756. /*!****************************************************************!*\
  9757. !*** C:/Users/first/Documents/HBuilderProjects/小程序/pages.json ***!
  9758. \****************************************************************/
  9759. /*! no static exports found */
  9760. /***/ (function(module, exports) {
  9761. /***/ }),
  9762. /***/ 5:
  9763. /*!*******************************************************!*\
  9764. !*** ./node_modules/@dcloudio/uni-stat/dist/index.js ***!
  9765. \*******************************************************/
  9766. /*! no static exports found */
  9767. /***/ (function(module, exports, __webpack_require__) {
  9768. "use strict";
  9769. /* WEBPACK VAR INJECTION */(function(uni) {var _package = __webpack_require__(/*! ../package.json */ 6);function _inherits(subClass, superClass) {if (typeof superClass !== "function" && superClass !== null) {throw new TypeError("Super expression must either be null or a function");}subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });if (superClass) _setPrototypeOf(subClass, superClass);}function _setPrototypeOf(o, p) {_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {o.__proto__ = p;return o;};return _setPrototypeOf(o, p);}function _createSuper(Derived) {var hasNativeReflectConstruct = _isNativeReflectConstruct();return function _createSuperInternal() {var Super = _getPrototypeOf(Derived),result;if (hasNativeReflectConstruct) {var NewTarget = _getPrototypeOf(this).constructor;result = Reflect.construct(Super, arguments, NewTarget);} else {result = Super.apply(this, arguments);}return _possibleConstructorReturn(this, result);};}function _possibleConstructorReturn(self, call) {if (call && (typeof call === "object" || typeof call === "function")) {return call;}return _assertThisInitialized(self);}function _assertThisInitialized(self) {if (self === void 0) {throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct() {if (typeof Reflect === "undefined" || !Reflect.construct) return false;if (Reflect.construct.sham) return false;if (typeof Proxy === "function") return true;try {Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));return true;} catch (e) {return false;}}function _getPrototypeOf(o) {_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {return o.__proto__ || Object.getPrototypeOf(o);};return _getPrototypeOf(o);}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;}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;}
  9770. var STAT_VERSION = _package.version;
  9771. var STAT_URL = 'https://tongji.dcloud.io/uni/stat';
  9772. var STAT_H5_URL = 'https://tongji.dcloud.io/uni/stat.gif';
  9773. var PAGE_PVER_TIME = 1800;
  9774. var APP_PVER_TIME = 300;
  9775. var OPERATING_TIME = 10;
  9776. var DIFF_TIME = 60 * 1000 * 60 * 24;
  9777. var statConfig = __webpack_require__(/*! uni-stat-config */ 7).default || __webpack_require__(/*! uni-stat-config */ 7);
  9778. var UUID_KEY = '__DC_STAT_UUID';
  9779. var UUID_VALUE = '__DC_UUID_VALUE';
  9780. function getUuid() {
  9781. var uuid = '';
  9782. if (getPlatformName() === 'n') {
  9783. try {
  9784. uuid = plus.runtime.getDCloudId();
  9785. } catch (e) {
  9786. uuid = '';
  9787. }
  9788. return uuid;
  9789. }
  9790. try {
  9791. uuid = uni.getStorageSync(UUID_KEY);
  9792. } catch (e) {
  9793. uuid = UUID_VALUE;
  9794. }
  9795. if (!uuid) {
  9796. uuid = Date.now() + '' + Math.floor(Math.random() * 1e7);
  9797. try {
  9798. uni.setStorageSync(UUID_KEY, uuid);
  9799. } catch (e) {
  9800. uni.setStorageSync(UUID_KEY, UUID_VALUE);
  9801. }
  9802. }
  9803. return uuid;
  9804. }
  9805. var getSgin = function getSgin(statData) {
  9806. var arr = Object.keys(statData);
  9807. var sortArr = arr.sort();
  9808. var sgin = {};
  9809. var sginStr = '';
  9810. for (var i in sortArr) {
  9811. sgin[sortArr[i]] = statData[sortArr[i]];
  9812. sginStr += sortArr[i] + '=' + statData[sortArr[i]] + '&';
  9813. }
  9814. // const options = sginStr.substr(0, sginStr.length - 1)
  9815. // sginStr = sginStr.substr(0, sginStr.length - 1) + '&key=' + STAT_KEY;
  9816. // const si = crypto.createHash('md5').update(sginStr).digest('hex');
  9817. return {
  9818. sign: '',
  9819. options: sginStr.substr(0, sginStr.length - 1) };
  9820. };
  9821. var getSplicing = function getSplicing(data) {
  9822. var str = '';
  9823. for (var i in data) {
  9824. str += i + '=' + data[i] + '&';
  9825. }
  9826. return str.substr(0, str.length - 1);
  9827. };
  9828. var getTime = function getTime() {
  9829. return parseInt(new Date().getTime() / 1000);
  9830. };
  9831. var getPlatformName = function getPlatformName() {var _platformList;
  9832. var aliArr = ['y', 'a', 'p', 'mp-ali'];
  9833. var platformList = (_platformList = {
  9834. 'app-plus': 'n',
  9835. 'h5': 'h5',
  9836. 'mp-weixin': 'wx' }, _defineProperty(_platformList,
  9837. aliArr.reverse().join(''), 'ali'), _defineProperty(_platformList,
  9838. 'mp-baidu', 'bd'), _defineProperty(_platformList,
  9839. 'mp-toutiao', 'tt'), _defineProperty(_platformList,
  9840. 'mp-qq', 'qq'), _defineProperty(_platformList,
  9841. 'quickapp-native', 'qn'), _defineProperty(_platformList,
  9842. 'mp-kuaishou', 'ks'), _platformList);
  9843. return platformList["mp-alipay"];
  9844. };
  9845. var getPackName = function getPackName() {
  9846. var packName = '';
  9847. if (getPlatformName() === 'wx' || getPlatformName() === 'qq') {
  9848. // 兼容微信小程序低版本基础库
  9849. if (uni.canIUse('getAccountInfoSync')) {
  9850. packName = uni.getAccountInfoSync().miniProgram.appId || '';
  9851. }
  9852. }
  9853. return packName;
  9854. };
  9855. var getVersion = function getVersion() {
  9856. return getPlatformName() === 'n' ? plus.runtime.version : '';
  9857. };
  9858. var getChannel = function getChannel() {
  9859. var platformName = getPlatformName();
  9860. var channel = '';
  9861. if (platformName === 'n') {
  9862. channel = plus.runtime.channel;
  9863. }
  9864. return channel;
  9865. };
  9866. var getScene = function getScene(options) {
  9867. var platformName = getPlatformName();
  9868. var scene = '';
  9869. if (options) {
  9870. return options;
  9871. }
  9872. if (platformName === 'wx') {
  9873. scene = uni.getLaunchOptionsSync().scene;
  9874. }
  9875. return scene;
  9876. };
  9877. var First__Visit__Time__KEY = 'First__Visit__Time';
  9878. var Last__Visit__Time__KEY = 'Last__Visit__Time';
  9879. var getFirstVisitTime = function getFirstVisitTime() {
  9880. var timeStorge = uni.getStorageSync(First__Visit__Time__KEY);
  9881. var time = 0;
  9882. if (timeStorge) {
  9883. time = timeStorge;
  9884. } else {
  9885. time = getTime();
  9886. uni.setStorageSync(First__Visit__Time__KEY, time);
  9887. uni.removeStorageSync(Last__Visit__Time__KEY);
  9888. }
  9889. return time;
  9890. };
  9891. var getLastVisitTime = function getLastVisitTime() {
  9892. var timeStorge = uni.getStorageSync(Last__Visit__Time__KEY);
  9893. var time = 0;
  9894. if (timeStorge) {
  9895. time = timeStorge;
  9896. } else {
  9897. time = '';
  9898. }
  9899. uni.setStorageSync(Last__Visit__Time__KEY, getTime());
  9900. return time;
  9901. };
  9902. var PAGE_RESIDENCE_TIME = '__page__residence__time';
  9903. var First_Page_residence_time = 0;
  9904. var Last_Page_residence_time = 0;
  9905. var setPageResidenceTime = function setPageResidenceTime() {
  9906. First_Page_residence_time = getTime();
  9907. if (getPlatformName() === 'n') {
  9908. uni.setStorageSync(PAGE_RESIDENCE_TIME, getTime());
  9909. }
  9910. return First_Page_residence_time;
  9911. };
  9912. var getPageResidenceTime = function getPageResidenceTime() {
  9913. Last_Page_residence_time = getTime();
  9914. if (getPlatformName() === 'n') {
  9915. First_Page_residence_time = uni.getStorageSync(PAGE_RESIDENCE_TIME);
  9916. }
  9917. return Last_Page_residence_time - First_Page_residence_time;
  9918. };
  9919. var TOTAL__VISIT__COUNT = 'Total__Visit__Count';
  9920. var getTotalVisitCount = function getTotalVisitCount() {
  9921. var timeStorge = uni.getStorageSync(TOTAL__VISIT__COUNT);
  9922. var count = 1;
  9923. if (timeStorge) {
  9924. count = timeStorge;
  9925. count++;
  9926. }
  9927. uni.setStorageSync(TOTAL__VISIT__COUNT, count);
  9928. return count;
  9929. };
  9930. var GetEncodeURIComponentOptions = function GetEncodeURIComponentOptions(statData) {
  9931. var data = {};
  9932. for (var prop in statData) {
  9933. data[prop] = encodeURIComponent(statData[prop]);
  9934. }
  9935. return data;
  9936. };
  9937. var Set__First__Time = 0;
  9938. var Set__Last__Time = 0;
  9939. var getFirstTime = function getFirstTime() {
  9940. var time = new Date().getTime();
  9941. Set__First__Time = time;
  9942. Set__Last__Time = 0;
  9943. return time;
  9944. };
  9945. var getLastTime = function getLastTime() {
  9946. var time = new Date().getTime();
  9947. Set__Last__Time = time;
  9948. return time;
  9949. };
  9950. var getResidenceTime = function getResidenceTime(type) {
  9951. var residenceTime = 0;
  9952. if (Set__First__Time !== 0) {
  9953. residenceTime = Set__Last__Time - Set__First__Time;
  9954. }
  9955. residenceTime = parseInt(residenceTime / 1000);
  9956. residenceTime = residenceTime < 1 ? 1 : residenceTime;
  9957. if (type === 'app') {
  9958. var overtime = residenceTime > APP_PVER_TIME ? true : false;
  9959. return {
  9960. residenceTime: residenceTime,
  9961. overtime: overtime };
  9962. }
  9963. if (type === 'page') {
  9964. var _overtime = residenceTime > PAGE_PVER_TIME ? true : false;
  9965. return {
  9966. residenceTime: residenceTime,
  9967. overtime: _overtime };
  9968. }
  9969. return {
  9970. residenceTime: residenceTime };
  9971. };
  9972. var getRoute = function getRoute() {
  9973. var pages = getCurrentPages();
  9974. var page = pages[pages.length - 1];
  9975. if (!page) return '';
  9976. var _self = page.$vm;
  9977. if (getPlatformName() === 'bd') {
  9978. return _self.$mp && _self.$mp.page.is;
  9979. } else {
  9980. return _self.$scope && _self.$scope.route || _self.$mp && _self.$mp.page.route;
  9981. }
  9982. };
  9983. var getPageRoute = function getPageRoute(self) {
  9984. var pages = getCurrentPages();
  9985. var page = pages[pages.length - 1];
  9986. if (!page) return '';
  9987. var _self = page.$vm;
  9988. var query = self._query;
  9989. var str = query && JSON.stringify(query) !== '{}' ? '?' + JSON.stringify(query) : '';
  9990. // clear
  9991. self._query = '';
  9992. if (getPlatformName() === 'bd') {
  9993. return _self.$mp && _self.$mp.page.is + str;
  9994. } else {
  9995. return _self.$scope && _self.$scope.route + str || _self.$mp && _self.$mp.page.route + str;
  9996. }
  9997. };
  9998. var getPageTypes = function getPageTypes(self) {
  9999. if (self.mpType === 'page' || self.$mp && self.$mp.mpType === 'page' || self.$options.mpType === 'page') {
  10000. return true;
  10001. }
  10002. return false;
  10003. };
  10004. var calibration = function calibration(eventName, options) {
  10005. // login 、 share 、pay_success 、pay_fail 、register 、title
  10006. if (!eventName) {
  10007. console.error("uni.report \u7F3A\u5C11 [eventName] \u53C2\u6570");
  10008. return true;
  10009. }
  10010. if (typeof eventName !== 'string') {
  10011. console.error("uni.report [eventName] \u53C2\u6570\u7C7B\u578B\u9519\u8BEF,\u53EA\u80FD\u4E3A String \u7C7B\u578B");
  10012. return true;
  10013. }
  10014. if (eventName.length > 255) {
  10015. console.error("uni.report [eventName] \u53C2\u6570\u957F\u5EA6\u4E0D\u80FD\u5927\u4E8E 255");
  10016. return true;
  10017. }
  10018. if (typeof options !== 'string' && typeof options !== 'object') {
  10019. console.error("uni.report [options] \u53C2\u6570\u7C7B\u578B\u9519\u8BEF,\u53EA\u80FD\u4E3A String \u6216 Object \u7C7B\u578B");
  10020. return true;
  10021. }
  10022. if (typeof options === 'string' && options.length > 255) {
  10023. console.error("uni.report [options] \u53C2\u6570\u957F\u5EA6\u4E0D\u80FD\u5927\u4E8E 255");
  10024. return true;
  10025. }
  10026. if (eventName === 'title' && typeof options !== 'string') {
  10027. console.error('uni.report [eventName] 参数为 title 时,[options] 参数只能为 String 类型');
  10028. return true;
  10029. }
  10030. };
  10031. var Report_Data_Time = 'Report_Data_Time';
  10032. var Report_Status = 'Report_Status';
  10033. var isReportData = function isReportData() {
  10034. return new Promise(function (resolve, reject) {
  10035. var start_time = '';
  10036. var end_time = new Date().getTime();
  10037. var diff_time = DIFF_TIME;
  10038. var report_status = 1;
  10039. try {
  10040. start_time = uni.getStorageSync(Report_Data_Time);
  10041. report_status = uni.getStorageSync(Report_Status);
  10042. } catch (e) {
  10043. start_time = '';
  10044. report_status = 1;
  10045. }
  10046. if (report_status === '') {
  10047. requestData(function (_ref)
  10048. {var enable = _ref.enable;
  10049. uni.setStorageSync(Report_Data_Time, end_time);
  10050. uni.setStorageSync(Report_Status, enable);
  10051. if (enable === 1) {
  10052. resolve();
  10053. }
  10054. });
  10055. return;
  10056. }
  10057. if (report_status === 1) {
  10058. resolve();
  10059. }
  10060. if (!start_time) {
  10061. uni.setStorageSync(Report_Data_Time, end_time);
  10062. start_time = end_time;
  10063. }
  10064. if (end_time - start_time > diff_time) {
  10065. requestData(function (_ref2)
  10066. {var enable = _ref2.enable;
  10067. uni.setStorageSync(Report_Data_Time, end_time);
  10068. uni.setStorageSync(Report_Status, enable);
  10069. });
  10070. }
  10071. });
  10072. };
  10073. var requestData = function requestData(done) {
  10074. var formData = {
  10075. usv: STAT_VERSION,
  10076. conf: JSON.stringify({
  10077. ak: statConfig.appid }) };
  10078. uni.request({
  10079. url: STAT_URL,
  10080. method: 'GET',
  10081. data: formData,
  10082. success: function success(res) {var
  10083. data =
  10084. res.data;
  10085. if (data.ret === 0) {
  10086. typeof done === 'function' && done({
  10087. enable: data.enable });
  10088. }
  10089. },
  10090. fail: function fail(e) {
  10091. var report_status_code = 1;
  10092. try {
  10093. report_status_code = uni.getStorageSync(Report_Status);
  10094. } catch (e) {
  10095. report_status_code = 1;
  10096. }
  10097. if (report_status_code === '') {
  10098. report_status_code = 1;
  10099. }
  10100. typeof done === 'function' && done({
  10101. enable: report_status_code });
  10102. } });
  10103. };
  10104. var PagesJson = __webpack_require__(/*! uni-pages?{"type":"style"} */ 8).default;
  10105. var statConfig$1 = __webpack_require__(/*! uni-stat-config */ 7).default || __webpack_require__(/*! uni-stat-config */ 7);
  10106. var resultOptions = uni.getSystemInfoSync();var
  10107. Util = /*#__PURE__*/function () {
  10108. function Util() {_classCallCheck(this, Util);
  10109. this.self = '';
  10110. this._retry = 0;
  10111. this._platform = '';
  10112. this._query = {};
  10113. this._navigationBarTitle = {
  10114. config: '',
  10115. page: '',
  10116. report: '',
  10117. lt: '' };
  10118. this._operatingTime = 0;
  10119. this._reportingRequestData = {
  10120. '1': [],
  10121. '11': [] };
  10122. this.__prevent_triggering = false;
  10123. this.__licationHide = false;
  10124. this.__licationShow = false;
  10125. this._lastPageRoute = '';
  10126. this.statData = {
  10127. uuid: getUuid(),
  10128. ut: getPlatformName(),
  10129. mpn: getPackName(),
  10130. ak: statConfig$1.appid,
  10131. usv: STAT_VERSION,
  10132. v: getVersion(),
  10133. ch: getChannel(),
  10134. cn: '',
  10135. pn: '',
  10136. ct: '',
  10137. t: getTime(),
  10138. tt: '',
  10139. p: resultOptions.platform === 'android' ? 'a' : 'i',
  10140. brand: resultOptions.brand || '',
  10141. md: resultOptions.model,
  10142. sv: resultOptions.system.replace(/(Android|iOS)\s/, ''),
  10143. mpsdk: resultOptions.SDKVersion || '',
  10144. mpv: resultOptions.version || '',
  10145. lang: resultOptions.language,
  10146. pr: resultOptions.pixelRatio,
  10147. ww: resultOptions.windowWidth,
  10148. wh: resultOptions.windowHeight,
  10149. sw: resultOptions.screenWidth,
  10150. sh: resultOptions.screenHeight };
  10151. }_createClass(Util, [{ key: "getIsReportData", value: function getIsReportData()
  10152. {
  10153. return isReportData();
  10154. } }, { key: "_applicationShow", value: function _applicationShow()
  10155. {
  10156. if (this.__licationHide) {
  10157. getLastTime();
  10158. var time = getResidenceTime('app');
  10159. if (time.overtime) {
  10160. var options = {
  10161. path: this._lastPageRoute,
  10162. scene: this.statData.sc };
  10163. this._sendReportRequest(options);
  10164. }
  10165. this.__licationHide = false;
  10166. }
  10167. } }, { key: "_applicationHide", value: function _applicationHide(
  10168. self, type) {
  10169. this.__licationHide = true;
  10170. getLastTime();
  10171. var time = getResidenceTime();
  10172. getFirstTime();
  10173. var route = getPageRoute(this);
  10174. this._sendHideRequest({
  10175. urlref: route,
  10176. urlref_ts: time.residenceTime },
  10177. type);
  10178. } }, { key: "_pageShow", value: function _pageShow()
  10179. {
  10180. var route = getPageRoute(this);
  10181. var routepath = getRoute();
  10182. this._navigationBarTitle.config = PagesJson &&
  10183. PagesJson.pages[routepath] &&
  10184. PagesJson.pages[routepath].titleNView &&
  10185. PagesJson.pages[routepath].titleNView.titleText ||
  10186. PagesJson &&
  10187. PagesJson.pages[routepath] &&
  10188. PagesJson.pages[routepath].navigationBarTitleText || '';
  10189. if (this.__licationShow) {
  10190. getFirstTime();
  10191. this.__licationShow = false;
  10192. // console.log('这是 onLauch 之后执行的第一次 pageShow ,为下次记录时间做准备');
  10193. this._lastPageRoute = route;
  10194. return;
  10195. }
  10196. getLastTime();
  10197. this._lastPageRoute = route;
  10198. var time = getResidenceTime('page');
  10199. if (time.overtime) {
  10200. var options = {
  10201. path: this._lastPageRoute,
  10202. scene: this.statData.sc };
  10203. this._sendReportRequest(options);
  10204. }
  10205. getFirstTime();
  10206. } }, { key: "_pageHide", value: function _pageHide()
  10207. {
  10208. if (!this.__licationHide) {
  10209. getLastTime();
  10210. var time = getResidenceTime('page');
  10211. this._sendPageRequest({
  10212. url: this._lastPageRoute,
  10213. urlref: this._lastPageRoute,
  10214. urlref_ts: time.residenceTime });
  10215. this._navigationBarTitle = {
  10216. config: '',
  10217. page: '',
  10218. report: '',
  10219. lt: '' };
  10220. return;
  10221. }
  10222. } }, { key: "_login", value: function _login()
  10223. {
  10224. this._sendEventRequest({
  10225. key: 'login' },
  10226. 0);
  10227. } }, { key: "_share", value: function _share()
  10228. {
  10229. this._sendEventRequest({
  10230. key: 'share' },
  10231. 0);
  10232. } }, { key: "_payment", value: function _payment(
  10233. key) {
  10234. this._sendEventRequest({
  10235. key: key },
  10236. 0);
  10237. } }, { key: "_sendReportRequest", value: function _sendReportRequest(
  10238. options) {
  10239. this._navigationBarTitle.lt = '1';
  10240. var query = options.query && JSON.stringify(options.query) !== '{}' ? '?' + JSON.stringify(options.query) : '';
  10241. this.statData.lt = '1';
  10242. this.statData.url = options.path + query || '';
  10243. this.statData.t = getTime();
  10244. this.statData.sc = getScene(options.scene);
  10245. this.statData.fvts = getFirstVisitTime();
  10246. this.statData.lvts = getLastVisitTime();
  10247. this.statData.tvc = getTotalVisitCount();
  10248. if (getPlatformName() === 'n') {
  10249. this.getProperty();
  10250. } else {
  10251. this.getNetworkInfo();
  10252. }
  10253. } }, { key: "_sendPageRequest", value: function _sendPageRequest(
  10254. opt) {var
  10255. url =
  10256. opt.url,urlref = opt.urlref,urlref_ts = opt.urlref_ts;
  10257. this._navigationBarTitle.lt = '11';
  10258. var options = {
  10259. ak: this.statData.ak,
  10260. uuid: this.statData.uuid,
  10261. lt: '11',
  10262. ut: this.statData.ut,
  10263. url: url,
  10264. tt: this.statData.tt,
  10265. urlref: urlref,
  10266. urlref_ts: urlref_ts,
  10267. ch: this.statData.ch,
  10268. usv: this.statData.usv,
  10269. t: getTime(),
  10270. p: this.statData.p };
  10271. this.request(options);
  10272. } }, { key: "_sendHideRequest", value: function _sendHideRequest(
  10273. opt, type) {var
  10274. urlref =
  10275. opt.urlref,urlref_ts = opt.urlref_ts;
  10276. var options = {
  10277. ak: this.statData.ak,
  10278. uuid: this.statData.uuid,
  10279. lt: '3',
  10280. ut: this.statData.ut,
  10281. urlref: urlref,
  10282. urlref_ts: urlref_ts,
  10283. ch: this.statData.ch,
  10284. usv: this.statData.usv,
  10285. t: getTime(),
  10286. p: this.statData.p };
  10287. this.request(options, type);
  10288. } }, { key: "_sendEventRequest", value: function _sendEventRequest()
  10289. {var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},_ref3$key = _ref3.key,key = _ref3$key === void 0 ? '' : _ref3$key,_ref3$value = _ref3.value,value = _ref3$value === void 0 ? "" : _ref3$value;
  10290. var route = this._lastPageRoute;
  10291. var options = {
  10292. ak: this.statData.ak,
  10293. uuid: this.statData.uuid,
  10294. lt: '21',
  10295. ut: this.statData.ut,
  10296. url: route,
  10297. ch: this.statData.ch,
  10298. e_n: key,
  10299. e_v: typeof value === 'object' ? JSON.stringify(value) : value.toString(),
  10300. usv: this.statData.usv,
  10301. t: getTime(),
  10302. p: this.statData.p };
  10303. this.request(options);
  10304. } }, { key: "getNetworkInfo", value: function getNetworkInfo()
  10305. {var _this = this;
  10306. uni.getNetworkType({
  10307. success: function success(result) {
  10308. _this.statData.net = result.networkType;
  10309. _this.getLocation();
  10310. } });
  10311. } }, { key: "getProperty", value: function getProperty()
  10312. {var _this2 = this;
  10313. plus.runtime.getProperty(plus.runtime.appid, function (wgtinfo) {
  10314. _this2.statData.v = wgtinfo.version || '';
  10315. _this2.getNetworkInfo();
  10316. });
  10317. } }, { key: "getLocation", value: function getLocation()
  10318. {var _this3 = this;
  10319. if (statConfig$1.getLocation) {
  10320. uni.getLocation({
  10321. type: 'wgs84',
  10322. geocode: true,
  10323. success: function success(result) {
  10324. if (result.address) {
  10325. _this3.statData.cn = result.address.country;
  10326. _this3.statData.pn = result.address.province;
  10327. _this3.statData.ct = result.address.city;
  10328. }
  10329. _this3.statData.lat = result.latitude;
  10330. _this3.statData.lng = result.longitude;
  10331. _this3.request(_this3.statData);
  10332. } });
  10333. } else {
  10334. this.statData.lat = 0;
  10335. this.statData.lng = 0;
  10336. this.request(this.statData);
  10337. }
  10338. } }, { key: "request", value: function request(
  10339. data, type) {var _this4 = this;
  10340. var time = getTime();
  10341. var title = this._navigationBarTitle;
  10342. data.ttn = title.page;
  10343. data.ttpj = title.config;
  10344. data.ttc = title.report;
  10345. var requestData = this._reportingRequestData;
  10346. if (getPlatformName() === 'n') {
  10347. requestData = uni.getStorageSync('__UNI__STAT__DATA') || {};
  10348. }
  10349. if (!requestData[data.lt]) {
  10350. requestData[data.lt] = [];
  10351. }
  10352. requestData[data.lt].push(data);
  10353. if (getPlatformName() === 'n') {
  10354. uni.setStorageSync('__UNI__STAT__DATA', requestData);
  10355. }
  10356. if (getPageResidenceTime() < OPERATING_TIME && !type) {
  10357. return;
  10358. }
  10359. var uniStatData = this._reportingRequestData;
  10360. if (getPlatformName() === 'n') {
  10361. uniStatData = uni.getStorageSync('__UNI__STAT__DATA');
  10362. }
  10363. // 时间超过,重新获取时间戳
  10364. setPageResidenceTime();
  10365. var firstArr = [];
  10366. var contentArr = [];
  10367. var lastArr = [];var _loop = function _loop(
  10368. i) {
  10369. var rd = uniStatData[i];
  10370. rd.forEach(function (elm) {
  10371. var newData = getSplicing(elm);
  10372. if (i === 0) {
  10373. firstArr.push(newData);
  10374. } else if (i === 3) {
  10375. lastArr.push(newData);
  10376. } else {
  10377. contentArr.push(newData);
  10378. }
  10379. });};for (var i in uniStatData) {_loop(i);
  10380. }
  10381. firstArr.push.apply(firstArr, contentArr.concat(lastArr));
  10382. var optionsData = {
  10383. usv: STAT_VERSION, //统计 SDK 版本号
  10384. t: time, //发送请求时的时间戮
  10385. requests: JSON.stringify(firstArr) };
  10386. this._reportingRequestData = {};
  10387. if (getPlatformName() === 'n') {
  10388. uni.removeStorageSync('__UNI__STAT__DATA');
  10389. }
  10390. if (data.ut === 'h5') {
  10391. this.imageRequest(optionsData);
  10392. return;
  10393. }
  10394. if (getPlatformName() === 'n' && this.statData.p === 'a') {
  10395. setTimeout(function () {
  10396. _this4._sendRequest(optionsData);
  10397. }, 200);
  10398. return;
  10399. }
  10400. this._sendRequest(optionsData);
  10401. } }, { key: "_sendRequest", value: function _sendRequest(
  10402. optionsData) {var _this5 = this;
  10403. this.getIsReportData().then(function () {
  10404. uni.request({
  10405. url: STAT_URL,
  10406. method: 'POST',
  10407. // header: {
  10408. // 'content-type': 'application/json' // 默认值
  10409. // },
  10410. data: optionsData,
  10411. success: function success() {
  10412. // if (process.env.NODE_ENV === 'development') {
  10413. // console.log('stat request success');
  10414. // }
  10415. },
  10416. fail: function fail(e) {
  10417. if (++_this5._retry < 3) {
  10418. setTimeout(function () {
  10419. _this5._sendRequest(optionsData);
  10420. }, 1000);
  10421. }
  10422. } });
  10423. });
  10424. }
  10425. /**
  10426. * h5 请求
  10427. */ }, { key: "imageRequest", value: function imageRequest(
  10428. data) {
  10429. this.getIsReportData().then(function () {
  10430. var image = new Image();
  10431. var options = getSgin(GetEncodeURIComponentOptions(data)).options;
  10432. image.src = STAT_H5_URL + '?' + options;
  10433. });
  10434. } }, { key: "sendEvent", value: function sendEvent(
  10435. key, value) {
  10436. // 校验 type 参数
  10437. if (calibration(key, value)) return;
  10438. if (key === 'title') {
  10439. this._navigationBarTitle.report = value;
  10440. return;
  10441. }
  10442. this._sendEventRequest({
  10443. key: key,
  10444. value: typeof value === 'object' ? JSON.stringify(value) : value },
  10445. 1);
  10446. } }]);return Util;}();var
  10447. Stat = /*#__PURE__*/function (_Util) {_inherits(Stat, _Util);var _super = _createSuper(Stat);_createClass(Stat, null, [{ key: "getInstance", value: function getInstance()
  10448. {
  10449. if (!this.instance) {
  10450. this.instance = new Stat();
  10451. }
  10452. return this.instance;
  10453. } }]);
  10454. function Stat() {var _this6;_classCallCheck(this, Stat);
  10455. _this6 = _super.call(this);
  10456. _this6.instance = null;
  10457. // 注册拦截器
  10458. if (typeof uni.addInterceptor === 'function' && "development" !== 'development') {
  10459. _this6.addInterceptorInit();
  10460. _this6.interceptLogin();
  10461. _this6.interceptShare(true);
  10462. _this6.interceptRequestPayment();
  10463. }return _this6;
  10464. }_createClass(Stat, [{ key: "addInterceptorInit", value: function addInterceptorInit()
  10465. {
  10466. var self = this;
  10467. uni.addInterceptor('setNavigationBarTitle', {
  10468. invoke: function invoke(args) {
  10469. self._navigationBarTitle.page = args.title;
  10470. } });
  10471. } }, { key: "interceptLogin", value: function interceptLogin()
  10472. {
  10473. var self = this;
  10474. uni.addInterceptor('login', {
  10475. complete: function complete() {
  10476. self._login();
  10477. } });
  10478. } }, { key: "interceptShare", value: function interceptShare(
  10479. type) {
  10480. var self = this;
  10481. if (!type) {
  10482. self._share();
  10483. return;
  10484. }
  10485. uni.addInterceptor('share', {
  10486. success: function success() {
  10487. self._share();
  10488. },
  10489. fail: function fail() {
  10490. self._share();
  10491. } });
  10492. } }, { key: "interceptRequestPayment", value: function interceptRequestPayment()
  10493. {
  10494. var self = this;
  10495. uni.addInterceptor('requestPayment', {
  10496. success: function success() {
  10497. self._payment('pay_success');
  10498. },
  10499. fail: function fail() {
  10500. self._payment('pay_fail');
  10501. } });
  10502. } }, { key: "report", value: function report(
  10503. options, self) {
  10504. this.self = self;
  10505. // if (process.env.NODE_ENV === 'development') {
  10506. // console.log('report init');
  10507. // }
  10508. setPageResidenceTime();
  10509. this.__licationShow = true;
  10510. this._sendReportRequest(options, true);
  10511. } }, { key: "load", value: function load(
  10512. options, self) {
  10513. if (!self.$scope && !self.$mp) {
  10514. var page = getCurrentPages();
  10515. self.$scope = page[page.length - 1];
  10516. }
  10517. this.self = self;
  10518. this._query = options;
  10519. } }, { key: "show", value: function show(
  10520. self) {
  10521. this.self = self;
  10522. if (getPageTypes(self)) {
  10523. this._pageShow(self);
  10524. } else {
  10525. this._applicationShow(self);
  10526. }
  10527. } }, { key: "ready", value: function ready(
  10528. self) {
  10529. // this.self = self;
  10530. // if (getPageTypes(self)) {
  10531. // this._pageShow(self);
  10532. // }
  10533. } }, { key: "hide", value: function hide(
  10534. self) {
  10535. this.self = self;
  10536. if (getPageTypes(self)) {
  10537. this._pageHide(self);
  10538. } else {
  10539. this._applicationHide(self, true);
  10540. }
  10541. } }, { key: "error", value: function error(
  10542. em) {
  10543. if (this._platform === 'devtools') {
  10544. if (true) {
  10545. console.info('当前运行环境为开发者工具,不上报数据。');
  10546. }
  10547. // return;
  10548. }
  10549. var emVal = '';
  10550. if (!em.message) {
  10551. emVal = JSON.stringify(em);
  10552. } else {
  10553. emVal = em.stack;
  10554. }
  10555. var options = {
  10556. ak: this.statData.ak,
  10557. uuid: this.statData.uuid,
  10558. lt: '31',
  10559. ut: this.statData.ut,
  10560. ch: this.statData.ch,
  10561. mpsdk: this.statData.mpsdk,
  10562. mpv: this.statData.mpv,
  10563. v: this.statData.v,
  10564. em: emVal,
  10565. usv: this.statData.usv,
  10566. t: getTime(),
  10567. p: this.statData.p };
  10568. this.request(options);
  10569. } }]);return Stat;}(Util);
  10570. var stat = Stat.getInstance();
  10571. var isHide = false;
  10572. var lifecycle = {
  10573. onLaunch: function onLaunch(options) {
  10574. stat.report(options, this);
  10575. },
  10576. onReady: function onReady() {
  10577. stat.ready(this);
  10578. },
  10579. onLoad: function onLoad(options) {
  10580. stat.load(options, this);
  10581. // 重写分享,获取分享上报事件
  10582. if (this.$scope && this.$scope.onShareAppMessage) {
  10583. var oldShareAppMessage = this.$scope.onShareAppMessage;
  10584. this.$scope.onShareAppMessage = function (options) {
  10585. stat.interceptShare(false);
  10586. return oldShareAppMessage.call(this, options);
  10587. };
  10588. }
  10589. },
  10590. onShow: function onShow() {
  10591. isHide = false;
  10592. stat.show(this);
  10593. },
  10594. onHide: function onHide() {
  10595. isHide = true;
  10596. stat.hide(this);
  10597. },
  10598. onUnload: function onUnload() {
  10599. if (isHide) {
  10600. isHide = false;
  10601. return;
  10602. }
  10603. stat.hide(this);
  10604. },
  10605. onError: function onError(e) {
  10606. stat.error(e);
  10607. } };
  10608. function main() {
  10609. if (true) {
  10610. uni.report = function (type, options) {};
  10611. } else { var Vue; }
  10612. }
  10613. main();
  10614. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-alipay/dist/index.js */ 1)["default"]))
  10615. /***/ }),
  10616. /***/ 6:
  10617. /*!******************************************************!*\
  10618. !*** ./node_modules/@dcloudio/uni-stat/package.json ***!
  10619. \******************************************************/
  10620. /*! exports provided: _from, _id, _inBundle, _integrity, _location, _phantomChildren, _requested, _requiredBy, _resolved, _shasum, _spec, _where, author, bugs, bundleDependencies, deprecated, description, devDependencies, files, gitHead, homepage, license, main, name, repository, scripts, version, default */
  10621. /***/ (function(module) {
  10622. module.exports = JSON.parse("{\"_from\":\"@dcloudio/uni-stat@next\",\"_id\":\"@dcloudio/uni-stat@2.0.0-31920210427001\",\"_inBundle\":false,\"_integrity\":\"sha512-45M5z4VUOBpLHbcJeeOE+piZ4tTnkcALy/7k+QPr2qWYxetNuSsfW+cENErL1HZDu83uex+HkiVawP/W2vavUw==\",\"_location\":\"/@dcloudio/uni-stat\",\"_phantomChildren\":{},\"_requested\":{\"type\":\"tag\",\"registry\":true,\"raw\":\"@dcloudio/uni-stat@next\",\"name\":\"@dcloudio/uni-stat\",\"escapedName\":\"@dcloudio%2funi-stat\",\"scope\":\"@dcloudio\",\"rawSpec\":\"next\",\"saveSpec\":null,\"fetchSpec\":\"next\"},\"_requiredBy\":[\"#USER\",\"/\",\"/@dcloudio/vue-cli-plugin-uni\"],\"_resolved\":\"https://registry.npmjs.org/@dcloudio/uni-stat/-/uni-stat-2.0.0-31920210427001.tgz\",\"_shasum\":\"86dc1d4965f220ef205c1dbfdd1926f9f5e0585a\",\"_spec\":\"@dcloudio/uni-stat@next\",\"_where\":\"/Users/guoshengqiang/Documents/dcloud-plugins-new/release/uniapp-cli\",\"author\":\"\",\"bugs\":{\"url\":\"https://github.com/dcloudio/uni-app/issues\"},\"bundleDependencies\":false,\"deprecated\":false,\"description\":\"\",\"devDependencies\":{\"@babel/core\":\"^7.5.5\",\"@babel/preset-env\":\"^7.5.5\",\"eslint\":\"^6.1.0\",\"rollup\":\"^1.19.3\",\"rollup-plugin-babel\":\"^4.3.3\",\"rollup-plugin-clear\":\"^2.0.7\",\"rollup-plugin-commonjs\":\"^10.0.2\",\"rollup-plugin-copy\":\"^3.1.0\",\"rollup-plugin-eslint\":\"^7.0.0\",\"rollup-plugin-json\":\"^4.0.0\",\"rollup-plugin-node-resolve\":\"^5.2.0\",\"rollup-plugin-replace\":\"^2.2.0\",\"rollup-plugin-uglify\":\"^6.0.2\"},\"files\":[\"dist\",\"package.json\",\"LICENSE\"],\"gitHead\":\"7d6b2ba93591e997c1f3254248375fe341719198\",\"homepage\":\"https://github.com/dcloudio/uni-app#readme\",\"license\":\"Apache-2.0\",\"main\":\"dist/index.js\",\"name\":\"@dcloudio/uni-stat\",\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/dcloudio/uni-app.git\",\"directory\":\"packages/uni-stat\"},\"scripts\":{\"build\":\"NODE_ENV=production rollup -c rollup.config.js\",\"dev\":\"NODE_ENV=development rollup -w -c rollup.config.js\"},\"version\":\"2.0.0-31920210427001\"}");
  10623. /***/ }),
  10624. /***/ 7:
  10625. /*!********************************************************************************!*\
  10626. !*** C:/Users/first/Documents/HBuilderProjects/小程序/pages.json?{"type":"stat"} ***!
  10627. \********************************************************************************/
  10628. /*! no static exports found */
  10629. /***/ (function(module, exports, __webpack_require__) {
  10630. "use strict";
  10631. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "appid": "__UNI__BAF74FD" };exports.default = _default;
  10632. /***/ }),
  10633. /***/ 8:
  10634. /*!*********************************************************************************!*\
  10635. !*** C:/Users/first/Documents/HBuilderProjects/小程序/pages.json?{"type":"style"} ***!
  10636. \*********************************************************************************/
  10637. /*! no static exports found */
  10638. /***/ (function(module, exports, __webpack_require__) {
  10639. "use strict";
  10640. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = { "pages": { "pages/index/index": { "defaultTitle": "一键加油" }, "pages/test/test": { "defaultTitle": "测试页", "pullRefresh": false }, "pages/succeed/succeed": { "defaultTitle": "支付成功", "pullRefresh": false }, "pages/authen/identity": { "defaultTitle": "请求授权", "pullRefresh": false }, "pages/authen/login": { "defaultTitle": "登录", "pullRefresh": false }, "pages/confirm/confirm": { "defaultTitle": "订单确认", "pullRefresh": false } }, "globalStyle": { "defaultTitle": "uni-app", "titleBarColor": "#F8F8F8", "backgroundColor": "#F8F8F8" } };exports.default = _default;
  10641. /***/ }),
  10642. /***/ 85:
  10643. /*!*********************************************************************************************************!*\
  10644. !*** C:/Users/first/Documents/HBuilderProjects/小程序/uni_modules/uni-popup/components/uni-popup/popup.js ***!
  10645. \*********************************************************************************************************/
  10646. /*! no static exports found */
  10647. /***/ (function(module, exports, __webpack_require__) {
  10648. "use strict";
  10649. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _message = _interopRequireDefault(__webpack_require__(/*! ./message.js */ 86));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10650. // 定义 type 类型:弹出类型:top/bottom/center
  10651. var config = {
  10652. // 顶部弹出
  10653. top: 'top',
  10654. // 底部弹出
  10655. bottom: 'bottom',
  10656. // 居中弹出
  10657. center: 'center',
  10658. // 消息提示
  10659. message: 'top',
  10660. // 对话框
  10661. dialog: 'center',
  10662. // 分享
  10663. share: 'bottom' };var _default =
  10664. {
  10665. data: function data() {
  10666. return {
  10667. config: config,
  10668. popupWidth: 0,
  10669. popupHeight: 0 };
  10670. },
  10671. mixins: [_message.default],
  10672. computed: {
  10673. isDesktop: function isDesktop() {
  10674. return this.popupWidth >= 500 && this.popupHeight >= 500;
  10675. } },
  10676. mounted: function mounted() {var _this = this;
  10677. var fixSize = function fixSize() {var _uni$getSystemInfoSyn =
  10678. uni.getSystemInfoSync(),windowWidth = _uni$getSystemInfoSyn.windowWidth,windowHeight = _uni$getSystemInfoSyn.windowHeight,windowTop = _uni$getSystemInfoSyn.windowTop;
  10679. _this.popupWidth = windowWidth;
  10680. _this.popupHeight = windowHeight + windowTop;
  10681. };
  10682. fixSize();
  10683. } };exports.default = _default;
  10684. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-alipay/dist/index.js */ 1)["default"]))
  10685. /***/ }),
  10686. /***/ 86:
  10687. /*!***********************************************************************************************************!*\
  10688. !*** C:/Users/first/Documents/HBuilderProjects/小程序/uni_modules/uni-popup/components/uni-popup/message.js ***!
  10689. \***********************************************************************************************************/
  10690. /*! no static exports found */
  10691. /***/ (function(module, exports, __webpack_require__) {
  10692. "use strict";
  10693. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  10694. created: function created() {
  10695. if (this.type === 'message') {
  10696. // 不显示遮罩
  10697. this.maskShow = false;
  10698. // 获取子组件对象
  10699. this.childrenMsg = null;
  10700. }
  10701. },
  10702. methods: {
  10703. customOpen: function customOpen() {
  10704. if (this.childrenMsg) {
  10705. this.childrenMsg.open();
  10706. }
  10707. },
  10708. customClose: function customClose() {
  10709. if (this.childrenMsg) {
  10710. this.childrenMsg.close();
  10711. }
  10712. } } };exports.default = _default;
  10713. /***/ }),
  10714. /***/ 94:
  10715. /*!*********************************************************************************************************!*\
  10716. !*** C:/Users/first/Documents/HBuilderProjects/小程序/uni_modules/uni-icons/components/uni-icons/icons.js ***!
  10717. \*********************************************************************************************************/
  10718. /*! no static exports found */
  10719. /***/ (function(module, exports, __webpack_require__) {
  10720. "use strict";
  10721. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  10722. "pulldown": "\uE588",
  10723. "refreshempty": "\uE461",
  10724. "back": "\uE471",
  10725. "forward": "\uE470",
  10726. "more": "\uE507",
  10727. "more-filled": "\uE537",
  10728. "scan": "\uE612",
  10729. "qq": "\uE264",
  10730. "weibo": "\uE260",
  10731. "weixin": "\uE261",
  10732. "pengyouquan": "\uE262",
  10733. "loop": "\uE565",
  10734. "refresh": "\uE407",
  10735. "refresh-filled": "\uE437",
  10736. "arrowthindown": "\uE585",
  10737. "arrowthinleft": "\uE586",
  10738. "arrowthinright": "\uE587",
  10739. "arrowthinup": "\uE584",
  10740. "undo-filled": "\uE7D6",
  10741. "undo": "\uE406",
  10742. "redo": "\uE405",
  10743. "redo-filled": "\uE7D9",
  10744. "bars": "\uE563",
  10745. "chatboxes": "\uE203",
  10746. "camera": "\uE301",
  10747. "chatboxes-filled": "\uE233",
  10748. "camera-filled": "\uE7EF",
  10749. "cart-filled": "\uE7F4",
  10750. "cart": "\uE7F5",
  10751. "checkbox-filled": "\uE442",
  10752. "checkbox": "\uE7FA",
  10753. "arrowleft": "\uE582",
  10754. "arrowdown": "\uE581",
  10755. "arrowright": "\uE583",
  10756. "smallcircle-filled": "\uE801",
  10757. "arrowup": "\uE580",
  10758. "circle": "\uE411",
  10759. "eye-filled": "\uE568",
  10760. "eye-slash-filled": "\uE822",
  10761. "eye-slash": "\uE823",
  10762. "eye": "\uE824",
  10763. "flag-filled": "\uE825",
  10764. "flag": "\uE508",
  10765. "gear-filled": "\uE532",
  10766. "reload": "\uE462",
  10767. "gear": "\uE502",
  10768. "hand-thumbsdown-filled": "\uE83B",
  10769. "hand-thumbsdown": "\uE83C",
  10770. "hand-thumbsup-filled": "\uE83D",
  10771. "heart-filled": "\uE83E",
  10772. "hand-thumbsup": "\uE83F",
  10773. "heart": "\uE840",
  10774. "home": "\uE500",
  10775. "info": "\uE504",
  10776. "home-filled": "\uE530",
  10777. "info-filled": "\uE534",
  10778. "circle-filled": "\uE441",
  10779. "chat-filled": "\uE847",
  10780. "chat": "\uE263",
  10781. "mail-open-filled": "\uE84D",
  10782. "email-filled": "\uE231",
  10783. "mail-open": "\uE84E",
  10784. "email": "\uE201",
  10785. "checkmarkempty": "\uE472",
  10786. "list": "\uE562",
  10787. "locked-filled": "\uE856",
  10788. "locked": "\uE506",
  10789. "map-filled": "\uE85C",
  10790. "map-pin": "\uE85E",
  10791. "map-pin-ellipse": "\uE864",
  10792. "map": "\uE364",
  10793. "minus-filled": "\uE440",
  10794. "mic-filled": "\uE332",
  10795. "minus": "\uE410",
  10796. "micoff": "\uE360",
  10797. "mic": "\uE302",
  10798. "clear": "\uE434",
  10799. "smallcircle": "\uE868",
  10800. "close": "\uE404",
  10801. "closeempty": "\uE460",
  10802. "paperclip": "\uE567",
  10803. "paperplane": "\uE503",
  10804. "paperplane-filled": "\uE86E",
  10805. "person-filled": "\uE131",
  10806. "contact-filled": "\uE130",
  10807. "person": "\uE101",
  10808. "contact": "\uE100",
  10809. "images-filled": "\uE87A",
  10810. "phone": "\uE200",
  10811. "images": "\uE87B",
  10812. "image": "\uE363",
  10813. "image-filled": "\uE877",
  10814. "location-filled": "\uE333",
  10815. "location": "\uE303",
  10816. "plus-filled": "\uE439",
  10817. "plus": "\uE409",
  10818. "plusempty": "\uE468",
  10819. "help-filled": "\uE535",
  10820. "help": "\uE505",
  10821. "navigate-filled": "\uE884",
  10822. "navigate": "\uE501",
  10823. "mic-slash-filled": "\uE892",
  10824. "search": "\uE466",
  10825. "settings": "\uE560",
  10826. "sound": "\uE590",
  10827. "sound-filled": "\uE8A1",
  10828. "spinner-cycle": "\uE465",
  10829. "download-filled": "\uE8A4",
  10830. "personadd-filled": "\uE132",
  10831. "videocam-filled": "\uE8AF",
  10832. "personadd": "\uE102",
  10833. "upload": "\uE402",
  10834. "upload-filled": "\uE8B1",
  10835. "starhalf": "\uE463",
  10836. "star-filled": "\uE438",
  10837. "star": "\uE408",
  10838. "trash": "\uE401",
  10839. "phone-filled": "\uE230",
  10840. "compose": "\uE400",
  10841. "videocam": "\uE300",
  10842. "trash-filled": "\uE8DC",
  10843. "download": "\uE403",
  10844. "chatbubble-filled": "\uE232",
  10845. "chatbubble": "\uE202",
  10846. "cloud-download": "\uE8E4",
  10847. "cloud-upload-filled": "\uE8E5",
  10848. "cloud-upload": "\uE8E6",
  10849. "cloud-download-filled": "\uE8E9",
  10850. "headphones": "\uE8BF",
  10851. "shop": "\uE609" };exports.default = _default;
  10852. /***/ })
  10853. }]);