vendor.js 323 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],[
  2. /* 0 */,
  3. /* 1 */
  4. /*!************************************************************!*\
  5. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  6. \************************************************************/
  7. /*! no static exports found */
  8. /***/ (function(module, exports, __webpack_require__) {
  9. "use strict";
  10. Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(n);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  11. var _toString = Object.prototype.toString;
  12. var hasOwnProperty = Object.prototype.hasOwnProperty;
  13. function isFn(fn) {
  14. return typeof fn === 'function';
  15. }
  16. function isStr(str) {
  17. return typeof str === 'string';
  18. }
  19. function isPlainObject(obj) {
  20. return _toString.call(obj) === '[object Object]';
  21. }
  22. function hasOwn(obj, key) {
  23. return hasOwnProperty.call(obj, key);
  24. }
  25. function noop() {}
  26. /**
  27. * Create a cached version of a pure function.
  28. */
  29. function cached(fn) {
  30. var cache = Object.create(null);
  31. return function cachedFn(str) {
  32. var hit = cache[str];
  33. return hit || (cache[str] = fn(str));
  34. };
  35. }
  36. /**
  37. * Camelize a hyphen-delimited string.
  38. */
  39. var camelizeRE = /-(\w)/g;
  40. var camelize = cached(function (str) {
  41. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  42. });
  43. var HOOKS = [
  44. 'invoke',
  45. 'success',
  46. 'fail',
  47. 'complete',
  48. 'returnValue'];
  49. var globalInterceptors = {};
  50. var scopedInterceptors = {};
  51. function mergeHook(parentVal, childVal) {
  52. var res = childVal ?
  53. parentVal ?
  54. parentVal.concat(childVal) :
  55. Array.isArray(childVal) ?
  56. childVal : [childVal] :
  57. parentVal;
  58. return res ?
  59. dedupeHooks(res) :
  60. res;
  61. }
  62. function dedupeHooks(hooks) {
  63. var res = [];
  64. for (var i = 0; i < hooks.length; i++) {
  65. if (res.indexOf(hooks[i]) === -1) {
  66. res.push(hooks[i]);
  67. }
  68. }
  69. return res;
  70. }
  71. function removeHook(hooks, hook) {
  72. var index = hooks.indexOf(hook);
  73. if (index !== -1) {
  74. hooks.splice(index, 1);
  75. }
  76. }
  77. function mergeInterceptorHook(interceptor, option) {
  78. Object.keys(option).forEach(function (hook) {
  79. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  80. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  81. }
  82. });
  83. }
  84. function removeInterceptorHook(interceptor, option) {
  85. if (!interceptor || !option) {
  86. return;
  87. }
  88. Object.keys(option).forEach(function (hook) {
  89. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  90. removeHook(interceptor[hook], option[hook]);
  91. }
  92. });
  93. }
  94. function addInterceptor(method, option) {
  95. if (typeof method === 'string' && isPlainObject(option)) {
  96. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  97. } else if (isPlainObject(method)) {
  98. mergeInterceptorHook(globalInterceptors, method);
  99. }
  100. }
  101. function removeInterceptor(method, option) {
  102. if (typeof method === 'string') {
  103. if (isPlainObject(option)) {
  104. removeInterceptorHook(scopedInterceptors[method], option);
  105. } else {
  106. delete scopedInterceptors[method];
  107. }
  108. } else if (isPlainObject(method)) {
  109. removeInterceptorHook(globalInterceptors, method);
  110. }
  111. }
  112. function wrapperHook(hook) {
  113. return function (data) {
  114. return hook(data) || data;
  115. };
  116. }
  117. function isPromise(obj) {
  118. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  119. }
  120. function queue(hooks, data) {
  121. var promise = false;
  122. for (var i = 0; i < hooks.length; i++) {
  123. var hook = hooks[i];
  124. if (promise) {
  125. promise = Promise.resolve(wrapperHook(hook));
  126. } else {
  127. var res = hook(data);
  128. if (isPromise(res)) {
  129. promise = Promise.resolve(res);
  130. }
  131. if (res === false) {
  132. return {
  133. then: function then() {} };
  134. }
  135. }
  136. }
  137. return promise || {
  138. then: function then(callback) {
  139. return callback(data);
  140. } };
  141. }
  142. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  143. ['success', 'fail', 'complete'].forEach(function (name) {
  144. if (Array.isArray(interceptor[name])) {
  145. var oldCallback = options[name];
  146. options[name] = function callbackInterceptor(res) {
  147. queue(interceptor[name], res).then(function (res) {
  148. /* eslint-disable no-mixed-operators */
  149. return isFn(oldCallback) && oldCallback(res) || res;
  150. });
  151. };
  152. }
  153. });
  154. return options;
  155. }
  156. function wrapperReturnValue(method, returnValue) {
  157. var returnValueHooks = [];
  158. if (Array.isArray(globalInterceptors.returnValue)) {
  159. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  160. }
  161. var interceptor = scopedInterceptors[method];
  162. if (interceptor && Array.isArray(interceptor.returnValue)) {
  163. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  164. }
  165. returnValueHooks.forEach(function (hook) {
  166. returnValue = hook(returnValue) || returnValue;
  167. });
  168. return returnValue;
  169. }
  170. function getApiInterceptorHooks(method) {
  171. var interceptor = Object.create(null);
  172. Object.keys(globalInterceptors).forEach(function (hook) {
  173. if (hook !== 'returnValue') {
  174. interceptor[hook] = globalInterceptors[hook].slice();
  175. }
  176. });
  177. var scopedInterceptor = scopedInterceptors[method];
  178. if (scopedInterceptor) {
  179. Object.keys(scopedInterceptor).forEach(function (hook) {
  180. if (hook !== 'returnValue') {
  181. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  182. }
  183. });
  184. }
  185. return interceptor;
  186. }
  187. 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];}
  188. var interceptor = getApiInterceptorHooks(method);
  189. if (interceptor && Object.keys(interceptor).length) {
  190. if (Array.isArray(interceptor.invoke)) {
  191. var res = queue(interceptor.invoke, options);
  192. return res.then(function (options) {
  193. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  194. });
  195. } else {
  196. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  197. }
  198. }
  199. return api.apply(void 0, [options].concat(params));
  200. }
  201. var promiseInterceptor = {
  202. returnValue: function returnValue(res) {
  203. if (!isPromise(res)) {
  204. return res;
  205. }
  206. return res.then(function (res) {
  207. return res[1];
  208. }).catch(function (res) {
  209. return res[0];
  210. });
  211. } };
  212. var SYNC_API_RE =
  213. /^\$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
  214. var CONTEXT_API_RE = /^create|Manager$/;
  215. // Context例外情况
  216. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  217. // 同步例外情况
  218. var ASYNC_API = ['createBLEConnection'];
  219. var CALLBACK_API_RE = /^on|^off/;
  220. function isContextApi(name) {
  221. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  222. }
  223. function isSyncApi(name) {
  224. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  225. }
  226. function isCallbackApi(name) {
  227. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  228. }
  229. function handlePromise(promise) {
  230. return promise.then(function (data) {
  231. return [null, data];
  232. }).
  233. catch(function (err) {return [err];});
  234. }
  235. function shouldPromise(name) {
  236. if (
  237. isContextApi(name) ||
  238. isSyncApi(name) ||
  239. isCallbackApi(name))
  240. {
  241. return false;
  242. }
  243. return true;
  244. }
  245. /* eslint-disable no-extend-native */
  246. if (!Promise.prototype.finally) {
  247. Promise.prototype.finally = function (callback) {
  248. var promise = this.constructor;
  249. return this.then(
  250. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  251. function (reason) {return promise.resolve(callback()).then(function () {
  252. throw reason;
  253. });});
  254. };
  255. }
  256. function promisify(name, api) {
  257. if (!shouldPromise(name)) {
  258. return api;
  259. }
  260. 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];}
  261. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  262. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  263. }
  264. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  265. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  266. success: resolve,
  267. fail: reject })].concat(
  268. params));
  269. })));
  270. };
  271. }
  272. var EPS = 1e-4;
  273. var BASE_DEVICE_WIDTH = 750;
  274. var isIOS = false;
  275. var deviceWidth = 0;
  276. var deviceDPR = 0;
  277. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  278. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  279. deviceWidth = windowWidth;
  280. deviceDPR = pixelRatio;
  281. isIOS = platform === 'ios';
  282. }
  283. function upx2px(number, newDeviceWidth) {
  284. if (deviceWidth === 0) {
  285. checkDeviceWidth();
  286. }
  287. number = Number(number);
  288. if (number === 0) {
  289. return 0;
  290. }
  291. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  292. if (result < 0) {
  293. result = -result;
  294. }
  295. result = Math.floor(result + EPS);
  296. if (result === 0) {
  297. if (deviceDPR === 1 || !isIOS) {
  298. result = 1;
  299. } else {
  300. result = 0.5;
  301. }
  302. }
  303. return number < 0 ? -result : result;
  304. }
  305. var interceptors = {
  306. promiseInterceptor: promiseInterceptor };
  307. var baseApi = /*#__PURE__*/Object.freeze({
  308. __proto__: null,
  309. upx2px: upx2px,
  310. addInterceptor: addInterceptor,
  311. removeInterceptor: removeInterceptor,
  312. interceptors: interceptors });
  313. var previewImage = {
  314. args: function args(fromArgs) {
  315. var currentIndex = parseInt(fromArgs.current);
  316. if (isNaN(currentIndex)) {
  317. return;
  318. }
  319. var urls = fromArgs.urls;
  320. if (!Array.isArray(urls)) {
  321. return;
  322. }
  323. var len = urls.length;
  324. if (!len) {
  325. return;
  326. }
  327. if (currentIndex < 0) {
  328. currentIndex = 0;
  329. } else if (currentIndex >= len) {
  330. currentIndex = len - 1;
  331. }
  332. if (currentIndex > 0) {
  333. fromArgs.current = urls[currentIndex];
  334. fromArgs.urls = urls.filter(
  335. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  336. } else {
  337. fromArgs.current = urls[0];
  338. }
  339. return {
  340. indicator: false,
  341. loop: false };
  342. } };
  343. function addSafeAreaInsets(result) {
  344. if (result.safeArea) {
  345. var safeArea = result.safeArea;
  346. result.safeAreaInsets = {
  347. top: safeArea.top,
  348. left: safeArea.left,
  349. right: result.windowWidth - safeArea.right,
  350. bottom: result.windowHeight - safeArea.bottom };
  351. }
  352. }
  353. var protocols = {
  354. previewImage: previewImage,
  355. getSystemInfo: {
  356. returnValue: addSafeAreaInsets },
  357. getSystemInfoSync: {
  358. returnValue: addSafeAreaInsets } };
  359. var todos = [
  360. 'vibrate',
  361. 'preloadPage',
  362. 'unPreloadPage',
  363. 'loadSubPackage'];
  364. var canIUses = [];
  365. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  366. function processCallback(methodName, method, returnValue) {
  367. return function (res) {
  368. return method(processReturnValue(methodName, res, returnValue));
  369. };
  370. }
  371. 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;
  372. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  373. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  374. if (isFn(argsOption)) {
  375. argsOption = argsOption(fromArgs, toArgs) || {};
  376. }
  377. for (var key in fromArgs) {
  378. if (hasOwn(argsOption, key)) {
  379. var keyOption = argsOption[key];
  380. if (isFn(keyOption)) {
  381. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  382. }
  383. if (!keyOption) {// 不支持的参数
  384. console.warn("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F ".concat(methodName, "\u6682\u4E0D\u652F\u6301").concat(key));
  385. } else if (isStr(keyOption)) {// 重写参数 key
  386. toArgs[keyOption] = fromArgs[key];
  387. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  388. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  389. }
  390. } else if (CALLBACKS.indexOf(key) !== -1) {
  391. if (isFn(fromArgs[key])) {
  392. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  393. }
  394. } else {
  395. if (!keepFromArgs) {
  396. toArgs[key] = fromArgs[key];
  397. }
  398. }
  399. }
  400. return toArgs;
  401. } else if (isFn(fromArgs)) {
  402. fromArgs = processCallback(methodName, fromArgs, returnValue);
  403. }
  404. return fromArgs;
  405. }
  406. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  407. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  408. res = protocols.returnValue(methodName, res);
  409. }
  410. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  411. }
  412. function wrapper(methodName, method) {
  413. if (hasOwn(protocols, methodName)) {
  414. var protocol = protocols[methodName];
  415. if (!protocol) {// 暂不支持的 api
  416. return function () {
  417. console.error("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F \u6682\u4E0D\u652F\u6301".concat(methodName));
  418. };
  419. }
  420. return function (arg1, arg2) {// 目前 api 最多两个参数
  421. var options = protocol;
  422. if (isFn(protocol)) {
  423. options = protocol(arg1);
  424. }
  425. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  426. var args = [arg1];
  427. if (typeof arg2 !== 'undefined') {
  428. args.push(arg2);
  429. }
  430. var returnValue = wx[options.name || methodName].apply(wx, args);
  431. if (isSyncApi(methodName)) {// 同步 api
  432. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  433. }
  434. return returnValue;
  435. };
  436. }
  437. return method;
  438. }
  439. var todoApis = Object.create(null);
  440. var TODOS = [
  441. 'onTabBarMidButtonTap',
  442. 'subscribePush',
  443. 'unsubscribePush',
  444. 'onPush',
  445. 'offPush',
  446. 'share'];
  447. function createTodoApi(name) {
  448. return function todoApi(_ref)
  449. {var fail = _ref.fail,complete = _ref.complete;
  450. var res = {
  451. errMsg: "".concat(name, ":fail:\u6682\u4E0D\u652F\u6301 ").concat(name, " \u65B9\u6CD5") };
  452. isFn(fail) && fail(res);
  453. isFn(complete) && complete(res);
  454. };
  455. }
  456. TODOS.forEach(function (name) {
  457. todoApis[name] = createTodoApi(name);
  458. });
  459. var providers = {
  460. oauth: ['weixin'],
  461. share: ['weixin'],
  462. payment: ['wxpay'],
  463. push: ['weixin'] };
  464. function getProvider(_ref2)
  465. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  466. var res = false;
  467. if (providers[service]) {
  468. res = {
  469. errMsg: 'getProvider:ok',
  470. service: service,
  471. provider: providers[service] };
  472. isFn(success) && success(res);
  473. } else {
  474. res = {
  475. errMsg: 'getProvider:fail:服务[' + service + ']不存在' };
  476. isFn(fail) && fail(res);
  477. }
  478. isFn(complete) && complete(res);
  479. }
  480. var extraApi = /*#__PURE__*/Object.freeze({
  481. __proto__: null,
  482. getProvider: getProvider });
  483. var getEmitter = function () {
  484. var Emitter;
  485. return function getUniEmitter() {
  486. if (!Emitter) {
  487. Emitter = new _vue.default();
  488. }
  489. return Emitter;
  490. };
  491. }();
  492. function apply(ctx, method, args) {
  493. return ctx[method].apply(ctx, args);
  494. }
  495. function $on() {
  496. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  497. }
  498. function $off() {
  499. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  500. }
  501. function $once() {
  502. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  503. }
  504. function $emit() {
  505. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  506. }
  507. var eventApi = /*#__PURE__*/Object.freeze({
  508. __proto__: null,
  509. $on: $on,
  510. $off: $off,
  511. $once: $once,
  512. $emit: $emit });
  513. var api = /*#__PURE__*/Object.freeze({
  514. __proto__: null });
  515. var MPPage = Page;
  516. var MPComponent = Component;
  517. var customizeRE = /:/g;
  518. var customize = cached(function (str) {
  519. return camelize(str.replace(customizeRE, '-'));
  520. });
  521. function initTriggerEvent(mpInstance) {
  522. {
  523. if (!wx.canIUse('nextTick')) {
  524. return;
  525. }
  526. }
  527. var oldTriggerEvent = mpInstance.triggerEvent;
  528. mpInstance.triggerEvent = function (event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  529. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  530. };
  531. }
  532. function initHook(name, options) {
  533. var oldHook = options[name];
  534. if (!oldHook) {
  535. options[name] = function () {
  536. initTriggerEvent(this);
  537. };
  538. } else {
  539. options[name] = function () {
  540. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  541. return oldHook.apply(this, args);
  542. };
  543. }
  544. }
  545. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  546. initHook('onLoad', options);
  547. return MPPage(options);
  548. };
  549. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  550. initHook('created', options);
  551. return MPComponent(options);
  552. };
  553. var PAGE_EVENT_HOOKS = [
  554. 'onPullDownRefresh',
  555. 'onReachBottom',
  556. 'onAddToFavorites',
  557. 'onShareTimeline',
  558. 'onShareAppMessage',
  559. 'onPageScroll',
  560. 'onResize',
  561. 'onTabItemTap'];
  562. function initMocks(vm, mocks) {
  563. var mpInstance = vm.$mp[vm.mpType];
  564. mocks.forEach(function (mock) {
  565. if (hasOwn(mpInstance, mock)) {
  566. vm[mock] = mpInstance[mock];
  567. }
  568. });
  569. }
  570. function hasHook(hook, vueOptions) {
  571. if (!vueOptions) {
  572. return true;
  573. }
  574. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  575. return true;
  576. }
  577. vueOptions = vueOptions.default || vueOptions;
  578. if (isFn(vueOptions)) {
  579. if (isFn(vueOptions.extendOptions[hook])) {
  580. return true;
  581. }
  582. if (vueOptions.super &&
  583. vueOptions.super.options &&
  584. Array.isArray(vueOptions.super.options[hook])) {
  585. return true;
  586. }
  587. return false;
  588. }
  589. if (isFn(vueOptions[hook])) {
  590. return true;
  591. }
  592. var mixins = vueOptions.mixins;
  593. if (Array.isArray(mixins)) {
  594. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  595. }
  596. }
  597. function initHooks(mpOptions, hooks, vueOptions) {
  598. hooks.forEach(function (hook) {
  599. if (hasHook(hook, vueOptions)) {
  600. mpOptions[hook] = function (args) {
  601. return this.$vm && this.$vm.__call_hook(hook, args);
  602. };
  603. }
  604. });
  605. }
  606. function initVueComponent(Vue, vueOptions) {
  607. vueOptions = vueOptions.default || vueOptions;
  608. var VueComponent;
  609. if (isFn(vueOptions)) {
  610. VueComponent = vueOptions;
  611. } else {
  612. VueComponent = Vue.extend(vueOptions);
  613. }
  614. vueOptions = VueComponent.options;
  615. return [VueComponent, vueOptions];
  616. }
  617. function initSlots(vm, vueSlots) {
  618. if (Array.isArray(vueSlots) && vueSlots.length) {
  619. var $slots = Object.create(null);
  620. vueSlots.forEach(function (slotName) {
  621. $slots[slotName] = true;
  622. });
  623. vm.$scopedSlots = vm.$slots = $slots;
  624. }
  625. }
  626. function initVueIds(vueIds, mpInstance) {
  627. vueIds = (vueIds || '').split(',');
  628. var len = vueIds.length;
  629. if (len === 1) {
  630. mpInstance._$vueId = vueIds[0];
  631. } else if (len === 2) {
  632. mpInstance._$vueId = vueIds[0];
  633. mpInstance._$vuePid = vueIds[1];
  634. }
  635. }
  636. function initData(vueOptions, context) {
  637. var data = vueOptions.data || {};
  638. var methods = vueOptions.methods || {};
  639. if (typeof data === 'function') {
  640. try {
  641. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  642. } catch (e) {
  643. if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  644. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  645. }
  646. }
  647. } else {
  648. try {
  649. // 对 data 格式化
  650. data = JSON.parse(JSON.stringify(data));
  651. } catch (e) {}
  652. }
  653. if (!isPlainObject(data)) {
  654. data = {};
  655. }
  656. Object.keys(methods).forEach(function (methodName) {
  657. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  658. data[methodName] = methods[methodName];
  659. }
  660. });
  661. return data;
  662. }
  663. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  664. function createObserver(name) {
  665. return function observer(newVal, oldVal) {
  666. if (this.$vm) {
  667. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  668. }
  669. };
  670. }
  671. function initBehaviors(vueOptions, initBehavior) {
  672. var vueBehaviors = vueOptions.behaviors;
  673. var vueExtends = vueOptions.extends;
  674. var vueMixins = vueOptions.mixins;
  675. var vueProps = vueOptions.props;
  676. if (!vueProps) {
  677. vueOptions.props = vueProps = [];
  678. }
  679. var behaviors = [];
  680. if (Array.isArray(vueBehaviors)) {
  681. vueBehaviors.forEach(function (behavior) {
  682. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  683. if (behavior === 'uni://form-field') {
  684. if (Array.isArray(vueProps)) {
  685. vueProps.push('name');
  686. vueProps.push('value');
  687. } else {
  688. vueProps.name = {
  689. type: String,
  690. default: '' };
  691. vueProps.value = {
  692. type: [String, Number, Boolean, Array, Object, Date],
  693. default: '' };
  694. }
  695. }
  696. });
  697. }
  698. if (isPlainObject(vueExtends) && vueExtends.props) {
  699. behaviors.push(
  700. initBehavior({
  701. properties: initProperties(vueExtends.props, true) }));
  702. }
  703. if (Array.isArray(vueMixins)) {
  704. vueMixins.forEach(function (vueMixin) {
  705. if (isPlainObject(vueMixin) && vueMixin.props) {
  706. behaviors.push(
  707. initBehavior({
  708. properties: initProperties(vueMixin.props, true) }));
  709. }
  710. });
  711. }
  712. return behaviors;
  713. }
  714. function parsePropType(key, type, defaultValue, file) {
  715. // [String]=>String
  716. if (Array.isArray(type) && type.length === 1) {
  717. return type[0];
  718. }
  719. return type;
  720. }
  721. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  722. var properties = {};
  723. if (!isBehavior) {
  724. properties.vueId = {
  725. type: String,
  726. value: '' };
  727. // 用于字节跳动小程序模拟抽象节点
  728. properties.generic = {
  729. type: Object,
  730. value: null };
  731. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  732. type: null,
  733. value: [],
  734. observer: function observer(newVal, oldVal) {
  735. var $slots = Object.create(null);
  736. newVal.forEach(function (slotName) {
  737. $slots[slotName] = true;
  738. });
  739. this.setData({
  740. $slots: $slots });
  741. } };
  742. }
  743. if (Array.isArray(props)) {// ['title']
  744. props.forEach(function (key) {
  745. properties[key] = {
  746. type: null,
  747. observer: createObserver(key) };
  748. });
  749. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  750. Object.keys(props).forEach(function (key) {
  751. var opts = props[key];
  752. if (isPlainObject(opts)) {// title:{type:String,default:''}
  753. var value = opts.default;
  754. if (isFn(value)) {
  755. value = value();
  756. }
  757. opts.type = parsePropType(key, opts.type);
  758. properties[key] = {
  759. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  760. value: value,
  761. observer: createObserver(key) };
  762. } else {// content:String
  763. var type = parsePropType(key, opts);
  764. properties[key] = {
  765. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  766. observer: createObserver(key) };
  767. }
  768. });
  769. }
  770. return properties;
  771. }
  772. function wrapper$1(event) {
  773. // TODO 又得兼容 mpvue 的 mp 对象
  774. try {
  775. event.mp = JSON.parse(JSON.stringify(event));
  776. } catch (e) {}
  777. event.stopPropagation = noop;
  778. event.preventDefault = noop;
  779. event.target = event.target || {};
  780. if (!hasOwn(event, 'detail')) {
  781. event.detail = {};
  782. }
  783. if (hasOwn(event, 'markerId')) {
  784. event.detail = typeof event.detail === 'object' ? event.detail : {};
  785. event.detail.markerId = event.markerId;
  786. }
  787. if (isPlainObject(event.detail)) {
  788. event.target = Object.assign({}, event.target, event.detail);
  789. }
  790. return event;
  791. }
  792. function getExtraValue(vm, dataPathsArray) {
  793. var context = vm;
  794. dataPathsArray.forEach(function (dataPathArray) {
  795. var dataPath = dataPathArray[0];
  796. var value = dataPathArray[2];
  797. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  798. var propPath = dataPathArray[1];
  799. var valuePath = dataPathArray[3];
  800. var vFor;
  801. if (Number.isInteger(dataPath)) {
  802. vFor = dataPath;
  803. } else if (!dataPath) {
  804. vFor = context;
  805. } else if (typeof dataPath === 'string' && dataPath) {
  806. if (dataPath.indexOf('#s#') === 0) {
  807. vFor = dataPath.substr(3);
  808. } else {
  809. vFor = vm.__get_value(dataPath, context);
  810. }
  811. }
  812. if (Number.isInteger(vFor)) {
  813. context = value;
  814. } else if (!propPath) {
  815. context = vFor[value];
  816. } else {
  817. if (Array.isArray(vFor)) {
  818. context = vFor.find(function (vForItem) {
  819. return vm.__get_value(propPath, vForItem) === value;
  820. });
  821. } else if (isPlainObject(vFor)) {
  822. context = Object.keys(vFor).find(function (vForKey) {
  823. return vm.__get_value(propPath, vFor[vForKey]) === value;
  824. });
  825. } else {
  826. console.error('v-for 暂不支持循环数据:', vFor);
  827. }
  828. }
  829. if (valuePath) {
  830. context = vm.__get_value(valuePath, context);
  831. }
  832. }
  833. });
  834. return context;
  835. }
  836. function processEventExtra(vm, extra, event) {
  837. var extraObj = {};
  838. if (Array.isArray(extra) && extra.length) {
  839. /**
  840. *[
  841. * ['data.items', 'data.id', item.data.id],
  842. * ['metas', 'id', meta.id]
  843. *],
  844. *[
  845. * ['data.items', 'data.id', item.data.id],
  846. * ['metas', 'id', meta.id]
  847. *],
  848. *'test'
  849. */
  850. extra.forEach(function (dataPath, index) {
  851. if (typeof dataPath === 'string') {
  852. if (!dataPath) {// model,prop.sync
  853. extraObj['$' + index] = vm;
  854. } else {
  855. if (dataPath === '$event') {// $event
  856. extraObj['$' + index] = event;
  857. } else if (dataPath === 'arguments') {
  858. if (event.detail && event.detail.__args__) {
  859. extraObj['$' + index] = event.detail.__args__;
  860. } else {
  861. extraObj['$' + index] = [event];
  862. }
  863. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  864. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  865. } else {
  866. extraObj['$' + index] = vm.__get_value(dataPath);
  867. }
  868. }
  869. } else {
  870. extraObj['$' + index] = getExtraValue(vm, dataPath);
  871. }
  872. });
  873. }
  874. return extraObj;
  875. }
  876. function getObjByArray(arr) {
  877. var obj = {};
  878. for (var i = 1; i < arr.length; i++) {
  879. var element = arr[i];
  880. obj[element[0]] = element[1];
  881. }
  882. return obj;
  883. }
  884. 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;
  885. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  886. if (isCustom) {// 自定义事件
  887. isCustomMPEvent = event.currentTarget &&
  888. event.currentTarget.dataset &&
  889. event.currentTarget.dataset.comType === 'wx';
  890. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  891. if (isCustomMPEvent) {
  892. return [event];
  893. }
  894. return event.detail.__args__ || event.detail;
  895. }
  896. }
  897. var extraObj = processEventExtra(vm, extra, event);
  898. var ret = [];
  899. args.forEach(function (arg) {
  900. if (arg === '$event') {
  901. if (methodName === '__set_model' && !isCustom) {// input v-model value
  902. ret.push(event.target.value);
  903. } else {
  904. if (isCustom && !isCustomMPEvent) {
  905. ret.push(event.detail.__args__[0]);
  906. } else {// wxcomponent 组件或内置组件
  907. ret.push(event);
  908. }
  909. }
  910. } else {
  911. if (Array.isArray(arg) && arg[0] === 'o') {
  912. ret.push(getObjByArray(arg));
  913. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  914. ret.push(extraObj[arg]);
  915. } else {
  916. ret.push(arg);
  917. }
  918. }
  919. });
  920. return ret;
  921. }
  922. var ONCE = '~';
  923. var CUSTOM = '^';
  924. function isMatchEventType(eventType, optType) {
  925. return eventType === optType ||
  926. optType === 'regionchange' && (
  927. eventType === 'begin' ||
  928. eventType === 'end');
  929. }
  930. function getContextVm(vm) {
  931. var $parent = vm.$parent;
  932. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  933. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  934. $parent = $parent.$parent;
  935. }
  936. return $parent && $parent.$parent;
  937. }
  938. function handleEvent(event) {var _this = this;
  939. event = wrapper$1(event);
  940. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  941. var dataset = (event.currentTarget || event.target).dataset;
  942. if (!dataset) {
  943. return console.warn('事件信息不存在');
  944. }
  945. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  946. if (!eventOpts) {
  947. return console.warn('事件信息不存在');
  948. }
  949. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  950. var eventType = event.type;
  951. var ret = [];
  952. eventOpts.forEach(function (eventOpt) {
  953. var type = eventOpt[0];
  954. var eventsArray = eventOpt[1];
  955. var isCustom = type.charAt(0) === CUSTOM;
  956. type = isCustom ? type.slice(1) : type;
  957. var isOnce = type.charAt(0) === ONCE;
  958. type = isOnce ? type.slice(1) : type;
  959. if (eventsArray && isMatchEventType(eventType, type)) {
  960. eventsArray.forEach(function (eventArray) {
  961. var methodName = eventArray[0];
  962. if (methodName) {
  963. var handlerCtx = _this.$vm;
  964. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  965. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  966. }
  967. if (methodName === '$emit') {
  968. handlerCtx.$emit.apply(handlerCtx,
  969. processEventArgs(
  970. _this.$vm,
  971. event,
  972. eventArray[1],
  973. eventArray[2],
  974. isCustom,
  975. methodName));
  976. return;
  977. }
  978. var handler = handlerCtx[methodName];
  979. if (!isFn(handler)) {
  980. throw new Error(" _vm.".concat(methodName, " is not a function"));
  981. }
  982. if (isOnce) {
  983. if (handler.once) {
  984. return;
  985. }
  986. handler.once = true;
  987. }
  988. var params = processEventArgs(
  989. _this.$vm,
  990. event,
  991. eventArray[1],
  992. eventArray[2],
  993. isCustom,
  994. methodName);
  995. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  996. // eslint-disable-next-line no-sparse-arrays
  997. ret.push(handler.apply(handlerCtx, (Array.isArray(params) ? params : []).concat([,,,,,,,,,, event])));
  998. }
  999. });
  1000. }
  1001. });
  1002. if (
  1003. eventType === 'input' &&
  1004. ret.length === 1 &&
  1005. typeof ret[0] !== 'undefined')
  1006. {
  1007. return ret[0];
  1008. }
  1009. }
  1010. var hooks = [
  1011. 'onShow',
  1012. 'onHide',
  1013. 'onError',
  1014. 'onPageNotFound',
  1015. 'onThemeChange',
  1016. 'onUnhandledRejection'];
  1017. function parseBaseApp(vm, _ref3)
  1018. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1019. if (vm.$options.store) {
  1020. _vue.default.prototype.$store = vm.$options.store;
  1021. }
  1022. _vue.default.prototype.mpHost = "mp-weixin";
  1023. _vue.default.mixin({
  1024. beforeCreate: function beforeCreate() {
  1025. if (!this.$options.mpType) {
  1026. return;
  1027. }
  1028. this.mpType = this.$options.mpType;
  1029. this.$mp = _defineProperty({
  1030. data: {} },
  1031. this.mpType, this.$options.mpInstance);
  1032. this.$scope = this.$options.mpInstance;
  1033. delete this.$options.mpType;
  1034. delete this.$options.mpInstance;
  1035. if (this.mpType !== 'app') {
  1036. initRefs(this);
  1037. initMocks(this, mocks);
  1038. }
  1039. } });
  1040. var appOptions = {
  1041. onLaunch: function onLaunch(args) {
  1042. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1043. return;
  1044. }
  1045. {
  1046. if (!wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1047. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1048. }
  1049. }
  1050. this.$vm = vm;
  1051. this.$vm.$mp = {
  1052. app: this };
  1053. this.$vm.$scope = this;
  1054. // vm 上也挂载 globalData
  1055. this.$vm.globalData = this.globalData;
  1056. this.$vm._isMounted = true;
  1057. this.$vm.__call_hook('mounted', args);
  1058. this.$vm.__call_hook('onLaunch', args);
  1059. } };
  1060. // 兼容旧版本 globalData
  1061. appOptions.globalData = vm.$options.globalData || {};
  1062. // 将 methods 中的方法挂在 getApp() 中
  1063. var methods = vm.$options.methods;
  1064. if (methods) {
  1065. Object.keys(methods).forEach(function (name) {
  1066. appOptions[name] = methods[name];
  1067. });
  1068. }
  1069. initHooks(appOptions, hooks);
  1070. return appOptions;
  1071. }
  1072. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1073. function findVmByVueId(vm, vuePid) {
  1074. var $children = vm.$children;
  1075. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1076. for (var i = $children.length - 1; i >= 0; i--) {
  1077. var childVm = $children[i];
  1078. if (childVm.$scope._$vueId === vuePid) {
  1079. return childVm;
  1080. }
  1081. }
  1082. // 反向递归查找
  1083. var parentVm;
  1084. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1085. parentVm = findVmByVueId($children[_i], vuePid);
  1086. if (parentVm) {
  1087. return parentVm;
  1088. }
  1089. }
  1090. }
  1091. function initBehavior(options) {
  1092. return Behavior(options);
  1093. }
  1094. function isPage() {
  1095. return !!this.route;
  1096. }
  1097. function initRelation(detail) {
  1098. this.triggerEvent('__l', detail);
  1099. }
  1100. function initRefs(vm) {
  1101. var mpInstance = vm.$scope;
  1102. Object.defineProperty(vm, '$refs', {
  1103. get: function get() {
  1104. var $refs = {};
  1105. var components = mpInstance.selectAllComponents('.vue-ref');
  1106. components.forEach(function (component) {
  1107. var ref = component.dataset.ref;
  1108. $refs[ref] = component.$vm || component;
  1109. });
  1110. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1111. forComponents.forEach(function (component) {
  1112. var ref = component.dataset.ref;
  1113. if (!$refs[ref]) {
  1114. $refs[ref] = [];
  1115. }
  1116. $refs[ref].push(component.$vm || component);
  1117. });
  1118. return $refs;
  1119. } });
  1120. }
  1121. function handleLink(event) {var _ref4 =
  1122. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1123. var parentVm;
  1124. if (vuePid) {
  1125. parentVm = findVmByVueId(this.$vm, vuePid);
  1126. }
  1127. if (!parentVm) {
  1128. parentVm = this.$vm;
  1129. }
  1130. vueOptions.parent = parentVm;
  1131. }
  1132. function parseApp(vm) {
  1133. return parseBaseApp(vm, {
  1134. mocks: mocks,
  1135. initRefs: initRefs });
  1136. }
  1137. function createApp(vm) {
  1138. App(parseApp(vm));
  1139. return vm;
  1140. }
  1141. function parseBaseComponent(vueComponentOptions)
  1142. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1143. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1144. var options = _objectSpread({
  1145. multipleSlots: true,
  1146. addGlobalClass: true },
  1147. vueOptions.options || {});
  1148. {
  1149. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1150. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1151. Object.assign(options, vueOptions['mp-weixin'].options);
  1152. }
  1153. }
  1154. var componentOptions = {
  1155. options: options,
  1156. data: initData(vueOptions, _vue.default.prototype),
  1157. behaviors: initBehaviors(vueOptions, initBehavior),
  1158. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1159. lifetimes: {
  1160. attached: function attached() {
  1161. var properties = this.properties;
  1162. var options = {
  1163. mpType: isPage.call(this) ? 'page' : 'component',
  1164. mpInstance: this,
  1165. propsData: properties };
  1166. initVueIds(properties.vueId, this);
  1167. // 处理父子关系
  1168. initRelation.call(this, {
  1169. vuePid: this._$vuePid,
  1170. vueOptions: options });
  1171. // 初始化 vue 实例
  1172. this.$vm = new VueComponent(options);
  1173. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1174. initSlots(this.$vm, properties.vueSlots);
  1175. // 触发首次 setData
  1176. this.$vm.$mount();
  1177. },
  1178. ready: function ready() {
  1179. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1180. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1181. if (this.$vm) {
  1182. this.$vm._isMounted = true;
  1183. this.$vm.__call_hook('mounted');
  1184. this.$vm.__call_hook('onReady');
  1185. }
  1186. },
  1187. detached: function detached() {
  1188. this.$vm && this.$vm.$destroy();
  1189. } },
  1190. pageLifetimes: {
  1191. show: function show(args) {
  1192. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1193. },
  1194. hide: function hide() {
  1195. this.$vm && this.$vm.__call_hook('onPageHide');
  1196. },
  1197. resize: function resize(size) {
  1198. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1199. } },
  1200. methods: {
  1201. __l: handleLink,
  1202. __e: handleEvent } };
  1203. // externalClasses
  1204. if (vueOptions.externalClasses) {
  1205. componentOptions.externalClasses = vueOptions.externalClasses;
  1206. }
  1207. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1208. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1209. componentOptions.methods[callMethod] = function (args) {
  1210. return this.$vm[callMethod](args);
  1211. };
  1212. });
  1213. }
  1214. if (isPage) {
  1215. return componentOptions;
  1216. }
  1217. return [componentOptions, VueComponent];
  1218. }
  1219. function parseComponent(vueComponentOptions) {
  1220. return parseBaseComponent(vueComponentOptions, {
  1221. isPage: isPage,
  1222. initRelation: initRelation });
  1223. }
  1224. var hooks$1 = [
  1225. 'onShow',
  1226. 'onHide',
  1227. 'onUnload'];
  1228. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1229. function parseBasePage(vuePageOptions, _ref6)
  1230. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1231. var pageOptions = parseComponent(vuePageOptions);
  1232. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1233. pageOptions.methods.onLoad = function (args) {
  1234. this.$vm.$mp.query = args; // 兼容 mpvue
  1235. this.$vm.__call_hook('onLoad', args);
  1236. };
  1237. return pageOptions;
  1238. }
  1239. function parsePage(vuePageOptions) {
  1240. return parseBasePage(vuePageOptions, {
  1241. isPage: isPage,
  1242. initRelation: initRelation });
  1243. }
  1244. function createPage(vuePageOptions) {
  1245. {
  1246. return Component(parsePage(vuePageOptions));
  1247. }
  1248. }
  1249. function createComponent(vueOptions) {
  1250. {
  1251. return Component(parseComponent(vueOptions));
  1252. }
  1253. }
  1254. todos.forEach(function (todoApi) {
  1255. protocols[todoApi] = false;
  1256. });
  1257. canIUses.forEach(function (canIUseApi) {
  1258. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1259. canIUseApi;
  1260. if (!wx.canIUse(apiName)) {
  1261. protocols[canIUseApi] = false;
  1262. }
  1263. });
  1264. var uni = {};
  1265. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1266. uni = new Proxy({}, {
  1267. get: function get(target, name) {
  1268. if (hasOwn(target, name)) {
  1269. return target[name];
  1270. }
  1271. if (baseApi[name]) {
  1272. return baseApi[name];
  1273. }
  1274. if (api[name]) {
  1275. return promisify(name, api[name]);
  1276. }
  1277. {
  1278. if (extraApi[name]) {
  1279. return promisify(name, extraApi[name]);
  1280. }
  1281. if (todoApis[name]) {
  1282. return promisify(name, todoApis[name]);
  1283. }
  1284. }
  1285. if (eventApi[name]) {
  1286. return eventApi[name];
  1287. }
  1288. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1289. return;
  1290. }
  1291. return promisify(name, wrapper(name, wx[name]));
  1292. },
  1293. set: function set(target, name, value) {
  1294. target[name] = value;
  1295. return true;
  1296. } });
  1297. } else {
  1298. Object.keys(baseApi).forEach(function (name) {
  1299. uni[name] = baseApi[name];
  1300. });
  1301. {
  1302. Object.keys(todoApis).forEach(function (name) {
  1303. uni[name] = promisify(name, todoApis[name]);
  1304. });
  1305. Object.keys(extraApi).forEach(function (name) {
  1306. uni[name] = promisify(name, todoApis[name]);
  1307. });
  1308. }
  1309. Object.keys(eventApi).forEach(function (name) {
  1310. uni[name] = eventApi[name];
  1311. });
  1312. Object.keys(api).forEach(function (name) {
  1313. uni[name] = promisify(name, api[name]);
  1314. });
  1315. Object.keys(wx).forEach(function (name) {
  1316. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1317. uni[name] = promisify(name, wrapper(name, wx[name]));
  1318. }
  1319. });
  1320. }
  1321. wx.createApp = createApp;
  1322. wx.createPage = createPage;
  1323. wx.createComponent = createComponent;
  1324. var uni$1 = uni;var _default =
  1325. uni$1;exports.default = _default;
  1326. /***/ }),
  1327. /* 2 */
  1328. /*!******************************************************************************************!*\
  1329. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  1330. \******************************************************************************************/
  1331. /*! exports provided: default */
  1332. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1333. "use strict";
  1334. __webpack_require__.r(__webpack_exports__);
  1335. /* WEBPACK VAR INJECTION */(function(global) {/*!
  1336. * Vue.js v2.6.11
  1337. * (c) 2014-2020 Evan You
  1338. * Released under the MIT License.
  1339. */
  1340. /* */
  1341. var emptyObject = Object.freeze({});
  1342. // These helpers produce better VM code in JS engines due to their
  1343. // explicitness and function inlining.
  1344. function isUndef (v) {
  1345. return v === undefined || v === null
  1346. }
  1347. function isDef (v) {
  1348. return v !== undefined && v !== null
  1349. }
  1350. function isTrue (v) {
  1351. return v === true
  1352. }
  1353. function isFalse (v) {
  1354. return v === false
  1355. }
  1356. /**
  1357. * Check if value is primitive.
  1358. */
  1359. function isPrimitive (value) {
  1360. return (
  1361. typeof value === 'string' ||
  1362. typeof value === 'number' ||
  1363. // $flow-disable-line
  1364. typeof value === 'symbol' ||
  1365. typeof value === 'boolean'
  1366. )
  1367. }
  1368. /**
  1369. * Quick object check - this is primarily used to tell
  1370. * Objects from primitive values when we know the value
  1371. * is a JSON-compliant type.
  1372. */
  1373. function isObject (obj) {
  1374. return obj !== null && typeof obj === 'object'
  1375. }
  1376. /**
  1377. * Get the raw type string of a value, e.g., [object Object].
  1378. */
  1379. var _toString = Object.prototype.toString;
  1380. function toRawType (value) {
  1381. return _toString.call(value).slice(8, -1)
  1382. }
  1383. /**
  1384. * Strict object type check. Only returns true
  1385. * for plain JavaScript objects.
  1386. */
  1387. function isPlainObject (obj) {
  1388. return _toString.call(obj) === '[object Object]'
  1389. }
  1390. function isRegExp (v) {
  1391. return _toString.call(v) === '[object RegExp]'
  1392. }
  1393. /**
  1394. * Check if val is a valid array index.
  1395. */
  1396. function isValidArrayIndex (val) {
  1397. var n = parseFloat(String(val));
  1398. return n >= 0 && Math.floor(n) === n && isFinite(val)
  1399. }
  1400. function isPromise (val) {
  1401. return (
  1402. isDef(val) &&
  1403. typeof val.then === 'function' &&
  1404. typeof val.catch === 'function'
  1405. )
  1406. }
  1407. /**
  1408. * Convert a value to a string that is actually rendered.
  1409. */
  1410. function toString (val) {
  1411. return val == null
  1412. ? ''
  1413. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  1414. ? JSON.stringify(val, null, 2)
  1415. : String(val)
  1416. }
  1417. /**
  1418. * Convert an input value to a number for persistence.
  1419. * If the conversion fails, return original string.
  1420. */
  1421. function toNumber (val) {
  1422. var n = parseFloat(val);
  1423. return isNaN(n) ? val : n
  1424. }
  1425. /**
  1426. * Make a map and return a function for checking if a key
  1427. * is in that map.
  1428. */
  1429. function makeMap (
  1430. str,
  1431. expectsLowerCase
  1432. ) {
  1433. var map = Object.create(null);
  1434. var list = str.split(',');
  1435. for (var i = 0; i < list.length; i++) {
  1436. map[list[i]] = true;
  1437. }
  1438. return expectsLowerCase
  1439. ? function (val) { return map[val.toLowerCase()]; }
  1440. : function (val) { return map[val]; }
  1441. }
  1442. /**
  1443. * Check if a tag is a built-in tag.
  1444. */
  1445. var isBuiltInTag = makeMap('slot,component', true);
  1446. /**
  1447. * Check if an attribute is a reserved attribute.
  1448. */
  1449. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  1450. /**
  1451. * Remove an item from an array.
  1452. */
  1453. function remove (arr, item) {
  1454. if (arr.length) {
  1455. var index = arr.indexOf(item);
  1456. if (index > -1) {
  1457. return arr.splice(index, 1)
  1458. }
  1459. }
  1460. }
  1461. /**
  1462. * Check whether an object has the property.
  1463. */
  1464. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1465. function hasOwn (obj, key) {
  1466. return hasOwnProperty.call(obj, key)
  1467. }
  1468. /**
  1469. * Create a cached version of a pure function.
  1470. */
  1471. function cached (fn) {
  1472. var cache = Object.create(null);
  1473. return (function cachedFn (str) {
  1474. var hit = cache[str];
  1475. return hit || (cache[str] = fn(str))
  1476. })
  1477. }
  1478. /**
  1479. * Camelize a hyphen-delimited string.
  1480. */
  1481. var camelizeRE = /-(\w)/g;
  1482. var camelize = cached(function (str) {
  1483. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  1484. });
  1485. /**
  1486. * Capitalize a string.
  1487. */
  1488. var capitalize = cached(function (str) {
  1489. return str.charAt(0).toUpperCase() + str.slice(1)
  1490. });
  1491. /**
  1492. * Hyphenate a camelCase string.
  1493. */
  1494. var hyphenateRE = /\B([A-Z])/g;
  1495. var hyphenate = cached(function (str) {
  1496. return str.replace(hyphenateRE, '-$1').toLowerCase()
  1497. });
  1498. /**
  1499. * Simple bind polyfill for environments that do not support it,
  1500. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  1501. * since native bind is now performant enough in most browsers.
  1502. * But removing it would mean breaking code that was able to run in
  1503. * PhantomJS 1.x, so this must be kept for backward compatibility.
  1504. */
  1505. /* istanbul ignore next */
  1506. function polyfillBind (fn, ctx) {
  1507. function boundFn (a) {
  1508. var l = arguments.length;
  1509. return l
  1510. ? l > 1
  1511. ? fn.apply(ctx, arguments)
  1512. : fn.call(ctx, a)
  1513. : fn.call(ctx)
  1514. }
  1515. boundFn._length = fn.length;
  1516. return boundFn
  1517. }
  1518. function nativeBind (fn, ctx) {
  1519. return fn.bind(ctx)
  1520. }
  1521. var bind = Function.prototype.bind
  1522. ? nativeBind
  1523. : polyfillBind;
  1524. /**
  1525. * Convert an Array-like object to a real Array.
  1526. */
  1527. function toArray (list, start) {
  1528. start = start || 0;
  1529. var i = list.length - start;
  1530. var ret = new Array(i);
  1531. while (i--) {
  1532. ret[i] = list[i + start];
  1533. }
  1534. return ret
  1535. }
  1536. /**
  1537. * Mix properties into target object.
  1538. */
  1539. function extend (to, _from) {
  1540. for (var key in _from) {
  1541. to[key] = _from[key];
  1542. }
  1543. return to
  1544. }
  1545. /**
  1546. * Merge an Array of Objects into a single Object.
  1547. */
  1548. function toObject (arr) {
  1549. var res = {};
  1550. for (var i = 0; i < arr.length; i++) {
  1551. if (arr[i]) {
  1552. extend(res, arr[i]);
  1553. }
  1554. }
  1555. return res
  1556. }
  1557. /* eslint-disable no-unused-vars */
  1558. /**
  1559. * Perform no operation.
  1560. * Stubbing args to make Flow happy without leaving useless transpiled code
  1561. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  1562. */
  1563. function noop (a, b, c) {}
  1564. /**
  1565. * Always return false.
  1566. */
  1567. var no = function (a, b, c) { return false; };
  1568. /* eslint-enable no-unused-vars */
  1569. /**
  1570. * Return the same value.
  1571. */
  1572. var identity = function (_) { return _; };
  1573. /**
  1574. * Check if two values are loosely equal - that is,
  1575. * if they are plain objects, do they have the same shape?
  1576. */
  1577. function looseEqual (a, b) {
  1578. if (a === b) { return true }
  1579. var isObjectA = isObject(a);
  1580. var isObjectB = isObject(b);
  1581. if (isObjectA && isObjectB) {
  1582. try {
  1583. var isArrayA = Array.isArray(a);
  1584. var isArrayB = Array.isArray(b);
  1585. if (isArrayA && isArrayB) {
  1586. return a.length === b.length && a.every(function (e, i) {
  1587. return looseEqual(e, b[i])
  1588. })
  1589. } else if (a instanceof Date && b instanceof Date) {
  1590. return a.getTime() === b.getTime()
  1591. } else if (!isArrayA && !isArrayB) {
  1592. var keysA = Object.keys(a);
  1593. var keysB = Object.keys(b);
  1594. return keysA.length === keysB.length && keysA.every(function (key) {
  1595. return looseEqual(a[key], b[key])
  1596. })
  1597. } else {
  1598. /* istanbul ignore next */
  1599. return false
  1600. }
  1601. } catch (e) {
  1602. /* istanbul ignore next */
  1603. return false
  1604. }
  1605. } else if (!isObjectA && !isObjectB) {
  1606. return String(a) === String(b)
  1607. } else {
  1608. return false
  1609. }
  1610. }
  1611. /**
  1612. * Return the first index at which a loosely equal value can be
  1613. * found in the array (if value is a plain object, the array must
  1614. * contain an object of the same shape), or -1 if it is not present.
  1615. */
  1616. function looseIndexOf (arr, val) {
  1617. for (var i = 0; i < arr.length; i++) {
  1618. if (looseEqual(arr[i], val)) { return i }
  1619. }
  1620. return -1
  1621. }
  1622. /**
  1623. * Ensure a function is called only once.
  1624. */
  1625. function once (fn) {
  1626. var called = false;
  1627. return function () {
  1628. if (!called) {
  1629. called = true;
  1630. fn.apply(this, arguments);
  1631. }
  1632. }
  1633. }
  1634. var ASSET_TYPES = [
  1635. 'component',
  1636. 'directive',
  1637. 'filter'
  1638. ];
  1639. var LIFECYCLE_HOOKS = [
  1640. 'beforeCreate',
  1641. 'created',
  1642. 'beforeMount',
  1643. 'mounted',
  1644. 'beforeUpdate',
  1645. 'updated',
  1646. 'beforeDestroy',
  1647. 'destroyed',
  1648. 'activated',
  1649. 'deactivated',
  1650. 'errorCaptured',
  1651. 'serverPrefetch'
  1652. ];
  1653. /* */
  1654. var config = ({
  1655. /**
  1656. * Option merge strategies (used in core/util/options)
  1657. */
  1658. // $flow-disable-line
  1659. optionMergeStrategies: Object.create(null),
  1660. /**
  1661. * Whether to suppress warnings.
  1662. */
  1663. silent: false,
  1664. /**
  1665. * Show production mode tip message on boot?
  1666. */
  1667. productionTip: "development" !== 'production',
  1668. /**
  1669. * Whether to enable devtools
  1670. */
  1671. devtools: "development" !== 'production',
  1672. /**
  1673. * Whether to record perf
  1674. */
  1675. performance: false,
  1676. /**
  1677. * Error handler for watcher errors
  1678. */
  1679. errorHandler: null,
  1680. /**
  1681. * Warn handler for watcher warns
  1682. */
  1683. warnHandler: null,
  1684. /**
  1685. * Ignore certain custom elements
  1686. */
  1687. ignoredElements: [],
  1688. /**
  1689. * Custom user key aliases for v-on
  1690. */
  1691. // $flow-disable-line
  1692. keyCodes: Object.create(null),
  1693. /**
  1694. * Check if a tag is reserved so that it cannot be registered as a
  1695. * component. This is platform-dependent and may be overwritten.
  1696. */
  1697. isReservedTag: no,
  1698. /**
  1699. * Check if an attribute is reserved so that it cannot be used as a component
  1700. * prop. This is platform-dependent and may be overwritten.
  1701. */
  1702. isReservedAttr: no,
  1703. /**
  1704. * Check if a tag is an unknown element.
  1705. * Platform-dependent.
  1706. */
  1707. isUnknownElement: no,
  1708. /**
  1709. * Get the namespace of an element
  1710. */
  1711. getTagNamespace: noop,
  1712. /**
  1713. * Parse the real tag name for the specific platform.
  1714. */
  1715. parsePlatformTagName: identity,
  1716. /**
  1717. * Check if an attribute must be bound using property, e.g. value
  1718. * Platform-dependent.
  1719. */
  1720. mustUseProp: no,
  1721. /**
  1722. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  1723. * This will significantly reduce performance if set to false.
  1724. */
  1725. async: true,
  1726. /**
  1727. * Exposed for legacy reasons
  1728. */
  1729. _lifecycleHooks: LIFECYCLE_HOOKS
  1730. });
  1731. /* */
  1732. /**
  1733. * unicode letters used for parsing html tags, component names and property paths.
  1734. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  1735. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  1736. */
  1737. 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/;
  1738. /**
  1739. * Check if a string starts with $ or _
  1740. */
  1741. function isReserved (str) {
  1742. var c = (str + '').charCodeAt(0);
  1743. return c === 0x24 || c === 0x5F
  1744. }
  1745. /**
  1746. * Define a property.
  1747. */
  1748. function def (obj, key, val, enumerable) {
  1749. Object.defineProperty(obj, key, {
  1750. value: val,
  1751. enumerable: !!enumerable,
  1752. writable: true,
  1753. configurable: true
  1754. });
  1755. }
  1756. /**
  1757. * Parse simple path.
  1758. */
  1759. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  1760. function parsePath (path) {
  1761. if (bailRE.test(path)) {
  1762. return
  1763. }
  1764. var segments = path.split('.');
  1765. return function (obj) {
  1766. for (var i = 0; i < segments.length; i++) {
  1767. if (!obj) { return }
  1768. obj = obj[segments[i]];
  1769. }
  1770. return obj
  1771. }
  1772. }
  1773. /* */
  1774. // can we use __proto__?
  1775. var hasProto = '__proto__' in {};
  1776. // Browser environment sniffing
  1777. var inBrowser = typeof window !== 'undefined';
  1778. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  1779. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  1780. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  1781. var isIE = UA && /msie|trident/.test(UA);
  1782. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  1783. var isEdge = UA && UA.indexOf('edge/') > 0;
  1784. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  1785. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  1786. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  1787. var isPhantomJS = UA && /phantomjs/.test(UA);
  1788. var isFF = UA && UA.match(/firefox\/(\d+)/);
  1789. // Firefox has a "watch" function on Object.prototype...
  1790. var nativeWatch = ({}).watch;
  1791. if (inBrowser) {
  1792. try {
  1793. var opts = {};
  1794. Object.defineProperty(opts, 'passive', ({
  1795. get: function get () {
  1796. }
  1797. })); // https://github.com/facebook/flow/issues/285
  1798. window.addEventListener('test-passive', null, opts);
  1799. } catch (e) {}
  1800. }
  1801. // this needs to be lazy-evaled because vue may be required before
  1802. // vue-server-renderer can set VUE_ENV
  1803. var _isServer;
  1804. var isServerRendering = function () {
  1805. if (_isServer === undefined) {
  1806. /* istanbul ignore if */
  1807. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  1808. // detect presence of vue-server-renderer and avoid
  1809. // Webpack shimming the process
  1810. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  1811. } else {
  1812. _isServer = false;
  1813. }
  1814. }
  1815. return _isServer
  1816. };
  1817. // detect devtools
  1818. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  1819. /* istanbul ignore next */
  1820. function isNative (Ctor) {
  1821. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  1822. }
  1823. var hasSymbol =
  1824. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  1825. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  1826. var _Set;
  1827. /* istanbul ignore if */ // $flow-disable-line
  1828. if (typeof Set !== 'undefined' && isNative(Set)) {
  1829. // use native Set when available.
  1830. _Set = Set;
  1831. } else {
  1832. // a non-standard Set polyfill that only works with primitive keys.
  1833. _Set = /*@__PURE__*/(function () {
  1834. function Set () {
  1835. this.set = Object.create(null);
  1836. }
  1837. Set.prototype.has = function has (key) {
  1838. return this.set[key] === true
  1839. };
  1840. Set.prototype.add = function add (key) {
  1841. this.set[key] = true;
  1842. };
  1843. Set.prototype.clear = function clear () {
  1844. this.set = Object.create(null);
  1845. };
  1846. return Set;
  1847. }());
  1848. }
  1849. /* */
  1850. var warn = noop;
  1851. var tip = noop;
  1852. var generateComponentTrace = (noop); // work around flow check
  1853. var formatComponentName = (noop);
  1854. if (true) {
  1855. var hasConsole = typeof console !== 'undefined';
  1856. var classifyRE = /(?:^|[-_])(\w)/g;
  1857. var classify = function (str) { return str
  1858. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  1859. .replace(/[-_]/g, ''); };
  1860. warn = function (msg, vm) {
  1861. var trace = vm ? generateComponentTrace(vm) : '';
  1862. if (config.warnHandler) {
  1863. config.warnHandler.call(null, msg, vm, trace);
  1864. } else if (hasConsole && (!config.silent)) {
  1865. console.error(("[Vue warn]: " + msg + trace));
  1866. }
  1867. };
  1868. tip = function (msg, vm) {
  1869. if (hasConsole && (!config.silent)) {
  1870. console.warn("[Vue tip]: " + msg + (
  1871. vm ? generateComponentTrace(vm) : ''
  1872. ));
  1873. }
  1874. };
  1875. formatComponentName = function (vm, includeFile) {
  1876. if (vm.$root === vm) {
  1877. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  1878. return ('') + vm.$options.__file
  1879. }
  1880. return '<Root>'
  1881. }
  1882. var options = typeof vm === 'function' && vm.cid != null
  1883. ? vm.options
  1884. : vm._isVue
  1885. ? vm.$options || vm.constructor.options
  1886. : vm;
  1887. var name = options.name || options._componentTag;
  1888. var file = options.__file;
  1889. if (!name && file) {
  1890. var match = file.match(/([^/\\]+)\.vue$/);
  1891. name = match && match[1];
  1892. }
  1893. return (
  1894. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  1895. (file && includeFile !== false ? (" at " + file) : '')
  1896. )
  1897. };
  1898. var repeat = function (str, n) {
  1899. var res = '';
  1900. while (n) {
  1901. if (n % 2 === 1) { res += str; }
  1902. if (n > 1) { str += str; }
  1903. n >>= 1;
  1904. }
  1905. return res
  1906. };
  1907. generateComponentTrace = function (vm) {
  1908. if (vm._isVue && vm.$parent) {
  1909. var tree = [];
  1910. var currentRecursiveSequence = 0;
  1911. while (vm && vm.$options.name !== 'PageBody') {
  1912. if (tree.length > 0) {
  1913. var last = tree[tree.length - 1];
  1914. if (last.constructor === vm.constructor) {
  1915. currentRecursiveSequence++;
  1916. vm = vm.$parent;
  1917. continue
  1918. } else if (currentRecursiveSequence > 0) {
  1919. tree[tree.length - 1] = [last, currentRecursiveSequence];
  1920. currentRecursiveSequence = 0;
  1921. }
  1922. }
  1923. !vm.$options.isReserved && tree.push(vm);
  1924. vm = vm.$parent;
  1925. }
  1926. return '\n\nfound in\n\n' + tree
  1927. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  1928. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  1929. : formatComponentName(vm))); })
  1930. .join('\n')
  1931. } else {
  1932. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  1933. }
  1934. };
  1935. }
  1936. /* */
  1937. var uid = 0;
  1938. /**
  1939. * A dep is an observable that can have multiple
  1940. * directives subscribing to it.
  1941. */
  1942. var Dep = function Dep () {
  1943. this.id = uid++;
  1944. this.subs = [];
  1945. };
  1946. Dep.prototype.addSub = function addSub (sub) {
  1947. this.subs.push(sub);
  1948. };
  1949. Dep.prototype.removeSub = function removeSub (sub) {
  1950. remove(this.subs, sub);
  1951. };
  1952. Dep.prototype.depend = function depend () {
  1953. if (Dep.SharedObject.target) {
  1954. Dep.SharedObject.target.addDep(this);
  1955. }
  1956. };
  1957. Dep.prototype.notify = function notify () {
  1958. // stabilize the subscriber list first
  1959. var subs = this.subs.slice();
  1960. if ( true && !config.async) {
  1961. // subs aren't sorted in scheduler if not running async
  1962. // we need to sort them now to make sure they fire in correct
  1963. // order
  1964. subs.sort(function (a, b) { return a.id - b.id; });
  1965. }
  1966. for (var i = 0, l = subs.length; i < l; i++) {
  1967. subs[i].update();
  1968. }
  1969. };
  1970. // The current target watcher being evaluated.
  1971. // This is globally unique because only one watcher
  1972. // can be evaluated at a time.
  1973. // fixed by xxxxxx (nvue shared vuex)
  1974. /* eslint-disable no-undef */
  1975. Dep.SharedObject = {};
  1976. Dep.SharedObject.target = null;
  1977. Dep.SharedObject.targetStack = [];
  1978. function pushTarget (target) {
  1979. Dep.SharedObject.targetStack.push(target);
  1980. Dep.SharedObject.target = target;
  1981. }
  1982. function popTarget () {
  1983. Dep.SharedObject.targetStack.pop();
  1984. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  1985. }
  1986. /* */
  1987. var VNode = function VNode (
  1988. tag,
  1989. data,
  1990. children,
  1991. text,
  1992. elm,
  1993. context,
  1994. componentOptions,
  1995. asyncFactory
  1996. ) {
  1997. this.tag = tag;
  1998. this.data = data;
  1999. this.children = children;
  2000. this.text = text;
  2001. this.elm = elm;
  2002. this.ns = undefined;
  2003. this.context = context;
  2004. this.fnContext = undefined;
  2005. this.fnOptions = undefined;
  2006. this.fnScopeId = undefined;
  2007. this.key = data && data.key;
  2008. this.componentOptions = componentOptions;
  2009. this.componentInstance = undefined;
  2010. this.parent = undefined;
  2011. this.raw = false;
  2012. this.isStatic = false;
  2013. this.isRootInsert = true;
  2014. this.isComment = false;
  2015. this.isCloned = false;
  2016. this.isOnce = false;
  2017. this.asyncFactory = asyncFactory;
  2018. this.asyncMeta = undefined;
  2019. this.isAsyncPlaceholder = false;
  2020. };
  2021. var prototypeAccessors = { child: { configurable: true } };
  2022. // DEPRECATED: alias for componentInstance for backwards compat.
  2023. /* istanbul ignore next */
  2024. prototypeAccessors.child.get = function () {
  2025. return this.componentInstance
  2026. };
  2027. Object.defineProperties( VNode.prototype, prototypeAccessors );
  2028. var createEmptyVNode = function (text) {
  2029. if ( text === void 0 ) text = '';
  2030. var node = new VNode();
  2031. node.text = text;
  2032. node.isComment = true;
  2033. return node
  2034. };
  2035. function createTextVNode (val) {
  2036. return new VNode(undefined, undefined, undefined, String(val))
  2037. }
  2038. // optimized shallow clone
  2039. // used for static nodes and slot nodes because they may be reused across
  2040. // multiple renders, cloning them avoids errors when DOM manipulations rely
  2041. // on their elm reference.
  2042. function cloneVNode (vnode) {
  2043. var cloned = new VNode(
  2044. vnode.tag,
  2045. vnode.data,
  2046. // #7975
  2047. // clone children array to avoid mutating original in case of cloning
  2048. // a child.
  2049. vnode.children && vnode.children.slice(),
  2050. vnode.text,
  2051. vnode.elm,
  2052. vnode.context,
  2053. vnode.componentOptions,
  2054. vnode.asyncFactory
  2055. );
  2056. cloned.ns = vnode.ns;
  2057. cloned.isStatic = vnode.isStatic;
  2058. cloned.key = vnode.key;
  2059. cloned.isComment = vnode.isComment;
  2060. cloned.fnContext = vnode.fnContext;
  2061. cloned.fnOptions = vnode.fnOptions;
  2062. cloned.fnScopeId = vnode.fnScopeId;
  2063. cloned.asyncMeta = vnode.asyncMeta;
  2064. cloned.isCloned = true;
  2065. return cloned
  2066. }
  2067. /*
  2068. * not type checking this file because flow doesn't play well with
  2069. * dynamically accessing methods on Array prototype
  2070. */
  2071. var arrayProto = Array.prototype;
  2072. var arrayMethods = Object.create(arrayProto);
  2073. var methodsToPatch = [
  2074. 'push',
  2075. 'pop',
  2076. 'shift',
  2077. 'unshift',
  2078. 'splice',
  2079. 'sort',
  2080. 'reverse'
  2081. ];
  2082. /**
  2083. * Intercept mutating methods and emit events
  2084. */
  2085. methodsToPatch.forEach(function (method) {
  2086. // cache original method
  2087. var original = arrayProto[method];
  2088. def(arrayMethods, method, function mutator () {
  2089. var args = [], len = arguments.length;
  2090. while ( len-- ) args[ len ] = arguments[ len ];
  2091. var result = original.apply(this, args);
  2092. var ob = this.__ob__;
  2093. var inserted;
  2094. switch (method) {
  2095. case 'push':
  2096. case 'unshift':
  2097. inserted = args;
  2098. break
  2099. case 'splice':
  2100. inserted = args.slice(2);
  2101. break
  2102. }
  2103. if (inserted) { ob.observeArray(inserted); }
  2104. // notify change
  2105. ob.dep.notify();
  2106. return result
  2107. });
  2108. });
  2109. /* */
  2110. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  2111. /**
  2112. * In some cases we may want to disable observation inside a component's
  2113. * update computation.
  2114. */
  2115. var shouldObserve = true;
  2116. function toggleObserving (value) {
  2117. shouldObserve = value;
  2118. }
  2119. /**
  2120. * Observer class that is attached to each observed
  2121. * object. Once attached, the observer converts the target
  2122. * object's property keys into getter/setters that
  2123. * collect dependencies and dispatch updates.
  2124. */
  2125. var Observer = function Observer (value) {
  2126. this.value = value;
  2127. this.dep = new Dep();
  2128. this.vmCount = 0;
  2129. def(value, '__ob__', this);
  2130. if (Array.isArray(value)) {
  2131. if (hasProto) {
  2132. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  2133. if(value.push !== value.__proto__.push){
  2134. copyAugment(value, arrayMethods, arrayKeys);
  2135. } else {
  2136. protoAugment(value, arrayMethods);
  2137. }
  2138. }
  2139. } else {
  2140. copyAugment(value, arrayMethods, arrayKeys);
  2141. }
  2142. this.observeArray(value);
  2143. } else {
  2144. this.walk(value);
  2145. }
  2146. };
  2147. /**
  2148. * Walk through all properties and convert them into
  2149. * getter/setters. This method should only be called when
  2150. * value type is Object.
  2151. */
  2152. Observer.prototype.walk = function walk (obj) {
  2153. var keys = Object.keys(obj);
  2154. for (var i = 0; i < keys.length; i++) {
  2155. defineReactive$$1(obj, keys[i]);
  2156. }
  2157. };
  2158. /**
  2159. * Observe a list of Array items.
  2160. */
  2161. Observer.prototype.observeArray = function observeArray (items) {
  2162. for (var i = 0, l = items.length; i < l; i++) {
  2163. observe(items[i]);
  2164. }
  2165. };
  2166. // helpers
  2167. /**
  2168. * Augment a target Object or Array by intercepting
  2169. * the prototype chain using __proto__
  2170. */
  2171. function protoAugment (target, src) {
  2172. /* eslint-disable no-proto */
  2173. target.__proto__ = src;
  2174. /* eslint-enable no-proto */
  2175. }
  2176. /**
  2177. * Augment a target Object or Array by defining
  2178. * hidden properties.
  2179. */
  2180. /* istanbul ignore next */
  2181. function copyAugment (target, src, keys) {
  2182. for (var i = 0, l = keys.length; i < l; i++) {
  2183. var key = keys[i];
  2184. def(target, key, src[key]);
  2185. }
  2186. }
  2187. /**
  2188. * Attempt to create an observer instance for a value,
  2189. * returns the new observer if successfully observed,
  2190. * or the existing observer if the value already has one.
  2191. */
  2192. function observe (value, asRootData) {
  2193. if (!isObject(value) || value instanceof VNode) {
  2194. return
  2195. }
  2196. var ob;
  2197. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  2198. ob = value.__ob__;
  2199. } else if (
  2200. shouldObserve &&
  2201. !isServerRendering() &&
  2202. (Array.isArray(value) || isPlainObject(value)) &&
  2203. Object.isExtensible(value) &&
  2204. !value._isVue
  2205. ) {
  2206. ob = new Observer(value);
  2207. }
  2208. if (asRootData && ob) {
  2209. ob.vmCount++;
  2210. }
  2211. return ob
  2212. }
  2213. /**
  2214. * Define a reactive property on an Object.
  2215. */
  2216. function defineReactive$$1 (
  2217. obj,
  2218. key,
  2219. val,
  2220. customSetter,
  2221. shallow
  2222. ) {
  2223. var dep = new Dep();
  2224. var property = Object.getOwnPropertyDescriptor(obj, key);
  2225. if (property && property.configurable === false) {
  2226. return
  2227. }
  2228. // cater for pre-defined getter/setters
  2229. var getter = property && property.get;
  2230. var setter = property && property.set;
  2231. if ((!getter || setter) && arguments.length === 2) {
  2232. val = obj[key];
  2233. }
  2234. var childOb = !shallow && observe(val);
  2235. Object.defineProperty(obj, key, {
  2236. enumerable: true,
  2237. configurable: true,
  2238. get: function reactiveGetter () {
  2239. var value = getter ? getter.call(obj) : val;
  2240. if (Dep.SharedObject.target) { // fixed by xxxxxx
  2241. dep.depend();
  2242. if (childOb) {
  2243. childOb.dep.depend();
  2244. if (Array.isArray(value)) {
  2245. dependArray(value);
  2246. }
  2247. }
  2248. }
  2249. return value
  2250. },
  2251. set: function reactiveSetter (newVal) {
  2252. var value = getter ? getter.call(obj) : val;
  2253. /* eslint-disable no-self-compare */
  2254. if (newVal === value || (newVal !== newVal && value !== value)) {
  2255. return
  2256. }
  2257. /* eslint-enable no-self-compare */
  2258. if ( true && customSetter) {
  2259. customSetter();
  2260. }
  2261. // #7981: for accessor properties without setter
  2262. if (getter && !setter) { return }
  2263. if (setter) {
  2264. setter.call(obj, newVal);
  2265. } else {
  2266. val = newVal;
  2267. }
  2268. childOb = !shallow && observe(newVal);
  2269. dep.notify();
  2270. }
  2271. });
  2272. }
  2273. /**
  2274. * Set a property on an object. Adds the new property and
  2275. * triggers change notification if the property doesn't
  2276. * already exist.
  2277. */
  2278. function set (target, key, val) {
  2279. if ( true &&
  2280. (isUndef(target) || isPrimitive(target))
  2281. ) {
  2282. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  2283. }
  2284. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2285. target.length = Math.max(target.length, key);
  2286. target.splice(key, 1, val);
  2287. return val
  2288. }
  2289. if (key in target && !(key in Object.prototype)) {
  2290. target[key] = val;
  2291. return val
  2292. }
  2293. var ob = (target).__ob__;
  2294. if (target._isVue || (ob && ob.vmCount)) {
  2295. true && warn(
  2296. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  2297. 'at runtime - declare it upfront in the data option.'
  2298. );
  2299. return val
  2300. }
  2301. if (!ob) {
  2302. target[key] = val;
  2303. return val
  2304. }
  2305. defineReactive$$1(ob.value, key, val);
  2306. ob.dep.notify();
  2307. return val
  2308. }
  2309. /**
  2310. * Delete a property and trigger change if necessary.
  2311. */
  2312. function del (target, key) {
  2313. if ( true &&
  2314. (isUndef(target) || isPrimitive(target))
  2315. ) {
  2316. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  2317. }
  2318. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2319. target.splice(key, 1);
  2320. return
  2321. }
  2322. var ob = (target).__ob__;
  2323. if (target._isVue || (ob && ob.vmCount)) {
  2324. true && warn(
  2325. 'Avoid deleting properties on a Vue instance or its root $data ' +
  2326. '- just set it to null.'
  2327. );
  2328. return
  2329. }
  2330. if (!hasOwn(target, key)) {
  2331. return
  2332. }
  2333. delete target[key];
  2334. if (!ob) {
  2335. return
  2336. }
  2337. ob.dep.notify();
  2338. }
  2339. /**
  2340. * Collect dependencies on array elements when the array is touched, since
  2341. * we cannot intercept array element access like property getters.
  2342. */
  2343. function dependArray (value) {
  2344. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  2345. e = value[i];
  2346. e && e.__ob__ && e.__ob__.dep.depend();
  2347. if (Array.isArray(e)) {
  2348. dependArray(e);
  2349. }
  2350. }
  2351. }
  2352. /* */
  2353. /**
  2354. * Option overwriting strategies are functions that handle
  2355. * how to merge a parent option value and a child option
  2356. * value into the final value.
  2357. */
  2358. var strats = config.optionMergeStrategies;
  2359. /**
  2360. * Options with restrictions
  2361. */
  2362. if (true) {
  2363. strats.el = strats.propsData = function (parent, child, vm, key) {
  2364. if (!vm) {
  2365. warn(
  2366. "option \"" + key + "\" can only be used during instance " +
  2367. 'creation with the `new` keyword.'
  2368. );
  2369. }
  2370. return defaultStrat(parent, child)
  2371. };
  2372. }
  2373. /**
  2374. * Helper that recursively merges two data objects together.
  2375. */
  2376. function mergeData (to, from) {
  2377. if (!from) { return to }
  2378. var key, toVal, fromVal;
  2379. var keys = hasSymbol
  2380. ? Reflect.ownKeys(from)
  2381. : Object.keys(from);
  2382. for (var i = 0; i < keys.length; i++) {
  2383. key = keys[i];
  2384. // in case the object is already observed...
  2385. if (key === '__ob__') { continue }
  2386. toVal = to[key];
  2387. fromVal = from[key];
  2388. if (!hasOwn(to, key)) {
  2389. set(to, key, fromVal);
  2390. } else if (
  2391. toVal !== fromVal &&
  2392. isPlainObject(toVal) &&
  2393. isPlainObject(fromVal)
  2394. ) {
  2395. mergeData(toVal, fromVal);
  2396. }
  2397. }
  2398. return to
  2399. }
  2400. /**
  2401. * Data
  2402. */
  2403. function mergeDataOrFn (
  2404. parentVal,
  2405. childVal,
  2406. vm
  2407. ) {
  2408. if (!vm) {
  2409. // in a Vue.extend merge, both should be functions
  2410. if (!childVal) {
  2411. return parentVal
  2412. }
  2413. if (!parentVal) {
  2414. return childVal
  2415. }
  2416. // when parentVal & childVal are both present,
  2417. // we need to return a function that returns the
  2418. // merged result of both functions... no need to
  2419. // check if parentVal is a function here because
  2420. // it has to be a function to pass previous merges.
  2421. return function mergedDataFn () {
  2422. return mergeData(
  2423. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  2424. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  2425. )
  2426. }
  2427. } else {
  2428. return function mergedInstanceDataFn () {
  2429. // instance merge
  2430. var instanceData = typeof childVal === 'function'
  2431. ? childVal.call(vm, vm)
  2432. : childVal;
  2433. var defaultData = typeof parentVal === 'function'
  2434. ? parentVal.call(vm, vm)
  2435. : parentVal;
  2436. if (instanceData) {
  2437. return mergeData(instanceData, defaultData)
  2438. } else {
  2439. return defaultData
  2440. }
  2441. }
  2442. }
  2443. }
  2444. strats.data = function (
  2445. parentVal,
  2446. childVal,
  2447. vm
  2448. ) {
  2449. if (!vm) {
  2450. if (childVal && typeof childVal !== 'function') {
  2451. true && warn(
  2452. 'The "data" option should be a function ' +
  2453. 'that returns a per-instance value in component ' +
  2454. 'definitions.',
  2455. vm
  2456. );
  2457. return parentVal
  2458. }
  2459. return mergeDataOrFn(parentVal, childVal)
  2460. }
  2461. return mergeDataOrFn(parentVal, childVal, vm)
  2462. };
  2463. /**
  2464. * Hooks and props are merged as arrays.
  2465. */
  2466. function mergeHook (
  2467. parentVal,
  2468. childVal
  2469. ) {
  2470. var res = childVal
  2471. ? parentVal
  2472. ? parentVal.concat(childVal)
  2473. : Array.isArray(childVal)
  2474. ? childVal
  2475. : [childVal]
  2476. : parentVal;
  2477. return res
  2478. ? dedupeHooks(res)
  2479. : res
  2480. }
  2481. function dedupeHooks (hooks) {
  2482. var res = [];
  2483. for (var i = 0; i < hooks.length; i++) {
  2484. if (res.indexOf(hooks[i]) === -1) {
  2485. res.push(hooks[i]);
  2486. }
  2487. }
  2488. return res
  2489. }
  2490. LIFECYCLE_HOOKS.forEach(function (hook) {
  2491. strats[hook] = mergeHook;
  2492. });
  2493. /**
  2494. * Assets
  2495. *
  2496. * When a vm is present (instance creation), we need to do
  2497. * a three-way merge between constructor options, instance
  2498. * options and parent options.
  2499. */
  2500. function mergeAssets (
  2501. parentVal,
  2502. childVal,
  2503. vm,
  2504. key
  2505. ) {
  2506. var res = Object.create(parentVal || null);
  2507. if (childVal) {
  2508. true && assertObjectType(key, childVal, vm);
  2509. return extend(res, childVal)
  2510. } else {
  2511. return res
  2512. }
  2513. }
  2514. ASSET_TYPES.forEach(function (type) {
  2515. strats[type + 's'] = mergeAssets;
  2516. });
  2517. /**
  2518. * Watchers.
  2519. *
  2520. * Watchers hashes should not overwrite one
  2521. * another, so we merge them as arrays.
  2522. */
  2523. strats.watch = function (
  2524. parentVal,
  2525. childVal,
  2526. vm,
  2527. key
  2528. ) {
  2529. // work around Firefox's Object.prototype.watch...
  2530. if (parentVal === nativeWatch) { parentVal = undefined; }
  2531. if (childVal === nativeWatch) { childVal = undefined; }
  2532. /* istanbul ignore if */
  2533. if (!childVal) { return Object.create(parentVal || null) }
  2534. if (true) {
  2535. assertObjectType(key, childVal, vm);
  2536. }
  2537. if (!parentVal) { return childVal }
  2538. var ret = {};
  2539. extend(ret, parentVal);
  2540. for (var key$1 in childVal) {
  2541. var parent = ret[key$1];
  2542. var child = childVal[key$1];
  2543. if (parent && !Array.isArray(parent)) {
  2544. parent = [parent];
  2545. }
  2546. ret[key$1] = parent
  2547. ? parent.concat(child)
  2548. : Array.isArray(child) ? child : [child];
  2549. }
  2550. return ret
  2551. };
  2552. /**
  2553. * Other object hashes.
  2554. */
  2555. strats.props =
  2556. strats.methods =
  2557. strats.inject =
  2558. strats.computed = function (
  2559. parentVal,
  2560. childVal,
  2561. vm,
  2562. key
  2563. ) {
  2564. if (childVal && "development" !== 'production') {
  2565. assertObjectType(key, childVal, vm);
  2566. }
  2567. if (!parentVal) { return childVal }
  2568. var ret = Object.create(null);
  2569. extend(ret, parentVal);
  2570. if (childVal) { extend(ret, childVal); }
  2571. return ret
  2572. };
  2573. strats.provide = mergeDataOrFn;
  2574. /**
  2575. * Default strategy.
  2576. */
  2577. var defaultStrat = function (parentVal, childVal) {
  2578. return childVal === undefined
  2579. ? parentVal
  2580. : childVal
  2581. };
  2582. /**
  2583. * Validate component names
  2584. */
  2585. function checkComponents (options) {
  2586. for (var key in options.components) {
  2587. validateComponentName(key);
  2588. }
  2589. }
  2590. function validateComponentName (name) {
  2591. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  2592. warn(
  2593. 'Invalid component name: "' + name + '". Component names ' +
  2594. 'should conform to valid custom element name in html5 specification.'
  2595. );
  2596. }
  2597. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  2598. warn(
  2599. 'Do not use built-in or reserved HTML elements as component ' +
  2600. 'id: ' + name
  2601. );
  2602. }
  2603. }
  2604. /**
  2605. * Ensure all props option syntax are normalized into the
  2606. * Object-based format.
  2607. */
  2608. function normalizeProps (options, vm) {
  2609. var props = options.props;
  2610. if (!props) { return }
  2611. var res = {};
  2612. var i, val, name;
  2613. if (Array.isArray(props)) {
  2614. i = props.length;
  2615. while (i--) {
  2616. val = props[i];
  2617. if (typeof val === 'string') {
  2618. name = camelize(val);
  2619. res[name] = { type: null };
  2620. } else if (true) {
  2621. warn('props must be strings when using array syntax.');
  2622. }
  2623. }
  2624. } else if (isPlainObject(props)) {
  2625. for (var key in props) {
  2626. val = props[key];
  2627. name = camelize(key);
  2628. res[name] = isPlainObject(val)
  2629. ? val
  2630. : { type: val };
  2631. }
  2632. } else if (true) {
  2633. warn(
  2634. "Invalid value for option \"props\": expected an Array or an Object, " +
  2635. "but got " + (toRawType(props)) + ".",
  2636. vm
  2637. );
  2638. }
  2639. options.props = res;
  2640. }
  2641. /**
  2642. * Normalize all injections into Object-based format
  2643. */
  2644. function normalizeInject (options, vm) {
  2645. var inject = options.inject;
  2646. if (!inject) { return }
  2647. var normalized = options.inject = {};
  2648. if (Array.isArray(inject)) {
  2649. for (var i = 0; i < inject.length; i++) {
  2650. normalized[inject[i]] = { from: inject[i] };
  2651. }
  2652. } else if (isPlainObject(inject)) {
  2653. for (var key in inject) {
  2654. var val = inject[key];
  2655. normalized[key] = isPlainObject(val)
  2656. ? extend({ from: key }, val)
  2657. : { from: val };
  2658. }
  2659. } else if (true) {
  2660. warn(
  2661. "Invalid value for option \"inject\": expected an Array or an Object, " +
  2662. "but got " + (toRawType(inject)) + ".",
  2663. vm
  2664. );
  2665. }
  2666. }
  2667. /**
  2668. * Normalize raw function directives into object format.
  2669. */
  2670. function normalizeDirectives (options) {
  2671. var dirs = options.directives;
  2672. if (dirs) {
  2673. for (var key in dirs) {
  2674. var def$$1 = dirs[key];
  2675. if (typeof def$$1 === 'function') {
  2676. dirs[key] = { bind: def$$1, update: def$$1 };
  2677. }
  2678. }
  2679. }
  2680. }
  2681. function assertObjectType (name, value, vm) {
  2682. if (!isPlainObject(value)) {
  2683. warn(
  2684. "Invalid value for option \"" + name + "\": expected an Object, " +
  2685. "but got " + (toRawType(value)) + ".",
  2686. vm
  2687. );
  2688. }
  2689. }
  2690. /**
  2691. * Merge two option objects into a new one.
  2692. * Core utility used in both instantiation and inheritance.
  2693. */
  2694. function mergeOptions (
  2695. parent,
  2696. child,
  2697. vm
  2698. ) {
  2699. if (true) {
  2700. checkComponents(child);
  2701. }
  2702. if (typeof child === 'function') {
  2703. child = child.options;
  2704. }
  2705. normalizeProps(child, vm);
  2706. normalizeInject(child, vm);
  2707. normalizeDirectives(child);
  2708. // Apply extends and mixins on the child options,
  2709. // but only if it is a raw options object that isn't
  2710. // the result of another mergeOptions call.
  2711. // Only merged options has the _base property.
  2712. if (!child._base) {
  2713. if (child.extends) {
  2714. parent = mergeOptions(parent, child.extends, vm);
  2715. }
  2716. if (child.mixins) {
  2717. for (var i = 0, l = child.mixins.length; i < l; i++) {
  2718. parent = mergeOptions(parent, child.mixins[i], vm);
  2719. }
  2720. }
  2721. }
  2722. var options = {};
  2723. var key;
  2724. for (key in parent) {
  2725. mergeField(key);
  2726. }
  2727. for (key in child) {
  2728. if (!hasOwn(parent, key)) {
  2729. mergeField(key);
  2730. }
  2731. }
  2732. function mergeField (key) {
  2733. var strat = strats[key] || defaultStrat;
  2734. options[key] = strat(parent[key], child[key], vm, key);
  2735. }
  2736. return options
  2737. }
  2738. /**
  2739. * Resolve an asset.
  2740. * This function is used because child instances need access
  2741. * to assets defined in its ancestor chain.
  2742. */
  2743. function resolveAsset (
  2744. options,
  2745. type,
  2746. id,
  2747. warnMissing
  2748. ) {
  2749. /* istanbul ignore if */
  2750. if (typeof id !== 'string') {
  2751. return
  2752. }
  2753. var assets = options[type];
  2754. // check local registration variations first
  2755. if (hasOwn(assets, id)) { return assets[id] }
  2756. var camelizedId = camelize(id);
  2757. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  2758. var PascalCaseId = capitalize(camelizedId);
  2759. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  2760. // fallback to prototype chain
  2761. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  2762. if ( true && warnMissing && !res) {
  2763. warn(
  2764. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  2765. options
  2766. );
  2767. }
  2768. return res
  2769. }
  2770. /* */
  2771. function validateProp (
  2772. key,
  2773. propOptions,
  2774. propsData,
  2775. vm
  2776. ) {
  2777. var prop = propOptions[key];
  2778. var absent = !hasOwn(propsData, key);
  2779. var value = propsData[key];
  2780. // boolean casting
  2781. var booleanIndex = getTypeIndex(Boolean, prop.type);
  2782. if (booleanIndex > -1) {
  2783. if (absent && !hasOwn(prop, 'default')) {
  2784. value = false;
  2785. } else if (value === '' || value === hyphenate(key)) {
  2786. // only cast empty string / same name to boolean if
  2787. // boolean has higher priority
  2788. var stringIndex = getTypeIndex(String, prop.type);
  2789. if (stringIndex < 0 || booleanIndex < stringIndex) {
  2790. value = true;
  2791. }
  2792. }
  2793. }
  2794. // check default value
  2795. if (value === undefined) {
  2796. value = getPropDefaultValue(vm, prop, key);
  2797. // since the default value is a fresh copy,
  2798. // make sure to observe it.
  2799. var prevShouldObserve = shouldObserve;
  2800. toggleObserving(true);
  2801. observe(value);
  2802. toggleObserving(prevShouldObserve);
  2803. }
  2804. if (
  2805. true
  2806. ) {
  2807. assertProp(prop, key, value, vm, absent);
  2808. }
  2809. return value
  2810. }
  2811. /**
  2812. * Get the default value of a prop.
  2813. */
  2814. function getPropDefaultValue (vm, prop, key) {
  2815. // no default, return undefined
  2816. if (!hasOwn(prop, 'default')) {
  2817. return undefined
  2818. }
  2819. var def = prop.default;
  2820. // warn against non-factory defaults for Object & Array
  2821. if ( true && isObject(def)) {
  2822. warn(
  2823. 'Invalid default value for prop "' + key + '": ' +
  2824. 'Props with type Object/Array must use a factory function ' +
  2825. 'to return the default value.',
  2826. vm
  2827. );
  2828. }
  2829. // the raw prop value was also undefined from previous render,
  2830. // return previous default value to avoid unnecessary watcher trigger
  2831. if (vm && vm.$options.propsData &&
  2832. vm.$options.propsData[key] === undefined &&
  2833. vm._props[key] !== undefined
  2834. ) {
  2835. return vm._props[key]
  2836. }
  2837. // call factory function for non-Function types
  2838. // a value is Function if its prototype is function even across different execution context
  2839. return typeof def === 'function' && getType(prop.type) !== 'Function'
  2840. ? def.call(vm)
  2841. : def
  2842. }
  2843. /**
  2844. * Assert whether a prop is valid.
  2845. */
  2846. function assertProp (
  2847. prop,
  2848. name,
  2849. value,
  2850. vm,
  2851. absent
  2852. ) {
  2853. if (prop.required && absent) {
  2854. warn(
  2855. 'Missing required prop: "' + name + '"',
  2856. vm
  2857. );
  2858. return
  2859. }
  2860. if (value == null && !prop.required) {
  2861. return
  2862. }
  2863. var type = prop.type;
  2864. var valid = !type || type === true;
  2865. var expectedTypes = [];
  2866. if (type) {
  2867. if (!Array.isArray(type)) {
  2868. type = [type];
  2869. }
  2870. for (var i = 0; i < type.length && !valid; i++) {
  2871. var assertedType = assertType(value, type[i]);
  2872. expectedTypes.push(assertedType.expectedType || '');
  2873. valid = assertedType.valid;
  2874. }
  2875. }
  2876. if (!valid) {
  2877. warn(
  2878. getInvalidTypeMessage(name, value, expectedTypes),
  2879. vm
  2880. );
  2881. return
  2882. }
  2883. var validator = prop.validator;
  2884. if (validator) {
  2885. if (!validator(value)) {
  2886. warn(
  2887. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  2888. vm
  2889. );
  2890. }
  2891. }
  2892. }
  2893. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  2894. function assertType (value, type) {
  2895. var valid;
  2896. var expectedType = getType(type);
  2897. if (simpleCheckRE.test(expectedType)) {
  2898. var t = typeof value;
  2899. valid = t === expectedType.toLowerCase();
  2900. // for primitive wrapper objects
  2901. if (!valid && t === 'object') {
  2902. valid = value instanceof type;
  2903. }
  2904. } else if (expectedType === 'Object') {
  2905. valid = isPlainObject(value);
  2906. } else if (expectedType === 'Array') {
  2907. valid = Array.isArray(value);
  2908. } else {
  2909. valid = value instanceof type;
  2910. }
  2911. return {
  2912. valid: valid,
  2913. expectedType: expectedType
  2914. }
  2915. }
  2916. /**
  2917. * Use function string name to check built-in types,
  2918. * because a simple equality check will fail when running
  2919. * across different vms / iframes.
  2920. */
  2921. function getType (fn) {
  2922. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  2923. return match ? match[1] : ''
  2924. }
  2925. function isSameType (a, b) {
  2926. return getType(a) === getType(b)
  2927. }
  2928. function getTypeIndex (type, expectedTypes) {
  2929. if (!Array.isArray(expectedTypes)) {
  2930. return isSameType(expectedTypes, type) ? 0 : -1
  2931. }
  2932. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  2933. if (isSameType(expectedTypes[i], type)) {
  2934. return i
  2935. }
  2936. }
  2937. return -1
  2938. }
  2939. function getInvalidTypeMessage (name, value, expectedTypes) {
  2940. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  2941. " Expected " + (expectedTypes.map(capitalize).join(', '));
  2942. var expectedType = expectedTypes[0];
  2943. var receivedType = toRawType(value);
  2944. var expectedValue = styleValue(value, expectedType);
  2945. var receivedValue = styleValue(value, receivedType);
  2946. // check if we need to specify expected value
  2947. if (expectedTypes.length === 1 &&
  2948. isExplicable(expectedType) &&
  2949. !isBoolean(expectedType, receivedType)) {
  2950. message += " with value " + expectedValue;
  2951. }
  2952. message += ", got " + receivedType + " ";
  2953. // check if we need to specify received value
  2954. if (isExplicable(receivedType)) {
  2955. message += "with value " + receivedValue + ".";
  2956. }
  2957. return message
  2958. }
  2959. function styleValue (value, type) {
  2960. if (type === 'String') {
  2961. return ("\"" + value + "\"")
  2962. } else if (type === 'Number') {
  2963. return ("" + (Number(value)))
  2964. } else {
  2965. return ("" + value)
  2966. }
  2967. }
  2968. function isExplicable (value) {
  2969. var explicitTypes = ['string', 'number', 'boolean'];
  2970. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  2971. }
  2972. function isBoolean () {
  2973. var args = [], len = arguments.length;
  2974. while ( len-- ) args[ len ] = arguments[ len ];
  2975. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  2976. }
  2977. /* */
  2978. function handleError (err, vm, info) {
  2979. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  2980. // See: https://github.com/vuejs/vuex/issues/1505
  2981. pushTarget();
  2982. try {
  2983. if (vm) {
  2984. var cur = vm;
  2985. while ((cur = cur.$parent)) {
  2986. var hooks = cur.$options.errorCaptured;
  2987. if (hooks) {
  2988. for (var i = 0; i < hooks.length; i++) {
  2989. try {
  2990. var capture = hooks[i].call(cur, err, vm, info) === false;
  2991. if (capture) { return }
  2992. } catch (e) {
  2993. globalHandleError(e, cur, 'errorCaptured hook');
  2994. }
  2995. }
  2996. }
  2997. }
  2998. }
  2999. globalHandleError(err, vm, info);
  3000. } finally {
  3001. popTarget();
  3002. }
  3003. }
  3004. function invokeWithErrorHandling (
  3005. handler,
  3006. context,
  3007. args,
  3008. vm,
  3009. info
  3010. ) {
  3011. var res;
  3012. try {
  3013. res = args ? handler.apply(context, args) : handler.call(context);
  3014. if (res && !res._isVue && isPromise(res) && !res._handled) {
  3015. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  3016. // issue #9511
  3017. // avoid catch triggering multiple times when nested calls
  3018. res._handled = true;
  3019. }
  3020. } catch (e) {
  3021. handleError(e, vm, info);
  3022. }
  3023. return res
  3024. }
  3025. function globalHandleError (err, vm, info) {
  3026. if (config.errorHandler) {
  3027. try {
  3028. return config.errorHandler.call(null, err, vm, info)
  3029. } catch (e) {
  3030. // if the user intentionally throws the original error in the handler,
  3031. // do not log it twice
  3032. if (e !== err) {
  3033. logError(e, null, 'config.errorHandler');
  3034. }
  3035. }
  3036. }
  3037. logError(err, vm, info);
  3038. }
  3039. function logError (err, vm, info) {
  3040. if (true) {
  3041. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  3042. }
  3043. /* istanbul ignore else */
  3044. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  3045. console.error(err);
  3046. } else {
  3047. throw err
  3048. }
  3049. }
  3050. /* */
  3051. var callbacks = [];
  3052. var pending = false;
  3053. function flushCallbacks () {
  3054. pending = false;
  3055. var copies = callbacks.slice(0);
  3056. callbacks.length = 0;
  3057. for (var i = 0; i < copies.length; i++) {
  3058. copies[i]();
  3059. }
  3060. }
  3061. // Here we have async deferring wrappers using microtasks.
  3062. // In 2.5 we used (macro) tasks (in combination with microtasks).
  3063. // However, it has subtle problems when state is changed right before repaint
  3064. // (e.g. #6813, out-in transitions).
  3065. // Also, using (macro) tasks in event handler would cause some weird behaviors
  3066. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  3067. // So we now use microtasks everywhere, again.
  3068. // A major drawback of this tradeoff is that there are some scenarios
  3069. // where microtasks have too high a priority and fire in between supposedly
  3070. // sequential events (e.g. #4521, #6690, which have workarounds)
  3071. // or even between bubbling of the same event (#6566).
  3072. var timerFunc;
  3073. // The nextTick behavior leverages the microtask queue, which can be accessed
  3074. // via either native Promise.then or MutationObserver.
  3075. // MutationObserver has wider support, however it is seriously bugged in
  3076. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  3077. // completely stops working after triggering a few times... so, if native
  3078. // Promise is available, we will use it:
  3079. /* istanbul ignore next, $flow-disable-line */
  3080. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  3081. var p = Promise.resolve();
  3082. timerFunc = function () {
  3083. p.then(flushCallbacks);
  3084. // In problematic UIWebViews, Promise.then doesn't completely break, but
  3085. // it can get stuck in a weird state where callbacks are pushed into the
  3086. // microtask queue but the queue isn't being flushed, until the browser
  3087. // needs to do some other work, e.g. handle a timer. Therefore we can
  3088. // "force" the microtask queue to be flushed by adding an empty timer.
  3089. if (isIOS) { setTimeout(noop); }
  3090. };
  3091. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  3092. isNative(MutationObserver) ||
  3093. // PhantomJS and iOS 7.x
  3094. MutationObserver.toString() === '[object MutationObserverConstructor]'
  3095. )) {
  3096. // Use MutationObserver where native Promise is not available,
  3097. // e.g. PhantomJS, iOS7, Android 4.4
  3098. // (#6466 MutationObserver is unreliable in IE11)
  3099. var counter = 1;
  3100. var observer = new MutationObserver(flushCallbacks);
  3101. var textNode = document.createTextNode(String(counter));
  3102. observer.observe(textNode, {
  3103. characterData: true
  3104. });
  3105. timerFunc = function () {
  3106. counter = (counter + 1) % 2;
  3107. textNode.data = String(counter);
  3108. };
  3109. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  3110. // Fallback to setImmediate.
  3111. // Technically it leverages the (macro) task queue,
  3112. // but it is still a better choice than setTimeout.
  3113. timerFunc = function () {
  3114. setImmediate(flushCallbacks);
  3115. };
  3116. } else {
  3117. // Fallback to setTimeout.
  3118. timerFunc = function () {
  3119. setTimeout(flushCallbacks, 0);
  3120. };
  3121. }
  3122. function nextTick (cb, ctx) {
  3123. var _resolve;
  3124. callbacks.push(function () {
  3125. if (cb) {
  3126. try {
  3127. cb.call(ctx);
  3128. } catch (e) {
  3129. handleError(e, ctx, 'nextTick');
  3130. }
  3131. } else if (_resolve) {
  3132. _resolve(ctx);
  3133. }
  3134. });
  3135. if (!pending) {
  3136. pending = true;
  3137. timerFunc();
  3138. }
  3139. // $flow-disable-line
  3140. if (!cb && typeof Promise !== 'undefined') {
  3141. return new Promise(function (resolve) {
  3142. _resolve = resolve;
  3143. })
  3144. }
  3145. }
  3146. /* */
  3147. /* not type checking this file because flow doesn't play well with Proxy */
  3148. var initProxy;
  3149. if (true) {
  3150. var allowedGlobals = makeMap(
  3151. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  3152. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  3153. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  3154. 'require' // for Webpack/Browserify
  3155. );
  3156. var warnNonPresent = function (target, key) {
  3157. warn(
  3158. "Property or method \"" + key + "\" is not defined on the instance but " +
  3159. 'referenced during render. Make sure that this property is reactive, ' +
  3160. 'either in the data option, or for class-based components, by ' +
  3161. 'initializing the property. ' +
  3162. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  3163. target
  3164. );
  3165. };
  3166. var warnReservedPrefix = function (target, key) {
  3167. warn(
  3168. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  3169. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  3170. 'prevent conflicts with Vue internals. ' +
  3171. 'See: https://vuejs.org/v2/api/#data',
  3172. target
  3173. );
  3174. };
  3175. var hasProxy =
  3176. typeof Proxy !== 'undefined' && isNative(Proxy);
  3177. if (hasProxy) {
  3178. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  3179. config.keyCodes = new Proxy(config.keyCodes, {
  3180. set: function set (target, key, value) {
  3181. if (isBuiltInModifier(key)) {
  3182. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  3183. return false
  3184. } else {
  3185. target[key] = value;
  3186. return true
  3187. }
  3188. }
  3189. });
  3190. }
  3191. var hasHandler = {
  3192. has: function has (target, key) {
  3193. var has = key in target;
  3194. var isAllowed = allowedGlobals(key) ||
  3195. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  3196. if (!has && !isAllowed) {
  3197. if (key in target.$data) { warnReservedPrefix(target, key); }
  3198. else { warnNonPresent(target, key); }
  3199. }
  3200. return has || !isAllowed
  3201. }
  3202. };
  3203. var getHandler = {
  3204. get: function get (target, key) {
  3205. if (typeof key === 'string' && !(key in target)) {
  3206. if (key in target.$data) { warnReservedPrefix(target, key); }
  3207. else { warnNonPresent(target, key); }
  3208. }
  3209. return target[key]
  3210. }
  3211. };
  3212. initProxy = function initProxy (vm) {
  3213. if (hasProxy) {
  3214. // determine which proxy handler to use
  3215. var options = vm.$options;
  3216. var handlers = options.render && options.render._withStripped
  3217. ? getHandler
  3218. : hasHandler;
  3219. vm._renderProxy = new Proxy(vm, handlers);
  3220. } else {
  3221. vm._renderProxy = vm;
  3222. }
  3223. };
  3224. }
  3225. /* */
  3226. var seenObjects = new _Set();
  3227. /**
  3228. * Recursively traverse an object to evoke all converted
  3229. * getters, so that every nested property inside the object
  3230. * is collected as a "deep" dependency.
  3231. */
  3232. function traverse (val) {
  3233. _traverse(val, seenObjects);
  3234. seenObjects.clear();
  3235. }
  3236. function _traverse (val, seen) {
  3237. var i, keys;
  3238. var isA = Array.isArray(val);
  3239. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  3240. return
  3241. }
  3242. if (val.__ob__) {
  3243. var depId = val.__ob__.dep.id;
  3244. if (seen.has(depId)) {
  3245. return
  3246. }
  3247. seen.add(depId);
  3248. }
  3249. if (isA) {
  3250. i = val.length;
  3251. while (i--) { _traverse(val[i], seen); }
  3252. } else {
  3253. keys = Object.keys(val);
  3254. i = keys.length;
  3255. while (i--) { _traverse(val[keys[i]], seen); }
  3256. }
  3257. }
  3258. var mark;
  3259. var measure;
  3260. if (true) {
  3261. var perf = inBrowser && window.performance;
  3262. /* istanbul ignore if */
  3263. if (
  3264. perf &&
  3265. perf.mark &&
  3266. perf.measure &&
  3267. perf.clearMarks &&
  3268. perf.clearMeasures
  3269. ) {
  3270. mark = function (tag) { return perf.mark(tag); };
  3271. measure = function (name, startTag, endTag) {
  3272. perf.measure(name, startTag, endTag);
  3273. perf.clearMarks(startTag);
  3274. perf.clearMarks(endTag);
  3275. // perf.clearMeasures(name)
  3276. };
  3277. }
  3278. }
  3279. /* */
  3280. var normalizeEvent = cached(function (name) {
  3281. var passive = name.charAt(0) === '&';
  3282. name = passive ? name.slice(1) : name;
  3283. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  3284. name = once$$1 ? name.slice(1) : name;
  3285. var capture = name.charAt(0) === '!';
  3286. name = capture ? name.slice(1) : name;
  3287. return {
  3288. name: name,
  3289. once: once$$1,
  3290. capture: capture,
  3291. passive: passive
  3292. }
  3293. });
  3294. function createFnInvoker (fns, vm) {
  3295. function invoker () {
  3296. var arguments$1 = arguments;
  3297. var fns = invoker.fns;
  3298. if (Array.isArray(fns)) {
  3299. var cloned = fns.slice();
  3300. for (var i = 0; i < cloned.length; i++) {
  3301. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  3302. }
  3303. } else {
  3304. // return handler return value for single handlers
  3305. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  3306. }
  3307. }
  3308. invoker.fns = fns;
  3309. return invoker
  3310. }
  3311. function updateListeners (
  3312. on,
  3313. oldOn,
  3314. add,
  3315. remove$$1,
  3316. createOnceHandler,
  3317. vm
  3318. ) {
  3319. var name, def$$1, cur, old, event;
  3320. for (name in on) {
  3321. def$$1 = cur = on[name];
  3322. old = oldOn[name];
  3323. event = normalizeEvent(name);
  3324. if (isUndef(cur)) {
  3325. true && warn(
  3326. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  3327. vm
  3328. );
  3329. } else if (isUndef(old)) {
  3330. if (isUndef(cur.fns)) {
  3331. cur = on[name] = createFnInvoker(cur, vm);
  3332. }
  3333. if (isTrue(event.once)) {
  3334. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  3335. }
  3336. add(event.name, cur, event.capture, event.passive, event.params);
  3337. } else if (cur !== old) {
  3338. old.fns = cur;
  3339. on[name] = old;
  3340. }
  3341. }
  3342. for (name in oldOn) {
  3343. if (isUndef(on[name])) {
  3344. event = normalizeEvent(name);
  3345. remove$$1(event.name, oldOn[name], event.capture);
  3346. }
  3347. }
  3348. }
  3349. /* */
  3350. /* */
  3351. // fixed by xxxxxx (mp properties)
  3352. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  3353. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  3354. if (isUndef(propOptions)) {
  3355. return res
  3356. }
  3357. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  3358. var attrs = data.attrs;
  3359. var props = data.props;
  3360. if (isDef(attrs) || isDef(props)) {
  3361. for (var key in propOptions) {
  3362. var altKey = hyphenate(key);
  3363. var result = checkProp(res, props, key, altKey, true) ||
  3364. checkProp(res, attrs, key, altKey, false);
  3365. // externalClass
  3366. if (
  3367. result &&
  3368. res[key] &&
  3369. externalClasses.indexOf(altKey) !== -1 &&
  3370. context[camelize(res[key])]
  3371. ) {
  3372. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  3373. res[key] = context[camelize(res[key])];
  3374. }
  3375. }
  3376. }
  3377. return res
  3378. }
  3379. function extractPropsFromVNodeData (
  3380. data,
  3381. Ctor,
  3382. tag,
  3383. context// fixed by xxxxxx
  3384. ) {
  3385. // we are only extracting raw values here.
  3386. // validation and default values are handled in the child
  3387. // component itself.
  3388. var propOptions = Ctor.options.props;
  3389. if (isUndef(propOptions)) {
  3390. // fixed by xxxxxx
  3391. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  3392. }
  3393. var res = {};
  3394. var attrs = data.attrs;
  3395. var props = data.props;
  3396. if (isDef(attrs) || isDef(props)) {
  3397. for (var key in propOptions) {
  3398. var altKey = hyphenate(key);
  3399. if (true) {
  3400. var keyInLowerCase = key.toLowerCase();
  3401. if (
  3402. key !== keyInLowerCase &&
  3403. attrs && hasOwn(attrs, keyInLowerCase)
  3404. ) {
  3405. tip(
  3406. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  3407. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  3408. " \"" + key + "\". " +
  3409. "Note that HTML attributes are case-insensitive and camelCased " +
  3410. "props need to use their kebab-case equivalents when using in-DOM " +
  3411. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  3412. );
  3413. }
  3414. }
  3415. checkProp(res, props, key, altKey, true) ||
  3416. checkProp(res, attrs, key, altKey, false);
  3417. }
  3418. }
  3419. // fixed by xxxxxx
  3420. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  3421. }
  3422. function checkProp (
  3423. res,
  3424. hash,
  3425. key,
  3426. altKey,
  3427. preserve
  3428. ) {
  3429. if (isDef(hash)) {
  3430. if (hasOwn(hash, key)) {
  3431. res[key] = hash[key];
  3432. if (!preserve) {
  3433. delete hash[key];
  3434. }
  3435. return true
  3436. } else if (hasOwn(hash, altKey)) {
  3437. res[key] = hash[altKey];
  3438. if (!preserve) {
  3439. delete hash[altKey];
  3440. }
  3441. return true
  3442. }
  3443. }
  3444. return false
  3445. }
  3446. /* */
  3447. // The template compiler attempts to minimize the need for normalization by
  3448. // statically analyzing the template at compile time.
  3449. //
  3450. // For plain HTML markup, normalization can be completely skipped because the
  3451. // generated render function is guaranteed to return Array<VNode>. There are
  3452. // two cases where extra normalization is needed:
  3453. // 1. When the children contains components - because a functional component
  3454. // may return an Array instead of a single root. In this case, just a simple
  3455. // normalization is needed - if any child is an Array, we flatten the whole
  3456. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  3457. // because functional components already normalize their own children.
  3458. function simpleNormalizeChildren (children) {
  3459. for (var i = 0; i < children.length; i++) {
  3460. if (Array.isArray(children[i])) {
  3461. return Array.prototype.concat.apply([], children)
  3462. }
  3463. }
  3464. return children
  3465. }
  3466. // 2. When the children contains constructs that always generated nested Arrays,
  3467. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  3468. // with hand-written render functions / JSX. In such cases a full normalization
  3469. // is needed to cater to all possible types of children values.
  3470. function normalizeChildren (children) {
  3471. return isPrimitive(children)
  3472. ? [createTextVNode(children)]
  3473. : Array.isArray(children)
  3474. ? normalizeArrayChildren(children)
  3475. : undefined
  3476. }
  3477. function isTextNode (node) {
  3478. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  3479. }
  3480. function normalizeArrayChildren (children, nestedIndex) {
  3481. var res = [];
  3482. var i, c, lastIndex, last;
  3483. for (i = 0; i < children.length; i++) {
  3484. c = children[i];
  3485. if (isUndef(c) || typeof c === 'boolean') { continue }
  3486. lastIndex = res.length - 1;
  3487. last = res[lastIndex];
  3488. // nested
  3489. if (Array.isArray(c)) {
  3490. if (c.length > 0) {
  3491. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  3492. // merge adjacent text nodes
  3493. if (isTextNode(c[0]) && isTextNode(last)) {
  3494. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  3495. c.shift();
  3496. }
  3497. res.push.apply(res, c);
  3498. }
  3499. } else if (isPrimitive(c)) {
  3500. if (isTextNode(last)) {
  3501. // merge adjacent text nodes
  3502. // this is necessary for SSR hydration because text nodes are
  3503. // essentially merged when rendered to HTML strings
  3504. res[lastIndex] = createTextVNode(last.text + c);
  3505. } else if (c !== '') {
  3506. // convert primitive to vnode
  3507. res.push(createTextVNode(c));
  3508. }
  3509. } else {
  3510. if (isTextNode(c) && isTextNode(last)) {
  3511. // merge adjacent text nodes
  3512. res[lastIndex] = createTextVNode(last.text + c.text);
  3513. } else {
  3514. // default key for nested array children (likely generated by v-for)
  3515. if (isTrue(children._isVList) &&
  3516. isDef(c.tag) &&
  3517. isUndef(c.key) &&
  3518. isDef(nestedIndex)) {
  3519. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  3520. }
  3521. res.push(c);
  3522. }
  3523. }
  3524. }
  3525. return res
  3526. }
  3527. /* */
  3528. function initProvide (vm) {
  3529. var provide = vm.$options.provide;
  3530. if (provide) {
  3531. vm._provided = typeof provide === 'function'
  3532. ? provide.call(vm)
  3533. : provide;
  3534. }
  3535. }
  3536. function initInjections (vm) {
  3537. var result = resolveInject(vm.$options.inject, vm);
  3538. if (result) {
  3539. toggleObserving(false);
  3540. Object.keys(result).forEach(function (key) {
  3541. /* istanbul ignore else */
  3542. if (true) {
  3543. defineReactive$$1(vm, key, result[key], function () {
  3544. warn(
  3545. "Avoid mutating an injected value directly since the changes will be " +
  3546. "overwritten whenever the provided component re-renders. " +
  3547. "injection being mutated: \"" + key + "\"",
  3548. vm
  3549. );
  3550. });
  3551. } else {}
  3552. });
  3553. toggleObserving(true);
  3554. }
  3555. }
  3556. function resolveInject (inject, vm) {
  3557. if (inject) {
  3558. // inject is :any because flow is not smart enough to figure out cached
  3559. var result = Object.create(null);
  3560. var keys = hasSymbol
  3561. ? Reflect.ownKeys(inject)
  3562. : Object.keys(inject);
  3563. for (var i = 0; i < keys.length; i++) {
  3564. var key = keys[i];
  3565. // #6574 in case the inject object is observed...
  3566. if (key === '__ob__') { continue }
  3567. var provideKey = inject[key].from;
  3568. var source = vm;
  3569. while (source) {
  3570. if (source._provided && hasOwn(source._provided, provideKey)) {
  3571. result[key] = source._provided[provideKey];
  3572. break
  3573. }
  3574. source = source.$parent;
  3575. }
  3576. if (!source) {
  3577. if ('default' in inject[key]) {
  3578. var provideDefault = inject[key].default;
  3579. result[key] = typeof provideDefault === 'function'
  3580. ? provideDefault.call(vm)
  3581. : provideDefault;
  3582. } else if (true) {
  3583. warn(("Injection \"" + key + "\" not found"), vm);
  3584. }
  3585. }
  3586. }
  3587. return result
  3588. }
  3589. }
  3590. /* */
  3591. /**
  3592. * Runtime helper for resolving raw children VNodes into a slot object.
  3593. */
  3594. function resolveSlots (
  3595. children,
  3596. context
  3597. ) {
  3598. if (!children || !children.length) {
  3599. return {}
  3600. }
  3601. var slots = {};
  3602. for (var i = 0, l = children.length; i < l; i++) {
  3603. var child = children[i];
  3604. var data = child.data;
  3605. // remove slot attribute if the node is resolved as a Vue slot node
  3606. if (data && data.attrs && data.attrs.slot) {
  3607. delete data.attrs.slot;
  3608. }
  3609. // named slots should only be respected if the vnode was rendered in the
  3610. // same context.
  3611. if ((child.context === context || child.fnContext === context) &&
  3612. data && data.slot != null
  3613. ) {
  3614. var name = data.slot;
  3615. var slot = (slots[name] || (slots[name] = []));
  3616. if (child.tag === 'template') {
  3617. slot.push.apply(slot, child.children || []);
  3618. } else {
  3619. slot.push(child);
  3620. }
  3621. } else {
  3622. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  3623. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  3624. (slots['page'] || (slots['page'] = [])).push(child);
  3625. }else{
  3626. (slots.default || (slots.default = [])).push(child);
  3627. }
  3628. }
  3629. }
  3630. // ignore slots that contains only whitespace
  3631. for (var name$1 in slots) {
  3632. if (slots[name$1].every(isWhitespace)) {
  3633. delete slots[name$1];
  3634. }
  3635. }
  3636. return slots
  3637. }
  3638. function isWhitespace (node) {
  3639. return (node.isComment && !node.asyncFactory) || node.text === ' '
  3640. }
  3641. /* */
  3642. function normalizeScopedSlots (
  3643. slots,
  3644. normalSlots,
  3645. prevSlots
  3646. ) {
  3647. var res;
  3648. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  3649. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  3650. var key = slots && slots.$key;
  3651. if (!slots) {
  3652. res = {};
  3653. } else if (slots._normalized) {
  3654. // fast path 1: child component re-render only, parent did not change
  3655. return slots._normalized
  3656. } else if (
  3657. isStable &&
  3658. prevSlots &&
  3659. prevSlots !== emptyObject &&
  3660. key === prevSlots.$key &&
  3661. !hasNormalSlots &&
  3662. !prevSlots.$hasNormal
  3663. ) {
  3664. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  3665. // only need to normalize once
  3666. return prevSlots
  3667. } else {
  3668. res = {};
  3669. for (var key$1 in slots) {
  3670. if (slots[key$1] && key$1[0] !== '$') {
  3671. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  3672. }
  3673. }
  3674. }
  3675. // expose normal slots on scopedSlots
  3676. for (var key$2 in normalSlots) {
  3677. if (!(key$2 in res)) {
  3678. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  3679. }
  3680. }
  3681. // avoriaz seems to mock a non-extensible $scopedSlots object
  3682. // and when that is passed down this would cause an error
  3683. if (slots && Object.isExtensible(slots)) {
  3684. (slots)._normalized = res;
  3685. }
  3686. def(res, '$stable', isStable);
  3687. def(res, '$key', key);
  3688. def(res, '$hasNormal', hasNormalSlots);
  3689. return res
  3690. }
  3691. function normalizeScopedSlot(normalSlots, key, fn) {
  3692. var normalized = function () {
  3693. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  3694. res = res && typeof res === 'object' && !Array.isArray(res)
  3695. ? [res] // single vnode
  3696. : normalizeChildren(res);
  3697. return res && (
  3698. res.length === 0 ||
  3699. (res.length === 1 && res[0].isComment) // #9658
  3700. ) ? undefined
  3701. : res
  3702. };
  3703. // this is a slot using the new v-slot syntax without scope. although it is
  3704. // compiled as a scoped slot, render fn users would expect it to be present
  3705. // on this.$slots because the usage is semantically a normal slot.
  3706. if (fn.proxy) {
  3707. Object.defineProperty(normalSlots, key, {
  3708. get: normalized,
  3709. enumerable: true,
  3710. configurable: true
  3711. });
  3712. }
  3713. return normalized
  3714. }
  3715. function proxyNormalSlot(slots, key) {
  3716. return function () { return slots[key]; }
  3717. }
  3718. /* */
  3719. /**
  3720. * Runtime helper for rendering v-for lists.
  3721. */
  3722. function renderList (
  3723. val,
  3724. render
  3725. ) {
  3726. var ret, i, l, keys, key;
  3727. if (Array.isArray(val) || typeof val === 'string') {
  3728. ret = new Array(val.length);
  3729. for (i = 0, l = val.length; i < l; i++) {
  3730. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  3731. }
  3732. } else if (typeof val === 'number') {
  3733. ret = new Array(val);
  3734. for (i = 0; i < val; i++) {
  3735. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  3736. }
  3737. } else if (isObject(val)) {
  3738. if (hasSymbol && val[Symbol.iterator]) {
  3739. ret = [];
  3740. var iterator = val[Symbol.iterator]();
  3741. var result = iterator.next();
  3742. while (!result.done) {
  3743. ret.push(render(result.value, ret.length, i++, i)); // fixed by xxxxxx
  3744. result = iterator.next();
  3745. }
  3746. } else {
  3747. keys = Object.keys(val);
  3748. ret = new Array(keys.length);
  3749. for (i = 0, l = keys.length; i < l; i++) {
  3750. key = keys[i];
  3751. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  3752. }
  3753. }
  3754. }
  3755. if (!isDef(ret)) {
  3756. ret = [];
  3757. }
  3758. (ret)._isVList = true;
  3759. return ret
  3760. }
  3761. /* */
  3762. /**
  3763. * Runtime helper for rendering <slot>
  3764. */
  3765. function renderSlot (
  3766. name,
  3767. fallback,
  3768. props,
  3769. bindObject
  3770. ) {
  3771. var scopedSlotFn = this.$scopedSlots[name];
  3772. var nodes;
  3773. if (scopedSlotFn) { // scoped slot
  3774. props = props || {};
  3775. if (bindObject) {
  3776. if ( true && !isObject(bindObject)) {
  3777. warn(
  3778. 'slot v-bind without argument expects an Object',
  3779. this
  3780. );
  3781. }
  3782. props = extend(extend({}, bindObject), props);
  3783. }
  3784. // fixed by xxxxxx app-plus scopedSlot
  3785. nodes = scopedSlotFn(props, this, props._i) || fallback;
  3786. } else {
  3787. nodes = this.$slots[name] || fallback;
  3788. }
  3789. var target = props && props.slot;
  3790. if (target) {
  3791. return this.$createElement('template', { slot: target }, nodes)
  3792. } else {
  3793. return nodes
  3794. }
  3795. }
  3796. /* */
  3797. /**
  3798. * Runtime helper for resolving filters
  3799. */
  3800. function resolveFilter (id) {
  3801. return resolveAsset(this.$options, 'filters', id, true) || identity
  3802. }
  3803. /* */
  3804. function isKeyNotMatch (expect, actual) {
  3805. if (Array.isArray(expect)) {
  3806. return expect.indexOf(actual) === -1
  3807. } else {
  3808. return expect !== actual
  3809. }
  3810. }
  3811. /**
  3812. * Runtime helper for checking keyCodes from config.
  3813. * exposed as Vue.prototype._k
  3814. * passing in eventKeyName as last argument separately for backwards compat
  3815. */
  3816. function checkKeyCodes (
  3817. eventKeyCode,
  3818. key,
  3819. builtInKeyCode,
  3820. eventKeyName,
  3821. builtInKeyName
  3822. ) {
  3823. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  3824. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  3825. return isKeyNotMatch(builtInKeyName, eventKeyName)
  3826. } else if (mappedKeyCode) {
  3827. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  3828. } else if (eventKeyName) {
  3829. return hyphenate(eventKeyName) !== key
  3830. }
  3831. }
  3832. /* */
  3833. /**
  3834. * Runtime helper for merging v-bind="object" into a VNode's data.
  3835. */
  3836. function bindObjectProps (
  3837. data,
  3838. tag,
  3839. value,
  3840. asProp,
  3841. isSync
  3842. ) {
  3843. if (value) {
  3844. if (!isObject(value)) {
  3845. true && warn(
  3846. 'v-bind without argument expects an Object or Array value',
  3847. this
  3848. );
  3849. } else {
  3850. if (Array.isArray(value)) {
  3851. value = toObject(value);
  3852. }
  3853. var hash;
  3854. var loop = function ( key ) {
  3855. if (
  3856. key === 'class' ||
  3857. key === 'style' ||
  3858. isReservedAttribute(key)
  3859. ) {
  3860. hash = data;
  3861. } else {
  3862. var type = data.attrs && data.attrs.type;
  3863. hash = asProp || config.mustUseProp(tag, type, key)
  3864. ? data.domProps || (data.domProps = {})
  3865. : data.attrs || (data.attrs = {});
  3866. }
  3867. var camelizedKey = camelize(key);
  3868. var hyphenatedKey = hyphenate(key);
  3869. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  3870. hash[key] = value[key];
  3871. if (isSync) {
  3872. var on = data.on || (data.on = {});
  3873. on[("update:" + key)] = function ($event) {
  3874. value[key] = $event;
  3875. };
  3876. }
  3877. }
  3878. };
  3879. for (var key in value) loop( key );
  3880. }
  3881. }
  3882. return data
  3883. }
  3884. /* */
  3885. /**
  3886. * Runtime helper for rendering static trees.
  3887. */
  3888. function renderStatic (
  3889. index,
  3890. isInFor
  3891. ) {
  3892. var cached = this._staticTrees || (this._staticTrees = []);
  3893. var tree = cached[index];
  3894. // if has already-rendered static tree and not inside v-for,
  3895. // we can reuse the same tree.
  3896. if (tree && !isInFor) {
  3897. return tree
  3898. }
  3899. // otherwise, render a fresh tree.
  3900. tree = cached[index] = this.$options.staticRenderFns[index].call(
  3901. this._renderProxy,
  3902. null,
  3903. this // for render fns generated for functional component templates
  3904. );
  3905. markStatic(tree, ("__static__" + index), false);
  3906. return tree
  3907. }
  3908. /**
  3909. * Runtime helper for v-once.
  3910. * Effectively it means marking the node as static with a unique key.
  3911. */
  3912. function markOnce (
  3913. tree,
  3914. index,
  3915. key
  3916. ) {
  3917. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  3918. return tree
  3919. }
  3920. function markStatic (
  3921. tree,
  3922. key,
  3923. isOnce
  3924. ) {
  3925. if (Array.isArray(tree)) {
  3926. for (var i = 0; i < tree.length; i++) {
  3927. if (tree[i] && typeof tree[i] !== 'string') {
  3928. markStaticNode(tree[i], (key + "_" + i), isOnce);
  3929. }
  3930. }
  3931. } else {
  3932. markStaticNode(tree, key, isOnce);
  3933. }
  3934. }
  3935. function markStaticNode (node, key, isOnce) {
  3936. node.isStatic = true;
  3937. node.key = key;
  3938. node.isOnce = isOnce;
  3939. }
  3940. /* */
  3941. function bindObjectListeners (data, value) {
  3942. if (value) {
  3943. if (!isPlainObject(value)) {
  3944. true && warn(
  3945. 'v-on without argument expects an Object value',
  3946. this
  3947. );
  3948. } else {
  3949. var on = data.on = data.on ? extend({}, data.on) : {};
  3950. for (var key in value) {
  3951. var existing = on[key];
  3952. var ours = value[key];
  3953. on[key] = existing ? [].concat(existing, ours) : ours;
  3954. }
  3955. }
  3956. }
  3957. return data
  3958. }
  3959. /* */
  3960. function resolveScopedSlots (
  3961. fns, // see flow/vnode
  3962. res,
  3963. // the following are added in 2.6
  3964. hasDynamicKeys,
  3965. contentHashKey
  3966. ) {
  3967. res = res || { $stable: !hasDynamicKeys };
  3968. for (var i = 0; i < fns.length; i++) {
  3969. var slot = fns[i];
  3970. if (Array.isArray(slot)) {
  3971. resolveScopedSlots(slot, res, hasDynamicKeys);
  3972. } else if (slot) {
  3973. // marker for reverse proxying v-slot without scope on this.$slots
  3974. if (slot.proxy) {
  3975. slot.fn.proxy = true;
  3976. }
  3977. res[slot.key] = slot.fn;
  3978. }
  3979. }
  3980. if (contentHashKey) {
  3981. (res).$key = contentHashKey;
  3982. }
  3983. return res
  3984. }
  3985. /* */
  3986. function bindDynamicKeys (baseObj, values) {
  3987. for (var i = 0; i < values.length; i += 2) {
  3988. var key = values[i];
  3989. if (typeof key === 'string' && key) {
  3990. baseObj[values[i]] = values[i + 1];
  3991. } else if ( true && key !== '' && key !== null) {
  3992. // null is a special value for explicitly removing a binding
  3993. warn(
  3994. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  3995. this
  3996. );
  3997. }
  3998. }
  3999. return baseObj
  4000. }
  4001. // helper to dynamically append modifier runtime markers to event names.
  4002. // ensure only append when value is already string, otherwise it will be cast
  4003. // to string and cause the type check to miss.
  4004. function prependModifier (value, symbol) {
  4005. return typeof value === 'string' ? symbol + value : value
  4006. }
  4007. /* */
  4008. function installRenderHelpers (target) {
  4009. target._o = markOnce;
  4010. target._n = toNumber;
  4011. target._s = toString;
  4012. target._l = renderList;
  4013. target._t = renderSlot;
  4014. target._q = looseEqual;
  4015. target._i = looseIndexOf;
  4016. target._m = renderStatic;
  4017. target._f = resolveFilter;
  4018. target._k = checkKeyCodes;
  4019. target._b = bindObjectProps;
  4020. target._v = createTextVNode;
  4021. target._e = createEmptyVNode;
  4022. target._u = resolveScopedSlots;
  4023. target._g = bindObjectListeners;
  4024. target._d = bindDynamicKeys;
  4025. target._p = prependModifier;
  4026. }
  4027. /* */
  4028. function FunctionalRenderContext (
  4029. data,
  4030. props,
  4031. children,
  4032. parent,
  4033. Ctor
  4034. ) {
  4035. var this$1 = this;
  4036. var options = Ctor.options;
  4037. // ensure the createElement function in functional components
  4038. // gets a unique context - this is necessary for correct named slot check
  4039. var contextVm;
  4040. if (hasOwn(parent, '_uid')) {
  4041. contextVm = Object.create(parent);
  4042. // $flow-disable-line
  4043. contextVm._original = parent;
  4044. } else {
  4045. // the context vm passed in is a functional context as well.
  4046. // in this case we want to make sure we are able to get a hold to the
  4047. // real context instance.
  4048. contextVm = parent;
  4049. // $flow-disable-line
  4050. parent = parent._original;
  4051. }
  4052. var isCompiled = isTrue(options._compiled);
  4053. var needNormalization = !isCompiled;
  4054. this.data = data;
  4055. this.props = props;
  4056. this.children = children;
  4057. this.parent = parent;
  4058. this.listeners = data.on || emptyObject;
  4059. this.injections = resolveInject(options.inject, parent);
  4060. this.slots = function () {
  4061. if (!this$1.$slots) {
  4062. normalizeScopedSlots(
  4063. data.scopedSlots,
  4064. this$1.$slots = resolveSlots(children, parent)
  4065. );
  4066. }
  4067. return this$1.$slots
  4068. };
  4069. Object.defineProperty(this, 'scopedSlots', ({
  4070. enumerable: true,
  4071. get: function get () {
  4072. return normalizeScopedSlots(data.scopedSlots, this.slots())
  4073. }
  4074. }));
  4075. // support for compiled functional template
  4076. if (isCompiled) {
  4077. // exposing $options for renderStatic()
  4078. this.$options = options;
  4079. // pre-resolve slots for renderSlot()
  4080. this.$slots = this.slots();
  4081. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  4082. }
  4083. if (options._scopeId) {
  4084. this._c = function (a, b, c, d) {
  4085. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  4086. if (vnode && !Array.isArray(vnode)) {
  4087. vnode.fnScopeId = options._scopeId;
  4088. vnode.fnContext = parent;
  4089. }
  4090. return vnode
  4091. };
  4092. } else {
  4093. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  4094. }
  4095. }
  4096. installRenderHelpers(FunctionalRenderContext.prototype);
  4097. function createFunctionalComponent (
  4098. Ctor,
  4099. propsData,
  4100. data,
  4101. contextVm,
  4102. children
  4103. ) {
  4104. var options = Ctor.options;
  4105. var props = {};
  4106. var propOptions = options.props;
  4107. if (isDef(propOptions)) {
  4108. for (var key in propOptions) {
  4109. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  4110. }
  4111. } else {
  4112. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  4113. if (isDef(data.props)) { mergeProps(props, data.props); }
  4114. }
  4115. var renderContext = new FunctionalRenderContext(
  4116. data,
  4117. props,
  4118. children,
  4119. contextVm,
  4120. Ctor
  4121. );
  4122. var vnode = options.render.call(null, renderContext._c, renderContext);
  4123. if (vnode instanceof VNode) {
  4124. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  4125. } else if (Array.isArray(vnode)) {
  4126. var vnodes = normalizeChildren(vnode) || [];
  4127. var res = new Array(vnodes.length);
  4128. for (var i = 0; i < vnodes.length; i++) {
  4129. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  4130. }
  4131. return res
  4132. }
  4133. }
  4134. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  4135. // #7817 clone node before setting fnContext, otherwise if the node is reused
  4136. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  4137. // that should not be matched to match.
  4138. var clone = cloneVNode(vnode);
  4139. clone.fnContext = contextVm;
  4140. clone.fnOptions = options;
  4141. if (true) {
  4142. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  4143. }
  4144. if (data.slot) {
  4145. (clone.data || (clone.data = {})).slot = data.slot;
  4146. }
  4147. return clone
  4148. }
  4149. function mergeProps (to, from) {
  4150. for (var key in from) {
  4151. to[camelize(key)] = from[key];
  4152. }
  4153. }
  4154. /* */
  4155. /* */
  4156. /* */
  4157. /* */
  4158. // inline hooks to be invoked on component VNodes during patch
  4159. var componentVNodeHooks = {
  4160. init: function init (vnode, hydrating) {
  4161. if (
  4162. vnode.componentInstance &&
  4163. !vnode.componentInstance._isDestroyed &&
  4164. vnode.data.keepAlive
  4165. ) {
  4166. // kept-alive components, treat as a patch
  4167. var mountedNode = vnode; // work around flow
  4168. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  4169. } else {
  4170. var child = vnode.componentInstance = createComponentInstanceForVnode(
  4171. vnode,
  4172. activeInstance
  4173. );
  4174. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  4175. }
  4176. },
  4177. prepatch: function prepatch (oldVnode, vnode) {
  4178. var options = vnode.componentOptions;
  4179. var child = vnode.componentInstance = oldVnode.componentInstance;
  4180. updateChildComponent(
  4181. child,
  4182. options.propsData, // updated props
  4183. options.listeners, // updated listeners
  4184. vnode, // new parent vnode
  4185. options.children // new children
  4186. );
  4187. },
  4188. insert: function insert (vnode) {
  4189. var context = vnode.context;
  4190. var componentInstance = vnode.componentInstance;
  4191. if (!componentInstance._isMounted) {
  4192. callHook(componentInstance, 'onServiceCreated');
  4193. callHook(componentInstance, 'onServiceAttached');
  4194. componentInstance._isMounted = true;
  4195. callHook(componentInstance, 'mounted');
  4196. }
  4197. if (vnode.data.keepAlive) {
  4198. if (context._isMounted) {
  4199. // vue-router#1212
  4200. // During updates, a kept-alive component's child components may
  4201. // change, so directly walking the tree here may call activated hooks
  4202. // on incorrect children. Instead we push them into a queue which will
  4203. // be processed after the whole patch process ended.
  4204. queueActivatedComponent(componentInstance);
  4205. } else {
  4206. activateChildComponent(componentInstance, true /* direct */);
  4207. }
  4208. }
  4209. },
  4210. destroy: function destroy (vnode) {
  4211. var componentInstance = vnode.componentInstance;
  4212. if (!componentInstance._isDestroyed) {
  4213. if (!vnode.data.keepAlive) {
  4214. componentInstance.$destroy();
  4215. } else {
  4216. deactivateChildComponent(componentInstance, true /* direct */);
  4217. }
  4218. }
  4219. }
  4220. };
  4221. var hooksToMerge = Object.keys(componentVNodeHooks);
  4222. function createComponent (
  4223. Ctor,
  4224. data,
  4225. context,
  4226. children,
  4227. tag
  4228. ) {
  4229. if (isUndef(Ctor)) {
  4230. return
  4231. }
  4232. var baseCtor = context.$options._base;
  4233. // plain options object: turn it into a constructor
  4234. if (isObject(Ctor)) {
  4235. Ctor = baseCtor.extend(Ctor);
  4236. }
  4237. // if at this stage it's not a constructor or an async component factory,
  4238. // reject.
  4239. if (typeof Ctor !== 'function') {
  4240. if (true) {
  4241. warn(("Invalid Component definition: " + (String(Ctor))), context);
  4242. }
  4243. return
  4244. }
  4245. // async component
  4246. var asyncFactory;
  4247. if (isUndef(Ctor.cid)) {
  4248. asyncFactory = Ctor;
  4249. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  4250. if (Ctor === undefined) {
  4251. // return a placeholder node for async component, which is rendered
  4252. // as a comment node but preserves all the raw information for the node.
  4253. // the information will be used for async server-rendering and hydration.
  4254. return createAsyncPlaceholder(
  4255. asyncFactory,
  4256. data,
  4257. context,
  4258. children,
  4259. tag
  4260. )
  4261. }
  4262. }
  4263. data = data || {};
  4264. // resolve constructor options in case global mixins are applied after
  4265. // component constructor creation
  4266. resolveConstructorOptions(Ctor);
  4267. // transform component v-model data into props & events
  4268. if (isDef(data.model)) {
  4269. transformModel(Ctor.options, data);
  4270. }
  4271. // extract props
  4272. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  4273. // functional component
  4274. if (isTrue(Ctor.options.functional)) {
  4275. return createFunctionalComponent(Ctor, propsData, data, context, children)
  4276. }
  4277. // extract listeners, since these needs to be treated as
  4278. // child component listeners instead of DOM listeners
  4279. var listeners = data.on;
  4280. // replace with listeners with .native modifier
  4281. // so it gets processed during parent component patch.
  4282. data.on = data.nativeOn;
  4283. if (isTrue(Ctor.options.abstract)) {
  4284. // abstract components do not keep anything
  4285. // other than props & listeners & slot
  4286. // work around flow
  4287. var slot = data.slot;
  4288. data = {};
  4289. if (slot) {
  4290. data.slot = slot;
  4291. }
  4292. }
  4293. // install component management hooks onto the placeholder node
  4294. installComponentHooks(data);
  4295. // return a placeholder vnode
  4296. var name = Ctor.options.name || tag;
  4297. var vnode = new VNode(
  4298. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  4299. data, undefined, undefined, undefined, context,
  4300. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  4301. asyncFactory
  4302. );
  4303. return vnode
  4304. }
  4305. function createComponentInstanceForVnode (
  4306. vnode, // we know it's MountedComponentVNode but flow doesn't
  4307. parent // activeInstance in lifecycle state
  4308. ) {
  4309. var options = {
  4310. _isComponent: true,
  4311. _parentVnode: vnode,
  4312. parent: parent
  4313. };
  4314. // check inline-template render functions
  4315. var inlineTemplate = vnode.data.inlineTemplate;
  4316. if (isDef(inlineTemplate)) {
  4317. options.render = inlineTemplate.render;
  4318. options.staticRenderFns = inlineTemplate.staticRenderFns;
  4319. }
  4320. return new vnode.componentOptions.Ctor(options)
  4321. }
  4322. function installComponentHooks (data) {
  4323. var hooks = data.hook || (data.hook = {});
  4324. for (var i = 0; i < hooksToMerge.length; i++) {
  4325. var key = hooksToMerge[i];
  4326. var existing = hooks[key];
  4327. var toMerge = componentVNodeHooks[key];
  4328. if (existing !== toMerge && !(existing && existing._merged)) {
  4329. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  4330. }
  4331. }
  4332. }
  4333. function mergeHook$1 (f1, f2) {
  4334. var merged = function (a, b) {
  4335. // flow complains about extra args which is why we use any
  4336. f1(a, b);
  4337. f2(a, b);
  4338. };
  4339. merged._merged = true;
  4340. return merged
  4341. }
  4342. // transform component v-model info (value and callback) into
  4343. // prop and event handler respectively.
  4344. function transformModel (options, data) {
  4345. var prop = (options.model && options.model.prop) || 'value';
  4346. var event = (options.model && options.model.event) || 'input'
  4347. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  4348. var on = data.on || (data.on = {});
  4349. var existing = on[event];
  4350. var callback = data.model.callback;
  4351. if (isDef(existing)) {
  4352. if (
  4353. Array.isArray(existing)
  4354. ? existing.indexOf(callback) === -1
  4355. : existing !== callback
  4356. ) {
  4357. on[event] = [callback].concat(existing);
  4358. }
  4359. } else {
  4360. on[event] = callback;
  4361. }
  4362. }
  4363. /* */
  4364. var SIMPLE_NORMALIZE = 1;
  4365. var ALWAYS_NORMALIZE = 2;
  4366. // wrapper function for providing a more flexible interface
  4367. // without getting yelled at by flow
  4368. function createElement (
  4369. context,
  4370. tag,
  4371. data,
  4372. children,
  4373. normalizationType,
  4374. alwaysNormalize
  4375. ) {
  4376. if (Array.isArray(data) || isPrimitive(data)) {
  4377. normalizationType = children;
  4378. children = data;
  4379. data = undefined;
  4380. }
  4381. if (isTrue(alwaysNormalize)) {
  4382. normalizationType = ALWAYS_NORMALIZE;
  4383. }
  4384. return _createElement(context, tag, data, children, normalizationType)
  4385. }
  4386. function _createElement (
  4387. context,
  4388. tag,
  4389. data,
  4390. children,
  4391. normalizationType
  4392. ) {
  4393. if (isDef(data) && isDef((data).__ob__)) {
  4394. true && warn(
  4395. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  4396. 'Always create fresh vnode data objects in each render!',
  4397. context
  4398. );
  4399. return createEmptyVNode()
  4400. }
  4401. // object syntax in v-bind
  4402. if (isDef(data) && isDef(data.is)) {
  4403. tag = data.is;
  4404. }
  4405. if (!tag) {
  4406. // in case of component :is set to falsy value
  4407. return createEmptyVNode()
  4408. }
  4409. // warn against non-primitive key
  4410. if ( true &&
  4411. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  4412. ) {
  4413. {
  4414. warn(
  4415. 'Avoid using non-primitive value as key, ' +
  4416. 'use string/number value instead.',
  4417. context
  4418. );
  4419. }
  4420. }
  4421. // support single function children as default scoped slot
  4422. if (Array.isArray(children) &&
  4423. typeof children[0] === 'function'
  4424. ) {
  4425. data = data || {};
  4426. data.scopedSlots = { default: children[0] };
  4427. children.length = 0;
  4428. }
  4429. if (normalizationType === ALWAYS_NORMALIZE) {
  4430. children = normalizeChildren(children);
  4431. } else if (normalizationType === SIMPLE_NORMALIZE) {
  4432. children = simpleNormalizeChildren(children);
  4433. }
  4434. var vnode, ns;
  4435. if (typeof tag === 'string') {
  4436. var Ctor;
  4437. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  4438. if (config.isReservedTag(tag)) {
  4439. // platform built-in elements
  4440. if ( true && isDef(data) && isDef(data.nativeOn)) {
  4441. warn(
  4442. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  4443. context
  4444. );
  4445. }
  4446. vnode = new VNode(
  4447. config.parsePlatformTagName(tag), data, children,
  4448. undefined, undefined, context
  4449. );
  4450. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  4451. // component
  4452. vnode = createComponent(Ctor, data, context, children, tag);
  4453. } else {
  4454. // unknown or unlisted namespaced elements
  4455. // check at runtime because it may get assigned a namespace when its
  4456. // parent normalizes children
  4457. vnode = new VNode(
  4458. tag, data, children,
  4459. undefined, undefined, context
  4460. );
  4461. }
  4462. } else {
  4463. // direct component options / constructor
  4464. vnode = createComponent(tag, data, context, children);
  4465. }
  4466. if (Array.isArray(vnode)) {
  4467. return vnode
  4468. } else if (isDef(vnode)) {
  4469. if (isDef(ns)) { applyNS(vnode, ns); }
  4470. if (isDef(data)) { registerDeepBindings(data); }
  4471. return vnode
  4472. } else {
  4473. return createEmptyVNode()
  4474. }
  4475. }
  4476. function applyNS (vnode, ns, force) {
  4477. vnode.ns = ns;
  4478. if (vnode.tag === 'foreignObject') {
  4479. // use default namespace inside foreignObject
  4480. ns = undefined;
  4481. force = true;
  4482. }
  4483. if (isDef(vnode.children)) {
  4484. for (var i = 0, l = vnode.children.length; i < l; i++) {
  4485. var child = vnode.children[i];
  4486. if (isDef(child.tag) && (
  4487. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  4488. applyNS(child, ns, force);
  4489. }
  4490. }
  4491. }
  4492. }
  4493. // ref #5318
  4494. // necessary to ensure parent re-render when deep bindings like :style and
  4495. // :class are used on slot nodes
  4496. function registerDeepBindings (data) {
  4497. if (isObject(data.style)) {
  4498. traverse(data.style);
  4499. }
  4500. if (isObject(data.class)) {
  4501. traverse(data.class);
  4502. }
  4503. }
  4504. /* */
  4505. function initRender (vm) {
  4506. vm._vnode = null; // the root of the child tree
  4507. vm._staticTrees = null; // v-once cached trees
  4508. var options = vm.$options;
  4509. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  4510. var renderContext = parentVnode && parentVnode.context;
  4511. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  4512. vm.$scopedSlots = emptyObject;
  4513. // bind the createElement fn to this instance
  4514. // so that we get proper render context inside it.
  4515. // args order: tag, data, children, normalizationType, alwaysNormalize
  4516. // internal version is used by render functions compiled from templates
  4517. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  4518. // normalization is always applied for the public version, used in
  4519. // user-written render functions.
  4520. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  4521. // $attrs & $listeners are exposed for easier HOC creation.
  4522. // they need to be reactive so that HOCs using them are always updated
  4523. var parentData = parentVnode && parentVnode.data;
  4524. /* istanbul ignore else */
  4525. if (true) {
  4526. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  4527. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  4528. }, true);
  4529. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  4530. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  4531. }, true);
  4532. } else {}
  4533. }
  4534. var currentRenderingInstance = null;
  4535. function renderMixin (Vue) {
  4536. // install runtime convenience helpers
  4537. installRenderHelpers(Vue.prototype);
  4538. Vue.prototype.$nextTick = function (fn) {
  4539. return nextTick(fn, this)
  4540. };
  4541. Vue.prototype._render = function () {
  4542. var vm = this;
  4543. var ref = vm.$options;
  4544. var render = ref.render;
  4545. var _parentVnode = ref._parentVnode;
  4546. if (_parentVnode) {
  4547. vm.$scopedSlots = normalizeScopedSlots(
  4548. _parentVnode.data.scopedSlots,
  4549. vm.$slots,
  4550. vm.$scopedSlots
  4551. );
  4552. }
  4553. // set parent vnode. this allows render functions to have access
  4554. // to the data on the placeholder node.
  4555. vm.$vnode = _parentVnode;
  4556. // render self
  4557. var vnode;
  4558. try {
  4559. // There's no need to maintain a stack because all render fns are called
  4560. // separately from one another. Nested component's render fns are called
  4561. // when parent component is patched.
  4562. currentRenderingInstance = vm;
  4563. vnode = render.call(vm._renderProxy, vm.$createElement);
  4564. } catch (e) {
  4565. handleError(e, vm, "render");
  4566. // return error render result,
  4567. // or previous vnode to prevent render error causing blank component
  4568. /* istanbul ignore else */
  4569. if ( true && vm.$options.renderError) {
  4570. try {
  4571. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  4572. } catch (e) {
  4573. handleError(e, vm, "renderError");
  4574. vnode = vm._vnode;
  4575. }
  4576. } else {
  4577. vnode = vm._vnode;
  4578. }
  4579. } finally {
  4580. currentRenderingInstance = null;
  4581. }
  4582. // if the returned array contains only a single node, allow it
  4583. if (Array.isArray(vnode) && vnode.length === 1) {
  4584. vnode = vnode[0];
  4585. }
  4586. // return empty vnode in case the render function errored out
  4587. if (!(vnode instanceof VNode)) {
  4588. if ( true && Array.isArray(vnode)) {
  4589. warn(
  4590. 'Multiple root nodes returned from render function. Render function ' +
  4591. 'should return a single root node.',
  4592. vm
  4593. );
  4594. }
  4595. vnode = createEmptyVNode();
  4596. }
  4597. // set parent
  4598. vnode.parent = _parentVnode;
  4599. return vnode
  4600. };
  4601. }
  4602. /* */
  4603. function ensureCtor (comp, base) {
  4604. if (
  4605. comp.__esModule ||
  4606. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  4607. ) {
  4608. comp = comp.default;
  4609. }
  4610. return isObject(comp)
  4611. ? base.extend(comp)
  4612. : comp
  4613. }
  4614. function createAsyncPlaceholder (
  4615. factory,
  4616. data,
  4617. context,
  4618. children,
  4619. tag
  4620. ) {
  4621. var node = createEmptyVNode();
  4622. node.asyncFactory = factory;
  4623. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  4624. return node
  4625. }
  4626. function resolveAsyncComponent (
  4627. factory,
  4628. baseCtor
  4629. ) {
  4630. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  4631. return factory.errorComp
  4632. }
  4633. if (isDef(factory.resolved)) {
  4634. return factory.resolved
  4635. }
  4636. var owner = currentRenderingInstance;
  4637. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  4638. // already pending
  4639. factory.owners.push(owner);
  4640. }
  4641. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  4642. return factory.loadingComp
  4643. }
  4644. if (owner && !isDef(factory.owners)) {
  4645. var owners = factory.owners = [owner];
  4646. var sync = true;
  4647. var timerLoading = null;
  4648. var timerTimeout = null
  4649. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  4650. var forceRender = function (renderCompleted) {
  4651. for (var i = 0, l = owners.length; i < l; i++) {
  4652. (owners[i]).$forceUpdate();
  4653. }
  4654. if (renderCompleted) {
  4655. owners.length = 0;
  4656. if (timerLoading !== null) {
  4657. clearTimeout(timerLoading);
  4658. timerLoading = null;
  4659. }
  4660. if (timerTimeout !== null) {
  4661. clearTimeout(timerTimeout);
  4662. timerTimeout = null;
  4663. }
  4664. }
  4665. };
  4666. var resolve = once(function (res) {
  4667. // cache resolved
  4668. factory.resolved = ensureCtor(res, baseCtor);
  4669. // invoke callbacks only if this is not a synchronous resolve
  4670. // (async resolves are shimmed as synchronous during SSR)
  4671. if (!sync) {
  4672. forceRender(true);
  4673. } else {
  4674. owners.length = 0;
  4675. }
  4676. });
  4677. var reject = once(function (reason) {
  4678. true && warn(
  4679. "Failed to resolve async component: " + (String(factory)) +
  4680. (reason ? ("\nReason: " + reason) : '')
  4681. );
  4682. if (isDef(factory.errorComp)) {
  4683. factory.error = true;
  4684. forceRender(true);
  4685. }
  4686. });
  4687. var res = factory(resolve, reject);
  4688. if (isObject(res)) {
  4689. if (isPromise(res)) {
  4690. // () => Promise
  4691. if (isUndef(factory.resolved)) {
  4692. res.then(resolve, reject);
  4693. }
  4694. } else if (isPromise(res.component)) {
  4695. res.component.then(resolve, reject);
  4696. if (isDef(res.error)) {
  4697. factory.errorComp = ensureCtor(res.error, baseCtor);
  4698. }
  4699. if (isDef(res.loading)) {
  4700. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  4701. if (res.delay === 0) {
  4702. factory.loading = true;
  4703. } else {
  4704. timerLoading = setTimeout(function () {
  4705. timerLoading = null;
  4706. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  4707. factory.loading = true;
  4708. forceRender(false);
  4709. }
  4710. }, res.delay || 200);
  4711. }
  4712. }
  4713. if (isDef(res.timeout)) {
  4714. timerTimeout = setTimeout(function () {
  4715. timerTimeout = null;
  4716. if (isUndef(factory.resolved)) {
  4717. reject(
  4718. true
  4719. ? ("timeout (" + (res.timeout) + "ms)")
  4720. : undefined
  4721. );
  4722. }
  4723. }, res.timeout);
  4724. }
  4725. }
  4726. }
  4727. sync = false;
  4728. // return in case resolved synchronously
  4729. return factory.loading
  4730. ? factory.loadingComp
  4731. : factory.resolved
  4732. }
  4733. }
  4734. /* */
  4735. function isAsyncPlaceholder (node) {
  4736. return node.isComment && node.asyncFactory
  4737. }
  4738. /* */
  4739. function getFirstComponentChild (children) {
  4740. if (Array.isArray(children)) {
  4741. for (var i = 0; i < children.length; i++) {
  4742. var c = children[i];
  4743. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  4744. return c
  4745. }
  4746. }
  4747. }
  4748. }
  4749. /* */
  4750. /* */
  4751. function initEvents (vm) {
  4752. vm._events = Object.create(null);
  4753. vm._hasHookEvent = false;
  4754. // init parent attached events
  4755. var listeners = vm.$options._parentListeners;
  4756. if (listeners) {
  4757. updateComponentListeners(vm, listeners);
  4758. }
  4759. }
  4760. var target;
  4761. function add (event, fn) {
  4762. target.$on(event, fn);
  4763. }
  4764. function remove$1 (event, fn) {
  4765. target.$off(event, fn);
  4766. }
  4767. function createOnceHandler (event, fn) {
  4768. var _target = target;
  4769. return function onceHandler () {
  4770. var res = fn.apply(null, arguments);
  4771. if (res !== null) {
  4772. _target.$off(event, onceHandler);
  4773. }
  4774. }
  4775. }
  4776. function updateComponentListeners (
  4777. vm,
  4778. listeners,
  4779. oldListeners
  4780. ) {
  4781. target = vm;
  4782. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  4783. target = undefined;
  4784. }
  4785. function eventsMixin (Vue) {
  4786. var hookRE = /^hook:/;
  4787. Vue.prototype.$on = function (event, fn) {
  4788. var vm = this;
  4789. if (Array.isArray(event)) {
  4790. for (var i = 0, l = event.length; i < l; i++) {
  4791. vm.$on(event[i], fn);
  4792. }
  4793. } else {
  4794. (vm._events[event] || (vm._events[event] = [])).push(fn);
  4795. // optimize hook:event cost by using a boolean flag marked at registration
  4796. // instead of a hash lookup
  4797. if (hookRE.test(event)) {
  4798. vm._hasHookEvent = true;
  4799. }
  4800. }
  4801. return vm
  4802. };
  4803. Vue.prototype.$once = function (event, fn) {
  4804. var vm = this;
  4805. function on () {
  4806. vm.$off(event, on);
  4807. fn.apply(vm, arguments);
  4808. }
  4809. on.fn = fn;
  4810. vm.$on(event, on);
  4811. return vm
  4812. };
  4813. Vue.prototype.$off = function (event, fn) {
  4814. var vm = this;
  4815. // all
  4816. if (!arguments.length) {
  4817. vm._events = Object.create(null);
  4818. return vm
  4819. }
  4820. // array of events
  4821. if (Array.isArray(event)) {
  4822. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  4823. vm.$off(event[i$1], fn);
  4824. }
  4825. return vm
  4826. }
  4827. // specific event
  4828. var cbs = vm._events[event];
  4829. if (!cbs) {
  4830. return vm
  4831. }
  4832. if (!fn) {
  4833. vm._events[event] = null;
  4834. return vm
  4835. }
  4836. // specific handler
  4837. var cb;
  4838. var i = cbs.length;
  4839. while (i--) {
  4840. cb = cbs[i];
  4841. if (cb === fn || cb.fn === fn) {
  4842. cbs.splice(i, 1);
  4843. break
  4844. }
  4845. }
  4846. return vm
  4847. };
  4848. Vue.prototype.$emit = function (event) {
  4849. var vm = this;
  4850. if (true) {
  4851. var lowerCaseEvent = event.toLowerCase();
  4852. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  4853. tip(
  4854. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  4855. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  4856. "Note that HTML attributes are case-insensitive and you cannot use " +
  4857. "v-on to listen to camelCase events when using in-DOM templates. " +
  4858. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  4859. );
  4860. }
  4861. }
  4862. var cbs = vm._events[event];
  4863. if (cbs) {
  4864. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  4865. var args = toArray(arguments, 1);
  4866. var info = "event handler for \"" + event + "\"";
  4867. for (var i = 0, l = cbs.length; i < l; i++) {
  4868. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  4869. }
  4870. }
  4871. return vm
  4872. };
  4873. }
  4874. /* */
  4875. var activeInstance = null;
  4876. var isUpdatingChildComponent = false;
  4877. function setActiveInstance(vm) {
  4878. var prevActiveInstance = activeInstance;
  4879. activeInstance = vm;
  4880. return function () {
  4881. activeInstance = prevActiveInstance;
  4882. }
  4883. }
  4884. function initLifecycle (vm) {
  4885. var options = vm.$options;
  4886. // locate first non-abstract parent
  4887. var parent = options.parent;
  4888. if (parent && !options.abstract) {
  4889. while (parent.$options.abstract && parent.$parent) {
  4890. parent = parent.$parent;
  4891. }
  4892. parent.$children.push(vm);
  4893. }
  4894. vm.$parent = parent;
  4895. vm.$root = parent ? parent.$root : vm;
  4896. vm.$children = [];
  4897. vm.$refs = {};
  4898. vm._watcher = null;
  4899. vm._inactive = null;
  4900. vm._directInactive = false;
  4901. vm._isMounted = false;
  4902. vm._isDestroyed = false;
  4903. vm._isBeingDestroyed = false;
  4904. }
  4905. function lifecycleMixin (Vue) {
  4906. Vue.prototype._update = function (vnode, hydrating) {
  4907. var vm = this;
  4908. var prevEl = vm.$el;
  4909. var prevVnode = vm._vnode;
  4910. var restoreActiveInstance = setActiveInstance(vm);
  4911. vm._vnode = vnode;
  4912. // Vue.prototype.__patch__ is injected in entry points
  4913. // based on the rendering backend used.
  4914. if (!prevVnode) {
  4915. // initial render
  4916. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  4917. } else {
  4918. // updates
  4919. vm.$el = vm.__patch__(prevVnode, vnode);
  4920. }
  4921. restoreActiveInstance();
  4922. // update __vue__ reference
  4923. if (prevEl) {
  4924. prevEl.__vue__ = null;
  4925. }
  4926. if (vm.$el) {
  4927. vm.$el.__vue__ = vm;
  4928. }
  4929. // if parent is an HOC, update its $el as well
  4930. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  4931. vm.$parent.$el = vm.$el;
  4932. }
  4933. // updated hook is called by the scheduler to ensure that children are
  4934. // updated in a parent's updated hook.
  4935. };
  4936. Vue.prototype.$forceUpdate = function () {
  4937. var vm = this;
  4938. if (vm._watcher) {
  4939. vm._watcher.update();
  4940. }
  4941. };
  4942. Vue.prototype.$destroy = function () {
  4943. var vm = this;
  4944. if (vm._isBeingDestroyed) {
  4945. return
  4946. }
  4947. callHook(vm, 'beforeDestroy');
  4948. vm._isBeingDestroyed = true;
  4949. // remove self from parent
  4950. var parent = vm.$parent;
  4951. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  4952. remove(parent.$children, vm);
  4953. }
  4954. // teardown watchers
  4955. if (vm._watcher) {
  4956. vm._watcher.teardown();
  4957. }
  4958. var i = vm._watchers.length;
  4959. while (i--) {
  4960. vm._watchers[i].teardown();
  4961. }
  4962. // remove reference from data ob
  4963. // frozen object may not have observer.
  4964. if (vm._data.__ob__) {
  4965. vm._data.__ob__.vmCount--;
  4966. }
  4967. // call the last hook...
  4968. vm._isDestroyed = true;
  4969. // invoke destroy hooks on current rendered tree
  4970. vm.__patch__(vm._vnode, null);
  4971. // fire destroyed hook
  4972. callHook(vm, 'destroyed');
  4973. // turn off all instance listeners.
  4974. vm.$off();
  4975. // remove __vue__ reference
  4976. if (vm.$el) {
  4977. vm.$el.__vue__ = null;
  4978. }
  4979. // release circular reference (#6759)
  4980. if (vm.$vnode) {
  4981. vm.$vnode.parent = null;
  4982. }
  4983. };
  4984. }
  4985. function updateChildComponent (
  4986. vm,
  4987. propsData,
  4988. listeners,
  4989. parentVnode,
  4990. renderChildren
  4991. ) {
  4992. if (true) {
  4993. isUpdatingChildComponent = true;
  4994. }
  4995. // determine whether component has slot children
  4996. // we need to do this before overwriting $options._renderChildren.
  4997. // check if there are dynamic scopedSlots (hand-written or compiled but with
  4998. // dynamic slot names). Static scoped slots compiled from template has the
  4999. // "$stable" marker.
  5000. var newScopedSlots = parentVnode.data.scopedSlots;
  5001. var oldScopedSlots = vm.$scopedSlots;
  5002. var hasDynamicScopedSlot = !!(
  5003. (newScopedSlots && !newScopedSlots.$stable) ||
  5004. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  5005. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  5006. );
  5007. // Any static slot children from the parent may have changed during parent's
  5008. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  5009. // update is necessary to ensure correctness.
  5010. var needsForceUpdate = !!(
  5011. renderChildren || // has new static slots
  5012. vm.$options._renderChildren || // has old static slots
  5013. hasDynamicScopedSlot
  5014. );
  5015. vm.$options._parentVnode = parentVnode;
  5016. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  5017. if (vm._vnode) { // update child tree's parent
  5018. vm._vnode.parent = parentVnode;
  5019. }
  5020. vm.$options._renderChildren = renderChildren;
  5021. // update $attrs and $listeners hash
  5022. // these are also reactive so they may trigger child update if the child
  5023. // used them during render
  5024. vm.$attrs = parentVnode.data.attrs || emptyObject;
  5025. vm.$listeners = listeners || emptyObject;
  5026. // update props
  5027. if (propsData && vm.$options.props) {
  5028. toggleObserving(false);
  5029. var props = vm._props;
  5030. var propKeys = vm.$options._propKeys || [];
  5031. for (var i = 0; i < propKeys.length; i++) {
  5032. var key = propKeys[i];
  5033. var propOptions = vm.$options.props; // wtf flow?
  5034. props[key] = validateProp(key, propOptions, propsData, vm);
  5035. }
  5036. toggleObserving(true);
  5037. // keep a copy of raw propsData
  5038. vm.$options.propsData = propsData;
  5039. }
  5040. // fixed by xxxxxx update properties(mp runtime)
  5041. vm._$updateProperties && vm._$updateProperties(vm);
  5042. // update listeners
  5043. listeners = listeners || emptyObject;
  5044. var oldListeners = vm.$options._parentListeners;
  5045. vm.$options._parentListeners = listeners;
  5046. updateComponentListeners(vm, listeners, oldListeners);
  5047. // resolve slots + force update if has children
  5048. if (needsForceUpdate) {
  5049. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  5050. vm.$forceUpdate();
  5051. }
  5052. if (true) {
  5053. isUpdatingChildComponent = false;
  5054. }
  5055. }
  5056. function isInInactiveTree (vm) {
  5057. while (vm && (vm = vm.$parent)) {
  5058. if (vm._inactive) { return true }
  5059. }
  5060. return false
  5061. }
  5062. function activateChildComponent (vm, direct) {
  5063. if (direct) {
  5064. vm._directInactive = false;
  5065. if (isInInactiveTree(vm)) {
  5066. return
  5067. }
  5068. } else if (vm._directInactive) {
  5069. return
  5070. }
  5071. if (vm._inactive || vm._inactive === null) {
  5072. vm._inactive = false;
  5073. for (var i = 0; i < vm.$children.length; i++) {
  5074. activateChildComponent(vm.$children[i]);
  5075. }
  5076. callHook(vm, 'activated');
  5077. }
  5078. }
  5079. function deactivateChildComponent (vm, direct) {
  5080. if (direct) {
  5081. vm._directInactive = true;
  5082. if (isInInactiveTree(vm)) {
  5083. return
  5084. }
  5085. }
  5086. if (!vm._inactive) {
  5087. vm._inactive = true;
  5088. for (var i = 0; i < vm.$children.length; i++) {
  5089. deactivateChildComponent(vm.$children[i]);
  5090. }
  5091. callHook(vm, 'deactivated');
  5092. }
  5093. }
  5094. function callHook (vm, hook) {
  5095. // #7573 disable dep collection when invoking lifecycle hooks
  5096. pushTarget();
  5097. var handlers = vm.$options[hook];
  5098. var info = hook + " hook";
  5099. if (handlers) {
  5100. for (var i = 0, j = handlers.length; i < j; i++) {
  5101. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  5102. }
  5103. }
  5104. if (vm._hasHookEvent) {
  5105. vm.$emit('hook:' + hook);
  5106. }
  5107. popTarget();
  5108. }
  5109. /* */
  5110. var MAX_UPDATE_COUNT = 100;
  5111. var queue = [];
  5112. var activatedChildren = [];
  5113. var has = {};
  5114. var circular = {};
  5115. var waiting = false;
  5116. var flushing = false;
  5117. var index = 0;
  5118. /**
  5119. * Reset the scheduler's state.
  5120. */
  5121. function resetSchedulerState () {
  5122. index = queue.length = activatedChildren.length = 0;
  5123. has = {};
  5124. if (true) {
  5125. circular = {};
  5126. }
  5127. waiting = flushing = false;
  5128. }
  5129. // Async edge case #6566 requires saving the timestamp when event listeners are
  5130. // attached. However, calling performance.now() has a perf overhead especially
  5131. // if the page has thousands of event listeners. Instead, we take a timestamp
  5132. // every time the scheduler flushes and use that for all event listeners
  5133. // attached during that flush.
  5134. var currentFlushTimestamp = 0;
  5135. // Async edge case fix requires storing an event listener's attach timestamp.
  5136. var getNow = Date.now;
  5137. // Determine what event timestamp the browser is using. Annoyingly, the
  5138. // timestamp can either be hi-res (relative to page load) or low-res
  5139. // (relative to UNIX epoch), so in order to compare time we have to use the
  5140. // same timestamp type when saving the flush timestamp.
  5141. // All IE versions use low-res event timestamps, and have problematic clock
  5142. // implementations (#9632)
  5143. if (inBrowser && !isIE) {
  5144. var performance = window.performance;
  5145. if (
  5146. performance &&
  5147. typeof performance.now === 'function' &&
  5148. getNow() > document.createEvent('Event').timeStamp
  5149. ) {
  5150. // if the event timestamp, although evaluated AFTER the Date.now(), is
  5151. // smaller than it, it means the event is using a hi-res timestamp,
  5152. // and we need to use the hi-res version for event listener timestamps as
  5153. // well.
  5154. getNow = function () { return performance.now(); };
  5155. }
  5156. }
  5157. /**
  5158. * Flush both queues and run the watchers.
  5159. */
  5160. function flushSchedulerQueue () {
  5161. currentFlushTimestamp = getNow();
  5162. flushing = true;
  5163. var watcher, id;
  5164. // Sort queue before flush.
  5165. // This ensures that:
  5166. // 1. Components are updated from parent to child. (because parent is always
  5167. // created before the child)
  5168. // 2. A component's user watchers are run before its render watcher (because
  5169. // user watchers are created before the render watcher)
  5170. // 3. If a component is destroyed during a parent component's watcher run,
  5171. // its watchers can be skipped.
  5172. queue.sort(function (a, b) { return a.id - b.id; });
  5173. // do not cache length because more watchers might be pushed
  5174. // as we run existing watchers
  5175. for (index = 0; index < queue.length; index++) {
  5176. watcher = queue[index];
  5177. if (watcher.before) {
  5178. watcher.before();
  5179. }
  5180. id = watcher.id;
  5181. has[id] = null;
  5182. watcher.run();
  5183. // in dev build, check and stop circular updates.
  5184. if ( true && has[id] != null) {
  5185. circular[id] = (circular[id] || 0) + 1;
  5186. if (circular[id] > MAX_UPDATE_COUNT) {
  5187. warn(
  5188. 'You may have an infinite update loop ' + (
  5189. watcher.user
  5190. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  5191. : "in a component render function."
  5192. ),
  5193. watcher.vm
  5194. );
  5195. break
  5196. }
  5197. }
  5198. }
  5199. // keep copies of post queues before resetting state
  5200. var activatedQueue = activatedChildren.slice();
  5201. var updatedQueue = queue.slice();
  5202. resetSchedulerState();
  5203. // call component updated and activated hooks
  5204. callActivatedHooks(activatedQueue);
  5205. callUpdatedHooks(updatedQueue);
  5206. // devtool hook
  5207. /* istanbul ignore if */
  5208. if (devtools && config.devtools) {
  5209. devtools.emit('flush');
  5210. }
  5211. }
  5212. function callUpdatedHooks (queue) {
  5213. var i = queue.length;
  5214. while (i--) {
  5215. var watcher = queue[i];
  5216. var vm = watcher.vm;
  5217. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  5218. callHook(vm, 'updated');
  5219. }
  5220. }
  5221. }
  5222. /**
  5223. * Queue a kept-alive component that was activated during patch.
  5224. * The queue will be processed after the entire tree has been patched.
  5225. */
  5226. function queueActivatedComponent (vm) {
  5227. // setting _inactive to false here so that a render function can
  5228. // rely on checking whether it's in an inactive tree (e.g. router-view)
  5229. vm._inactive = false;
  5230. activatedChildren.push(vm);
  5231. }
  5232. function callActivatedHooks (queue) {
  5233. for (var i = 0; i < queue.length; i++) {
  5234. queue[i]._inactive = true;
  5235. activateChildComponent(queue[i], true /* true */);
  5236. }
  5237. }
  5238. /**
  5239. * Push a watcher into the watcher queue.
  5240. * Jobs with duplicate IDs will be skipped unless it's
  5241. * pushed when the queue is being flushed.
  5242. */
  5243. function queueWatcher (watcher) {
  5244. var id = watcher.id;
  5245. if (has[id] == null) {
  5246. has[id] = true;
  5247. if (!flushing) {
  5248. queue.push(watcher);
  5249. } else {
  5250. // if already flushing, splice the watcher based on its id
  5251. // if already past its id, it will be run next immediately.
  5252. var i = queue.length - 1;
  5253. while (i > index && queue[i].id > watcher.id) {
  5254. i--;
  5255. }
  5256. queue.splice(i + 1, 0, watcher);
  5257. }
  5258. // queue the flush
  5259. if (!waiting) {
  5260. waiting = true;
  5261. if ( true && !config.async) {
  5262. flushSchedulerQueue();
  5263. return
  5264. }
  5265. nextTick(flushSchedulerQueue);
  5266. }
  5267. }
  5268. }
  5269. /* */
  5270. var uid$2 = 0;
  5271. /**
  5272. * A watcher parses an expression, collects dependencies,
  5273. * and fires callback when the expression value changes.
  5274. * This is used for both the $watch() api and directives.
  5275. */
  5276. var Watcher = function Watcher (
  5277. vm,
  5278. expOrFn,
  5279. cb,
  5280. options,
  5281. isRenderWatcher
  5282. ) {
  5283. this.vm = vm;
  5284. if (isRenderWatcher) {
  5285. vm._watcher = this;
  5286. }
  5287. vm._watchers.push(this);
  5288. // options
  5289. if (options) {
  5290. this.deep = !!options.deep;
  5291. this.user = !!options.user;
  5292. this.lazy = !!options.lazy;
  5293. this.sync = !!options.sync;
  5294. this.before = options.before;
  5295. } else {
  5296. this.deep = this.user = this.lazy = this.sync = false;
  5297. }
  5298. this.cb = cb;
  5299. this.id = ++uid$2; // uid for batching
  5300. this.active = true;
  5301. this.dirty = this.lazy; // for lazy watchers
  5302. this.deps = [];
  5303. this.newDeps = [];
  5304. this.depIds = new _Set();
  5305. this.newDepIds = new _Set();
  5306. this.expression = true
  5307. ? expOrFn.toString()
  5308. : undefined;
  5309. // parse expression for getter
  5310. if (typeof expOrFn === 'function') {
  5311. this.getter = expOrFn;
  5312. } else {
  5313. this.getter = parsePath(expOrFn);
  5314. if (!this.getter) {
  5315. this.getter = noop;
  5316. true && warn(
  5317. "Failed watching path: \"" + expOrFn + "\" " +
  5318. 'Watcher only accepts simple dot-delimited paths. ' +
  5319. 'For full control, use a function instead.',
  5320. vm
  5321. );
  5322. }
  5323. }
  5324. this.value = this.lazy
  5325. ? undefined
  5326. : this.get();
  5327. };
  5328. /**
  5329. * Evaluate the getter, and re-collect dependencies.
  5330. */
  5331. Watcher.prototype.get = function get () {
  5332. pushTarget(this);
  5333. var value;
  5334. var vm = this.vm;
  5335. try {
  5336. value = this.getter.call(vm, vm);
  5337. } catch (e) {
  5338. if (this.user) {
  5339. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  5340. } else {
  5341. throw e
  5342. }
  5343. } finally {
  5344. // "touch" every property so they are all tracked as
  5345. // dependencies for deep watching
  5346. if (this.deep) {
  5347. traverse(value);
  5348. }
  5349. popTarget();
  5350. this.cleanupDeps();
  5351. }
  5352. return value
  5353. };
  5354. /**
  5355. * Add a dependency to this directive.
  5356. */
  5357. Watcher.prototype.addDep = function addDep (dep) {
  5358. var id = dep.id;
  5359. if (!this.newDepIds.has(id)) {
  5360. this.newDepIds.add(id);
  5361. this.newDeps.push(dep);
  5362. if (!this.depIds.has(id)) {
  5363. dep.addSub(this);
  5364. }
  5365. }
  5366. };
  5367. /**
  5368. * Clean up for dependency collection.
  5369. */
  5370. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  5371. var i = this.deps.length;
  5372. while (i--) {
  5373. var dep = this.deps[i];
  5374. if (!this.newDepIds.has(dep.id)) {
  5375. dep.removeSub(this);
  5376. }
  5377. }
  5378. var tmp = this.depIds;
  5379. this.depIds = this.newDepIds;
  5380. this.newDepIds = tmp;
  5381. this.newDepIds.clear();
  5382. tmp = this.deps;
  5383. this.deps = this.newDeps;
  5384. this.newDeps = tmp;
  5385. this.newDeps.length = 0;
  5386. };
  5387. /**
  5388. * Subscriber interface.
  5389. * Will be called when a dependency changes.
  5390. */
  5391. Watcher.prototype.update = function update () {
  5392. /* istanbul ignore else */
  5393. if (this.lazy) {
  5394. this.dirty = true;
  5395. } else if (this.sync) {
  5396. this.run();
  5397. } else {
  5398. queueWatcher(this);
  5399. }
  5400. };
  5401. /**
  5402. * Scheduler job interface.
  5403. * Will be called by the scheduler.
  5404. */
  5405. Watcher.prototype.run = function run () {
  5406. if (this.active) {
  5407. var value = this.get();
  5408. if (
  5409. value !== this.value ||
  5410. // Deep watchers and watchers on Object/Arrays should fire even
  5411. // when the value is the same, because the value may
  5412. // have mutated.
  5413. isObject(value) ||
  5414. this.deep
  5415. ) {
  5416. // set new value
  5417. var oldValue = this.value;
  5418. this.value = value;
  5419. if (this.user) {
  5420. try {
  5421. this.cb.call(this.vm, value, oldValue);
  5422. } catch (e) {
  5423. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  5424. }
  5425. } else {
  5426. this.cb.call(this.vm, value, oldValue);
  5427. }
  5428. }
  5429. }
  5430. };
  5431. /**
  5432. * Evaluate the value of the watcher.
  5433. * This only gets called for lazy watchers.
  5434. */
  5435. Watcher.prototype.evaluate = function evaluate () {
  5436. this.value = this.get();
  5437. this.dirty = false;
  5438. };
  5439. /**
  5440. * Depend on all deps collected by this watcher.
  5441. */
  5442. Watcher.prototype.depend = function depend () {
  5443. var i = this.deps.length;
  5444. while (i--) {
  5445. this.deps[i].depend();
  5446. }
  5447. };
  5448. /**
  5449. * Remove self from all dependencies' subscriber list.
  5450. */
  5451. Watcher.prototype.teardown = function teardown () {
  5452. if (this.active) {
  5453. // remove self from vm's watcher list
  5454. // this is a somewhat expensive operation so we skip it
  5455. // if the vm is being destroyed.
  5456. if (!this.vm._isBeingDestroyed) {
  5457. remove(this.vm._watchers, this);
  5458. }
  5459. var i = this.deps.length;
  5460. while (i--) {
  5461. this.deps[i].removeSub(this);
  5462. }
  5463. this.active = false;
  5464. }
  5465. };
  5466. /* */
  5467. var sharedPropertyDefinition = {
  5468. enumerable: true,
  5469. configurable: true,
  5470. get: noop,
  5471. set: noop
  5472. };
  5473. function proxy (target, sourceKey, key) {
  5474. sharedPropertyDefinition.get = function proxyGetter () {
  5475. return this[sourceKey][key]
  5476. };
  5477. sharedPropertyDefinition.set = function proxySetter (val) {
  5478. this[sourceKey][key] = val;
  5479. };
  5480. Object.defineProperty(target, key, sharedPropertyDefinition);
  5481. }
  5482. function initState (vm) {
  5483. vm._watchers = [];
  5484. var opts = vm.$options;
  5485. if (opts.props) { initProps(vm, opts.props); }
  5486. if (opts.methods) { initMethods(vm, opts.methods); }
  5487. if (opts.data) {
  5488. initData(vm);
  5489. } else {
  5490. observe(vm._data = {}, true /* asRootData */);
  5491. }
  5492. if (opts.computed) { initComputed(vm, opts.computed); }
  5493. if (opts.watch && opts.watch !== nativeWatch) {
  5494. initWatch(vm, opts.watch);
  5495. }
  5496. }
  5497. function initProps (vm, propsOptions) {
  5498. var propsData = vm.$options.propsData || {};
  5499. var props = vm._props = {};
  5500. // cache prop keys so that future props updates can iterate using Array
  5501. // instead of dynamic object key enumeration.
  5502. var keys = vm.$options._propKeys = [];
  5503. var isRoot = !vm.$parent;
  5504. // root instance props should be converted
  5505. if (!isRoot) {
  5506. toggleObserving(false);
  5507. }
  5508. var loop = function ( key ) {
  5509. keys.push(key);
  5510. var value = validateProp(key, propsOptions, propsData, vm);
  5511. /* istanbul ignore else */
  5512. if (true) {
  5513. var hyphenatedKey = hyphenate(key);
  5514. if (isReservedAttribute(hyphenatedKey) ||
  5515. config.isReservedAttr(hyphenatedKey)) {
  5516. warn(
  5517. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  5518. vm
  5519. );
  5520. }
  5521. defineReactive$$1(props, key, value, function () {
  5522. if (!isRoot && !isUpdatingChildComponent) {
  5523. {
  5524. if(vm.mpHost === 'mp-baidu'){//百度 observer 在 setData callback 之后触发,直接忽略该 warn
  5525. return
  5526. }
  5527. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  5528. if(
  5529. key === 'value' &&
  5530. Array.isArray(vm.$options.behaviors) &&
  5531. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  5532. ){
  5533. return
  5534. }
  5535. if(vm._getFormData){
  5536. return
  5537. }
  5538. var $parent = vm.$parent;
  5539. while($parent){
  5540. if($parent.__next_tick_pending){
  5541. return
  5542. }
  5543. $parent = $parent.$parent;
  5544. }
  5545. }
  5546. warn(
  5547. "Avoid mutating a prop directly since the value will be " +
  5548. "overwritten whenever the parent component re-renders. " +
  5549. "Instead, use a data or computed property based on the prop's " +
  5550. "value. Prop being mutated: \"" + key + "\"",
  5551. vm
  5552. );
  5553. }
  5554. });
  5555. } else {}
  5556. // static props are already proxied on the component's prototype
  5557. // during Vue.extend(). We only need to proxy props defined at
  5558. // instantiation here.
  5559. if (!(key in vm)) {
  5560. proxy(vm, "_props", key);
  5561. }
  5562. };
  5563. for (var key in propsOptions) loop( key );
  5564. toggleObserving(true);
  5565. }
  5566. function initData (vm) {
  5567. var data = vm.$options.data;
  5568. data = vm._data = typeof data === 'function'
  5569. ? getData(data, vm)
  5570. : data || {};
  5571. if (!isPlainObject(data)) {
  5572. data = {};
  5573. true && warn(
  5574. 'data functions should return an object:\n' +
  5575. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  5576. vm
  5577. );
  5578. }
  5579. // proxy data on instance
  5580. var keys = Object.keys(data);
  5581. var props = vm.$options.props;
  5582. var methods = vm.$options.methods;
  5583. var i = keys.length;
  5584. while (i--) {
  5585. var key = keys[i];
  5586. if (true) {
  5587. if (methods && hasOwn(methods, key)) {
  5588. warn(
  5589. ("Method \"" + key + "\" has already been defined as a data property."),
  5590. vm
  5591. );
  5592. }
  5593. }
  5594. if (props && hasOwn(props, key)) {
  5595. true && warn(
  5596. "The data property \"" + key + "\" is already declared as a prop. " +
  5597. "Use prop default value instead.",
  5598. vm
  5599. );
  5600. } else if (!isReserved(key)) {
  5601. proxy(vm, "_data", key);
  5602. }
  5603. }
  5604. // observe data
  5605. observe(data, true /* asRootData */);
  5606. }
  5607. function getData (data, vm) {
  5608. // #7573 disable dep collection when invoking data getters
  5609. pushTarget();
  5610. try {
  5611. return data.call(vm, vm)
  5612. } catch (e) {
  5613. handleError(e, vm, "data()");
  5614. return {}
  5615. } finally {
  5616. popTarget();
  5617. }
  5618. }
  5619. var computedWatcherOptions = { lazy: true };
  5620. function initComputed (vm, computed) {
  5621. // $flow-disable-line
  5622. var watchers = vm._computedWatchers = Object.create(null);
  5623. // computed properties are just getters during SSR
  5624. var isSSR = isServerRendering();
  5625. for (var key in computed) {
  5626. var userDef = computed[key];
  5627. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  5628. if ( true && getter == null) {
  5629. warn(
  5630. ("Getter is missing for computed property \"" + key + "\"."),
  5631. vm
  5632. );
  5633. }
  5634. if (!isSSR) {
  5635. // create internal watcher for the computed property.
  5636. watchers[key] = new Watcher(
  5637. vm,
  5638. getter || noop,
  5639. noop,
  5640. computedWatcherOptions
  5641. );
  5642. }
  5643. // component-defined computed properties are already defined on the
  5644. // component prototype. We only need to define computed properties defined
  5645. // at instantiation here.
  5646. if (!(key in vm)) {
  5647. defineComputed(vm, key, userDef);
  5648. } else if (true) {
  5649. if (key in vm.$data) {
  5650. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  5651. } else if (vm.$options.props && key in vm.$options.props) {
  5652. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  5653. }
  5654. }
  5655. }
  5656. }
  5657. function defineComputed (
  5658. target,
  5659. key,
  5660. userDef
  5661. ) {
  5662. var shouldCache = !isServerRendering();
  5663. if (typeof userDef === 'function') {
  5664. sharedPropertyDefinition.get = shouldCache
  5665. ? createComputedGetter(key)
  5666. : createGetterInvoker(userDef);
  5667. sharedPropertyDefinition.set = noop;
  5668. } else {
  5669. sharedPropertyDefinition.get = userDef.get
  5670. ? shouldCache && userDef.cache !== false
  5671. ? createComputedGetter(key)
  5672. : createGetterInvoker(userDef.get)
  5673. : noop;
  5674. sharedPropertyDefinition.set = userDef.set || noop;
  5675. }
  5676. if ( true &&
  5677. sharedPropertyDefinition.set === noop) {
  5678. sharedPropertyDefinition.set = function () {
  5679. warn(
  5680. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  5681. this
  5682. );
  5683. };
  5684. }
  5685. Object.defineProperty(target, key, sharedPropertyDefinition);
  5686. }
  5687. function createComputedGetter (key) {
  5688. return function computedGetter () {
  5689. var watcher = this._computedWatchers && this._computedWatchers[key];
  5690. if (watcher) {
  5691. if (watcher.dirty) {
  5692. watcher.evaluate();
  5693. }
  5694. if (Dep.SharedObject.target) {// fixed by xxxxxx
  5695. watcher.depend();
  5696. }
  5697. return watcher.value
  5698. }
  5699. }
  5700. }
  5701. function createGetterInvoker(fn) {
  5702. return function computedGetter () {
  5703. return fn.call(this, this)
  5704. }
  5705. }
  5706. function initMethods (vm, methods) {
  5707. var props = vm.$options.props;
  5708. for (var key in methods) {
  5709. if (true) {
  5710. if (typeof methods[key] !== 'function') {
  5711. warn(
  5712. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  5713. "Did you reference the function correctly?",
  5714. vm
  5715. );
  5716. }
  5717. if (props && hasOwn(props, key)) {
  5718. warn(
  5719. ("Method \"" + key + "\" has already been defined as a prop."),
  5720. vm
  5721. );
  5722. }
  5723. if ((key in vm) && isReserved(key)) {
  5724. warn(
  5725. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  5726. "Avoid defining component methods that start with _ or $."
  5727. );
  5728. }
  5729. }
  5730. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  5731. }
  5732. }
  5733. function initWatch (vm, watch) {
  5734. for (var key in watch) {
  5735. var handler = watch[key];
  5736. if (Array.isArray(handler)) {
  5737. for (var i = 0; i < handler.length; i++) {
  5738. createWatcher(vm, key, handler[i]);
  5739. }
  5740. } else {
  5741. createWatcher(vm, key, handler);
  5742. }
  5743. }
  5744. }
  5745. function createWatcher (
  5746. vm,
  5747. expOrFn,
  5748. handler,
  5749. options
  5750. ) {
  5751. if (isPlainObject(handler)) {
  5752. options = handler;
  5753. handler = handler.handler;
  5754. }
  5755. if (typeof handler === 'string') {
  5756. handler = vm[handler];
  5757. }
  5758. return vm.$watch(expOrFn, handler, options)
  5759. }
  5760. function stateMixin (Vue) {
  5761. // flow somehow has problems with directly declared definition object
  5762. // when using Object.defineProperty, so we have to procedurally build up
  5763. // the object here.
  5764. var dataDef = {};
  5765. dataDef.get = function () { return this._data };
  5766. var propsDef = {};
  5767. propsDef.get = function () { return this._props };
  5768. if (true) {
  5769. dataDef.set = function () {
  5770. warn(
  5771. 'Avoid replacing instance root $data. ' +
  5772. 'Use nested data properties instead.',
  5773. this
  5774. );
  5775. };
  5776. propsDef.set = function () {
  5777. warn("$props is readonly.", this);
  5778. };
  5779. }
  5780. Object.defineProperty(Vue.prototype, '$data', dataDef);
  5781. Object.defineProperty(Vue.prototype, '$props', propsDef);
  5782. Vue.prototype.$set = set;
  5783. Vue.prototype.$delete = del;
  5784. Vue.prototype.$watch = function (
  5785. expOrFn,
  5786. cb,
  5787. options
  5788. ) {
  5789. var vm = this;
  5790. if (isPlainObject(cb)) {
  5791. return createWatcher(vm, expOrFn, cb, options)
  5792. }
  5793. options = options || {};
  5794. options.user = true;
  5795. var watcher = new Watcher(vm, expOrFn, cb, options);
  5796. if (options.immediate) {
  5797. try {
  5798. cb.call(vm, watcher.value);
  5799. } catch (error) {
  5800. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  5801. }
  5802. }
  5803. return function unwatchFn () {
  5804. watcher.teardown();
  5805. }
  5806. };
  5807. }
  5808. /* */
  5809. var uid$3 = 0;
  5810. function initMixin (Vue) {
  5811. Vue.prototype._init = function (options) {
  5812. var vm = this;
  5813. // a uid
  5814. vm._uid = uid$3++;
  5815. var startTag, endTag;
  5816. /* istanbul ignore if */
  5817. if ( true && config.performance && mark) {
  5818. startTag = "vue-perf-start:" + (vm._uid);
  5819. endTag = "vue-perf-end:" + (vm._uid);
  5820. mark(startTag);
  5821. }
  5822. // a flag to avoid this being observed
  5823. vm._isVue = true;
  5824. // merge options
  5825. if (options && options._isComponent) {
  5826. // optimize internal component instantiation
  5827. // since dynamic options merging is pretty slow, and none of the
  5828. // internal component options needs special treatment.
  5829. initInternalComponent(vm, options);
  5830. } else {
  5831. vm.$options = mergeOptions(
  5832. resolveConstructorOptions(vm.constructor),
  5833. options || {},
  5834. vm
  5835. );
  5836. }
  5837. /* istanbul ignore else */
  5838. if (true) {
  5839. initProxy(vm);
  5840. } else {}
  5841. // expose real self
  5842. vm._self = vm;
  5843. initLifecycle(vm);
  5844. initEvents(vm);
  5845. initRender(vm);
  5846. callHook(vm, 'beforeCreate');
  5847. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  5848. initState(vm);
  5849. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  5850. !vm._$fallback && callHook(vm, 'created');
  5851. /* istanbul ignore if */
  5852. if ( true && config.performance && mark) {
  5853. vm._name = formatComponentName(vm, false);
  5854. mark(endTag);
  5855. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  5856. }
  5857. if (vm.$options.el) {
  5858. vm.$mount(vm.$options.el);
  5859. }
  5860. };
  5861. }
  5862. function initInternalComponent (vm, options) {
  5863. var opts = vm.$options = Object.create(vm.constructor.options);
  5864. // doing this because it's faster than dynamic enumeration.
  5865. var parentVnode = options._parentVnode;
  5866. opts.parent = options.parent;
  5867. opts._parentVnode = parentVnode;
  5868. var vnodeComponentOptions = parentVnode.componentOptions;
  5869. opts.propsData = vnodeComponentOptions.propsData;
  5870. opts._parentListeners = vnodeComponentOptions.listeners;
  5871. opts._renderChildren = vnodeComponentOptions.children;
  5872. opts._componentTag = vnodeComponentOptions.tag;
  5873. if (options.render) {
  5874. opts.render = options.render;
  5875. opts.staticRenderFns = options.staticRenderFns;
  5876. }
  5877. }
  5878. function resolveConstructorOptions (Ctor) {
  5879. var options = Ctor.options;
  5880. if (Ctor.super) {
  5881. var superOptions = resolveConstructorOptions(Ctor.super);
  5882. var cachedSuperOptions = Ctor.superOptions;
  5883. if (superOptions !== cachedSuperOptions) {
  5884. // super option changed,
  5885. // need to resolve new options.
  5886. Ctor.superOptions = superOptions;
  5887. // check if there are any late-modified/attached options (#4976)
  5888. var modifiedOptions = resolveModifiedOptions(Ctor);
  5889. // update base extend options
  5890. if (modifiedOptions) {
  5891. extend(Ctor.extendOptions, modifiedOptions);
  5892. }
  5893. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  5894. if (options.name) {
  5895. options.components[options.name] = Ctor;
  5896. }
  5897. }
  5898. }
  5899. return options
  5900. }
  5901. function resolveModifiedOptions (Ctor) {
  5902. var modified;
  5903. var latest = Ctor.options;
  5904. var sealed = Ctor.sealedOptions;
  5905. for (var key in latest) {
  5906. if (latest[key] !== sealed[key]) {
  5907. if (!modified) { modified = {}; }
  5908. modified[key] = latest[key];
  5909. }
  5910. }
  5911. return modified
  5912. }
  5913. function Vue (options) {
  5914. if ( true &&
  5915. !(this instanceof Vue)
  5916. ) {
  5917. warn('Vue is a constructor and should be called with the `new` keyword');
  5918. }
  5919. this._init(options);
  5920. }
  5921. initMixin(Vue);
  5922. stateMixin(Vue);
  5923. eventsMixin(Vue);
  5924. lifecycleMixin(Vue);
  5925. renderMixin(Vue);
  5926. /* */
  5927. function initUse (Vue) {
  5928. Vue.use = function (plugin) {
  5929. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  5930. if (installedPlugins.indexOf(plugin) > -1) {
  5931. return this
  5932. }
  5933. // additional parameters
  5934. var args = toArray(arguments, 1);
  5935. args.unshift(this);
  5936. if (typeof plugin.install === 'function') {
  5937. plugin.install.apply(plugin, args);
  5938. } else if (typeof plugin === 'function') {
  5939. plugin.apply(null, args);
  5940. }
  5941. installedPlugins.push(plugin);
  5942. return this
  5943. };
  5944. }
  5945. /* */
  5946. function initMixin$1 (Vue) {
  5947. Vue.mixin = function (mixin) {
  5948. this.options = mergeOptions(this.options, mixin);
  5949. return this
  5950. };
  5951. }
  5952. /* */
  5953. function initExtend (Vue) {
  5954. /**
  5955. * Each instance constructor, including Vue, has a unique
  5956. * cid. This enables us to create wrapped "child
  5957. * constructors" for prototypal inheritance and cache them.
  5958. */
  5959. Vue.cid = 0;
  5960. var cid = 1;
  5961. /**
  5962. * Class inheritance
  5963. */
  5964. Vue.extend = function (extendOptions) {
  5965. extendOptions = extendOptions || {};
  5966. var Super = this;
  5967. var SuperId = Super.cid;
  5968. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  5969. if (cachedCtors[SuperId]) {
  5970. return cachedCtors[SuperId]
  5971. }
  5972. var name = extendOptions.name || Super.options.name;
  5973. if ( true && name) {
  5974. validateComponentName(name);
  5975. }
  5976. var Sub = function VueComponent (options) {
  5977. this._init(options);
  5978. };
  5979. Sub.prototype = Object.create(Super.prototype);
  5980. Sub.prototype.constructor = Sub;
  5981. Sub.cid = cid++;
  5982. Sub.options = mergeOptions(
  5983. Super.options,
  5984. extendOptions
  5985. );
  5986. Sub['super'] = Super;
  5987. // For props and computed properties, we define the proxy getters on
  5988. // the Vue instances at extension time, on the extended prototype. This
  5989. // avoids Object.defineProperty calls for each instance created.
  5990. if (Sub.options.props) {
  5991. initProps$1(Sub);
  5992. }
  5993. if (Sub.options.computed) {
  5994. initComputed$1(Sub);
  5995. }
  5996. // allow further extension/mixin/plugin usage
  5997. Sub.extend = Super.extend;
  5998. Sub.mixin = Super.mixin;
  5999. Sub.use = Super.use;
  6000. // create asset registers, so extended classes
  6001. // can have their private assets too.
  6002. ASSET_TYPES.forEach(function (type) {
  6003. Sub[type] = Super[type];
  6004. });
  6005. // enable recursive self-lookup
  6006. if (name) {
  6007. Sub.options.components[name] = Sub;
  6008. }
  6009. // keep a reference to the super options at extension time.
  6010. // later at instantiation we can check if Super's options have
  6011. // been updated.
  6012. Sub.superOptions = Super.options;
  6013. Sub.extendOptions = extendOptions;
  6014. Sub.sealedOptions = extend({}, Sub.options);
  6015. // cache constructor
  6016. cachedCtors[SuperId] = Sub;
  6017. return Sub
  6018. };
  6019. }
  6020. function initProps$1 (Comp) {
  6021. var props = Comp.options.props;
  6022. for (var key in props) {
  6023. proxy(Comp.prototype, "_props", key);
  6024. }
  6025. }
  6026. function initComputed$1 (Comp) {
  6027. var computed = Comp.options.computed;
  6028. for (var key in computed) {
  6029. defineComputed(Comp.prototype, key, computed[key]);
  6030. }
  6031. }
  6032. /* */
  6033. function initAssetRegisters (Vue) {
  6034. /**
  6035. * Create asset registration methods.
  6036. */
  6037. ASSET_TYPES.forEach(function (type) {
  6038. Vue[type] = function (
  6039. id,
  6040. definition
  6041. ) {
  6042. if (!definition) {
  6043. return this.options[type + 's'][id]
  6044. } else {
  6045. /* istanbul ignore if */
  6046. if ( true && type === 'component') {
  6047. validateComponentName(id);
  6048. }
  6049. if (type === 'component' && isPlainObject(definition)) {
  6050. definition.name = definition.name || id;
  6051. definition = this.options._base.extend(definition);
  6052. }
  6053. if (type === 'directive' && typeof definition === 'function') {
  6054. definition = { bind: definition, update: definition };
  6055. }
  6056. this.options[type + 's'][id] = definition;
  6057. return definition
  6058. }
  6059. };
  6060. });
  6061. }
  6062. /* */
  6063. function getComponentName (opts) {
  6064. return opts && (opts.Ctor.options.name || opts.tag)
  6065. }
  6066. function matches (pattern, name) {
  6067. if (Array.isArray(pattern)) {
  6068. return pattern.indexOf(name) > -1
  6069. } else if (typeof pattern === 'string') {
  6070. return pattern.split(',').indexOf(name) > -1
  6071. } else if (isRegExp(pattern)) {
  6072. return pattern.test(name)
  6073. }
  6074. /* istanbul ignore next */
  6075. return false
  6076. }
  6077. function pruneCache (keepAliveInstance, filter) {
  6078. var cache = keepAliveInstance.cache;
  6079. var keys = keepAliveInstance.keys;
  6080. var _vnode = keepAliveInstance._vnode;
  6081. for (var key in cache) {
  6082. var cachedNode = cache[key];
  6083. if (cachedNode) {
  6084. var name = getComponentName(cachedNode.componentOptions);
  6085. if (name && !filter(name)) {
  6086. pruneCacheEntry(cache, key, keys, _vnode);
  6087. }
  6088. }
  6089. }
  6090. }
  6091. function pruneCacheEntry (
  6092. cache,
  6093. key,
  6094. keys,
  6095. current
  6096. ) {
  6097. var cached$$1 = cache[key];
  6098. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  6099. cached$$1.componentInstance.$destroy();
  6100. }
  6101. cache[key] = null;
  6102. remove(keys, key);
  6103. }
  6104. var patternTypes = [String, RegExp, Array];
  6105. var KeepAlive = {
  6106. name: 'keep-alive',
  6107. abstract: true,
  6108. props: {
  6109. include: patternTypes,
  6110. exclude: patternTypes,
  6111. max: [String, Number]
  6112. },
  6113. created: function created () {
  6114. this.cache = Object.create(null);
  6115. this.keys = [];
  6116. },
  6117. destroyed: function destroyed () {
  6118. for (var key in this.cache) {
  6119. pruneCacheEntry(this.cache, key, this.keys);
  6120. }
  6121. },
  6122. mounted: function mounted () {
  6123. var this$1 = this;
  6124. this.$watch('include', function (val) {
  6125. pruneCache(this$1, function (name) { return matches(val, name); });
  6126. });
  6127. this.$watch('exclude', function (val) {
  6128. pruneCache(this$1, function (name) { return !matches(val, name); });
  6129. });
  6130. },
  6131. render: function render () {
  6132. var slot = this.$slots.default;
  6133. var vnode = getFirstComponentChild(slot);
  6134. var componentOptions = vnode && vnode.componentOptions;
  6135. if (componentOptions) {
  6136. // check pattern
  6137. var name = getComponentName(componentOptions);
  6138. var ref = this;
  6139. var include = ref.include;
  6140. var exclude = ref.exclude;
  6141. if (
  6142. // not included
  6143. (include && (!name || !matches(include, name))) ||
  6144. // excluded
  6145. (exclude && name && matches(exclude, name))
  6146. ) {
  6147. return vnode
  6148. }
  6149. var ref$1 = this;
  6150. var cache = ref$1.cache;
  6151. var keys = ref$1.keys;
  6152. var key = vnode.key == null
  6153. // same constructor may get registered as different local components
  6154. // so cid alone is not enough (#3269)
  6155. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  6156. : vnode.key;
  6157. if (cache[key]) {
  6158. vnode.componentInstance = cache[key].componentInstance;
  6159. // make current key freshest
  6160. remove(keys, key);
  6161. keys.push(key);
  6162. } else {
  6163. cache[key] = vnode;
  6164. keys.push(key);
  6165. // prune oldest entry
  6166. if (this.max && keys.length > parseInt(this.max)) {
  6167. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  6168. }
  6169. }
  6170. vnode.data.keepAlive = true;
  6171. }
  6172. return vnode || (slot && slot[0])
  6173. }
  6174. };
  6175. var builtInComponents = {
  6176. KeepAlive: KeepAlive
  6177. };
  6178. /* */
  6179. function initGlobalAPI (Vue) {
  6180. // config
  6181. var configDef = {};
  6182. configDef.get = function () { return config; };
  6183. if (true) {
  6184. configDef.set = function () {
  6185. warn(
  6186. 'Do not replace the Vue.config object, set individual fields instead.'
  6187. );
  6188. };
  6189. }
  6190. Object.defineProperty(Vue, 'config', configDef);
  6191. // exposed util methods.
  6192. // NOTE: these are not considered part of the public API - avoid relying on
  6193. // them unless you are aware of the risk.
  6194. Vue.util = {
  6195. warn: warn,
  6196. extend: extend,
  6197. mergeOptions: mergeOptions,
  6198. defineReactive: defineReactive$$1
  6199. };
  6200. Vue.set = set;
  6201. Vue.delete = del;
  6202. Vue.nextTick = nextTick;
  6203. // 2.6 explicit observable API
  6204. Vue.observable = function (obj) {
  6205. observe(obj);
  6206. return obj
  6207. };
  6208. Vue.options = Object.create(null);
  6209. ASSET_TYPES.forEach(function (type) {
  6210. Vue.options[type + 's'] = Object.create(null);
  6211. });
  6212. // this is used to identify the "base" constructor to extend all plain-object
  6213. // components with in Weex's multi-instance scenarios.
  6214. Vue.options._base = Vue;
  6215. extend(Vue.options.components, builtInComponents);
  6216. initUse(Vue);
  6217. initMixin$1(Vue);
  6218. initExtend(Vue);
  6219. initAssetRegisters(Vue);
  6220. }
  6221. initGlobalAPI(Vue);
  6222. Object.defineProperty(Vue.prototype, '$isServer', {
  6223. get: isServerRendering
  6224. });
  6225. Object.defineProperty(Vue.prototype, '$ssrContext', {
  6226. get: function get () {
  6227. /* istanbul ignore next */
  6228. return this.$vnode && this.$vnode.ssrContext
  6229. }
  6230. });
  6231. // expose FunctionalRenderContext for ssr runtime helper installation
  6232. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  6233. value: FunctionalRenderContext
  6234. });
  6235. Vue.version = '2.6.11';
  6236. /**
  6237. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  6238. */
  6239. var ARRAYTYPE = '[object Array]';
  6240. var OBJECTTYPE = '[object Object]';
  6241. // const FUNCTIONTYPE = '[object Function]'
  6242. function diff(current, pre) {
  6243. var result = {};
  6244. syncKeys(current, pre);
  6245. _diff(current, pre, '', result);
  6246. return result
  6247. }
  6248. function syncKeys(current, pre) {
  6249. if (current === pre) { return }
  6250. var rootCurrentType = type(current);
  6251. var rootPreType = type(pre);
  6252. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  6253. if(Object.keys(current).length >= Object.keys(pre).length){
  6254. for (var key in pre) {
  6255. var currentValue = current[key];
  6256. if (currentValue === undefined) {
  6257. current[key] = null;
  6258. } else {
  6259. syncKeys(currentValue, pre[key]);
  6260. }
  6261. }
  6262. }
  6263. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  6264. if (current.length >= pre.length) {
  6265. pre.forEach(function (item, index) {
  6266. syncKeys(current[index], item);
  6267. });
  6268. }
  6269. }
  6270. }
  6271. function _diff(current, pre, path, result) {
  6272. if (current === pre) { return }
  6273. var rootCurrentType = type(current);
  6274. var rootPreType = type(pre);
  6275. if (rootCurrentType == OBJECTTYPE) {
  6276. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  6277. setResult(result, path, current);
  6278. } else {
  6279. var loop = function ( key ) {
  6280. var currentValue = current[key];
  6281. var preValue = pre[key];
  6282. var currentType = type(currentValue);
  6283. var preType = type(preValue);
  6284. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  6285. if (currentValue != pre[key]) {
  6286. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6287. }
  6288. } else if (currentType == ARRAYTYPE) {
  6289. if (preType != ARRAYTYPE) {
  6290. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6291. } else {
  6292. if (currentValue.length < preValue.length) {
  6293. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6294. } else {
  6295. currentValue.forEach(function (item, index) {
  6296. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  6297. });
  6298. }
  6299. }
  6300. } else if (currentType == OBJECTTYPE) {
  6301. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  6302. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6303. } else {
  6304. for (var subKey in currentValue) {
  6305. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  6306. }
  6307. }
  6308. }
  6309. };
  6310. for (var key in current) loop( key );
  6311. }
  6312. } else if (rootCurrentType == ARRAYTYPE) {
  6313. if (rootPreType != ARRAYTYPE) {
  6314. setResult(result, path, current);
  6315. } else {
  6316. if (current.length < pre.length) {
  6317. setResult(result, path, current);
  6318. } else {
  6319. current.forEach(function (item, index) {
  6320. _diff(item, pre[index], path + '[' + index + ']', result);
  6321. });
  6322. }
  6323. }
  6324. } else {
  6325. setResult(result, path, current);
  6326. }
  6327. }
  6328. function setResult(result, k, v) {
  6329. // if (type(v) != FUNCTIONTYPE) {
  6330. result[k] = v;
  6331. // }
  6332. }
  6333. function type(obj) {
  6334. return Object.prototype.toString.call(obj)
  6335. }
  6336. /* */
  6337. function flushCallbacks$1(vm) {
  6338. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  6339. if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6340. var mpInstance = vm.$scope;
  6341. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6342. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  6343. }
  6344. var copies = vm.__next_tick_callbacks.slice(0);
  6345. vm.__next_tick_callbacks.length = 0;
  6346. for (var i = 0; i < copies.length; i++) {
  6347. copies[i]();
  6348. }
  6349. }
  6350. }
  6351. function hasRenderWatcher(vm) {
  6352. return queue.find(function (watcher) { return vm._watcher === watcher; })
  6353. }
  6354. function nextTick$1(vm, cb) {
  6355. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  6356. //2.nextTick 之前存在 render watcher
  6357. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  6358. if(Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  6359. var mpInstance = vm.$scope;
  6360. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6361. ']:nextVueTick');
  6362. }
  6363. return nextTick(cb, vm)
  6364. }else{
  6365. if(Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  6366. var mpInstance$1 = vm.$scope;
  6367. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  6368. ']:nextMPTick');
  6369. }
  6370. }
  6371. var _resolve;
  6372. if (!vm.__next_tick_callbacks) {
  6373. vm.__next_tick_callbacks = [];
  6374. }
  6375. vm.__next_tick_callbacks.push(function () {
  6376. if (cb) {
  6377. try {
  6378. cb.call(vm);
  6379. } catch (e) {
  6380. handleError(e, vm, 'nextTick');
  6381. }
  6382. } else if (_resolve) {
  6383. _resolve(vm);
  6384. }
  6385. });
  6386. // $flow-disable-line
  6387. if (!cb && typeof Promise !== 'undefined') {
  6388. return new Promise(function (resolve) {
  6389. _resolve = resolve;
  6390. })
  6391. }
  6392. }
  6393. /* */
  6394. function cloneWithData(vm) {
  6395. // 确保当前 vm 所有数据被同步
  6396. var ret = Object.create(null);
  6397. var dataKeys = [].concat(
  6398. Object.keys(vm._data || {}),
  6399. Object.keys(vm._computedWatchers || {}));
  6400. dataKeys.reduce(function(ret, key) {
  6401. ret[key] = vm[key];
  6402. return ret
  6403. }, ret);
  6404. // vue-composition-api
  6405. var rawBindings = vm.__secret_vfa_state__ && vm.__secret_vfa_state__.rawBindings;
  6406. if (rawBindings) {
  6407. Object.keys(rawBindings).forEach(function (key) {
  6408. ret[key] = vm[key];
  6409. });
  6410. }
  6411. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  6412. Object.assign(ret, vm.$mp.data || {});
  6413. if (
  6414. Array.isArray(vm.$options.behaviors) &&
  6415. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  6416. ) { //form-field
  6417. ret['name'] = vm.name;
  6418. ret['value'] = vm.value;
  6419. }
  6420. return JSON.parse(JSON.stringify(ret))
  6421. }
  6422. var patch = function(oldVnode, vnode) {
  6423. var this$1 = this;
  6424. if (vnode === null) { //destroy
  6425. return
  6426. }
  6427. if (this.mpType === 'page' || this.mpType === 'component') {
  6428. var mpInstance = this.$scope;
  6429. var data = Object.create(null);
  6430. try {
  6431. data = cloneWithData(this);
  6432. } catch (err) {
  6433. console.error(err);
  6434. }
  6435. data.__webviewId__ = mpInstance.data.__webviewId__;
  6436. var mpData = Object.create(null);
  6437. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  6438. mpData[key] = mpInstance.data[key];
  6439. });
  6440. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  6441. if (Object.keys(diffData).length) {
  6442. if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6443. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  6444. ']差量更新',
  6445. JSON.stringify(diffData));
  6446. }
  6447. this.__next_tick_pending = true;
  6448. mpInstance.setData(diffData, function () {
  6449. this$1.__next_tick_pending = false;
  6450. flushCallbacks$1(this$1);
  6451. });
  6452. } else {
  6453. flushCallbacks$1(this);
  6454. }
  6455. }
  6456. };
  6457. /* */
  6458. function createEmptyRender() {
  6459. }
  6460. function mountComponent$1(
  6461. vm,
  6462. el,
  6463. hydrating
  6464. ) {
  6465. if (!vm.mpType) {//main.js 中的 new Vue
  6466. return vm
  6467. }
  6468. if (vm.mpType === 'app') {
  6469. vm.$options.render = createEmptyRender;
  6470. }
  6471. if (!vm.$options.render) {
  6472. vm.$options.render = createEmptyRender;
  6473. if (true) {
  6474. /* istanbul ignore if */
  6475. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  6476. vm.$options.el || el) {
  6477. warn(
  6478. 'You are using the runtime-only build of Vue where the template ' +
  6479. 'compiler is not available. Either pre-compile the templates into ' +
  6480. 'render functions, or use the compiler-included build.',
  6481. vm
  6482. );
  6483. } else {
  6484. warn(
  6485. 'Failed to mount component: template or render function not defined.',
  6486. vm
  6487. );
  6488. }
  6489. }
  6490. }
  6491. !vm._$fallback && callHook(vm, 'beforeMount');
  6492. var updateComponent = function () {
  6493. vm._update(vm._render(), hydrating);
  6494. };
  6495. // we set this to vm._watcher inside the watcher's constructor
  6496. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  6497. // component's mounted hook), which relies on vm._watcher being already defined
  6498. new Watcher(vm, updateComponent, noop, {
  6499. before: function before() {
  6500. if (vm._isMounted && !vm._isDestroyed) {
  6501. callHook(vm, 'beforeUpdate');
  6502. }
  6503. }
  6504. }, true /* isRenderWatcher */);
  6505. hydrating = false;
  6506. return vm
  6507. }
  6508. /* */
  6509. function renderClass (
  6510. staticClass,
  6511. dynamicClass
  6512. ) {
  6513. if (isDef(staticClass) || isDef(dynamicClass)) {
  6514. return concat(staticClass, stringifyClass(dynamicClass))
  6515. }
  6516. /* istanbul ignore next */
  6517. return ''
  6518. }
  6519. function concat (a, b) {
  6520. return a ? b ? (a + ' ' + b) : a : (b || '')
  6521. }
  6522. function stringifyClass (value) {
  6523. if (Array.isArray(value)) {
  6524. return stringifyArray(value)
  6525. }
  6526. if (isObject(value)) {
  6527. return stringifyObject(value)
  6528. }
  6529. if (typeof value === 'string') {
  6530. return value
  6531. }
  6532. /* istanbul ignore next */
  6533. return ''
  6534. }
  6535. function stringifyArray (value) {
  6536. var res = '';
  6537. var stringified;
  6538. for (var i = 0, l = value.length; i < l; i++) {
  6539. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  6540. if (res) { res += ' '; }
  6541. res += stringified;
  6542. }
  6543. }
  6544. return res
  6545. }
  6546. function stringifyObject (value) {
  6547. var res = '';
  6548. for (var key in value) {
  6549. if (value[key]) {
  6550. if (res) { res += ' '; }
  6551. res += key;
  6552. }
  6553. }
  6554. return res
  6555. }
  6556. /* */
  6557. var parseStyleText = cached(function (cssText) {
  6558. var res = {};
  6559. var listDelimiter = /;(?![^(]*\))/g;
  6560. var propertyDelimiter = /:(.+)/;
  6561. cssText.split(listDelimiter).forEach(function (item) {
  6562. if (item) {
  6563. var tmp = item.split(propertyDelimiter);
  6564. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  6565. }
  6566. });
  6567. return res
  6568. });
  6569. // normalize possible array / string values into Object
  6570. function normalizeStyleBinding (bindingStyle) {
  6571. if (Array.isArray(bindingStyle)) {
  6572. return toObject(bindingStyle)
  6573. }
  6574. if (typeof bindingStyle === 'string') {
  6575. return parseStyleText(bindingStyle)
  6576. }
  6577. return bindingStyle
  6578. }
  6579. /* */
  6580. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  6581. function getTarget(obj, path) {
  6582. var parts = path.split('.');
  6583. var key = parts[0];
  6584. if (key.indexOf('__$n') === 0) { //number index
  6585. key = parseInt(key.replace('__$n', ''));
  6586. }
  6587. if (parts.length === 1) {
  6588. return obj[key]
  6589. }
  6590. return getTarget(obj[key], parts.slice(1).join('.'))
  6591. }
  6592. function internalMixin(Vue) {
  6593. Vue.config.errorHandler = function(err, vm, info) {
  6594. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  6595. console.error(err);
  6596. /* eslint-disable no-undef */
  6597. var app = getApp();
  6598. if (app && app.onError) {
  6599. app.onError(err);
  6600. }
  6601. };
  6602. var oldEmit = Vue.prototype.$emit;
  6603. Vue.prototype.$emit = function(event) {
  6604. if (this.$scope && event) {
  6605. this.$scope['triggerEvent'](event, {
  6606. __args__: toArray(arguments, 1)
  6607. });
  6608. }
  6609. return oldEmit.apply(this, arguments)
  6610. };
  6611. Vue.prototype.$nextTick = function(fn) {
  6612. return nextTick$1(this, fn)
  6613. };
  6614. MP_METHODS.forEach(function (method) {
  6615. Vue.prototype[method] = function(args) {
  6616. if (this.$scope && this.$scope[method]) {
  6617. return this.$scope[method](args)
  6618. }
  6619. // mp-alipay
  6620. if (typeof my === 'undefined') {
  6621. return
  6622. }
  6623. if (method === 'createSelectorQuery') {
  6624. /* eslint-disable no-undef */
  6625. return my.createSelectorQuery(args)
  6626. } else if (method === 'createIntersectionObserver') {
  6627. /* eslint-disable no-undef */
  6628. return my.createIntersectionObserver(args)
  6629. }
  6630. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  6631. };
  6632. });
  6633. Vue.prototype.__init_provide = initProvide;
  6634. Vue.prototype.__init_injections = initInjections;
  6635. Vue.prototype.__call_hook = function(hook, args) {
  6636. var vm = this;
  6637. // #7573 disable dep collection when invoking lifecycle hooks
  6638. pushTarget();
  6639. var handlers = vm.$options[hook];
  6640. var info = hook + " hook";
  6641. var ret;
  6642. if (handlers) {
  6643. for (var i = 0, j = handlers.length; i < j; i++) {
  6644. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  6645. }
  6646. }
  6647. if (vm._hasHookEvent) {
  6648. vm.$emit('hook:' + hook, args);
  6649. }
  6650. popTarget();
  6651. return ret
  6652. };
  6653. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  6654. if (Array.isArray(modifiers)) {
  6655. if (modifiers.indexOf('trim') !== -1) {
  6656. value = value.trim();
  6657. }
  6658. if (modifiers.indexOf('number') !== -1) {
  6659. value = this._n(value);
  6660. }
  6661. }
  6662. if (!target) {
  6663. target = this;
  6664. }
  6665. target[key] = value;
  6666. };
  6667. Vue.prototype.__set_sync = function(target, key, value) {
  6668. if (!target) {
  6669. target = this;
  6670. }
  6671. target[key] = value;
  6672. };
  6673. Vue.prototype.__get_orig = function(item) {
  6674. if (isPlainObject(item)) {
  6675. return item['$orig'] || item
  6676. }
  6677. return item
  6678. };
  6679. Vue.prototype.__get_value = function(dataPath, target) {
  6680. return getTarget(target || this, dataPath)
  6681. };
  6682. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  6683. return renderClass(staticClass, dynamicClass)
  6684. };
  6685. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  6686. if (!dynamicStyle && !staticStyle) {
  6687. return ''
  6688. }
  6689. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  6690. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  6691. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  6692. };
  6693. Vue.prototype.__map = function(val, iteratee) {
  6694. //TODO 暂不考虑 string
  6695. var ret, i, l, keys, key;
  6696. if (Array.isArray(val)) {
  6697. ret = new Array(val.length);
  6698. for (i = 0, l = val.length; i < l; i++) {
  6699. ret[i] = iteratee(val[i], i);
  6700. }
  6701. return ret
  6702. } else if (isObject(val)) {
  6703. keys = Object.keys(val);
  6704. ret = Object.create(null);
  6705. for (i = 0, l = keys.length; i < l; i++) {
  6706. key = keys[i];
  6707. ret[key] = iteratee(val[key], key, i);
  6708. }
  6709. return ret
  6710. } else if (typeof val === 'number') {
  6711. ret = new Array(val);
  6712. for (i = 0, l = val; i < l; i++) {
  6713. // 第一个参数暂时仍和小程序一致
  6714. ret[i] = iteratee(i, i);
  6715. }
  6716. return ret
  6717. }
  6718. return []
  6719. };
  6720. }
  6721. /* */
  6722. var LIFECYCLE_HOOKS$1 = [
  6723. //App
  6724. 'onLaunch',
  6725. 'onShow',
  6726. 'onHide',
  6727. 'onUniNViewMessage',
  6728. 'onPageNotFound',
  6729. 'onThemeChange',
  6730. 'onError',
  6731. 'onUnhandledRejection',
  6732. //Page
  6733. 'onLoad',
  6734. // 'onShow',
  6735. 'onReady',
  6736. // 'onHide',
  6737. 'onUnload',
  6738. 'onPullDownRefresh',
  6739. 'onReachBottom',
  6740. 'onTabItemTap',
  6741. 'onAddToFavorites',
  6742. 'onShareTimeline',
  6743. 'onShareAppMessage',
  6744. 'onResize',
  6745. 'onPageScroll',
  6746. 'onNavigationBarButtonTap',
  6747. 'onBackPress',
  6748. 'onNavigationBarSearchInputChanged',
  6749. 'onNavigationBarSearchInputConfirmed',
  6750. 'onNavigationBarSearchInputClicked',
  6751. //Component
  6752. // 'onReady', // 兼容旧版本,应该移除该事件
  6753. 'onPageShow',
  6754. 'onPageHide',
  6755. 'onPageResize'
  6756. ];
  6757. function lifecycleMixin$1(Vue) {
  6758. //fixed vue-class-component
  6759. var oldExtend = Vue.extend;
  6760. Vue.extend = function(extendOptions) {
  6761. extendOptions = extendOptions || {};
  6762. var methods = extendOptions.methods;
  6763. if (methods) {
  6764. Object.keys(methods).forEach(function (methodName) {
  6765. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  6766. extendOptions[methodName] = methods[methodName];
  6767. delete methods[methodName];
  6768. }
  6769. });
  6770. }
  6771. return oldExtend.call(this, extendOptions)
  6772. };
  6773. var strategies = Vue.config.optionMergeStrategies;
  6774. var mergeHook = strategies.created;
  6775. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  6776. strategies[hook] = mergeHook;
  6777. });
  6778. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  6779. }
  6780. /* */
  6781. // install platform patch function
  6782. Vue.prototype.__patch__ = patch;
  6783. // public mount method
  6784. Vue.prototype.$mount = function(
  6785. el ,
  6786. hydrating
  6787. ) {
  6788. return mountComponent$1(this, el, hydrating)
  6789. };
  6790. lifecycleMixin$1(Vue);
  6791. internalMixin(Vue);
  6792. /* */
  6793. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  6794. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  6795. /***/ }),
  6796. /* 3 */
  6797. /*!***********************************!*\
  6798. !*** (webpack)/buildin/global.js ***!
  6799. \***********************************/
  6800. /*! no static exports found */
  6801. /***/ (function(module, exports) {
  6802. var g;
  6803. // This works in non-strict mode
  6804. g = (function() {
  6805. return this;
  6806. })();
  6807. try {
  6808. // This works if eval is allowed (see CSP)
  6809. g = g || new Function("return this")();
  6810. } catch (e) {
  6811. // This works if the window reference is available
  6812. if (typeof window === "object") g = window;
  6813. }
  6814. // g can still be undefined, but nothing to do about it...
  6815. // We return undefined, instead of nothing here, so it's
  6816. // easier to handle this case. if(!global) { ...}
  6817. module.exports = g;
  6818. /***/ }),
  6819. /* 4 */
  6820. /*!*************************************!*\
  6821. !*** D:/wwwroot/HDhotel/pages.json ***!
  6822. \*************************************/
  6823. /*! no static exports found */
  6824. /***/ (function(module, exports) {
  6825. /***/ }),
  6826. /* 5 */,
  6827. /* 6 */,
  6828. /* 7 */,
  6829. /* 8 */,
  6830. /* 9 */,
  6831. /* 10 */
  6832. /*!**********************************************************************************************************!*\
  6833. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  6834. \**********************************************************************************************************/
  6835. /*! exports provided: default */
  6836. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  6837. "use strict";
  6838. __webpack_require__.r(__webpack_exports__);
  6839. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  6840. /* globals __VUE_SSR_CONTEXT__ */
  6841. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  6842. // This module is a runtime utility for cleaner component module output and will
  6843. // be included in the final webpack user bundle.
  6844. function normalizeComponent (
  6845. scriptExports,
  6846. render,
  6847. staticRenderFns,
  6848. functionalTemplate,
  6849. injectStyles,
  6850. scopeId,
  6851. moduleIdentifier, /* server only */
  6852. shadowMode, /* vue-cli only */
  6853. components, // fixed by xxxxxx auto components
  6854. renderjs // fixed by xxxxxx renderjs
  6855. ) {
  6856. // Vue.extend constructor export interop
  6857. var options = typeof scriptExports === 'function'
  6858. ? scriptExports.options
  6859. : scriptExports
  6860. // fixed by xxxxxx auto components
  6861. if (components) {
  6862. if (!options.components) {
  6863. options.components = {}
  6864. }
  6865. var hasOwn = Object.prototype.hasOwnProperty
  6866. for (var name in components) {
  6867. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  6868. options.components[name] = components[name]
  6869. }
  6870. }
  6871. }
  6872. // fixed by xxxxxx renderjs
  6873. if (renderjs) {
  6874. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  6875. this[renderjs.__module] = this
  6876. });
  6877. (options.mixins || (options.mixins = [])).push(renderjs)
  6878. }
  6879. // render functions
  6880. if (render) {
  6881. options.render = render
  6882. options.staticRenderFns = staticRenderFns
  6883. options._compiled = true
  6884. }
  6885. // functional template
  6886. if (functionalTemplate) {
  6887. options.functional = true
  6888. }
  6889. // scopedId
  6890. if (scopeId) {
  6891. options._scopeId = 'data-v-' + scopeId
  6892. }
  6893. var hook
  6894. if (moduleIdentifier) { // server build
  6895. hook = function (context) {
  6896. // 2.3 injection
  6897. context =
  6898. context || // cached call
  6899. (this.$vnode && this.$vnode.ssrContext) || // stateful
  6900. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  6901. // 2.2 with runInNewContext: true
  6902. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  6903. context = __VUE_SSR_CONTEXT__
  6904. }
  6905. // inject component styles
  6906. if (injectStyles) {
  6907. injectStyles.call(this, context)
  6908. }
  6909. // register component module identifier for async chunk inferrence
  6910. if (context && context._registeredComponents) {
  6911. context._registeredComponents.add(moduleIdentifier)
  6912. }
  6913. }
  6914. // used by ssr in case component is cached and beforeCreate
  6915. // never gets called
  6916. options._ssrRegister = hook
  6917. } else if (injectStyles) {
  6918. hook = shadowMode
  6919. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  6920. : injectStyles
  6921. }
  6922. if (hook) {
  6923. if (options.functional) {
  6924. // for template-only hot-reload because in that case the render fn doesn't
  6925. // go through the normalizer
  6926. options._injectStyles = hook
  6927. // register for functioal component in vue file
  6928. var originalRender = options.render
  6929. options.render = function renderWithStyleInjection (h, context) {
  6930. hook.call(context)
  6931. return originalRender(h, context)
  6932. }
  6933. } else {
  6934. // inject component registration as beforeCreate hook
  6935. var existing = options.beforeCreate
  6936. options.beforeCreate = existing
  6937. ? [].concat(existing, hook)
  6938. : [hook]
  6939. }
  6940. }
  6941. return {
  6942. exports: scriptExports,
  6943. options: options
  6944. }
  6945. }
  6946. /***/ }),
  6947. /* 11 */
  6948. /*!*******************************************!*\
  6949. !*** D:/wwwroot/HDhotel/config/config.js ***!
  6950. \*******************************************/
  6951. /*! no static exports found */
  6952. /***/ (function(module, exports, __webpack_require__) {
  6953. "use strict";
  6954. Object.defineProperty(exports, "__esModule", { value: true });exports.config = void 0;var config = {
  6955. //dev
  6956. apiBaseurl: 'http://im.t.phpim.cn/', //测试
  6957. loginUrl: 'http://ht.t.phpim.cn?backpage=http://tanhuiapp.hongweisoft.com/#/pages/index/index', //登录后跳转到测试链接
  6958. // 密码授权令牌
  6959. client_id: 4,
  6960. client_secret: 'jO1XHQu0GytEdxJzNRFwcIeWmS57yCMBuA5P9yDo'
  6961. //online 线上地址
  6962. // apiBaseurl:'http://hd.phpim.cn/',//线上
  6963. //gloab 全局
  6964. // imgUrl:"http://qny.gzsdtfp.com/",
  6965. };exports.config = config;
  6966. /***/ }),
  6967. /* 12 */
  6968. /*!*****************************************!*\
  6969. !*** D:/wwwroot/HDhotel/store/index.js ***!
  6970. \*****************************************/
  6971. /*! no static exports found */
  6972. /***/ (function(module, exports, __webpack_require__) {
  6973. "use strict";
  6974. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
  6975. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 13));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  6976. _vue.default.use(_vuex.default);
  6977. var store = new _vuex.default.Store({
  6978. state: {
  6979. hasLogin: false,
  6980. token: '',
  6981. userInfo: {} },
  6982. mutations: {
  6983. setLogin: function setLogin(state, userInfo) {
  6984. // console.log('userInfo',userInfo);
  6985. // state.userInfo = userInfo.wechatUserInfo || {}
  6986. state.token = userInfo.access_token;
  6987. state.hasLogin = Boolean(state.token);
  6988. console.log(state);
  6989. // uni.setStorage({
  6990. // key: "userInfo",
  6991. // data: userInfo.wechatUserInfo
  6992. // })
  6993. uni.setStorage({
  6994. key: "hasLogin",
  6995. data: true });
  6996. uni.setStorage({
  6997. key: "token",
  6998. data: userInfo.access_token });
  6999. },
  7000. logout: function logout(state) {
  7001. userInfo = {};
  7002. hasLogin: false,
  7003. uni.removeStorage({
  7004. key: "userInfo" });
  7005. } },
  7006. actions: {} });var _default =
  7007. store;exports.default = _default;
  7008. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  7009. /***/ }),
  7010. /* 13 */
  7011. /*!********************************************!*\
  7012. !*** ./node_modules/vuex/dist/vuex.esm.js ***!
  7013. \********************************************/
  7014. /*! exports provided: Store, install, mapState, mapMutations, mapGetters, mapActions, createNamespacedHelpers, default */
  7015. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7016. "use strict";
  7017. __webpack_require__.r(__webpack_exports__);
  7018. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Store", function() { return Store; });
  7019. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "install", function() { return install; });
  7020. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapState", function() { return mapState; });
  7021. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapMutations", function() { return mapMutations; });
  7022. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapGetters", function() { return mapGetters; });
  7023. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapActions", function() { return mapActions; });
  7024. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNamespacedHelpers", function() { return createNamespacedHelpers; });
  7025. /**
  7026. * vuex v3.0.1
  7027. * (c) 2017 Evan You
  7028. * @license MIT
  7029. */
  7030. var applyMixin = function (Vue) {
  7031. var version = Number(Vue.version.split('.')[0]);
  7032. if (version >= 2) {
  7033. Vue.mixin({ beforeCreate: vuexInit });
  7034. } else {
  7035. // override init and inject vuex init procedure
  7036. // for 1.x backwards compatibility.
  7037. var _init = Vue.prototype._init;
  7038. Vue.prototype._init = function (options) {
  7039. if ( options === void 0 ) options = {};
  7040. options.init = options.init
  7041. ? [vuexInit].concat(options.init)
  7042. : vuexInit;
  7043. _init.call(this, options);
  7044. };
  7045. }
  7046. /**
  7047. * Vuex init hook, injected into each instances init hooks list.
  7048. */
  7049. function vuexInit () {
  7050. var options = this.$options;
  7051. // store injection
  7052. if (options.store) {
  7053. this.$store = typeof options.store === 'function'
  7054. ? options.store()
  7055. : options.store;
  7056. } else if (options.parent && options.parent.$store) {
  7057. this.$store = options.parent.$store;
  7058. }
  7059. }
  7060. };
  7061. var devtoolHook =
  7062. typeof window !== 'undefined' &&
  7063. window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  7064. function devtoolPlugin (store) {
  7065. if (!devtoolHook) { return }
  7066. store._devtoolHook = devtoolHook;
  7067. devtoolHook.emit('vuex:init', store);
  7068. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  7069. store.replaceState(targetState);
  7070. });
  7071. store.subscribe(function (mutation, state) {
  7072. devtoolHook.emit('vuex:mutation', mutation, state);
  7073. });
  7074. }
  7075. /**
  7076. * Get the first item that pass the test
  7077. * by second argument function
  7078. *
  7079. * @param {Array} list
  7080. * @param {Function} f
  7081. * @return {*}
  7082. */
  7083. /**
  7084. * Deep copy the given object considering circular structure.
  7085. * This function caches all nested objects and its copies.
  7086. * If it detects circular structure, use cached copy to avoid infinite loop.
  7087. *
  7088. * @param {*} obj
  7089. * @param {Array<Object>} cache
  7090. * @return {*}
  7091. */
  7092. /**
  7093. * forEach for object
  7094. */
  7095. function forEachValue (obj, fn) {
  7096. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  7097. }
  7098. function isObject (obj) {
  7099. return obj !== null && typeof obj === 'object'
  7100. }
  7101. function isPromise (val) {
  7102. return val && typeof val.then === 'function'
  7103. }
  7104. function assert (condition, msg) {
  7105. if (!condition) { throw new Error(("[vuex] " + msg)) }
  7106. }
  7107. var Module = function Module (rawModule, runtime) {
  7108. this.runtime = runtime;
  7109. this._children = Object.create(null);
  7110. this._rawModule = rawModule;
  7111. var rawState = rawModule.state;
  7112. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  7113. };
  7114. var prototypeAccessors$1 = { namespaced: { configurable: true } };
  7115. prototypeAccessors$1.namespaced.get = function () {
  7116. return !!this._rawModule.namespaced
  7117. };
  7118. Module.prototype.addChild = function addChild (key, module) {
  7119. this._children[key] = module;
  7120. };
  7121. Module.prototype.removeChild = function removeChild (key) {
  7122. delete this._children[key];
  7123. };
  7124. Module.prototype.getChild = function getChild (key) {
  7125. return this._children[key]
  7126. };
  7127. Module.prototype.update = function update (rawModule) {
  7128. this._rawModule.namespaced = rawModule.namespaced;
  7129. if (rawModule.actions) {
  7130. this._rawModule.actions = rawModule.actions;
  7131. }
  7132. if (rawModule.mutations) {
  7133. this._rawModule.mutations = rawModule.mutations;
  7134. }
  7135. if (rawModule.getters) {
  7136. this._rawModule.getters = rawModule.getters;
  7137. }
  7138. };
  7139. Module.prototype.forEachChild = function forEachChild (fn) {
  7140. forEachValue(this._children, fn);
  7141. };
  7142. Module.prototype.forEachGetter = function forEachGetter (fn) {
  7143. if (this._rawModule.getters) {
  7144. forEachValue(this._rawModule.getters, fn);
  7145. }
  7146. };
  7147. Module.prototype.forEachAction = function forEachAction (fn) {
  7148. if (this._rawModule.actions) {
  7149. forEachValue(this._rawModule.actions, fn);
  7150. }
  7151. };
  7152. Module.prototype.forEachMutation = function forEachMutation (fn) {
  7153. if (this._rawModule.mutations) {
  7154. forEachValue(this._rawModule.mutations, fn);
  7155. }
  7156. };
  7157. Object.defineProperties( Module.prototype, prototypeAccessors$1 );
  7158. var ModuleCollection = function ModuleCollection (rawRootModule) {
  7159. // register root module (Vuex.Store options)
  7160. this.register([], rawRootModule, false);
  7161. };
  7162. ModuleCollection.prototype.get = function get (path) {
  7163. return path.reduce(function (module, key) {
  7164. return module.getChild(key)
  7165. }, this.root)
  7166. };
  7167. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  7168. var module = this.root;
  7169. return path.reduce(function (namespace, key) {
  7170. module = module.getChild(key);
  7171. return namespace + (module.namespaced ? key + '/' : '')
  7172. }, '')
  7173. };
  7174. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  7175. update([], this.root, rawRootModule);
  7176. };
  7177. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  7178. var this$1 = this;
  7179. if ( runtime === void 0 ) runtime = true;
  7180. if (true) {
  7181. assertRawModule(path, rawModule);
  7182. }
  7183. var newModule = new Module(rawModule, runtime);
  7184. if (path.length === 0) {
  7185. this.root = newModule;
  7186. } else {
  7187. var parent = this.get(path.slice(0, -1));
  7188. parent.addChild(path[path.length - 1], newModule);
  7189. }
  7190. // register nested modules
  7191. if (rawModule.modules) {
  7192. forEachValue(rawModule.modules, function (rawChildModule, key) {
  7193. this$1.register(path.concat(key), rawChildModule, runtime);
  7194. });
  7195. }
  7196. };
  7197. ModuleCollection.prototype.unregister = function unregister (path) {
  7198. var parent = this.get(path.slice(0, -1));
  7199. var key = path[path.length - 1];
  7200. if (!parent.getChild(key).runtime) { return }
  7201. parent.removeChild(key);
  7202. };
  7203. function update (path, targetModule, newModule) {
  7204. if (true) {
  7205. assertRawModule(path, newModule);
  7206. }
  7207. // update target module
  7208. targetModule.update(newModule);
  7209. // update nested modules
  7210. if (newModule.modules) {
  7211. for (var key in newModule.modules) {
  7212. if (!targetModule.getChild(key)) {
  7213. if (true) {
  7214. console.warn(
  7215. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  7216. 'manual reload is needed'
  7217. );
  7218. }
  7219. return
  7220. }
  7221. update(
  7222. path.concat(key),
  7223. targetModule.getChild(key),
  7224. newModule.modules[key]
  7225. );
  7226. }
  7227. }
  7228. }
  7229. var functionAssert = {
  7230. assert: function (value) { return typeof value === 'function'; },
  7231. expected: 'function'
  7232. };
  7233. var objectAssert = {
  7234. assert: function (value) { return typeof value === 'function' ||
  7235. (typeof value === 'object' && typeof value.handler === 'function'); },
  7236. expected: 'function or object with "handler" function'
  7237. };
  7238. var assertTypes = {
  7239. getters: functionAssert,
  7240. mutations: functionAssert,
  7241. actions: objectAssert
  7242. };
  7243. function assertRawModule (path, rawModule) {
  7244. Object.keys(assertTypes).forEach(function (key) {
  7245. if (!rawModule[key]) { return }
  7246. var assertOptions = assertTypes[key];
  7247. forEachValue(rawModule[key], function (value, type) {
  7248. assert(
  7249. assertOptions.assert(value),
  7250. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  7251. );
  7252. });
  7253. });
  7254. }
  7255. function makeAssertionMessage (path, key, type, value, expected) {
  7256. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  7257. if (path.length > 0) {
  7258. buf += " in module \"" + (path.join('.')) + "\"";
  7259. }
  7260. buf += " is " + (JSON.stringify(value)) + ".";
  7261. return buf
  7262. }
  7263. var Vue; // bind on install
  7264. var Store = function Store (options) {
  7265. var this$1 = this;
  7266. if ( options === void 0 ) options = {};
  7267. // Auto install if it is not done yet and `window` has `Vue`.
  7268. // To allow users to avoid auto-installation in some cases,
  7269. // this code should be placed here. See #731
  7270. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  7271. install(window.Vue);
  7272. }
  7273. if (true) {
  7274. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  7275. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  7276. assert(this instanceof Store, "Store must be called with the new operator.");
  7277. }
  7278. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  7279. var strict = options.strict; if ( strict === void 0 ) strict = false;
  7280. var state = options.state; if ( state === void 0 ) state = {};
  7281. if (typeof state === 'function') {
  7282. state = state() || {};
  7283. }
  7284. // store internal state
  7285. this._committing = false;
  7286. this._actions = Object.create(null);
  7287. this._actionSubscribers = [];
  7288. this._mutations = Object.create(null);
  7289. this._wrappedGetters = Object.create(null);
  7290. this._modules = new ModuleCollection(options);
  7291. this._modulesNamespaceMap = Object.create(null);
  7292. this._subscribers = [];
  7293. this._watcherVM = new Vue();
  7294. // bind commit and dispatch to self
  7295. var store = this;
  7296. var ref = this;
  7297. var dispatch = ref.dispatch;
  7298. var commit = ref.commit;
  7299. this.dispatch = function boundDispatch (type, payload) {
  7300. return dispatch.call(store, type, payload)
  7301. };
  7302. this.commit = function boundCommit (type, payload, options) {
  7303. return commit.call(store, type, payload, options)
  7304. };
  7305. // strict mode
  7306. this.strict = strict;
  7307. // init root module.
  7308. // this also recursively registers all sub-modules
  7309. // and collects all module getters inside this._wrappedGetters
  7310. installModule(this, state, [], this._modules.root);
  7311. // initialize the store vm, which is responsible for the reactivity
  7312. // (also registers _wrappedGetters as computed properties)
  7313. resetStoreVM(this, state);
  7314. // apply plugins
  7315. plugins.forEach(function (plugin) { return plugin(this$1); });
  7316. if (Vue.config.devtools) {
  7317. devtoolPlugin(this);
  7318. }
  7319. };
  7320. var prototypeAccessors = { state: { configurable: true } };
  7321. prototypeAccessors.state.get = function () {
  7322. return this._vm._data.$$state
  7323. };
  7324. prototypeAccessors.state.set = function (v) {
  7325. if (true) {
  7326. assert(false, "Use store.replaceState() to explicit replace store state.");
  7327. }
  7328. };
  7329. Store.prototype.commit = function commit (_type, _payload, _options) {
  7330. var this$1 = this;
  7331. // check object-style commit
  7332. var ref = unifyObjectStyle(_type, _payload, _options);
  7333. var type = ref.type;
  7334. var payload = ref.payload;
  7335. var options = ref.options;
  7336. var mutation = { type: type, payload: payload };
  7337. var entry = this._mutations[type];
  7338. if (!entry) {
  7339. if (true) {
  7340. console.error(("[vuex] unknown mutation type: " + type));
  7341. }
  7342. return
  7343. }
  7344. this._withCommit(function () {
  7345. entry.forEach(function commitIterator (handler) {
  7346. handler(payload);
  7347. });
  7348. });
  7349. this._subscribers.forEach(function (sub) { return sub(mutation, this$1.state); });
  7350. if (
  7351. true &&
  7352. options && options.silent
  7353. ) {
  7354. console.warn(
  7355. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  7356. 'Use the filter functionality in the vue-devtools'
  7357. );
  7358. }
  7359. };
  7360. Store.prototype.dispatch = function dispatch (_type, _payload) {
  7361. var this$1 = this;
  7362. // check object-style dispatch
  7363. var ref = unifyObjectStyle(_type, _payload);
  7364. var type = ref.type;
  7365. var payload = ref.payload;
  7366. var action = { type: type, payload: payload };
  7367. var entry = this._actions[type];
  7368. if (!entry) {
  7369. if (true) {
  7370. console.error(("[vuex] unknown action type: " + type));
  7371. }
  7372. return
  7373. }
  7374. this._actionSubscribers.forEach(function (sub) { return sub(action, this$1.state); });
  7375. return entry.length > 1
  7376. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  7377. : entry[0](payload)
  7378. };
  7379. Store.prototype.subscribe = function subscribe (fn) {
  7380. return genericSubscribe(fn, this._subscribers)
  7381. };
  7382. Store.prototype.subscribeAction = function subscribeAction (fn) {
  7383. return genericSubscribe(fn, this._actionSubscribers)
  7384. };
  7385. Store.prototype.watch = function watch (getter, cb, options) {
  7386. var this$1 = this;
  7387. if (true) {
  7388. assert(typeof getter === 'function', "store.watch only accepts a function.");
  7389. }
  7390. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  7391. };
  7392. Store.prototype.replaceState = function replaceState (state) {
  7393. var this$1 = this;
  7394. this._withCommit(function () {
  7395. this$1._vm._data.$$state = state;
  7396. });
  7397. };
  7398. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  7399. if ( options === void 0 ) options = {};
  7400. if (typeof path === 'string') { path = [path]; }
  7401. if (true) {
  7402. assert(Array.isArray(path), "module path must be a string or an Array.");
  7403. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  7404. }
  7405. this._modules.register(path, rawModule);
  7406. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  7407. // reset store to update getters...
  7408. resetStoreVM(this, this.state);
  7409. };
  7410. Store.prototype.unregisterModule = function unregisterModule (path) {
  7411. var this$1 = this;
  7412. if (typeof path === 'string') { path = [path]; }
  7413. if (true) {
  7414. assert(Array.isArray(path), "module path must be a string or an Array.");
  7415. }
  7416. this._modules.unregister(path);
  7417. this._withCommit(function () {
  7418. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  7419. Vue.delete(parentState, path[path.length - 1]);
  7420. });
  7421. resetStore(this);
  7422. };
  7423. Store.prototype.hotUpdate = function hotUpdate (newOptions) {
  7424. this._modules.update(newOptions);
  7425. resetStore(this, true);
  7426. };
  7427. Store.prototype._withCommit = function _withCommit (fn) {
  7428. var committing = this._committing;
  7429. this._committing = true;
  7430. fn();
  7431. this._committing = committing;
  7432. };
  7433. Object.defineProperties( Store.prototype, prototypeAccessors );
  7434. function genericSubscribe (fn, subs) {
  7435. if (subs.indexOf(fn) < 0) {
  7436. subs.push(fn);
  7437. }
  7438. return function () {
  7439. var i = subs.indexOf(fn);
  7440. if (i > -1) {
  7441. subs.splice(i, 1);
  7442. }
  7443. }
  7444. }
  7445. function resetStore (store, hot) {
  7446. store._actions = Object.create(null);
  7447. store._mutations = Object.create(null);
  7448. store._wrappedGetters = Object.create(null);
  7449. store._modulesNamespaceMap = Object.create(null);
  7450. var state = store.state;
  7451. // init all modules
  7452. installModule(store, state, [], store._modules.root, true);
  7453. // reset vm
  7454. resetStoreVM(store, state, hot);
  7455. }
  7456. function resetStoreVM (store, state, hot) {
  7457. var oldVm = store._vm;
  7458. // bind store public getters
  7459. store.getters = {};
  7460. var wrappedGetters = store._wrappedGetters;
  7461. var computed = {};
  7462. forEachValue(wrappedGetters, function (fn, key) {
  7463. // use computed to leverage its lazy-caching mechanism
  7464. computed[key] = function () { return fn(store); };
  7465. Object.defineProperty(store.getters, key, {
  7466. get: function () { return store._vm[key]; },
  7467. enumerable: true // for local getters
  7468. });
  7469. });
  7470. // use a Vue instance to store the state tree
  7471. // suppress warnings just in case the user has added
  7472. // some funky global mixins
  7473. var silent = Vue.config.silent;
  7474. Vue.config.silent = true;
  7475. store._vm = new Vue({
  7476. data: {
  7477. $$state: state
  7478. },
  7479. computed: computed
  7480. });
  7481. Vue.config.silent = silent;
  7482. // enable strict mode for new vm
  7483. if (store.strict) {
  7484. enableStrictMode(store);
  7485. }
  7486. if (oldVm) {
  7487. if (hot) {
  7488. // dispatch changes in all subscribed watchers
  7489. // to force getter re-evaluation for hot reloading.
  7490. store._withCommit(function () {
  7491. oldVm._data.$$state = null;
  7492. });
  7493. }
  7494. Vue.nextTick(function () { return oldVm.$destroy(); });
  7495. }
  7496. }
  7497. function installModule (store, rootState, path, module, hot) {
  7498. var isRoot = !path.length;
  7499. var namespace = store._modules.getNamespace(path);
  7500. // register in namespace map
  7501. if (module.namespaced) {
  7502. store._modulesNamespaceMap[namespace] = module;
  7503. }
  7504. // set state
  7505. if (!isRoot && !hot) {
  7506. var parentState = getNestedState(rootState, path.slice(0, -1));
  7507. var moduleName = path[path.length - 1];
  7508. store._withCommit(function () {
  7509. Vue.set(parentState, moduleName, module.state);
  7510. });
  7511. }
  7512. var local = module.context = makeLocalContext(store, namespace, path);
  7513. module.forEachMutation(function (mutation, key) {
  7514. var namespacedType = namespace + key;
  7515. registerMutation(store, namespacedType, mutation, local);
  7516. });
  7517. module.forEachAction(function (action, key) {
  7518. var type = action.root ? key : namespace + key;
  7519. var handler = action.handler || action;
  7520. registerAction(store, type, handler, local);
  7521. });
  7522. module.forEachGetter(function (getter, key) {
  7523. var namespacedType = namespace + key;
  7524. registerGetter(store, namespacedType, getter, local);
  7525. });
  7526. module.forEachChild(function (child, key) {
  7527. installModule(store, rootState, path.concat(key), child, hot);
  7528. });
  7529. }
  7530. /**
  7531. * make localized dispatch, commit, getters and state
  7532. * if there is no namespace, just use root ones
  7533. */
  7534. function makeLocalContext (store, namespace, path) {
  7535. var noNamespace = namespace === '';
  7536. var local = {
  7537. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  7538. var args = unifyObjectStyle(_type, _payload, _options);
  7539. var payload = args.payload;
  7540. var options = args.options;
  7541. var type = args.type;
  7542. if (!options || !options.root) {
  7543. type = namespace + type;
  7544. if ( true && !store._actions[type]) {
  7545. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  7546. return
  7547. }
  7548. }
  7549. return store.dispatch(type, payload)
  7550. },
  7551. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  7552. var args = unifyObjectStyle(_type, _payload, _options);
  7553. var payload = args.payload;
  7554. var options = args.options;
  7555. var type = args.type;
  7556. if (!options || !options.root) {
  7557. type = namespace + type;
  7558. if ( true && !store._mutations[type]) {
  7559. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  7560. return
  7561. }
  7562. }
  7563. store.commit(type, payload, options);
  7564. }
  7565. };
  7566. // getters and state object must be gotten lazily
  7567. // because they will be changed by vm update
  7568. Object.defineProperties(local, {
  7569. getters: {
  7570. get: noNamespace
  7571. ? function () { return store.getters; }
  7572. : function () { return makeLocalGetters(store, namespace); }
  7573. },
  7574. state: {
  7575. get: function () { return getNestedState(store.state, path); }
  7576. }
  7577. });
  7578. return local
  7579. }
  7580. function makeLocalGetters (store, namespace) {
  7581. var gettersProxy = {};
  7582. var splitPos = namespace.length;
  7583. Object.keys(store.getters).forEach(function (type) {
  7584. // skip if the target getter is not match this namespace
  7585. if (type.slice(0, splitPos) !== namespace) { return }
  7586. // extract local getter type
  7587. var localType = type.slice(splitPos);
  7588. // Add a port to the getters proxy.
  7589. // Define as getter property because
  7590. // we do not want to evaluate the getters in this time.
  7591. Object.defineProperty(gettersProxy, localType, {
  7592. get: function () { return store.getters[type]; },
  7593. enumerable: true
  7594. });
  7595. });
  7596. return gettersProxy
  7597. }
  7598. function registerMutation (store, type, handler, local) {
  7599. var entry = store._mutations[type] || (store._mutations[type] = []);
  7600. entry.push(function wrappedMutationHandler (payload) {
  7601. handler.call(store, local.state, payload);
  7602. });
  7603. }
  7604. function registerAction (store, type, handler, local) {
  7605. var entry = store._actions[type] || (store._actions[type] = []);
  7606. entry.push(function wrappedActionHandler (payload, cb) {
  7607. var res = handler.call(store, {
  7608. dispatch: local.dispatch,
  7609. commit: local.commit,
  7610. getters: local.getters,
  7611. state: local.state,
  7612. rootGetters: store.getters,
  7613. rootState: store.state
  7614. }, payload, cb);
  7615. if (!isPromise(res)) {
  7616. res = Promise.resolve(res);
  7617. }
  7618. if (store._devtoolHook) {
  7619. return res.catch(function (err) {
  7620. store._devtoolHook.emit('vuex:error', err);
  7621. throw err
  7622. })
  7623. } else {
  7624. return res
  7625. }
  7626. });
  7627. }
  7628. function registerGetter (store, type, rawGetter, local) {
  7629. if (store._wrappedGetters[type]) {
  7630. if (true) {
  7631. console.error(("[vuex] duplicate getter key: " + type));
  7632. }
  7633. return
  7634. }
  7635. store._wrappedGetters[type] = function wrappedGetter (store) {
  7636. return rawGetter(
  7637. local.state, // local state
  7638. local.getters, // local getters
  7639. store.state, // root state
  7640. store.getters // root getters
  7641. )
  7642. };
  7643. }
  7644. function enableStrictMode (store) {
  7645. store._vm.$watch(function () { return this._data.$$state }, function () {
  7646. if (true) {
  7647. assert(store._committing, "Do not mutate vuex store state outside mutation handlers.");
  7648. }
  7649. }, { deep: true, sync: true });
  7650. }
  7651. function getNestedState (state, path) {
  7652. return path.length
  7653. ? path.reduce(function (state, key) { return state[key]; }, state)
  7654. : state
  7655. }
  7656. function unifyObjectStyle (type, payload, options) {
  7657. if (isObject(type) && type.type) {
  7658. options = payload;
  7659. payload = type;
  7660. type = type.type;
  7661. }
  7662. if (true) {
  7663. assert(typeof type === 'string', ("Expects string as the type, but found " + (typeof type) + "."));
  7664. }
  7665. return { type: type, payload: payload, options: options }
  7666. }
  7667. function install (_Vue) {
  7668. if (Vue && _Vue === Vue) {
  7669. if (true) {
  7670. console.error(
  7671. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  7672. );
  7673. }
  7674. return
  7675. }
  7676. Vue = _Vue;
  7677. applyMixin(Vue);
  7678. }
  7679. var mapState = normalizeNamespace(function (namespace, states) {
  7680. var res = {};
  7681. normalizeMap(states).forEach(function (ref) {
  7682. var key = ref.key;
  7683. var val = ref.val;
  7684. res[key] = function mappedState () {
  7685. var state = this.$store.state;
  7686. var getters = this.$store.getters;
  7687. if (namespace) {
  7688. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  7689. if (!module) {
  7690. return
  7691. }
  7692. state = module.context.state;
  7693. getters = module.context.getters;
  7694. }
  7695. return typeof val === 'function'
  7696. ? val.call(this, state, getters)
  7697. : state[val]
  7698. };
  7699. // mark vuex getter for devtools
  7700. res[key].vuex = true;
  7701. });
  7702. return res
  7703. });
  7704. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  7705. var res = {};
  7706. normalizeMap(mutations).forEach(function (ref) {
  7707. var key = ref.key;
  7708. var val = ref.val;
  7709. res[key] = function mappedMutation () {
  7710. var args = [], len = arguments.length;
  7711. while ( len-- ) args[ len ] = arguments[ len ];
  7712. var commit = this.$store.commit;
  7713. if (namespace) {
  7714. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  7715. if (!module) {
  7716. return
  7717. }
  7718. commit = module.context.commit;
  7719. }
  7720. return typeof val === 'function'
  7721. ? val.apply(this, [commit].concat(args))
  7722. : commit.apply(this.$store, [val].concat(args))
  7723. };
  7724. });
  7725. return res
  7726. });
  7727. var mapGetters = normalizeNamespace(function (namespace, getters) {
  7728. var res = {};
  7729. normalizeMap(getters).forEach(function (ref) {
  7730. var key = ref.key;
  7731. var val = ref.val;
  7732. val = namespace + val;
  7733. res[key] = function mappedGetter () {
  7734. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  7735. return
  7736. }
  7737. if ( true && !(val in this.$store.getters)) {
  7738. console.error(("[vuex] unknown getter: " + val));
  7739. return
  7740. }
  7741. return this.$store.getters[val]
  7742. };
  7743. // mark vuex getter for devtools
  7744. res[key].vuex = true;
  7745. });
  7746. return res
  7747. });
  7748. var mapActions = normalizeNamespace(function (namespace, actions) {
  7749. var res = {};
  7750. normalizeMap(actions).forEach(function (ref) {
  7751. var key = ref.key;
  7752. var val = ref.val;
  7753. res[key] = function mappedAction () {
  7754. var args = [], len = arguments.length;
  7755. while ( len-- ) args[ len ] = arguments[ len ];
  7756. var dispatch = this.$store.dispatch;
  7757. if (namespace) {
  7758. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  7759. if (!module) {
  7760. return
  7761. }
  7762. dispatch = module.context.dispatch;
  7763. }
  7764. return typeof val === 'function'
  7765. ? val.apply(this, [dispatch].concat(args))
  7766. : dispatch.apply(this.$store, [val].concat(args))
  7767. };
  7768. });
  7769. return res
  7770. });
  7771. var createNamespacedHelpers = function (namespace) { return ({
  7772. mapState: mapState.bind(null, namespace),
  7773. mapGetters: mapGetters.bind(null, namespace),
  7774. mapMutations: mapMutations.bind(null, namespace),
  7775. mapActions: mapActions.bind(null, namespace)
  7776. }); };
  7777. function normalizeMap (map) {
  7778. return Array.isArray(map)
  7779. ? map.map(function (key) { return ({ key: key, val: key }); })
  7780. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  7781. }
  7782. function normalizeNamespace (fn) {
  7783. return function (namespace, map) {
  7784. if (typeof namespace !== 'string') {
  7785. map = namespace;
  7786. namespace = '';
  7787. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  7788. namespace += '/';
  7789. }
  7790. return fn(namespace, map)
  7791. }
  7792. }
  7793. function getModuleByNamespace (store, helper, namespace) {
  7794. var module = store._modulesNamespaceMap[namespace];
  7795. if ( true && !module) {
  7796. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  7797. }
  7798. return module
  7799. }
  7800. var index_esm = {
  7801. Store: Store,
  7802. install: install,
  7803. version: '3.0.1',
  7804. mapState: mapState,
  7805. mapMutations: mapMutations,
  7806. mapGetters: mapGetters,
  7807. mapActions: mapActions,
  7808. createNamespacedHelpers: createNamespacedHelpers
  7809. };
  7810. /* harmony default export */ __webpack_exports__["default"] = (index_esm);
  7811. /***/ }),
  7812. /* 14 */
  7813. /*!********************************************************************!*\
  7814. !*** D:/wwwroot/HDhotel/js_sdk/luch-request/luch-request/index.js ***!
  7815. \********************************************************************/
  7816. /*! no static exports found */
  7817. /***/ (function(module, exports, __webpack_require__) {
  7818. "use strict";
  7819. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _Request = _interopRequireDefault(__webpack_require__(/*! ./core/Request */ 15));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  7820. _Request.default;exports.default = _default;
  7821. /***/ }),
  7822. /* 15 */
  7823. /*!***************************************************************************!*\
  7824. !*** D:/wwwroot/HDhotel/js_sdk/luch-request/luch-request/core/Request.js ***!
  7825. \***************************************************************************/
  7826. /*! no static exports found */
  7827. /***/ (function(module, exports, __webpack_require__) {
  7828. "use strict";
  7829. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  7830. var _dispatchRequest = _interopRequireDefault(__webpack_require__(/*! ./dispatchRequest */ 16));
  7831. var _InterceptorManager = _interopRequireDefault(__webpack_require__(/*! ./InterceptorManager */ 24));
  7832. var _mergeConfig = _interopRequireDefault(__webpack_require__(/*! ./mergeConfig */ 25));
  7833. var _defaults = _interopRequireDefault(__webpack_require__(/*! ./defaults */ 26));
  7834. var _utils = __webpack_require__(/*! ../utils */ 19);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var
  7835. Request = /*#__PURE__*/function () {
  7836. /**
  7837. * @param {Object} arg - 全局配置
  7838. * @param {String} arg.baseURL - 全局根路径
  7839. * @param {Object} arg.header - 全局header
  7840. * @param {String} arg.method = [GET|POST|PUT|DELETE|CONNECT|HEAD|OPTIONS|TRACE] - 全局默认请求方式
  7841. * @param {String} arg.dataType = [json] - 全局默认的dataType
  7842. * @param {String} arg.responseType = [text|arraybuffer] - 全局默认的responseType。App和支付宝小程序不支持
  7843. * @param {Object} arg.custom - 全局默认的自定义参数
  7844. * @param {Number} arg.timeout - 全局默认的超时时间,单位 ms。默认30000。仅微信小程序(2.10.0)、支付宝小程序支持
  7845. * @param {Boolean} arg.sslVerify - 全局默认的是否验证 ssl 证书。默认true.仅App安卓端支持(HBuilderX 2.3.3+)
  7846. * @param {Boolean} arg.withCredentials - 全局默认的跨域请求时是否携带凭证(cookies)。默认false。仅H5支持(HBuilderX 2.6.15+)
  7847. * @param {Boolean} arg.firstIpv4 - 全DNS解析时优先使用ipv4。默认false。仅 App-Android 支持 (HBuilderX 2.8.0+)
  7848. * @param {Function(statusCode):Boolean} arg.validateStatus - 全局默认的自定义验证器。默认statusCode >= 200 && statusCode < 300
  7849. */
  7850. function Request() {var arg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};_classCallCheck(this, Request);
  7851. if (!(0, _utils.isPlainObject)(arg)) {
  7852. arg = {};
  7853. console.warn('设置全局参数必须接收一个Object');
  7854. }
  7855. this.config = _objectSpread({}, _defaults.default, {}, arg);
  7856. this.interceptors = {
  7857. request: new _InterceptorManager.default(),
  7858. response: new _InterceptorManager.default() };
  7859. }
  7860. /**
  7861. * @Function
  7862. * @param {Request~setConfigCallback} f - 设置全局默认配置
  7863. */_createClass(Request, [{ key: "setConfig", value: function setConfig(
  7864. f) {
  7865. this.config = f(this.config);
  7866. } }, { key: "middleware", value: function middleware(
  7867. config) {
  7868. config = (0, _mergeConfig.default)(this.config, config);
  7869. var chain = [_dispatchRequest.default, undefined];
  7870. var promise = Promise.resolve(config);
  7871. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  7872. chain.unshift(interceptor.fulfilled, interceptor.rejected);
  7873. });
  7874. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  7875. chain.push(interceptor.fulfilled, interceptor.rejected);
  7876. });
  7877. while (chain.length) {
  7878. promise = promise.then(chain.shift(), chain.shift());
  7879. }
  7880. return promise;
  7881. }
  7882. /**
  7883. * @Function
  7884. * @param {Object} config - 请求配置项
  7885. * @prop {String} options.url - 请求路径
  7886. * @prop {Object} options.data - 请求参数
  7887. * @prop {Object} [options.responseType = config.responseType] [text|arraybuffer] - 响应的数据类型
  7888. * @prop {Object} [options.dataType = config.dataType] - 如果设为 json,会尝试对返回的数据做一次 JSON.parse
  7889. * @prop {Object} [options.header = config.header] - 请求header
  7890. * @prop {Object} [options.method = config.method] - 请求方法
  7891. * @returns {Promise<unknown>}
  7892. */ }, { key: "request", value: function request()
  7893. {var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  7894. return this.middleware(config);
  7895. } }, { key: "get", value: function get(
  7896. url) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7897. return this.middleware(_objectSpread({
  7898. url: url,
  7899. method: 'GET' },
  7900. options));
  7901. } }, { key: "post", value: function post(
  7902. url, data) {var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  7903. return this.middleware(_objectSpread({
  7904. url: url,
  7905. data: data,
  7906. method: 'POST' },
  7907. options));
  7908. } }, { key: "put", value: function put(
  7909. url, data) {var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  7910. return this.middleware(_objectSpread({
  7911. url: url,
  7912. data: data,
  7913. method: 'PUT' },
  7914. options));
  7915. } }, { key: "delete", value: function _delete(
  7916. url, data) {var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  7917. return this.middleware(_objectSpread({
  7918. url: url,
  7919. data: data,
  7920. method: 'DELETE' },
  7921. options));
  7922. } }, { key: "connect", value: function connect(
  7923. url, data) {var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  7924. return this.middleware(_objectSpread({
  7925. url: url,
  7926. data: data,
  7927. method: 'CONNECT' },
  7928. options));
  7929. } }, { key: "head", value: function head(
  7930. url, data) {var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  7931. return this.middleware(_objectSpread({
  7932. url: url,
  7933. data: data,
  7934. method: 'HEAD' },
  7935. options));
  7936. } }, { key: "options", value: function options(
  7937. url, data) {var _options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  7938. return this.middleware(_objectSpread({
  7939. url: url,
  7940. data: data,
  7941. method: 'OPTIONS' },
  7942. _options));
  7943. } }, { key: "trace", value: function trace(
  7944. url, data) {var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  7945. return this.middleware(_objectSpread({
  7946. url: url,
  7947. data: data,
  7948. method: 'TRACE' },
  7949. options));
  7950. } }, { key: "upload", value: function upload(
  7951. url) {var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7952. config.url = url;
  7953. config.method = 'UPLOAD';
  7954. return this.middleware(config);
  7955. } }, { key: "download", value: function download(
  7956. url) {var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7957. config.url = url;
  7958. config.method = 'DOWNLOAD';
  7959. return this.middleware(config);
  7960. } }]);return Request;}();
  7961. /**
  7962. * setConfig回调
  7963. * @return {Object} - 返回操作后的config
  7964. * @callback Request~setConfigCallback
  7965. * @param {Object} config - 全局默认config
  7966. */exports.default = Request;
  7967. /***/ }),
  7968. /* 16 */
  7969. /*!***********************************************************************************!*\
  7970. !*** D:/wwwroot/HDhotel/js_sdk/luch-request/luch-request/core/dispatchRequest.js ***!
  7971. \***********************************************************************************/
  7972. /*! no static exports found */
  7973. /***/ (function(module, exports, __webpack_require__) {
  7974. "use strict";
  7975. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _index = _interopRequireDefault(__webpack_require__(/*! ../adapters/index */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}var _default =
  7976. function _default(config) {
  7977. return (0, _index.default)(config);
  7978. };exports.default = _default;
  7979. /***/ }),
  7980. /* 17 */
  7981. /*!*****************************************************************************!*\
  7982. !*** D:/wwwroot/HDhotel/js_sdk/luch-request/luch-request/adapters/index.js ***!
  7983. \*****************************************************************************/
  7984. /*! no static exports found */
  7985. /***/ (function(module, exports, __webpack_require__) {
  7986. "use strict";
  7987. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _buildURL = _interopRequireDefault(__webpack_require__(/*! ../helpers/buildURL */ 18));
  7988. var _buildFullPath = _interopRequireDefault(__webpack_require__(/*! ../core/buildFullPath */ 20));
  7989. var _settle = _interopRequireDefault(__webpack_require__(/*! ../core/settle */ 23));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
  7990. /**
  7991. * 返回可选值存在的配置
  7992. * @param {Array} keys - 可选值数组
  7993. * @param {Object} config2 - 配置
  7994. * @return {{}} - 存在的配置项
  7995. */
  7996. var mergeKeys = function mergeKeys(keys, config2) {
  7997. var config = {};
  7998. keys.forEach(function (prop) {
  7999. if (typeof config2[prop] !== 'undefined') {
  8000. config[prop] = config2[prop];
  8001. }
  8002. });
  8003. return config;
  8004. };var _default =
  8005. function _default(config) {
  8006. return new Promise(function (resolve, reject) {
  8007. var _config = {
  8008. url: (0, _buildURL.default)((0, _buildFullPath.default)(config.baseURL, config.url), config.params),
  8009. header: config.header,
  8010. complete: function complete(response) {
  8011. response.config = config;
  8012. try {
  8013. // 对可能字符串不是json 的情况容错
  8014. if (typeof response.data === 'string') {
  8015. response.data = JSON.parse(response.data);
  8016. }
  8017. // eslint-disable-next-line no-empty
  8018. } catch (e) {
  8019. }
  8020. (0, _settle.default)(resolve, reject, response);
  8021. } };
  8022. var requestTask;
  8023. if (config.method === 'UPLOAD') {
  8024. delete _config.header['content-type'];
  8025. delete _config.header['Content-Type'];
  8026. var otherConfig = {
  8027. filePath: config.filePath,
  8028. name: config.name };
  8029. var optionalKeys = [
  8030. 'formData'];
  8031. requestTask = uni.uploadFile(_objectSpread({}, _config, {}, otherConfig, {}, mergeKeys(optionalKeys, config)));
  8032. } else if (config.method === 'DOWNLOAD') {
  8033. requestTask = uni.downloadFile(_config);
  8034. } else {
  8035. var _optionalKeys = [
  8036. 'data',
  8037. 'method',
  8038. 'timeout',
  8039. 'dataType',
  8040. 'responseType'];
  8041. requestTask = uni.request(_objectSpread({}, _config, {}, mergeKeys(_optionalKeys, config)));
  8042. }
  8043. if (config.getTask) {
  8044. config.getTask(requestTask, config);
  8045. }
  8046. });
  8047. };exports.default = _default;
  8048. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8049. /***/ }),
  8050. /* 18 */
  8051. /*!*******************************************************************************!*\
  8052. !*** D:/wwwroot/HDhotel/js_sdk/luch-request/luch-request/helpers/buildURL.js ***!
  8053. \*******************************************************************************/
  8054. /*! no static exports found */
  8055. /***/ (function(module, exports, __webpack_require__) {
  8056. "use strict";
  8057. Object.defineProperty(exports, "__esModule", { value: true });exports.default = buildURL;
  8058. var utils = _interopRequireWildcard(__webpack_require__(/*! ./../utils */ 19));function _getRequireWildcardCache() {if (typeof WeakMap !== "function") return null;var cache = new WeakMap();_getRequireWildcardCache = function _getRequireWildcardCache() {return cache;};return cache;}function _interopRequireWildcard(obj) {if (obj && obj.__esModule) {return obj;}if (obj === null || typeof obj !== "object" && typeof obj !== "function") {return { default: obj };}var cache = _getRequireWildcardCache();if (cache && cache.has(obj)) {return cache.get(obj);}var newObj = {};var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;for (var key in obj) {if (Object.prototype.hasOwnProperty.call(obj, key)) {var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;if (desc && (desc.get || desc.set)) {Object.defineProperty(newObj, key, desc);} else {newObj[key] = obj[key];}}}newObj.default = obj;if (cache) {cache.set(obj, newObj);}return newObj;}
  8059. function encode(val) {
  8060. return encodeURIComponent(val).
  8061. replace(/%40/gi, '@').
  8062. replace(/%3A/gi, ':').
  8063. replace(/%24/g, '$').
  8064. replace(/%2C/gi, ',').
  8065. replace(/%20/g, '+').
  8066. replace(/%5B/gi, '[').
  8067. replace(/%5D/gi, ']');
  8068. }
  8069. /**
  8070. * Build a URL by appending params to the end
  8071. *
  8072. * @param {string} url The base of the url (e.g., http://www.google.com)
  8073. * @param {object} [params] The params to be appended
  8074. * @returns {string} The formatted url
  8075. */
  8076. function buildURL(url, params) {
  8077. /*eslint no-param-reassign:0*/
  8078. if (!params) {
  8079. return url;
  8080. }
  8081. var serializedParams;
  8082. if (utils.isURLSearchParams(params)) {
  8083. serializedParams = params.toString();
  8084. } else {
  8085. var parts = [];
  8086. utils.forEach(params, function serialize(val, key) {
  8087. if (val === null || typeof val === 'undefined') {
  8088. return;
  8089. }
  8090. if (utils.isArray(val)) {
  8091. key = key + '[]';
  8092. } else {
  8093. val = [val];
  8094. }
  8095. utils.forEach(val, function parseValue(v) {
  8096. if (utils.isDate(v)) {
  8097. v = v.toISOString();
  8098. } else if (utils.isObject(v)) {
  8099. v = JSON.stringify(v);
  8100. }
  8101. parts.push(encode(key) + '=' + encode(v));
  8102. });
  8103. });
  8104. serializedParams = parts.join('&');
  8105. }
  8106. if (serializedParams) {
  8107. var hashmarkIndex = url.indexOf('#');
  8108. if (hashmarkIndex !== -1) {
  8109. url = url.slice(0, hashmarkIndex);
  8110. }
  8111. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  8112. }
  8113. return url;
  8114. }
  8115. /***/ }),
  8116. /* 19 */
  8117. /*!********************************************************************!*\
  8118. !*** D:/wwwroot/HDhotel/js_sdk/luch-request/luch-request/utils.js ***!
  8119. \********************************************************************/
  8120. /*! no static exports found */
  8121. /***/ (function(module, exports, __webpack_require__) {
  8122. "use strict";
  8123. // utils is a library of generic helper functions non-specific to axios
  8124. Object.defineProperty(exports, "__esModule", { value: true });exports.isArray = isArray;exports.isObject = isObject;exports.isDate = isDate;exports.isURLSearchParams = isURLSearchParams;exports.forEach = forEach;exports.isBoolean = isBoolean;exports.isPlainObject = isPlainObject;exports.deepMerge = deepMerge;
  8125. var toString = Object.prototype.toString;
  8126. /**
  8127. * Determine if a value is an Array
  8128. *
  8129. * @param {Object} val The value to test
  8130. * @returns {boolean} True if value is an Array, otherwise false
  8131. */
  8132. function isArray(val) {
  8133. return toString.call(val) === '[object Array]';
  8134. }
  8135. /**
  8136. * Determine if a value is an Object
  8137. *
  8138. * @param {Object} val The value to test
  8139. * @returns {boolean} True if value is an Object, otherwise false
  8140. */
  8141. function isObject(val) {
  8142. return val !== null && typeof val === 'object';
  8143. }
  8144. /**
  8145. * Determine if a value is a Date
  8146. *
  8147. * @param {Object} val The value to test
  8148. * @returns {boolean} True if value is a Date, otherwise false
  8149. */
  8150. function isDate(val) {
  8151. return toString.call(val) === '[object Date]';
  8152. }
  8153. /**
  8154. * Determine if a value is a URLSearchParams object
  8155. *
  8156. * @param {Object} val The value to test
  8157. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  8158. */
  8159. function isURLSearchParams(val) {
  8160. return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
  8161. }
  8162. /**
  8163. * Iterate over an Array or an Object invoking a function for each item.
  8164. *
  8165. * If `obj` is an Array callback will be called passing
  8166. * the value, index, and complete array for each item.
  8167. *
  8168. * If 'obj' is an Object callback will be called passing
  8169. * the value, key, and complete object for each property.
  8170. *
  8171. * @param {Object|Array} obj The object to iterate
  8172. * @param {Function} fn The callback to invoke for each item
  8173. */
  8174. function forEach(obj, fn) {
  8175. // Don't bother if no value provided
  8176. if (obj === null || typeof obj === 'undefined') {
  8177. return;
  8178. }
  8179. // Force an array if not already something iterable
  8180. if (typeof obj !== 'object') {
  8181. /*eslint no-param-reassign:0*/
  8182. obj = [obj];
  8183. }
  8184. if (isArray(obj)) {
  8185. // Iterate over array values
  8186. for (var i = 0, l = obj.length; i < l; i++) {
  8187. fn.call(null, obj[i], i, obj);
  8188. }
  8189. } else {
  8190. // Iterate over object keys
  8191. for (var key in obj) {
  8192. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  8193. fn.call(null, obj[key], key, obj);
  8194. }
  8195. }
  8196. }
  8197. }
  8198. /**
  8199. * 是否为boolean 值
  8200. * @param val
  8201. * @returns {boolean}
  8202. */
  8203. function isBoolean(val) {
  8204. return typeof val === 'boolean';
  8205. }
  8206. /**
  8207. * 是否为真正的对象{} new Object
  8208. * @param {any} obj - 检测的对象
  8209. * @returns {boolean}
  8210. */
  8211. function isPlainObject(obj) {
  8212. return Object.prototype.toString.call(obj) === '[object Object]';
  8213. }
  8214. /**
  8215. * Function equal to merge with the difference being that no reference
  8216. * to original objects is kept.
  8217. *
  8218. * @see merge
  8219. * @param {Object} obj1 Object to merge
  8220. * @returns {Object} Result of all merge properties
  8221. */
  8222. function deepMerge() /* obj1, obj2, obj3, ... */{
  8223. var result = {};
  8224. function assignValue(val, key) {
  8225. if (typeof result[key] === 'object' && typeof val === 'object') {
  8226. result[key] = deepMerge(result[key], val);
  8227. } else if (typeof val === 'object') {
  8228. result[key] = deepMerge({}, val);
  8229. } else {
  8230. result[key] = val;
  8231. }
  8232. }
  8233. for (var i = 0, l = arguments.length; i < l; i++) {
  8234. forEach(arguments[i], assignValue);
  8235. }
  8236. return result;
  8237. }
  8238. /***/ }),
  8239. /* 20 */
  8240. /*!*********************************************************************************!*\
  8241. !*** D:/wwwroot/HDhotel/js_sdk/luch-request/luch-request/core/buildFullPath.js ***!
  8242. \*********************************************************************************/
  8243. /*! no static exports found */
  8244. /***/ (function(module, exports, __webpack_require__) {
  8245. "use strict";
  8246. Object.defineProperty(exports, "__esModule", { value: true });exports.default = buildFullPath;
  8247. var _isAbsoluteURL = _interopRequireDefault(__webpack_require__(/*! ../helpers/isAbsoluteURL */ 21));
  8248. var _combineURLs = _interopRequireDefault(__webpack_require__(/*! ../helpers/combineURLs */ 22));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8249. /**
  8250. * Creates a new URL by combining the baseURL with the requestedURL,
  8251. * only when the requestedURL is not already an absolute URL.
  8252. * If the requestURL is absolute, this function returns the requestedURL untouched.
  8253. *
  8254. * @param {string} baseURL The base URL
  8255. * @param {string} requestedURL Absolute or relative URL to combine
  8256. * @returns {string} The combined full path
  8257. */
  8258. function buildFullPath(baseURL, requestedURL) {
  8259. if (baseURL && !(0, _isAbsoluteURL.default)(requestedURL)) {
  8260. return (0, _combineURLs.default)(baseURL, requestedURL);
  8261. }
  8262. return requestedURL;
  8263. }
  8264. /***/ }),
  8265. /* 21 */
  8266. /*!************************************************************************************!*\
  8267. !*** D:/wwwroot/HDhotel/js_sdk/luch-request/luch-request/helpers/isAbsoluteURL.js ***!
  8268. \************************************************************************************/
  8269. /*! no static exports found */
  8270. /***/ (function(module, exports, __webpack_require__) {
  8271. "use strict";
  8272. /**
  8273. * Determines whether the specified URL is absolute
  8274. *
  8275. * @param {string} url The URL to test
  8276. * @returns {boolean} True if the specified URL is absolute, otherwise false
  8277. */Object.defineProperty(exports, "__esModule", { value: true });exports.default = isAbsoluteURL;
  8278. function isAbsoluteURL(url) {
  8279. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  8280. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  8281. // by any combination of letters, digits, plus, period, or hyphen.
  8282. return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
  8283. }
  8284. /***/ }),
  8285. /* 22 */
  8286. /*!**********************************************************************************!*\
  8287. !*** D:/wwwroot/HDhotel/js_sdk/luch-request/luch-request/helpers/combineURLs.js ***!
  8288. \**********************************************************************************/
  8289. /*! no static exports found */
  8290. /***/ (function(module, exports, __webpack_require__) {
  8291. "use strict";
  8292. /**
  8293. * Creates a new URL by combining the specified URLs
  8294. *
  8295. * @param {string} baseURL The base URL
  8296. * @param {string} relativeURL The relative URL
  8297. * @returns {string} The combined URL
  8298. */Object.defineProperty(exports, "__esModule", { value: true });exports.default = combineURLs;
  8299. function combineURLs(baseURL, relativeURL) {
  8300. return relativeURL ?
  8301. baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') :
  8302. baseURL;
  8303. }
  8304. /***/ }),
  8305. /* 23 */
  8306. /*!**************************************************************************!*\
  8307. !*** D:/wwwroot/HDhotel/js_sdk/luch-request/luch-request/core/settle.js ***!
  8308. \**************************************************************************/
  8309. /*! no static exports found */
  8310. /***/ (function(module, exports, __webpack_require__) {
  8311. "use strict";
  8312. Object.defineProperty(exports, "__esModule", { value: true });exports.default = settle; /**
  8313. * Resolve or reject a Promise based on response status.
  8314. *
  8315. * @param {Function} resolve A function that resolves the promise.
  8316. * @param {Function} reject A function that rejects the promise.
  8317. * @param {object} response The response.
  8318. */
  8319. function settle(resolve, reject, response) {
  8320. var validateStatus = response.config.validateStatus;
  8321. var status = response.statusCode;
  8322. if (status && (!validateStatus || validateStatus(status))) {
  8323. resolve(response);
  8324. } else {
  8325. reject(response);
  8326. }
  8327. }
  8328. /***/ }),
  8329. /* 24 */
  8330. /*!**************************************************************************************!*\
  8331. !*** D:/wwwroot/HDhotel/js_sdk/luch-request/luch-request/core/InterceptorManager.js ***!
  8332. \**************************************************************************************/
  8333. /*! no static exports found */
  8334. /***/ (function(module, exports, __webpack_require__) {
  8335. "use strict";
  8336. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  8337. function InterceptorManager() {
  8338. this.handlers = [];
  8339. }
  8340. /**
  8341. * Add a new interceptor to the stack
  8342. *
  8343. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  8344. * @param {Function} rejected The function to handle `reject` for a `Promise`
  8345. *
  8346. * @return {Number} An ID used to remove interceptor later
  8347. */
  8348. InterceptorManager.prototype.use = function use(fulfilled, rejected) {
  8349. this.handlers.push({
  8350. fulfilled: fulfilled,
  8351. rejected: rejected });
  8352. return this.handlers.length - 1;
  8353. };
  8354. /**
  8355. * Remove an interceptor from the stack
  8356. *
  8357. * @param {Number} id The ID that was returned by `use`
  8358. */
  8359. InterceptorManager.prototype.eject = function eject(id) {
  8360. if (this.handlers[id]) {
  8361. this.handlers[id] = null;
  8362. }
  8363. };
  8364. /**
  8365. * Iterate over all the registered interceptors
  8366. *
  8367. * This method is particularly useful for skipping over any
  8368. * interceptors that may have become `null` calling `eject`.
  8369. *
  8370. * @param {Function} fn The function to call for each interceptor
  8371. */
  8372. InterceptorManager.prototype.forEach = function forEach(fn) {
  8373. this.handlers.forEach(function (h) {
  8374. if (h !== null) {
  8375. fn(h);
  8376. }
  8377. });
  8378. };var _default =
  8379. InterceptorManager;exports.default = _default;
  8380. /***/ }),
  8381. /* 25 */
  8382. /*!*******************************************************************************!*\
  8383. !*** D:/wwwroot/HDhotel/js_sdk/luch-request/luch-request/core/mergeConfig.js ***!
  8384. \*******************************************************************************/
  8385. /*! no static exports found */
  8386. /***/ (function(module, exports, __webpack_require__) {
  8387. "use strict";
  8388. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _utils = __webpack_require__(/*! ../utils */ 19);function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}
  8389. /**
  8390. * 合并局部配置优先的配置,如果局部有该配置项则用局部,如果全局有该配置项则用全局
  8391. * @param {Array} keys - 配置项
  8392. * @param {Object} globalsConfig - 当前的全局配置
  8393. * @param {Object} config2 - 局部配置
  8394. * @return {{}}
  8395. */
  8396. var mergeKeys = function mergeKeys(keys, globalsConfig, config2) {
  8397. var config = {};
  8398. keys.forEach(function (prop) {
  8399. if (typeof config2[prop] !== 'undefined') {
  8400. config[prop] = config2[prop];
  8401. } else if (typeof globalsConfig[prop] !== 'undefined') {
  8402. config[prop] = globalsConfig[prop];
  8403. }
  8404. });
  8405. return config;
  8406. };
  8407. /**
  8408. *
  8409. * @param globalsConfig - 当前实例的全局配置
  8410. * @param config2 - 当前的局部配置
  8411. * @return - 合并后的配置
  8412. */var _default =
  8413. function _default(globalsConfig) {var config2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  8414. var method = config2.method || globalsConfig.method || 'GET';
  8415. var config = {
  8416. baseURL: globalsConfig.baseURL || '',
  8417. method: method,
  8418. url: config2.url || '',
  8419. params: config2.params || {},
  8420. custom: _objectSpread({}, globalsConfig.custom || {}, {}, config2.custom || {}),
  8421. header: (0, _utils.deepMerge)(globalsConfig.header || {}, config2.header || {}) };
  8422. var defaultToConfig2Keys = ['getTask', 'validateStatus'];
  8423. config = _objectSpread({}, config, {}, mergeKeys(defaultToConfig2Keys, globalsConfig, config2));
  8424. // eslint-disable-next-line no-empty
  8425. if (method === 'DOWNLOAD') {
  8426. } else if (method === 'UPLOAD') {
  8427. delete config.header['content-type'];
  8428. delete config.header['Content-Type'];
  8429. var uploadKeys = [
  8430. 'filePath',
  8431. 'name',
  8432. 'formData'];
  8433. uploadKeys.forEach(function (prop) {
  8434. if (typeof config2[prop] !== 'undefined') {
  8435. config[prop] = config2[prop];
  8436. }
  8437. });
  8438. } else {
  8439. var defaultsKeys = [
  8440. 'data',
  8441. 'timeout',
  8442. 'dataType',
  8443. 'responseType'];
  8444. config = _objectSpread({}, config, {}, mergeKeys(defaultsKeys, globalsConfig, config2));
  8445. }
  8446. return config;
  8447. };exports.default = _default;
  8448. /***/ }),
  8449. /* 26 */
  8450. /*!****************************************************************************!*\
  8451. !*** D:/wwwroot/HDhotel/js_sdk/luch-request/luch-request/core/defaults.js ***!
  8452. \****************************************************************************/
  8453. /*! no static exports found */
  8454. /***/ (function(module, exports, __webpack_require__) {
  8455. "use strict";
  8456. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  8457. * 默认的全局配置
  8458. */var _default =
  8459. {
  8460. baseURL: '',
  8461. header: {},
  8462. method: 'GET',
  8463. dataType: 'json',
  8464. responseType: 'text',
  8465. custom: {},
  8466. timeout: 30000,
  8467. validateStatus: function validateStatus(status) {
  8468. return status >= 200 && status < 300;
  8469. } };exports.default = _default;
  8470. /***/ }),
  8471. /* 27 */
  8472. /*!******************************************!*\
  8473. !*** D:/wwwroot/HDhotel/utils/filter.js ***!
  8474. \******************************************/
  8475. /*! no static exports found */
  8476. /***/ (function(module, exports, __webpack_require__) {
  8477. "use strict";
  8478. var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
  8479. var _config = __webpack_require__(/*! @/config/config */ 11);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8480. //保留两位小数
  8481. _vue.default.filter('keepTwoNum', function (val) {
  8482. var value = Number(val);
  8483. return value.toFixed(2);
  8484. });
  8485. //链接加时间戳
  8486. _vue.default.filter("timestamp", function (link) {
  8487. return link + '?t=' + new Date().getTime();
  8488. });
  8489. /***/ }),
  8490. /* 28 */,
  8491. /* 29 */,
  8492. /* 30 */,
  8493. /* 31 */,
  8494. /* 32 */,
  8495. /* 33 */,
  8496. /* 34 */,
  8497. /* 35 */,
  8498. /* 36 */,
  8499. /* 37 */,
  8500. /* 38 */,
  8501. /* 39 */,
  8502. /* 40 */,
  8503. /* 41 */,
  8504. /* 42 */,
  8505. /* 43 */,
  8506. /* 44 */,
  8507. /* 45 */,
  8508. /* 46 */,
  8509. /* 47 */,
  8510. /* 48 */,
  8511. /* 49 */,
  8512. /* 50 */
  8513. /*!*********************************************************************!*\
  8514. !*** D:/wwwroot/HDhotel/components/mescroll-uni/mescroll-mixins.js ***!
  8515. \*********************************************************************/
  8516. /*! no static exports found */
  8517. /***/ (function(module, exports, __webpack_require__) {
  8518. "use strict";
  8519. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // mescroll-body 和 mescroll-uni 通用
  8520. // import MescrollUni from "./mescroll-uni.vue";
  8521. // import MescrollBody from "./mescroll-body.vue";
  8522. var MescrollMixin = {
  8523. // components: { // 非H5端无法通过mixin注册组件, 只能在main.js中注册全局组件或具体界面中注册
  8524. // MescrollUni,
  8525. // MescrollBody
  8526. // },
  8527. data: function data() {
  8528. return {
  8529. mescroll: null //mescroll实例对象
  8530. };
  8531. },
  8532. // 注册系统自带的下拉刷新 (配置down.native为true时生效, 还需在pages配置enablePullDownRefresh:true;详请参考mescroll-native的案例)
  8533. onPullDownRefresh: function onPullDownRefresh() {
  8534. this.mescroll && this.mescroll.onPullDownRefresh();
  8535. },
  8536. // 注册列表滚动事件,用于判定在顶部可下拉刷新,在指定位置可显示隐藏回到顶部按钮 (此方法为页面生命周期,无法在子组件中触发, 仅在mescroll-body生效)
  8537. onPageScroll: function onPageScroll(e) {
  8538. this.mescroll && this.mescroll.onPageScroll(e);
  8539. },
  8540. // 注册滚动到底部的事件,用于上拉加载 (此方法为页面生命周期,无法在子组件中触发, 仅在mescroll-body生效)
  8541. onReachBottom: function onReachBottom() {
  8542. this.mescroll && this.mescroll.onReachBottom();
  8543. },
  8544. methods: {
  8545. // mescroll组件初始化的回调,可获取到mescroll对象
  8546. mescrollInit: function mescrollInit(mescroll) {
  8547. this.mescroll = mescroll;
  8548. this.mescrollInitByRef(); // 兼容字节跳动小程序
  8549. },
  8550. // 以ref的方式初始化mescroll对象 (兼容字节跳动小程序: http://www.mescroll.com/qa.html?v=20200107#q26)
  8551. mescrollInitByRef: function mescrollInitByRef() {
  8552. if (!this.mescroll || !this.mescroll.resetUpScroll) {
  8553. var mescrollRef = this.$refs.mescrollRef;
  8554. if (mescrollRef) this.mescroll = mescrollRef.mescroll;
  8555. }
  8556. },
  8557. // 下拉刷新的回调 (mixin默认resetUpScroll)
  8558. downCallback: function downCallback() {var _this = this;
  8559. if (this.mescroll.optUp.use) {
  8560. this.mescroll.resetUpScroll();
  8561. } else {
  8562. setTimeout(function () {
  8563. _this.mescroll.endSuccess();
  8564. }, 500);
  8565. }
  8566. },
  8567. // 上拉加载的回调
  8568. upCallback: function upCallback() {var _this2 = this;
  8569. // mixin默认延时500自动结束加载
  8570. setTimeout(function () {
  8571. _this2.mescroll.endErr();
  8572. }, 500);
  8573. } },
  8574. mounted: function mounted() {
  8575. this.mescrollInitByRef(); // 兼容字节跳动小程序, 避免未设置@init或@init此时未能取到ref的情况
  8576. } };var _default =
  8577. MescrollMixin;exports.default = _default;
  8578. /***/ }),
  8579. /* 51 */,
  8580. /* 52 */,
  8581. /* 53 */,
  8582. /* 54 */,
  8583. /* 55 */,
  8584. /* 56 */,
  8585. /* 57 */,
  8586. /* 58 */,
  8587. /* 59 */,
  8588. /* 60 */,
  8589. /* 61 */,
  8590. /* 62 */,
  8591. /* 63 */,
  8592. /* 64 */,
  8593. /* 65 */,
  8594. /* 66 */,
  8595. /* 67 */,
  8596. /* 68 */,
  8597. /* 69 */,
  8598. /* 70 */,
  8599. /* 71 */,
  8600. /* 72 */,
  8601. /* 73 */,
  8602. /* 74 */,
  8603. /* 75 */,
  8604. /* 76 */,
  8605. /* 77 */,
  8606. /* 78 */,
  8607. /* 79 */,
  8608. /* 80 */,
  8609. /* 81 */,
  8610. /* 82 */
  8611. /*!******************************************************************!*\
  8612. !*** D:/wwwroot/HDhotel/components/mescroll-uni/mescroll-uni.js ***!
  8613. \******************************************************************/
  8614. /*! no static exports found */
  8615. /***/ (function(module, exports, __webpack_require__) {
  8616. "use strict";
  8617. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = MeScroll; /* mescroll
  8618. * version 1.3.2
  8619. * 2020-08-05 wenju
  8620. * http://www.mescroll.com
  8621. */
  8622. function MeScroll(options, isScrollBody) {
  8623. var me = this;
  8624. me.version = '1.3.2'; // mescroll版本号
  8625. me.options = options || {}; // 配置
  8626. me.isScrollBody = isScrollBody || false; // 滚动区域是否为原生页面滚动; 默认为scroll-view
  8627. me.isDownScrolling = false; // 是否在执行下拉刷新的回调
  8628. me.isUpScrolling = false; // 是否在执行上拉加载的回调
  8629. var hasDownCallback = me.options.down && me.options.down.callback; // 是否配置了down的callback
  8630. // 初始化下拉刷新
  8631. me.initDownScroll();
  8632. // 初始化上拉加载,则初始化
  8633. me.initUpScroll();
  8634. // 自动加载
  8635. setTimeout(function () {// 待主线程执行完毕再执行,避免new MeScroll未初始化,在回调获取不到mescroll的实例
  8636. // 自动触发下拉刷新 (只有配置了down的callback才自动触发下拉刷新)
  8637. if ((me.optDown.use || me.optDown.native) && me.optDown.auto && hasDownCallback) {
  8638. if (me.optDown.autoShowLoading) {
  8639. me.triggerDownScroll(); // 显示下拉进度,执行下拉回调
  8640. } else {
  8641. me.optDown.callback && me.optDown.callback(me); // 不显示下拉进度,直接执行下拉回调
  8642. }
  8643. }
  8644. // 自动触发上拉加载
  8645. if (!me.isUpAutoLoad) {// 部分小程序(头条小程序)emit是异步, 会导致isUpAutoLoad判断有误, 先延时确保先执行down的callback,再执行up的callback
  8646. setTimeout(function () {
  8647. me.optUp.use && me.optUp.auto && !me.isUpAutoLoad && me.triggerUpScroll();
  8648. }, 100);
  8649. }
  8650. }, 30); // 需让me.optDown.inited和me.optUp.inited先执行
  8651. }
  8652. /* 配置参数:下拉刷新 */
  8653. MeScroll.prototype.extendDownScroll = function (optDown) {
  8654. // 下拉刷新的配置
  8655. MeScroll.extend(optDown, {
  8656. use: true, // 是否启用下拉刷新; 默认true
  8657. auto: true, // 是否在初始化完毕之后自动执行下拉刷新的回调; 默认true
  8658. native: false, // 是否使用系统自带的下拉刷新; 默认false; 仅mescroll-body生效 (值为true时,还需在pages配置enablePullDownRefresh:true;详请参考mescroll-native的案例)
  8659. autoShowLoading: false, // 如果设置auto=true(在初始化完毕之后自动执行下拉刷新的回调),那么是否显示下拉刷新的进度; 默认false
  8660. isLock: false, // 是否锁定下拉刷新,默认false;
  8661. offset: 80, // 在列表顶部,下拉大于80px,松手即可触发下拉刷新的回调
  8662. startTop: 100, // scroll-view快速滚动到顶部时,此时的scroll-top可能大于0, 此值用于控制最大的误差
  8663. inOffsetRate: 1, // 在列表顶部,下拉的距离小于offset时,改变下拉区域高度比例;值小于1且越接近0,高度变化越小,表现为越往下越难拉
  8664. outOffsetRate: 0.2, // 在列表顶部,下拉的距离大于offset时,改变下拉区域高度比例;值小于1且越接近0,高度变化越小,表现为越往下越难拉
  8665. bottomOffset: 20, // 当手指touchmove位置在距离body底部20px范围内的时候结束上拉刷新,避免Webview嵌套导致touchend事件不执行
  8666. minAngle: 45, // 向下滑动最少偏移的角度,取值区间 [0,90];默认45度,即向下滑动的角度大于45度则触发下拉;而小于45度,将不触发下拉,避免与左右滑动的轮播等组件冲突;
  8667. textInOffset: '下拉刷新', // 下拉的距离在offset范围内的提示文本
  8668. textOutOffset: '释放更新', // 下拉的距离大于offset范围的提示文本
  8669. textLoading: '加载中 ...', // 加载中的提示文本
  8670. bgColor: "transparent", // 背景颜色 (建议在pages.json中再设置一下backgroundColorTop)
  8671. textColor: "gray", // 文本颜色 (当bgColor配置了颜色,而textColor未配置时,则textColor会默认为白色)
  8672. inited: null, // 下拉刷新初始化完毕的回调
  8673. inOffset: null, // 下拉的距离进入offset范围内那一刻的回调
  8674. outOffset: null, // 下拉的距离大于offset那一刻的回调
  8675. onMoving: null, // 下拉过程中的回调,滑动过程一直在执行; rate下拉区域当前高度与指定距离的比值(inOffset: rate<1; outOffset: rate>=1); downHight当前下拉区域的高度
  8676. beforeLoading: null, // 准备触发下拉刷新的回调: 如果return true,将不触发showLoading和callback回调; 常用来完全自定义下拉刷新, 参考案例【淘宝 v6.8.0】
  8677. showLoading: null, // 显示下拉刷新进度的回调
  8678. afterLoading: null, // 显示下拉刷新进度的回调之后,马上要执行的代码 (如: 在wxs中使用)
  8679. beforeEndDownScroll: null, // 准备结束下拉的回调. 返回结束下拉的延时执行时间,默认0ms; 常用于结束下拉之前再显示另外一小段动画,才去隐藏下拉刷新的场景, 参考案例【dotJump】
  8680. endDownScroll: null, // 结束下拉刷新的回调
  8681. afterEndDownScroll: null, // 结束下拉刷新的回调,马上要执行的代码 (如: 在wxs中使用)
  8682. callback: function callback(mescroll) {
  8683. // 下拉刷新的回调;默认重置上拉加载列表为第一页
  8684. mescroll.resetUpScroll();
  8685. } });
  8686. };
  8687. /* 配置参数:上拉加载 */
  8688. MeScroll.prototype.extendUpScroll = function (optUp) {
  8689. // 上拉加载的配置
  8690. MeScroll.extend(optUp, {
  8691. use: true, // 是否启用上拉加载; 默认true
  8692. auto: true, // 是否在初始化完毕之后自动执行上拉加载的回调; 默认true
  8693. isLock: false, // 是否锁定上拉加载,默认false;
  8694. isBoth: true, // 上拉加载时,如果滑动到列表顶部是否可以同时触发下拉刷新;默认true,两者可同时触发;
  8695. callback: null, // 上拉加载的回调;function(page,mescroll){ }
  8696. page: {
  8697. num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  8698. size: 10, // 每页数据的数量
  8699. time: null // 加载第一页数据服务器返回的时间; 防止用户翻页时,后台新增了数据从而导致下一页数据重复;
  8700. },
  8701. noMoreSize: 5, // 如果列表已无数据,可设置列表的总数量要大于等于5条才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看
  8702. offset: 80, // 距底部多远时,触发upCallback
  8703. textLoading: '加载中 ...', // 加载中的提示文本
  8704. textNoMore: '-- END --', // 没有更多数据的提示文本
  8705. bgColor: "transparent", // 背景颜色 (建议在pages.json中再设置一下backgroundColorBottom)
  8706. textColor: "gray", // 文本颜色 (当bgColor配置了颜色,而textColor未配置时,则textColor会默认为白色)
  8707. inited: null, // 初始化完毕的回调
  8708. showLoading: null, // 显示加载中的回调
  8709. showNoMore: null, // 显示无更多数据的回调
  8710. hideUpScroll: null, // 隐藏上拉加载的回调
  8711. errDistance: 60, // endErr的时候需往上滑动一段距离,使其往下滑动时再次触发onReachBottom,仅mescroll-body生效
  8712. toTop: {
  8713. // 回到顶部按钮,需配置src才显示
  8714. src: null, // 图片路径,默认null (绝对路径或网络图)
  8715. offset: 1000, // 列表滚动多少距离才显示回到顶部按钮,默认1000
  8716. duration: 300, // 回到顶部的动画时长,默认300ms (当值为0或300则使用系统自带回到顶部,更流畅; 其他值则通过step模拟,部分机型可能不够流畅,所以非特殊情况不建议修改此项)
  8717. btnClick: null, // 点击按钮的回调
  8718. onShow: null, // 是否显示的回调
  8719. zIndex: 9990, // fixed定位z-index值
  8720. left: null, // 到左边的距离, 默认null. 此项有值时,right不生效. (支持20, "20rpx", "20px", "20%"格式的值, 其中纯数字则默认单位rpx)
  8721. right: 20, // 到右边的距离, 默认20 (支持20, "20rpx", "20px", "20%"格式的值, 其中纯数字则默认单位rpx)
  8722. bottom: 120, // 到底部的距离, 默认120 (支持20, "20rpx", "20px", "20%"格式的值, 其中纯数字则默认单位rpx)
  8723. safearea: false, // bottom的偏移量是否加上底部安全区的距离, 默认false, 需要适配iPhoneX时使用 (具体的界面如果不配置此项,则取本vue的safearea值)
  8724. width: 72, // 回到顶部图标的宽度, 默认72 (支持20, "20rpx", "20px", "20%"格式的值, 其中纯数字则默认单位rpx)
  8725. radius: "50%" // 圆角, 默认"50%" (支持20, "20rpx", "20px", "20%"格式的值, 其中纯数字则默认单位rpx)
  8726. },
  8727. empty: {
  8728. use: true, // 是否显示空布局
  8729. icon: null, // 图标路径
  8730. tip: '~ 暂无相关数据 ~', // 提示
  8731. btnText: '', // 按钮
  8732. btnClick: null, // 点击按钮的回调
  8733. onShow: null, // 是否显示的回调
  8734. fixed: false, // 是否使用fixed定位,默认false; 配置fixed为true,以下的top和zIndex才生效 (transform会使fixed失效,最终会降级为absolute)
  8735. top: "100rpx", // fixed定位的top值 (完整的单位值,如 "10%"; "100rpx")
  8736. zIndex: 99 // fixed定位z-index值
  8737. },
  8738. onScroll: false // 是否监听滚动事件
  8739. });
  8740. };
  8741. /* 配置参数 */
  8742. MeScroll.extend = function (userOption, defaultOption) {
  8743. if (!userOption) return defaultOption;
  8744. for (var key in defaultOption) {
  8745. if (userOption[key] == null) {
  8746. var def = defaultOption[key];
  8747. if (def != null && typeof def === 'object') {
  8748. userOption[key] = MeScroll.extend({}, def); // 深度匹配
  8749. } else {
  8750. userOption[key] = def;
  8751. }
  8752. } else if (typeof userOption[key] === 'object') {
  8753. MeScroll.extend(userOption[key], defaultOption[key]); // 深度匹配
  8754. }
  8755. }
  8756. return userOption;
  8757. };
  8758. /* 简单判断是否配置了颜色 (非透明,非白色) */
  8759. MeScroll.prototype.hasColor = function (color) {
  8760. if (!color) return false;
  8761. var c = color.toLowerCase();
  8762. return c != "#fff" && c != "#ffffff" && c != "transparent" && c != "white";
  8763. };
  8764. /* -------初始化下拉刷新------- */
  8765. MeScroll.prototype.initDownScroll = function () {
  8766. var me = this;
  8767. // 配置参数
  8768. me.optDown = me.options.down || {};
  8769. if (!me.optDown.textColor && me.hasColor(me.optDown.bgColor)) me.optDown.textColor = "#fff"; // 当bgColor有值且textColor未设置,则textColor默认白色
  8770. me.extendDownScroll(me.optDown);
  8771. // 如果是mescroll-body且配置了native,则禁止自定义的下拉刷新
  8772. if (me.isScrollBody && me.optDown.native) {
  8773. me.optDown.use = false;
  8774. } else {
  8775. me.optDown.native = false; // 仅mescroll-body支持,mescroll-uni不支持
  8776. }
  8777. me.downHight = 0; // 下拉区域的高度
  8778. // 在页面中加入下拉布局
  8779. if (me.optDown.use && me.optDown.inited) {
  8780. // 初始化完毕的回调
  8781. setTimeout(function () {// 待主线程执行完毕再执行,避免new MeScroll未初始化,在回调获取不到mescroll的实例
  8782. me.optDown.inited(me);
  8783. }, 0);
  8784. }
  8785. };
  8786. /* 列表touchstart事件 */
  8787. MeScroll.prototype.touchstartEvent = function (e) {
  8788. if (!this.optDown.use) return;
  8789. this.startPoint = this.getPoint(e); // 记录起点
  8790. this.startTop = this.getScrollTop(); // 记录此时的滚动条位置
  8791. this.startAngle = 0; // 初始角度
  8792. this.lastPoint = this.startPoint; // 重置上次move的点
  8793. this.maxTouchmoveY = this.getBodyHeight() - this.optDown.bottomOffset; // 手指触摸的最大范围(写在touchstart避免body获取高度为0的情况)
  8794. this.inTouchend = false; // 标记不是touchend
  8795. };
  8796. /* 列表touchmove事件 */
  8797. MeScroll.prototype.touchmoveEvent = function (e) {
  8798. if (!this.optDown.use) return;
  8799. var me = this;
  8800. var scrollTop = me.getScrollTop(); // 当前滚动条的距离
  8801. var curPoint = me.getPoint(e); // 当前点
  8802. var moveY = curPoint.y - me.startPoint.y; // 和起点比,移动的距离,大于0向下拉,小于0向上拉
  8803. // 向下拉 && 在顶部
  8804. // mescroll-body,直接判定在顶部即可
  8805. // scroll-view在滚动时不会触发touchmove,当触顶/底/左/右时,才会触发touchmove
  8806. // scroll-view滚动到顶部时,scrollTop不一定为0,也有可能大于0; 在iOS的APP中scrollTop可能为负数,不一定和startTop相等
  8807. if (moveY > 0 && (
  8808. me.isScrollBody && scrollTop <= 0 ||
  8809. !me.isScrollBody && (scrollTop <= 0 || scrollTop <= me.optDown.startTop && scrollTop === me.startTop)))
  8810. {
  8811. // 可下拉的条件
  8812. if (!me.inTouchend && !me.isDownScrolling && !me.optDown.isLock && (!me.isUpScrolling || me.isUpScrolling &&
  8813. me.optUp.isBoth)) {
  8814. // 下拉的初始角度是否在配置的范围内
  8815. if (!me.startAngle) me.startAngle = me.getAngle(me.lastPoint, curPoint); // 两点之间的角度,区间 [0,90]
  8816. if (me.startAngle < me.optDown.minAngle) return; // 如果小于配置的角度,则不往下执行下拉刷新
  8817. // 如果手指的位置超过配置的距离,则提前结束下拉,避免Webview嵌套导致touchend无法触发
  8818. if (me.maxTouchmoveY > 0 && curPoint.y >= me.maxTouchmoveY) {
  8819. me.inTouchend = true; // 标记执行touchend
  8820. me.touchendEvent(); // 提前触发touchend
  8821. return;
  8822. }
  8823. me.preventDefault(e); // 阻止默认事件
  8824. var diff = curPoint.y - me.lastPoint.y; // 和上次比,移动的距离 (大于0向下,小于0向上)
  8825. // 下拉距离 < 指定距离
  8826. if (me.downHight < me.optDown.offset) {
  8827. if (me.movetype !== 1) {
  8828. me.movetype = 1; // 加入标记,保证只执行一次
  8829. me.optDown.inOffset && me.optDown.inOffset(me); // 进入指定距离范围内那一刻的回调,只执行一次
  8830. me.isMoveDown = true; // 标记下拉区域高度改变,在touchend重置回来
  8831. }
  8832. me.downHight += diff * me.optDown.inOffsetRate; // 越往下,高度变化越小
  8833. // 指定距离 <= 下拉距离
  8834. } else {
  8835. if (me.movetype !== 2) {
  8836. me.movetype = 2; // 加入标记,保证只执行一次
  8837. me.optDown.outOffset && me.optDown.outOffset(me); // 下拉超过指定距离那一刻的回调,只执行一次
  8838. me.isMoveDown = true; // 标记下拉区域高度改变,在touchend重置回来
  8839. }
  8840. if (diff > 0) {// 向下拉
  8841. me.downHight += diff * me.optDown.outOffsetRate; // 越往下,高度变化越小
  8842. } else {// 向上收
  8843. me.downHight += diff; // 向上收回高度,则向上滑多少收多少高度
  8844. }
  8845. }
  8846. me.downHight = Math.round(me.downHight); // 取整
  8847. var rate = me.downHight / me.optDown.offset; // 下拉区域当前高度与指定距离的比值
  8848. me.optDown.onMoving && me.optDown.onMoving(me, rate, me.downHight); // 下拉过程中的回调,一直在执行
  8849. }
  8850. }
  8851. me.lastPoint = curPoint; // 记录本次移动的点
  8852. };
  8853. /* 列表touchend事件 */
  8854. MeScroll.prototype.touchendEvent = function (e) {
  8855. if (!this.optDown.use) return;
  8856. // 如果下拉区域高度已改变,则需重置回来
  8857. if (this.isMoveDown) {
  8858. if (this.downHight >= this.optDown.offset) {
  8859. // 符合触发刷新的条件
  8860. this.triggerDownScroll();
  8861. } else {
  8862. // 不符合的话 则重置
  8863. this.downHight = 0;
  8864. this.endDownScrollCall(this);
  8865. }
  8866. this.movetype = 0;
  8867. this.isMoveDown = false;
  8868. } else if (!this.isScrollBody && this.getScrollTop() === this.startTop) {// scroll-view到顶/左/右/底的滑动事件
  8869. var isScrollUp = this.getPoint(e).y - this.startPoint.y < 0; // 和起点比,移动的距离,大于0向下拉,小于0向上拉
  8870. // 上滑
  8871. if (isScrollUp) {
  8872. // 需检查滑动的角度
  8873. var angle = this.getAngle(this.getPoint(e), this.startPoint); // 两点之间的角度,区间 [0,90]
  8874. if (angle > 80) {
  8875. // 检查并触发上拉
  8876. this.triggerUpScroll(true);
  8877. }
  8878. }
  8879. }
  8880. };
  8881. /* 根据点击滑动事件获取第一个手指的坐标 */
  8882. MeScroll.prototype.getPoint = function (e) {
  8883. if (!e) {
  8884. return {
  8885. x: 0,
  8886. y: 0 };
  8887. }
  8888. if (e.touches && e.touches[0]) {
  8889. return {
  8890. x: e.touches[0].pageX,
  8891. y: e.touches[0].pageY };
  8892. } else if (e.changedTouches && e.changedTouches[0]) {
  8893. return {
  8894. x: e.changedTouches[0].pageX,
  8895. y: e.changedTouches[0].pageY };
  8896. } else {
  8897. return {
  8898. x: e.clientX,
  8899. y: e.clientY };
  8900. }
  8901. };
  8902. /* 计算两点之间的角度: 区间 [0,90]*/
  8903. MeScroll.prototype.getAngle = function (p1, p2) {
  8904. var x = Math.abs(p1.x - p2.x);
  8905. var y = Math.abs(p1.y - p2.y);
  8906. var z = Math.sqrt(x * x + y * y);
  8907. var angle = 0;
  8908. if (z !== 0) {
  8909. angle = Math.asin(y / z) / Math.PI * 180;
  8910. }
  8911. return angle;
  8912. };
  8913. /* 触发下拉刷新 */
  8914. MeScroll.prototype.triggerDownScroll = function () {
  8915. if (this.optDown.beforeLoading && this.optDown.beforeLoading(this)) {
  8916. //return true则处于完全自定义状态
  8917. } else {
  8918. this.showDownScroll(); // 下拉刷新中...
  8919. !this.optDown.native && this.optDown.callback && this.optDown.callback(this); // 执行回调,联网加载数据
  8920. }
  8921. };
  8922. /* 显示下拉进度布局 */
  8923. MeScroll.prototype.showDownScroll = function () {
  8924. this.isDownScrolling = true; // 标记下拉中
  8925. if (this.optDown.native) {
  8926. uni.startPullDownRefresh(); // 系统自带的下拉刷新
  8927. this.showDownLoadingCall(0); // 仍触发showLoading,因为上拉加载用到
  8928. } else {
  8929. this.downHight = this.optDown.offset; // 更新下拉区域高度
  8930. this.showDownLoadingCall(this.downHight); // 下拉刷新中...
  8931. }
  8932. };
  8933. MeScroll.prototype.showDownLoadingCall = function (downHight) {
  8934. this.optDown.showLoading && this.optDown.showLoading(this, downHight); // 下拉刷新中...
  8935. this.optDown.afterLoading && this.optDown.afterLoading(this, downHight); // 下拉刷新中...触发之后马上要执行的代码
  8936. };
  8937. /* 显示系统自带的下拉刷新时需要处理的业务 */
  8938. MeScroll.prototype.onPullDownRefresh = function () {
  8939. this.isDownScrolling = true; // 标记下拉中
  8940. this.showDownLoadingCall(0); // 仍触发showLoading,因为上拉加载用到
  8941. this.optDown.callback && this.optDown.callback(this); // 执行回调,联网加载数据
  8942. };
  8943. /* 结束下拉刷新 */
  8944. MeScroll.prototype.endDownScroll = function () {
  8945. if (this.optDown.native) {// 结束原生下拉刷新
  8946. this.isDownScrolling = false;
  8947. this.endDownScrollCall(this);
  8948. uni.stopPullDownRefresh();
  8949. return;
  8950. }
  8951. var me = this;
  8952. // 结束下拉刷新的方法
  8953. var endScroll = function endScroll() {
  8954. me.downHight = 0;
  8955. me.isDownScrolling = false;
  8956. me.endDownScrollCall(me);
  8957. if (!me.isScrollBody) {
  8958. me.setScrollHeight(0); // scroll-view重置滚动区域,使数据不满屏时仍可检查触发翻页
  8959. me.scrollTo(0, 0); // scroll-view需重置滚动条到顶部,避免startTop大于0时,对下拉刷新的影响
  8960. }
  8961. };
  8962. // 结束下拉刷新时的回调
  8963. var delay = 0;
  8964. if (me.optDown.beforeEndDownScroll) delay = me.optDown.beforeEndDownScroll(me); // 结束下拉刷新的延时,单位ms
  8965. if (typeof delay === 'number' && delay > 0) {
  8966. setTimeout(endScroll, delay);
  8967. } else {
  8968. endScroll();
  8969. }
  8970. };
  8971. MeScroll.prototype.endDownScrollCall = function () {
  8972. this.optDown.endDownScroll && this.optDown.endDownScroll(this);
  8973. this.optDown.afterEndDownScroll && this.optDown.afterEndDownScroll(this);
  8974. };
  8975. /* 锁定下拉刷新:isLock=ture,null锁定;isLock=false解锁 */
  8976. MeScroll.prototype.lockDownScroll = function (isLock) {
  8977. if (isLock == null) isLock = true;
  8978. this.optDown.isLock = isLock;
  8979. };
  8980. /* 锁定上拉加载:isLock=ture,null锁定;isLock=false解锁 */
  8981. MeScroll.prototype.lockUpScroll = function (isLock) {
  8982. if (isLock == null) isLock = true;
  8983. this.optUp.isLock = isLock;
  8984. };
  8985. /* -------初始化上拉加载------- */
  8986. MeScroll.prototype.initUpScroll = function () {
  8987. var me = this;
  8988. // 配置参数
  8989. me.optUp = me.options.up || { use: false };
  8990. if (!me.optUp.textColor && me.hasColor(me.optUp.bgColor)) me.optUp.textColor = "#fff"; // 当bgColor有值且textColor未设置,则textColor默认白色
  8991. me.extendUpScroll(me.optUp);
  8992. if (me.optUp.use === false) return; // 配置不使用上拉加载时,则不初始化上拉布局
  8993. me.optUp.hasNext = true; // 如果使用上拉,则默认有下一页
  8994. me.startNum = me.optUp.page.num + 1; // 记录page开始的页码
  8995. // 初始化完毕的回调
  8996. if (me.optUp.inited) {
  8997. setTimeout(function () {// 待主线程执行完毕再执行,避免new MeScroll未初始化,在回调获取不到mescroll的实例
  8998. me.optUp.inited(me);
  8999. }, 0);
  9000. }
  9001. };
  9002. /*滚动到底部的事件 (仅mescroll-body生效)*/
  9003. MeScroll.prototype.onReachBottom = function () {
  9004. if (this.isScrollBody && !this.isUpScrolling) {// 只能支持下拉刷新的时候同时可以触发上拉加载,否则滚动到底部就需要上滑一点才能触发onReachBottom
  9005. if (!this.optUp.isLock && this.optUp.hasNext) {
  9006. this.triggerUpScroll();
  9007. }
  9008. }
  9009. };
  9010. /*列表滚动事件 (仅mescroll-body生效)*/
  9011. MeScroll.prototype.onPageScroll = function (e) {
  9012. if (!this.isScrollBody) return;
  9013. // 更新滚动条的位置 (主要用于判断下拉刷新时,滚动条是否在顶部)
  9014. this.setScrollTop(e.scrollTop);
  9015. // 顶部按钮的显示隐藏
  9016. if (e.scrollTop >= this.optUp.toTop.offset) {
  9017. this.showTopBtn();
  9018. } else {
  9019. this.hideTopBtn();
  9020. }
  9021. };
  9022. /*列表滚动事件*/
  9023. MeScroll.prototype.scroll = function (e, onScroll) {
  9024. // 更新滚动条的位置
  9025. this.setScrollTop(e.scrollTop);
  9026. // 更新滚动内容高度
  9027. this.setScrollHeight(e.scrollHeight);
  9028. // 向上滑还是向下滑动
  9029. if (this.preScrollY == null) this.preScrollY = 0;
  9030. this.isScrollUp = e.scrollTop - this.preScrollY > 0;
  9031. this.preScrollY = e.scrollTop;
  9032. // 上滑 && 检查并触发上拉
  9033. this.isScrollUp && this.triggerUpScroll(true);
  9034. // 顶部按钮的显示隐藏
  9035. if (e.scrollTop >= this.optUp.toTop.offset) {
  9036. this.showTopBtn();
  9037. } else {
  9038. this.hideTopBtn();
  9039. }
  9040. // 滑动监听
  9041. this.optUp.onScroll && onScroll && onScroll();
  9042. };
  9043. /* 触发上拉加载 */
  9044. MeScroll.prototype.triggerUpScroll = function (isCheck) {
  9045. if (!this.isUpScrolling && this.optUp.use && this.optUp.callback) {
  9046. // 是否校验在底部; 默认不校验
  9047. if (isCheck === true) {
  9048. var canUp = false;
  9049. // 还有下一页 && 没有锁定 && 不在下拉中
  9050. if (this.optUp.hasNext && !this.optUp.isLock && !this.isDownScrolling) {
  9051. if (this.getScrollBottom() <= this.optUp.offset) {// 到底部
  9052. canUp = true; // 标记可上拉
  9053. }
  9054. }
  9055. if (canUp === false) return;
  9056. }
  9057. this.showUpScroll(); // 上拉加载中...
  9058. this.optUp.page.num++; // 预先加一页,如果失败则减回
  9059. this.isUpAutoLoad = true; // 标记上拉已经自动执行过,避免初始化时多次触发上拉回调
  9060. this.num = this.optUp.page.num; // 把最新的页数赋值在mescroll上,避免对page的影响
  9061. this.size = this.optUp.page.size; // 把最新的页码赋值在mescroll上,避免对page的影响
  9062. this.time = this.optUp.page.time; // 把最新的页码赋值在mescroll上,避免对page的影响
  9063. this.optUp.callback(this); // 执行回调,联网加载数据
  9064. }
  9065. };
  9066. /* 显示上拉加载中 */
  9067. MeScroll.prototype.showUpScroll = function () {
  9068. this.isUpScrolling = true; // 标记上拉加载中
  9069. this.optUp.showLoading && this.optUp.showLoading(this); // 回调
  9070. };
  9071. /* 显示上拉无更多数据 */
  9072. MeScroll.prototype.showNoMore = function () {
  9073. this.optUp.hasNext = false; // 标记无更多数据
  9074. this.optUp.showNoMore && this.optUp.showNoMore(this); // 回调
  9075. };
  9076. /* 隐藏上拉区域**/
  9077. MeScroll.prototype.hideUpScroll = function () {
  9078. this.optUp.hideUpScroll && this.optUp.hideUpScroll(this); // 回调
  9079. };
  9080. /* 结束上拉加载 */
  9081. MeScroll.prototype.endUpScroll = function (isShowNoMore) {
  9082. if (isShowNoMore != null) {// isShowNoMore=null,不处理下拉状态,下拉刷新的时候调用
  9083. if (isShowNoMore) {
  9084. this.showNoMore(); // isShowNoMore=true,显示无更多数据
  9085. } else {
  9086. this.hideUpScroll(); // isShowNoMore=false,隐藏上拉加载
  9087. }
  9088. }
  9089. this.isUpScrolling = false; // 标记结束上拉加载
  9090. };
  9091. /* 重置上拉加载列表为第一页
  9092. *isShowLoading 是否显示进度布局;
  9093. * 1.默认null,不传参,则显示上拉加载的进度布局
  9094. * 2.传参true, 则显示下拉刷新的进度布局
  9095. * 3.传参false,则不显示上拉和下拉的进度 (常用于静默更新列表数据)
  9096. */
  9097. MeScroll.prototype.resetUpScroll = function (isShowLoading) {
  9098. if (this.optUp && this.optUp.use) {
  9099. var page = this.optUp.page;
  9100. this.prePageNum = page.num; // 缓存重置前的页码,加载失败可退回
  9101. this.prePageTime = page.time; // 缓存重置前的时间,加载失败可退回
  9102. page.num = this.startNum; // 重置为第一页
  9103. page.time = null; // 重置时间为空
  9104. if (!this.isDownScrolling && isShowLoading !== false) {// 如果不是下拉刷新触发的resetUpScroll并且不配置列表静默更新,则显示进度;
  9105. if (isShowLoading == null) {
  9106. this.removeEmpty(); // 移除空布局
  9107. this.showUpScroll(); // 不传参,默认显示上拉加载的进度布局
  9108. } else {
  9109. this.showDownScroll(); // 传true,显示下拉刷新的进度布局,不清空列表
  9110. }
  9111. }
  9112. this.isUpAutoLoad = true; // 标记上拉已经自动执行过,避免初始化时多次触发上拉回调
  9113. this.num = page.num; // 把最新的页数赋值在mescroll上,避免对page的影响
  9114. this.size = page.size; // 把最新的页码赋值在mescroll上,避免对page的影响
  9115. this.time = page.time; // 把最新的页码赋值在mescroll上,避免对page的影响
  9116. this.optUp.callback && this.optUp.callback(this); // 执行上拉回调
  9117. }
  9118. };
  9119. /* 设置page.num的值 */
  9120. MeScroll.prototype.setPageNum = function (num) {
  9121. this.optUp.page.num = num - 1;
  9122. };
  9123. /* 设置page.size的值 */
  9124. MeScroll.prototype.setPageSize = function (size) {
  9125. this.optUp.page.size = size;
  9126. };
  9127. /* 联网回调成功,结束下拉刷新和上拉加载
  9128. * dataSize: 当前页的数据量(必传)
  9129. * totalPage: 总页数(必传)
  9130. * systime: 服务器时间 (可空)
  9131. */
  9132. MeScroll.prototype.endByPage = function (dataSize, totalPage, systime) {
  9133. var hasNext;
  9134. if (this.optUp.use && totalPage != null) hasNext = this.optUp.page.num < totalPage; // 是否还有下一页
  9135. this.endSuccess(dataSize, hasNext, systime);
  9136. };
  9137. /* 联网回调成功,结束下拉刷新和上拉加载
  9138. * dataSize: 当前页的数据量(必传)
  9139. * totalSize: 列表所有数据总数量(必传)
  9140. * systime: 服务器时间 (可空)
  9141. */
  9142. MeScroll.prototype.endBySize = function (dataSize, totalSize, systime) {
  9143. var hasNext;
  9144. if (this.optUp.use && totalSize != null) {
  9145. var loadSize = (this.optUp.page.num - 1) * this.optUp.page.size + dataSize; // 已加载的数据总数
  9146. hasNext = loadSize < totalSize; // 是否还有下一页
  9147. }
  9148. this.endSuccess(dataSize, hasNext, systime);
  9149. };
  9150. /* 联网回调成功,结束下拉刷新和上拉加载
  9151. * dataSize: 当前页的数据个数(不是所有页的数据总和),用于上拉加载判断是否还有下一页.如果不传,则会判断还有下一页
  9152. * hasNext: 是否还有下一页,布尔类型;用来解决这个小问题:比如列表共有20条数据,每页加载10条,共2页.如果只根据dataSize判断,则需翻到第三页才会知道无更多数据,如果传了hasNext,则翻到第二页即可显示无更多数据.
  9153. * systime: 服务器时间(可空);用来解决这个小问题:当准备翻下一页时,数据库新增了几条记录,此时翻下一页,前面的几条数据会和上一页的重复;这里传入了systime,那么upCallback的page.time就会有值,把page.time传给服务器,让后台过滤新加入的那几条记录
  9154. */
  9155. MeScroll.prototype.endSuccess = function (dataSize, hasNext, systime) {
  9156. var me = this;
  9157. // 结束下拉刷新
  9158. if (me.isDownScrolling) me.endDownScroll();
  9159. // 结束上拉加载
  9160. if (me.optUp.use) {
  9161. var isShowNoMore; // 是否已无更多数据
  9162. if (dataSize != null) {
  9163. var pageNum = me.optUp.page.num; // 当前页码
  9164. var pageSize = me.optUp.page.size; // 每页长度
  9165. // 如果是第一页
  9166. if (pageNum === 1) {
  9167. if (systime) me.optUp.page.time = systime; // 设置加载列表数据第一页的时间
  9168. }
  9169. if (dataSize < pageSize || hasNext === false) {
  9170. // 返回的数据不满一页时,则说明已无更多数据
  9171. me.optUp.hasNext = false;
  9172. if (dataSize === 0 && pageNum === 1) {
  9173. // 如果第一页无任何数据且配置了空布局
  9174. isShowNoMore = false;
  9175. me.showEmpty();
  9176. } else {
  9177. // 总列表数少于配置的数量,则不显示无更多数据
  9178. var allDataSize = (pageNum - 1) * pageSize + dataSize;
  9179. if (allDataSize < me.optUp.noMoreSize) {
  9180. isShowNoMore = false;
  9181. } else {
  9182. isShowNoMore = true;
  9183. }
  9184. me.removeEmpty(); // 移除空布局
  9185. }
  9186. } else {
  9187. // 还有下一页
  9188. isShowNoMore = false;
  9189. me.optUp.hasNext = true;
  9190. me.removeEmpty(); // 移除空布局
  9191. }
  9192. }
  9193. // 隐藏上拉
  9194. me.endUpScroll(isShowNoMore);
  9195. }
  9196. };
  9197. /* 回调失败,结束下拉刷新和上拉加载 */
  9198. MeScroll.prototype.endErr = function (errDistance) {
  9199. // 结束下拉,回调失败重置回原来的页码和时间
  9200. if (this.isDownScrolling) {
  9201. var page = this.optUp.page;
  9202. if (page && this.prePageNum) {
  9203. page.num = this.prePageNum;
  9204. page.time = this.prePageTime;
  9205. }
  9206. this.endDownScroll();
  9207. }
  9208. // 结束上拉,回调失败重置回原来的页码
  9209. if (this.isUpScrolling) {
  9210. this.optUp.page.num--;
  9211. this.endUpScroll(false);
  9212. // 如果是mescroll-body,则需往回滚一定距离
  9213. if (this.isScrollBody && errDistance !== 0) {// 不处理0
  9214. if (!errDistance) errDistance = this.optUp.errDistance; // 不传,则取默认
  9215. this.scrollTo(this.getScrollTop() - errDistance, 0); // 往上回滚的距离
  9216. }
  9217. }
  9218. };
  9219. /* 显示空布局 */
  9220. MeScroll.prototype.showEmpty = function () {
  9221. this.optUp.empty.use && this.optUp.empty.onShow && this.optUp.empty.onShow(true);
  9222. };
  9223. /* 移除空布局 */
  9224. MeScroll.prototype.removeEmpty = function () {
  9225. this.optUp.empty.use && this.optUp.empty.onShow && this.optUp.empty.onShow(false);
  9226. };
  9227. /* 显示回到顶部的按钮 */
  9228. MeScroll.prototype.showTopBtn = function () {
  9229. if (!this.topBtnShow) {
  9230. this.topBtnShow = true;
  9231. this.optUp.toTop.onShow && this.optUp.toTop.onShow(true);
  9232. }
  9233. };
  9234. /* 隐藏回到顶部的按钮 */
  9235. MeScroll.prototype.hideTopBtn = function () {
  9236. if (this.topBtnShow) {
  9237. this.topBtnShow = false;
  9238. this.optUp.toTop.onShow && this.optUp.toTop.onShow(false);
  9239. }
  9240. };
  9241. /* 获取滚动条的位置 */
  9242. MeScroll.prototype.getScrollTop = function () {
  9243. return this.scrollTop || 0;
  9244. };
  9245. /* 记录滚动条的位置 */
  9246. MeScroll.prototype.setScrollTop = function (y) {
  9247. this.scrollTop = y;
  9248. };
  9249. /* 滚动到指定位置 */
  9250. MeScroll.prototype.scrollTo = function (y, t) {
  9251. this.myScrollTo && this.myScrollTo(y, t); // scrollview需自定义回到顶部方法
  9252. };
  9253. /* 自定义scrollTo */
  9254. MeScroll.prototype.resetScrollTo = function (myScrollTo) {
  9255. this.myScrollTo = myScrollTo;
  9256. };
  9257. /* 滚动条到底部的距离 */
  9258. MeScroll.prototype.getScrollBottom = function () {
  9259. return this.getScrollHeight() - this.getClientHeight() - this.getScrollTop();
  9260. };
  9261. /* 计步器
  9262. star: 开始值
  9263. end: 结束值
  9264. callback(step,timer): 回调step值,计步器timer,可自行通过window.clearInterval(timer)结束计步器;
  9265. t: 计步时长,传0则直接回调end值;不传则默认300ms
  9266. rate: 周期;不传则默认30ms计步一次
  9267. * */
  9268. MeScroll.prototype.getStep = function (star, end, callback, t, rate) {
  9269. var diff = end - star; // 差值
  9270. if (t === 0 || diff === 0) {
  9271. callback && callback(end);
  9272. return;
  9273. }
  9274. t = t || 300; // 时长 300ms
  9275. rate = rate || 30; // 周期 30ms
  9276. var count = t / rate; // 次数
  9277. var step = diff / count; // 步长
  9278. var i = 0; // 计数
  9279. var timer = setInterval(function () {
  9280. if (i < count - 1) {
  9281. star += step;
  9282. callback && callback(star, timer);
  9283. i++;
  9284. } else {
  9285. callback && callback(end, timer); // 最后一次直接设置end,避免计算误差
  9286. clearInterval(timer);
  9287. }
  9288. }, rate);
  9289. };
  9290. /* 滚动容器的高度 */
  9291. MeScroll.prototype.getClientHeight = function (isReal) {
  9292. var h = this.clientHeight || 0;
  9293. if (h === 0 && isReal !== true) {// 未获取到容器的高度,可临时取body的高度 (可能会有误差)
  9294. h = this.getBodyHeight();
  9295. }
  9296. return h;
  9297. };
  9298. MeScroll.prototype.setClientHeight = function (h) {
  9299. this.clientHeight = h;
  9300. };
  9301. /* 滚动内容的高度 */
  9302. MeScroll.prototype.getScrollHeight = function () {
  9303. return this.scrollHeight || 0;
  9304. };
  9305. MeScroll.prototype.setScrollHeight = function (h) {
  9306. this.scrollHeight = h;
  9307. };
  9308. /* body的高度 */
  9309. MeScroll.prototype.getBodyHeight = function () {
  9310. return this.bodyHeight || 0;
  9311. };
  9312. MeScroll.prototype.setBodyHeight = function (h) {
  9313. this.bodyHeight = h;
  9314. };
  9315. /* 阻止浏览器默认滚动事件 */
  9316. MeScroll.prototype.preventDefault = function (e) {
  9317. // 小程序不支持e.preventDefault, 已在wxs中禁止
  9318. // app的bounce只能通过配置pages.json的style.app-plus.bounce为"none"来禁止, 或使用renderjs禁止
  9319. // cancelable:是否可以被禁用; defaultPrevented:是否已经被禁用
  9320. if (e && e.cancelable && !e.defaultPrevented) e.preventDefault();
  9321. };
  9322. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9323. /***/ }),
  9324. /* 83 */
  9325. /*!*************************************************************************!*\
  9326. !*** D:/wwwroot/HDhotel/components/mescroll-uni/mescroll-uni-option.js ***!
  9327. \*************************************************************************/
  9328. /*! no static exports found */
  9329. /***/ (function(module, exports, __webpack_require__) {
  9330. "use strict";
  9331. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 全局配置
  9332. // mescroll-body 和 mescroll-uni 通用
  9333. var GlobalOption = {
  9334. down: {
  9335. // 其他down的配置参数也可以写,这里只展示了常用的配置:
  9336. textInOffset: '下拉刷新', // 下拉的距离在offset范围内的提示文本
  9337. textOutOffset: '释放更新', // 下拉的距离大于offset范围的提示文本
  9338. textLoading: '加载中 ...', // 加载中的提示文本
  9339. offset: 80, // 在列表顶部,下拉大于80px,松手即可触发下拉刷新的回调
  9340. native: false // 是否使用系统自带的下拉刷新; 默认false; 仅在mescroll-body生效 (值为true时,还需在pages配置enablePullDownRefresh:true;详请参考mescroll-native的案例)
  9341. },
  9342. up: {
  9343. // 其他up的配置参数也可以写,这里只展示了常用的配置:
  9344. textLoading: '加载中 ...', // 加载中的提示文本
  9345. textNoMore: '-- END --', // 没有更多数据的提示文本
  9346. offset: 80, // 距底部多远时,触发upCallback
  9347. toTop: {
  9348. // 回到顶部按钮,需配置src才显示
  9349. src: "http://www.mescroll.com/img/mescroll-totop.png?v=1", // 图片路径 (建议放入static目录, 如 /static/img/mescroll-totop.png )
  9350. offset: 1000, // 列表滚动多少距离才显示回到顶部按钮,默认1000px
  9351. right: 20, // 到右边的距离, 默认20 (支持"20rpx", "20px", "20%"格式的值, 纯数字则默认单位rpx)
  9352. bottom: 120, // 到底部的距离, 默认120 (支持"20rpx", "20px", "20%"格式的值, 纯数字则默认单位rpx)
  9353. width: 72 // 回到顶部图标的宽度, 默认72 (支持"20rpx", "20px", "20%"格式的值, 纯数字则默认单位rpx)
  9354. },
  9355. empty: {
  9356. use: true, // 是否显示空布局
  9357. icon: "http://www.mescroll.com/img/mescroll-empty.png?v=1", // 图标路径 (建议放入static目录, 如 /static/img/mescroll-empty.png )
  9358. tip: '~ 空空如也 ~' // 提示
  9359. } } };var _default =
  9360. GlobalOption;exports.default = _default;
  9361. /***/ }),
  9362. /* 84 */
  9363. /*!****************************************************************!*\
  9364. !*** D:/wwwroot/HDhotel/components/mescroll-uni/wxs/mixins.js ***!
  9365. \****************************************************************/
  9366. /*! no static exports found */
  9367. /***/ (function(module, exports, __webpack_require__) {
  9368. "use strict";
  9369. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 定义在wxs (含renderjs) 逻辑层的数据和方法, 与视图层相互通信
  9370. var WxsMixin = {
  9371. data: function data() {
  9372. return {
  9373. // 传入wxs视图层的数据 (响应式)
  9374. wxsProp: {
  9375. optDown: {}, // 下拉刷新的配置
  9376. scrollTop: 0, // 滚动条的距离
  9377. bodyHeight: 0, // body的高度
  9378. isDownScrolling: false, // 是否正在下拉刷新中
  9379. isUpScrolling: false, // 是否正在上拉加载中
  9380. isScrollBody: true, // 是否为mescroll-body滚动
  9381. isUpBoth: true, // 上拉加载时,是否同时可以下拉刷新
  9382. t: 0 // 数据更新的标记 (只有数据更新了,才会触发wxs的Observer)
  9383. },
  9384. // 标记调用wxs视图层的方法
  9385. callProp: {
  9386. callType: '', // 方法名
  9387. t: 0 // 数据更新的标记 (只有数据更新了,才会触发wxs的Observer)
  9388. },
  9389. // 不用wxs的平台使用此处的wxsBiz对象,抹平wxs的写法 (微信小程序和APP使用的wxsBiz对象是./wxs/wxs.wxs)
  9390. // 不用renderjs的平台使用此处的renderBiz对象,抹平renderjs的写法 (app 和 h5 使用的renderBiz对象是./wxs/renderjs.js)
  9391. renderBiz: {
  9392. propObserver: function propObserver() {} // 抹平renderjs的写法
  9393. } };
  9394. },
  9395. methods: {
  9396. // wxs视图层调用逻辑层的回调
  9397. wxsCall: function wxsCall(msg) {
  9398. if (msg.type === 'setWxsProp') {
  9399. // 更新wxsProp数据 (值改变才触发更新)
  9400. this.wxsProp = {
  9401. optDown: this.mescroll.optDown,
  9402. scrollTop: this.mescroll.getScrollTop(),
  9403. bodyHeight: this.mescroll.getBodyHeight(),
  9404. isDownScrolling: this.mescroll.isDownScrolling,
  9405. isUpScrolling: this.mescroll.isUpScrolling,
  9406. isUpBoth: this.mescroll.optUp.isBoth,
  9407. isScrollBody: this.mescroll.isScrollBody,
  9408. t: Date.now() };
  9409. } else if (msg.type === 'setLoadType') {
  9410. // 设置inOffset,outOffset的状态
  9411. this.downLoadType = msg.downLoadType;
  9412. } else if (msg.type === 'triggerDownScroll') {
  9413. // 主动触发下拉刷新
  9414. this.mescroll.triggerDownScroll();
  9415. } else if (msg.type === 'endDownScroll') {
  9416. // 结束下拉刷新
  9417. this.mescroll.endDownScroll();
  9418. } else if (msg.type === 'triggerUpScroll') {
  9419. // 主动触发上拉加载
  9420. this.mescroll.triggerUpScroll(true);
  9421. }
  9422. } },
  9423. mounted: function mounted() {var _this = this;
  9424. // 配置主动触发wxs显示加载进度的回调
  9425. this.mescroll.optDown.afterLoading = function () {
  9426. _this.callProp = { callType: "showLoading", t: Date.now() }; // 触发wxs的方法 (值改变才触发更新)
  9427. };
  9428. // 配置主动触发wxs隐藏加载进度的回调
  9429. this.mescroll.optDown.afterEndDownScroll = function () {
  9430. _this.callProp = { callType: "endDownScroll", t: Date.now() }; // 触发wxs的方法 (值改变才触发更新)
  9431. setTimeout(function () {
  9432. if (_this.downLoadType === 4 || _this.downLoadType === 0) {
  9433. _this.callProp = { callType: "clearTransform", t: Date.now() }; // 触发wxs的方法 (值改变才触发更新)
  9434. }
  9435. }, 320);
  9436. };
  9437. // 初始化wxs的数据
  9438. this.wxsCall({ type: 'setWxsProp' });
  9439. } };var _default =
  9440. WxsMixin;exports.default = _default;
  9441. /***/ })
  9442. ]]);
  9443. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map