vendor.js 375 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],{
  2. /***/ 1:
  3. /*!************************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  5. \************************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. 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 _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  10. var _toString = Object.prototype.toString;
  11. var hasOwnProperty = Object.prototype.hasOwnProperty;
  12. function isFn(fn) {
  13. return typeof fn === 'function';
  14. }
  15. function isStr(str) {
  16. return typeof str === 'string';
  17. }
  18. function isPlainObject(obj) {
  19. return _toString.call(obj) === '[object Object]';
  20. }
  21. function hasOwn(obj, key) {
  22. return hasOwnProperty.call(obj, key);
  23. }
  24. function noop() {}
  25. /**
  26. * Create a cached version of a pure function.
  27. */
  28. function cached(fn) {
  29. var cache = Object.create(null);
  30. return function cachedFn(str) {
  31. var hit = cache[str];
  32. return hit || (cache[str] = fn(str));
  33. };
  34. }
  35. /**
  36. * Camelize a hyphen-delimited string.
  37. */
  38. var camelizeRE = /-(\w)/g;
  39. var camelize = cached(function (str) {
  40. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  41. });
  42. var HOOKS = [
  43. 'invoke',
  44. 'success',
  45. 'fail',
  46. 'complete',
  47. 'returnValue'];
  48. var globalInterceptors = {};
  49. var scopedInterceptors = {};
  50. function mergeHook(parentVal, childVal) {
  51. var res = childVal ?
  52. parentVal ?
  53. parentVal.concat(childVal) :
  54. Array.isArray(childVal) ?
  55. childVal : [childVal] :
  56. parentVal;
  57. return res ?
  58. dedupeHooks(res) :
  59. res;
  60. }
  61. function dedupeHooks(hooks) {
  62. var res = [];
  63. for (var i = 0; i < hooks.length; i++) {
  64. if (res.indexOf(hooks[i]) === -1) {
  65. res.push(hooks[i]);
  66. }
  67. }
  68. return res;
  69. }
  70. function removeHook(hooks, hook) {
  71. var index = hooks.indexOf(hook);
  72. if (index !== -1) {
  73. hooks.splice(index, 1);
  74. }
  75. }
  76. function mergeInterceptorHook(interceptor, option) {
  77. Object.keys(option).forEach(function (hook) {
  78. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  79. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  80. }
  81. });
  82. }
  83. function removeInterceptorHook(interceptor, option) {
  84. if (!interceptor || !option) {
  85. return;
  86. }
  87. Object.keys(option).forEach(function (hook) {
  88. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  89. removeHook(interceptor[hook], option[hook]);
  90. }
  91. });
  92. }
  93. function addInterceptor(method, option) {
  94. if (typeof method === 'string' && isPlainObject(option)) {
  95. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  96. } else if (isPlainObject(method)) {
  97. mergeInterceptorHook(globalInterceptors, method);
  98. }
  99. }
  100. function removeInterceptor(method, option) {
  101. if (typeof method === 'string') {
  102. if (isPlainObject(option)) {
  103. removeInterceptorHook(scopedInterceptors[method], option);
  104. } else {
  105. delete scopedInterceptors[method];
  106. }
  107. } else if (isPlainObject(method)) {
  108. removeInterceptorHook(globalInterceptors, method);
  109. }
  110. }
  111. function wrapperHook(hook) {
  112. return function (data) {
  113. return hook(data) || data;
  114. };
  115. }
  116. function isPromise(obj) {
  117. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  118. }
  119. function queue(hooks, data) {
  120. var promise = false;
  121. for (var i = 0; i < hooks.length; i++) {
  122. var hook = hooks[i];
  123. if (promise) {
  124. promise = Promise.resolve(wrapperHook(hook));
  125. } else {
  126. var res = hook(data);
  127. if (isPromise(res)) {
  128. promise = Promise.resolve(res);
  129. }
  130. if (res === false) {
  131. return {
  132. then: function then() {} };
  133. }
  134. }
  135. }
  136. return promise || {
  137. then: function then(callback) {
  138. return callback(data);
  139. } };
  140. }
  141. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  142. ['success', 'fail', 'complete'].forEach(function (name) {
  143. if (Array.isArray(interceptor[name])) {
  144. var oldCallback = options[name];
  145. options[name] = function callbackInterceptor(res) {
  146. queue(interceptor[name], res).then(function (res) {
  147. /* eslint-disable no-mixed-operators */
  148. return isFn(oldCallback) && oldCallback(res) || res;
  149. });
  150. };
  151. }
  152. });
  153. return options;
  154. }
  155. function wrapperReturnValue(method, returnValue) {
  156. var returnValueHooks = [];
  157. if (Array.isArray(globalInterceptors.returnValue)) {
  158. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  159. }
  160. var interceptor = scopedInterceptors[method];
  161. if (interceptor && Array.isArray(interceptor.returnValue)) {
  162. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  163. }
  164. returnValueHooks.forEach(function (hook) {
  165. returnValue = hook(returnValue) || returnValue;
  166. });
  167. return returnValue;
  168. }
  169. function getApiInterceptorHooks(method) {
  170. var interceptor = Object.create(null);
  171. Object.keys(globalInterceptors).forEach(function (hook) {
  172. if (hook !== 'returnValue') {
  173. interceptor[hook] = globalInterceptors[hook].slice();
  174. }
  175. });
  176. var scopedInterceptor = scopedInterceptors[method];
  177. if (scopedInterceptor) {
  178. Object.keys(scopedInterceptor).forEach(function (hook) {
  179. if (hook !== 'returnValue') {
  180. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  181. }
  182. });
  183. }
  184. return interceptor;
  185. }
  186. function invokeApi(method, api, options) {for (var _len = arguments.length, params = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {params[_key - 3] = arguments[_key];}
  187. var interceptor = getApiInterceptorHooks(method);
  188. if (interceptor && Object.keys(interceptor).length) {
  189. if (Array.isArray(interceptor.invoke)) {
  190. var res = queue(interceptor.invoke, options);
  191. return res.then(function (options) {
  192. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  193. });
  194. } else {
  195. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  196. }
  197. }
  198. return api.apply(void 0, [options].concat(params));
  199. }
  200. var promiseInterceptor = {
  201. returnValue: function returnValue(res) {
  202. if (!isPromise(res)) {
  203. return res;
  204. }
  205. return res.then(function (res) {
  206. return res[1];
  207. }).catch(function (res) {
  208. return res[0];
  209. });
  210. } };
  211. var SYNC_API_RE =
  212. /^\$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64/;
  213. var CONTEXT_API_RE = /^create|Manager$/;
  214. // Context例外情况
  215. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  216. // 同步例外情况
  217. var ASYNC_API = ['createBLEConnection'];
  218. var CALLBACK_API_RE = /^on|^off/;
  219. function isContextApi(name) {
  220. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  221. }
  222. function isSyncApi(name) {
  223. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  224. }
  225. function isCallbackApi(name) {
  226. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  227. }
  228. function handlePromise(promise) {
  229. return promise.then(function (data) {
  230. return [null, data];
  231. }).
  232. catch(function (err) {return [err];});
  233. }
  234. function shouldPromise(name) {
  235. if (
  236. isContextApi(name) ||
  237. isSyncApi(name) ||
  238. isCallbackApi(name))
  239. {
  240. return false;
  241. }
  242. return true;
  243. }
  244. /* eslint-disable no-extend-native */
  245. if (!Promise.prototype.finally) {
  246. Promise.prototype.finally = function (callback) {
  247. var promise = this.constructor;
  248. return this.then(
  249. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  250. function (reason) {return promise.resolve(callback()).then(function () {
  251. throw reason;
  252. });});
  253. };
  254. }
  255. function promisify(name, api) {
  256. if (!shouldPromise(name)) {
  257. return api;
  258. }
  259. return function promiseApi() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {params[_key2 - 1] = arguments[_key2];}
  260. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  261. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  262. }
  263. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  264. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  265. success: resolve,
  266. fail: reject })].concat(
  267. params));
  268. })));
  269. };
  270. }
  271. var EPS = 1e-4;
  272. var BASE_DEVICE_WIDTH = 750;
  273. var isIOS = false;
  274. var deviceWidth = 0;
  275. var deviceDPR = 0;
  276. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  277. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  278. deviceWidth = windowWidth;
  279. deviceDPR = pixelRatio;
  280. isIOS = platform === 'ios';
  281. }
  282. function upx2px(number, newDeviceWidth) {
  283. if (deviceWidth === 0) {
  284. checkDeviceWidth();
  285. }
  286. number = Number(number);
  287. if (number === 0) {
  288. return 0;
  289. }
  290. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  291. if (result < 0) {
  292. result = -result;
  293. }
  294. result = Math.floor(result + EPS);
  295. if (result === 0) {
  296. if (deviceDPR === 1 || !isIOS) {
  297. result = 1;
  298. } else {
  299. result = 0.5;
  300. }
  301. }
  302. return number < 0 ? -result : result;
  303. }
  304. var interceptors = {
  305. promiseInterceptor: promiseInterceptor };
  306. var baseApi = /*#__PURE__*/Object.freeze({
  307. __proto__: null,
  308. upx2px: upx2px,
  309. addInterceptor: addInterceptor,
  310. removeInterceptor: removeInterceptor,
  311. interceptors: interceptors });var
  312. EventChannel = /*#__PURE__*/function () {
  313. function EventChannel(id, events) {var _this = this;_classCallCheck(this, EventChannel);
  314. this.id = id;
  315. this.listener = {};
  316. this.emitCache = {};
  317. if (events) {
  318. Object.keys(events).forEach(function (name) {
  319. _this.on(name, events[name]);
  320. });
  321. }
  322. }_createClass(EventChannel, [{ key: "emit", value: function emit(
  323. eventName) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  324. var fns = this.listener[eventName];
  325. if (!fns) {
  326. return (this.emitCache[eventName] || (this.emitCache[eventName] = [])).push(args);
  327. }
  328. fns.forEach(function (opt) {
  329. opt.fn.apply(opt.fn, args);
  330. });
  331. this.listener[eventName] = fns.filter(function (opt) {return opt.type !== 'once';});
  332. } }, { key: "on", value: function on(
  333. eventName, fn) {
  334. this._addListener(eventName, 'on', fn);
  335. this._clearCache(eventName);
  336. } }, { key: "once", value: function once(
  337. eventName, fn) {
  338. this._addListener(eventName, 'once', fn);
  339. this._clearCache(eventName);
  340. } }, { key: "off", value: function off(
  341. eventName, fn) {
  342. var fns = this.listener[eventName];
  343. if (!fns) {
  344. return;
  345. }
  346. if (fn) {
  347. for (var i = 0; i < fns.length;) {
  348. if (fns[i].fn === fn) {
  349. fns.splice(i, 1);
  350. i--;
  351. }
  352. i++;
  353. }
  354. } else {
  355. delete this.listener[eventName];
  356. }
  357. } }, { key: "_clearCache", value: function _clearCache(
  358. eventName) {
  359. var cacheArgs = this.emitCache[eventName];
  360. if (cacheArgs) {
  361. for (; cacheArgs.length > 0;) {
  362. this.emit.apply(this, [eventName].concat(cacheArgs.shift()));
  363. }
  364. }
  365. } }, { key: "_addListener", value: function _addListener(
  366. eventName, type, fn) {
  367. (this.listener[eventName] || (this.listener[eventName] = [])).push({
  368. fn: fn,
  369. type: type });
  370. } }]);return EventChannel;}();
  371. var eventChannels = {};
  372. var eventChannelStack = [];
  373. var id = 0;
  374. function initEventChannel(events) {var cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  375. id++;
  376. var eventChannel = new EventChannel(id, events);
  377. if (cache) {
  378. eventChannels[id] = eventChannel;
  379. eventChannelStack.push(eventChannel);
  380. }
  381. return eventChannel;
  382. }
  383. function getEventChannel(id) {
  384. if (id) {
  385. var eventChannel = eventChannels[id];
  386. delete eventChannels[id];
  387. return eventChannel;
  388. }
  389. return eventChannelStack.shift();
  390. }
  391. var navigateTo = {
  392. args: function args(fromArgs, toArgs) {
  393. var id = initEventChannel(fromArgs.events).id;
  394. if (fromArgs.url) {
  395. fromArgs.url = fromArgs.url + (fromArgs.url.indexOf('?') === -1 ? '?' : '&') + '__id__=' + id;
  396. }
  397. },
  398. returnValue: function returnValue(fromRes, toRes) {
  399. fromRes.eventChannel = getEventChannel();
  400. } };
  401. function findExistsPageIndex(url) {
  402. var pages = getCurrentPages();
  403. var len = pages.length;
  404. while (len--) {
  405. var page = pages[len];
  406. if (page.$page && page.$page.fullPath === url) {
  407. return len;
  408. }
  409. }
  410. return -1;
  411. }
  412. var redirectTo = {
  413. name: function name(fromArgs) {
  414. if (fromArgs.exists === 'back' && fromArgs.delta) {
  415. return 'navigateBack';
  416. }
  417. return 'redirectTo';
  418. },
  419. args: function args(fromArgs) {
  420. if (fromArgs.exists === 'back' && fromArgs.url) {
  421. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  422. if (existsPageIndex !== -1) {
  423. var delta = getCurrentPages().length - 1 - existsPageIndex;
  424. if (delta > 0) {
  425. fromArgs.delta = delta;
  426. }
  427. }
  428. }
  429. } };
  430. var previewImage = {
  431. args: function args(fromArgs) {
  432. var currentIndex = parseInt(fromArgs.current);
  433. if (isNaN(currentIndex)) {
  434. return;
  435. }
  436. var urls = fromArgs.urls;
  437. if (!Array.isArray(urls)) {
  438. return;
  439. }
  440. var len = urls.length;
  441. if (!len) {
  442. return;
  443. }
  444. if (currentIndex < 0) {
  445. currentIndex = 0;
  446. } else if (currentIndex >= len) {
  447. currentIndex = len - 1;
  448. }
  449. if (currentIndex > 0) {
  450. fromArgs.current = urls[currentIndex];
  451. fromArgs.urls = urls.filter(
  452. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  453. } else {
  454. fromArgs.current = urls[0];
  455. }
  456. return {
  457. indicator: false,
  458. loop: false };
  459. } };
  460. function addSafeAreaInsets(result) {
  461. if (result.safeArea) {
  462. var safeArea = result.safeArea;
  463. result.safeAreaInsets = {
  464. top: safeArea.top,
  465. left: safeArea.left,
  466. right: result.windowWidth - safeArea.right,
  467. bottom: result.windowHeight - safeArea.bottom };
  468. }
  469. }
  470. var protocols = {
  471. redirectTo: redirectTo,
  472. navigateTo: navigateTo,
  473. previewImage: previewImage,
  474. getSystemInfo: {
  475. returnValue: addSafeAreaInsets },
  476. getSystemInfoSync: {
  477. returnValue: addSafeAreaInsets } };
  478. var todos = [
  479. 'vibrate',
  480. 'preloadPage',
  481. 'unPreloadPage',
  482. 'loadSubPackage'];
  483. var canIUses = [];
  484. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  485. function processCallback(methodName, method, returnValue) {
  486. return function (res) {
  487. return method(processReturnValue(methodName, res, returnValue));
  488. };
  489. }
  490. 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;
  491. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  492. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  493. if (isFn(argsOption)) {
  494. argsOption = argsOption(fromArgs, toArgs) || {};
  495. }
  496. for (var key in fromArgs) {
  497. if (hasOwn(argsOption, key)) {
  498. var keyOption = argsOption[key];
  499. if (isFn(keyOption)) {
  500. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  501. }
  502. if (!keyOption) {// 不支持的参数
  503. console.warn("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F ".concat(methodName, "\u6682\u4E0D\u652F\u6301").concat(key));
  504. } else if (isStr(keyOption)) {// 重写参数 key
  505. toArgs[keyOption] = fromArgs[key];
  506. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  507. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  508. }
  509. } else if (CALLBACKS.indexOf(key) !== -1) {
  510. if (isFn(fromArgs[key])) {
  511. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  512. }
  513. } else {
  514. if (!keepFromArgs) {
  515. toArgs[key] = fromArgs[key];
  516. }
  517. }
  518. }
  519. return toArgs;
  520. } else if (isFn(fromArgs)) {
  521. fromArgs = processCallback(methodName, fromArgs, returnValue);
  522. }
  523. return fromArgs;
  524. }
  525. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  526. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  527. res = protocols.returnValue(methodName, res);
  528. }
  529. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  530. }
  531. function wrapper(methodName, method) {
  532. if (hasOwn(protocols, methodName)) {
  533. var protocol = protocols[methodName];
  534. if (!protocol) {// 暂不支持的 api
  535. return function () {
  536. console.error("\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F \u6682\u4E0D\u652F\u6301".concat(methodName));
  537. };
  538. }
  539. return function (arg1, arg2) {// 目前 api 最多两个参数
  540. var options = protocol;
  541. if (isFn(protocol)) {
  542. options = protocol(arg1);
  543. }
  544. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  545. var args = [arg1];
  546. if (typeof arg2 !== 'undefined') {
  547. args.push(arg2);
  548. }
  549. if (isFn(options.name)) {
  550. methodName = options.name(arg1);
  551. } else if (isStr(options.name)) {
  552. methodName = options.name;
  553. }
  554. var returnValue = wx[methodName].apply(wx, args);
  555. if (isSyncApi(methodName)) {// 同步 api
  556. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  557. }
  558. return returnValue;
  559. };
  560. }
  561. return method;
  562. }
  563. var todoApis = Object.create(null);
  564. var TODOS = [
  565. 'onTabBarMidButtonTap',
  566. 'subscribePush',
  567. 'unsubscribePush',
  568. 'onPush',
  569. 'offPush',
  570. 'share'];
  571. function createTodoApi(name) {
  572. return function todoApi(_ref)
  573. {var fail = _ref.fail,complete = _ref.complete;
  574. var res = {
  575. errMsg: "".concat(name, ":fail:\u6682\u4E0D\u652F\u6301 ").concat(name, " \u65B9\u6CD5") };
  576. isFn(fail) && fail(res);
  577. isFn(complete) && complete(res);
  578. };
  579. }
  580. TODOS.forEach(function (name) {
  581. todoApis[name] = createTodoApi(name);
  582. });
  583. var providers = {
  584. oauth: ['weixin'],
  585. share: ['weixin'],
  586. payment: ['wxpay'],
  587. push: ['weixin'] };
  588. function getProvider(_ref2)
  589. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  590. var res = false;
  591. if (providers[service]) {
  592. res = {
  593. errMsg: 'getProvider:ok',
  594. service: service,
  595. provider: providers[service] };
  596. isFn(success) && success(res);
  597. } else {
  598. res = {
  599. errMsg: 'getProvider:fail:服务[' + service + ']不存在' };
  600. isFn(fail) && fail(res);
  601. }
  602. isFn(complete) && complete(res);
  603. }
  604. var extraApi = /*#__PURE__*/Object.freeze({
  605. __proto__: null,
  606. getProvider: getProvider });
  607. var getEmitter = function () {
  608. var Emitter;
  609. return function getUniEmitter() {
  610. if (!Emitter) {
  611. Emitter = new _vue.default();
  612. }
  613. return Emitter;
  614. };
  615. }();
  616. function apply(ctx, method, args) {
  617. return ctx[method].apply(ctx, args);
  618. }
  619. function $on() {
  620. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  621. }
  622. function $off() {
  623. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  624. }
  625. function $once() {
  626. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  627. }
  628. function $emit() {
  629. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  630. }
  631. var eventApi = /*#__PURE__*/Object.freeze({
  632. __proto__: null,
  633. $on: $on,
  634. $off: $off,
  635. $once: $once,
  636. $emit: $emit });
  637. var api = /*#__PURE__*/Object.freeze({
  638. __proto__: null });
  639. var MPPage = Page;
  640. var MPComponent = Component;
  641. var customizeRE = /:/g;
  642. var customize = cached(function (str) {
  643. return camelize(str.replace(customizeRE, '-'));
  644. });
  645. function initTriggerEvent(mpInstance) {
  646. {
  647. if (!wx.canIUse('nextTick')) {
  648. return;
  649. }
  650. }
  651. var oldTriggerEvent = mpInstance.triggerEvent;
  652. mpInstance.triggerEvent = function (event) {for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {args[_key4 - 1] = arguments[_key4];}
  653. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  654. };
  655. }
  656. function initHook(name, options) {
  657. var oldHook = options[name];
  658. if (!oldHook) {
  659. options[name] = function () {
  660. initTriggerEvent(this);
  661. };
  662. } else {
  663. options[name] = function () {
  664. initTriggerEvent(this);for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  665. return oldHook.apply(this, args);
  666. };
  667. }
  668. }
  669. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  670. initHook('onLoad', options);
  671. return MPPage(options);
  672. };
  673. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  674. initHook('created', options);
  675. return MPComponent(options);
  676. };
  677. var PAGE_EVENT_HOOKS = [
  678. 'onPullDownRefresh',
  679. 'onReachBottom',
  680. 'onAddToFavorites',
  681. 'onShareTimeline',
  682. 'onShareAppMessage',
  683. 'onPageScroll',
  684. 'onResize',
  685. 'onTabItemTap'];
  686. function initMocks(vm, mocks) {
  687. var mpInstance = vm.$mp[vm.mpType];
  688. mocks.forEach(function (mock) {
  689. if (hasOwn(mpInstance, mock)) {
  690. vm[mock] = mpInstance[mock];
  691. }
  692. });
  693. }
  694. function hasHook(hook, vueOptions) {
  695. if (!vueOptions) {
  696. return true;
  697. }
  698. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  699. return true;
  700. }
  701. vueOptions = vueOptions.default || vueOptions;
  702. if (isFn(vueOptions)) {
  703. if (isFn(vueOptions.extendOptions[hook])) {
  704. return true;
  705. }
  706. if (vueOptions.super &&
  707. vueOptions.super.options &&
  708. Array.isArray(vueOptions.super.options[hook])) {
  709. return true;
  710. }
  711. return false;
  712. }
  713. if (isFn(vueOptions[hook])) {
  714. return true;
  715. }
  716. var mixins = vueOptions.mixins;
  717. if (Array.isArray(mixins)) {
  718. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  719. }
  720. }
  721. function initHooks(mpOptions, hooks, vueOptions) {
  722. hooks.forEach(function (hook) {
  723. if (hasHook(hook, vueOptions)) {
  724. mpOptions[hook] = function (args) {
  725. return this.$vm && this.$vm.__call_hook(hook, args);
  726. };
  727. }
  728. });
  729. }
  730. function initVueComponent(Vue, vueOptions) {
  731. vueOptions = vueOptions.default || vueOptions;
  732. var VueComponent;
  733. if (isFn(vueOptions)) {
  734. VueComponent = vueOptions;
  735. } else {
  736. VueComponent = Vue.extend(vueOptions);
  737. }
  738. vueOptions = VueComponent.options;
  739. return [VueComponent, vueOptions];
  740. }
  741. function initSlots(vm, vueSlots) {
  742. if (Array.isArray(vueSlots) && vueSlots.length) {
  743. var $slots = Object.create(null);
  744. vueSlots.forEach(function (slotName) {
  745. $slots[slotName] = true;
  746. });
  747. vm.$scopedSlots = vm.$slots = $slots;
  748. }
  749. }
  750. function initVueIds(vueIds, mpInstance) {
  751. vueIds = (vueIds || '').split(',');
  752. var len = vueIds.length;
  753. if (len === 1) {
  754. mpInstance._$vueId = vueIds[0];
  755. } else if (len === 2) {
  756. mpInstance._$vueId = vueIds[0];
  757. mpInstance._$vuePid = vueIds[1];
  758. }
  759. }
  760. function initData(vueOptions, context) {
  761. var data = vueOptions.data || {};
  762. var methods = vueOptions.methods || {};
  763. if (typeof data === 'function') {
  764. try {
  765. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  766. } catch (e) {
  767. if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  768. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  769. }
  770. }
  771. } else {
  772. try {
  773. // 对 data 格式化
  774. data = JSON.parse(JSON.stringify(data));
  775. } catch (e) {}
  776. }
  777. if (!isPlainObject(data)) {
  778. data = {};
  779. }
  780. Object.keys(methods).forEach(function (methodName) {
  781. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  782. data[methodName] = methods[methodName];
  783. }
  784. });
  785. return data;
  786. }
  787. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  788. function createObserver(name) {
  789. return function observer(newVal, oldVal) {
  790. if (this.$vm) {
  791. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  792. }
  793. };
  794. }
  795. function initBehaviors(vueOptions, initBehavior) {
  796. var vueBehaviors = vueOptions.behaviors;
  797. var vueExtends = vueOptions.extends;
  798. var vueMixins = vueOptions.mixins;
  799. var vueProps = vueOptions.props;
  800. if (!vueProps) {
  801. vueOptions.props = vueProps = [];
  802. }
  803. var behaviors = [];
  804. if (Array.isArray(vueBehaviors)) {
  805. vueBehaviors.forEach(function (behavior) {
  806. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  807. if (behavior === 'uni://form-field') {
  808. if (Array.isArray(vueProps)) {
  809. vueProps.push('name');
  810. vueProps.push('value');
  811. } else {
  812. vueProps.name = {
  813. type: String,
  814. default: '' };
  815. vueProps.value = {
  816. type: [String, Number, Boolean, Array, Object, Date],
  817. default: '' };
  818. }
  819. }
  820. });
  821. }
  822. if (isPlainObject(vueExtends) && vueExtends.props) {
  823. behaviors.push(
  824. initBehavior({
  825. properties: initProperties(vueExtends.props, true) }));
  826. }
  827. if (Array.isArray(vueMixins)) {
  828. vueMixins.forEach(function (vueMixin) {
  829. if (isPlainObject(vueMixin) && vueMixin.props) {
  830. behaviors.push(
  831. initBehavior({
  832. properties: initProperties(vueMixin.props, true) }));
  833. }
  834. });
  835. }
  836. return behaviors;
  837. }
  838. function parsePropType(key, type, defaultValue, file) {
  839. // [String]=>String
  840. if (Array.isArray(type) && type.length === 1) {
  841. return type[0];
  842. }
  843. return type;
  844. }
  845. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  846. var properties = {};
  847. if (!isBehavior) {
  848. properties.vueId = {
  849. type: String,
  850. value: '' };
  851. // 用于字节跳动小程序模拟抽象节点
  852. properties.generic = {
  853. type: Object,
  854. value: null };
  855. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  856. type: null,
  857. value: [],
  858. observer: function observer(newVal, oldVal) {
  859. var $slots = Object.create(null);
  860. newVal.forEach(function (slotName) {
  861. $slots[slotName] = true;
  862. });
  863. this.setData({
  864. $slots: $slots });
  865. } };
  866. }
  867. if (Array.isArray(props)) {// ['title']
  868. props.forEach(function (key) {
  869. properties[key] = {
  870. type: null,
  871. observer: createObserver(key) };
  872. });
  873. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  874. Object.keys(props).forEach(function (key) {
  875. var opts = props[key];
  876. if (isPlainObject(opts)) {// title:{type:String,default:''}
  877. var value = opts.default;
  878. if (isFn(value)) {
  879. value = value();
  880. }
  881. opts.type = parsePropType(key, opts.type);
  882. properties[key] = {
  883. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  884. value: value,
  885. observer: createObserver(key) };
  886. } else {// content:String
  887. var type = parsePropType(key, opts);
  888. properties[key] = {
  889. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  890. observer: createObserver(key) };
  891. }
  892. });
  893. }
  894. return properties;
  895. }
  896. function wrapper$1(event) {
  897. // TODO 又得兼容 mpvue 的 mp 对象
  898. try {
  899. event.mp = JSON.parse(JSON.stringify(event));
  900. } catch (e) {}
  901. event.stopPropagation = noop;
  902. event.preventDefault = noop;
  903. event.target = event.target || {};
  904. if (!hasOwn(event, 'detail')) {
  905. event.detail = {};
  906. }
  907. if (hasOwn(event, 'markerId')) {
  908. event.detail = typeof event.detail === 'object' ? event.detail : {};
  909. event.detail.markerId = event.markerId;
  910. }
  911. if (isPlainObject(event.detail)) {
  912. event.target = Object.assign({}, event.target, event.detail);
  913. }
  914. return event;
  915. }
  916. function getExtraValue(vm, dataPathsArray) {
  917. var context = vm;
  918. dataPathsArray.forEach(function (dataPathArray) {
  919. var dataPath = dataPathArray[0];
  920. var value = dataPathArray[2];
  921. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  922. var propPath = dataPathArray[1];
  923. var valuePath = dataPathArray[3];
  924. var vFor;
  925. if (Number.isInteger(dataPath)) {
  926. vFor = dataPath;
  927. } else if (!dataPath) {
  928. vFor = context;
  929. } else if (typeof dataPath === 'string' && dataPath) {
  930. if (dataPath.indexOf('#s#') === 0) {
  931. vFor = dataPath.substr(3);
  932. } else {
  933. vFor = vm.__get_value(dataPath, context);
  934. }
  935. }
  936. if (Number.isInteger(vFor)) {
  937. context = value;
  938. } else if (!propPath) {
  939. context = vFor[value];
  940. } else {
  941. if (Array.isArray(vFor)) {
  942. context = vFor.find(function (vForItem) {
  943. return vm.__get_value(propPath, vForItem) === value;
  944. });
  945. } else if (isPlainObject(vFor)) {
  946. context = Object.keys(vFor).find(function (vForKey) {
  947. return vm.__get_value(propPath, vFor[vForKey]) === value;
  948. });
  949. } else {
  950. console.error('v-for 暂不支持循环数据:', vFor);
  951. }
  952. }
  953. if (valuePath) {
  954. context = vm.__get_value(valuePath, context);
  955. }
  956. }
  957. });
  958. return context;
  959. }
  960. function processEventExtra(vm, extra, event) {
  961. var extraObj = {};
  962. if (Array.isArray(extra) && extra.length) {
  963. /**
  964. *[
  965. * ['data.items', 'data.id', item.data.id],
  966. * ['metas', 'id', meta.id]
  967. *],
  968. *[
  969. * ['data.items', 'data.id', item.data.id],
  970. * ['metas', 'id', meta.id]
  971. *],
  972. *'test'
  973. */
  974. extra.forEach(function (dataPath, index) {
  975. if (typeof dataPath === 'string') {
  976. if (!dataPath) {// model,prop.sync
  977. extraObj['$' + index] = vm;
  978. } else {
  979. if (dataPath === '$event') {// $event
  980. extraObj['$' + index] = event;
  981. } else if (dataPath === 'arguments') {
  982. if (event.detail && event.detail.__args__) {
  983. extraObj['$' + index] = event.detail.__args__;
  984. } else {
  985. extraObj['$' + index] = [event];
  986. }
  987. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  988. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  989. } else {
  990. extraObj['$' + index] = vm.__get_value(dataPath);
  991. }
  992. }
  993. } else {
  994. extraObj['$' + index] = getExtraValue(vm, dataPath);
  995. }
  996. });
  997. }
  998. return extraObj;
  999. }
  1000. function getObjByArray(arr) {
  1001. var obj = {};
  1002. for (var i = 1; i < arr.length; i++) {
  1003. var element = arr[i];
  1004. obj[element[0]] = element[1];
  1005. }
  1006. return obj;
  1007. }
  1008. 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;
  1009. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1010. if (isCustom) {// 自定义事件
  1011. isCustomMPEvent = event.currentTarget &&
  1012. event.currentTarget.dataset &&
  1013. event.currentTarget.dataset.comType === 'wx';
  1014. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1015. if (isCustomMPEvent) {
  1016. return [event];
  1017. }
  1018. return event.detail.__args__ || event.detail;
  1019. }
  1020. }
  1021. var extraObj = processEventExtra(vm, extra, event);
  1022. var ret = [];
  1023. args.forEach(function (arg) {
  1024. if (arg === '$event') {
  1025. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1026. ret.push(event.target.value);
  1027. } else {
  1028. if (isCustom && !isCustomMPEvent) {
  1029. ret.push(event.detail.__args__[0]);
  1030. } else {// wxcomponent 组件或内置组件
  1031. ret.push(event);
  1032. }
  1033. }
  1034. } else {
  1035. if (Array.isArray(arg) && arg[0] === 'o') {
  1036. ret.push(getObjByArray(arg));
  1037. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1038. ret.push(extraObj[arg]);
  1039. } else {
  1040. ret.push(arg);
  1041. }
  1042. }
  1043. });
  1044. return ret;
  1045. }
  1046. var ONCE = '~';
  1047. var CUSTOM = '^';
  1048. function isMatchEventType(eventType, optType) {
  1049. return eventType === optType ||
  1050. optType === 'regionchange' && (
  1051. eventType === 'begin' ||
  1052. eventType === 'end');
  1053. }
  1054. function getContextVm(vm) {
  1055. var $parent = vm.$parent;
  1056. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1057. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1058. $parent = $parent.$parent;
  1059. }
  1060. return $parent && $parent.$parent;
  1061. }
  1062. function handleEvent(event) {var _this2 = this;
  1063. event = wrapper$1(event);
  1064. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1065. var dataset = (event.currentTarget || event.target).dataset;
  1066. if (!dataset) {
  1067. return console.warn('事件信息不存在');
  1068. }
  1069. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1070. if (!eventOpts) {
  1071. return console.warn('事件信息不存在');
  1072. }
  1073. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1074. var eventType = event.type;
  1075. var ret = [];
  1076. eventOpts.forEach(function (eventOpt) {
  1077. var type = eventOpt[0];
  1078. var eventsArray = eventOpt[1];
  1079. var isCustom = type.charAt(0) === CUSTOM;
  1080. type = isCustom ? type.slice(1) : type;
  1081. var isOnce = type.charAt(0) === ONCE;
  1082. type = isOnce ? type.slice(1) : type;
  1083. if (eventsArray && isMatchEventType(eventType, type)) {
  1084. eventsArray.forEach(function (eventArray) {
  1085. var methodName = eventArray[0];
  1086. if (methodName) {
  1087. var handlerCtx = _this2.$vm;
  1088. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1089. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1090. }
  1091. if (methodName === '$emit') {
  1092. handlerCtx.$emit.apply(handlerCtx,
  1093. processEventArgs(
  1094. _this2.$vm,
  1095. event,
  1096. eventArray[1],
  1097. eventArray[2],
  1098. isCustom,
  1099. methodName));
  1100. return;
  1101. }
  1102. var handler = handlerCtx[methodName];
  1103. if (!isFn(handler)) {
  1104. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1105. }
  1106. if (isOnce) {
  1107. if (handler.once) {
  1108. return;
  1109. }
  1110. handler.once = true;
  1111. }
  1112. var params = processEventArgs(
  1113. _this2.$vm,
  1114. event,
  1115. eventArray[1],
  1116. eventArray[2],
  1117. isCustom,
  1118. methodName);
  1119. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1120. // eslint-disable-next-line no-sparse-arrays
  1121. ret.push(handler.apply(handlerCtx, (Array.isArray(params) ? params : []).concat([,,,,,,,,,, event])));
  1122. }
  1123. });
  1124. }
  1125. });
  1126. if (
  1127. eventType === 'input' &&
  1128. ret.length === 1 &&
  1129. typeof ret[0] !== 'undefined')
  1130. {
  1131. return ret[0];
  1132. }
  1133. }
  1134. var hooks = [
  1135. 'onShow',
  1136. 'onHide',
  1137. 'onError',
  1138. 'onPageNotFound',
  1139. 'onThemeChange',
  1140. 'onUnhandledRejection'];
  1141. function parseBaseApp(vm, _ref3)
  1142. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1143. if (vm.$options.store) {
  1144. _vue.default.prototype.$store = vm.$options.store;
  1145. }
  1146. _vue.default.prototype.mpHost = "mp-weixin";
  1147. _vue.default.mixin({
  1148. beforeCreate: function beforeCreate() {
  1149. if (!this.$options.mpType) {
  1150. return;
  1151. }
  1152. this.mpType = this.$options.mpType;
  1153. this.$mp = _defineProperty({
  1154. data: {} },
  1155. this.mpType, this.$options.mpInstance);
  1156. this.$scope = this.$options.mpInstance;
  1157. delete this.$options.mpType;
  1158. delete this.$options.mpInstance;
  1159. if (this.mpType !== 'app') {
  1160. initRefs(this);
  1161. initMocks(this, mocks);
  1162. }
  1163. } });
  1164. var appOptions = {
  1165. onLaunch: function onLaunch(args) {
  1166. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1167. return;
  1168. }
  1169. {
  1170. if (!wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1171. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1172. }
  1173. }
  1174. this.$vm = vm;
  1175. this.$vm.$mp = {
  1176. app: this };
  1177. this.$vm.$scope = this;
  1178. // vm 上也挂载 globalData
  1179. this.$vm.globalData = this.globalData;
  1180. this.$vm._isMounted = true;
  1181. this.$vm.__call_hook('mounted', args);
  1182. this.$vm.__call_hook('onLaunch', args);
  1183. } };
  1184. // 兼容旧版本 globalData
  1185. appOptions.globalData = vm.$options.globalData || {};
  1186. // 将 methods 中的方法挂在 getApp() 中
  1187. var methods = vm.$options.methods;
  1188. if (methods) {
  1189. Object.keys(methods).forEach(function (name) {
  1190. appOptions[name] = methods[name];
  1191. });
  1192. }
  1193. initHooks(appOptions, hooks);
  1194. return appOptions;
  1195. }
  1196. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1197. function findVmByVueId(vm, vuePid) {
  1198. var $children = vm.$children;
  1199. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1200. for (var i = $children.length - 1; i >= 0; i--) {
  1201. var childVm = $children[i];
  1202. if (childVm.$scope._$vueId === vuePid) {
  1203. return childVm;
  1204. }
  1205. }
  1206. // 反向递归查找
  1207. var parentVm;
  1208. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1209. parentVm = findVmByVueId($children[_i], vuePid);
  1210. if (parentVm) {
  1211. return parentVm;
  1212. }
  1213. }
  1214. }
  1215. function initBehavior(options) {
  1216. return Behavior(options);
  1217. }
  1218. function isPage() {
  1219. return !!this.route;
  1220. }
  1221. function initRelation(detail) {
  1222. this.triggerEvent('__l', detail);
  1223. }
  1224. function initRefs(vm) {
  1225. var mpInstance = vm.$scope;
  1226. Object.defineProperty(vm, '$refs', {
  1227. get: function get() {
  1228. var $refs = {};
  1229. var components = mpInstance.selectAllComponents('.vue-ref');
  1230. components.forEach(function (component) {
  1231. var ref = component.dataset.ref;
  1232. $refs[ref] = component.$vm || component;
  1233. });
  1234. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1235. forComponents.forEach(function (component) {
  1236. var ref = component.dataset.ref;
  1237. if (!$refs[ref]) {
  1238. $refs[ref] = [];
  1239. }
  1240. $refs[ref].push(component.$vm || component);
  1241. });
  1242. return $refs;
  1243. } });
  1244. }
  1245. function handleLink(event) {var _ref4 =
  1246. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1247. var parentVm;
  1248. if (vuePid) {
  1249. parentVm = findVmByVueId(this.$vm, vuePid);
  1250. }
  1251. if (!parentVm) {
  1252. parentVm = this.$vm;
  1253. }
  1254. vueOptions.parent = parentVm;
  1255. }
  1256. function parseApp(vm) {
  1257. return parseBaseApp(vm, {
  1258. mocks: mocks,
  1259. initRefs: initRefs });
  1260. }
  1261. function createApp(vm) {
  1262. _vue.default.prototype.getOpenerEventChannel = function () {
  1263. if (!this.__eventChannel__) {
  1264. this.__eventChannel__ = new EventChannel();
  1265. }
  1266. return this.__eventChannel__;
  1267. };
  1268. var callHook = _vue.default.prototype.__call_hook;
  1269. _vue.default.prototype.__call_hook = function (hook, args) {
  1270. if (hook === 'onLoad' && args && args.__id__) {
  1271. this.__eventChannel__ = getEventChannel(args.__id__);
  1272. delete args.__id__;
  1273. }
  1274. return callHook.call(this, hook, args);
  1275. };
  1276. App(parseApp(vm));
  1277. return vm;
  1278. }
  1279. var encodeReserveRE = /[!'()*]/g;
  1280. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1281. var commaRE = /%2C/g;
  1282. // fixed encodeURIComponent which is more conformant to RFC3986:
  1283. // - escapes [!'()*]
  1284. // - preserve commas
  1285. var encode = function encode(str) {return encodeURIComponent(str).
  1286. replace(encodeReserveRE, encodeReserveReplacer).
  1287. replace(commaRE, ',');};
  1288. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1289. var res = obj ? Object.keys(obj).map(function (key) {
  1290. var val = obj[key];
  1291. if (val === undefined) {
  1292. return '';
  1293. }
  1294. if (val === null) {
  1295. return encodeStr(key);
  1296. }
  1297. if (Array.isArray(val)) {
  1298. var result = [];
  1299. val.forEach(function (val2) {
  1300. if (val2 === undefined) {
  1301. return;
  1302. }
  1303. if (val2 === null) {
  1304. result.push(encodeStr(key));
  1305. } else {
  1306. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1307. }
  1308. });
  1309. return result.join('&');
  1310. }
  1311. return encodeStr(key) + '=' + encodeStr(val);
  1312. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1313. return res ? "?".concat(res) : '';
  1314. }
  1315. function parseBaseComponent(vueComponentOptions)
  1316. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1317. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1318. var options = _objectSpread({
  1319. multipleSlots: true,
  1320. addGlobalClass: true },
  1321. vueOptions.options || {});
  1322. {
  1323. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1324. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1325. Object.assign(options, vueOptions['mp-weixin'].options);
  1326. }
  1327. }
  1328. var componentOptions = {
  1329. options: options,
  1330. data: initData(vueOptions, _vue.default.prototype),
  1331. behaviors: initBehaviors(vueOptions, initBehavior),
  1332. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1333. lifetimes: {
  1334. attached: function attached() {
  1335. var properties = this.properties;
  1336. var options = {
  1337. mpType: isPage.call(this) ? 'page' : 'component',
  1338. mpInstance: this,
  1339. propsData: properties };
  1340. initVueIds(properties.vueId, this);
  1341. // 处理父子关系
  1342. initRelation.call(this, {
  1343. vuePid: this._$vuePid,
  1344. vueOptions: options });
  1345. // 初始化 vue 实例
  1346. this.$vm = new VueComponent(options);
  1347. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1348. initSlots(this.$vm, properties.vueSlots);
  1349. // 触发首次 setData
  1350. this.$vm.$mount();
  1351. },
  1352. ready: function ready() {
  1353. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1354. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1355. if (this.$vm) {
  1356. this.$vm._isMounted = true;
  1357. this.$vm.__call_hook('mounted');
  1358. this.$vm.__call_hook('onReady');
  1359. }
  1360. },
  1361. detached: function detached() {
  1362. this.$vm && this.$vm.$destroy();
  1363. } },
  1364. pageLifetimes: {
  1365. show: function show(args) {
  1366. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1367. },
  1368. hide: function hide() {
  1369. this.$vm && this.$vm.__call_hook('onPageHide');
  1370. },
  1371. resize: function resize(size) {
  1372. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1373. } },
  1374. methods: {
  1375. __l: handleLink,
  1376. __e: handleEvent } };
  1377. // externalClasses
  1378. if (vueOptions.externalClasses) {
  1379. componentOptions.externalClasses = vueOptions.externalClasses;
  1380. }
  1381. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1382. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1383. componentOptions.methods[callMethod] = function (args) {
  1384. return this.$vm[callMethod](args);
  1385. };
  1386. });
  1387. }
  1388. if (isPage) {
  1389. return componentOptions;
  1390. }
  1391. return [componentOptions, VueComponent];
  1392. }
  1393. function parseComponent(vueComponentOptions) {
  1394. return parseBaseComponent(vueComponentOptions, {
  1395. isPage: isPage,
  1396. initRelation: initRelation });
  1397. }
  1398. var hooks$1 = [
  1399. 'onShow',
  1400. 'onHide',
  1401. 'onUnload'];
  1402. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1403. function parseBasePage(vuePageOptions, _ref6)
  1404. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1405. var pageOptions = parseComponent(vuePageOptions);
  1406. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1407. pageOptions.methods.onLoad = function (query) {
  1408. this.options = query;
  1409. var copyQuery = Object.assign({}, query);
  1410. delete copyQuery.__id__;
  1411. this.$page = {
  1412. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1413. this.$vm.$mp.query = query; // 兼容 mpvue
  1414. this.$vm.__call_hook('onLoad', query);
  1415. };
  1416. return pageOptions;
  1417. }
  1418. function parsePage(vuePageOptions) {
  1419. return parseBasePage(vuePageOptions, {
  1420. isPage: isPage,
  1421. initRelation: initRelation });
  1422. }
  1423. function createPage(vuePageOptions) {
  1424. {
  1425. return Component(parsePage(vuePageOptions));
  1426. }
  1427. }
  1428. function createComponent(vueOptions) {
  1429. {
  1430. return Component(parseComponent(vueOptions));
  1431. }
  1432. }
  1433. todos.forEach(function (todoApi) {
  1434. protocols[todoApi] = false;
  1435. });
  1436. canIUses.forEach(function (canIUseApi) {
  1437. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1438. canIUseApi;
  1439. if (!wx.canIUse(apiName)) {
  1440. protocols[canIUseApi] = false;
  1441. }
  1442. });
  1443. var uni = {};
  1444. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1445. uni = new Proxy({}, {
  1446. get: function get(target, name) {
  1447. if (hasOwn(target, name)) {
  1448. return target[name];
  1449. }
  1450. if (baseApi[name]) {
  1451. return baseApi[name];
  1452. }
  1453. if (api[name]) {
  1454. return promisify(name, api[name]);
  1455. }
  1456. {
  1457. if (extraApi[name]) {
  1458. return promisify(name, extraApi[name]);
  1459. }
  1460. if (todoApis[name]) {
  1461. return promisify(name, todoApis[name]);
  1462. }
  1463. }
  1464. if (eventApi[name]) {
  1465. return eventApi[name];
  1466. }
  1467. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1468. return;
  1469. }
  1470. return promisify(name, wrapper(name, wx[name]));
  1471. },
  1472. set: function set(target, name, value) {
  1473. target[name] = value;
  1474. return true;
  1475. } });
  1476. } else {
  1477. Object.keys(baseApi).forEach(function (name) {
  1478. uni[name] = baseApi[name];
  1479. });
  1480. {
  1481. Object.keys(todoApis).forEach(function (name) {
  1482. uni[name] = promisify(name, todoApis[name]);
  1483. });
  1484. Object.keys(extraApi).forEach(function (name) {
  1485. uni[name] = promisify(name, todoApis[name]);
  1486. });
  1487. }
  1488. Object.keys(eventApi).forEach(function (name) {
  1489. uni[name] = eventApi[name];
  1490. });
  1491. Object.keys(api).forEach(function (name) {
  1492. uni[name] = promisify(name, api[name]);
  1493. });
  1494. Object.keys(wx).forEach(function (name) {
  1495. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1496. uni[name] = promisify(name, wrapper(name, wx[name]));
  1497. }
  1498. });
  1499. }
  1500. wx.createApp = createApp;
  1501. wx.createPage = createPage;
  1502. wx.createComponent = createComponent;
  1503. var uni$1 = uni;var _default =
  1504. uni$1;exports.default = _default;
  1505. /***/ }),
  1506. /***/ 10:
  1507. /*!**********************************************************************************************************!*\
  1508. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  1509. \**********************************************************************************************************/
  1510. /*! exports provided: default */
  1511. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1512. "use strict";
  1513. __webpack_require__.r(__webpack_exports__);
  1514. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  1515. /* globals __VUE_SSR_CONTEXT__ */
  1516. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  1517. // This module is a runtime utility for cleaner component module output and will
  1518. // be included in the final webpack user bundle.
  1519. function normalizeComponent (
  1520. scriptExports,
  1521. render,
  1522. staticRenderFns,
  1523. functionalTemplate,
  1524. injectStyles,
  1525. scopeId,
  1526. moduleIdentifier, /* server only */
  1527. shadowMode, /* vue-cli only */
  1528. components, // fixed by xxxxxx auto components
  1529. renderjs // fixed by xxxxxx renderjs
  1530. ) {
  1531. // Vue.extend constructor export interop
  1532. var options = typeof scriptExports === 'function'
  1533. ? scriptExports.options
  1534. : scriptExports
  1535. // fixed by xxxxxx auto components
  1536. if (components) {
  1537. if (!options.components) {
  1538. options.components = {}
  1539. }
  1540. var hasOwn = Object.prototype.hasOwnProperty
  1541. for (var name in components) {
  1542. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  1543. options.components[name] = components[name]
  1544. }
  1545. }
  1546. }
  1547. // fixed by xxxxxx renderjs
  1548. if (renderjs) {
  1549. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  1550. this[renderjs.__module] = this
  1551. });
  1552. (options.mixins || (options.mixins = [])).push(renderjs)
  1553. }
  1554. // render functions
  1555. if (render) {
  1556. options.render = render
  1557. options.staticRenderFns = staticRenderFns
  1558. options._compiled = true
  1559. }
  1560. // functional template
  1561. if (functionalTemplate) {
  1562. options.functional = true
  1563. }
  1564. // scopedId
  1565. if (scopeId) {
  1566. options._scopeId = 'data-v-' + scopeId
  1567. }
  1568. var hook
  1569. if (moduleIdentifier) { // server build
  1570. hook = function (context) {
  1571. // 2.3 injection
  1572. context =
  1573. context || // cached call
  1574. (this.$vnode && this.$vnode.ssrContext) || // stateful
  1575. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  1576. // 2.2 with runInNewContext: true
  1577. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  1578. context = __VUE_SSR_CONTEXT__
  1579. }
  1580. // inject component styles
  1581. if (injectStyles) {
  1582. injectStyles.call(this, context)
  1583. }
  1584. // register component module identifier for async chunk inferrence
  1585. if (context && context._registeredComponents) {
  1586. context._registeredComponents.add(moduleIdentifier)
  1587. }
  1588. }
  1589. // used by ssr in case component is cached and beforeCreate
  1590. // never gets called
  1591. options._ssrRegister = hook
  1592. } else if (injectStyles) {
  1593. hook = shadowMode
  1594. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  1595. : injectStyles
  1596. }
  1597. if (hook) {
  1598. if (options.functional) {
  1599. // for template-only hot-reload because in that case the render fn doesn't
  1600. // go through the normalizer
  1601. options._injectStyles = hook
  1602. // register for functioal component in vue file
  1603. var originalRender = options.render
  1604. options.render = function renderWithStyleInjection (h, context) {
  1605. hook.call(context)
  1606. return originalRender(h, context)
  1607. }
  1608. } else {
  1609. // inject component registration as beforeCreate hook
  1610. var existing = options.beforeCreate
  1611. options.beforeCreate = existing
  1612. ? [].concat(existing, hook)
  1613. : [hook]
  1614. }
  1615. }
  1616. return {
  1617. exports: scriptExports,
  1618. options: options
  1619. }
  1620. }
  1621. /***/ }),
  1622. /***/ 11:
  1623. /*!***************************************************!*\
  1624. !*** E:/.swdz/uni-app/baoma/mabao/store/index.js ***!
  1625. \***************************************************/
  1626. /*! no static exports found */
  1627. /***/ (function(module, exports, __webpack_require__) {
  1628. "use strict";
  1629. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 12));var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
  1630. var _vuex = _interopRequireDefault(__webpack_require__(/*! vuex */ 15));
  1631. var _request = _interopRequireDefault(__webpack_require__(/*! @/common/request */ 16));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}
  1632. _vue.default.use(_vuex.default);
  1633. var store = new _vuex.default.Store({
  1634. state: {
  1635. hasLogin: false,
  1636. jwt: uni.getStorageSync('jwt'),
  1637. user: {} },
  1638. // getters
  1639. getters: {
  1640. // ��ȡtokenֵ
  1641. getJwt: function getJwt(state) {
  1642. return state.jwt;
  1643. },
  1644. // ��֤�Ƿ���token
  1645. verifyJwt: function verifyJwt(state) {
  1646. if (state.jwt) {
  1647. state.hasLogin = true;
  1648. return true;
  1649. }
  1650. return false;
  1651. } },
  1652. mutations: {
  1653. setJwt: function setJwt(state, jwt) {
  1654. state.jwt = jwt;
  1655. uni.setStorageSync('jwt', state.jwt);
  1656. },
  1657. login: function login(state) {
  1658. state.hasLogin = true;
  1659. try {
  1660. uni.setStorageSync('jwt', state.jwt);
  1661. } catch (e) {
  1662. // error
  1663. }
  1664. },
  1665. logout: function logout(state) {
  1666. state.hasLogin = false;
  1667. state.user = {};
  1668. state.jwt = '';
  1669. uni.removeStorage({
  1670. key: 'jwt',
  1671. success: function success(res) {} });
  1672. },
  1673. setUser: function setUser(state, user) {
  1674. state.user = user;
  1675. } },
  1676. actions: {
  1677. // lazy loading openid
  1678. getUser: function () {var _getUser = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref,
  1679. refresh) {var commit, state;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:commit = _ref.commit, state = _ref.state;_context.next = 3;return (
  1680. new Promise(function (resolve, reject) {
  1681. if (refresh != true && state.user && Object.keys(state.user).length > 0) {
  1682. resolve(state.user);
  1683. } else {
  1684. _request.default.get("/api/user/userInfo", {}, false).then(function (data) {
  1685. if (data.code == 200) {
  1686. commit('setUser', data.data);
  1687. resolve(data.data);
  1688. } else {
  1689. resolve(null);
  1690. }
  1691. }).catch(function (err) {
  1692. console.info(err);
  1693. reject(err);
  1694. });
  1695. }
  1696. }));case 3:return _context.abrupt("return", _context.sent);case 4:case "end":return _context.stop();}}}, _callee);}));function getUser(_x, _x2) {return _getUser.apply(this, arguments);}return getUser;}() } });var _default =
  1697. store;exports.default = _default;
  1698. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  1699. /***/ }),
  1700. /***/ 12:
  1701. /*!**********************************************************!*\
  1702. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  1703. \**********************************************************/
  1704. /*! no static exports found */
  1705. /***/ (function(module, exports, __webpack_require__) {
  1706. module.exports = __webpack_require__(/*! regenerator-runtime */ 13);
  1707. /***/ }),
  1708. /***/ 13:
  1709. /*!************************************************************!*\
  1710. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  1711. \************************************************************/
  1712. /*! no static exports found */
  1713. /***/ (function(module, exports, __webpack_require__) {
  1714. /**
  1715. * Copyright (c) 2014-present, Facebook, Inc.
  1716. *
  1717. * This source code is licensed under the MIT license found in the
  1718. * LICENSE file in the root directory of this source tree.
  1719. */
  1720. // This method of obtaining a reference to the global object needs to be
  1721. // kept identical to the way it is obtained in runtime.js
  1722. var g = (function() {
  1723. return this || (typeof self === "object" && self);
  1724. })() || Function("return this")();
  1725. // Use `getOwnPropertyNames` because not all browsers support calling
  1726. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  1727. var hadRuntime = g.regeneratorRuntime &&
  1728. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  1729. // Save the old regeneratorRuntime in case it needs to be restored later.
  1730. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  1731. // Force reevalutation of runtime.js.
  1732. g.regeneratorRuntime = undefined;
  1733. module.exports = __webpack_require__(/*! ./runtime */ 14);
  1734. if (hadRuntime) {
  1735. // Restore the original runtime.
  1736. g.regeneratorRuntime = oldRuntime;
  1737. } else {
  1738. // Remove the global property added by runtime.js.
  1739. try {
  1740. delete g.regeneratorRuntime;
  1741. } catch(e) {
  1742. g.regeneratorRuntime = undefined;
  1743. }
  1744. }
  1745. /***/ }),
  1746. /***/ 14:
  1747. /*!*****************************************************!*\
  1748. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  1749. \*****************************************************/
  1750. /*! no static exports found */
  1751. /***/ (function(module, exports) {
  1752. /**
  1753. * Copyright (c) 2014-present, Facebook, Inc.
  1754. *
  1755. * This source code is licensed under the MIT license found in the
  1756. * LICENSE file in the root directory of this source tree.
  1757. */
  1758. !(function(global) {
  1759. "use strict";
  1760. var Op = Object.prototype;
  1761. var hasOwn = Op.hasOwnProperty;
  1762. var undefined; // More compressible than void 0.
  1763. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  1764. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  1765. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  1766. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  1767. var inModule = typeof module === "object";
  1768. var runtime = global.regeneratorRuntime;
  1769. if (runtime) {
  1770. if (inModule) {
  1771. // If regeneratorRuntime is defined globally and we're in a module,
  1772. // make the exports object identical to regeneratorRuntime.
  1773. module.exports = runtime;
  1774. }
  1775. // Don't bother evaluating the rest of this file if the runtime was
  1776. // already defined globally.
  1777. return;
  1778. }
  1779. // Define the runtime globally (as expected by generated code) as either
  1780. // module.exports (if we're in a module) or a new, empty object.
  1781. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  1782. function wrap(innerFn, outerFn, self, tryLocsList) {
  1783. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  1784. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  1785. var generator = Object.create(protoGenerator.prototype);
  1786. var context = new Context(tryLocsList || []);
  1787. // The ._invoke method unifies the implementations of the .next,
  1788. // .throw, and .return methods.
  1789. generator._invoke = makeInvokeMethod(innerFn, self, context);
  1790. return generator;
  1791. }
  1792. runtime.wrap = wrap;
  1793. // Try/catch helper to minimize deoptimizations. Returns a completion
  1794. // record like context.tryEntries[i].completion. This interface could
  1795. // have been (and was previously) designed to take a closure to be
  1796. // invoked without arguments, but in all the cases we care about we
  1797. // already have an existing method we want to call, so there's no need
  1798. // to create a new function object. We can even get away with assuming
  1799. // the method takes exactly one argument, since that happens to be true
  1800. // in every case, so we don't have to touch the arguments object. The
  1801. // only additional allocation required is the completion record, which
  1802. // has a stable shape and so hopefully should be cheap to allocate.
  1803. function tryCatch(fn, obj, arg) {
  1804. try {
  1805. return { type: "normal", arg: fn.call(obj, arg) };
  1806. } catch (err) {
  1807. return { type: "throw", arg: err };
  1808. }
  1809. }
  1810. var GenStateSuspendedStart = "suspendedStart";
  1811. var GenStateSuspendedYield = "suspendedYield";
  1812. var GenStateExecuting = "executing";
  1813. var GenStateCompleted = "completed";
  1814. // Returning this object from the innerFn has the same effect as
  1815. // breaking out of the dispatch switch statement.
  1816. var ContinueSentinel = {};
  1817. // Dummy constructor functions that we use as the .constructor and
  1818. // .constructor.prototype properties for functions that return Generator
  1819. // objects. For full spec compliance, you may wish to configure your
  1820. // minifier not to mangle the names of these two functions.
  1821. function Generator() {}
  1822. function GeneratorFunction() {}
  1823. function GeneratorFunctionPrototype() {}
  1824. // This is a polyfill for %IteratorPrototype% for environments that
  1825. // don't natively support it.
  1826. var IteratorPrototype = {};
  1827. IteratorPrototype[iteratorSymbol] = function () {
  1828. return this;
  1829. };
  1830. var getProto = Object.getPrototypeOf;
  1831. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  1832. if (NativeIteratorPrototype &&
  1833. NativeIteratorPrototype !== Op &&
  1834. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  1835. // This environment has a native %IteratorPrototype%; use it instead
  1836. // of the polyfill.
  1837. IteratorPrototype = NativeIteratorPrototype;
  1838. }
  1839. var Gp = GeneratorFunctionPrototype.prototype =
  1840. Generator.prototype = Object.create(IteratorPrototype);
  1841. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  1842. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  1843. GeneratorFunctionPrototype[toStringTagSymbol] =
  1844. GeneratorFunction.displayName = "GeneratorFunction";
  1845. // Helper for defining the .next, .throw, and .return methods of the
  1846. // Iterator interface in terms of a single ._invoke method.
  1847. function defineIteratorMethods(prototype) {
  1848. ["next", "throw", "return"].forEach(function(method) {
  1849. prototype[method] = function(arg) {
  1850. return this._invoke(method, arg);
  1851. };
  1852. });
  1853. }
  1854. runtime.isGeneratorFunction = function(genFun) {
  1855. var ctor = typeof genFun === "function" && genFun.constructor;
  1856. return ctor
  1857. ? ctor === GeneratorFunction ||
  1858. // For the native GeneratorFunction constructor, the best we can
  1859. // do is to check its .name property.
  1860. (ctor.displayName || ctor.name) === "GeneratorFunction"
  1861. : false;
  1862. };
  1863. runtime.mark = function(genFun) {
  1864. if (Object.setPrototypeOf) {
  1865. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  1866. } else {
  1867. genFun.__proto__ = GeneratorFunctionPrototype;
  1868. if (!(toStringTagSymbol in genFun)) {
  1869. genFun[toStringTagSymbol] = "GeneratorFunction";
  1870. }
  1871. }
  1872. genFun.prototype = Object.create(Gp);
  1873. return genFun;
  1874. };
  1875. // Within the body of any async function, `await x` is transformed to
  1876. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  1877. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  1878. // meant to be awaited.
  1879. runtime.awrap = function(arg) {
  1880. return { __await: arg };
  1881. };
  1882. function AsyncIterator(generator) {
  1883. function invoke(method, arg, resolve, reject) {
  1884. var record = tryCatch(generator[method], generator, arg);
  1885. if (record.type === "throw") {
  1886. reject(record.arg);
  1887. } else {
  1888. var result = record.arg;
  1889. var value = result.value;
  1890. if (value &&
  1891. typeof value === "object" &&
  1892. hasOwn.call(value, "__await")) {
  1893. return Promise.resolve(value.__await).then(function(value) {
  1894. invoke("next", value, resolve, reject);
  1895. }, function(err) {
  1896. invoke("throw", err, resolve, reject);
  1897. });
  1898. }
  1899. return Promise.resolve(value).then(function(unwrapped) {
  1900. // When a yielded Promise is resolved, its final value becomes
  1901. // the .value of the Promise<{value,done}> result for the
  1902. // current iteration.
  1903. result.value = unwrapped;
  1904. resolve(result);
  1905. }, function(error) {
  1906. // If a rejected Promise was yielded, throw the rejection back
  1907. // into the async generator function so it can be handled there.
  1908. return invoke("throw", error, resolve, reject);
  1909. });
  1910. }
  1911. }
  1912. var previousPromise;
  1913. function enqueue(method, arg) {
  1914. function callInvokeWithMethodAndArg() {
  1915. return new Promise(function(resolve, reject) {
  1916. invoke(method, arg, resolve, reject);
  1917. });
  1918. }
  1919. return previousPromise =
  1920. // If enqueue has been called before, then we want to wait until
  1921. // all previous Promises have been resolved before calling invoke,
  1922. // so that results are always delivered in the correct order. If
  1923. // enqueue has not been called before, then it is important to
  1924. // call invoke immediately, without waiting on a callback to fire,
  1925. // so that the async generator function has the opportunity to do
  1926. // any necessary setup in a predictable way. This predictability
  1927. // is why the Promise constructor synchronously invokes its
  1928. // executor callback, and why async functions synchronously
  1929. // execute code before the first await. Since we implement simple
  1930. // async functions in terms of async generators, it is especially
  1931. // important to get this right, even though it requires care.
  1932. previousPromise ? previousPromise.then(
  1933. callInvokeWithMethodAndArg,
  1934. // Avoid propagating failures to Promises returned by later
  1935. // invocations of the iterator.
  1936. callInvokeWithMethodAndArg
  1937. ) : callInvokeWithMethodAndArg();
  1938. }
  1939. // Define the unified helper method that is used to implement .next,
  1940. // .throw, and .return (see defineIteratorMethods).
  1941. this._invoke = enqueue;
  1942. }
  1943. defineIteratorMethods(AsyncIterator.prototype);
  1944. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  1945. return this;
  1946. };
  1947. runtime.AsyncIterator = AsyncIterator;
  1948. // Note that simple async functions are implemented on top of
  1949. // AsyncIterator objects; they just return a Promise for the value of
  1950. // the final result produced by the iterator.
  1951. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  1952. var iter = new AsyncIterator(
  1953. wrap(innerFn, outerFn, self, tryLocsList)
  1954. );
  1955. return runtime.isGeneratorFunction(outerFn)
  1956. ? iter // If outerFn is a generator, return the full iterator.
  1957. : iter.next().then(function(result) {
  1958. return result.done ? result.value : iter.next();
  1959. });
  1960. };
  1961. function makeInvokeMethod(innerFn, self, context) {
  1962. var state = GenStateSuspendedStart;
  1963. return function invoke(method, arg) {
  1964. if (state === GenStateExecuting) {
  1965. throw new Error("Generator is already running");
  1966. }
  1967. if (state === GenStateCompleted) {
  1968. if (method === "throw") {
  1969. throw arg;
  1970. }
  1971. // Be forgiving, per 25.3.3.3.3 of the spec:
  1972. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  1973. return doneResult();
  1974. }
  1975. context.method = method;
  1976. context.arg = arg;
  1977. while (true) {
  1978. var delegate = context.delegate;
  1979. if (delegate) {
  1980. var delegateResult = maybeInvokeDelegate(delegate, context);
  1981. if (delegateResult) {
  1982. if (delegateResult === ContinueSentinel) continue;
  1983. return delegateResult;
  1984. }
  1985. }
  1986. if (context.method === "next") {
  1987. // Setting context._sent for legacy support of Babel's
  1988. // function.sent implementation.
  1989. context.sent = context._sent = context.arg;
  1990. } else if (context.method === "throw") {
  1991. if (state === GenStateSuspendedStart) {
  1992. state = GenStateCompleted;
  1993. throw context.arg;
  1994. }
  1995. context.dispatchException(context.arg);
  1996. } else if (context.method === "return") {
  1997. context.abrupt("return", context.arg);
  1998. }
  1999. state = GenStateExecuting;
  2000. var record = tryCatch(innerFn, self, context);
  2001. if (record.type === "normal") {
  2002. // If an exception is thrown from innerFn, we leave state ===
  2003. // GenStateExecuting and loop back for another invocation.
  2004. state = context.done
  2005. ? GenStateCompleted
  2006. : GenStateSuspendedYield;
  2007. if (record.arg === ContinueSentinel) {
  2008. continue;
  2009. }
  2010. return {
  2011. value: record.arg,
  2012. done: context.done
  2013. };
  2014. } else if (record.type === "throw") {
  2015. state = GenStateCompleted;
  2016. // Dispatch the exception by looping back around to the
  2017. // context.dispatchException(context.arg) call above.
  2018. context.method = "throw";
  2019. context.arg = record.arg;
  2020. }
  2021. }
  2022. };
  2023. }
  2024. // Call delegate.iterator[context.method](context.arg) and handle the
  2025. // result, either by returning a { value, done } result from the
  2026. // delegate iterator, or by modifying context.method and context.arg,
  2027. // setting context.delegate to null, and returning the ContinueSentinel.
  2028. function maybeInvokeDelegate(delegate, context) {
  2029. var method = delegate.iterator[context.method];
  2030. if (method === undefined) {
  2031. // A .throw or .return when the delegate iterator has no .throw
  2032. // method always terminates the yield* loop.
  2033. context.delegate = null;
  2034. if (context.method === "throw") {
  2035. if (delegate.iterator.return) {
  2036. // If the delegate iterator has a return method, give it a
  2037. // chance to clean up.
  2038. context.method = "return";
  2039. context.arg = undefined;
  2040. maybeInvokeDelegate(delegate, context);
  2041. if (context.method === "throw") {
  2042. // If maybeInvokeDelegate(context) changed context.method from
  2043. // "return" to "throw", let that override the TypeError below.
  2044. return ContinueSentinel;
  2045. }
  2046. }
  2047. context.method = "throw";
  2048. context.arg = new TypeError(
  2049. "The iterator does not provide a 'throw' method");
  2050. }
  2051. return ContinueSentinel;
  2052. }
  2053. var record = tryCatch(method, delegate.iterator, context.arg);
  2054. if (record.type === "throw") {
  2055. context.method = "throw";
  2056. context.arg = record.arg;
  2057. context.delegate = null;
  2058. return ContinueSentinel;
  2059. }
  2060. var info = record.arg;
  2061. if (! info) {
  2062. context.method = "throw";
  2063. context.arg = new TypeError("iterator result is not an object");
  2064. context.delegate = null;
  2065. return ContinueSentinel;
  2066. }
  2067. if (info.done) {
  2068. // Assign the result of the finished delegate to the temporary
  2069. // variable specified by delegate.resultName (see delegateYield).
  2070. context[delegate.resultName] = info.value;
  2071. // Resume execution at the desired location (see delegateYield).
  2072. context.next = delegate.nextLoc;
  2073. // If context.method was "throw" but the delegate handled the
  2074. // exception, let the outer generator proceed normally. If
  2075. // context.method was "next", forget context.arg since it has been
  2076. // "consumed" by the delegate iterator. If context.method was
  2077. // "return", allow the original .return call to continue in the
  2078. // outer generator.
  2079. if (context.method !== "return") {
  2080. context.method = "next";
  2081. context.arg = undefined;
  2082. }
  2083. } else {
  2084. // Re-yield the result returned by the delegate method.
  2085. return info;
  2086. }
  2087. // The delegate iterator is finished, so forget it and continue with
  2088. // the outer generator.
  2089. context.delegate = null;
  2090. return ContinueSentinel;
  2091. }
  2092. // Define Generator.prototype.{next,throw,return} in terms of the
  2093. // unified ._invoke helper method.
  2094. defineIteratorMethods(Gp);
  2095. Gp[toStringTagSymbol] = "Generator";
  2096. // A Generator should always return itself as the iterator object when the
  2097. // @@iterator function is called on it. Some browsers' implementations of the
  2098. // iterator prototype chain incorrectly implement this, causing the Generator
  2099. // object to not be returned from this call. This ensures that doesn't happen.
  2100. // See https://github.com/facebook/regenerator/issues/274 for more details.
  2101. Gp[iteratorSymbol] = function() {
  2102. return this;
  2103. };
  2104. Gp.toString = function() {
  2105. return "[object Generator]";
  2106. };
  2107. function pushTryEntry(locs) {
  2108. var entry = { tryLoc: locs[0] };
  2109. if (1 in locs) {
  2110. entry.catchLoc = locs[1];
  2111. }
  2112. if (2 in locs) {
  2113. entry.finallyLoc = locs[2];
  2114. entry.afterLoc = locs[3];
  2115. }
  2116. this.tryEntries.push(entry);
  2117. }
  2118. function resetTryEntry(entry) {
  2119. var record = entry.completion || {};
  2120. record.type = "normal";
  2121. delete record.arg;
  2122. entry.completion = record;
  2123. }
  2124. function Context(tryLocsList) {
  2125. // The root entry object (effectively a try statement without a catch
  2126. // or a finally block) gives us a place to store values thrown from
  2127. // locations where there is no enclosing try statement.
  2128. this.tryEntries = [{ tryLoc: "root" }];
  2129. tryLocsList.forEach(pushTryEntry, this);
  2130. this.reset(true);
  2131. }
  2132. runtime.keys = function(object) {
  2133. var keys = [];
  2134. for (var key in object) {
  2135. keys.push(key);
  2136. }
  2137. keys.reverse();
  2138. // Rather than returning an object with a next method, we keep
  2139. // things simple and return the next function itself.
  2140. return function next() {
  2141. while (keys.length) {
  2142. var key = keys.pop();
  2143. if (key in object) {
  2144. next.value = key;
  2145. next.done = false;
  2146. return next;
  2147. }
  2148. }
  2149. // To avoid creating an additional object, we just hang the .value
  2150. // and .done properties off the next function object itself. This
  2151. // also ensures that the minifier will not anonymize the function.
  2152. next.done = true;
  2153. return next;
  2154. };
  2155. };
  2156. function values(iterable) {
  2157. if (iterable) {
  2158. var iteratorMethod = iterable[iteratorSymbol];
  2159. if (iteratorMethod) {
  2160. return iteratorMethod.call(iterable);
  2161. }
  2162. if (typeof iterable.next === "function") {
  2163. return iterable;
  2164. }
  2165. if (!isNaN(iterable.length)) {
  2166. var i = -1, next = function next() {
  2167. while (++i < iterable.length) {
  2168. if (hasOwn.call(iterable, i)) {
  2169. next.value = iterable[i];
  2170. next.done = false;
  2171. return next;
  2172. }
  2173. }
  2174. next.value = undefined;
  2175. next.done = true;
  2176. return next;
  2177. };
  2178. return next.next = next;
  2179. }
  2180. }
  2181. // Return an iterator with no values.
  2182. return { next: doneResult };
  2183. }
  2184. runtime.values = values;
  2185. function doneResult() {
  2186. return { value: undefined, done: true };
  2187. }
  2188. Context.prototype = {
  2189. constructor: Context,
  2190. reset: function(skipTempReset) {
  2191. this.prev = 0;
  2192. this.next = 0;
  2193. // Resetting context._sent for legacy support of Babel's
  2194. // function.sent implementation.
  2195. this.sent = this._sent = undefined;
  2196. this.done = false;
  2197. this.delegate = null;
  2198. this.method = "next";
  2199. this.arg = undefined;
  2200. this.tryEntries.forEach(resetTryEntry);
  2201. if (!skipTempReset) {
  2202. for (var name in this) {
  2203. // Not sure about the optimal order of these conditions:
  2204. if (name.charAt(0) === "t" &&
  2205. hasOwn.call(this, name) &&
  2206. !isNaN(+name.slice(1))) {
  2207. this[name] = undefined;
  2208. }
  2209. }
  2210. }
  2211. },
  2212. stop: function() {
  2213. this.done = true;
  2214. var rootEntry = this.tryEntries[0];
  2215. var rootRecord = rootEntry.completion;
  2216. if (rootRecord.type === "throw") {
  2217. throw rootRecord.arg;
  2218. }
  2219. return this.rval;
  2220. },
  2221. dispatchException: function(exception) {
  2222. if (this.done) {
  2223. throw exception;
  2224. }
  2225. var context = this;
  2226. function handle(loc, caught) {
  2227. record.type = "throw";
  2228. record.arg = exception;
  2229. context.next = loc;
  2230. if (caught) {
  2231. // If the dispatched exception was caught by a catch block,
  2232. // then let that catch block handle the exception normally.
  2233. context.method = "next";
  2234. context.arg = undefined;
  2235. }
  2236. return !! caught;
  2237. }
  2238. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2239. var entry = this.tryEntries[i];
  2240. var record = entry.completion;
  2241. if (entry.tryLoc === "root") {
  2242. // Exception thrown outside of any try block that could handle
  2243. // it, so set the completion value of the entire function to
  2244. // throw the exception.
  2245. return handle("end");
  2246. }
  2247. if (entry.tryLoc <= this.prev) {
  2248. var hasCatch = hasOwn.call(entry, "catchLoc");
  2249. var hasFinally = hasOwn.call(entry, "finallyLoc");
  2250. if (hasCatch && hasFinally) {
  2251. if (this.prev < entry.catchLoc) {
  2252. return handle(entry.catchLoc, true);
  2253. } else if (this.prev < entry.finallyLoc) {
  2254. return handle(entry.finallyLoc);
  2255. }
  2256. } else if (hasCatch) {
  2257. if (this.prev < entry.catchLoc) {
  2258. return handle(entry.catchLoc, true);
  2259. }
  2260. } else if (hasFinally) {
  2261. if (this.prev < entry.finallyLoc) {
  2262. return handle(entry.finallyLoc);
  2263. }
  2264. } else {
  2265. throw new Error("try statement without catch or finally");
  2266. }
  2267. }
  2268. }
  2269. },
  2270. abrupt: function(type, arg) {
  2271. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2272. var entry = this.tryEntries[i];
  2273. if (entry.tryLoc <= this.prev &&
  2274. hasOwn.call(entry, "finallyLoc") &&
  2275. this.prev < entry.finallyLoc) {
  2276. var finallyEntry = entry;
  2277. break;
  2278. }
  2279. }
  2280. if (finallyEntry &&
  2281. (type === "break" ||
  2282. type === "continue") &&
  2283. finallyEntry.tryLoc <= arg &&
  2284. arg <= finallyEntry.finallyLoc) {
  2285. // Ignore the finally entry if control is not jumping to a
  2286. // location outside the try/catch block.
  2287. finallyEntry = null;
  2288. }
  2289. var record = finallyEntry ? finallyEntry.completion : {};
  2290. record.type = type;
  2291. record.arg = arg;
  2292. if (finallyEntry) {
  2293. this.method = "next";
  2294. this.next = finallyEntry.finallyLoc;
  2295. return ContinueSentinel;
  2296. }
  2297. return this.complete(record);
  2298. },
  2299. complete: function(record, afterLoc) {
  2300. if (record.type === "throw") {
  2301. throw record.arg;
  2302. }
  2303. if (record.type === "break" ||
  2304. record.type === "continue") {
  2305. this.next = record.arg;
  2306. } else if (record.type === "return") {
  2307. this.rval = this.arg = record.arg;
  2308. this.method = "return";
  2309. this.next = "end";
  2310. } else if (record.type === "normal" && afterLoc) {
  2311. this.next = afterLoc;
  2312. }
  2313. return ContinueSentinel;
  2314. },
  2315. finish: function(finallyLoc) {
  2316. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2317. var entry = this.tryEntries[i];
  2318. if (entry.finallyLoc === finallyLoc) {
  2319. this.complete(entry.completion, entry.afterLoc);
  2320. resetTryEntry(entry);
  2321. return ContinueSentinel;
  2322. }
  2323. }
  2324. },
  2325. "catch": function(tryLoc) {
  2326. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  2327. var entry = this.tryEntries[i];
  2328. if (entry.tryLoc === tryLoc) {
  2329. var record = entry.completion;
  2330. if (record.type === "throw") {
  2331. var thrown = record.arg;
  2332. resetTryEntry(entry);
  2333. }
  2334. return thrown;
  2335. }
  2336. }
  2337. // The context.catch method must only be called with a location
  2338. // argument that corresponds to a known catch block.
  2339. throw new Error("illegal catch attempt");
  2340. },
  2341. delegateYield: function(iterable, resultName, nextLoc) {
  2342. this.delegate = {
  2343. iterator: values(iterable),
  2344. resultName: resultName,
  2345. nextLoc: nextLoc
  2346. };
  2347. if (this.method === "next") {
  2348. // Deliberately forget the last sent value so that we don't
  2349. // accidentally pass it on to the delegate.
  2350. this.arg = undefined;
  2351. }
  2352. return ContinueSentinel;
  2353. }
  2354. };
  2355. })(
  2356. // In sloppy mode, unbound `this` refers to the global object, fallback to
  2357. // Function constructor if we're in global strict mode. That is sadly a form
  2358. // of indirect eval which violates Content Security Policy.
  2359. (function() {
  2360. return this || (typeof self === "object" && self);
  2361. })() || Function("return this")()
  2362. );
  2363. /***/ }),
  2364. /***/ 15:
  2365. /*!********************************************!*\
  2366. !*** ./node_modules/vuex/dist/vuex.esm.js ***!
  2367. \********************************************/
  2368. /*! exports provided: default, Store, createNamespacedHelpers, install, mapActions, mapGetters, mapMutations, mapState */
  2369. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  2370. "use strict";
  2371. __webpack_require__.r(__webpack_exports__);
  2372. /* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Store", function() { return Store; });
  2373. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNamespacedHelpers", function() { return createNamespacedHelpers; });
  2374. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "install", function() { return install; });
  2375. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapActions", function() { return mapActions; });
  2376. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapGetters", function() { return mapGetters; });
  2377. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapMutations", function() { return mapMutations; });
  2378. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "mapState", function() { return mapState; });
  2379. /*!
  2380. * vuex v3.4.0
  2381. * (c) 2020 Evan You
  2382. * @license MIT
  2383. */
  2384. function applyMixin (Vue) {
  2385. var version = Number(Vue.version.split('.')[0]);
  2386. if (version >= 2) {
  2387. Vue.mixin({ beforeCreate: vuexInit });
  2388. } else {
  2389. // override init and inject vuex init procedure
  2390. // for 1.x backwards compatibility.
  2391. var _init = Vue.prototype._init;
  2392. Vue.prototype._init = function (options) {
  2393. if ( options === void 0 ) options = {};
  2394. options.init = options.init
  2395. ? [vuexInit].concat(options.init)
  2396. : vuexInit;
  2397. _init.call(this, options);
  2398. };
  2399. }
  2400. /**
  2401. * Vuex init hook, injected into each instances init hooks list.
  2402. */
  2403. function vuexInit () {
  2404. var options = this.$options;
  2405. // store injection
  2406. if (options.store) {
  2407. this.$store = typeof options.store === 'function'
  2408. ? options.store()
  2409. : options.store;
  2410. } else if (options.parent && options.parent.$store) {
  2411. this.$store = options.parent.$store;
  2412. }
  2413. }
  2414. }
  2415. var target = typeof window !== 'undefined'
  2416. ? window
  2417. : typeof global !== 'undefined'
  2418. ? global
  2419. : {};
  2420. var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  2421. function devtoolPlugin (store) {
  2422. if (!devtoolHook) { return }
  2423. store._devtoolHook = devtoolHook;
  2424. devtoolHook.emit('vuex:init', store);
  2425. devtoolHook.on('vuex:travel-to-state', function (targetState) {
  2426. store.replaceState(targetState);
  2427. });
  2428. store.subscribe(function (mutation, state) {
  2429. devtoolHook.emit('vuex:mutation', mutation, state);
  2430. }, { prepend: true });
  2431. store.subscribeAction(function (action, state) {
  2432. devtoolHook.emit('vuex:action', action, state);
  2433. }, { prepend: true });
  2434. }
  2435. /**
  2436. * Get the first item that pass the test
  2437. * by second argument function
  2438. *
  2439. * @param {Array} list
  2440. * @param {Function} f
  2441. * @return {*}
  2442. */
  2443. /**
  2444. * forEach for object
  2445. */
  2446. function forEachValue (obj, fn) {
  2447. Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });
  2448. }
  2449. function isObject (obj) {
  2450. return obj !== null && typeof obj === 'object'
  2451. }
  2452. function isPromise (val) {
  2453. return val && typeof val.then === 'function'
  2454. }
  2455. function assert (condition, msg) {
  2456. if (!condition) { throw new Error(("[vuex] " + msg)) }
  2457. }
  2458. function partial (fn, arg) {
  2459. return function () {
  2460. return fn(arg)
  2461. }
  2462. }
  2463. // Base data struct for store's module, package with some attribute and method
  2464. var Module = function Module (rawModule, runtime) {
  2465. this.runtime = runtime;
  2466. // Store some children item
  2467. this._children = Object.create(null);
  2468. // Store the origin module object which passed by programmer
  2469. this._rawModule = rawModule;
  2470. var rawState = rawModule.state;
  2471. // Store the origin module's state
  2472. this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
  2473. };
  2474. var prototypeAccessors = { namespaced: { configurable: true } };
  2475. prototypeAccessors.namespaced.get = function () {
  2476. return !!this._rawModule.namespaced
  2477. };
  2478. Module.prototype.addChild = function addChild (key, module) {
  2479. this._children[key] = module;
  2480. };
  2481. Module.prototype.removeChild = function removeChild (key) {
  2482. delete this._children[key];
  2483. };
  2484. Module.prototype.getChild = function getChild (key) {
  2485. return this._children[key]
  2486. };
  2487. Module.prototype.hasChild = function hasChild (key) {
  2488. return key in this._children
  2489. };
  2490. Module.prototype.update = function update (rawModule) {
  2491. this._rawModule.namespaced = rawModule.namespaced;
  2492. if (rawModule.actions) {
  2493. this._rawModule.actions = rawModule.actions;
  2494. }
  2495. if (rawModule.mutations) {
  2496. this._rawModule.mutations = rawModule.mutations;
  2497. }
  2498. if (rawModule.getters) {
  2499. this._rawModule.getters = rawModule.getters;
  2500. }
  2501. };
  2502. Module.prototype.forEachChild = function forEachChild (fn) {
  2503. forEachValue(this._children, fn);
  2504. };
  2505. Module.prototype.forEachGetter = function forEachGetter (fn) {
  2506. if (this._rawModule.getters) {
  2507. forEachValue(this._rawModule.getters, fn);
  2508. }
  2509. };
  2510. Module.prototype.forEachAction = function forEachAction (fn) {
  2511. if (this._rawModule.actions) {
  2512. forEachValue(this._rawModule.actions, fn);
  2513. }
  2514. };
  2515. Module.prototype.forEachMutation = function forEachMutation (fn) {
  2516. if (this._rawModule.mutations) {
  2517. forEachValue(this._rawModule.mutations, fn);
  2518. }
  2519. };
  2520. Object.defineProperties( Module.prototype, prototypeAccessors );
  2521. var ModuleCollection = function ModuleCollection (rawRootModule) {
  2522. // register root module (Vuex.Store options)
  2523. this.register([], rawRootModule, false);
  2524. };
  2525. ModuleCollection.prototype.get = function get (path) {
  2526. return path.reduce(function (module, key) {
  2527. return module.getChild(key)
  2528. }, this.root)
  2529. };
  2530. ModuleCollection.prototype.getNamespace = function getNamespace (path) {
  2531. var module = this.root;
  2532. return path.reduce(function (namespace, key) {
  2533. module = module.getChild(key);
  2534. return namespace + (module.namespaced ? key + '/' : '')
  2535. }, '')
  2536. };
  2537. ModuleCollection.prototype.update = function update$1 (rawRootModule) {
  2538. update([], this.root, rawRootModule);
  2539. };
  2540. ModuleCollection.prototype.register = function register (path, rawModule, runtime) {
  2541. var this$1 = this;
  2542. if ( runtime === void 0 ) runtime = true;
  2543. if ((true)) {
  2544. assertRawModule(path, rawModule);
  2545. }
  2546. var newModule = new Module(rawModule, runtime);
  2547. if (path.length === 0) {
  2548. this.root = newModule;
  2549. } else {
  2550. var parent = this.get(path.slice(0, -1));
  2551. parent.addChild(path[path.length - 1], newModule);
  2552. }
  2553. // register nested modules
  2554. if (rawModule.modules) {
  2555. forEachValue(rawModule.modules, function (rawChildModule, key) {
  2556. this$1.register(path.concat(key), rawChildModule, runtime);
  2557. });
  2558. }
  2559. };
  2560. ModuleCollection.prototype.unregister = function unregister (path) {
  2561. var parent = this.get(path.slice(0, -1));
  2562. var key = path[path.length - 1];
  2563. if (!parent.getChild(key).runtime) { return }
  2564. parent.removeChild(key);
  2565. };
  2566. ModuleCollection.prototype.isRegistered = function isRegistered (path) {
  2567. var parent = this.get(path.slice(0, -1));
  2568. var key = path[path.length - 1];
  2569. return parent.hasChild(key)
  2570. };
  2571. function update (path, targetModule, newModule) {
  2572. if ((true)) {
  2573. assertRawModule(path, newModule);
  2574. }
  2575. // update target module
  2576. targetModule.update(newModule);
  2577. // update nested modules
  2578. if (newModule.modules) {
  2579. for (var key in newModule.modules) {
  2580. if (!targetModule.getChild(key)) {
  2581. if ((true)) {
  2582. console.warn(
  2583. "[vuex] trying to add a new module '" + key + "' on hot reloading, " +
  2584. 'manual reload is needed'
  2585. );
  2586. }
  2587. return
  2588. }
  2589. update(
  2590. path.concat(key),
  2591. targetModule.getChild(key),
  2592. newModule.modules[key]
  2593. );
  2594. }
  2595. }
  2596. }
  2597. var functionAssert = {
  2598. assert: function (value) { return typeof value === 'function'; },
  2599. expected: 'function'
  2600. };
  2601. var objectAssert = {
  2602. assert: function (value) { return typeof value === 'function' ||
  2603. (typeof value === 'object' && typeof value.handler === 'function'); },
  2604. expected: 'function or object with "handler" function'
  2605. };
  2606. var assertTypes = {
  2607. getters: functionAssert,
  2608. mutations: functionAssert,
  2609. actions: objectAssert
  2610. };
  2611. function assertRawModule (path, rawModule) {
  2612. Object.keys(assertTypes).forEach(function (key) {
  2613. if (!rawModule[key]) { return }
  2614. var assertOptions = assertTypes[key];
  2615. forEachValue(rawModule[key], function (value, type) {
  2616. assert(
  2617. assertOptions.assert(value),
  2618. makeAssertionMessage(path, key, type, value, assertOptions.expected)
  2619. );
  2620. });
  2621. });
  2622. }
  2623. function makeAssertionMessage (path, key, type, value, expected) {
  2624. var buf = key + " should be " + expected + " but \"" + key + "." + type + "\"";
  2625. if (path.length > 0) {
  2626. buf += " in module \"" + (path.join('.')) + "\"";
  2627. }
  2628. buf += " is " + (JSON.stringify(value)) + ".";
  2629. return buf
  2630. }
  2631. var Vue; // bind on install
  2632. var Store = function Store (options) {
  2633. var this$1 = this;
  2634. if ( options === void 0 ) options = {};
  2635. // Auto install if it is not done yet and `window` has `Vue`.
  2636. // To allow users to avoid auto-installation in some cases,
  2637. // this code should be placed here. See #731
  2638. if (!Vue && typeof window !== 'undefined' && window.Vue) {
  2639. install(window.Vue);
  2640. }
  2641. if ((true)) {
  2642. assert(Vue, "must call Vue.use(Vuex) before creating a store instance.");
  2643. assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser.");
  2644. assert(this instanceof Store, "store must be called with the new operator.");
  2645. }
  2646. var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];
  2647. var strict = options.strict; if ( strict === void 0 ) strict = false;
  2648. // store internal state
  2649. this._committing = false;
  2650. this._actions = Object.create(null);
  2651. this._actionSubscribers = [];
  2652. this._mutations = Object.create(null);
  2653. this._wrappedGetters = Object.create(null);
  2654. this._modules = new ModuleCollection(options);
  2655. this._modulesNamespaceMap = Object.create(null);
  2656. this._subscribers = [];
  2657. this._watcherVM = new Vue();
  2658. this._makeLocalGettersCache = Object.create(null);
  2659. // bind commit and dispatch to self
  2660. var store = this;
  2661. var ref = this;
  2662. var dispatch = ref.dispatch;
  2663. var commit = ref.commit;
  2664. this.dispatch = function boundDispatch (type, payload) {
  2665. return dispatch.call(store, type, payload)
  2666. };
  2667. this.commit = function boundCommit (type, payload, options) {
  2668. return commit.call(store, type, payload, options)
  2669. };
  2670. // strict mode
  2671. this.strict = strict;
  2672. var state = this._modules.root.state;
  2673. // init root module.
  2674. // this also recursively registers all sub-modules
  2675. // and collects all module getters inside this._wrappedGetters
  2676. installModule(this, state, [], this._modules.root);
  2677. // initialize the store vm, which is responsible for the reactivity
  2678. // (also registers _wrappedGetters as computed properties)
  2679. resetStoreVM(this, state);
  2680. // apply plugins
  2681. plugins.forEach(function (plugin) { return plugin(this$1); });
  2682. var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;
  2683. if (useDevtools) {
  2684. devtoolPlugin(this);
  2685. }
  2686. };
  2687. var prototypeAccessors$1 = { state: { configurable: true } };
  2688. prototypeAccessors$1.state.get = function () {
  2689. return this._vm._data.$$state
  2690. };
  2691. prototypeAccessors$1.state.set = function (v) {
  2692. if ((true)) {
  2693. assert(false, "use store.replaceState() to explicit replace store state.");
  2694. }
  2695. };
  2696. Store.prototype.commit = function commit (_type, _payload, _options) {
  2697. var this$1 = this;
  2698. // check object-style commit
  2699. var ref = unifyObjectStyle(_type, _payload, _options);
  2700. var type = ref.type;
  2701. var payload = ref.payload;
  2702. var options = ref.options;
  2703. var mutation = { type: type, payload: payload };
  2704. var entry = this._mutations[type];
  2705. if (!entry) {
  2706. if ((true)) {
  2707. console.error(("[vuex] unknown mutation type: " + type));
  2708. }
  2709. return
  2710. }
  2711. this._withCommit(function () {
  2712. entry.forEach(function commitIterator (handler) {
  2713. handler(payload);
  2714. });
  2715. });
  2716. this._subscribers
  2717. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  2718. .forEach(function (sub) { return sub(mutation, this$1.state); });
  2719. if (
  2720. ( true) &&
  2721. options && options.silent
  2722. ) {
  2723. console.warn(
  2724. "[vuex] mutation type: " + type + ". Silent option has been removed. " +
  2725. 'Use the filter functionality in the vue-devtools'
  2726. );
  2727. }
  2728. };
  2729. Store.prototype.dispatch = function dispatch (_type, _payload) {
  2730. var this$1 = this;
  2731. // check object-style dispatch
  2732. var ref = unifyObjectStyle(_type, _payload);
  2733. var type = ref.type;
  2734. var payload = ref.payload;
  2735. var action = { type: type, payload: payload };
  2736. var entry = this._actions[type];
  2737. if (!entry) {
  2738. if ((true)) {
  2739. console.error(("[vuex] unknown action type: " + type));
  2740. }
  2741. return
  2742. }
  2743. try {
  2744. this._actionSubscribers
  2745. .slice() // shallow copy to prevent iterator invalidation if subscriber synchronously calls unsubscribe
  2746. .filter(function (sub) { return sub.before; })
  2747. .forEach(function (sub) { return sub.before(action, this$1.state); });
  2748. } catch (e) {
  2749. if ((true)) {
  2750. console.warn("[vuex] error in before action subscribers: ");
  2751. console.error(e);
  2752. }
  2753. }
  2754. var result = entry.length > 1
  2755. ? Promise.all(entry.map(function (handler) { return handler(payload); }))
  2756. : entry[0](payload);
  2757. return new Promise(function (resolve, reject) {
  2758. result.then(function (res) {
  2759. try {
  2760. this$1._actionSubscribers
  2761. .filter(function (sub) { return sub.after; })
  2762. .forEach(function (sub) { return sub.after(action, this$1.state); });
  2763. } catch (e) {
  2764. if ((true)) {
  2765. console.warn("[vuex] error in after action subscribers: ");
  2766. console.error(e);
  2767. }
  2768. }
  2769. resolve(res);
  2770. }, function (error) {
  2771. try {
  2772. this$1._actionSubscribers
  2773. .filter(function (sub) { return sub.error; })
  2774. .forEach(function (sub) { return sub.error(action, this$1.state, error); });
  2775. } catch (e) {
  2776. if ((true)) {
  2777. console.warn("[vuex] error in error action subscribers: ");
  2778. console.error(e);
  2779. }
  2780. }
  2781. reject(error);
  2782. });
  2783. })
  2784. };
  2785. Store.prototype.subscribe = function subscribe (fn, options) {
  2786. return genericSubscribe(fn, this._subscribers, options)
  2787. };
  2788. Store.prototype.subscribeAction = function subscribeAction (fn, options) {
  2789. var subs = typeof fn === 'function' ? { before: fn } : fn;
  2790. return genericSubscribe(subs, this._actionSubscribers, options)
  2791. };
  2792. Store.prototype.watch = function watch (getter, cb, options) {
  2793. var this$1 = this;
  2794. if ((true)) {
  2795. assert(typeof getter === 'function', "store.watch only accepts a function.");
  2796. }
  2797. return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)
  2798. };
  2799. Store.prototype.replaceState = function replaceState (state) {
  2800. var this$1 = this;
  2801. this._withCommit(function () {
  2802. this$1._vm._data.$$state = state;
  2803. });
  2804. };
  2805. Store.prototype.registerModule = function registerModule (path, rawModule, options) {
  2806. if ( options === void 0 ) options = {};
  2807. if (typeof path === 'string') { path = [path]; }
  2808. if ((true)) {
  2809. assert(Array.isArray(path), "module path must be a string or an Array.");
  2810. assert(path.length > 0, 'cannot register the root module by using registerModule.');
  2811. }
  2812. this._modules.register(path, rawModule);
  2813. installModule(this, this.state, path, this._modules.get(path), options.preserveState);
  2814. // reset store to update getters...
  2815. resetStoreVM(this, this.state);
  2816. };
  2817. Store.prototype.unregisterModule = function unregisterModule (path) {
  2818. var this$1 = this;
  2819. if (typeof path === 'string') { path = [path]; }
  2820. if ((true)) {
  2821. assert(Array.isArray(path), "module path must be a string or an Array.");
  2822. }
  2823. this._modules.unregister(path);
  2824. this._withCommit(function () {
  2825. var parentState = getNestedState(this$1.state, path.slice(0, -1));
  2826. Vue.delete(parentState, path[path.length - 1]);
  2827. });
  2828. resetStore(this);
  2829. };
  2830. Store.prototype.hasModule = function hasModule (path) {
  2831. if (typeof path === 'string') { path = [path]; }
  2832. if ((true)) {
  2833. assert(Array.isArray(path), "module path must be a string or an Array.");
  2834. }
  2835. return this._modules.isRegistered(path)
  2836. };
  2837. Store.prototype.hotUpdate = function hotUpdate (newOptions) {
  2838. this._modules.update(newOptions);
  2839. resetStore(this, true);
  2840. };
  2841. Store.prototype._withCommit = function _withCommit (fn) {
  2842. var committing = this._committing;
  2843. this._committing = true;
  2844. fn();
  2845. this._committing = committing;
  2846. };
  2847. Object.defineProperties( Store.prototype, prototypeAccessors$1 );
  2848. function genericSubscribe (fn, subs, options) {
  2849. if (subs.indexOf(fn) < 0) {
  2850. options && options.prepend
  2851. ? subs.unshift(fn)
  2852. : subs.push(fn);
  2853. }
  2854. return function () {
  2855. var i = subs.indexOf(fn);
  2856. if (i > -1) {
  2857. subs.splice(i, 1);
  2858. }
  2859. }
  2860. }
  2861. function resetStore (store, hot) {
  2862. store._actions = Object.create(null);
  2863. store._mutations = Object.create(null);
  2864. store._wrappedGetters = Object.create(null);
  2865. store._modulesNamespaceMap = Object.create(null);
  2866. var state = store.state;
  2867. // init all modules
  2868. installModule(store, state, [], store._modules.root, true);
  2869. // reset vm
  2870. resetStoreVM(store, state, hot);
  2871. }
  2872. function resetStoreVM (store, state, hot) {
  2873. var oldVm = store._vm;
  2874. // bind store public getters
  2875. store.getters = {};
  2876. // reset local getters cache
  2877. store._makeLocalGettersCache = Object.create(null);
  2878. var wrappedGetters = store._wrappedGetters;
  2879. var computed = {};
  2880. forEachValue(wrappedGetters, function (fn, key) {
  2881. // use computed to leverage its lazy-caching mechanism
  2882. // direct inline function use will lead to closure preserving oldVm.
  2883. // using partial to return function with only arguments preserved in closure environment.
  2884. computed[key] = partial(fn, store);
  2885. Object.defineProperty(store.getters, key, {
  2886. get: function () { return store._vm[key]; },
  2887. enumerable: true // for local getters
  2888. });
  2889. });
  2890. // use a Vue instance to store the state tree
  2891. // suppress warnings just in case the user has added
  2892. // some funky global mixins
  2893. var silent = Vue.config.silent;
  2894. Vue.config.silent = true;
  2895. store._vm = new Vue({
  2896. data: {
  2897. $$state: state
  2898. },
  2899. computed: computed
  2900. });
  2901. Vue.config.silent = silent;
  2902. // enable strict mode for new vm
  2903. if (store.strict) {
  2904. enableStrictMode(store);
  2905. }
  2906. if (oldVm) {
  2907. if (hot) {
  2908. // dispatch changes in all subscribed watchers
  2909. // to force getter re-evaluation for hot reloading.
  2910. store._withCommit(function () {
  2911. oldVm._data.$$state = null;
  2912. });
  2913. }
  2914. Vue.nextTick(function () { return oldVm.$destroy(); });
  2915. }
  2916. }
  2917. function installModule (store, rootState, path, module, hot) {
  2918. var isRoot = !path.length;
  2919. var namespace = store._modules.getNamespace(path);
  2920. // register in namespace map
  2921. if (module.namespaced) {
  2922. if (store._modulesNamespaceMap[namespace] && ("development" !== 'production')) {
  2923. console.error(("[vuex] duplicate namespace " + namespace + " for the namespaced module " + (path.join('/'))));
  2924. }
  2925. store._modulesNamespaceMap[namespace] = module;
  2926. }
  2927. // set state
  2928. if (!isRoot && !hot) {
  2929. var parentState = getNestedState(rootState, path.slice(0, -1));
  2930. var moduleName = path[path.length - 1];
  2931. store._withCommit(function () {
  2932. if ((true)) {
  2933. if (moduleName in parentState) {
  2934. console.warn(
  2935. ("[vuex] state field \"" + moduleName + "\" was overridden by a module with the same name at \"" + (path.join('.')) + "\"")
  2936. );
  2937. }
  2938. }
  2939. Vue.set(parentState, moduleName, module.state);
  2940. });
  2941. }
  2942. var local = module.context = makeLocalContext(store, namespace, path);
  2943. module.forEachMutation(function (mutation, key) {
  2944. var namespacedType = namespace + key;
  2945. registerMutation(store, namespacedType, mutation, local);
  2946. });
  2947. module.forEachAction(function (action, key) {
  2948. var type = action.root ? key : namespace + key;
  2949. var handler = action.handler || action;
  2950. registerAction(store, type, handler, local);
  2951. });
  2952. module.forEachGetter(function (getter, key) {
  2953. var namespacedType = namespace + key;
  2954. registerGetter(store, namespacedType, getter, local);
  2955. });
  2956. module.forEachChild(function (child, key) {
  2957. installModule(store, rootState, path.concat(key), child, hot);
  2958. });
  2959. }
  2960. /**
  2961. * make localized dispatch, commit, getters and state
  2962. * if there is no namespace, just use root ones
  2963. */
  2964. function makeLocalContext (store, namespace, path) {
  2965. var noNamespace = namespace === '';
  2966. var local = {
  2967. dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
  2968. var args = unifyObjectStyle(_type, _payload, _options);
  2969. var payload = args.payload;
  2970. var options = args.options;
  2971. var type = args.type;
  2972. if (!options || !options.root) {
  2973. type = namespace + type;
  2974. if (( true) && !store._actions[type]) {
  2975. console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
  2976. return
  2977. }
  2978. }
  2979. return store.dispatch(type, payload)
  2980. },
  2981. commit: noNamespace ? store.commit : function (_type, _payload, _options) {
  2982. var args = unifyObjectStyle(_type, _payload, _options);
  2983. var payload = args.payload;
  2984. var options = args.options;
  2985. var type = args.type;
  2986. if (!options || !options.root) {
  2987. type = namespace + type;
  2988. if (( true) && !store._mutations[type]) {
  2989. console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
  2990. return
  2991. }
  2992. }
  2993. store.commit(type, payload, options);
  2994. }
  2995. };
  2996. // getters and state object must be gotten lazily
  2997. // because they will be changed by vm update
  2998. Object.defineProperties(local, {
  2999. getters: {
  3000. get: noNamespace
  3001. ? function () { return store.getters; }
  3002. : function () { return makeLocalGetters(store, namespace); }
  3003. },
  3004. state: {
  3005. get: function () { return getNestedState(store.state, path); }
  3006. }
  3007. });
  3008. return local
  3009. }
  3010. function makeLocalGetters (store, namespace) {
  3011. if (!store._makeLocalGettersCache[namespace]) {
  3012. var gettersProxy = {};
  3013. var splitPos = namespace.length;
  3014. Object.keys(store.getters).forEach(function (type) {
  3015. // skip if the target getter is not match this namespace
  3016. if (type.slice(0, splitPos) !== namespace) { return }
  3017. // extract local getter type
  3018. var localType = type.slice(splitPos);
  3019. // Add a port to the getters proxy.
  3020. // Define as getter property because
  3021. // we do not want to evaluate the getters in this time.
  3022. Object.defineProperty(gettersProxy, localType, {
  3023. get: function () { return store.getters[type]; },
  3024. enumerable: true
  3025. });
  3026. });
  3027. store._makeLocalGettersCache[namespace] = gettersProxy;
  3028. }
  3029. return store._makeLocalGettersCache[namespace]
  3030. }
  3031. function registerMutation (store, type, handler, local) {
  3032. var entry = store._mutations[type] || (store._mutations[type] = []);
  3033. entry.push(function wrappedMutationHandler (payload) {
  3034. handler.call(store, local.state, payload);
  3035. });
  3036. }
  3037. function registerAction (store, type, handler, local) {
  3038. var entry = store._actions[type] || (store._actions[type] = []);
  3039. entry.push(function wrappedActionHandler (payload) {
  3040. var res = handler.call(store, {
  3041. dispatch: local.dispatch,
  3042. commit: local.commit,
  3043. getters: local.getters,
  3044. state: local.state,
  3045. rootGetters: store.getters,
  3046. rootState: store.state
  3047. }, payload);
  3048. if (!isPromise(res)) {
  3049. res = Promise.resolve(res);
  3050. }
  3051. if (store._devtoolHook) {
  3052. return res.catch(function (err) {
  3053. store._devtoolHook.emit('vuex:error', err);
  3054. throw err
  3055. })
  3056. } else {
  3057. return res
  3058. }
  3059. });
  3060. }
  3061. function registerGetter (store, type, rawGetter, local) {
  3062. if (store._wrappedGetters[type]) {
  3063. if ((true)) {
  3064. console.error(("[vuex] duplicate getter key: " + type));
  3065. }
  3066. return
  3067. }
  3068. store._wrappedGetters[type] = function wrappedGetter (store) {
  3069. return rawGetter(
  3070. local.state, // local state
  3071. local.getters, // local getters
  3072. store.state, // root state
  3073. store.getters // root getters
  3074. )
  3075. };
  3076. }
  3077. function enableStrictMode (store) {
  3078. store._vm.$watch(function () { return this._data.$$state }, function () {
  3079. if ((true)) {
  3080. assert(store._committing, "do not mutate vuex store state outside mutation handlers.");
  3081. }
  3082. }, { deep: true, sync: true });
  3083. }
  3084. function getNestedState (state, path) {
  3085. return path.reduce(function (state, key) { return state[key]; }, state)
  3086. }
  3087. function unifyObjectStyle (type, payload, options) {
  3088. if (isObject(type) && type.type) {
  3089. options = payload;
  3090. payload = type;
  3091. type = type.type;
  3092. }
  3093. if ((true)) {
  3094. assert(typeof type === 'string', ("expects string as the type, but found " + (typeof type) + "."));
  3095. }
  3096. return { type: type, payload: payload, options: options }
  3097. }
  3098. function install (_Vue) {
  3099. if (Vue && _Vue === Vue) {
  3100. if ((true)) {
  3101. console.error(
  3102. '[vuex] already installed. Vue.use(Vuex) should be called only once.'
  3103. );
  3104. }
  3105. return
  3106. }
  3107. Vue = _Vue;
  3108. applyMixin(Vue);
  3109. }
  3110. /**
  3111. * Reduce the code which written in Vue.js for getting the state.
  3112. * @param {String} [namespace] - Module's namespace
  3113. * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.
  3114. * @param {Object}
  3115. */
  3116. var mapState = normalizeNamespace(function (namespace, states) {
  3117. var res = {};
  3118. if (( true) && !isValidMap(states)) {
  3119. console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');
  3120. }
  3121. normalizeMap(states).forEach(function (ref) {
  3122. var key = ref.key;
  3123. var val = ref.val;
  3124. res[key] = function mappedState () {
  3125. var state = this.$store.state;
  3126. var getters = this.$store.getters;
  3127. if (namespace) {
  3128. var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  3129. if (!module) {
  3130. return
  3131. }
  3132. state = module.context.state;
  3133. getters = module.context.getters;
  3134. }
  3135. return typeof val === 'function'
  3136. ? val.call(this, state, getters)
  3137. : state[val]
  3138. };
  3139. // mark vuex getter for devtools
  3140. res[key].vuex = true;
  3141. });
  3142. return res
  3143. });
  3144. /**
  3145. * Reduce the code which written in Vue.js for committing the mutation
  3146. * @param {String} [namespace] - Module's namespace
  3147. * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept anthor params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  3148. * @return {Object}
  3149. */
  3150. var mapMutations = normalizeNamespace(function (namespace, mutations) {
  3151. var res = {};
  3152. if (( true) && !isValidMap(mutations)) {
  3153. console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');
  3154. }
  3155. normalizeMap(mutations).forEach(function (ref) {
  3156. var key = ref.key;
  3157. var val = ref.val;
  3158. res[key] = function mappedMutation () {
  3159. var args = [], len = arguments.length;
  3160. while ( len-- ) args[ len ] = arguments[ len ];
  3161. // Get the commit method from store
  3162. var commit = this.$store.commit;
  3163. if (namespace) {
  3164. var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);
  3165. if (!module) {
  3166. return
  3167. }
  3168. commit = module.context.commit;
  3169. }
  3170. return typeof val === 'function'
  3171. ? val.apply(this, [commit].concat(args))
  3172. : commit.apply(this.$store, [val].concat(args))
  3173. };
  3174. });
  3175. return res
  3176. });
  3177. /**
  3178. * Reduce the code which written in Vue.js for getting the getters
  3179. * @param {String} [namespace] - Module's namespace
  3180. * @param {Object|Array} getters
  3181. * @return {Object}
  3182. */
  3183. var mapGetters = normalizeNamespace(function (namespace, getters) {
  3184. var res = {};
  3185. if (( true) && !isValidMap(getters)) {
  3186. console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');
  3187. }
  3188. normalizeMap(getters).forEach(function (ref) {
  3189. var key = ref.key;
  3190. var val = ref.val;
  3191. // The namespace has been mutated by normalizeNamespace
  3192. val = namespace + val;
  3193. res[key] = function mappedGetter () {
  3194. if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {
  3195. return
  3196. }
  3197. if (( true) && !(val in this.$store.getters)) {
  3198. console.error(("[vuex] unknown getter: " + val));
  3199. return
  3200. }
  3201. return this.$store.getters[val]
  3202. };
  3203. // mark vuex getter for devtools
  3204. res[key].vuex = true;
  3205. });
  3206. return res
  3207. });
  3208. /**
  3209. * Reduce the code which written in Vue.js for dispatch the action
  3210. * @param {String} [namespace] - Module's namespace
  3211. * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.
  3212. * @return {Object}
  3213. */
  3214. var mapActions = normalizeNamespace(function (namespace, actions) {
  3215. var res = {};
  3216. if (( true) && !isValidMap(actions)) {
  3217. console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');
  3218. }
  3219. normalizeMap(actions).forEach(function (ref) {
  3220. var key = ref.key;
  3221. var val = ref.val;
  3222. res[key] = function mappedAction () {
  3223. var args = [], len = arguments.length;
  3224. while ( len-- ) args[ len ] = arguments[ len ];
  3225. // get dispatch function from store
  3226. var dispatch = this.$store.dispatch;
  3227. if (namespace) {
  3228. var module = getModuleByNamespace(this.$store, 'mapActions', namespace);
  3229. if (!module) {
  3230. return
  3231. }
  3232. dispatch = module.context.dispatch;
  3233. }
  3234. return typeof val === 'function'
  3235. ? val.apply(this, [dispatch].concat(args))
  3236. : dispatch.apply(this.$store, [val].concat(args))
  3237. };
  3238. });
  3239. return res
  3240. });
  3241. /**
  3242. * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object
  3243. * @param {String} namespace
  3244. * @return {Object}
  3245. */
  3246. var createNamespacedHelpers = function (namespace) { return ({
  3247. mapState: mapState.bind(null, namespace),
  3248. mapGetters: mapGetters.bind(null, namespace),
  3249. mapMutations: mapMutations.bind(null, namespace),
  3250. mapActions: mapActions.bind(null, namespace)
  3251. }); };
  3252. /**
  3253. * Normalize the map
  3254. * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]
  3255. * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]
  3256. * @param {Array|Object} map
  3257. * @return {Object}
  3258. */
  3259. function normalizeMap (map) {
  3260. if (!isValidMap(map)) {
  3261. return []
  3262. }
  3263. return Array.isArray(map)
  3264. ? map.map(function (key) { return ({ key: key, val: key }); })
  3265. : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })
  3266. }
  3267. /**
  3268. * Validate whether given map is valid or not
  3269. * @param {*} map
  3270. * @return {Boolean}
  3271. */
  3272. function isValidMap (map) {
  3273. return Array.isArray(map) || isObject(map)
  3274. }
  3275. /**
  3276. * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.
  3277. * @param {Function} fn
  3278. * @return {Function}
  3279. */
  3280. function normalizeNamespace (fn) {
  3281. return function (namespace, map) {
  3282. if (typeof namespace !== 'string') {
  3283. map = namespace;
  3284. namespace = '';
  3285. } else if (namespace.charAt(namespace.length - 1) !== '/') {
  3286. namespace += '/';
  3287. }
  3288. return fn(namespace, map)
  3289. }
  3290. }
  3291. /**
  3292. * Search a special module from store by namespace. if module not exist, print error message.
  3293. * @param {Object} store
  3294. * @param {String} helper
  3295. * @param {String} namespace
  3296. * @return {Object}
  3297. */
  3298. function getModuleByNamespace (store, helper, namespace) {
  3299. var module = store._modulesNamespaceMap[namespace];
  3300. if (( true) && !module) {
  3301. console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace));
  3302. }
  3303. return module
  3304. }
  3305. var index = {
  3306. Store: Store,
  3307. install: install,
  3308. version: '3.4.0',
  3309. mapState: mapState,
  3310. mapMutations: mapMutations,
  3311. mapGetters: mapGetters,
  3312. mapActions: mapActions,
  3313. createNamespacedHelpers: createNamespacedHelpers
  3314. };
  3315. /* harmony default export */ __webpack_exports__["default"] = (index);
  3316. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ 3)))
  3317. /***/ }),
  3318. /***/ 16:
  3319. /*!******************************************************!*\
  3320. !*** E:/.swdz/uni-app/baoma/mabao/common/request.js ***!
  3321. \******************************************************/
  3322. /*! no static exports found */
  3323. /***/ (function(module, exports, __webpack_require__) {
  3324. "use strict";
  3325. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _store = _interopRequireDefault(__webpack_require__(/*! @/store */ 11));
  3326. var _env = __webpack_require__(/*! @/common/env */ 17);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} //获取环境接口地址
  3327. var user = __webpack_require__(/*! @/common/user.js */ 18);
  3328. /**
  3329. * 判断传入参数的类型,以字符串的形式返回
  3330. * @obj:数据
  3331. **/
  3332. function dataType(obj) {
  3333. if (obj === null) return "Null";
  3334. if (obj === undefined) return "Undefined";
  3335. return Object.prototype.toString.call(obj).slice(8, -1);
  3336. };
  3337. /**
  3338. * 处理对象参数值,排除对象参数值为”“、null、undefined,并返回一个新对象
  3339. **/
  3340. function dealObjectValue(obj) {
  3341. var param = {};
  3342. if (obj === null || obj === undefined || obj === "") return param;
  3343. for (var key in obj) {
  3344. if (dataType(obj[key]) === "Object") {
  3345. param[key] = dealObjectValue(obj[key]);
  3346. } else if (obj[key] !== null && obj[key] !== undefined && obj[key] !== "") {
  3347. param[key] = obj[key];
  3348. }
  3349. }
  3350. return param;
  3351. };
  3352. var post = function post(url, data, showloading) {
  3353. if (showloading != false) {
  3354. uni.showLoading({
  3355. mask: true,
  3356. title: '加载中' });
  3357. }
  3358. return new Promise(function (resolve, reject) {
  3359. data = dealObjectValue(data);
  3360. var jwt = _store.default.getters['getJwt'];
  3361. var header = {
  3362. 'content-type': 'application/x-www-form-urlencoded',
  3363. 'token': jwt //自定义请求头信息
  3364. };
  3365. uni.request({
  3366. url: _env.envHost + url,
  3367. method: 'POST',
  3368. data: data,
  3369. header: header,
  3370. success: function success(res) {
  3371. console.info(res);
  3372. if (res.statusCode == 200) {
  3373. if (res.data.code == 403) {
  3374. _store.default.commit('logout');
  3375. user.loginByWeixinCode().then(function (res) {
  3376. console.info(res);
  3377. }).catch(function (err) {
  3378. });
  3379. } else {
  3380. resolve(res.data);
  3381. }
  3382. } else {
  3383. reject(res.errMsg);
  3384. }
  3385. },
  3386. fail: function fail(err) {
  3387. reject();
  3388. // let errmsg = err.response.data;
  3389. // switch (err.response.status) {
  3390. // case 0:
  3391. // console.log("网络连接错误")
  3392. // errmsg = "网络连接错误";
  3393. // break;
  3394. // case 401:
  3395. // console.log("请登录后操作")
  3396. // errmsg = '请登录后操作';
  3397. // store.dispatch('logout');
  3398. // uni.redirectTo({
  3399. // url: '/pages/auth/login'
  3400. // })
  3401. // break
  3402. // case 404:
  3403. // errmsg = "接口不存在";
  3404. // break
  3405. // }
  3406. // uni.showToast({
  3407. // title: errmsg,
  3408. // icon: 'none'
  3409. // })
  3410. },
  3411. complete: function complete() {
  3412. uni.hideLoading();
  3413. } });
  3414. });
  3415. };
  3416. var get = function get(url, data, showloading) {
  3417. if (showloading != false) {
  3418. uni.showLoading({
  3419. mask: true,
  3420. title: '加载中' });
  3421. }
  3422. return new Promise(function (resolve, reject) {
  3423. data = dealObjectValue(data);
  3424. var jwt = _store.default.getters['getJwt'];
  3425. var header = {
  3426. 'token': jwt //自定义请求头信息
  3427. };
  3428. uni.request({
  3429. url: _env.envHost + url,
  3430. method: 'GET',
  3431. data: data,
  3432. header: header,
  3433. success: function success(res) {
  3434. //console.info(res)
  3435. if (res.statusCode == 200) {
  3436. if (res.data.code == 403) {
  3437. _store.default.commit('logout');
  3438. user.loginByWeixinCode().then(function (res) {
  3439. console.info(res);
  3440. }).catch(function (err) {
  3441. });
  3442. } else {
  3443. resolve(res.data);
  3444. }
  3445. } else {
  3446. reject(res.errMsg);
  3447. }
  3448. },
  3449. fail: function fail(err) {
  3450. reject();
  3451. // let errmsg = err.response.data;
  3452. // switch (err.response.status) {
  3453. // case 0:
  3454. // console.log("网络连接错误")
  3455. // errmsg = "网络连接错误";
  3456. // break;
  3457. // case 401:
  3458. // console.log("请登录后操作")
  3459. // errmsg = '请登录后操作';
  3460. // store.dispatch('logout');
  3461. // uni.redirectTo({
  3462. // url: '/pages/auth/login'
  3463. // })
  3464. // break
  3465. // case 404:
  3466. // errmsg = "接口不存在";
  3467. // break
  3468. // }
  3469. // uni.showToast({
  3470. // title: errmsg,
  3471. // icon: 'none'
  3472. // })
  3473. },
  3474. complete: function complete() {
  3475. uni.hideLoading();
  3476. } });
  3477. });
  3478. };
  3479. var upload = function upload(url, file, data, showloading) {
  3480. if (showloading != false) {
  3481. uni.showLoading({
  3482. mask: true,
  3483. title: '上传中...' });
  3484. }
  3485. return new Promise(function (resolve, reject) {
  3486. data = dealObjectValue(data);
  3487. var jwt = _store.default.getters['getJwt'];
  3488. var header = {
  3489. 'token': jwt //自定义请求头信息
  3490. };
  3491. uni.uploadFile({
  3492. url: _env.envHost + url,
  3493. // files: files,
  3494. filePath: file,
  3495. name: 'file',
  3496. formData: data,
  3497. header: header,
  3498. success: function success(res) {
  3499. console.info(res);
  3500. resolve(res.data);
  3501. },
  3502. fail: function fail(err) {
  3503. uni.showModal({
  3504. content: err.errMsg,
  3505. showCancel: false });
  3506. reject(err);
  3507. console.log('uploadImage fail', err);
  3508. },
  3509. complete: function complete() {
  3510. uni.hideLoading();
  3511. } });
  3512. });
  3513. };
  3514. var uploadAsync = function uploadAsync(url, file, data, _success, showloading) {
  3515. if (showloading != false) {
  3516. uni.showLoading({
  3517. mask: true,
  3518. title: '上传中...' });
  3519. }
  3520. data = dealObjectValue(data);
  3521. var jwt = _store.default.getters['getJwt'];
  3522. var header = {
  3523. 'token': jwt //自定义请求头信息
  3524. };
  3525. return uni.uploadFile({
  3526. url: _env.envHost + url,
  3527. // files: files,
  3528. filePath: file,
  3529. name: 'file',
  3530. formData: data,
  3531. header: header,
  3532. success: function success(res) {
  3533. console.info(res);
  3534. if (_success)
  3535. _success(JSON.parse(res.data));
  3536. },
  3537. fail: function fail(err) {
  3538. uni.showModal({
  3539. content: err.errMsg,
  3540. showCancel: false });
  3541. console.log('uploadImage fail', err);
  3542. },
  3543. complete: function complete() {
  3544. uni.hideLoading();
  3545. } });
  3546. };
  3547. var uploadFiles = function uploadFiles(url, files, data, showloading) {
  3548. if (showloading != false) {
  3549. uni.showLoading({
  3550. mask: true,
  3551. title: '上传中...' });
  3552. }
  3553. console.info(files);
  3554. return new Promise(function (resolve, reject) {
  3555. data = dealObjectValue(data);
  3556. var jwt = _store.default.getters['getJwt'];
  3557. var header = {
  3558. 'token': jwt //自定义请求头信息
  3559. };
  3560. uni.uploadFile({
  3561. url: _env.envHost + url,
  3562. files: files,
  3563. formData: data,
  3564. header: header,
  3565. success: function success(res) {
  3566. console.info(JSON.stringify(res));
  3567. resolve(JSON.parse(res.data));
  3568. },
  3569. fail: function fail(err) {
  3570. uni.showModal({
  3571. content: err.errMsg,
  3572. showCancel: false });
  3573. reject(err);
  3574. console.log('uploadImage fail', err);
  3575. },
  3576. complete: function complete() {
  3577. uni.hideLoading();
  3578. } });
  3579. });
  3580. };var _default =
  3581. {
  3582. post: post,
  3583. upload: upload,
  3584. uploadAsync: uploadAsync,
  3585. uploadFiles: uploadFiles,
  3586. get: get };exports.default = _default;
  3587. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3588. /***/ }),
  3589. /***/ 17:
  3590. /*!**************************************************!*\
  3591. !*** E:/.swdz/uni-app/baoma/mabao/common/env.js ***!
  3592. \**************************************************/
  3593. /*! no static exports found */
  3594. /***/ (function(module, exports, __webpack_require__) {
  3595. "use strict";
  3596. Object.defineProperty(exports, "__esModule", { value: true });exports.imgHost = exports.envHost = void 0;var envHost = 'https://t5.9026.com'; //开发环境
  3597. // export const imgHost='https://www.juyinzhengxin.com/';
  3598. exports.envHost = envHost;var imgHost = 'https://zhengda.oss-cn-chengdu.aliyuncs.com/juyin';exports.imgHost = imgHost;
  3599. /***/ }),
  3600. /***/ 18:
  3601. /*!***************************************************!*\
  3602. !*** E:/.swdz/uni-app/baoma/mabao/common/user.js ***!
  3603. \***************************************************/
  3604. /*! no static exports found */
  3605. /***/ (function(module, exports, __webpack_require__) {
  3606. "use strict";
  3607. /* WEBPACK VAR INJECTION */(function(uni) {
  3608. var _store = _interopRequireDefault(__webpack_require__(/*! @/store */ 11));
  3609. var _request = _interopRequireDefault(__webpack_require__(/*! @/common/request */ 16));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} /**
  3610. * 用户相关服务
  3611. */
  3612. /**
  3613. * Promise封装wx.checkSession
  3614. */
  3615. function checkSession() {
  3616. return new Promise(function (resolve, reject) {
  3617. wx.checkSession({
  3618. success: function success() {
  3619. resolve(true);
  3620. },
  3621. fail: function fail() {
  3622. reject(false);
  3623. } });
  3624. });
  3625. }
  3626. /**
  3627. * Promise封装wx.login
  3628. */
  3629. function login() {
  3630. return new Promise(function (resolve, reject) {
  3631. wx.login({
  3632. success: function success(res) {
  3633. if (res.code) {
  3634. resolve(res);
  3635. } else {
  3636. reject(res);
  3637. }
  3638. },
  3639. fail: function fail(err) {
  3640. reject(err);
  3641. } });
  3642. });
  3643. }
  3644. /**
  3645. * 调用微信登录
  3646. */
  3647. function loginByWeixinCode() {
  3648. return new Promise(function (resolve, reject) {
  3649. return login().then(function (res) {
  3650. var code = res.code;
  3651. //登录远程服务器
  3652. _request.default.post('/api/v1/common/wxLogin', {
  3653. wechat_code: code }).
  3654. then(function (res) {
  3655. if (res.code == 200) {
  3656. if (res.data.token) {
  3657. _store.default.commit('setJwt', res.data.token);
  3658. _store.default.commit('setUser', res.data);
  3659. _store.default.commit('login');
  3660. resolve(res);
  3661. } else {
  3662. uni.showToast({
  3663. title: '登录失败',
  3664. icon: "none" });
  3665. reject(res);
  3666. }
  3667. } else {
  3668. reject(res);
  3669. }
  3670. }).catch(function (err) {
  3671. reject(err);
  3672. });
  3673. }).catch(function (err) {
  3674. reject(err);
  3675. });
  3676. });
  3677. }
  3678. /**
  3679. * 调用微信登录
  3680. */
  3681. function loginByWeixin(userInfo) {
  3682. return new Promise(function (resolve, reject) {
  3683. return login().then(function (res) {
  3684. var code = res.code;
  3685. //登录远程服务器
  3686. _request.default.post('/api/v1/common/wxLogin', {
  3687. // up_id: uni.getStorageSync("up_id"),
  3688. wechat_code: code,
  3689. nickname: userInfo.nickName,
  3690. avatar: userInfo.avatarUrl }).
  3691. then(function (res) {
  3692. if (res.status == 0) {
  3693. if (res.data.token) {
  3694. _store.default.commit('setJwt', res.data.token);
  3695. _store.default.commit('setUser', res.data);
  3696. _store.default.commit('login');
  3697. resolve(res);
  3698. } else {
  3699. reject(res);
  3700. }
  3701. } else {
  3702. reject(res);
  3703. }
  3704. }).catch(function (err) {
  3705. reject(err);
  3706. });
  3707. }).catch(function (err) {
  3708. reject(err);
  3709. });
  3710. });
  3711. }
  3712. /**
  3713. * 判断用户是否登录
  3714. */
  3715. function checkLogin() {
  3716. return new Promise(function (resolve, reject) {
  3717. if (_store.default.getters['verifyJwt']) {
  3718. checkSession().then(function () {
  3719. resolve(true);
  3720. }).catch(function () {
  3721. reject(false);
  3722. });
  3723. } else {
  3724. reject(false);
  3725. }
  3726. });
  3727. }
  3728. function islogin(res) {
  3729. if (res.status == 401) {
  3730. uni.showModal({
  3731. title: "提示",
  3732. content: "暂未登录,请登录",
  3733. showCancel: false,
  3734. confirmText: "去登录",
  3735. success: function success(re) {
  3736. if (re.confirm) {
  3737. uni.navigateTo({
  3738. url: "/pages/login/login" });
  3739. }
  3740. } });
  3741. } else {
  3742. return true;
  3743. }
  3744. }
  3745. module.exports = {
  3746. loginByWeixin: loginByWeixin,
  3747. loginByWeixinCode: loginByWeixinCode,
  3748. checkLogin: checkLogin,
  3749. islogin: islogin };
  3750. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3751. /***/ }),
  3752. /***/ 19:
  3753. /*!***************************************************!*\
  3754. !*** E:/.swdz/uni-app/baoma/mabao/common/util.js ***!
  3755. \***************************************************/
  3756. /*! no static exports found */
  3757. /***/ (function(module, exports, __webpack_require__) {
  3758. /* WEBPACK VAR INJECTION */(function(uni) {
  3759. function ViewImage(imgList, e) {
  3760. uni.previewImage({
  3761. urls: imgList,
  3762. current: e.currentTarget.dataset.url });
  3763. }
  3764. function formatTime(time) {
  3765. if (typeof time !== 'number' || time < 0) {
  3766. return time;
  3767. }
  3768. var hour = parseInt(time / 3600);
  3769. time = time % 3600;
  3770. var minute = parseInt(time / 60);
  3771. time = time % 60;
  3772. var second = time;
  3773. return [hour, minute, second].map(function (n) {
  3774. n = n.toString();
  3775. return n[1] ? n : '0' + n;
  3776. }).join(':');
  3777. }
  3778. // 判断是否为手机号
  3779. function isPhoneNumber(pone) {
  3780. var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
  3781. if (!myreg.test(pone)) {
  3782. return false;
  3783. } else {
  3784. return true;
  3785. }
  3786. }
  3787. //密码判断
  3788. function isPassword(p) {
  3789. var myreg = /^[a-zA-Z0-9]{6,12}$/;
  3790. if (!myreg.test(p)) {
  3791. return false;
  3792. } else {
  3793. return true;
  3794. }
  3795. }
  3796. //判断验证码
  3797. function isCaptcha(p) {
  3798. var myreg = /^[0-9A-Za-z]{4,12}$/;
  3799. if (!myreg.test(p)) {
  3800. return false;
  3801. } else {
  3802. return true;
  3803. }
  3804. }
  3805. //判断用户名
  3806. function isUserName(p) {
  3807. var myreg = /^[a-zA-Z0-9]{1,20}$/;
  3808. if (!myreg.test(p)) {
  3809. return false;
  3810. } else {
  3811. return true;
  3812. }
  3813. }
  3814. //判断身份证
  3815. function isIdCard(value) {
  3816. var myReg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
  3817. if (!myReg.test(value)) {
  3818. return false;
  3819. } else {
  3820. return true;
  3821. }
  3822. }
  3823. var isEmpty = function isEmpty(a) {
  3824. return typeof a == 'undefined' || a == null || a == '' || a == 'undefined';
  3825. };
  3826. function formatLocation(longitude, latitude) {
  3827. if (typeof longitude === 'string' && typeof latitude === 'string') {
  3828. longitude = parseFloat(longitude);
  3829. latitude = parseFloat(latitude);
  3830. }
  3831. longitude = longitude.toFixed(2);
  3832. latitude = latitude.toFixed(2);
  3833. return {
  3834. longitude: longitude.toString().split('.'),
  3835. latitude: latitude.toString().split('.') };
  3836. }
  3837. var dateUtils = {
  3838. UNITS: {
  3839. '年': 31557600000,
  3840. '月': 2629800000,
  3841. '天': 86400000,
  3842. '小时': 3600000,
  3843. '分钟': 60000,
  3844. '秒': 1000 },
  3845. humanize: function humanize(milliseconds, date) {
  3846. var humanize = '';
  3847. var _format = function _format(number) {
  3848. return number < 10 ? '0' + number : number;
  3849. };
  3850. for (var key in this.UNITS) {
  3851. if (milliseconds >= this.UNITS[key]) {
  3852. switch (key) {
  3853. case '小时':
  3854. humanize = _format(date.getHours()) + ':' + _format(date.getMinutes());
  3855. break;
  3856. default:
  3857. humanize = Math.floor(milliseconds / this.UNITS[key]) + key + '前';
  3858. break;}
  3859. break;
  3860. }
  3861. }
  3862. return humanize || '刚刚';
  3863. },
  3864. format: function format(dateStr) {
  3865. var date = this.parse(dateStr);
  3866. var diff = Date.now() - date.getTime();
  3867. if (diff < this.UNITS['天']) {
  3868. return this.humanize(diff, date);
  3869. }
  3870. var _format = function _format(number) {
  3871. return number < 10 ? '0' + number : number;
  3872. };
  3873. return date.getFullYear() + '-' + _format(date.getMonth() + 1) + '-' + _format(date.getDate()) + '-' +
  3874. _format(date.getHours()) + ':' + _format(date.getMinutes());
  3875. },
  3876. formatHms: function formatHms(dateStr) {
  3877. var date = this.parse(dateStr);
  3878. var _format = function _format(number) {
  3879. return number < 10 ? '0' + number : number;
  3880. };
  3881. return _format(date.getHours()) + ':' + _format(date.getMinutes());
  3882. },
  3883. formatYMD: function formatYMD(dateStr) {
  3884. var date = this.parse(dateStr);
  3885. var _format = function _format(number) {
  3886. return number < 10 ? '0' + number : number;
  3887. };
  3888. return date.getFullYear() + '-' + _format(date.getMonth() + 1) + '-' + _format(date.getDate());
  3889. },
  3890. parse: function parse(str) {//将"yyyy-mm-dd HH:MM:ss"格式的字符串,转化为一个Date对象
  3891. if (!str) {
  3892. return new Date();
  3893. }
  3894. var a = str.split(/[^0-9]/);
  3895. return new Date(a[0], a[1] - 1, a[2], a[3], a[4], a[5]);
  3896. },
  3897. /**************************************时间格式化处理************************************/
  3898. dateFtt: function dateFtt(fmt, date) {//author: meizz
  3899. var o = {
  3900. "M+": date.getMonth() + 1, //月份
  3901. "d+": date.getDate(), //日
  3902. "H+": date.getHours(), //小时
  3903. "m+": date.getMinutes(), //分
  3904. "s+": date.getSeconds(), //秒
  3905. "q+": Math.floor((date.getMonth() + 3) / 3), //季度
  3906. "S": date.getMilliseconds() //毫秒
  3907. };
  3908. if (/(y+)/.test(fmt))
  3909. fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
  3910. for (var k in o) {
  3911. if (new RegExp("(" + k + ")").test(fmt))
  3912. fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));}
  3913. return fmt;
  3914. } };
  3915. module.exports = {
  3916. formatTime: formatTime,
  3917. isPhoneNumber: isPhoneNumber,
  3918. isUserName: isUserName,
  3919. isPassword: isPassword,
  3920. isCaptcha: isCaptcha,
  3921. formatLocation: formatLocation,
  3922. dateUtils: dateUtils,
  3923. isEmpty: isEmpty,
  3924. isIdCard: isIdCard,
  3925. ViewImage: ViewImage };
  3926. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  3927. /***/ }),
  3928. /***/ 2:
  3929. /*!******************************************************************************************!*\
  3930. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  3931. \******************************************************************************************/
  3932. /*! exports provided: default */
  3933. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  3934. "use strict";
  3935. __webpack_require__.r(__webpack_exports__);
  3936. /* WEBPACK VAR INJECTION */(function(global) {/*!
  3937. * Vue.js v2.6.11
  3938. * (c) 2014-2020 Evan You
  3939. * Released under the MIT License.
  3940. */
  3941. /* */
  3942. var emptyObject = Object.freeze({});
  3943. // These helpers produce better VM code in JS engines due to their
  3944. // explicitness and function inlining.
  3945. function isUndef (v) {
  3946. return v === undefined || v === null
  3947. }
  3948. function isDef (v) {
  3949. return v !== undefined && v !== null
  3950. }
  3951. function isTrue (v) {
  3952. return v === true
  3953. }
  3954. function isFalse (v) {
  3955. return v === false
  3956. }
  3957. /**
  3958. * Check if value is primitive.
  3959. */
  3960. function isPrimitive (value) {
  3961. return (
  3962. typeof value === 'string' ||
  3963. typeof value === 'number' ||
  3964. // $flow-disable-line
  3965. typeof value === 'symbol' ||
  3966. typeof value === 'boolean'
  3967. )
  3968. }
  3969. /**
  3970. * Quick object check - this is primarily used to tell
  3971. * Objects from primitive values when we know the value
  3972. * is a JSON-compliant type.
  3973. */
  3974. function isObject (obj) {
  3975. return obj !== null && typeof obj === 'object'
  3976. }
  3977. /**
  3978. * Get the raw type string of a value, e.g., [object Object].
  3979. */
  3980. var _toString = Object.prototype.toString;
  3981. function toRawType (value) {
  3982. return _toString.call(value).slice(8, -1)
  3983. }
  3984. /**
  3985. * Strict object type check. Only returns true
  3986. * for plain JavaScript objects.
  3987. */
  3988. function isPlainObject (obj) {
  3989. return _toString.call(obj) === '[object Object]'
  3990. }
  3991. function isRegExp (v) {
  3992. return _toString.call(v) === '[object RegExp]'
  3993. }
  3994. /**
  3995. * Check if val is a valid array index.
  3996. */
  3997. function isValidArrayIndex (val) {
  3998. var n = parseFloat(String(val));
  3999. return n >= 0 && Math.floor(n) === n && isFinite(val)
  4000. }
  4001. function isPromise (val) {
  4002. return (
  4003. isDef(val) &&
  4004. typeof val.then === 'function' &&
  4005. typeof val.catch === 'function'
  4006. )
  4007. }
  4008. /**
  4009. * Convert a value to a string that is actually rendered.
  4010. */
  4011. function toString (val) {
  4012. return val == null
  4013. ? ''
  4014. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  4015. ? JSON.stringify(val, null, 2)
  4016. : String(val)
  4017. }
  4018. /**
  4019. * Convert an input value to a number for persistence.
  4020. * If the conversion fails, return original string.
  4021. */
  4022. function toNumber (val) {
  4023. var n = parseFloat(val);
  4024. return isNaN(n) ? val : n
  4025. }
  4026. /**
  4027. * Make a map and return a function for checking if a key
  4028. * is in that map.
  4029. */
  4030. function makeMap (
  4031. str,
  4032. expectsLowerCase
  4033. ) {
  4034. var map = Object.create(null);
  4035. var list = str.split(',');
  4036. for (var i = 0; i < list.length; i++) {
  4037. map[list[i]] = true;
  4038. }
  4039. return expectsLowerCase
  4040. ? function (val) { return map[val.toLowerCase()]; }
  4041. : function (val) { return map[val]; }
  4042. }
  4043. /**
  4044. * Check if a tag is a built-in tag.
  4045. */
  4046. var isBuiltInTag = makeMap('slot,component', true);
  4047. /**
  4048. * Check if an attribute is a reserved attribute.
  4049. */
  4050. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  4051. /**
  4052. * Remove an item from an array.
  4053. */
  4054. function remove (arr, item) {
  4055. if (arr.length) {
  4056. var index = arr.indexOf(item);
  4057. if (index > -1) {
  4058. return arr.splice(index, 1)
  4059. }
  4060. }
  4061. }
  4062. /**
  4063. * Check whether an object has the property.
  4064. */
  4065. var hasOwnProperty = Object.prototype.hasOwnProperty;
  4066. function hasOwn (obj, key) {
  4067. return hasOwnProperty.call(obj, key)
  4068. }
  4069. /**
  4070. * Create a cached version of a pure function.
  4071. */
  4072. function cached (fn) {
  4073. var cache = Object.create(null);
  4074. return (function cachedFn (str) {
  4075. var hit = cache[str];
  4076. return hit || (cache[str] = fn(str))
  4077. })
  4078. }
  4079. /**
  4080. * Camelize a hyphen-delimited string.
  4081. */
  4082. var camelizeRE = /-(\w)/g;
  4083. var camelize = cached(function (str) {
  4084. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  4085. });
  4086. /**
  4087. * Capitalize a string.
  4088. */
  4089. var capitalize = cached(function (str) {
  4090. return str.charAt(0).toUpperCase() + str.slice(1)
  4091. });
  4092. /**
  4093. * Hyphenate a camelCase string.
  4094. */
  4095. var hyphenateRE = /\B([A-Z])/g;
  4096. var hyphenate = cached(function (str) {
  4097. return str.replace(hyphenateRE, '-$1').toLowerCase()
  4098. });
  4099. /**
  4100. * Simple bind polyfill for environments that do not support it,
  4101. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  4102. * since native bind is now performant enough in most browsers.
  4103. * But removing it would mean breaking code that was able to run in
  4104. * PhantomJS 1.x, so this must be kept for backward compatibility.
  4105. */
  4106. /* istanbul ignore next */
  4107. function polyfillBind (fn, ctx) {
  4108. function boundFn (a) {
  4109. var l = arguments.length;
  4110. return l
  4111. ? l > 1
  4112. ? fn.apply(ctx, arguments)
  4113. : fn.call(ctx, a)
  4114. : fn.call(ctx)
  4115. }
  4116. boundFn._length = fn.length;
  4117. return boundFn
  4118. }
  4119. function nativeBind (fn, ctx) {
  4120. return fn.bind(ctx)
  4121. }
  4122. var bind = Function.prototype.bind
  4123. ? nativeBind
  4124. : polyfillBind;
  4125. /**
  4126. * Convert an Array-like object to a real Array.
  4127. */
  4128. function toArray (list, start) {
  4129. start = start || 0;
  4130. var i = list.length - start;
  4131. var ret = new Array(i);
  4132. while (i--) {
  4133. ret[i] = list[i + start];
  4134. }
  4135. return ret
  4136. }
  4137. /**
  4138. * Mix properties into target object.
  4139. */
  4140. function extend (to, _from) {
  4141. for (var key in _from) {
  4142. to[key] = _from[key];
  4143. }
  4144. return to
  4145. }
  4146. /**
  4147. * Merge an Array of Objects into a single Object.
  4148. */
  4149. function toObject (arr) {
  4150. var res = {};
  4151. for (var i = 0; i < arr.length; i++) {
  4152. if (arr[i]) {
  4153. extend(res, arr[i]);
  4154. }
  4155. }
  4156. return res
  4157. }
  4158. /* eslint-disable no-unused-vars */
  4159. /**
  4160. * Perform no operation.
  4161. * Stubbing args to make Flow happy without leaving useless transpiled code
  4162. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  4163. */
  4164. function noop (a, b, c) {}
  4165. /**
  4166. * Always return false.
  4167. */
  4168. var no = function (a, b, c) { return false; };
  4169. /* eslint-enable no-unused-vars */
  4170. /**
  4171. * Return the same value.
  4172. */
  4173. var identity = function (_) { return _; };
  4174. /**
  4175. * Check if two values are loosely equal - that is,
  4176. * if they are plain objects, do they have the same shape?
  4177. */
  4178. function looseEqual (a, b) {
  4179. if (a === b) { return true }
  4180. var isObjectA = isObject(a);
  4181. var isObjectB = isObject(b);
  4182. if (isObjectA && isObjectB) {
  4183. try {
  4184. var isArrayA = Array.isArray(a);
  4185. var isArrayB = Array.isArray(b);
  4186. if (isArrayA && isArrayB) {
  4187. return a.length === b.length && a.every(function (e, i) {
  4188. return looseEqual(e, b[i])
  4189. })
  4190. } else if (a instanceof Date && b instanceof Date) {
  4191. return a.getTime() === b.getTime()
  4192. } else if (!isArrayA && !isArrayB) {
  4193. var keysA = Object.keys(a);
  4194. var keysB = Object.keys(b);
  4195. return keysA.length === keysB.length && keysA.every(function (key) {
  4196. return looseEqual(a[key], b[key])
  4197. })
  4198. } else {
  4199. /* istanbul ignore next */
  4200. return false
  4201. }
  4202. } catch (e) {
  4203. /* istanbul ignore next */
  4204. return false
  4205. }
  4206. } else if (!isObjectA && !isObjectB) {
  4207. return String(a) === String(b)
  4208. } else {
  4209. return false
  4210. }
  4211. }
  4212. /**
  4213. * Return the first index at which a loosely equal value can be
  4214. * found in the array (if value is a plain object, the array must
  4215. * contain an object of the same shape), or -1 if it is not present.
  4216. */
  4217. function looseIndexOf (arr, val) {
  4218. for (var i = 0; i < arr.length; i++) {
  4219. if (looseEqual(arr[i], val)) { return i }
  4220. }
  4221. return -1
  4222. }
  4223. /**
  4224. * Ensure a function is called only once.
  4225. */
  4226. function once (fn) {
  4227. var called = false;
  4228. return function () {
  4229. if (!called) {
  4230. called = true;
  4231. fn.apply(this, arguments);
  4232. }
  4233. }
  4234. }
  4235. var ASSET_TYPES = [
  4236. 'component',
  4237. 'directive',
  4238. 'filter'
  4239. ];
  4240. var LIFECYCLE_HOOKS = [
  4241. 'beforeCreate',
  4242. 'created',
  4243. 'beforeMount',
  4244. 'mounted',
  4245. 'beforeUpdate',
  4246. 'updated',
  4247. 'beforeDestroy',
  4248. 'destroyed',
  4249. 'activated',
  4250. 'deactivated',
  4251. 'errorCaptured',
  4252. 'serverPrefetch'
  4253. ];
  4254. /* */
  4255. var config = ({
  4256. /**
  4257. * Option merge strategies (used in core/util/options)
  4258. */
  4259. // $flow-disable-line
  4260. optionMergeStrategies: Object.create(null),
  4261. /**
  4262. * Whether to suppress warnings.
  4263. */
  4264. silent: false,
  4265. /**
  4266. * Show production mode tip message on boot?
  4267. */
  4268. productionTip: "development" !== 'production',
  4269. /**
  4270. * Whether to enable devtools
  4271. */
  4272. devtools: "development" !== 'production',
  4273. /**
  4274. * Whether to record perf
  4275. */
  4276. performance: false,
  4277. /**
  4278. * Error handler for watcher errors
  4279. */
  4280. errorHandler: null,
  4281. /**
  4282. * Warn handler for watcher warns
  4283. */
  4284. warnHandler: null,
  4285. /**
  4286. * Ignore certain custom elements
  4287. */
  4288. ignoredElements: [],
  4289. /**
  4290. * Custom user key aliases for v-on
  4291. */
  4292. // $flow-disable-line
  4293. keyCodes: Object.create(null),
  4294. /**
  4295. * Check if a tag is reserved so that it cannot be registered as a
  4296. * component. This is platform-dependent and may be overwritten.
  4297. */
  4298. isReservedTag: no,
  4299. /**
  4300. * Check if an attribute is reserved so that it cannot be used as a component
  4301. * prop. This is platform-dependent and may be overwritten.
  4302. */
  4303. isReservedAttr: no,
  4304. /**
  4305. * Check if a tag is an unknown element.
  4306. * Platform-dependent.
  4307. */
  4308. isUnknownElement: no,
  4309. /**
  4310. * Get the namespace of an element
  4311. */
  4312. getTagNamespace: noop,
  4313. /**
  4314. * Parse the real tag name for the specific platform.
  4315. */
  4316. parsePlatformTagName: identity,
  4317. /**
  4318. * Check if an attribute must be bound using property, e.g. value
  4319. * Platform-dependent.
  4320. */
  4321. mustUseProp: no,
  4322. /**
  4323. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  4324. * This will significantly reduce performance if set to false.
  4325. */
  4326. async: true,
  4327. /**
  4328. * Exposed for legacy reasons
  4329. */
  4330. _lifecycleHooks: LIFECYCLE_HOOKS
  4331. });
  4332. /* */
  4333. /**
  4334. * unicode letters used for parsing html tags, component names and property paths.
  4335. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  4336. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  4337. */
  4338. 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/;
  4339. /**
  4340. * Check if a string starts with $ or _
  4341. */
  4342. function isReserved (str) {
  4343. var c = (str + '').charCodeAt(0);
  4344. return c === 0x24 || c === 0x5F
  4345. }
  4346. /**
  4347. * Define a property.
  4348. */
  4349. function def (obj, key, val, enumerable) {
  4350. Object.defineProperty(obj, key, {
  4351. value: val,
  4352. enumerable: !!enumerable,
  4353. writable: true,
  4354. configurable: true
  4355. });
  4356. }
  4357. /**
  4358. * Parse simple path.
  4359. */
  4360. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  4361. function parsePath (path) {
  4362. if (bailRE.test(path)) {
  4363. return
  4364. }
  4365. var segments = path.split('.');
  4366. return function (obj) {
  4367. for (var i = 0; i < segments.length; i++) {
  4368. if (!obj) { return }
  4369. obj = obj[segments[i]];
  4370. }
  4371. return obj
  4372. }
  4373. }
  4374. /* */
  4375. // can we use __proto__?
  4376. var hasProto = '__proto__' in {};
  4377. // Browser environment sniffing
  4378. var inBrowser = typeof window !== 'undefined';
  4379. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  4380. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  4381. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  4382. var isIE = UA && /msie|trident/.test(UA);
  4383. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  4384. var isEdge = UA && UA.indexOf('edge/') > 0;
  4385. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  4386. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  4387. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  4388. var isPhantomJS = UA && /phantomjs/.test(UA);
  4389. var isFF = UA && UA.match(/firefox\/(\d+)/);
  4390. // Firefox has a "watch" function on Object.prototype...
  4391. var nativeWatch = ({}).watch;
  4392. if (inBrowser) {
  4393. try {
  4394. var opts = {};
  4395. Object.defineProperty(opts, 'passive', ({
  4396. get: function get () {
  4397. }
  4398. })); // https://github.com/facebook/flow/issues/285
  4399. window.addEventListener('test-passive', null, opts);
  4400. } catch (e) {}
  4401. }
  4402. // this needs to be lazy-evaled because vue may be required before
  4403. // vue-server-renderer can set VUE_ENV
  4404. var _isServer;
  4405. var isServerRendering = function () {
  4406. if (_isServer === undefined) {
  4407. /* istanbul ignore if */
  4408. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  4409. // detect presence of vue-server-renderer and avoid
  4410. // Webpack shimming the process
  4411. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  4412. } else {
  4413. _isServer = false;
  4414. }
  4415. }
  4416. return _isServer
  4417. };
  4418. // detect devtools
  4419. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  4420. /* istanbul ignore next */
  4421. function isNative (Ctor) {
  4422. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  4423. }
  4424. var hasSymbol =
  4425. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  4426. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  4427. var _Set;
  4428. /* istanbul ignore if */ // $flow-disable-line
  4429. if (typeof Set !== 'undefined' && isNative(Set)) {
  4430. // use native Set when available.
  4431. _Set = Set;
  4432. } else {
  4433. // a non-standard Set polyfill that only works with primitive keys.
  4434. _Set = /*@__PURE__*/(function () {
  4435. function Set () {
  4436. this.set = Object.create(null);
  4437. }
  4438. Set.prototype.has = function has (key) {
  4439. return this.set[key] === true
  4440. };
  4441. Set.prototype.add = function add (key) {
  4442. this.set[key] = true;
  4443. };
  4444. Set.prototype.clear = function clear () {
  4445. this.set = Object.create(null);
  4446. };
  4447. return Set;
  4448. }());
  4449. }
  4450. /* */
  4451. var warn = noop;
  4452. var tip = noop;
  4453. var generateComponentTrace = (noop); // work around flow check
  4454. var formatComponentName = (noop);
  4455. if (true) {
  4456. var hasConsole = typeof console !== 'undefined';
  4457. var classifyRE = /(?:^|[-_])(\w)/g;
  4458. var classify = function (str) { return str
  4459. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  4460. .replace(/[-_]/g, ''); };
  4461. warn = function (msg, vm) {
  4462. var trace = vm ? generateComponentTrace(vm) : '';
  4463. if (config.warnHandler) {
  4464. config.warnHandler.call(null, msg, vm, trace);
  4465. } else if (hasConsole && (!config.silent)) {
  4466. console.error(("[Vue warn]: " + msg + trace));
  4467. }
  4468. };
  4469. tip = function (msg, vm) {
  4470. if (hasConsole && (!config.silent)) {
  4471. console.warn("[Vue tip]: " + msg + (
  4472. vm ? generateComponentTrace(vm) : ''
  4473. ));
  4474. }
  4475. };
  4476. formatComponentName = function (vm, includeFile) {
  4477. if (vm.$root === vm) {
  4478. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  4479. return ('') + vm.$options.__file
  4480. }
  4481. return '<Root>'
  4482. }
  4483. var options = typeof vm === 'function' && vm.cid != null
  4484. ? vm.options
  4485. : vm._isVue
  4486. ? vm.$options || vm.constructor.options
  4487. : vm;
  4488. var name = options.name || options._componentTag;
  4489. var file = options.__file;
  4490. if (!name && file) {
  4491. var match = file.match(/([^/\\]+)\.vue$/);
  4492. name = match && match[1];
  4493. }
  4494. return (
  4495. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  4496. (file && includeFile !== false ? (" at " + file) : '')
  4497. )
  4498. };
  4499. var repeat = function (str, n) {
  4500. var res = '';
  4501. while (n) {
  4502. if (n % 2 === 1) { res += str; }
  4503. if (n > 1) { str += str; }
  4504. n >>= 1;
  4505. }
  4506. return res
  4507. };
  4508. generateComponentTrace = function (vm) {
  4509. if (vm._isVue && vm.$parent) {
  4510. var tree = [];
  4511. var currentRecursiveSequence = 0;
  4512. while (vm && vm.$options.name !== 'PageBody') {
  4513. if (tree.length > 0) {
  4514. var last = tree[tree.length - 1];
  4515. if (last.constructor === vm.constructor) {
  4516. currentRecursiveSequence++;
  4517. vm = vm.$parent;
  4518. continue
  4519. } else if (currentRecursiveSequence > 0) {
  4520. tree[tree.length - 1] = [last, currentRecursiveSequence];
  4521. currentRecursiveSequence = 0;
  4522. }
  4523. }
  4524. !vm.$options.isReserved && tree.push(vm);
  4525. vm = vm.$parent;
  4526. }
  4527. return '\n\nfound in\n\n' + tree
  4528. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  4529. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  4530. : formatComponentName(vm))); })
  4531. .join('\n')
  4532. } else {
  4533. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  4534. }
  4535. };
  4536. }
  4537. /* */
  4538. var uid = 0;
  4539. /**
  4540. * A dep is an observable that can have multiple
  4541. * directives subscribing to it.
  4542. */
  4543. var Dep = function Dep () {
  4544. this.id = uid++;
  4545. this.subs = [];
  4546. };
  4547. Dep.prototype.addSub = function addSub (sub) {
  4548. this.subs.push(sub);
  4549. };
  4550. Dep.prototype.removeSub = function removeSub (sub) {
  4551. remove(this.subs, sub);
  4552. };
  4553. Dep.prototype.depend = function depend () {
  4554. if (Dep.SharedObject.target) {
  4555. Dep.SharedObject.target.addDep(this);
  4556. }
  4557. };
  4558. Dep.prototype.notify = function notify () {
  4559. // stabilize the subscriber list first
  4560. var subs = this.subs.slice();
  4561. if ( true && !config.async) {
  4562. // subs aren't sorted in scheduler if not running async
  4563. // we need to sort them now to make sure they fire in correct
  4564. // order
  4565. subs.sort(function (a, b) { return a.id - b.id; });
  4566. }
  4567. for (var i = 0, l = subs.length; i < l; i++) {
  4568. subs[i].update();
  4569. }
  4570. };
  4571. // The current target watcher being evaluated.
  4572. // This is globally unique because only one watcher
  4573. // can be evaluated at a time.
  4574. // fixed by xxxxxx (nvue shared vuex)
  4575. /* eslint-disable no-undef */
  4576. Dep.SharedObject = {};
  4577. Dep.SharedObject.target = null;
  4578. Dep.SharedObject.targetStack = [];
  4579. function pushTarget (target) {
  4580. Dep.SharedObject.targetStack.push(target);
  4581. Dep.SharedObject.target = target;
  4582. }
  4583. function popTarget () {
  4584. Dep.SharedObject.targetStack.pop();
  4585. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  4586. }
  4587. /* */
  4588. var VNode = function VNode (
  4589. tag,
  4590. data,
  4591. children,
  4592. text,
  4593. elm,
  4594. context,
  4595. componentOptions,
  4596. asyncFactory
  4597. ) {
  4598. this.tag = tag;
  4599. this.data = data;
  4600. this.children = children;
  4601. this.text = text;
  4602. this.elm = elm;
  4603. this.ns = undefined;
  4604. this.context = context;
  4605. this.fnContext = undefined;
  4606. this.fnOptions = undefined;
  4607. this.fnScopeId = undefined;
  4608. this.key = data && data.key;
  4609. this.componentOptions = componentOptions;
  4610. this.componentInstance = undefined;
  4611. this.parent = undefined;
  4612. this.raw = false;
  4613. this.isStatic = false;
  4614. this.isRootInsert = true;
  4615. this.isComment = false;
  4616. this.isCloned = false;
  4617. this.isOnce = false;
  4618. this.asyncFactory = asyncFactory;
  4619. this.asyncMeta = undefined;
  4620. this.isAsyncPlaceholder = false;
  4621. };
  4622. var prototypeAccessors = { child: { configurable: true } };
  4623. // DEPRECATED: alias for componentInstance for backwards compat.
  4624. /* istanbul ignore next */
  4625. prototypeAccessors.child.get = function () {
  4626. return this.componentInstance
  4627. };
  4628. Object.defineProperties( VNode.prototype, prototypeAccessors );
  4629. var createEmptyVNode = function (text) {
  4630. if ( text === void 0 ) text = '';
  4631. var node = new VNode();
  4632. node.text = text;
  4633. node.isComment = true;
  4634. return node
  4635. };
  4636. function createTextVNode (val) {
  4637. return new VNode(undefined, undefined, undefined, String(val))
  4638. }
  4639. // optimized shallow clone
  4640. // used for static nodes and slot nodes because they may be reused across
  4641. // multiple renders, cloning them avoids errors when DOM manipulations rely
  4642. // on their elm reference.
  4643. function cloneVNode (vnode) {
  4644. var cloned = new VNode(
  4645. vnode.tag,
  4646. vnode.data,
  4647. // #7975
  4648. // clone children array to avoid mutating original in case of cloning
  4649. // a child.
  4650. vnode.children && vnode.children.slice(),
  4651. vnode.text,
  4652. vnode.elm,
  4653. vnode.context,
  4654. vnode.componentOptions,
  4655. vnode.asyncFactory
  4656. );
  4657. cloned.ns = vnode.ns;
  4658. cloned.isStatic = vnode.isStatic;
  4659. cloned.key = vnode.key;
  4660. cloned.isComment = vnode.isComment;
  4661. cloned.fnContext = vnode.fnContext;
  4662. cloned.fnOptions = vnode.fnOptions;
  4663. cloned.fnScopeId = vnode.fnScopeId;
  4664. cloned.asyncMeta = vnode.asyncMeta;
  4665. cloned.isCloned = true;
  4666. return cloned
  4667. }
  4668. /*
  4669. * not type checking this file because flow doesn't play well with
  4670. * dynamically accessing methods on Array prototype
  4671. */
  4672. var arrayProto = Array.prototype;
  4673. var arrayMethods = Object.create(arrayProto);
  4674. var methodsToPatch = [
  4675. 'push',
  4676. 'pop',
  4677. 'shift',
  4678. 'unshift',
  4679. 'splice',
  4680. 'sort',
  4681. 'reverse'
  4682. ];
  4683. /**
  4684. * Intercept mutating methods and emit events
  4685. */
  4686. methodsToPatch.forEach(function (method) {
  4687. // cache original method
  4688. var original = arrayProto[method];
  4689. def(arrayMethods, method, function mutator () {
  4690. var args = [], len = arguments.length;
  4691. while ( len-- ) args[ len ] = arguments[ len ];
  4692. var result = original.apply(this, args);
  4693. var ob = this.__ob__;
  4694. var inserted;
  4695. switch (method) {
  4696. case 'push':
  4697. case 'unshift':
  4698. inserted = args;
  4699. break
  4700. case 'splice':
  4701. inserted = args.slice(2);
  4702. break
  4703. }
  4704. if (inserted) { ob.observeArray(inserted); }
  4705. // notify change
  4706. ob.dep.notify();
  4707. return result
  4708. });
  4709. });
  4710. /* */
  4711. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  4712. /**
  4713. * In some cases we may want to disable observation inside a component's
  4714. * update computation.
  4715. */
  4716. var shouldObserve = true;
  4717. function toggleObserving (value) {
  4718. shouldObserve = value;
  4719. }
  4720. /**
  4721. * Observer class that is attached to each observed
  4722. * object. Once attached, the observer converts the target
  4723. * object's property keys into getter/setters that
  4724. * collect dependencies and dispatch updates.
  4725. */
  4726. var Observer = function Observer (value) {
  4727. this.value = value;
  4728. this.dep = new Dep();
  4729. this.vmCount = 0;
  4730. def(value, '__ob__', this);
  4731. if (Array.isArray(value)) {
  4732. if (hasProto) {
  4733. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  4734. if(value.push !== value.__proto__.push){
  4735. copyAugment(value, arrayMethods, arrayKeys);
  4736. } else {
  4737. protoAugment(value, arrayMethods);
  4738. }
  4739. }
  4740. } else {
  4741. copyAugment(value, arrayMethods, arrayKeys);
  4742. }
  4743. this.observeArray(value);
  4744. } else {
  4745. this.walk(value);
  4746. }
  4747. };
  4748. /**
  4749. * Walk through all properties and convert them into
  4750. * getter/setters. This method should only be called when
  4751. * value type is Object.
  4752. */
  4753. Observer.prototype.walk = function walk (obj) {
  4754. var keys = Object.keys(obj);
  4755. for (var i = 0; i < keys.length; i++) {
  4756. defineReactive$$1(obj, keys[i]);
  4757. }
  4758. };
  4759. /**
  4760. * Observe a list of Array items.
  4761. */
  4762. Observer.prototype.observeArray = function observeArray (items) {
  4763. for (var i = 0, l = items.length; i < l; i++) {
  4764. observe(items[i]);
  4765. }
  4766. };
  4767. // helpers
  4768. /**
  4769. * Augment a target Object or Array by intercepting
  4770. * the prototype chain using __proto__
  4771. */
  4772. function protoAugment (target, src) {
  4773. /* eslint-disable no-proto */
  4774. target.__proto__ = src;
  4775. /* eslint-enable no-proto */
  4776. }
  4777. /**
  4778. * Augment a target Object or Array by defining
  4779. * hidden properties.
  4780. */
  4781. /* istanbul ignore next */
  4782. function copyAugment (target, src, keys) {
  4783. for (var i = 0, l = keys.length; i < l; i++) {
  4784. var key = keys[i];
  4785. def(target, key, src[key]);
  4786. }
  4787. }
  4788. /**
  4789. * Attempt to create an observer instance for a value,
  4790. * returns the new observer if successfully observed,
  4791. * or the existing observer if the value already has one.
  4792. */
  4793. function observe (value, asRootData) {
  4794. if (!isObject(value) || value instanceof VNode) {
  4795. return
  4796. }
  4797. var ob;
  4798. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  4799. ob = value.__ob__;
  4800. } else if (
  4801. shouldObserve &&
  4802. !isServerRendering() &&
  4803. (Array.isArray(value) || isPlainObject(value)) &&
  4804. Object.isExtensible(value) &&
  4805. !value._isVue
  4806. ) {
  4807. ob = new Observer(value);
  4808. }
  4809. if (asRootData && ob) {
  4810. ob.vmCount++;
  4811. }
  4812. return ob
  4813. }
  4814. /**
  4815. * Define a reactive property on an Object.
  4816. */
  4817. function defineReactive$$1 (
  4818. obj,
  4819. key,
  4820. val,
  4821. customSetter,
  4822. shallow
  4823. ) {
  4824. var dep = new Dep();
  4825. var property = Object.getOwnPropertyDescriptor(obj, key);
  4826. if (property && property.configurable === false) {
  4827. return
  4828. }
  4829. // cater for pre-defined getter/setters
  4830. var getter = property && property.get;
  4831. var setter = property && property.set;
  4832. if ((!getter || setter) && arguments.length === 2) {
  4833. val = obj[key];
  4834. }
  4835. var childOb = !shallow && observe(val);
  4836. Object.defineProperty(obj, key, {
  4837. enumerable: true,
  4838. configurable: true,
  4839. get: function reactiveGetter () {
  4840. var value = getter ? getter.call(obj) : val;
  4841. if (Dep.SharedObject.target) { // fixed by xxxxxx
  4842. dep.depend();
  4843. if (childOb) {
  4844. childOb.dep.depend();
  4845. if (Array.isArray(value)) {
  4846. dependArray(value);
  4847. }
  4848. }
  4849. }
  4850. return value
  4851. },
  4852. set: function reactiveSetter (newVal) {
  4853. var value = getter ? getter.call(obj) : val;
  4854. /* eslint-disable no-self-compare */
  4855. if (newVal === value || (newVal !== newVal && value !== value)) {
  4856. return
  4857. }
  4858. /* eslint-enable no-self-compare */
  4859. if ( true && customSetter) {
  4860. customSetter();
  4861. }
  4862. // #7981: for accessor properties without setter
  4863. if (getter && !setter) { return }
  4864. if (setter) {
  4865. setter.call(obj, newVal);
  4866. } else {
  4867. val = newVal;
  4868. }
  4869. childOb = !shallow && observe(newVal);
  4870. dep.notify();
  4871. }
  4872. });
  4873. }
  4874. /**
  4875. * Set a property on an object. Adds the new property and
  4876. * triggers change notification if the property doesn't
  4877. * already exist.
  4878. */
  4879. function set (target, key, val) {
  4880. if ( true &&
  4881. (isUndef(target) || isPrimitive(target))
  4882. ) {
  4883. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  4884. }
  4885. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4886. target.length = Math.max(target.length, key);
  4887. target.splice(key, 1, val);
  4888. return val
  4889. }
  4890. if (key in target && !(key in Object.prototype)) {
  4891. target[key] = val;
  4892. return val
  4893. }
  4894. var ob = (target).__ob__;
  4895. if (target._isVue || (ob && ob.vmCount)) {
  4896. true && warn(
  4897. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  4898. 'at runtime - declare it upfront in the data option.'
  4899. );
  4900. return val
  4901. }
  4902. if (!ob) {
  4903. target[key] = val;
  4904. return val
  4905. }
  4906. defineReactive$$1(ob.value, key, val);
  4907. ob.dep.notify();
  4908. return val
  4909. }
  4910. /**
  4911. * Delete a property and trigger change if necessary.
  4912. */
  4913. function del (target, key) {
  4914. if ( true &&
  4915. (isUndef(target) || isPrimitive(target))
  4916. ) {
  4917. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  4918. }
  4919. if (Array.isArray(target) && isValidArrayIndex(key)) {
  4920. target.splice(key, 1);
  4921. return
  4922. }
  4923. var ob = (target).__ob__;
  4924. if (target._isVue || (ob && ob.vmCount)) {
  4925. true && warn(
  4926. 'Avoid deleting properties on a Vue instance or its root $data ' +
  4927. '- just set it to null.'
  4928. );
  4929. return
  4930. }
  4931. if (!hasOwn(target, key)) {
  4932. return
  4933. }
  4934. delete target[key];
  4935. if (!ob) {
  4936. return
  4937. }
  4938. ob.dep.notify();
  4939. }
  4940. /**
  4941. * Collect dependencies on array elements when the array is touched, since
  4942. * we cannot intercept array element access like property getters.
  4943. */
  4944. function dependArray (value) {
  4945. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  4946. e = value[i];
  4947. e && e.__ob__ && e.__ob__.dep.depend();
  4948. if (Array.isArray(e)) {
  4949. dependArray(e);
  4950. }
  4951. }
  4952. }
  4953. /* */
  4954. /**
  4955. * Option overwriting strategies are functions that handle
  4956. * how to merge a parent option value and a child option
  4957. * value into the final value.
  4958. */
  4959. var strats = config.optionMergeStrategies;
  4960. /**
  4961. * Options with restrictions
  4962. */
  4963. if (true) {
  4964. strats.el = strats.propsData = function (parent, child, vm, key) {
  4965. if (!vm) {
  4966. warn(
  4967. "option \"" + key + "\" can only be used during instance " +
  4968. 'creation with the `new` keyword.'
  4969. );
  4970. }
  4971. return defaultStrat(parent, child)
  4972. };
  4973. }
  4974. /**
  4975. * Helper that recursively merges two data objects together.
  4976. */
  4977. function mergeData (to, from) {
  4978. if (!from) { return to }
  4979. var key, toVal, fromVal;
  4980. var keys = hasSymbol
  4981. ? Reflect.ownKeys(from)
  4982. : Object.keys(from);
  4983. for (var i = 0; i < keys.length; i++) {
  4984. key = keys[i];
  4985. // in case the object is already observed...
  4986. if (key === '__ob__') { continue }
  4987. toVal = to[key];
  4988. fromVal = from[key];
  4989. if (!hasOwn(to, key)) {
  4990. set(to, key, fromVal);
  4991. } else if (
  4992. toVal !== fromVal &&
  4993. isPlainObject(toVal) &&
  4994. isPlainObject(fromVal)
  4995. ) {
  4996. mergeData(toVal, fromVal);
  4997. }
  4998. }
  4999. return to
  5000. }
  5001. /**
  5002. * Data
  5003. */
  5004. function mergeDataOrFn (
  5005. parentVal,
  5006. childVal,
  5007. vm
  5008. ) {
  5009. if (!vm) {
  5010. // in a Vue.extend merge, both should be functions
  5011. if (!childVal) {
  5012. return parentVal
  5013. }
  5014. if (!parentVal) {
  5015. return childVal
  5016. }
  5017. // when parentVal & childVal are both present,
  5018. // we need to return a function that returns the
  5019. // merged result of both functions... no need to
  5020. // check if parentVal is a function here because
  5021. // it has to be a function to pass previous merges.
  5022. return function mergedDataFn () {
  5023. return mergeData(
  5024. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  5025. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  5026. )
  5027. }
  5028. } else {
  5029. return function mergedInstanceDataFn () {
  5030. // instance merge
  5031. var instanceData = typeof childVal === 'function'
  5032. ? childVal.call(vm, vm)
  5033. : childVal;
  5034. var defaultData = typeof parentVal === 'function'
  5035. ? parentVal.call(vm, vm)
  5036. : parentVal;
  5037. if (instanceData) {
  5038. return mergeData(instanceData, defaultData)
  5039. } else {
  5040. return defaultData
  5041. }
  5042. }
  5043. }
  5044. }
  5045. strats.data = function (
  5046. parentVal,
  5047. childVal,
  5048. vm
  5049. ) {
  5050. if (!vm) {
  5051. if (childVal && typeof childVal !== 'function') {
  5052. true && warn(
  5053. 'The "data" option should be a function ' +
  5054. 'that returns a per-instance value in component ' +
  5055. 'definitions.',
  5056. vm
  5057. );
  5058. return parentVal
  5059. }
  5060. return mergeDataOrFn(parentVal, childVal)
  5061. }
  5062. return mergeDataOrFn(parentVal, childVal, vm)
  5063. };
  5064. /**
  5065. * Hooks and props are merged as arrays.
  5066. */
  5067. function mergeHook (
  5068. parentVal,
  5069. childVal
  5070. ) {
  5071. var res = childVal
  5072. ? parentVal
  5073. ? parentVal.concat(childVal)
  5074. : Array.isArray(childVal)
  5075. ? childVal
  5076. : [childVal]
  5077. : parentVal;
  5078. return res
  5079. ? dedupeHooks(res)
  5080. : res
  5081. }
  5082. function dedupeHooks (hooks) {
  5083. var res = [];
  5084. for (var i = 0; i < hooks.length; i++) {
  5085. if (res.indexOf(hooks[i]) === -1) {
  5086. res.push(hooks[i]);
  5087. }
  5088. }
  5089. return res
  5090. }
  5091. LIFECYCLE_HOOKS.forEach(function (hook) {
  5092. strats[hook] = mergeHook;
  5093. });
  5094. /**
  5095. * Assets
  5096. *
  5097. * When a vm is present (instance creation), we need to do
  5098. * a three-way merge between constructor options, instance
  5099. * options and parent options.
  5100. */
  5101. function mergeAssets (
  5102. parentVal,
  5103. childVal,
  5104. vm,
  5105. key
  5106. ) {
  5107. var res = Object.create(parentVal || null);
  5108. if (childVal) {
  5109. true && assertObjectType(key, childVal, vm);
  5110. return extend(res, childVal)
  5111. } else {
  5112. return res
  5113. }
  5114. }
  5115. ASSET_TYPES.forEach(function (type) {
  5116. strats[type + 's'] = mergeAssets;
  5117. });
  5118. /**
  5119. * Watchers.
  5120. *
  5121. * Watchers hashes should not overwrite one
  5122. * another, so we merge them as arrays.
  5123. */
  5124. strats.watch = function (
  5125. parentVal,
  5126. childVal,
  5127. vm,
  5128. key
  5129. ) {
  5130. // work around Firefox's Object.prototype.watch...
  5131. if (parentVal === nativeWatch) { parentVal = undefined; }
  5132. if (childVal === nativeWatch) { childVal = undefined; }
  5133. /* istanbul ignore if */
  5134. if (!childVal) { return Object.create(parentVal || null) }
  5135. if (true) {
  5136. assertObjectType(key, childVal, vm);
  5137. }
  5138. if (!parentVal) { return childVal }
  5139. var ret = {};
  5140. extend(ret, parentVal);
  5141. for (var key$1 in childVal) {
  5142. var parent = ret[key$1];
  5143. var child = childVal[key$1];
  5144. if (parent && !Array.isArray(parent)) {
  5145. parent = [parent];
  5146. }
  5147. ret[key$1] = parent
  5148. ? parent.concat(child)
  5149. : Array.isArray(child) ? child : [child];
  5150. }
  5151. return ret
  5152. };
  5153. /**
  5154. * Other object hashes.
  5155. */
  5156. strats.props =
  5157. strats.methods =
  5158. strats.inject =
  5159. strats.computed = function (
  5160. parentVal,
  5161. childVal,
  5162. vm,
  5163. key
  5164. ) {
  5165. if (childVal && "development" !== 'production') {
  5166. assertObjectType(key, childVal, vm);
  5167. }
  5168. if (!parentVal) { return childVal }
  5169. var ret = Object.create(null);
  5170. extend(ret, parentVal);
  5171. if (childVal) { extend(ret, childVal); }
  5172. return ret
  5173. };
  5174. strats.provide = mergeDataOrFn;
  5175. /**
  5176. * Default strategy.
  5177. */
  5178. var defaultStrat = function (parentVal, childVal) {
  5179. return childVal === undefined
  5180. ? parentVal
  5181. : childVal
  5182. };
  5183. /**
  5184. * Validate component names
  5185. */
  5186. function checkComponents (options) {
  5187. for (var key in options.components) {
  5188. validateComponentName(key);
  5189. }
  5190. }
  5191. function validateComponentName (name) {
  5192. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  5193. warn(
  5194. 'Invalid component name: "' + name + '". Component names ' +
  5195. 'should conform to valid custom element name in html5 specification.'
  5196. );
  5197. }
  5198. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  5199. warn(
  5200. 'Do not use built-in or reserved HTML elements as component ' +
  5201. 'id: ' + name
  5202. );
  5203. }
  5204. }
  5205. /**
  5206. * Ensure all props option syntax are normalized into the
  5207. * Object-based format.
  5208. */
  5209. function normalizeProps (options, vm) {
  5210. var props = options.props;
  5211. if (!props) { return }
  5212. var res = {};
  5213. var i, val, name;
  5214. if (Array.isArray(props)) {
  5215. i = props.length;
  5216. while (i--) {
  5217. val = props[i];
  5218. if (typeof val === 'string') {
  5219. name = camelize(val);
  5220. res[name] = { type: null };
  5221. } else if (true) {
  5222. warn('props must be strings when using array syntax.');
  5223. }
  5224. }
  5225. } else if (isPlainObject(props)) {
  5226. for (var key in props) {
  5227. val = props[key];
  5228. name = camelize(key);
  5229. res[name] = isPlainObject(val)
  5230. ? val
  5231. : { type: val };
  5232. }
  5233. } else if (true) {
  5234. warn(
  5235. "Invalid value for option \"props\": expected an Array or an Object, " +
  5236. "but got " + (toRawType(props)) + ".",
  5237. vm
  5238. );
  5239. }
  5240. options.props = res;
  5241. }
  5242. /**
  5243. * Normalize all injections into Object-based format
  5244. */
  5245. function normalizeInject (options, vm) {
  5246. var inject = options.inject;
  5247. if (!inject) { return }
  5248. var normalized = options.inject = {};
  5249. if (Array.isArray(inject)) {
  5250. for (var i = 0; i < inject.length; i++) {
  5251. normalized[inject[i]] = { from: inject[i] };
  5252. }
  5253. } else if (isPlainObject(inject)) {
  5254. for (var key in inject) {
  5255. var val = inject[key];
  5256. normalized[key] = isPlainObject(val)
  5257. ? extend({ from: key }, val)
  5258. : { from: val };
  5259. }
  5260. } else if (true) {
  5261. warn(
  5262. "Invalid value for option \"inject\": expected an Array or an Object, " +
  5263. "but got " + (toRawType(inject)) + ".",
  5264. vm
  5265. );
  5266. }
  5267. }
  5268. /**
  5269. * Normalize raw function directives into object format.
  5270. */
  5271. function normalizeDirectives (options) {
  5272. var dirs = options.directives;
  5273. if (dirs) {
  5274. for (var key in dirs) {
  5275. var def$$1 = dirs[key];
  5276. if (typeof def$$1 === 'function') {
  5277. dirs[key] = { bind: def$$1, update: def$$1 };
  5278. }
  5279. }
  5280. }
  5281. }
  5282. function assertObjectType (name, value, vm) {
  5283. if (!isPlainObject(value)) {
  5284. warn(
  5285. "Invalid value for option \"" + name + "\": expected an Object, " +
  5286. "but got " + (toRawType(value)) + ".",
  5287. vm
  5288. );
  5289. }
  5290. }
  5291. /**
  5292. * Merge two option objects into a new one.
  5293. * Core utility used in both instantiation and inheritance.
  5294. */
  5295. function mergeOptions (
  5296. parent,
  5297. child,
  5298. vm
  5299. ) {
  5300. if (true) {
  5301. checkComponents(child);
  5302. }
  5303. if (typeof child === 'function') {
  5304. child = child.options;
  5305. }
  5306. normalizeProps(child, vm);
  5307. normalizeInject(child, vm);
  5308. normalizeDirectives(child);
  5309. // Apply extends and mixins on the child options,
  5310. // but only if it is a raw options object that isn't
  5311. // the result of another mergeOptions call.
  5312. // Only merged options has the _base property.
  5313. if (!child._base) {
  5314. if (child.extends) {
  5315. parent = mergeOptions(parent, child.extends, vm);
  5316. }
  5317. if (child.mixins) {
  5318. for (var i = 0, l = child.mixins.length; i < l; i++) {
  5319. parent = mergeOptions(parent, child.mixins[i], vm);
  5320. }
  5321. }
  5322. }
  5323. var options = {};
  5324. var key;
  5325. for (key in parent) {
  5326. mergeField(key);
  5327. }
  5328. for (key in child) {
  5329. if (!hasOwn(parent, key)) {
  5330. mergeField(key);
  5331. }
  5332. }
  5333. function mergeField (key) {
  5334. var strat = strats[key] || defaultStrat;
  5335. options[key] = strat(parent[key], child[key], vm, key);
  5336. }
  5337. return options
  5338. }
  5339. /**
  5340. * Resolve an asset.
  5341. * This function is used because child instances need access
  5342. * to assets defined in its ancestor chain.
  5343. */
  5344. function resolveAsset (
  5345. options,
  5346. type,
  5347. id,
  5348. warnMissing
  5349. ) {
  5350. /* istanbul ignore if */
  5351. if (typeof id !== 'string') {
  5352. return
  5353. }
  5354. var assets = options[type];
  5355. // check local registration variations first
  5356. if (hasOwn(assets, id)) { return assets[id] }
  5357. var camelizedId = camelize(id);
  5358. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  5359. var PascalCaseId = capitalize(camelizedId);
  5360. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  5361. // fallback to prototype chain
  5362. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  5363. if ( true && warnMissing && !res) {
  5364. warn(
  5365. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  5366. options
  5367. );
  5368. }
  5369. return res
  5370. }
  5371. /* */
  5372. function validateProp (
  5373. key,
  5374. propOptions,
  5375. propsData,
  5376. vm
  5377. ) {
  5378. var prop = propOptions[key];
  5379. var absent = !hasOwn(propsData, key);
  5380. var value = propsData[key];
  5381. // boolean casting
  5382. var booleanIndex = getTypeIndex(Boolean, prop.type);
  5383. if (booleanIndex > -1) {
  5384. if (absent && !hasOwn(prop, 'default')) {
  5385. value = false;
  5386. } else if (value === '' || value === hyphenate(key)) {
  5387. // only cast empty string / same name to boolean if
  5388. // boolean has higher priority
  5389. var stringIndex = getTypeIndex(String, prop.type);
  5390. if (stringIndex < 0 || booleanIndex < stringIndex) {
  5391. value = true;
  5392. }
  5393. }
  5394. }
  5395. // check default value
  5396. if (value === undefined) {
  5397. value = getPropDefaultValue(vm, prop, key);
  5398. // since the default value is a fresh copy,
  5399. // make sure to observe it.
  5400. var prevShouldObserve = shouldObserve;
  5401. toggleObserving(true);
  5402. observe(value);
  5403. toggleObserving(prevShouldObserve);
  5404. }
  5405. if (
  5406. true
  5407. ) {
  5408. assertProp(prop, key, value, vm, absent);
  5409. }
  5410. return value
  5411. }
  5412. /**
  5413. * Get the default value of a prop.
  5414. */
  5415. function getPropDefaultValue (vm, prop, key) {
  5416. // no default, return undefined
  5417. if (!hasOwn(prop, 'default')) {
  5418. return undefined
  5419. }
  5420. var def = prop.default;
  5421. // warn against non-factory defaults for Object & Array
  5422. if ( true && isObject(def)) {
  5423. warn(
  5424. 'Invalid default value for prop "' + key + '": ' +
  5425. 'Props with type Object/Array must use a factory function ' +
  5426. 'to return the default value.',
  5427. vm
  5428. );
  5429. }
  5430. // the raw prop value was also undefined from previous render,
  5431. // return previous default value to avoid unnecessary watcher trigger
  5432. if (vm && vm.$options.propsData &&
  5433. vm.$options.propsData[key] === undefined &&
  5434. vm._props[key] !== undefined
  5435. ) {
  5436. return vm._props[key]
  5437. }
  5438. // call factory function for non-Function types
  5439. // a value is Function if its prototype is function even across different execution context
  5440. return typeof def === 'function' && getType(prop.type) !== 'Function'
  5441. ? def.call(vm)
  5442. : def
  5443. }
  5444. /**
  5445. * Assert whether a prop is valid.
  5446. */
  5447. function assertProp (
  5448. prop,
  5449. name,
  5450. value,
  5451. vm,
  5452. absent
  5453. ) {
  5454. if (prop.required && absent) {
  5455. warn(
  5456. 'Missing required prop: "' + name + '"',
  5457. vm
  5458. );
  5459. return
  5460. }
  5461. if (value == null && !prop.required) {
  5462. return
  5463. }
  5464. var type = prop.type;
  5465. var valid = !type || type === true;
  5466. var expectedTypes = [];
  5467. if (type) {
  5468. if (!Array.isArray(type)) {
  5469. type = [type];
  5470. }
  5471. for (var i = 0; i < type.length && !valid; i++) {
  5472. var assertedType = assertType(value, type[i]);
  5473. expectedTypes.push(assertedType.expectedType || '');
  5474. valid = assertedType.valid;
  5475. }
  5476. }
  5477. if (!valid) {
  5478. warn(
  5479. getInvalidTypeMessage(name, value, expectedTypes),
  5480. vm
  5481. );
  5482. return
  5483. }
  5484. var validator = prop.validator;
  5485. if (validator) {
  5486. if (!validator(value)) {
  5487. warn(
  5488. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  5489. vm
  5490. );
  5491. }
  5492. }
  5493. }
  5494. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  5495. function assertType (value, type) {
  5496. var valid;
  5497. var expectedType = getType(type);
  5498. if (simpleCheckRE.test(expectedType)) {
  5499. var t = typeof value;
  5500. valid = t === expectedType.toLowerCase();
  5501. // for primitive wrapper objects
  5502. if (!valid && t === 'object') {
  5503. valid = value instanceof type;
  5504. }
  5505. } else if (expectedType === 'Object') {
  5506. valid = isPlainObject(value);
  5507. } else if (expectedType === 'Array') {
  5508. valid = Array.isArray(value);
  5509. } else {
  5510. valid = value instanceof type;
  5511. }
  5512. return {
  5513. valid: valid,
  5514. expectedType: expectedType
  5515. }
  5516. }
  5517. /**
  5518. * Use function string name to check built-in types,
  5519. * because a simple equality check will fail when running
  5520. * across different vms / iframes.
  5521. */
  5522. function getType (fn) {
  5523. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  5524. return match ? match[1] : ''
  5525. }
  5526. function isSameType (a, b) {
  5527. return getType(a) === getType(b)
  5528. }
  5529. function getTypeIndex (type, expectedTypes) {
  5530. if (!Array.isArray(expectedTypes)) {
  5531. return isSameType(expectedTypes, type) ? 0 : -1
  5532. }
  5533. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  5534. if (isSameType(expectedTypes[i], type)) {
  5535. return i
  5536. }
  5537. }
  5538. return -1
  5539. }
  5540. function getInvalidTypeMessage (name, value, expectedTypes) {
  5541. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  5542. " Expected " + (expectedTypes.map(capitalize).join(', '));
  5543. var expectedType = expectedTypes[0];
  5544. var receivedType = toRawType(value);
  5545. var expectedValue = styleValue(value, expectedType);
  5546. var receivedValue = styleValue(value, receivedType);
  5547. // check if we need to specify expected value
  5548. if (expectedTypes.length === 1 &&
  5549. isExplicable(expectedType) &&
  5550. !isBoolean(expectedType, receivedType)) {
  5551. message += " with value " + expectedValue;
  5552. }
  5553. message += ", got " + receivedType + " ";
  5554. // check if we need to specify received value
  5555. if (isExplicable(receivedType)) {
  5556. message += "with value " + receivedValue + ".";
  5557. }
  5558. return message
  5559. }
  5560. function styleValue (value, type) {
  5561. if (type === 'String') {
  5562. return ("\"" + value + "\"")
  5563. } else if (type === 'Number') {
  5564. return ("" + (Number(value)))
  5565. } else {
  5566. return ("" + value)
  5567. }
  5568. }
  5569. function isExplicable (value) {
  5570. var explicitTypes = ['string', 'number', 'boolean'];
  5571. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  5572. }
  5573. function isBoolean () {
  5574. var args = [], len = arguments.length;
  5575. while ( len-- ) args[ len ] = arguments[ len ];
  5576. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  5577. }
  5578. /* */
  5579. function handleError (err, vm, info) {
  5580. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  5581. // See: https://github.com/vuejs/vuex/issues/1505
  5582. pushTarget();
  5583. try {
  5584. if (vm) {
  5585. var cur = vm;
  5586. while ((cur = cur.$parent)) {
  5587. var hooks = cur.$options.errorCaptured;
  5588. if (hooks) {
  5589. for (var i = 0; i < hooks.length; i++) {
  5590. try {
  5591. var capture = hooks[i].call(cur, err, vm, info) === false;
  5592. if (capture) { return }
  5593. } catch (e) {
  5594. globalHandleError(e, cur, 'errorCaptured hook');
  5595. }
  5596. }
  5597. }
  5598. }
  5599. }
  5600. globalHandleError(err, vm, info);
  5601. } finally {
  5602. popTarget();
  5603. }
  5604. }
  5605. function invokeWithErrorHandling (
  5606. handler,
  5607. context,
  5608. args,
  5609. vm,
  5610. info
  5611. ) {
  5612. var res;
  5613. try {
  5614. res = args ? handler.apply(context, args) : handler.call(context);
  5615. if (res && !res._isVue && isPromise(res) && !res._handled) {
  5616. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  5617. // issue #9511
  5618. // avoid catch triggering multiple times when nested calls
  5619. res._handled = true;
  5620. }
  5621. } catch (e) {
  5622. handleError(e, vm, info);
  5623. }
  5624. return res
  5625. }
  5626. function globalHandleError (err, vm, info) {
  5627. if (config.errorHandler) {
  5628. try {
  5629. return config.errorHandler.call(null, err, vm, info)
  5630. } catch (e) {
  5631. // if the user intentionally throws the original error in the handler,
  5632. // do not log it twice
  5633. if (e !== err) {
  5634. logError(e, null, 'config.errorHandler');
  5635. }
  5636. }
  5637. }
  5638. logError(err, vm, info);
  5639. }
  5640. function logError (err, vm, info) {
  5641. if (true) {
  5642. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  5643. }
  5644. /* istanbul ignore else */
  5645. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  5646. console.error(err);
  5647. } else {
  5648. throw err
  5649. }
  5650. }
  5651. /* */
  5652. var callbacks = [];
  5653. var pending = false;
  5654. function flushCallbacks () {
  5655. pending = false;
  5656. var copies = callbacks.slice(0);
  5657. callbacks.length = 0;
  5658. for (var i = 0; i < copies.length; i++) {
  5659. copies[i]();
  5660. }
  5661. }
  5662. // Here we have async deferring wrappers using microtasks.
  5663. // In 2.5 we used (macro) tasks (in combination with microtasks).
  5664. // However, it has subtle problems when state is changed right before repaint
  5665. // (e.g. #6813, out-in transitions).
  5666. // Also, using (macro) tasks in event handler would cause some weird behaviors
  5667. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  5668. // So we now use microtasks everywhere, again.
  5669. // A major drawback of this tradeoff is that there are some scenarios
  5670. // where microtasks have too high a priority and fire in between supposedly
  5671. // sequential events (e.g. #4521, #6690, which have workarounds)
  5672. // or even between bubbling of the same event (#6566).
  5673. var timerFunc;
  5674. // The nextTick behavior leverages the microtask queue, which can be accessed
  5675. // via either native Promise.then or MutationObserver.
  5676. // MutationObserver has wider support, however it is seriously bugged in
  5677. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  5678. // completely stops working after triggering a few times... so, if native
  5679. // Promise is available, we will use it:
  5680. /* istanbul ignore next, $flow-disable-line */
  5681. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  5682. var p = Promise.resolve();
  5683. timerFunc = function () {
  5684. p.then(flushCallbacks);
  5685. // In problematic UIWebViews, Promise.then doesn't completely break, but
  5686. // it can get stuck in a weird state where callbacks are pushed into the
  5687. // microtask queue but the queue isn't being flushed, until the browser
  5688. // needs to do some other work, e.g. handle a timer. Therefore we can
  5689. // "force" the microtask queue to be flushed by adding an empty timer.
  5690. if (isIOS) { setTimeout(noop); }
  5691. };
  5692. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  5693. isNative(MutationObserver) ||
  5694. // PhantomJS and iOS 7.x
  5695. MutationObserver.toString() === '[object MutationObserverConstructor]'
  5696. )) {
  5697. // Use MutationObserver where native Promise is not available,
  5698. // e.g. PhantomJS, iOS7, Android 4.4
  5699. // (#6466 MutationObserver is unreliable in IE11)
  5700. var counter = 1;
  5701. var observer = new MutationObserver(flushCallbacks);
  5702. var textNode = document.createTextNode(String(counter));
  5703. observer.observe(textNode, {
  5704. characterData: true
  5705. });
  5706. timerFunc = function () {
  5707. counter = (counter + 1) % 2;
  5708. textNode.data = String(counter);
  5709. };
  5710. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  5711. // Fallback to setImmediate.
  5712. // Technically it leverages the (macro) task queue,
  5713. // but it is still a better choice than setTimeout.
  5714. timerFunc = function () {
  5715. setImmediate(flushCallbacks);
  5716. };
  5717. } else {
  5718. // Fallback to setTimeout.
  5719. timerFunc = function () {
  5720. setTimeout(flushCallbacks, 0);
  5721. };
  5722. }
  5723. function nextTick (cb, ctx) {
  5724. var _resolve;
  5725. callbacks.push(function () {
  5726. if (cb) {
  5727. try {
  5728. cb.call(ctx);
  5729. } catch (e) {
  5730. handleError(e, ctx, 'nextTick');
  5731. }
  5732. } else if (_resolve) {
  5733. _resolve(ctx);
  5734. }
  5735. });
  5736. if (!pending) {
  5737. pending = true;
  5738. timerFunc();
  5739. }
  5740. // $flow-disable-line
  5741. if (!cb && typeof Promise !== 'undefined') {
  5742. return new Promise(function (resolve) {
  5743. _resolve = resolve;
  5744. })
  5745. }
  5746. }
  5747. /* */
  5748. /* not type checking this file because flow doesn't play well with Proxy */
  5749. var initProxy;
  5750. if (true) {
  5751. var allowedGlobals = makeMap(
  5752. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  5753. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  5754. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  5755. 'require' // for Webpack/Browserify
  5756. );
  5757. var warnNonPresent = function (target, key) {
  5758. warn(
  5759. "Property or method \"" + key + "\" is not defined on the instance but " +
  5760. 'referenced during render. Make sure that this property is reactive, ' +
  5761. 'either in the data option, or for class-based components, by ' +
  5762. 'initializing the property. ' +
  5763. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  5764. target
  5765. );
  5766. };
  5767. var warnReservedPrefix = function (target, key) {
  5768. warn(
  5769. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  5770. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  5771. 'prevent conflicts with Vue internals. ' +
  5772. 'See: https://vuejs.org/v2/api/#data',
  5773. target
  5774. );
  5775. };
  5776. var hasProxy =
  5777. typeof Proxy !== 'undefined' && isNative(Proxy);
  5778. if (hasProxy) {
  5779. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  5780. config.keyCodes = new Proxy(config.keyCodes, {
  5781. set: function set (target, key, value) {
  5782. if (isBuiltInModifier(key)) {
  5783. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  5784. return false
  5785. } else {
  5786. target[key] = value;
  5787. return true
  5788. }
  5789. }
  5790. });
  5791. }
  5792. var hasHandler = {
  5793. has: function has (target, key) {
  5794. var has = key in target;
  5795. var isAllowed = allowedGlobals(key) ||
  5796. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  5797. if (!has && !isAllowed) {
  5798. if (key in target.$data) { warnReservedPrefix(target, key); }
  5799. else { warnNonPresent(target, key); }
  5800. }
  5801. return has || !isAllowed
  5802. }
  5803. };
  5804. var getHandler = {
  5805. get: function get (target, key) {
  5806. if (typeof key === 'string' && !(key in target)) {
  5807. if (key in target.$data) { warnReservedPrefix(target, key); }
  5808. else { warnNonPresent(target, key); }
  5809. }
  5810. return target[key]
  5811. }
  5812. };
  5813. initProxy = function initProxy (vm) {
  5814. if (hasProxy) {
  5815. // determine which proxy handler to use
  5816. var options = vm.$options;
  5817. var handlers = options.render && options.render._withStripped
  5818. ? getHandler
  5819. : hasHandler;
  5820. vm._renderProxy = new Proxy(vm, handlers);
  5821. } else {
  5822. vm._renderProxy = vm;
  5823. }
  5824. };
  5825. }
  5826. /* */
  5827. var seenObjects = new _Set();
  5828. /**
  5829. * Recursively traverse an object to evoke all converted
  5830. * getters, so that every nested property inside the object
  5831. * is collected as a "deep" dependency.
  5832. */
  5833. function traverse (val) {
  5834. _traverse(val, seenObjects);
  5835. seenObjects.clear();
  5836. }
  5837. function _traverse (val, seen) {
  5838. var i, keys;
  5839. var isA = Array.isArray(val);
  5840. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  5841. return
  5842. }
  5843. if (val.__ob__) {
  5844. var depId = val.__ob__.dep.id;
  5845. if (seen.has(depId)) {
  5846. return
  5847. }
  5848. seen.add(depId);
  5849. }
  5850. if (isA) {
  5851. i = val.length;
  5852. while (i--) { _traverse(val[i], seen); }
  5853. } else {
  5854. keys = Object.keys(val);
  5855. i = keys.length;
  5856. while (i--) { _traverse(val[keys[i]], seen); }
  5857. }
  5858. }
  5859. var mark;
  5860. var measure;
  5861. if (true) {
  5862. var perf = inBrowser && window.performance;
  5863. /* istanbul ignore if */
  5864. if (
  5865. perf &&
  5866. perf.mark &&
  5867. perf.measure &&
  5868. perf.clearMarks &&
  5869. perf.clearMeasures
  5870. ) {
  5871. mark = function (tag) { return perf.mark(tag); };
  5872. measure = function (name, startTag, endTag) {
  5873. perf.measure(name, startTag, endTag);
  5874. perf.clearMarks(startTag);
  5875. perf.clearMarks(endTag);
  5876. // perf.clearMeasures(name)
  5877. };
  5878. }
  5879. }
  5880. /* */
  5881. var normalizeEvent = cached(function (name) {
  5882. var passive = name.charAt(0) === '&';
  5883. name = passive ? name.slice(1) : name;
  5884. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  5885. name = once$$1 ? name.slice(1) : name;
  5886. var capture = name.charAt(0) === '!';
  5887. name = capture ? name.slice(1) : name;
  5888. return {
  5889. name: name,
  5890. once: once$$1,
  5891. capture: capture,
  5892. passive: passive
  5893. }
  5894. });
  5895. function createFnInvoker (fns, vm) {
  5896. function invoker () {
  5897. var arguments$1 = arguments;
  5898. var fns = invoker.fns;
  5899. if (Array.isArray(fns)) {
  5900. var cloned = fns.slice();
  5901. for (var i = 0; i < cloned.length; i++) {
  5902. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  5903. }
  5904. } else {
  5905. // return handler return value for single handlers
  5906. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  5907. }
  5908. }
  5909. invoker.fns = fns;
  5910. return invoker
  5911. }
  5912. function updateListeners (
  5913. on,
  5914. oldOn,
  5915. add,
  5916. remove$$1,
  5917. createOnceHandler,
  5918. vm
  5919. ) {
  5920. var name, def$$1, cur, old, event;
  5921. for (name in on) {
  5922. def$$1 = cur = on[name];
  5923. old = oldOn[name];
  5924. event = normalizeEvent(name);
  5925. if (isUndef(cur)) {
  5926. true && warn(
  5927. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  5928. vm
  5929. );
  5930. } else if (isUndef(old)) {
  5931. if (isUndef(cur.fns)) {
  5932. cur = on[name] = createFnInvoker(cur, vm);
  5933. }
  5934. if (isTrue(event.once)) {
  5935. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  5936. }
  5937. add(event.name, cur, event.capture, event.passive, event.params);
  5938. } else if (cur !== old) {
  5939. old.fns = cur;
  5940. on[name] = old;
  5941. }
  5942. }
  5943. for (name in oldOn) {
  5944. if (isUndef(on[name])) {
  5945. event = normalizeEvent(name);
  5946. remove$$1(event.name, oldOn[name], event.capture);
  5947. }
  5948. }
  5949. }
  5950. /* */
  5951. /* */
  5952. // fixed by xxxxxx (mp properties)
  5953. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  5954. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  5955. if (isUndef(propOptions)) {
  5956. return res
  5957. }
  5958. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  5959. var attrs = data.attrs;
  5960. var props = data.props;
  5961. if (isDef(attrs) || isDef(props)) {
  5962. for (var key in propOptions) {
  5963. var altKey = hyphenate(key);
  5964. var result = checkProp(res, props, key, altKey, true) ||
  5965. checkProp(res, attrs, key, altKey, false);
  5966. // externalClass
  5967. if (
  5968. result &&
  5969. res[key] &&
  5970. externalClasses.indexOf(altKey) !== -1 &&
  5971. context[camelize(res[key])]
  5972. ) {
  5973. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  5974. res[key] = context[camelize(res[key])];
  5975. }
  5976. }
  5977. }
  5978. return res
  5979. }
  5980. function extractPropsFromVNodeData (
  5981. data,
  5982. Ctor,
  5983. tag,
  5984. context// fixed by xxxxxx
  5985. ) {
  5986. // we are only extracting raw values here.
  5987. // validation and default values are handled in the child
  5988. // component itself.
  5989. var propOptions = Ctor.options.props;
  5990. if (isUndef(propOptions)) {
  5991. // fixed by xxxxxx
  5992. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  5993. }
  5994. var res = {};
  5995. var attrs = data.attrs;
  5996. var props = data.props;
  5997. if (isDef(attrs) || isDef(props)) {
  5998. for (var key in propOptions) {
  5999. var altKey = hyphenate(key);
  6000. if (true) {
  6001. var keyInLowerCase = key.toLowerCase();
  6002. if (
  6003. key !== keyInLowerCase &&
  6004. attrs && hasOwn(attrs, keyInLowerCase)
  6005. ) {
  6006. tip(
  6007. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  6008. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  6009. " \"" + key + "\". " +
  6010. "Note that HTML attributes are case-insensitive and camelCased " +
  6011. "props need to use their kebab-case equivalents when using in-DOM " +
  6012. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  6013. );
  6014. }
  6015. }
  6016. checkProp(res, props, key, altKey, true) ||
  6017. checkProp(res, attrs, key, altKey, false);
  6018. }
  6019. }
  6020. // fixed by xxxxxx
  6021. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  6022. }
  6023. function checkProp (
  6024. res,
  6025. hash,
  6026. key,
  6027. altKey,
  6028. preserve
  6029. ) {
  6030. if (isDef(hash)) {
  6031. if (hasOwn(hash, key)) {
  6032. res[key] = hash[key];
  6033. if (!preserve) {
  6034. delete hash[key];
  6035. }
  6036. return true
  6037. } else if (hasOwn(hash, altKey)) {
  6038. res[key] = hash[altKey];
  6039. if (!preserve) {
  6040. delete hash[altKey];
  6041. }
  6042. return true
  6043. }
  6044. }
  6045. return false
  6046. }
  6047. /* */
  6048. // The template compiler attempts to minimize the need for normalization by
  6049. // statically analyzing the template at compile time.
  6050. //
  6051. // For plain HTML markup, normalization can be completely skipped because the
  6052. // generated render function is guaranteed to return Array<VNode>. There are
  6053. // two cases where extra normalization is needed:
  6054. // 1. When the children contains components - because a functional component
  6055. // may return an Array instead of a single root. In this case, just a simple
  6056. // normalization is needed - if any child is an Array, we flatten the whole
  6057. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  6058. // because functional components already normalize their own children.
  6059. function simpleNormalizeChildren (children) {
  6060. for (var i = 0; i < children.length; i++) {
  6061. if (Array.isArray(children[i])) {
  6062. return Array.prototype.concat.apply([], children)
  6063. }
  6064. }
  6065. return children
  6066. }
  6067. // 2. When the children contains constructs that always generated nested Arrays,
  6068. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  6069. // with hand-written render functions / JSX. In such cases a full normalization
  6070. // is needed to cater to all possible types of children values.
  6071. function normalizeChildren (children) {
  6072. return isPrimitive(children)
  6073. ? [createTextVNode(children)]
  6074. : Array.isArray(children)
  6075. ? normalizeArrayChildren(children)
  6076. : undefined
  6077. }
  6078. function isTextNode (node) {
  6079. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  6080. }
  6081. function normalizeArrayChildren (children, nestedIndex) {
  6082. var res = [];
  6083. var i, c, lastIndex, last;
  6084. for (i = 0; i < children.length; i++) {
  6085. c = children[i];
  6086. if (isUndef(c) || typeof c === 'boolean') { continue }
  6087. lastIndex = res.length - 1;
  6088. last = res[lastIndex];
  6089. // nested
  6090. if (Array.isArray(c)) {
  6091. if (c.length > 0) {
  6092. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  6093. // merge adjacent text nodes
  6094. if (isTextNode(c[0]) && isTextNode(last)) {
  6095. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  6096. c.shift();
  6097. }
  6098. res.push.apply(res, c);
  6099. }
  6100. } else if (isPrimitive(c)) {
  6101. if (isTextNode(last)) {
  6102. // merge adjacent text nodes
  6103. // this is necessary for SSR hydration because text nodes are
  6104. // essentially merged when rendered to HTML strings
  6105. res[lastIndex] = createTextVNode(last.text + c);
  6106. } else if (c !== '') {
  6107. // convert primitive to vnode
  6108. res.push(createTextVNode(c));
  6109. }
  6110. } else {
  6111. if (isTextNode(c) && isTextNode(last)) {
  6112. // merge adjacent text nodes
  6113. res[lastIndex] = createTextVNode(last.text + c.text);
  6114. } else {
  6115. // default key for nested array children (likely generated by v-for)
  6116. if (isTrue(children._isVList) &&
  6117. isDef(c.tag) &&
  6118. isUndef(c.key) &&
  6119. isDef(nestedIndex)) {
  6120. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  6121. }
  6122. res.push(c);
  6123. }
  6124. }
  6125. }
  6126. return res
  6127. }
  6128. /* */
  6129. function initProvide (vm) {
  6130. var provide = vm.$options.provide;
  6131. if (provide) {
  6132. vm._provided = typeof provide === 'function'
  6133. ? provide.call(vm)
  6134. : provide;
  6135. }
  6136. }
  6137. function initInjections (vm) {
  6138. var result = resolveInject(vm.$options.inject, vm);
  6139. if (result) {
  6140. toggleObserving(false);
  6141. Object.keys(result).forEach(function (key) {
  6142. /* istanbul ignore else */
  6143. if (true) {
  6144. defineReactive$$1(vm, key, result[key], function () {
  6145. warn(
  6146. "Avoid mutating an injected value directly since the changes will be " +
  6147. "overwritten whenever the provided component re-renders. " +
  6148. "injection being mutated: \"" + key + "\"",
  6149. vm
  6150. );
  6151. });
  6152. } else {}
  6153. });
  6154. toggleObserving(true);
  6155. }
  6156. }
  6157. function resolveInject (inject, vm) {
  6158. if (inject) {
  6159. // inject is :any because flow is not smart enough to figure out cached
  6160. var result = Object.create(null);
  6161. var keys = hasSymbol
  6162. ? Reflect.ownKeys(inject)
  6163. : Object.keys(inject);
  6164. for (var i = 0; i < keys.length; i++) {
  6165. var key = keys[i];
  6166. // #6574 in case the inject object is observed...
  6167. if (key === '__ob__') { continue }
  6168. var provideKey = inject[key].from;
  6169. var source = vm;
  6170. while (source) {
  6171. if (source._provided && hasOwn(source._provided, provideKey)) {
  6172. result[key] = source._provided[provideKey];
  6173. break
  6174. }
  6175. source = source.$parent;
  6176. }
  6177. if (!source) {
  6178. if ('default' in inject[key]) {
  6179. var provideDefault = inject[key].default;
  6180. result[key] = typeof provideDefault === 'function'
  6181. ? provideDefault.call(vm)
  6182. : provideDefault;
  6183. } else if (true) {
  6184. warn(("Injection \"" + key + "\" not found"), vm);
  6185. }
  6186. }
  6187. }
  6188. return result
  6189. }
  6190. }
  6191. /* */
  6192. /**
  6193. * Runtime helper for resolving raw children VNodes into a slot object.
  6194. */
  6195. function resolveSlots (
  6196. children,
  6197. context
  6198. ) {
  6199. if (!children || !children.length) {
  6200. return {}
  6201. }
  6202. var slots = {};
  6203. for (var i = 0, l = children.length; i < l; i++) {
  6204. var child = children[i];
  6205. var data = child.data;
  6206. // remove slot attribute if the node is resolved as a Vue slot node
  6207. if (data && data.attrs && data.attrs.slot) {
  6208. delete data.attrs.slot;
  6209. }
  6210. // named slots should only be respected if the vnode was rendered in the
  6211. // same context.
  6212. if ((child.context === context || child.fnContext === context) &&
  6213. data && data.slot != null
  6214. ) {
  6215. var name = data.slot;
  6216. var slot = (slots[name] || (slots[name] = []));
  6217. if (child.tag === 'template') {
  6218. slot.push.apply(slot, child.children || []);
  6219. } else {
  6220. slot.push(child);
  6221. }
  6222. } else {
  6223. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  6224. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  6225. (slots['page'] || (slots['page'] = [])).push(child);
  6226. }else{
  6227. (slots.default || (slots.default = [])).push(child);
  6228. }
  6229. }
  6230. }
  6231. // ignore slots that contains only whitespace
  6232. for (var name$1 in slots) {
  6233. if (slots[name$1].every(isWhitespace)) {
  6234. delete slots[name$1];
  6235. }
  6236. }
  6237. return slots
  6238. }
  6239. function isWhitespace (node) {
  6240. return (node.isComment && !node.asyncFactory) || node.text === ' '
  6241. }
  6242. /* */
  6243. function normalizeScopedSlots (
  6244. slots,
  6245. normalSlots,
  6246. prevSlots
  6247. ) {
  6248. var res;
  6249. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  6250. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  6251. var key = slots && slots.$key;
  6252. if (!slots) {
  6253. res = {};
  6254. } else if (slots._normalized) {
  6255. // fast path 1: child component re-render only, parent did not change
  6256. return slots._normalized
  6257. } else if (
  6258. isStable &&
  6259. prevSlots &&
  6260. prevSlots !== emptyObject &&
  6261. key === prevSlots.$key &&
  6262. !hasNormalSlots &&
  6263. !prevSlots.$hasNormal
  6264. ) {
  6265. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  6266. // only need to normalize once
  6267. return prevSlots
  6268. } else {
  6269. res = {};
  6270. for (var key$1 in slots) {
  6271. if (slots[key$1] && key$1[0] !== '$') {
  6272. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  6273. }
  6274. }
  6275. }
  6276. // expose normal slots on scopedSlots
  6277. for (var key$2 in normalSlots) {
  6278. if (!(key$2 in res)) {
  6279. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  6280. }
  6281. }
  6282. // avoriaz seems to mock a non-extensible $scopedSlots object
  6283. // and when that is passed down this would cause an error
  6284. if (slots && Object.isExtensible(slots)) {
  6285. (slots)._normalized = res;
  6286. }
  6287. def(res, '$stable', isStable);
  6288. def(res, '$key', key);
  6289. def(res, '$hasNormal', hasNormalSlots);
  6290. return res
  6291. }
  6292. function normalizeScopedSlot(normalSlots, key, fn) {
  6293. var normalized = function () {
  6294. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  6295. res = res && typeof res === 'object' && !Array.isArray(res)
  6296. ? [res] // single vnode
  6297. : normalizeChildren(res);
  6298. return res && (
  6299. res.length === 0 ||
  6300. (res.length === 1 && res[0].isComment) // #9658
  6301. ) ? undefined
  6302. : res
  6303. };
  6304. // this is a slot using the new v-slot syntax without scope. although it is
  6305. // compiled as a scoped slot, render fn users would expect it to be present
  6306. // on this.$slots because the usage is semantically a normal slot.
  6307. if (fn.proxy) {
  6308. Object.defineProperty(normalSlots, key, {
  6309. get: normalized,
  6310. enumerable: true,
  6311. configurable: true
  6312. });
  6313. }
  6314. return normalized
  6315. }
  6316. function proxyNormalSlot(slots, key) {
  6317. return function () { return slots[key]; }
  6318. }
  6319. /* */
  6320. /**
  6321. * Runtime helper for rendering v-for lists.
  6322. */
  6323. function renderList (
  6324. val,
  6325. render
  6326. ) {
  6327. var ret, i, l, keys, key;
  6328. if (Array.isArray(val) || typeof val === 'string') {
  6329. ret = new Array(val.length);
  6330. for (i = 0, l = val.length; i < l; i++) {
  6331. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  6332. }
  6333. } else if (typeof val === 'number') {
  6334. ret = new Array(val);
  6335. for (i = 0; i < val; i++) {
  6336. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  6337. }
  6338. } else if (isObject(val)) {
  6339. if (hasSymbol && val[Symbol.iterator]) {
  6340. ret = [];
  6341. var iterator = val[Symbol.iterator]();
  6342. var result = iterator.next();
  6343. while (!result.done) {
  6344. ret.push(render(result.value, ret.length, i++, i)); // fixed by xxxxxx
  6345. result = iterator.next();
  6346. }
  6347. } else {
  6348. keys = Object.keys(val);
  6349. ret = new Array(keys.length);
  6350. for (i = 0, l = keys.length; i < l; i++) {
  6351. key = keys[i];
  6352. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  6353. }
  6354. }
  6355. }
  6356. if (!isDef(ret)) {
  6357. ret = [];
  6358. }
  6359. (ret)._isVList = true;
  6360. return ret
  6361. }
  6362. /* */
  6363. /**
  6364. * Runtime helper for rendering <slot>
  6365. */
  6366. function renderSlot (
  6367. name,
  6368. fallback,
  6369. props,
  6370. bindObject
  6371. ) {
  6372. var scopedSlotFn = this.$scopedSlots[name];
  6373. var nodes;
  6374. if (scopedSlotFn) { // scoped slot
  6375. props = props || {};
  6376. if (bindObject) {
  6377. if ( true && !isObject(bindObject)) {
  6378. warn(
  6379. 'slot v-bind without argument expects an Object',
  6380. this
  6381. );
  6382. }
  6383. props = extend(extend({}, bindObject), props);
  6384. }
  6385. // fixed by xxxxxx app-plus scopedSlot
  6386. nodes = scopedSlotFn(props, this, props._i) || fallback;
  6387. } else {
  6388. nodes = this.$slots[name] || fallback;
  6389. }
  6390. var target = props && props.slot;
  6391. if (target) {
  6392. return this.$createElement('template', { slot: target }, nodes)
  6393. } else {
  6394. return nodes
  6395. }
  6396. }
  6397. /* */
  6398. /**
  6399. * Runtime helper for resolving filters
  6400. */
  6401. function resolveFilter (id) {
  6402. return resolveAsset(this.$options, 'filters', id, true) || identity
  6403. }
  6404. /* */
  6405. function isKeyNotMatch (expect, actual) {
  6406. if (Array.isArray(expect)) {
  6407. return expect.indexOf(actual) === -1
  6408. } else {
  6409. return expect !== actual
  6410. }
  6411. }
  6412. /**
  6413. * Runtime helper for checking keyCodes from config.
  6414. * exposed as Vue.prototype._k
  6415. * passing in eventKeyName as last argument separately for backwards compat
  6416. */
  6417. function checkKeyCodes (
  6418. eventKeyCode,
  6419. key,
  6420. builtInKeyCode,
  6421. eventKeyName,
  6422. builtInKeyName
  6423. ) {
  6424. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  6425. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  6426. return isKeyNotMatch(builtInKeyName, eventKeyName)
  6427. } else if (mappedKeyCode) {
  6428. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  6429. } else if (eventKeyName) {
  6430. return hyphenate(eventKeyName) !== key
  6431. }
  6432. }
  6433. /* */
  6434. /**
  6435. * Runtime helper for merging v-bind="object" into a VNode's data.
  6436. */
  6437. function bindObjectProps (
  6438. data,
  6439. tag,
  6440. value,
  6441. asProp,
  6442. isSync
  6443. ) {
  6444. if (value) {
  6445. if (!isObject(value)) {
  6446. true && warn(
  6447. 'v-bind without argument expects an Object or Array value',
  6448. this
  6449. );
  6450. } else {
  6451. if (Array.isArray(value)) {
  6452. value = toObject(value);
  6453. }
  6454. var hash;
  6455. var loop = function ( key ) {
  6456. if (
  6457. key === 'class' ||
  6458. key === 'style' ||
  6459. isReservedAttribute(key)
  6460. ) {
  6461. hash = data;
  6462. } else {
  6463. var type = data.attrs && data.attrs.type;
  6464. hash = asProp || config.mustUseProp(tag, type, key)
  6465. ? data.domProps || (data.domProps = {})
  6466. : data.attrs || (data.attrs = {});
  6467. }
  6468. var camelizedKey = camelize(key);
  6469. var hyphenatedKey = hyphenate(key);
  6470. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  6471. hash[key] = value[key];
  6472. if (isSync) {
  6473. var on = data.on || (data.on = {});
  6474. on[("update:" + key)] = function ($event) {
  6475. value[key] = $event;
  6476. };
  6477. }
  6478. }
  6479. };
  6480. for (var key in value) loop( key );
  6481. }
  6482. }
  6483. return data
  6484. }
  6485. /* */
  6486. /**
  6487. * Runtime helper for rendering static trees.
  6488. */
  6489. function renderStatic (
  6490. index,
  6491. isInFor
  6492. ) {
  6493. var cached = this._staticTrees || (this._staticTrees = []);
  6494. var tree = cached[index];
  6495. // if has already-rendered static tree and not inside v-for,
  6496. // we can reuse the same tree.
  6497. if (tree && !isInFor) {
  6498. return tree
  6499. }
  6500. // otherwise, render a fresh tree.
  6501. tree = cached[index] = this.$options.staticRenderFns[index].call(
  6502. this._renderProxy,
  6503. null,
  6504. this // for render fns generated for functional component templates
  6505. );
  6506. markStatic(tree, ("__static__" + index), false);
  6507. return tree
  6508. }
  6509. /**
  6510. * Runtime helper for v-once.
  6511. * Effectively it means marking the node as static with a unique key.
  6512. */
  6513. function markOnce (
  6514. tree,
  6515. index,
  6516. key
  6517. ) {
  6518. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  6519. return tree
  6520. }
  6521. function markStatic (
  6522. tree,
  6523. key,
  6524. isOnce
  6525. ) {
  6526. if (Array.isArray(tree)) {
  6527. for (var i = 0; i < tree.length; i++) {
  6528. if (tree[i] && typeof tree[i] !== 'string') {
  6529. markStaticNode(tree[i], (key + "_" + i), isOnce);
  6530. }
  6531. }
  6532. } else {
  6533. markStaticNode(tree, key, isOnce);
  6534. }
  6535. }
  6536. function markStaticNode (node, key, isOnce) {
  6537. node.isStatic = true;
  6538. node.key = key;
  6539. node.isOnce = isOnce;
  6540. }
  6541. /* */
  6542. function bindObjectListeners (data, value) {
  6543. if (value) {
  6544. if (!isPlainObject(value)) {
  6545. true && warn(
  6546. 'v-on without argument expects an Object value',
  6547. this
  6548. );
  6549. } else {
  6550. var on = data.on = data.on ? extend({}, data.on) : {};
  6551. for (var key in value) {
  6552. var existing = on[key];
  6553. var ours = value[key];
  6554. on[key] = existing ? [].concat(existing, ours) : ours;
  6555. }
  6556. }
  6557. }
  6558. return data
  6559. }
  6560. /* */
  6561. function resolveScopedSlots (
  6562. fns, // see flow/vnode
  6563. res,
  6564. // the following are added in 2.6
  6565. hasDynamicKeys,
  6566. contentHashKey
  6567. ) {
  6568. res = res || { $stable: !hasDynamicKeys };
  6569. for (var i = 0; i < fns.length; i++) {
  6570. var slot = fns[i];
  6571. if (Array.isArray(slot)) {
  6572. resolveScopedSlots(slot, res, hasDynamicKeys);
  6573. } else if (slot) {
  6574. // marker for reverse proxying v-slot without scope on this.$slots
  6575. if (slot.proxy) {
  6576. slot.fn.proxy = true;
  6577. }
  6578. res[slot.key] = slot.fn;
  6579. }
  6580. }
  6581. if (contentHashKey) {
  6582. (res).$key = contentHashKey;
  6583. }
  6584. return res
  6585. }
  6586. /* */
  6587. function bindDynamicKeys (baseObj, values) {
  6588. for (var i = 0; i < values.length; i += 2) {
  6589. var key = values[i];
  6590. if (typeof key === 'string' && key) {
  6591. baseObj[values[i]] = values[i + 1];
  6592. } else if ( true && key !== '' && key !== null) {
  6593. // null is a special value for explicitly removing a binding
  6594. warn(
  6595. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  6596. this
  6597. );
  6598. }
  6599. }
  6600. return baseObj
  6601. }
  6602. // helper to dynamically append modifier runtime markers to event names.
  6603. // ensure only append when value is already string, otherwise it will be cast
  6604. // to string and cause the type check to miss.
  6605. function prependModifier (value, symbol) {
  6606. return typeof value === 'string' ? symbol + value : value
  6607. }
  6608. /* */
  6609. function installRenderHelpers (target) {
  6610. target._o = markOnce;
  6611. target._n = toNumber;
  6612. target._s = toString;
  6613. target._l = renderList;
  6614. target._t = renderSlot;
  6615. target._q = looseEqual;
  6616. target._i = looseIndexOf;
  6617. target._m = renderStatic;
  6618. target._f = resolveFilter;
  6619. target._k = checkKeyCodes;
  6620. target._b = bindObjectProps;
  6621. target._v = createTextVNode;
  6622. target._e = createEmptyVNode;
  6623. target._u = resolveScopedSlots;
  6624. target._g = bindObjectListeners;
  6625. target._d = bindDynamicKeys;
  6626. target._p = prependModifier;
  6627. }
  6628. /* */
  6629. function FunctionalRenderContext (
  6630. data,
  6631. props,
  6632. children,
  6633. parent,
  6634. Ctor
  6635. ) {
  6636. var this$1 = this;
  6637. var options = Ctor.options;
  6638. // ensure the createElement function in functional components
  6639. // gets a unique context - this is necessary for correct named slot check
  6640. var contextVm;
  6641. if (hasOwn(parent, '_uid')) {
  6642. contextVm = Object.create(parent);
  6643. // $flow-disable-line
  6644. contextVm._original = parent;
  6645. } else {
  6646. // the context vm passed in is a functional context as well.
  6647. // in this case we want to make sure we are able to get a hold to the
  6648. // real context instance.
  6649. contextVm = parent;
  6650. // $flow-disable-line
  6651. parent = parent._original;
  6652. }
  6653. var isCompiled = isTrue(options._compiled);
  6654. var needNormalization = !isCompiled;
  6655. this.data = data;
  6656. this.props = props;
  6657. this.children = children;
  6658. this.parent = parent;
  6659. this.listeners = data.on || emptyObject;
  6660. this.injections = resolveInject(options.inject, parent);
  6661. this.slots = function () {
  6662. if (!this$1.$slots) {
  6663. normalizeScopedSlots(
  6664. data.scopedSlots,
  6665. this$1.$slots = resolveSlots(children, parent)
  6666. );
  6667. }
  6668. return this$1.$slots
  6669. };
  6670. Object.defineProperty(this, 'scopedSlots', ({
  6671. enumerable: true,
  6672. get: function get () {
  6673. return normalizeScopedSlots(data.scopedSlots, this.slots())
  6674. }
  6675. }));
  6676. // support for compiled functional template
  6677. if (isCompiled) {
  6678. // exposing $options for renderStatic()
  6679. this.$options = options;
  6680. // pre-resolve slots for renderSlot()
  6681. this.$slots = this.slots();
  6682. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  6683. }
  6684. if (options._scopeId) {
  6685. this._c = function (a, b, c, d) {
  6686. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  6687. if (vnode && !Array.isArray(vnode)) {
  6688. vnode.fnScopeId = options._scopeId;
  6689. vnode.fnContext = parent;
  6690. }
  6691. return vnode
  6692. };
  6693. } else {
  6694. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  6695. }
  6696. }
  6697. installRenderHelpers(FunctionalRenderContext.prototype);
  6698. function createFunctionalComponent (
  6699. Ctor,
  6700. propsData,
  6701. data,
  6702. contextVm,
  6703. children
  6704. ) {
  6705. var options = Ctor.options;
  6706. var props = {};
  6707. var propOptions = options.props;
  6708. if (isDef(propOptions)) {
  6709. for (var key in propOptions) {
  6710. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  6711. }
  6712. } else {
  6713. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  6714. if (isDef(data.props)) { mergeProps(props, data.props); }
  6715. }
  6716. var renderContext = new FunctionalRenderContext(
  6717. data,
  6718. props,
  6719. children,
  6720. contextVm,
  6721. Ctor
  6722. );
  6723. var vnode = options.render.call(null, renderContext._c, renderContext);
  6724. if (vnode instanceof VNode) {
  6725. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  6726. } else if (Array.isArray(vnode)) {
  6727. var vnodes = normalizeChildren(vnode) || [];
  6728. var res = new Array(vnodes.length);
  6729. for (var i = 0; i < vnodes.length; i++) {
  6730. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  6731. }
  6732. return res
  6733. }
  6734. }
  6735. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  6736. // #7817 clone node before setting fnContext, otherwise if the node is reused
  6737. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  6738. // that should not be matched to match.
  6739. var clone = cloneVNode(vnode);
  6740. clone.fnContext = contextVm;
  6741. clone.fnOptions = options;
  6742. if (true) {
  6743. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  6744. }
  6745. if (data.slot) {
  6746. (clone.data || (clone.data = {})).slot = data.slot;
  6747. }
  6748. return clone
  6749. }
  6750. function mergeProps (to, from) {
  6751. for (var key in from) {
  6752. to[camelize(key)] = from[key];
  6753. }
  6754. }
  6755. /* */
  6756. /* */
  6757. /* */
  6758. /* */
  6759. // inline hooks to be invoked on component VNodes during patch
  6760. var componentVNodeHooks = {
  6761. init: function init (vnode, hydrating) {
  6762. if (
  6763. vnode.componentInstance &&
  6764. !vnode.componentInstance._isDestroyed &&
  6765. vnode.data.keepAlive
  6766. ) {
  6767. // kept-alive components, treat as a patch
  6768. var mountedNode = vnode; // work around flow
  6769. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  6770. } else {
  6771. var child = vnode.componentInstance = createComponentInstanceForVnode(
  6772. vnode,
  6773. activeInstance
  6774. );
  6775. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  6776. }
  6777. },
  6778. prepatch: function prepatch (oldVnode, vnode) {
  6779. var options = vnode.componentOptions;
  6780. var child = vnode.componentInstance = oldVnode.componentInstance;
  6781. updateChildComponent(
  6782. child,
  6783. options.propsData, // updated props
  6784. options.listeners, // updated listeners
  6785. vnode, // new parent vnode
  6786. options.children // new children
  6787. );
  6788. },
  6789. insert: function insert (vnode) {
  6790. var context = vnode.context;
  6791. var componentInstance = vnode.componentInstance;
  6792. if (!componentInstance._isMounted) {
  6793. callHook(componentInstance, 'onServiceCreated');
  6794. callHook(componentInstance, 'onServiceAttached');
  6795. componentInstance._isMounted = true;
  6796. callHook(componentInstance, 'mounted');
  6797. }
  6798. if (vnode.data.keepAlive) {
  6799. if (context._isMounted) {
  6800. // vue-router#1212
  6801. // During updates, a kept-alive component's child components may
  6802. // change, so directly walking the tree here may call activated hooks
  6803. // on incorrect children. Instead we push them into a queue which will
  6804. // be processed after the whole patch process ended.
  6805. queueActivatedComponent(componentInstance);
  6806. } else {
  6807. activateChildComponent(componentInstance, true /* direct */);
  6808. }
  6809. }
  6810. },
  6811. destroy: function destroy (vnode) {
  6812. var componentInstance = vnode.componentInstance;
  6813. if (!componentInstance._isDestroyed) {
  6814. if (!vnode.data.keepAlive) {
  6815. componentInstance.$destroy();
  6816. } else {
  6817. deactivateChildComponent(componentInstance, true /* direct */);
  6818. }
  6819. }
  6820. }
  6821. };
  6822. var hooksToMerge = Object.keys(componentVNodeHooks);
  6823. function createComponent (
  6824. Ctor,
  6825. data,
  6826. context,
  6827. children,
  6828. tag
  6829. ) {
  6830. if (isUndef(Ctor)) {
  6831. return
  6832. }
  6833. var baseCtor = context.$options._base;
  6834. // plain options object: turn it into a constructor
  6835. if (isObject(Ctor)) {
  6836. Ctor = baseCtor.extend(Ctor);
  6837. }
  6838. // if at this stage it's not a constructor or an async component factory,
  6839. // reject.
  6840. if (typeof Ctor !== 'function') {
  6841. if (true) {
  6842. warn(("Invalid Component definition: " + (String(Ctor))), context);
  6843. }
  6844. return
  6845. }
  6846. // async component
  6847. var asyncFactory;
  6848. if (isUndef(Ctor.cid)) {
  6849. asyncFactory = Ctor;
  6850. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  6851. if (Ctor === undefined) {
  6852. // return a placeholder node for async component, which is rendered
  6853. // as a comment node but preserves all the raw information for the node.
  6854. // the information will be used for async server-rendering and hydration.
  6855. return createAsyncPlaceholder(
  6856. asyncFactory,
  6857. data,
  6858. context,
  6859. children,
  6860. tag
  6861. )
  6862. }
  6863. }
  6864. data = data || {};
  6865. // resolve constructor options in case global mixins are applied after
  6866. // component constructor creation
  6867. resolveConstructorOptions(Ctor);
  6868. // transform component v-model data into props & events
  6869. if (isDef(data.model)) {
  6870. transformModel(Ctor.options, data);
  6871. }
  6872. // extract props
  6873. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  6874. // functional component
  6875. if (isTrue(Ctor.options.functional)) {
  6876. return createFunctionalComponent(Ctor, propsData, data, context, children)
  6877. }
  6878. // extract listeners, since these needs to be treated as
  6879. // child component listeners instead of DOM listeners
  6880. var listeners = data.on;
  6881. // replace with listeners with .native modifier
  6882. // so it gets processed during parent component patch.
  6883. data.on = data.nativeOn;
  6884. if (isTrue(Ctor.options.abstract)) {
  6885. // abstract components do not keep anything
  6886. // other than props & listeners & slot
  6887. // work around flow
  6888. var slot = data.slot;
  6889. data = {};
  6890. if (slot) {
  6891. data.slot = slot;
  6892. }
  6893. }
  6894. // install component management hooks onto the placeholder node
  6895. installComponentHooks(data);
  6896. // return a placeholder vnode
  6897. var name = Ctor.options.name || tag;
  6898. var vnode = new VNode(
  6899. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  6900. data, undefined, undefined, undefined, context,
  6901. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  6902. asyncFactory
  6903. );
  6904. return vnode
  6905. }
  6906. function createComponentInstanceForVnode (
  6907. vnode, // we know it's MountedComponentVNode but flow doesn't
  6908. parent // activeInstance in lifecycle state
  6909. ) {
  6910. var options = {
  6911. _isComponent: true,
  6912. _parentVnode: vnode,
  6913. parent: parent
  6914. };
  6915. // check inline-template render functions
  6916. var inlineTemplate = vnode.data.inlineTemplate;
  6917. if (isDef(inlineTemplate)) {
  6918. options.render = inlineTemplate.render;
  6919. options.staticRenderFns = inlineTemplate.staticRenderFns;
  6920. }
  6921. return new vnode.componentOptions.Ctor(options)
  6922. }
  6923. function installComponentHooks (data) {
  6924. var hooks = data.hook || (data.hook = {});
  6925. for (var i = 0; i < hooksToMerge.length; i++) {
  6926. var key = hooksToMerge[i];
  6927. var existing = hooks[key];
  6928. var toMerge = componentVNodeHooks[key];
  6929. if (existing !== toMerge && !(existing && existing._merged)) {
  6930. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  6931. }
  6932. }
  6933. }
  6934. function mergeHook$1 (f1, f2) {
  6935. var merged = function (a, b) {
  6936. // flow complains about extra args which is why we use any
  6937. f1(a, b);
  6938. f2(a, b);
  6939. };
  6940. merged._merged = true;
  6941. return merged
  6942. }
  6943. // transform component v-model info (value and callback) into
  6944. // prop and event handler respectively.
  6945. function transformModel (options, data) {
  6946. var prop = (options.model && options.model.prop) || 'value';
  6947. var event = (options.model && options.model.event) || 'input'
  6948. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  6949. var on = data.on || (data.on = {});
  6950. var existing = on[event];
  6951. var callback = data.model.callback;
  6952. if (isDef(existing)) {
  6953. if (
  6954. Array.isArray(existing)
  6955. ? existing.indexOf(callback) === -1
  6956. : existing !== callback
  6957. ) {
  6958. on[event] = [callback].concat(existing);
  6959. }
  6960. } else {
  6961. on[event] = callback;
  6962. }
  6963. }
  6964. /* */
  6965. var SIMPLE_NORMALIZE = 1;
  6966. var ALWAYS_NORMALIZE = 2;
  6967. // wrapper function for providing a more flexible interface
  6968. // without getting yelled at by flow
  6969. function createElement (
  6970. context,
  6971. tag,
  6972. data,
  6973. children,
  6974. normalizationType,
  6975. alwaysNormalize
  6976. ) {
  6977. if (Array.isArray(data) || isPrimitive(data)) {
  6978. normalizationType = children;
  6979. children = data;
  6980. data = undefined;
  6981. }
  6982. if (isTrue(alwaysNormalize)) {
  6983. normalizationType = ALWAYS_NORMALIZE;
  6984. }
  6985. return _createElement(context, tag, data, children, normalizationType)
  6986. }
  6987. function _createElement (
  6988. context,
  6989. tag,
  6990. data,
  6991. children,
  6992. normalizationType
  6993. ) {
  6994. if (isDef(data) && isDef((data).__ob__)) {
  6995. true && warn(
  6996. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  6997. 'Always create fresh vnode data objects in each render!',
  6998. context
  6999. );
  7000. return createEmptyVNode()
  7001. }
  7002. // object syntax in v-bind
  7003. if (isDef(data) && isDef(data.is)) {
  7004. tag = data.is;
  7005. }
  7006. if (!tag) {
  7007. // in case of component :is set to falsy value
  7008. return createEmptyVNode()
  7009. }
  7010. // warn against non-primitive key
  7011. if ( true &&
  7012. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  7013. ) {
  7014. {
  7015. warn(
  7016. 'Avoid using non-primitive value as key, ' +
  7017. 'use string/number value instead.',
  7018. context
  7019. );
  7020. }
  7021. }
  7022. // support single function children as default scoped slot
  7023. if (Array.isArray(children) &&
  7024. typeof children[0] === 'function'
  7025. ) {
  7026. data = data || {};
  7027. data.scopedSlots = { default: children[0] };
  7028. children.length = 0;
  7029. }
  7030. if (normalizationType === ALWAYS_NORMALIZE) {
  7031. children = normalizeChildren(children);
  7032. } else if (normalizationType === SIMPLE_NORMALIZE) {
  7033. children = simpleNormalizeChildren(children);
  7034. }
  7035. var vnode, ns;
  7036. if (typeof tag === 'string') {
  7037. var Ctor;
  7038. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  7039. if (config.isReservedTag(tag)) {
  7040. // platform built-in elements
  7041. if ( true && isDef(data) && isDef(data.nativeOn)) {
  7042. warn(
  7043. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  7044. context
  7045. );
  7046. }
  7047. vnode = new VNode(
  7048. config.parsePlatformTagName(tag), data, children,
  7049. undefined, undefined, context
  7050. );
  7051. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  7052. // component
  7053. vnode = createComponent(Ctor, data, context, children, tag);
  7054. } else {
  7055. // unknown or unlisted namespaced elements
  7056. // check at runtime because it may get assigned a namespace when its
  7057. // parent normalizes children
  7058. vnode = new VNode(
  7059. tag, data, children,
  7060. undefined, undefined, context
  7061. );
  7062. }
  7063. } else {
  7064. // direct component options / constructor
  7065. vnode = createComponent(tag, data, context, children);
  7066. }
  7067. if (Array.isArray(vnode)) {
  7068. return vnode
  7069. } else if (isDef(vnode)) {
  7070. if (isDef(ns)) { applyNS(vnode, ns); }
  7071. if (isDef(data)) { registerDeepBindings(data); }
  7072. return vnode
  7073. } else {
  7074. return createEmptyVNode()
  7075. }
  7076. }
  7077. function applyNS (vnode, ns, force) {
  7078. vnode.ns = ns;
  7079. if (vnode.tag === 'foreignObject') {
  7080. // use default namespace inside foreignObject
  7081. ns = undefined;
  7082. force = true;
  7083. }
  7084. if (isDef(vnode.children)) {
  7085. for (var i = 0, l = vnode.children.length; i < l; i++) {
  7086. var child = vnode.children[i];
  7087. if (isDef(child.tag) && (
  7088. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  7089. applyNS(child, ns, force);
  7090. }
  7091. }
  7092. }
  7093. }
  7094. // ref #5318
  7095. // necessary to ensure parent re-render when deep bindings like :style and
  7096. // :class are used on slot nodes
  7097. function registerDeepBindings (data) {
  7098. if (isObject(data.style)) {
  7099. traverse(data.style);
  7100. }
  7101. if (isObject(data.class)) {
  7102. traverse(data.class);
  7103. }
  7104. }
  7105. /* */
  7106. function initRender (vm) {
  7107. vm._vnode = null; // the root of the child tree
  7108. vm._staticTrees = null; // v-once cached trees
  7109. var options = vm.$options;
  7110. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  7111. var renderContext = parentVnode && parentVnode.context;
  7112. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  7113. vm.$scopedSlots = emptyObject;
  7114. // bind the createElement fn to this instance
  7115. // so that we get proper render context inside it.
  7116. // args order: tag, data, children, normalizationType, alwaysNormalize
  7117. // internal version is used by render functions compiled from templates
  7118. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  7119. // normalization is always applied for the public version, used in
  7120. // user-written render functions.
  7121. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  7122. // $attrs & $listeners are exposed for easier HOC creation.
  7123. // they need to be reactive so that HOCs using them are always updated
  7124. var parentData = parentVnode && parentVnode.data;
  7125. /* istanbul ignore else */
  7126. if (true) {
  7127. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  7128. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  7129. }, true);
  7130. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  7131. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  7132. }, true);
  7133. } else {}
  7134. }
  7135. var currentRenderingInstance = null;
  7136. function renderMixin (Vue) {
  7137. // install runtime convenience helpers
  7138. installRenderHelpers(Vue.prototype);
  7139. Vue.prototype.$nextTick = function (fn) {
  7140. return nextTick(fn, this)
  7141. };
  7142. Vue.prototype._render = function () {
  7143. var vm = this;
  7144. var ref = vm.$options;
  7145. var render = ref.render;
  7146. var _parentVnode = ref._parentVnode;
  7147. if (_parentVnode) {
  7148. vm.$scopedSlots = normalizeScopedSlots(
  7149. _parentVnode.data.scopedSlots,
  7150. vm.$slots,
  7151. vm.$scopedSlots
  7152. );
  7153. }
  7154. // set parent vnode. this allows render functions to have access
  7155. // to the data on the placeholder node.
  7156. vm.$vnode = _parentVnode;
  7157. // render self
  7158. var vnode;
  7159. try {
  7160. // There's no need to maintain a stack because all render fns are called
  7161. // separately from one another. Nested component's render fns are called
  7162. // when parent component is patched.
  7163. currentRenderingInstance = vm;
  7164. vnode = render.call(vm._renderProxy, vm.$createElement);
  7165. } catch (e) {
  7166. handleError(e, vm, "render");
  7167. // return error render result,
  7168. // or previous vnode to prevent render error causing blank component
  7169. /* istanbul ignore else */
  7170. if ( true && vm.$options.renderError) {
  7171. try {
  7172. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  7173. } catch (e) {
  7174. handleError(e, vm, "renderError");
  7175. vnode = vm._vnode;
  7176. }
  7177. } else {
  7178. vnode = vm._vnode;
  7179. }
  7180. } finally {
  7181. currentRenderingInstance = null;
  7182. }
  7183. // if the returned array contains only a single node, allow it
  7184. if (Array.isArray(vnode) && vnode.length === 1) {
  7185. vnode = vnode[0];
  7186. }
  7187. // return empty vnode in case the render function errored out
  7188. if (!(vnode instanceof VNode)) {
  7189. if ( true && Array.isArray(vnode)) {
  7190. warn(
  7191. 'Multiple root nodes returned from render function. Render function ' +
  7192. 'should return a single root node.',
  7193. vm
  7194. );
  7195. }
  7196. vnode = createEmptyVNode();
  7197. }
  7198. // set parent
  7199. vnode.parent = _parentVnode;
  7200. return vnode
  7201. };
  7202. }
  7203. /* */
  7204. function ensureCtor (comp, base) {
  7205. if (
  7206. comp.__esModule ||
  7207. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  7208. ) {
  7209. comp = comp.default;
  7210. }
  7211. return isObject(comp)
  7212. ? base.extend(comp)
  7213. : comp
  7214. }
  7215. function createAsyncPlaceholder (
  7216. factory,
  7217. data,
  7218. context,
  7219. children,
  7220. tag
  7221. ) {
  7222. var node = createEmptyVNode();
  7223. node.asyncFactory = factory;
  7224. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  7225. return node
  7226. }
  7227. function resolveAsyncComponent (
  7228. factory,
  7229. baseCtor
  7230. ) {
  7231. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  7232. return factory.errorComp
  7233. }
  7234. if (isDef(factory.resolved)) {
  7235. return factory.resolved
  7236. }
  7237. var owner = currentRenderingInstance;
  7238. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  7239. // already pending
  7240. factory.owners.push(owner);
  7241. }
  7242. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  7243. return factory.loadingComp
  7244. }
  7245. if (owner && !isDef(factory.owners)) {
  7246. var owners = factory.owners = [owner];
  7247. var sync = true;
  7248. var timerLoading = null;
  7249. var timerTimeout = null
  7250. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  7251. var forceRender = function (renderCompleted) {
  7252. for (var i = 0, l = owners.length; i < l; i++) {
  7253. (owners[i]).$forceUpdate();
  7254. }
  7255. if (renderCompleted) {
  7256. owners.length = 0;
  7257. if (timerLoading !== null) {
  7258. clearTimeout(timerLoading);
  7259. timerLoading = null;
  7260. }
  7261. if (timerTimeout !== null) {
  7262. clearTimeout(timerTimeout);
  7263. timerTimeout = null;
  7264. }
  7265. }
  7266. };
  7267. var resolve = once(function (res) {
  7268. // cache resolved
  7269. factory.resolved = ensureCtor(res, baseCtor);
  7270. // invoke callbacks only if this is not a synchronous resolve
  7271. // (async resolves are shimmed as synchronous during SSR)
  7272. if (!sync) {
  7273. forceRender(true);
  7274. } else {
  7275. owners.length = 0;
  7276. }
  7277. });
  7278. var reject = once(function (reason) {
  7279. true && warn(
  7280. "Failed to resolve async component: " + (String(factory)) +
  7281. (reason ? ("\nReason: " + reason) : '')
  7282. );
  7283. if (isDef(factory.errorComp)) {
  7284. factory.error = true;
  7285. forceRender(true);
  7286. }
  7287. });
  7288. var res = factory(resolve, reject);
  7289. if (isObject(res)) {
  7290. if (isPromise(res)) {
  7291. // () => Promise
  7292. if (isUndef(factory.resolved)) {
  7293. res.then(resolve, reject);
  7294. }
  7295. } else if (isPromise(res.component)) {
  7296. res.component.then(resolve, reject);
  7297. if (isDef(res.error)) {
  7298. factory.errorComp = ensureCtor(res.error, baseCtor);
  7299. }
  7300. if (isDef(res.loading)) {
  7301. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  7302. if (res.delay === 0) {
  7303. factory.loading = true;
  7304. } else {
  7305. timerLoading = setTimeout(function () {
  7306. timerLoading = null;
  7307. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  7308. factory.loading = true;
  7309. forceRender(false);
  7310. }
  7311. }, res.delay || 200);
  7312. }
  7313. }
  7314. if (isDef(res.timeout)) {
  7315. timerTimeout = setTimeout(function () {
  7316. timerTimeout = null;
  7317. if (isUndef(factory.resolved)) {
  7318. reject(
  7319. true
  7320. ? ("timeout (" + (res.timeout) + "ms)")
  7321. : undefined
  7322. );
  7323. }
  7324. }, res.timeout);
  7325. }
  7326. }
  7327. }
  7328. sync = false;
  7329. // return in case resolved synchronously
  7330. return factory.loading
  7331. ? factory.loadingComp
  7332. : factory.resolved
  7333. }
  7334. }
  7335. /* */
  7336. function isAsyncPlaceholder (node) {
  7337. return node.isComment && node.asyncFactory
  7338. }
  7339. /* */
  7340. function getFirstComponentChild (children) {
  7341. if (Array.isArray(children)) {
  7342. for (var i = 0; i < children.length; i++) {
  7343. var c = children[i];
  7344. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  7345. return c
  7346. }
  7347. }
  7348. }
  7349. }
  7350. /* */
  7351. /* */
  7352. function initEvents (vm) {
  7353. vm._events = Object.create(null);
  7354. vm._hasHookEvent = false;
  7355. // init parent attached events
  7356. var listeners = vm.$options._parentListeners;
  7357. if (listeners) {
  7358. updateComponentListeners(vm, listeners);
  7359. }
  7360. }
  7361. var target;
  7362. function add (event, fn) {
  7363. target.$on(event, fn);
  7364. }
  7365. function remove$1 (event, fn) {
  7366. target.$off(event, fn);
  7367. }
  7368. function createOnceHandler (event, fn) {
  7369. var _target = target;
  7370. return function onceHandler () {
  7371. var res = fn.apply(null, arguments);
  7372. if (res !== null) {
  7373. _target.$off(event, onceHandler);
  7374. }
  7375. }
  7376. }
  7377. function updateComponentListeners (
  7378. vm,
  7379. listeners,
  7380. oldListeners
  7381. ) {
  7382. target = vm;
  7383. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  7384. target = undefined;
  7385. }
  7386. function eventsMixin (Vue) {
  7387. var hookRE = /^hook:/;
  7388. Vue.prototype.$on = function (event, fn) {
  7389. var vm = this;
  7390. if (Array.isArray(event)) {
  7391. for (var i = 0, l = event.length; i < l; i++) {
  7392. vm.$on(event[i], fn);
  7393. }
  7394. } else {
  7395. (vm._events[event] || (vm._events[event] = [])).push(fn);
  7396. // optimize hook:event cost by using a boolean flag marked at registration
  7397. // instead of a hash lookup
  7398. if (hookRE.test(event)) {
  7399. vm._hasHookEvent = true;
  7400. }
  7401. }
  7402. return vm
  7403. };
  7404. Vue.prototype.$once = function (event, fn) {
  7405. var vm = this;
  7406. function on () {
  7407. vm.$off(event, on);
  7408. fn.apply(vm, arguments);
  7409. }
  7410. on.fn = fn;
  7411. vm.$on(event, on);
  7412. return vm
  7413. };
  7414. Vue.prototype.$off = function (event, fn) {
  7415. var vm = this;
  7416. // all
  7417. if (!arguments.length) {
  7418. vm._events = Object.create(null);
  7419. return vm
  7420. }
  7421. // array of events
  7422. if (Array.isArray(event)) {
  7423. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  7424. vm.$off(event[i$1], fn);
  7425. }
  7426. return vm
  7427. }
  7428. // specific event
  7429. var cbs = vm._events[event];
  7430. if (!cbs) {
  7431. return vm
  7432. }
  7433. if (!fn) {
  7434. vm._events[event] = null;
  7435. return vm
  7436. }
  7437. // specific handler
  7438. var cb;
  7439. var i = cbs.length;
  7440. while (i--) {
  7441. cb = cbs[i];
  7442. if (cb === fn || cb.fn === fn) {
  7443. cbs.splice(i, 1);
  7444. break
  7445. }
  7446. }
  7447. return vm
  7448. };
  7449. Vue.prototype.$emit = function (event) {
  7450. var vm = this;
  7451. if (true) {
  7452. var lowerCaseEvent = event.toLowerCase();
  7453. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  7454. tip(
  7455. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  7456. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  7457. "Note that HTML attributes are case-insensitive and you cannot use " +
  7458. "v-on to listen to camelCase events when using in-DOM templates. " +
  7459. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  7460. );
  7461. }
  7462. }
  7463. var cbs = vm._events[event];
  7464. if (cbs) {
  7465. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  7466. var args = toArray(arguments, 1);
  7467. var info = "event handler for \"" + event + "\"";
  7468. for (var i = 0, l = cbs.length; i < l; i++) {
  7469. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  7470. }
  7471. }
  7472. return vm
  7473. };
  7474. }
  7475. /* */
  7476. var activeInstance = null;
  7477. var isUpdatingChildComponent = false;
  7478. function setActiveInstance(vm) {
  7479. var prevActiveInstance = activeInstance;
  7480. activeInstance = vm;
  7481. return function () {
  7482. activeInstance = prevActiveInstance;
  7483. }
  7484. }
  7485. function initLifecycle (vm) {
  7486. var options = vm.$options;
  7487. // locate first non-abstract parent
  7488. var parent = options.parent;
  7489. if (parent && !options.abstract) {
  7490. while (parent.$options.abstract && parent.$parent) {
  7491. parent = parent.$parent;
  7492. }
  7493. parent.$children.push(vm);
  7494. }
  7495. vm.$parent = parent;
  7496. vm.$root = parent ? parent.$root : vm;
  7497. vm.$children = [];
  7498. vm.$refs = {};
  7499. vm._watcher = null;
  7500. vm._inactive = null;
  7501. vm._directInactive = false;
  7502. vm._isMounted = false;
  7503. vm._isDestroyed = false;
  7504. vm._isBeingDestroyed = false;
  7505. }
  7506. function lifecycleMixin (Vue) {
  7507. Vue.prototype._update = function (vnode, hydrating) {
  7508. var vm = this;
  7509. var prevEl = vm.$el;
  7510. var prevVnode = vm._vnode;
  7511. var restoreActiveInstance = setActiveInstance(vm);
  7512. vm._vnode = vnode;
  7513. // Vue.prototype.__patch__ is injected in entry points
  7514. // based on the rendering backend used.
  7515. if (!prevVnode) {
  7516. // initial render
  7517. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  7518. } else {
  7519. // updates
  7520. vm.$el = vm.__patch__(prevVnode, vnode);
  7521. }
  7522. restoreActiveInstance();
  7523. // update __vue__ reference
  7524. if (prevEl) {
  7525. prevEl.__vue__ = null;
  7526. }
  7527. if (vm.$el) {
  7528. vm.$el.__vue__ = vm;
  7529. }
  7530. // if parent is an HOC, update its $el as well
  7531. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  7532. vm.$parent.$el = vm.$el;
  7533. }
  7534. // updated hook is called by the scheduler to ensure that children are
  7535. // updated in a parent's updated hook.
  7536. };
  7537. Vue.prototype.$forceUpdate = function () {
  7538. var vm = this;
  7539. if (vm._watcher) {
  7540. vm._watcher.update();
  7541. }
  7542. };
  7543. Vue.prototype.$destroy = function () {
  7544. var vm = this;
  7545. if (vm._isBeingDestroyed) {
  7546. return
  7547. }
  7548. callHook(vm, 'beforeDestroy');
  7549. vm._isBeingDestroyed = true;
  7550. // remove self from parent
  7551. var parent = vm.$parent;
  7552. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  7553. remove(parent.$children, vm);
  7554. }
  7555. // teardown watchers
  7556. if (vm._watcher) {
  7557. vm._watcher.teardown();
  7558. }
  7559. var i = vm._watchers.length;
  7560. while (i--) {
  7561. vm._watchers[i].teardown();
  7562. }
  7563. // remove reference from data ob
  7564. // frozen object may not have observer.
  7565. if (vm._data.__ob__) {
  7566. vm._data.__ob__.vmCount--;
  7567. }
  7568. // call the last hook...
  7569. vm._isDestroyed = true;
  7570. // invoke destroy hooks on current rendered tree
  7571. vm.__patch__(vm._vnode, null);
  7572. // fire destroyed hook
  7573. callHook(vm, 'destroyed');
  7574. // turn off all instance listeners.
  7575. vm.$off();
  7576. // remove __vue__ reference
  7577. if (vm.$el) {
  7578. vm.$el.__vue__ = null;
  7579. }
  7580. // release circular reference (#6759)
  7581. if (vm.$vnode) {
  7582. vm.$vnode.parent = null;
  7583. }
  7584. };
  7585. }
  7586. function updateChildComponent (
  7587. vm,
  7588. propsData,
  7589. listeners,
  7590. parentVnode,
  7591. renderChildren
  7592. ) {
  7593. if (true) {
  7594. isUpdatingChildComponent = true;
  7595. }
  7596. // determine whether component has slot children
  7597. // we need to do this before overwriting $options._renderChildren.
  7598. // check if there are dynamic scopedSlots (hand-written or compiled but with
  7599. // dynamic slot names). Static scoped slots compiled from template has the
  7600. // "$stable" marker.
  7601. var newScopedSlots = parentVnode.data.scopedSlots;
  7602. var oldScopedSlots = vm.$scopedSlots;
  7603. var hasDynamicScopedSlot = !!(
  7604. (newScopedSlots && !newScopedSlots.$stable) ||
  7605. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  7606. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  7607. );
  7608. // Any static slot children from the parent may have changed during parent's
  7609. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  7610. // update is necessary to ensure correctness.
  7611. var needsForceUpdate = !!(
  7612. renderChildren || // has new static slots
  7613. vm.$options._renderChildren || // has old static slots
  7614. hasDynamicScopedSlot
  7615. );
  7616. vm.$options._parentVnode = parentVnode;
  7617. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  7618. if (vm._vnode) { // update child tree's parent
  7619. vm._vnode.parent = parentVnode;
  7620. }
  7621. vm.$options._renderChildren = renderChildren;
  7622. // update $attrs and $listeners hash
  7623. // these are also reactive so they may trigger child update if the child
  7624. // used them during render
  7625. vm.$attrs = parentVnode.data.attrs || emptyObject;
  7626. vm.$listeners = listeners || emptyObject;
  7627. // update props
  7628. if (propsData && vm.$options.props) {
  7629. toggleObserving(false);
  7630. var props = vm._props;
  7631. var propKeys = vm.$options._propKeys || [];
  7632. for (var i = 0; i < propKeys.length; i++) {
  7633. var key = propKeys[i];
  7634. var propOptions = vm.$options.props; // wtf flow?
  7635. props[key] = validateProp(key, propOptions, propsData, vm);
  7636. }
  7637. toggleObserving(true);
  7638. // keep a copy of raw propsData
  7639. vm.$options.propsData = propsData;
  7640. }
  7641. // fixed by xxxxxx update properties(mp runtime)
  7642. vm._$updateProperties && vm._$updateProperties(vm);
  7643. // update listeners
  7644. listeners = listeners || emptyObject;
  7645. var oldListeners = vm.$options._parentListeners;
  7646. vm.$options._parentListeners = listeners;
  7647. updateComponentListeners(vm, listeners, oldListeners);
  7648. // resolve slots + force update if has children
  7649. if (needsForceUpdate) {
  7650. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  7651. vm.$forceUpdate();
  7652. }
  7653. if (true) {
  7654. isUpdatingChildComponent = false;
  7655. }
  7656. }
  7657. function isInInactiveTree (vm) {
  7658. while (vm && (vm = vm.$parent)) {
  7659. if (vm._inactive) { return true }
  7660. }
  7661. return false
  7662. }
  7663. function activateChildComponent (vm, direct) {
  7664. if (direct) {
  7665. vm._directInactive = false;
  7666. if (isInInactiveTree(vm)) {
  7667. return
  7668. }
  7669. } else if (vm._directInactive) {
  7670. return
  7671. }
  7672. if (vm._inactive || vm._inactive === null) {
  7673. vm._inactive = false;
  7674. for (var i = 0; i < vm.$children.length; i++) {
  7675. activateChildComponent(vm.$children[i]);
  7676. }
  7677. callHook(vm, 'activated');
  7678. }
  7679. }
  7680. function deactivateChildComponent (vm, direct) {
  7681. if (direct) {
  7682. vm._directInactive = true;
  7683. if (isInInactiveTree(vm)) {
  7684. return
  7685. }
  7686. }
  7687. if (!vm._inactive) {
  7688. vm._inactive = true;
  7689. for (var i = 0; i < vm.$children.length; i++) {
  7690. deactivateChildComponent(vm.$children[i]);
  7691. }
  7692. callHook(vm, 'deactivated');
  7693. }
  7694. }
  7695. function callHook (vm, hook) {
  7696. // #7573 disable dep collection when invoking lifecycle hooks
  7697. pushTarget();
  7698. var handlers = vm.$options[hook];
  7699. var info = hook + " hook";
  7700. if (handlers) {
  7701. for (var i = 0, j = handlers.length; i < j; i++) {
  7702. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  7703. }
  7704. }
  7705. if (vm._hasHookEvent) {
  7706. vm.$emit('hook:' + hook);
  7707. }
  7708. popTarget();
  7709. }
  7710. /* */
  7711. var MAX_UPDATE_COUNT = 100;
  7712. var queue = [];
  7713. var activatedChildren = [];
  7714. var has = {};
  7715. var circular = {};
  7716. var waiting = false;
  7717. var flushing = false;
  7718. var index = 0;
  7719. /**
  7720. * Reset the scheduler's state.
  7721. */
  7722. function resetSchedulerState () {
  7723. index = queue.length = activatedChildren.length = 0;
  7724. has = {};
  7725. if (true) {
  7726. circular = {};
  7727. }
  7728. waiting = flushing = false;
  7729. }
  7730. // Async edge case #6566 requires saving the timestamp when event listeners are
  7731. // attached. However, calling performance.now() has a perf overhead especially
  7732. // if the page has thousands of event listeners. Instead, we take a timestamp
  7733. // every time the scheduler flushes and use that for all event listeners
  7734. // attached during that flush.
  7735. var currentFlushTimestamp = 0;
  7736. // Async edge case fix requires storing an event listener's attach timestamp.
  7737. var getNow = Date.now;
  7738. // Determine what event timestamp the browser is using. Annoyingly, the
  7739. // timestamp can either be hi-res (relative to page load) or low-res
  7740. // (relative to UNIX epoch), so in order to compare time we have to use the
  7741. // same timestamp type when saving the flush timestamp.
  7742. // All IE versions use low-res event timestamps, and have problematic clock
  7743. // implementations (#9632)
  7744. if (inBrowser && !isIE) {
  7745. var performance = window.performance;
  7746. if (
  7747. performance &&
  7748. typeof performance.now === 'function' &&
  7749. getNow() > document.createEvent('Event').timeStamp
  7750. ) {
  7751. // if the event timestamp, although evaluated AFTER the Date.now(), is
  7752. // smaller than it, it means the event is using a hi-res timestamp,
  7753. // and we need to use the hi-res version for event listener timestamps as
  7754. // well.
  7755. getNow = function () { return performance.now(); };
  7756. }
  7757. }
  7758. /**
  7759. * Flush both queues and run the watchers.
  7760. */
  7761. function flushSchedulerQueue () {
  7762. currentFlushTimestamp = getNow();
  7763. flushing = true;
  7764. var watcher, id;
  7765. // Sort queue before flush.
  7766. // This ensures that:
  7767. // 1. Components are updated from parent to child. (because parent is always
  7768. // created before the child)
  7769. // 2. A component's user watchers are run before its render watcher (because
  7770. // user watchers are created before the render watcher)
  7771. // 3. If a component is destroyed during a parent component's watcher run,
  7772. // its watchers can be skipped.
  7773. queue.sort(function (a, b) { return a.id - b.id; });
  7774. // do not cache length because more watchers might be pushed
  7775. // as we run existing watchers
  7776. for (index = 0; index < queue.length; index++) {
  7777. watcher = queue[index];
  7778. if (watcher.before) {
  7779. watcher.before();
  7780. }
  7781. id = watcher.id;
  7782. has[id] = null;
  7783. watcher.run();
  7784. // in dev build, check and stop circular updates.
  7785. if ( true && has[id] != null) {
  7786. circular[id] = (circular[id] || 0) + 1;
  7787. if (circular[id] > MAX_UPDATE_COUNT) {
  7788. warn(
  7789. 'You may have an infinite update loop ' + (
  7790. watcher.user
  7791. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  7792. : "in a component render function."
  7793. ),
  7794. watcher.vm
  7795. );
  7796. break
  7797. }
  7798. }
  7799. }
  7800. // keep copies of post queues before resetting state
  7801. var activatedQueue = activatedChildren.slice();
  7802. var updatedQueue = queue.slice();
  7803. resetSchedulerState();
  7804. // call component updated and activated hooks
  7805. callActivatedHooks(activatedQueue);
  7806. callUpdatedHooks(updatedQueue);
  7807. // devtool hook
  7808. /* istanbul ignore if */
  7809. if (devtools && config.devtools) {
  7810. devtools.emit('flush');
  7811. }
  7812. }
  7813. function callUpdatedHooks (queue) {
  7814. var i = queue.length;
  7815. while (i--) {
  7816. var watcher = queue[i];
  7817. var vm = watcher.vm;
  7818. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  7819. callHook(vm, 'updated');
  7820. }
  7821. }
  7822. }
  7823. /**
  7824. * Queue a kept-alive component that was activated during patch.
  7825. * The queue will be processed after the entire tree has been patched.
  7826. */
  7827. function queueActivatedComponent (vm) {
  7828. // setting _inactive to false here so that a render function can
  7829. // rely on checking whether it's in an inactive tree (e.g. router-view)
  7830. vm._inactive = false;
  7831. activatedChildren.push(vm);
  7832. }
  7833. function callActivatedHooks (queue) {
  7834. for (var i = 0; i < queue.length; i++) {
  7835. queue[i]._inactive = true;
  7836. activateChildComponent(queue[i], true /* true */);
  7837. }
  7838. }
  7839. /**
  7840. * Push a watcher into the watcher queue.
  7841. * Jobs with duplicate IDs will be skipped unless it's
  7842. * pushed when the queue is being flushed.
  7843. */
  7844. function queueWatcher (watcher) {
  7845. var id = watcher.id;
  7846. if (has[id] == null) {
  7847. has[id] = true;
  7848. if (!flushing) {
  7849. queue.push(watcher);
  7850. } else {
  7851. // if already flushing, splice the watcher based on its id
  7852. // if already past its id, it will be run next immediately.
  7853. var i = queue.length - 1;
  7854. while (i > index && queue[i].id > watcher.id) {
  7855. i--;
  7856. }
  7857. queue.splice(i + 1, 0, watcher);
  7858. }
  7859. // queue the flush
  7860. if (!waiting) {
  7861. waiting = true;
  7862. if ( true && !config.async) {
  7863. flushSchedulerQueue();
  7864. return
  7865. }
  7866. nextTick(flushSchedulerQueue);
  7867. }
  7868. }
  7869. }
  7870. /* */
  7871. var uid$2 = 0;
  7872. /**
  7873. * A watcher parses an expression, collects dependencies,
  7874. * and fires callback when the expression value changes.
  7875. * This is used for both the $watch() api and directives.
  7876. */
  7877. var Watcher = function Watcher (
  7878. vm,
  7879. expOrFn,
  7880. cb,
  7881. options,
  7882. isRenderWatcher
  7883. ) {
  7884. this.vm = vm;
  7885. if (isRenderWatcher) {
  7886. vm._watcher = this;
  7887. }
  7888. vm._watchers.push(this);
  7889. // options
  7890. if (options) {
  7891. this.deep = !!options.deep;
  7892. this.user = !!options.user;
  7893. this.lazy = !!options.lazy;
  7894. this.sync = !!options.sync;
  7895. this.before = options.before;
  7896. } else {
  7897. this.deep = this.user = this.lazy = this.sync = false;
  7898. }
  7899. this.cb = cb;
  7900. this.id = ++uid$2; // uid for batching
  7901. this.active = true;
  7902. this.dirty = this.lazy; // for lazy watchers
  7903. this.deps = [];
  7904. this.newDeps = [];
  7905. this.depIds = new _Set();
  7906. this.newDepIds = new _Set();
  7907. this.expression = true
  7908. ? expOrFn.toString()
  7909. : undefined;
  7910. // parse expression for getter
  7911. if (typeof expOrFn === 'function') {
  7912. this.getter = expOrFn;
  7913. } else {
  7914. this.getter = parsePath(expOrFn);
  7915. if (!this.getter) {
  7916. this.getter = noop;
  7917. true && warn(
  7918. "Failed watching path: \"" + expOrFn + "\" " +
  7919. 'Watcher only accepts simple dot-delimited paths. ' +
  7920. 'For full control, use a function instead.',
  7921. vm
  7922. );
  7923. }
  7924. }
  7925. this.value = this.lazy
  7926. ? undefined
  7927. : this.get();
  7928. };
  7929. /**
  7930. * Evaluate the getter, and re-collect dependencies.
  7931. */
  7932. Watcher.prototype.get = function get () {
  7933. pushTarget(this);
  7934. var value;
  7935. var vm = this.vm;
  7936. try {
  7937. value = this.getter.call(vm, vm);
  7938. } catch (e) {
  7939. if (this.user) {
  7940. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  7941. } else {
  7942. throw e
  7943. }
  7944. } finally {
  7945. // "touch" every property so they are all tracked as
  7946. // dependencies for deep watching
  7947. if (this.deep) {
  7948. traverse(value);
  7949. }
  7950. popTarget();
  7951. this.cleanupDeps();
  7952. }
  7953. return value
  7954. };
  7955. /**
  7956. * Add a dependency to this directive.
  7957. */
  7958. Watcher.prototype.addDep = function addDep (dep) {
  7959. var id = dep.id;
  7960. if (!this.newDepIds.has(id)) {
  7961. this.newDepIds.add(id);
  7962. this.newDeps.push(dep);
  7963. if (!this.depIds.has(id)) {
  7964. dep.addSub(this);
  7965. }
  7966. }
  7967. };
  7968. /**
  7969. * Clean up for dependency collection.
  7970. */
  7971. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  7972. var i = this.deps.length;
  7973. while (i--) {
  7974. var dep = this.deps[i];
  7975. if (!this.newDepIds.has(dep.id)) {
  7976. dep.removeSub(this);
  7977. }
  7978. }
  7979. var tmp = this.depIds;
  7980. this.depIds = this.newDepIds;
  7981. this.newDepIds = tmp;
  7982. this.newDepIds.clear();
  7983. tmp = this.deps;
  7984. this.deps = this.newDeps;
  7985. this.newDeps = tmp;
  7986. this.newDeps.length = 0;
  7987. };
  7988. /**
  7989. * Subscriber interface.
  7990. * Will be called when a dependency changes.
  7991. */
  7992. Watcher.prototype.update = function update () {
  7993. /* istanbul ignore else */
  7994. if (this.lazy) {
  7995. this.dirty = true;
  7996. } else if (this.sync) {
  7997. this.run();
  7998. } else {
  7999. queueWatcher(this);
  8000. }
  8001. };
  8002. /**
  8003. * Scheduler job interface.
  8004. * Will be called by the scheduler.
  8005. */
  8006. Watcher.prototype.run = function run () {
  8007. if (this.active) {
  8008. var value = this.get();
  8009. if (
  8010. value !== this.value ||
  8011. // Deep watchers and watchers on Object/Arrays should fire even
  8012. // when the value is the same, because the value may
  8013. // have mutated.
  8014. isObject(value) ||
  8015. this.deep
  8016. ) {
  8017. // set new value
  8018. var oldValue = this.value;
  8019. this.value = value;
  8020. if (this.user) {
  8021. try {
  8022. this.cb.call(this.vm, value, oldValue);
  8023. } catch (e) {
  8024. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  8025. }
  8026. } else {
  8027. this.cb.call(this.vm, value, oldValue);
  8028. }
  8029. }
  8030. }
  8031. };
  8032. /**
  8033. * Evaluate the value of the watcher.
  8034. * This only gets called for lazy watchers.
  8035. */
  8036. Watcher.prototype.evaluate = function evaluate () {
  8037. this.value = this.get();
  8038. this.dirty = false;
  8039. };
  8040. /**
  8041. * Depend on all deps collected by this watcher.
  8042. */
  8043. Watcher.prototype.depend = function depend () {
  8044. var i = this.deps.length;
  8045. while (i--) {
  8046. this.deps[i].depend();
  8047. }
  8048. };
  8049. /**
  8050. * Remove self from all dependencies' subscriber list.
  8051. */
  8052. Watcher.prototype.teardown = function teardown () {
  8053. if (this.active) {
  8054. // remove self from vm's watcher list
  8055. // this is a somewhat expensive operation so we skip it
  8056. // if the vm is being destroyed.
  8057. if (!this.vm._isBeingDestroyed) {
  8058. remove(this.vm._watchers, this);
  8059. }
  8060. var i = this.deps.length;
  8061. while (i--) {
  8062. this.deps[i].removeSub(this);
  8063. }
  8064. this.active = false;
  8065. }
  8066. };
  8067. /* */
  8068. var sharedPropertyDefinition = {
  8069. enumerable: true,
  8070. configurable: true,
  8071. get: noop,
  8072. set: noop
  8073. };
  8074. function proxy (target, sourceKey, key) {
  8075. sharedPropertyDefinition.get = function proxyGetter () {
  8076. return this[sourceKey][key]
  8077. };
  8078. sharedPropertyDefinition.set = function proxySetter (val) {
  8079. this[sourceKey][key] = val;
  8080. };
  8081. Object.defineProperty(target, key, sharedPropertyDefinition);
  8082. }
  8083. function initState (vm) {
  8084. vm._watchers = [];
  8085. var opts = vm.$options;
  8086. if (opts.props) { initProps(vm, opts.props); }
  8087. if (opts.methods) { initMethods(vm, opts.methods); }
  8088. if (opts.data) {
  8089. initData(vm);
  8090. } else {
  8091. observe(vm._data = {}, true /* asRootData */);
  8092. }
  8093. if (opts.computed) { initComputed(vm, opts.computed); }
  8094. if (opts.watch && opts.watch !== nativeWatch) {
  8095. initWatch(vm, opts.watch);
  8096. }
  8097. }
  8098. function initProps (vm, propsOptions) {
  8099. var propsData = vm.$options.propsData || {};
  8100. var props = vm._props = {};
  8101. // cache prop keys so that future props updates can iterate using Array
  8102. // instead of dynamic object key enumeration.
  8103. var keys = vm.$options._propKeys = [];
  8104. var isRoot = !vm.$parent;
  8105. // root instance props should be converted
  8106. if (!isRoot) {
  8107. toggleObserving(false);
  8108. }
  8109. var loop = function ( key ) {
  8110. keys.push(key);
  8111. var value = validateProp(key, propsOptions, propsData, vm);
  8112. /* istanbul ignore else */
  8113. if (true) {
  8114. var hyphenatedKey = hyphenate(key);
  8115. if (isReservedAttribute(hyphenatedKey) ||
  8116. config.isReservedAttr(hyphenatedKey)) {
  8117. warn(
  8118. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  8119. vm
  8120. );
  8121. }
  8122. defineReactive$$1(props, key, value, function () {
  8123. if (!isRoot && !isUpdatingChildComponent) {
  8124. {
  8125. if(vm.mpHost === 'mp-baidu'){//百度 observer 在 setData callback 之后触发,直接忽略该 warn
  8126. return
  8127. }
  8128. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  8129. if(
  8130. key === 'value' &&
  8131. Array.isArray(vm.$options.behaviors) &&
  8132. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  8133. ){
  8134. return
  8135. }
  8136. if(vm._getFormData){
  8137. return
  8138. }
  8139. var $parent = vm.$parent;
  8140. while($parent){
  8141. if($parent.__next_tick_pending){
  8142. return
  8143. }
  8144. $parent = $parent.$parent;
  8145. }
  8146. }
  8147. warn(
  8148. "Avoid mutating a prop directly since the value will be " +
  8149. "overwritten whenever the parent component re-renders. " +
  8150. "Instead, use a data or computed property based on the prop's " +
  8151. "value. Prop being mutated: \"" + key + "\"",
  8152. vm
  8153. );
  8154. }
  8155. });
  8156. } else {}
  8157. // static props are already proxied on the component's prototype
  8158. // during Vue.extend(). We only need to proxy props defined at
  8159. // instantiation here.
  8160. if (!(key in vm)) {
  8161. proxy(vm, "_props", key);
  8162. }
  8163. };
  8164. for (var key in propsOptions) loop( key );
  8165. toggleObserving(true);
  8166. }
  8167. function initData (vm) {
  8168. var data = vm.$options.data;
  8169. data = vm._data = typeof data === 'function'
  8170. ? getData(data, vm)
  8171. : data || {};
  8172. if (!isPlainObject(data)) {
  8173. data = {};
  8174. true && warn(
  8175. 'data functions should return an object:\n' +
  8176. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  8177. vm
  8178. );
  8179. }
  8180. // proxy data on instance
  8181. var keys = Object.keys(data);
  8182. var props = vm.$options.props;
  8183. var methods = vm.$options.methods;
  8184. var i = keys.length;
  8185. while (i--) {
  8186. var key = keys[i];
  8187. if (true) {
  8188. if (methods && hasOwn(methods, key)) {
  8189. warn(
  8190. ("Method \"" + key + "\" has already been defined as a data property."),
  8191. vm
  8192. );
  8193. }
  8194. }
  8195. if (props && hasOwn(props, key)) {
  8196. true && warn(
  8197. "The data property \"" + key + "\" is already declared as a prop. " +
  8198. "Use prop default value instead.",
  8199. vm
  8200. );
  8201. } else if (!isReserved(key)) {
  8202. proxy(vm, "_data", key);
  8203. }
  8204. }
  8205. // observe data
  8206. observe(data, true /* asRootData */);
  8207. }
  8208. function getData (data, vm) {
  8209. // #7573 disable dep collection when invoking data getters
  8210. pushTarget();
  8211. try {
  8212. return data.call(vm, vm)
  8213. } catch (e) {
  8214. handleError(e, vm, "data()");
  8215. return {}
  8216. } finally {
  8217. popTarget();
  8218. }
  8219. }
  8220. var computedWatcherOptions = { lazy: true };
  8221. function initComputed (vm, computed) {
  8222. // $flow-disable-line
  8223. var watchers = vm._computedWatchers = Object.create(null);
  8224. // computed properties are just getters during SSR
  8225. var isSSR = isServerRendering();
  8226. for (var key in computed) {
  8227. var userDef = computed[key];
  8228. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  8229. if ( true && getter == null) {
  8230. warn(
  8231. ("Getter is missing for computed property \"" + key + "\"."),
  8232. vm
  8233. );
  8234. }
  8235. if (!isSSR) {
  8236. // create internal watcher for the computed property.
  8237. watchers[key] = new Watcher(
  8238. vm,
  8239. getter || noop,
  8240. noop,
  8241. computedWatcherOptions
  8242. );
  8243. }
  8244. // component-defined computed properties are already defined on the
  8245. // component prototype. We only need to define computed properties defined
  8246. // at instantiation here.
  8247. if (!(key in vm)) {
  8248. defineComputed(vm, key, userDef);
  8249. } else if (true) {
  8250. if (key in vm.$data) {
  8251. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  8252. } else if (vm.$options.props && key in vm.$options.props) {
  8253. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  8254. }
  8255. }
  8256. }
  8257. }
  8258. function defineComputed (
  8259. target,
  8260. key,
  8261. userDef
  8262. ) {
  8263. var shouldCache = !isServerRendering();
  8264. if (typeof userDef === 'function') {
  8265. sharedPropertyDefinition.get = shouldCache
  8266. ? createComputedGetter(key)
  8267. : createGetterInvoker(userDef);
  8268. sharedPropertyDefinition.set = noop;
  8269. } else {
  8270. sharedPropertyDefinition.get = userDef.get
  8271. ? shouldCache && userDef.cache !== false
  8272. ? createComputedGetter(key)
  8273. : createGetterInvoker(userDef.get)
  8274. : noop;
  8275. sharedPropertyDefinition.set = userDef.set || noop;
  8276. }
  8277. if ( true &&
  8278. sharedPropertyDefinition.set === noop) {
  8279. sharedPropertyDefinition.set = function () {
  8280. warn(
  8281. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  8282. this
  8283. );
  8284. };
  8285. }
  8286. Object.defineProperty(target, key, sharedPropertyDefinition);
  8287. }
  8288. function createComputedGetter (key) {
  8289. return function computedGetter () {
  8290. var watcher = this._computedWatchers && this._computedWatchers[key];
  8291. if (watcher) {
  8292. if (watcher.dirty) {
  8293. watcher.evaluate();
  8294. }
  8295. if (Dep.SharedObject.target) {// fixed by xxxxxx
  8296. watcher.depend();
  8297. }
  8298. return watcher.value
  8299. }
  8300. }
  8301. }
  8302. function createGetterInvoker(fn) {
  8303. return function computedGetter () {
  8304. return fn.call(this, this)
  8305. }
  8306. }
  8307. function initMethods (vm, methods) {
  8308. var props = vm.$options.props;
  8309. for (var key in methods) {
  8310. if (true) {
  8311. if (typeof methods[key] !== 'function') {
  8312. warn(
  8313. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  8314. "Did you reference the function correctly?",
  8315. vm
  8316. );
  8317. }
  8318. if (props && hasOwn(props, key)) {
  8319. warn(
  8320. ("Method \"" + key + "\" has already been defined as a prop."),
  8321. vm
  8322. );
  8323. }
  8324. if ((key in vm) && isReserved(key)) {
  8325. warn(
  8326. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  8327. "Avoid defining component methods that start with _ or $."
  8328. );
  8329. }
  8330. }
  8331. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  8332. }
  8333. }
  8334. function initWatch (vm, watch) {
  8335. for (var key in watch) {
  8336. var handler = watch[key];
  8337. if (Array.isArray(handler)) {
  8338. for (var i = 0; i < handler.length; i++) {
  8339. createWatcher(vm, key, handler[i]);
  8340. }
  8341. } else {
  8342. createWatcher(vm, key, handler);
  8343. }
  8344. }
  8345. }
  8346. function createWatcher (
  8347. vm,
  8348. expOrFn,
  8349. handler,
  8350. options
  8351. ) {
  8352. if (isPlainObject(handler)) {
  8353. options = handler;
  8354. handler = handler.handler;
  8355. }
  8356. if (typeof handler === 'string') {
  8357. handler = vm[handler];
  8358. }
  8359. return vm.$watch(expOrFn, handler, options)
  8360. }
  8361. function stateMixin (Vue) {
  8362. // flow somehow has problems with directly declared definition object
  8363. // when using Object.defineProperty, so we have to procedurally build up
  8364. // the object here.
  8365. var dataDef = {};
  8366. dataDef.get = function () { return this._data };
  8367. var propsDef = {};
  8368. propsDef.get = function () { return this._props };
  8369. if (true) {
  8370. dataDef.set = function () {
  8371. warn(
  8372. 'Avoid replacing instance root $data. ' +
  8373. 'Use nested data properties instead.',
  8374. this
  8375. );
  8376. };
  8377. propsDef.set = function () {
  8378. warn("$props is readonly.", this);
  8379. };
  8380. }
  8381. Object.defineProperty(Vue.prototype, '$data', dataDef);
  8382. Object.defineProperty(Vue.prototype, '$props', propsDef);
  8383. Vue.prototype.$set = set;
  8384. Vue.prototype.$delete = del;
  8385. Vue.prototype.$watch = function (
  8386. expOrFn,
  8387. cb,
  8388. options
  8389. ) {
  8390. var vm = this;
  8391. if (isPlainObject(cb)) {
  8392. return createWatcher(vm, expOrFn, cb, options)
  8393. }
  8394. options = options || {};
  8395. options.user = true;
  8396. var watcher = new Watcher(vm, expOrFn, cb, options);
  8397. if (options.immediate) {
  8398. try {
  8399. cb.call(vm, watcher.value);
  8400. } catch (error) {
  8401. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  8402. }
  8403. }
  8404. return function unwatchFn () {
  8405. watcher.teardown();
  8406. }
  8407. };
  8408. }
  8409. /* */
  8410. var uid$3 = 0;
  8411. function initMixin (Vue) {
  8412. Vue.prototype._init = function (options) {
  8413. var vm = this;
  8414. // a uid
  8415. vm._uid = uid$3++;
  8416. var startTag, endTag;
  8417. /* istanbul ignore if */
  8418. if ( true && config.performance && mark) {
  8419. startTag = "vue-perf-start:" + (vm._uid);
  8420. endTag = "vue-perf-end:" + (vm._uid);
  8421. mark(startTag);
  8422. }
  8423. // a flag to avoid this being observed
  8424. vm._isVue = true;
  8425. // merge options
  8426. if (options && options._isComponent) {
  8427. // optimize internal component instantiation
  8428. // since dynamic options merging is pretty slow, and none of the
  8429. // internal component options needs special treatment.
  8430. initInternalComponent(vm, options);
  8431. } else {
  8432. vm.$options = mergeOptions(
  8433. resolveConstructorOptions(vm.constructor),
  8434. options || {},
  8435. vm
  8436. );
  8437. }
  8438. /* istanbul ignore else */
  8439. if (true) {
  8440. initProxy(vm);
  8441. } else {}
  8442. // expose real self
  8443. vm._self = vm;
  8444. initLifecycle(vm);
  8445. initEvents(vm);
  8446. initRender(vm);
  8447. callHook(vm, 'beforeCreate');
  8448. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  8449. initState(vm);
  8450. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  8451. !vm._$fallback && callHook(vm, 'created');
  8452. /* istanbul ignore if */
  8453. if ( true && config.performance && mark) {
  8454. vm._name = formatComponentName(vm, false);
  8455. mark(endTag);
  8456. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  8457. }
  8458. if (vm.$options.el) {
  8459. vm.$mount(vm.$options.el);
  8460. }
  8461. };
  8462. }
  8463. function initInternalComponent (vm, options) {
  8464. var opts = vm.$options = Object.create(vm.constructor.options);
  8465. // doing this because it's faster than dynamic enumeration.
  8466. var parentVnode = options._parentVnode;
  8467. opts.parent = options.parent;
  8468. opts._parentVnode = parentVnode;
  8469. var vnodeComponentOptions = parentVnode.componentOptions;
  8470. opts.propsData = vnodeComponentOptions.propsData;
  8471. opts._parentListeners = vnodeComponentOptions.listeners;
  8472. opts._renderChildren = vnodeComponentOptions.children;
  8473. opts._componentTag = vnodeComponentOptions.tag;
  8474. if (options.render) {
  8475. opts.render = options.render;
  8476. opts.staticRenderFns = options.staticRenderFns;
  8477. }
  8478. }
  8479. function resolveConstructorOptions (Ctor) {
  8480. var options = Ctor.options;
  8481. if (Ctor.super) {
  8482. var superOptions = resolveConstructorOptions(Ctor.super);
  8483. var cachedSuperOptions = Ctor.superOptions;
  8484. if (superOptions !== cachedSuperOptions) {
  8485. // super option changed,
  8486. // need to resolve new options.
  8487. Ctor.superOptions = superOptions;
  8488. // check if there are any late-modified/attached options (#4976)
  8489. var modifiedOptions = resolveModifiedOptions(Ctor);
  8490. // update base extend options
  8491. if (modifiedOptions) {
  8492. extend(Ctor.extendOptions, modifiedOptions);
  8493. }
  8494. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  8495. if (options.name) {
  8496. options.components[options.name] = Ctor;
  8497. }
  8498. }
  8499. }
  8500. return options
  8501. }
  8502. function resolveModifiedOptions (Ctor) {
  8503. var modified;
  8504. var latest = Ctor.options;
  8505. var sealed = Ctor.sealedOptions;
  8506. for (var key in latest) {
  8507. if (latest[key] !== sealed[key]) {
  8508. if (!modified) { modified = {}; }
  8509. modified[key] = latest[key];
  8510. }
  8511. }
  8512. return modified
  8513. }
  8514. function Vue (options) {
  8515. if ( true &&
  8516. !(this instanceof Vue)
  8517. ) {
  8518. warn('Vue is a constructor and should be called with the `new` keyword');
  8519. }
  8520. this._init(options);
  8521. }
  8522. initMixin(Vue);
  8523. stateMixin(Vue);
  8524. eventsMixin(Vue);
  8525. lifecycleMixin(Vue);
  8526. renderMixin(Vue);
  8527. /* */
  8528. function initUse (Vue) {
  8529. Vue.use = function (plugin) {
  8530. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  8531. if (installedPlugins.indexOf(plugin) > -1) {
  8532. return this
  8533. }
  8534. // additional parameters
  8535. var args = toArray(arguments, 1);
  8536. args.unshift(this);
  8537. if (typeof plugin.install === 'function') {
  8538. plugin.install.apply(plugin, args);
  8539. } else if (typeof plugin === 'function') {
  8540. plugin.apply(null, args);
  8541. }
  8542. installedPlugins.push(plugin);
  8543. return this
  8544. };
  8545. }
  8546. /* */
  8547. function initMixin$1 (Vue) {
  8548. Vue.mixin = function (mixin) {
  8549. this.options = mergeOptions(this.options, mixin);
  8550. return this
  8551. };
  8552. }
  8553. /* */
  8554. function initExtend (Vue) {
  8555. /**
  8556. * Each instance constructor, including Vue, has a unique
  8557. * cid. This enables us to create wrapped "child
  8558. * constructors" for prototypal inheritance and cache them.
  8559. */
  8560. Vue.cid = 0;
  8561. var cid = 1;
  8562. /**
  8563. * Class inheritance
  8564. */
  8565. Vue.extend = function (extendOptions) {
  8566. extendOptions = extendOptions || {};
  8567. var Super = this;
  8568. var SuperId = Super.cid;
  8569. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  8570. if (cachedCtors[SuperId]) {
  8571. return cachedCtors[SuperId]
  8572. }
  8573. var name = extendOptions.name || Super.options.name;
  8574. if ( true && name) {
  8575. validateComponentName(name);
  8576. }
  8577. var Sub = function VueComponent (options) {
  8578. this._init(options);
  8579. };
  8580. Sub.prototype = Object.create(Super.prototype);
  8581. Sub.prototype.constructor = Sub;
  8582. Sub.cid = cid++;
  8583. Sub.options = mergeOptions(
  8584. Super.options,
  8585. extendOptions
  8586. );
  8587. Sub['super'] = Super;
  8588. // For props and computed properties, we define the proxy getters on
  8589. // the Vue instances at extension time, on the extended prototype. This
  8590. // avoids Object.defineProperty calls for each instance created.
  8591. if (Sub.options.props) {
  8592. initProps$1(Sub);
  8593. }
  8594. if (Sub.options.computed) {
  8595. initComputed$1(Sub);
  8596. }
  8597. // allow further extension/mixin/plugin usage
  8598. Sub.extend = Super.extend;
  8599. Sub.mixin = Super.mixin;
  8600. Sub.use = Super.use;
  8601. // create asset registers, so extended classes
  8602. // can have their private assets too.
  8603. ASSET_TYPES.forEach(function (type) {
  8604. Sub[type] = Super[type];
  8605. });
  8606. // enable recursive self-lookup
  8607. if (name) {
  8608. Sub.options.components[name] = Sub;
  8609. }
  8610. // keep a reference to the super options at extension time.
  8611. // later at instantiation we can check if Super's options have
  8612. // been updated.
  8613. Sub.superOptions = Super.options;
  8614. Sub.extendOptions = extendOptions;
  8615. Sub.sealedOptions = extend({}, Sub.options);
  8616. // cache constructor
  8617. cachedCtors[SuperId] = Sub;
  8618. return Sub
  8619. };
  8620. }
  8621. function initProps$1 (Comp) {
  8622. var props = Comp.options.props;
  8623. for (var key in props) {
  8624. proxy(Comp.prototype, "_props", key);
  8625. }
  8626. }
  8627. function initComputed$1 (Comp) {
  8628. var computed = Comp.options.computed;
  8629. for (var key in computed) {
  8630. defineComputed(Comp.prototype, key, computed[key]);
  8631. }
  8632. }
  8633. /* */
  8634. function initAssetRegisters (Vue) {
  8635. /**
  8636. * Create asset registration methods.
  8637. */
  8638. ASSET_TYPES.forEach(function (type) {
  8639. Vue[type] = function (
  8640. id,
  8641. definition
  8642. ) {
  8643. if (!definition) {
  8644. return this.options[type + 's'][id]
  8645. } else {
  8646. /* istanbul ignore if */
  8647. if ( true && type === 'component') {
  8648. validateComponentName(id);
  8649. }
  8650. if (type === 'component' && isPlainObject(definition)) {
  8651. definition.name = definition.name || id;
  8652. definition = this.options._base.extend(definition);
  8653. }
  8654. if (type === 'directive' && typeof definition === 'function') {
  8655. definition = { bind: definition, update: definition };
  8656. }
  8657. this.options[type + 's'][id] = definition;
  8658. return definition
  8659. }
  8660. };
  8661. });
  8662. }
  8663. /* */
  8664. function getComponentName (opts) {
  8665. return opts && (opts.Ctor.options.name || opts.tag)
  8666. }
  8667. function matches (pattern, name) {
  8668. if (Array.isArray(pattern)) {
  8669. return pattern.indexOf(name) > -1
  8670. } else if (typeof pattern === 'string') {
  8671. return pattern.split(',').indexOf(name) > -1
  8672. } else if (isRegExp(pattern)) {
  8673. return pattern.test(name)
  8674. }
  8675. /* istanbul ignore next */
  8676. return false
  8677. }
  8678. function pruneCache (keepAliveInstance, filter) {
  8679. var cache = keepAliveInstance.cache;
  8680. var keys = keepAliveInstance.keys;
  8681. var _vnode = keepAliveInstance._vnode;
  8682. for (var key in cache) {
  8683. var cachedNode = cache[key];
  8684. if (cachedNode) {
  8685. var name = getComponentName(cachedNode.componentOptions);
  8686. if (name && !filter(name)) {
  8687. pruneCacheEntry(cache, key, keys, _vnode);
  8688. }
  8689. }
  8690. }
  8691. }
  8692. function pruneCacheEntry (
  8693. cache,
  8694. key,
  8695. keys,
  8696. current
  8697. ) {
  8698. var cached$$1 = cache[key];
  8699. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  8700. cached$$1.componentInstance.$destroy();
  8701. }
  8702. cache[key] = null;
  8703. remove(keys, key);
  8704. }
  8705. var patternTypes = [String, RegExp, Array];
  8706. var KeepAlive = {
  8707. name: 'keep-alive',
  8708. abstract: true,
  8709. props: {
  8710. include: patternTypes,
  8711. exclude: patternTypes,
  8712. max: [String, Number]
  8713. },
  8714. created: function created () {
  8715. this.cache = Object.create(null);
  8716. this.keys = [];
  8717. },
  8718. destroyed: function destroyed () {
  8719. for (var key in this.cache) {
  8720. pruneCacheEntry(this.cache, key, this.keys);
  8721. }
  8722. },
  8723. mounted: function mounted () {
  8724. var this$1 = this;
  8725. this.$watch('include', function (val) {
  8726. pruneCache(this$1, function (name) { return matches(val, name); });
  8727. });
  8728. this.$watch('exclude', function (val) {
  8729. pruneCache(this$1, function (name) { return !matches(val, name); });
  8730. });
  8731. },
  8732. render: function render () {
  8733. var slot = this.$slots.default;
  8734. var vnode = getFirstComponentChild(slot);
  8735. var componentOptions = vnode && vnode.componentOptions;
  8736. if (componentOptions) {
  8737. // check pattern
  8738. var name = getComponentName(componentOptions);
  8739. var ref = this;
  8740. var include = ref.include;
  8741. var exclude = ref.exclude;
  8742. if (
  8743. // not included
  8744. (include && (!name || !matches(include, name))) ||
  8745. // excluded
  8746. (exclude && name && matches(exclude, name))
  8747. ) {
  8748. return vnode
  8749. }
  8750. var ref$1 = this;
  8751. var cache = ref$1.cache;
  8752. var keys = ref$1.keys;
  8753. var key = vnode.key == null
  8754. // same constructor may get registered as different local components
  8755. // so cid alone is not enough (#3269)
  8756. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  8757. : vnode.key;
  8758. if (cache[key]) {
  8759. vnode.componentInstance = cache[key].componentInstance;
  8760. // make current key freshest
  8761. remove(keys, key);
  8762. keys.push(key);
  8763. } else {
  8764. cache[key] = vnode;
  8765. keys.push(key);
  8766. // prune oldest entry
  8767. if (this.max && keys.length > parseInt(this.max)) {
  8768. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  8769. }
  8770. }
  8771. vnode.data.keepAlive = true;
  8772. }
  8773. return vnode || (slot && slot[0])
  8774. }
  8775. };
  8776. var builtInComponents = {
  8777. KeepAlive: KeepAlive
  8778. };
  8779. /* */
  8780. function initGlobalAPI (Vue) {
  8781. // config
  8782. var configDef = {};
  8783. configDef.get = function () { return config; };
  8784. if (true) {
  8785. configDef.set = function () {
  8786. warn(
  8787. 'Do not replace the Vue.config object, set individual fields instead.'
  8788. );
  8789. };
  8790. }
  8791. Object.defineProperty(Vue, 'config', configDef);
  8792. // exposed util methods.
  8793. // NOTE: these are not considered part of the public API - avoid relying on
  8794. // them unless you are aware of the risk.
  8795. Vue.util = {
  8796. warn: warn,
  8797. extend: extend,
  8798. mergeOptions: mergeOptions,
  8799. defineReactive: defineReactive$$1
  8800. };
  8801. Vue.set = set;
  8802. Vue.delete = del;
  8803. Vue.nextTick = nextTick;
  8804. // 2.6 explicit observable API
  8805. Vue.observable = function (obj) {
  8806. observe(obj);
  8807. return obj
  8808. };
  8809. Vue.options = Object.create(null);
  8810. ASSET_TYPES.forEach(function (type) {
  8811. Vue.options[type + 's'] = Object.create(null);
  8812. });
  8813. // this is used to identify the "base" constructor to extend all plain-object
  8814. // components with in Weex's multi-instance scenarios.
  8815. Vue.options._base = Vue;
  8816. extend(Vue.options.components, builtInComponents);
  8817. initUse(Vue);
  8818. initMixin$1(Vue);
  8819. initExtend(Vue);
  8820. initAssetRegisters(Vue);
  8821. }
  8822. initGlobalAPI(Vue);
  8823. Object.defineProperty(Vue.prototype, '$isServer', {
  8824. get: isServerRendering
  8825. });
  8826. Object.defineProperty(Vue.prototype, '$ssrContext', {
  8827. get: function get () {
  8828. /* istanbul ignore next */
  8829. return this.$vnode && this.$vnode.ssrContext
  8830. }
  8831. });
  8832. // expose FunctionalRenderContext for ssr runtime helper installation
  8833. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  8834. value: FunctionalRenderContext
  8835. });
  8836. Vue.version = '2.6.11';
  8837. /**
  8838. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  8839. */
  8840. var ARRAYTYPE = '[object Array]';
  8841. var OBJECTTYPE = '[object Object]';
  8842. // const FUNCTIONTYPE = '[object Function]'
  8843. function diff(current, pre) {
  8844. var result = {};
  8845. syncKeys(current, pre);
  8846. _diff(current, pre, '', result);
  8847. return result
  8848. }
  8849. function syncKeys(current, pre) {
  8850. if (current === pre) { return }
  8851. var rootCurrentType = type(current);
  8852. var rootPreType = type(pre);
  8853. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  8854. if(Object.keys(current).length >= Object.keys(pre).length){
  8855. for (var key in pre) {
  8856. var currentValue = current[key];
  8857. if (currentValue === undefined) {
  8858. current[key] = null;
  8859. } else {
  8860. syncKeys(currentValue, pre[key]);
  8861. }
  8862. }
  8863. }
  8864. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  8865. if (current.length >= pre.length) {
  8866. pre.forEach(function (item, index) {
  8867. syncKeys(current[index], item);
  8868. });
  8869. }
  8870. }
  8871. }
  8872. function _diff(current, pre, path, result) {
  8873. if (current === pre) { return }
  8874. var rootCurrentType = type(current);
  8875. var rootPreType = type(pre);
  8876. if (rootCurrentType == OBJECTTYPE) {
  8877. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  8878. setResult(result, path, current);
  8879. } else {
  8880. var loop = function ( key ) {
  8881. var currentValue = current[key];
  8882. var preValue = pre[key];
  8883. var currentType = type(currentValue);
  8884. var preType = type(preValue);
  8885. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  8886. if (currentValue != pre[key]) {
  8887. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8888. }
  8889. } else if (currentType == ARRAYTYPE) {
  8890. if (preType != ARRAYTYPE) {
  8891. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8892. } else {
  8893. if (currentValue.length < preValue.length) {
  8894. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8895. } else {
  8896. currentValue.forEach(function (item, index) {
  8897. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  8898. });
  8899. }
  8900. }
  8901. } else if (currentType == OBJECTTYPE) {
  8902. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  8903. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  8904. } else {
  8905. for (var subKey in currentValue) {
  8906. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  8907. }
  8908. }
  8909. }
  8910. };
  8911. for (var key in current) loop( key );
  8912. }
  8913. } else if (rootCurrentType == ARRAYTYPE) {
  8914. if (rootPreType != ARRAYTYPE) {
  8915. setResult(result, path, current);
  8916. } else {
  8917. if (current.length < pre.length) {
  8918. setResult(result, path, current);
  8919. } else {
  8920. current.forEach(function (item, index) {
  8921. _diff(item, pre[index], path + '[' + index + ']', result);
  8922. });
  8923. }
  8924. }
  8925. } else {
  8926. setResult(result, path, current);
  8927. }
  8928. }
  8929. function setResult(result, k, v) {
  8930. // if (type(v) != FUNCTIONTYPE) {
  8931. result[k] = v;
  8932. // }
  8933. }
  8934. function type(obj) {
  8935. return Object.prototype.toString.call(obj)
  8936. }
  8937. /* */
  8938. function flushCallbacks$1(vm) {
  8939. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  8940. if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  8941. var mpInstance = vm.$scope;
  8942. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8943. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  8944. }
  8945. var copies = vm.__next_tick_callbacks.slice(0);
  8946. vm.__next_tick_callbacks.length = 0;
  8947. for (var i = 0; i < copies.length; i++) {
  8948. copies[i]();
  8949. }
  8950. }
  8951. }
  8952. function hasRenderWatcher(vm) {
  8953. return queue.find(function (watcher) { return vm._watcher === watcher; })
  8954. }
  8955. function nextTick$1(vm, cb) {
  8956. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  8957. //2.nextTick 之前存在 render watcher
  8958. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  8959. if(Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  8960. var mpInstance = vm.$scope;
  8961. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  8962. ']:nextVueTick');
  8963. }
  8964. return nextTick(cb, vm)
  8965. }else{
  8966. if(Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG){
  8967. var mpInstance$1 = vm.$scope;
  8968. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  8969. ']:nextMPTick');
  8970. }
  8971. }
  8972. var _resolve;
  8973. if (!vm.__next_tick_callbacks) {
  8974. vm.__next_tick_callbacks = [];
  8975. }
  8976. vm.__next_tick_callbacks.push(function () {
  8977. if (cb) {
  8978. try {
  8979. cb.call(vm);
  8980. } catch (e) {
  8981. handleError(e, vm, 'nextTick');
  8982. }
  8983. } else if (_resolve) {
  8984. _resolve(vm);
  8985. }
  8986. });
  8987. // $flow-disable-line
  8988. if (!cb && typeof Promise !== 'undefined') {
  8989. return new Promise(function (resolve) {
  8990. _resolve = resolve;
  8991. })
  8992. }
  8993. }
  8994. /* */
  8995. function cloneWithData(vm) {
  8996. // 确保当前 vm 所有数据被同步
  8997. var ret = Object.create(null);
  8998. var dataKeys = [].concat(
  8999. Object.keys(vm._data || {}),
  9000. Object.keys(vm._computedWatchers || {}));
  9001. dataKeys.reduce(function(ret, key) {
  9002. ret[key] = vm[key];
  9003. return ret
  9004. }, ret);
  9005. // vue-composition-api
  9006. var rawBindings = vm.__secret_vfa_state__ && vm.__secret_vfa_state__.rawBindings;
  9007. if (rawBindings) {
  9008. Object.keys(rawBindings).forEach(function (key) {
  9009. ret[key] = vm[key];
  9010. });
  9011. }
  9012. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  9013. Object.assign(ret, vm.$mp.data || {});
  9014. if (
  9015. Array.isArray(vm.$options.behaviors) &&
  9016. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  9017. ) { //form-field
  9018. ret['name'] = vm.name;
  9019. ret['value'] = vm.value;
  9020. }
  9021. return JSON.parse(JSON.stringify(ret))
  9022. }
  9023. var patch = function(oldVnode, vnode) {
  9024. var this$1 = this;
  9025. if (vnode === null) { //destroy
  9026. return
  9027. }
  9028. if (this.mpType === 'page' || this.mpType === 'component') {
  9029. var mpInstance = this.$scope;
  9030. var data = Object.create(null);
  9031. try {
  9032. data = cloneWithData(this);
  9033. } catch (err) {
  9034. console.error(err);
  9035. }
  9036. data.__webviewId__ = mpInstance.data.__webviewId__;
  9037. var mpData = Object.create(null);
  9038. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  9039. mpData[key] = mpInstance.data[key];
  9040. });
  9041. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  9042. if (Object.keys(diffData).length) {
  9043. if (Object({"NODE_ENV":"development","VUE_APP_PLATFORM":"mp-weixin","BASE_URL":"/"}).VUE_APP_DEBUG) {
  9044. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  9045. ']差量更新',
  9046. JSON.stringify(diffData));
  9047. }
  9048. this.__next_tick_pending = true;
  9049. mpInstance.setData(diffData, function () {
  9050. this$1.__next_tick_pending = false;
  9051. flushCallbacks$1(this$1);
  9052. });
  9053. } else {
  9054. flushCallbacks$1(this);
  9055. }
  9056. }
  9057. };
  9058. /* */
  9059. function createEmptyRender() {
  9060. }
  9061. function mountComponent$1(
  9062. vm,
  9063. el,
  9064. hydrating
  9065. ) {
  9066. if (!vm.mpType) {//main.js 中的 new Vue
  9067. return vm
  9068. }
  9069. if (vm.mpType === 'app') {
  9070. vm.$options.render = createEmptyRender;
  9071. }
  9072. if (!vm.$options.render) {
  9073. vm.$options.render = createEmptyRender;
  9074. if (true) {
  9075. /* istanbul ignore if */
  9076. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  9077. vm.$options.el || el) {
  9078. warn(
  9079. 'You are using the runtime-only build of Vue where the template ' +
  9080. 'compiler is not available. Either pre-compile the templates into ' +
  9081. 'render functions, or use the compiler-included build.',
  9082. vm
  9083. );
  9084. } else {
  9085. warn(
  9086. 'Failed to mount component: template or render function not defined.',
  9087. vm
  9088. );
  9089. }
  9090. }
  9091. }
  9092. !vm._$fallback && callHook(vm, 'beforeMount');
  9093. var updateComponent = function () {
  9094. vm._update(vm._render(), hydrating);
  9095. };
  9096. // we set this to vm._watcher inside the watcher's constructor
  9097. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  9098. // component's mounted hook), which relies on vm._watcher being already defined
  9099. new Watcher(vm, updateComponent, noop, {
  9100. before: function before() {
  9101. if (vm._isMounted && !vm._isDestroyed) {
  9102. callHook(vm, 'beforeUpdate');
  9103. }
  9104. }
  9105. }, true /* isRenderWatcher */);
  9106. hydrating = false;
  9107. return vm
  9108. }
  9109. /* */
  9110. function renderClass (
  9111. staticClass,
  9112. dynamicClass
  9113. ) {
  9114. if (isDef(staticClass) || isDef(dynamicClass)) {
  9115. return concat(staticClass, stringifyClass(dynamicClass))
  9116. }
  9117. /* istanbul ignore next */
  9118. return ''
  9119. }
  9120. function concat (a, b) {
  9121. return a ? b ? (a + ' ' + b) : a : (b || '')
  9122. }
  9123. function stringifyClass (value) {
  9124. if (Array.isArray(value)) {
  9125. return stringifyArray(value)
  9126. }
  9127. if (isObject(value)) {
  9128. return stringifyObject(value)
  9129. }
  9130. if (typeof value === 'string') {
  9131. return value
  9132. }
  9133. /* istanbul ignore next */
  9134. return ''
  9135. }
  9136. function stringifyArray (value) {
  9137. var res = '';
  9138. var stringified;
  9139. for (var i = 0, l = value.length; i < l; i++) {
  9140. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  9141. if (res) { res += ' '; }
  9142. res += stringified;
  9143. }
  9144. }
  9145. return res
  9146. }
  9147. function stringifyObject (value) {
  9148. var res = '';
  9149. for (var key in value) {
  9150. if (value[key]) {
  9151. if (res) { res += ' '; }
  9152. res += key;
  9153. }
  9154. }
  9155. return res
  9156. }
  9157. /* */
  9158. var parseStyleText = cached(function (cssText) {
  9159. var res = {};
  9160. var listDelimiter = /;(?![^(]*\))/g;
  9161. var propertyDelimiter = /:(.+)/;
  9162. cssText.split(listDelimiter).forEach(function (item) {
  9163. if (item) {
  9164. var tmp = item.split(propertyDelimiter);
  9165. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  9166. }
  9167. });
  9168. return res
  9169. });
  9170. // normalize possible array / string values into Object
  9171. function normalizeStyleBinding (bindingStyle) {
  9172. if (Array.isArray(bindingStyle)) {
  9173. return toObject(bindingStyle)
  9174. }
  9175. if (typeof bindingStyle === 'string') {
  9176. return parseStyleText(bindingStyle)
  9177. }
  9178. return bindingStyle
  9179. }
  9180. /* */
  9181. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  9182. function getTarget(obj, path) {
  9183. var parts = path.split('.');
  9184. var key = parts[0];
  9185. if (key.indexOf('__$n') === 0) { //number index
  9186. key = parseInt(key.replace('__$n', ''));
  9187. }
  9188. if (parts.length === 1) {
  9189. return obj[key]
  9190. }
  9191. return getTarget(obj[key], parts.slice(1).join('.'))
  9192. }
  9193. function internalMixin(Vue) {
  9194. Vue.config.errorHandler = function(err, vm, info) {
  9195. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  9196. console.error(err);
  9197. /* eslint-disable no-undef */
  9198. var app = getApp();
  9199. if (app && app.onError) {
  9200. app.onError(err);
  9201. }
  9202. };
  9203. var oldEmit = Vue.prototype.$emit;
  9204. Vue.prototype.$emit = function(event) {
  9205. if (this.$scope && event) {
  9206. this.$scope['triggerEvent'](event, {
  9207. __args__: toArray(arguments, 1)
  9208. });
  9209. }
  9210. return oldEmit.apply(this, arguments)
  9211. };
  9212. Vue.prototype.$nextTick = function(fn) {
  9213. return nextTick$1(this, fn)
  9214. };
  9215. MP_METHODS.forEach(function (method) {
  9216. Vue.prototype[method] = function(args) {
  9217. if (this.$scope && this.$scope[method]) {
  9218. return this.$scope[method](args)
  9219. }
  9220. // mp-alipay
  9221. if (typeof my === 'undefined') {
  9222. return
  9223. }
  9224. if (method === 'createSelectorQuery') {
  9225. /* eslint-disable no-undef */
  9226. return my.createSelectorQuery(args)
  9227. } else if (method === 'createIntersectionObserver') {
  9228. /* eslint-disable no-undef */
  9229. return my.createIntersectionObserver(args)
  9230. }
  9231. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  9232. };
  9233. });
  9234. Vue.prototype.__init_provide = initProvide;
  9235. Vue.prototype.__init_injections = initInjections;
  9236. Vue.prototype.__call_hook = function(hook, args) {
  9237. var vm = this;
  9238. // #7573 disable dep collection when invoking lifecycle hooks
  9239. pushTarget();
  9240. var handlers = vm.$options[hook];
  9241. var info = hook + " hook";
  9242. var ret;
  9243. if (handlers) {
  9244. for (var i = 0, j = handlers.length; i < j; i++) {
  9245. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  9246. }
  9247. }
  9248. if (vm._hasHookEvent) {
  9249. vm.$emit('hook:' + hook, args);
  9250. }
  9251. popTarget();
  9252. return ret
  9253. };
  9254. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  9255. if (Array.isArray(modifiers)) {
  9256. if (modifiers.indexOf('trim') !== -1) {
  9257. value = value.trim();
  9258. }
  9259. if (modifiers.indexOf('number') !== -1) {
  9260. value = this._n(value);
  9261. }
  9262. }
  9263. if (!target) {
  9264. target = this;
  9265. }
  9266. target[key] = value;
  9267. };
  9268. Vue.prototype.__set_sync = function(target, key, value) {
  9269. if (!target) {
  9270. target = this;
  9271. }
  9272. target[key] = value;
  9273. };
  9274. Vue.prototype.__get_orig = function(item) {
  9275. if (isPlainObject(item)) {
  9276. return item['$orig'] || item
  9277. }
  9278. return item
  9279. };
  9280. Vue.prototype.__get_value = function(dataPath, target) {
  9281. return getTarget(target || this, dataPath)
  9282. };
  9283. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  9284. return renderClass(staticClass, dynamicClass)
  9285. };
  9286. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  9287. if (!dynamicStyle && !staticStyle) {
  9288. return ''
  9289. }
  9290. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  9291. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  9292. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  9293. };
  9294. Vue.prototype.__map = function(val, iteratee) {
  9295. //TODO 暂不考虑 string
  9296. var ret, i, l, keys, key;
  9297. if (Array.isArray(val)) {
  9298. ret = new Array(val.length);
  9299. for (i = 0, l = val.length; i < l; i++) {
  9300. ret[i] = iteratee(val[i], i);
  9301. }
  9302. return ret
  9303. } else if (isObject(val)) {
  9304. keys = Object.keys(val);
  9305. ret = Object.create(null);
  9306. for (i = 0, l = keys.length; i < l; i++) {
  9307. key = keys[i];
  9308. ret[key] = iteratee(val[key], key, i);
  9309. }
  9310. return ret
  9311. } else if (typeof val === 'number') {
  9312. ret = new Array(val);
  9313. for (i = 0, l = val; i < l; i++) {
  9314. // 第一个参数暂时仍和小程序一致
  9315. ret[i] = iteratee(i, i);
  9316. }
  9317. return ret
  9318. }
  9319. return []
  9320. };
  9321. }
  9322. /* */
  9323. var LIFECYCLE_HOOKS$1 = [
  9324. //App
  9325. 'onLaunch',
  9326. 'onShow',
  9327. 'onHide',
  9328. 'onUniNViewMessage',
  9329. 'onPageNotFound',
  9330. 'onThemeChange',
  9331. 'onError',
  9332. 'onUnhandledRejection',
  9333. //Page
  9334. 'onLoad',
  9335. // 'onShow',
  9336. 'onReady',
  9337. // 'onHide',
  9338. 'onUnload',
  9339. 'onPullDownRefresh',
  9340. 'onReachBottom',
  9341. 'onTabItemTap',
  9342. 'onAddToFavorites',
  9343. 'onShareTimeline',
  9344. 'onShareAppMessage',
  9345. 'onResize',
  9346. 'onPageScroll',
  9347. 'onNavigationBarButtonTap',
  9348. 'onBackPress',
  9349. 'onNavigationBarSearchInputChanged',
  9350. 'onNavigationBarSearchInputConfirmed',
  9351. 'onNavigationBarSearchInputClicked',
  9352. //Component
  9353. // 'onReady', // 兼容旧版本,应该移除该事件
  9354. 'onPageShow',
  9355. 'onPageHide',
  9356. 'onPageResize'
  9357. ];
  9358. function lifecycleMixin$1(Vue) {
  9359. //fixed vue-class-component
  9360. var oldExtend = Vue.extend;
  9361. Vue.extend = function(extendOptions) {
  9362. extendOptions = extendOptions || {};
  9363. var methods = extendOptions.methods;
  9364. if (methods) {
  9365. Object.keys(methods).forEach(function (methodName) {
  9366. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  9367. extendOptions[methodName] = methods[methodName];
  9368. delete methods[methodName];
  9369. }
  9370. });
  9371. }
  9372. return oldExtend.call(this, extendOptions)
  9373. };
  9374. var strategies = Vue.config.optionMergeStrategies;
  9375. var mergeHook = strategies.created;
  9376. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  9377. strategies[hook] = mergeHook;
  9378. });
  9379. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  9380. }
  9381. /* */
  9382. // install platform patch function
  9383. Vue.prototype.__patch__ = patch;
  9384. // public mount method
  9385. Vue.prototype.$mount = function(
  9386. el ,
  9387. hydrating
  9388. ) {
  9389. return mountComponent$1(this, el, hydrating)
  9390. };
  9391. lifecycleMixin$1(Vue);
  9392. internalMixin(Vue);
  9393. /* */
  9394. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  9395. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  9396. /***/ }),
  9397. /***/ 20:
  9398. /*!******************************************************!*\
  9399. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/index.js ***!
  9400. \******************************************************/
  9401. /*! no static exports found */
  9402. /***/ (function(module, exports, __webpack_require__) {
  9403. "use strict";
  9404. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  9405. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 21));
  9406. var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 22));
  9407. var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 26));
  9408. var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 27));
  9409. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 28));
  9410. var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 29));
  9411. var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 30));
  9412. var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 31));
  9413. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 32));
  9414. var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 33));
  9415. var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 34));
  9416. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 24));
  9417. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 23));
  9418. var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 35));
  9419. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 25));
  9420. var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 36));
  9421. var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 37));
  9422. var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 38));
  9423. var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 39));
  9424. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 40));
  9425. var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 41);
  9426. var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 42));
  9427. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 43));
  9428. var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 44));
  9429. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 45));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // 引入全局mixin
  9430. // 引入关于是否mixin集成小程序分享的配置
  9431. // import wxshare from './libs/mixin/mpShare.js'
  9432. // 全局挂载引入http相关请求拦截插件
  9433. function wranning(str) {// 开发环境进行信息输出,主要是一些报错信息
  9434. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  9435. // https://uniapp.dcloud.io/frame?id=%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e5%92%8c%e7%94%9f%e4%ba%a7%e7%8e%af%e5%a2%83
  9436. if (true) {console.warn(str);}} // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
  9437. // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
  9438. // let vuexStore = {};
  9439. // try {
  9440. // vuexStore = require("@/store/$u.mixin.js");
  9441. // } catch (e) {
  9442. // //TODO handle the exception
  9443. // }
  9444. // post类型对象参数转为get类型url参数
  9445. var $u = { queryParams: _queryParams.default, route: _route.default, timeFormat: _timeFormat.default, date: _timeFormat.default, // 另名date
  9446. timeFrom: _timeFrom.default, colorGradient: _colorGradient.default.colorGradient, guid: _guid.default, color: _color.default, sys: _sys.sys, os: _sys.os, type2icon: _type2icon.default, randomArray: _randomArray.default, wranning: wranning, get: _request.default.get, post: _request.default.post,
  9447. put: _request.default.put,
  9448. 'delete': _request.default.delete,
  9449. hexToRgb: _colorGradient.default.hexToRgb,
  9450. rgbToHex: _colorGradient.default.rgbToHex,
  9451. test: _test.default,
  9452. random: _random.default,
  9453. deepClone: _deepClone.default,
  9454. deepMerge: _deepMerge.default,
  9455. getParent: _getParent.default,
  9456. $parent: _$parent.default,
  9457. addUnit: _addUnit.default,
  9458. trim: _trim.default,
  9459. type: ['primary', 'success', 'error', 'warning', 'info'],
  9460. http: _request.default,
  9461. toast: _toast.default,
  9462. config: _config.default, // uView配置信息相关,比如版本号
  9463. zIndex: _zIndex.default,
  9464. debounce: _debounce.default,
  9465. throttle: _throttle.default };
  9466. var install = function install(Vue) {
  9467. Vue.mixin(_mixin.default);
  9468. if (Vue.prototype.openShare) {
  9469. Vue.mixin(mpShare);
  9470. }
  9471. // Vue.mixin(vuexStore);
  9472. // 时间格式化,同时两个名称,date和timeFormat
  9473. Vue.filter('timeFormat', function (timestamp, format) {
  9474. return (0, _timeFormat.default)(timestamp, format);
  9475. });
  9476. Vue.filter('date', function (timestamp, format) {
  9477. return (0, _timeFormat.default)(timestamp, format);
  9478. });
  9479. // 将多久以前的方法,注入到全局过滤器
  9480. Vue.filter('timeFrom', function (timestamp, format) {
  9481. return (0, _timeFrom.default)(timestamp, format);
  9482. });
  9483. Vue.prototype.$u = $u;
  9484. };var _default =
  9485. {
  9486. install: install };exports.default = _default;
  9487. /***/ }),
  9488. /***/ 21:
  9489. /*!*****************************************************************!*\
  9490. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/mixin/mixin.js ***!
  9491. \*****************************************************************/
  9492. /*! no static exports found */
  9493. /***/ (function(module, exports, __webpack_require__) {
  9494. /* WEBPACK VAR INJECTION */(function(uni) {module.exports = {
  9495. data: function data() {
  9496. return {};
  9497. },
  9498. onLoad: function onLoad() {
  9499. // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  9500. this.$u.getRect = this.$uGetRect;
  9501. },
  9502. methods: {
  9503. // 查询节点信息
  9504. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  9505. // 解决办法为在组件根部再套一个没有任何作用的view元素
  9506. $uGetRect: function $uGetRect(selector, all) {var _this = this;
  9507. return new Promise(function (resolve) {
  9508. uni.createSelectorQuery().
  9509. in(_this)[all ? 'selectAll' : 'select'](selector).
  9510. boundingClientRect(function (rect) {
  9511. if (all && Array.isArray(rect) && rect.length) {
  9512. resolve(rect);
  9513. }
  9514. if (!all && rect) {
  9515. resolve(rect);
  9516. }
  9517. }).
  9518. exec();
  9519. });
  9520. },
  9521. getParentData: function getParentData() {var _this2 = this;var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  9522. // 避免在created中去定义parent变量
  9523. if (!this.parent) this.parent = false;
  9524. // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
  9525. // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
  9526. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  9527. this.parent = this.$u.$parent.call(this, parentName);
  9528. if (this.parent) {
  9529. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  9530. Object.keys(this.parentData).map(function (key) {
  9531. _this2.parentData[key] = _this2.parent[key];
  9532. });
  9533. }
  9534. } },
  9535. onReachBottom: function onReachBottom() {
  9536. uni.$emit('uOnReachBottom');
  9537. } };
  9538. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9539. /***/ }),
  9540. /***/ 22:
  9541. /*!*******************************************************************!*\
  9542. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/request/index.js ***!
  9543. \*******************************************************************/
  9544. /*! no static exports found */
  9545. /***/ (function(module, exports, __webpack_require__) {
  9546. "use strict";
  9547. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 23));
  9548. var _test = _interopRequireDefault(__webpack_require__(/*! ../function/test */ 25));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var
  9549. Request = /*#__PURE__*/function () {_createClass(Request, [{ key: "setConfig",
  9550. // 设置全局默认配置
  9551. value: function setConfig(customConfig) {
  9552. // 深度合并对象,否则会造成对象深层属性丢失
  9553. this.config = (0, _deepMerge.default)(this.config, customConfig);
  9554. }
  9555. // 主要请求部分
  9556. }, { key: "request", value: function request() {var _this = this;var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  9557. // 检查请求拦截
  9558. if (this.interceptor.request && typeof this.interceptor.request === 'function') {
  9559. var tmpConfig = {};
  9560. var interceptorRequest = this.interceptor.request(options);
  9561. if (interceptorRequest === false) {
  9562. // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
  9563. return new Promise(function () {});
  9564. }
  9565. this.options = interceptorRequest;
  9566. }
  9567. options.dataType = options.dataType || this.config.dataType;
  9568. options.responseType = options.responseType || this.config.responseType;
  9569. options.url = options.url || '';
  9570. options.params = options.params || {};
  9571. options.header = Object.assign(this.config.header, options.header);
  9572. options.method = options.method || this.config.method;
  9573. return new Promise(function (resolve, reject) {
  9574. options.complete = function (response) {
  9575. // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
  9576. uni.hideLoading();
  9577. // 清除定时器,如果请求回来了,就无需loading
  9578. clearTimeout(_this.config.timer);
  9579. _this.config.timer = null;
  9580. // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
  9581. if (_this.config.originalData) {
  9582. // 判断是否存在拦截器
  9583. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  9584. var resInterceptors = _this.interceptor.response(response);
  9585. // 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
  9586. if (resInterceptors !== false) {
  9587. resolve(resInterceptors);
  9588. } else {
  9589. // 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
  9590. reject(response);
  9591. }
  9592. } else {
  9593. // 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
  9594. resolve(response);
  9595. }
  9596. } else {
  9597. if (response.statusCode == 200) {
  9598. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  9599. var _resInterceptors = _this.interceptor.response(response.data);
  9600. if (_resInterceptors !== false) {
  9601. resolve(_resInterceptors);
  9602. } else {
  9603. reject(response.data);
  9604. }
  9605. } else {
  9606. // 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
  9607. resolve(response.data);
  9608. }
  9609. } else {
  9610. // 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
  9611. // if(response.errMsg) {
  9612. // uni.showModal({
  9613. // title: response.errMsg
  9614. // });
  9615. // }
  9616. reject(response);
  9617. }
  9618. }
  9619. };
  9620. // 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
  9621. options.url = _test.default.url(options.url) ? options.url : _this.config.baseUrl + (options.url.indexOf('/') == 0 ?
  9622. options.url : '/' + options.url);
  9623. // 是否显示loading
  9624. // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
  9625. // 而没有清除前者的定时器,导致前者超时,一直显示loading
  9626. if (_this.config.showLoading && !_this.config.timer) {
  9627. _this.config.timer = setTimeout(function () {
  9628. uni.showLoading({
  9629. title: _this.config.loadingText,
  9630. mask: _this.config.loadingMask });
  9631. _this.config.timer = null;
  9632. }, _this.config.loadingTime);
  9633. }
  9634. uni.request(options);
  9635. });
  9636. // .catch(res => {
  9637. // // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
  9638. // // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
  9639. // return new Promise(()=>{});
  9640. // })
  9641. } }]);
  9642. function Request() {var _this2 = this;_classCallCheck(this, Request);
  9643. this.config = {
  9644. baseUrl: '', // 请求的根域名
  9645. // 默认的请求头
  9646. header: {},
  9647. method: 'POST',
  9648. // 设置为json,返回后uni.request会对数据进行一次JSON.parse
  9649. dataType: 'json',
  9650. // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
  9651. responseType: 'text',
  9652. showLoading: true, // 是否显示请求中的loading
  9653. loadingText: '请求中...',
  9654. loadingTime: 800, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  9655. timer: null, // 定时器
  9656. originalData: false, // 是否在拦截器中返回服务端的原始数据,见文档说明
  9657. loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  9658. };
  9659. // 拦截器
  9660. this.interceptor = {
  9661. // 请求前的拦截
  9662. request: null,
  9663. // 请求后的拦截
  9664. response: null };
  9665. // get请求
  9666. this.get = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  9667. return _this2.request({
  9668. method: 'GET',
  9669. url: url,
  9670. header: header,
  9671. data: data });
  9672. };
  9673. // post请求
  9674. this.post = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  9675. return _this2.request({
  9676. url: url,
  9677. method: 'POST',
  9678. header: header,
  9679. data: data });
  9680. };
  9681. // put请求,不支持支付宝小程序(HX2.6.15)
  9682. this.put = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  9683. return _this2.request({
  9684. url: url,
  9685. method: 'PUT',
  9686. header: header,
  9687. data: data });
  9688. };
  9689. // delete请求,不支持支付宝和头条小程序(HX2.6.15)
  9690. this.delete = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  9691. return _this2.request({
  9692. url: url,
  9693. method: 'DELETE',
  9694. header: header,
  9695. data: data });
  9696. };
  9697. }return Request;}();var _default =
  9698. new Request();exports.default = _default;
  9699. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9700. /***/ }),
  9701. /***/ 23:
  9702. /*!************************************************************************!*\
  9703. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/deepMerge.js ***!
  9704. \************************************************************************/
  9705. /*! no static exports found */
  9706. /***/ (function(module, exports, __webpack_require__) {
  9707. "use strict";
  9708. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./deepClone */ 24));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9709. // JS对象深度合并
  9710. function deepMerge() {var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  9711. target = (0, _deepClone.default)(target);
  9712. if (typeof target !== 'object' || typeof source !== 'object') return false;
  9713. for (var prop in source) {
  9714. if (!source.hasOwnProperty(prop)) continue;
  9715. if (prop in target) {
  9716. if (typeof target[prop] !== 'object') {
  9717. target[prop] = source[prop];
  9718. } else {
  9719. if (typeof source[prop] !== 'object') {
  9720. target[prop] = source[prop];
  9721. } else {
  9722. if (target[prop].concat && source[prop].concat) {
  9723. target[prop] = target[prop].concat(source[prop]);
  9724. } else {
  9725. target[prop] = deepMerge(target[prop], source[prop]);
  9726. }
  9727. }
  9728. }
  9729. } else {
  9730. target[prop] = source[prop];
  9731. }
  9732. }
  9733. return target;
  9734. }var _default =
  9735. deepMerge;exports.default = _default;
  9736. /***/ }),
  9737. /***/ 24:
  9738. /*!************************************************************************!*\
  9739. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/deepClone.js ***!
  9740. \************************************************************************/
  9741. /*! no static exports found */
  9742. /***/ (function(module, exports, __webpack_require__) {
  9743. "use strict";
  9744. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 判断arr是否为一个数组,返回一个bool值
  9745. function isArray(arr) {
  9746. return Object.prototype.toString.call(arr) === '[object Array]';
  9747. }
  9748. // 深度克隆
  9749. function deepClone(obj) {
  9750. // 对常见的“非”值,直接返回原来值
  9751. if ([null, undefined, NaN, false].includes(obj)) return obj;
  9752. if (typeof obj !== "object" && typeof obj !== 'function') {
  9753. //原始类型直接返回
  9754. return obj;
  9755. }
  9756. var o = isArray(obj) ? [] : {};
  9757. for (var i in obj) {
  9758. if (obj.hasOwnProperty(i)) {
  9759. o[i] = typeof obj[i] === "object" ? deepClone(obj[i]) : obj[i];
  9760. }
  9761. }
  9762. return o;
  9763. }var _default =
  9764. deepClone;exports.default = _default;
  9765. /***/ }),
  9766. /***/ 25:
  9767. /*!*******************************************************************!*\
  9768. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/test.js ***!
  9769. \*******************************************************************/
  9770. /*! no static exports found */
  9771. /***/ (function(module, exports, __webpack_require__) {
  9772. "use strict";
  9773. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  9774. * 验证电子邮箱格式
  9775. */
  9776. function email(value) {
  9777. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  9778. }
  9779. /**
  9780. * 验证手机格式
  9781. */
  9782. function mobile(value) {
  9783. return /^1[23456789]\d{9}$/.test(value);
  9784. }
  9785. /**
  9786. * 验证URL格式
  9787. */
  9788. function url(value) {
  9789. return /^((https|http|ftp|rtsp|mms):\/\/)(([0-9a-zA-Z_!~*'().&=+$%-]+: )?[0-9a-zA-Z_!~*'().&=+$%-]+@)?(([0-9]{1,3}.){3}[0-9]{1,3}|([0-9a-zA-Z_!~*'()-]+.)*([0-9a-zA-Z][0-9a-zA-Z-]{0,61})?[0-9a-zA-Z].[a-zA-Z]{2,6})(:[0-9]{1,4})?((\/?)|(\/[0-9a-zA-Z_!~*'().;?:@&=+$,%#-]+)+\/?)$/.
  9790. test(value);
  9791. }
  9792. /**
  9793. * 验证日期格式
  9794. */
  9795. function date(value) {
  9796. return !/Invalid|NaN/.test(new Date(value).toString());
  9797. }
  9798. /**
  9799. * 验证ISO类型的日期格式
  9800. */
  9801. function dateISO(value) {
  9802. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  9803. }
  9804. /**
  9805. * 验证十进制数字
  9806. */
  9807. function number(value) {
  9808. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  9809. }
  9810. /**
  9811. * 验证整数
  9812. */
  9813. function digits(value) {
  9814. return /^\d+$/.test(value);
  9815. }
  9816. /**
  9817. * 验证身份证号码
  9818. */
  9819. function idCard(value) {
  9820. return /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(
  9821. value);
  9822. }
  9823. /**
  9824. * 是否车牌号
  9825. */
  9826. function carNo(value) {
  9827. // 新能源车牌
  9828. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  9829. // 旧车牌
  9830. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  9831. if (value.length === 7) {
  9832. return creg.test(value);
  9833. } else if (value.length === 8) {
  9834. return xreg.test(value);
  9835. } else {
  9836. return false;
  9837. }
  9838. }
  9839. /**
  9840. * 金额,只允许2位小数
  9841. */
  9842. function amount(value) {
  9843. //金额,只允许保留两位小数
  9844. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  9845. }
  9846. /**
  9847. * 中文
  9848. */
  9849. function chinese(value) {
  9850. var reg = /^[\u4e00-\u9fa5]+$/gi;
  9851. return reg.test(value);
  9852. }
  9853. /**
  9854. * 只能输入字母
  9855. */
  9856. function letter(value) {
  9857. return /^[a-zA-Z]*$/.test(value);
  9858. }
  9859. /**
  9860. * 只能是字母或者数字
  9861. */
  9862. function enOrNum(value) {
  9863. //英文或者数字
  9864. var reg = /^[0-9a-zA-Z]*$/g;
  9865. return reg.test(value);
  9866. }
  9867. /**
  9868. * 验证是否包含某个值
  9869. */
  9870. function contains(value, param) {
  9871. return value.indexOf(param) >= 0;
  9872. }
  9873. /**
  9874. * 验证一个值范围[min, max]
  9875. */
  9876. function range(value, param) {
  9877. return value >= param[0] && value <= param[1];
  9878. }
  9879. /**
  9880. * 验证一个长度范围[min, max]
  9881. */
  9882. function rangeLength(value, param) {
  9883. return value.length >= param[0] && value.length <= param[1];
  9884. }
  9885. /**
  9886. * 是否固定电话
  9887. */
  9888. function landline(value) {
  9889. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  9890. return reg.test(value);
  9891. }
  9892. /**
  9893. * 判断是否为空
  9894. */
  9895. function empty(value) {
  9896. switch (typeof value) {
  9897. case 'undefined':
  9898. return true;
  9899. case 'string':
  9900. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  9901. break;
  9902. case 'boolean':
  9903. if (!value) return true;
  9904. break;
  9905. case 'number':
  9906. if (0 === value || isNaN(value)) return true;
  9907. break;
  9908. case 'object':
  9909. if (null === value || value.length === 0) return true;
  9910. for (var i in value) {
  9911. return false;
  9912. }
  9913. return true;}
  9914. return false;
  9915. }
  9916. /**
  9917. * 是否json字符串
  9918. */
  9919. function jsonString(value) {
  9920. if (typeof value == 'string') {
  9921. try {
  9922. var obj = JSON.parse(value);
  9923. if (typeof obj == 'object' && obj) {
  9924. return true;
  9925. } else {
  9926. return false;
  9927. }
  9928. } catch (e) {
  9929. return false;
  9930. }
  9931. }
  9932. return false;
  9933. }
  9934. /**
  9935. * 是否数组
  9936. */
  9937. function array(value) {
  9938. if (typeof Array.isArray === "function") {
  9939. return Array.isArray(value);
  9940. } else {
  9941. return Object.prototype.toString.call(value) === "[object Array]";
  9942. }
  9943. }
  9944. /**
  9945. * 是否对象
  9946. */
  9947. function object(value) {
  9948. return Object.prototype.toString.call(value) === '[object Object]';
  9949. }
  9950. /**
  9951. * 是否短信验证码
  9952. */
  9953. function code(value) {var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  9954. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  9955. }var _default =
  9956. {
  9957. email: email,
  9958. mobile: mobile,
  9959. url: url,
  9960. date: date,
  9961. dateISO: dateISO,
  9962. number: number,
  9963. digits: digits,
  9964. idCard: idCard,
  9965. carNo: carNo,
  9966. amount: amount,
  9967. chinese: chinese,
  9968. letter: letter,
  9969. enOrNum: enOrNum,
  9970. contains: contains,
  9971. range: range,
  9972. rangeLength: rangeLength,
  9973. empty: empty,
  9974. isEmpty: empty,
  9975. jsonString: jsonString,
  9976. landline: landline,
  9977. object: object,
  9978. array: array,
  9979. code: code };exports.default = _default;
  9980. /***/ }),
  9981. /***/ 26:
  9982. /*!**************************************************************************!*\
  9983. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/queryParams.js ***!
  9984. \**************************************************************************/
  9985. /*! no static exports found */
  9986. /***/ (function(module, exports, __webpack_require__) {
  9987. "use strict";
  9988. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  9989. * 对象转url参数
  9990. * @param {*} data,对象
  9991. * @param {*} isPrefix,是否自动加上"?"
  9992. */
  9993. function queryParams() {var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var isPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var arrayFormat = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'brackets';
  9994. var prefix = isPrefix ? '?' : '';
  9995. var _result = [];
  9996. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';var _loop = function _loop(
  9997. key) {
  9998. var value = data[key];
  9999. // 去掉为空的参数
  10000. if (['', undefined, null].indexOf(value) >= 0) {
  10001. return "continue";
  10002. }
  10003. // 如果值为数组,另行处理
  10004. if (value.constructor === Array) {
  10005. // e.g. {ids: [1, 2, 3]}
  10006. switch (arrayFormat) {
  10007. case 'indices':
  10008. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  10009. for (var i = 0; i < value.length; i++) {
  10010. _result.push(key + '[' + i + ']=' + value[i]);
  10011. }
  10012. break;
  10013. case 'brackets':
  10014. // 结果: ids[]=1&ids[]=2&ids[]=3
  10015. value.forEach(function (_value) {
  10016. _result.push(key + '[]=' + _value);
  10017. });
  10018. break;
  10019. case 'repeat':
  10020. // 结果: ids=1&ids=2&ids=3
  10021. value.forEach(function (_value) {
  10022. _result.push(key + '=' + _value);
  10023. });
  10024. break;
  10025. case 'comma':
  10026. // 结果: ids=1,2,3
  10027. var commaStr = "";
  10028. value.forEach(function (_value) {
  10029. commaStr += (commaStr ? "," : "") + _value;
  10030. });
  10031. _result.push(key + '=' + commaStr);
  10032. break;
  10033. default:
  10034. value.forEach(function (_value) {
  10035. _result.push(key + '[]=' + _value);
  10036. });}
  10037. } else {
  10038. _result.push(key + '=' + value);
  10039. }};for (var key in data) {var _ret = _loop(key);if (_ret === "continue") continue;
  10040. }
  10041. return _result.length ? prefix + _result.join('&') : '';
  10042. }var _default =
  10043. queryParams;exports.default = _default;
  10044. /***/ }),
  10045. /***/ 27:
  10046. /*!********************************************************************!*\
  10047. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/route.js ***!
  10048. \********************************************************************/
  10049. /*! no static exports found */
  10050. /***/ (function(module, exports, __webpack_require__) {
  10051. "use strict";
  10052. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _queryParams = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/queryParams.js */ 26));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10053. /**
  10054. * 路由跳转
  10055. * 注意:本方法没有对跳转的回调函数进行封装
  10056. */
  10057. function route() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  10058. var config = {
  10059. type: 'navigateTo',
  10060. url: '',
  10061. delta: 1, // navigateBack页面后退时,回退的层数
  10062. params: {}, // 传递的参数
  10063. animationType: 'pop-in', // 窗口动画,只在APP有效
  10064. animationDuration: 300 // 窗口动画持续时间,单位毫秒,只在APP有效
  10065. };
  10066. config = Object.assign(config, options);
  10067. // 如果url没有"/"开头,添加上,因为uni的路由跳转需要"/"开头
  10068. if (config.url[0] != '/') config.url = '/' + config.url;
  10069. // 判断是否有传递显式的参数,Object.keys转为数组并判断长度,switchTab类型时不能携带参数
  10070. if (Object.keys(config.params).length && config.type != 'switchTab') {
  10071. // 判断用户传递的url中,是否带有参数
  10072. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  10073. // 如果有url中有get参数,转换后无需带上"?"
  10074. var query = '';
  10075. if (/.*\/.*\?.*=.*/.test(config.url)) {
  10076. // object对象转为get类型的参数
  10077. query = (0, _queryParams.default)(config.params, false);
  10078. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  10079. config.url += "&" + query;
  10080. } else {
  10081. query = (0, _queryParams.default)(config.params);
  10082. config.url += query;
  10083. }
  10084. }
  10085. // 简写形式,把url和参数拼接起来
  10086. if (typeof options === 'string' && typeof params == 'object') {
  10087. var _query = '';
  10088. if (/.*\/.*\?.*=.*/.test(options)) {
  10089. // object对象转为get类型的参数
  10090. _query = (0, _queryParams.default)(params, false);
  10091. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  10092. options += "&" + _query;
  10093. } else {
  10094. _query = (0, _queryParams.default)(params);
  10095. options += _query;
  10096. }
  10097. }
  10098. // 判断是否一个字符串,如果是,直接跳转(简写法)
  10099. // 如果是中情形,默认第二个参数为对象形式的参数
  10100. if (typeof options === 'string') {
  10101. if (options[0] != '/') options = '/' + options;
  10102. return uni.navigateTo({
  10103. url: options });
  10104. }
  10105. // navigateTo类型的跳转
  10106. if (config.type == 'navigateTo' || config.type == 'to') {
  10107. return uni.navigateTo({
  10108. url: config.url,
  10109. animationType: config.animationType,
  10110. animationDuration: config.animationDuration });
  10111. }
  10112. if (config.type == 'redirectTo' || config.type == 'redirect') {
  10113. return uni.redirectTo({
  10114. url: config.url });
  10115. }
  10116. if (config.type == 'switchTab' || config.type == 'tab') {
  10117. return uni.switchTab({
  10118. url: config.url });
  10119. }
  10120. if (config.type == 'reLaunch') {
  10121. return uni.reLaunch({
  10122. url: config.url });
  10123. }
  10124. if (config.type == 'navigateBack' || config.type == 'back') {
  10125. return uni.navigateBack({
  10126. delta: parseInt(config.delta ? config.delta : this.delta) });
  10127. }
  10128. }var _default =
  10129. route;exports.default = _default;
  10130. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10131. /***/ }),
  10132. /***/ 28:
  10133. /*!*************************************************************************!*\
  10134. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/timeFormat.js ***!
  10135. \*************************************************************************/
  10136. /*! no static exports found */
  10137. /***/ (function(module, exports, __webpack_require__) {
  10138. "use strict";
  10139. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  10140. // 所以这里做一个兼容polyfill的兼容处理
  10141. if (!String.prototype.padStart) {
  10142. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  10143. String.prototype.padStart = function (maxLength) {var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  10144. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError(
  10145. 'fillString must be String');
  10146. var str = this;
  10147. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  10148. if (str.length >= maxLength) return String(str);
  10149. var fillLength = maxLength - str.length,
  10150. times = Math.ceil(fillLength / fillString.length);
  10151. while (times >>= 1) {
  10152. fillString += fillString;
  10153. if (times === 1) {
  10154. fillString += fillString;
  10155. }
  10156. }
  10157. return fillString.slice(0, fillLength) + str;
  10158. };
  10159. }
  10160. function timeFormat() {var timestamp = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  10161. // 其他更多是格式化有如下:
  10162. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  10163. timestamp = parseInt(timestamp);
  10164. // 如果为null,则格式化当前时间
  10165. if (!timestamp) timestamp = Number(new Date());
  10166. // 判断用户输入的时间戳是秒还是毫秒,一般前端js获取的时间戳是毫秒(13位),后端传过来的为秒(10位)
  10167. if (timestamp.toString().length == 10) timestamp *= 1000;
  10168. var date = new Date(timestamp);
  10169. var ret;
  10170. var opt = {
  10171. "y+": date.getFullYear().toString(), // 年
  10172. "m+": (date.getMonth() + 1).toString(), // 月
  10173. "d+": date.getDate().toString(), // 日
  10174. "h+": date.getHours().toString(), // 时
  10175. "M+": date.getMinutes().toString(), // 分
  10176. "s+": date.getSeconds().toString() // 秒
  10177. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  10178. };
  10179. for (var k in opt) {
  10180. ret = new RegExp("(" + k + ")").exec(fmt);
  10181. if (ret) {
  10182. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  10183. };
  10184. };
  10185. return fmt;
  10186. }var _default =
  10187. timeFormat;exports.default = _default;
  10188. /***/ }),
  10189. /***/ 29:
  10190. /*!***********************************************************************!*\
  10191. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/timeFrom.js ***!
  10192. \***********************************************************************/
  10193. /*! no static exports found */
  10194. /***/ (function(module, exports, __webpack_require__) {
  10195. "use strict";
  10196. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/timeFormat.js */ 28));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10197. /**
  10198. * 时间戳转为多久之前
  10199. * @param String timestamp 时间戳
  10200. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  10201. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  10202. */
  10203. function timeFrom() {var timestamp = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  10204. if (timestamp == null) timestamp = Number(new Date());
  10205. timestamp = parseInt(timestamp);
  10206. // 判断用户输入的时间戳是秒还是毫秒,一般前端js获取的时间戳是毫秒(13位),后端传过来的为秒(10位)
  10207. if (timestamp.toString().length == 10) timestamp *= 1000;
  10208. var timer = new Date().getTime() - timestamp;
  10209. timer = parseInt(timer / 1000);
  10210. // 如果小于5分钟,则返回"刚刚",其他以此类推
  10211. var tips = '';
  10212. switch (true) {
  10213. case timer < 300:
  10214. tips = '刚刚';
  10215. break;
  10216. case timer >= 300 && timer < 3600:
  10217. tips = parseInt(timer / 60) + '分钟前';
  10218. break;
  10219. case timer >= 3600 && timer < 86400:
  10220. tips = parseInt(timer / 3600) + '小时前';
  10221. break;
  10222. case timer >= 86400 && timer < 2592000:
  10223. tips = parseInt(timer / 86400) + '天前';
  10224. break;
  10225. default:
  10226. // 如果format为false,则无论什么时间戳,都显示xx之前
  10227. if (format === false) {
  10228. if (timer >= 2592000 && timer < 365 * 86400) {
  10229. tips = parseInt(timer / (86400 * 30)) + '个月前';
  10230. } else {
  10231. tips = parseInt(timer / (86400 * 365)) + '年前';
  10232. }
  10233. } else {
  10234. tips = (0, _timeFormat.default)(timestamp, format);
  10235. }}
  10236. return tips;
  10237. }var _default =
  10238. timeFrom;exports.default = _default;
  10239. /***/ }),
  10240. /***/ 298:
  10241. /*!******************************************************************!*\
  10242. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/util/emitter.js ***!
  10243. \******************************************************************/
  10244. /*! no static exports found */
  10245. /***/ (function(module, exports, __webpack_require__) {
  10246. "use strict";
  10247. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  10248. * 递归使用 call 方式this指向
  10249. * @param componentName // 需要找的组件的名称
  10250. * @param eventName // 事件名称
  10251. * @param params // 需要传递的参数
  10252. */
  10253. function _broadcast(componentName, eventName, params) {
  10254. // 循环子节点找到名称一样的子节点 否则 递归 当前子节点
  10255. this.$children.map(function (child) {
  10256. if (componentName === child.$options.name) {
  10257. child.$emit.apply(child, [eventName].concat(params));
  10258. } else {
  10259. _broadcast.apply(child, [componentName, eventName].concat(params));
  10260. }
  10261. });
  10262. }var _default =
  10263. {
  10264. methods: {
  10265. /**
  10266. * 派发 (向上查找) (一个)
  10267. * @param componentName // 需要找的组件的名称
  10268. * @param eventName // 事件名称
  10269. * @param params // 需要传递的参数
  10270. */
  10271. dispatch: function dispatch(componentName, eventName, params) {
  10272. var parent = this.$parent || this.$root; //$parent 找到最近的父节点 $root 根节点
  10273. var name = parent.$options.name; // 获取当前组件实例的name
  10274. // 如果当前有节点 && 当前没名称 且 当前名称等于需要传进来的名称的时候就去查找当前的节点
  10275. // 循环出当前名称的一样的组件实例
  10276. while (parent && (!name || name !== componentName)) {
  10277. parent = parent.$parent;
  10278. if (parent) {
  10279. name = parent.$options.name;
  10280. }
  10281. }
  10282. // 有节点表示当前找到了name一样的实例
  10283. if (parent) {
  10284. parent.$emit.apply(parent, [eventName].concat(params));
  10285. }
  10286. },
  10287. /**
  10288. * 广播 (向下查找) (广播多个)
  10289. * @param componentName // 需要找的组件的名称
  10290. * @param eventName // 事件名称
  10291. * @param params // 需要传递的参数
  10292. */
  10293. broadcast: function broadcast(componentName, eventName, params) {
  10294. _broadcast.call(this, componentName, eventName, params);
  10295. } } };exports.default = _default;
  10296. /***/ }),
  10297. /***/ 3:
  10298. /*!***********************************!*\
  10299. !*** (webpack)/buildin/global.js ***!
  10300. \***********************************/
  10301. /*! no static exports found */
  10302. /***/ (function(module, exports) {
  10303. var g;
  10304. // This works in non-strict mode
  10305. g = (function() {
  10306. return this;
  10307. })();
  10308. try {
  10309. // This works if eval is allowed (see CSP)
  10310. g = g || new Function("return this")();
  10311. } catch (e) {
  10312. // This works if the window reference is available
  10313. if (typeof window === "object") g = window;
  10314. }
  10315. // g can still be undefined, but nothing to do about it...
  10316. // We return undefined, instead of nothing here, so it's
  10317. // easier to handle this case. if(!global) { ...}
  10318. module.exports = g;
  10319. /***/ }),
  10320. /***/ 30:
  10321. /*!****************************************************************************!*\
  10322. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/colorGradient.js ***!
  10323. \****************************************************************************/
  10324. /*! no static exports found */
  10325. /***/ (function(module, exports, __webpack_require__) {
  10326. "use strict";
  10327. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  10328. * 求两个颜色之间的渐变值
  10329. * @param {string} startColor 开始的颜色
  10330. * @param {string} endColor 结束的颜色
  10331. * @param {number} step 颜色等分的份额
  10332. * */
  10333. function colorGradient() {var startColor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'rgb(0, 0, 0)';var endColor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rgb(255, 255, 255)';var step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
  10334. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  10335. var startR = startRGB[0];
  10336. var startG = startRGB[1];
  10337. var startB = startRGB[2];
  10338. var endRGB = hexToRgb(endColor, false);
  10339. var endR = endRGB[0];
  10340. var endG = endRGB[1];
  10341. var endB = endRGB[2];
  10342. var sR = (endR - startR) / step; //总差值
  10343. var sG = (endG - startG) / step;
  10344. var sB = (endB - startB) / step;
  10345. var colorArr = [];
  10346. for (var i = 0; i < step; i++) {
  10347. //计算每一步的hex值
  10348. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB *
  10349. i + startB) + ')');
  10350. colorArr.push(hex);
  10351. }
  10352. return colorArr;
  10353. }
  10354. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  10355. function hexToRgb(sColor) {var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  10356. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  10357. sColor = sColor.toLowerCase();
  10358. if (sColor && reg.test(sColor)) {
  10359. if (sColor.length === 4) {
  10360. var sColorNew = "#";
  10361. for (var i = 1; i < 4; i += 1) {
  10362. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  10363. }
  10364. sColor = sColorNew;
  10365. }
  10366. //处理六位的颜色值
  10367. var sColorChange = [];
  10368. for (var _i = 1; _i < 7; _i += 2) {
  10369. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  10370. }
  10371. if (!str) {
  10372. return sColorChange;
  10373. } else {
  10374. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  10375. }
  10376. } else if (/^(rgb|RGB)/.test(sColor)) {
  10377. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  10378. return arr.map(function (val) {return Number(val);});
  10379. } else {
  10380. return sColor;
  10381. }
  10382. };
  10383. // 将rgb表示方式转换为hex表示方式
  10384. function rgbToHex(rgb) {
  10385. var _this = rgb;
  10386. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  10387. if (/^(rgb|RGB)/.test(_this)) {
  10388. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  10389. var strHex = "#";
  10390. for (var i = 0; i < aColor.length; i++) {
  10391. var hex = Number(aColor[i]).toString(16);
  10392. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  10393. if (hex === "0") {
  10394. hex += hex;
  10395. }
  10396. strHex += hex;
  10397. }
  10398. if (strHex.length !== 7) {
  10399. strHex = _this;
  10400. }
  10401. return strHex;
  10402. } else if (reg.test(_this)) {
  10403. var aNum = _this.replace(/#/, "").split("");
  10404. if (aNum.length === 6) {
  10405. return _this;
  10406. } else if (aNum.length === 3) {
  10407. var numHex = "#";
  10408. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  10409. numHex += aNum[_i2] + aNum[_i2];
  10410. }
  10411. return numHex;
  10412. }
  10413. } else {
  10414. return _this;
  10415. }
  10416. }var _default =
  10417. {
  10418. colorGradient: colorGradient,
  10419. hexToRgb: hexToRgb,
  10420. rgbToHex: rgbToHex };exports.default = _default;
  10421. /***/ }),
  10422. /***/ 31:
  10423. /*!*******************************************************************!*\
  10424. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/guid.js ***!
  10425. \*******************************************************************/
  10426. /*! no static exports found */
  10427. /***/ (function(module, exports, __webpack_require__) {
  10428. "use strict";
  10429. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  10430. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  10431. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  10432. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  10433. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  10434. * v-for的时候,推荐使用后端返回的id而不是循环的index
  10435. * @param {Number} len uuid的长度
  10436. * @param {Boolean} firstU 将返回的首字母置为"u"
  10437. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  10438. */
  10439. function guid() {var len = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 32;var firstU = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;var radix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
  10440. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  10441. var uuid = [];
  10442. radix = radix || chars.length;
  10443. if (len) {
  10444. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  10445. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  10446. } else {
  10447. var r;
  10448. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  10449. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  10450. uuid[14] = '4';
  10451. for (var _i = 0; _i < 36; _i++) {
  10452. if (!uuid[_i]) {
  10453. r = 0 | Math.random() * 16;
  10454. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  10455. }
  10456. }
  10457. }
  10458. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  10459. if (firstU) {
  10460. uuid.shift();
  10461. return 'u' + uuid.join('');
  10462. } else {
  10463. return uuid.join('');
  10464. }
  10465. }var _default =
  10466. guid;exports.default = _default;
  10467. /***/ }),
  10468. /***/ 32:
  10469. /*!********************************************************************!*\
  10470. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/color.js ***!
  10471. \********************************************************************/
  10472. /*! no static exports found */
  10473. /***/ (function(module, exports, __webpack_require__) {
  10474. "use strict";
  10475. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  10476. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  10477. var color = {
  10478. primary: "#2979ff",
  10479. primaryDark: "#2b85e4",
  10480. primaryDisabled: "#a0cfff",
  10481. primaryLight: "#ecf5ff",
  10482. bgColor: "#f3f4f6",
  10483. info: "#909399",
  10484. infoDark: "#82848a",
  10485. infoDisabled: "#c8c9cc",
  10486. infoLight: "#f4f4f5",
  10487. warning: "#ff9900",
  10488. warningDark: "#f29100",
  10489. warningDisabled: "#fcbd71",
  10490. warningLight: "#fdf6ec",
  10491. error: "#fa3534",
  10492. errorDark: "#dd6161",
  10493. errorDisabled: "#fab6b6",
  10494. errorLight: "#fef0f0",
  10495. success: "#19be6b",
  10496. successDark: "#18b566",
  10497. successDisabled: "#71d5a1",
  10498. successLight: "#dbf1e1",
  10499. mainColor: "#303133",
  10500. contentColor: "#606266",
  10501. tipsColor: "#909399",
  10502. lightColor: "#c0c4cc",
  10503. borderColor: "#e4e7ed" };var _default =
  10504. color;exports.default = _default;
  10505. /***/ }),
  10506. /***/ 33:
  10507. /*!************************************************************************!*\
  10508. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/type2icon.js ***!
  10509. \************************************************************************/
  10510. /*! no static exports found */
  10511. /***/ (function(module, exports, __webpack_require__) {
  10512. "use strict";
  10513. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  10514. * 根据主题type值,获取对应的图标
  10515. * @param String type 主题名称,primary|info|error|warning|success
  10516. * @param String fill 是否使用fill填充实体的图标
  10517. */
  10518. function type2icon() {var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  10519. // 如果非预置值,默认为success
  10520. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  10521. var iconName = '';
  10522. // 目前(2019-12-12),info和primary使用同一个图标
  10523. switch (type) {
  10524. case 'primary':
  10525. iconName = 'info-circle';
  10526. break;
  10527. case 'info':
  10528. iconName = 'info-circle';
  10529. break;
  10530. case 'error':
  10531. iconName = 'close-circle';
  10532. break;
  10533. case 'warning':
  10534. iconName = 'error-circle';
  10535. break;
  10536. case 'success':
  10537. iconName = 'checkmark-circle';
  10538. break;
  10539. default:
  10540. iconName = 'checkmark-circle';}
  10541. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  10542. if (fill) iconName += '-fill';
  10543. return iconName;
  10544. }var _default =
  10545. type2icon;exports.default = _default;
  10546. /***/ }),
  10547. /***/ 34:
  10548. /*!**************************************************************************!*\
  10549. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/randomArray.js ***!
  10550. \**************************************************************************/
  10551. /*! no static exports found */
  10552. /***/ (function(module, exports, __webpack_require__) {
  10553. "use strict";
  10554. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 打乱数组
  10555. function randomArray() {var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  10556. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  10557. return array.sort(function () {return Math.random() - 0.5;});
  10558. }var _default =
  10559. randomArray;exports.default = _default;
  10560. /***/ }),
  10561. /***/ 35:
  10562. /*!**********************************************************************!*\
  10563. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/addUnit.js ***!
  10564. \**********************************************************************/
  10565. /*! no static exports found */
  10566. /***/ (function(module, exports, __webpack_require__) {
  10567. "use strict";
  10568. Object.defineProperty(exports, "__esModule", { value: true });exports.default = addUnit;var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 25));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  10569. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  10570. function addUnit() {var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  10571. value = String(value);
  10572. // 用uView内置验证规则中的number判断是否为数值
  10573. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  10574. }
  10575. /***/ }),
  10576. /***/ 36:
  10577. /*!*********************************************************************!*\
  10578. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/random.js ***!
  10579. \*********************************************************************/
  10580. /*! no static exports found */
  10581. /***/ (function(module, exports, __webpack_require__) {
  10582. "use strict";
  10583. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function random(min, max) {
  10584. if (min >= 0 && max > 0 && max >= min) {
  10585. var gab = max - min + 1;
  10586. return Math.floor(Math.random() * gab + min);
  10587. } else {
  10588. return 0;
  10589. }
  10590. }var _default =
  10591. random;exports.default = _default;
  10592. /***/ }),
  10593. /***/ 37:
  10594. /*!*******************************************************************!*\
  10595. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/trim.js ***!
  10596. \*******************************************************************/
  10597. /*! no static exports found */
  10598. /***/ (function(module, exports, __webpack_require__) {
  10599. "use strict";
  10600. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function trim(str) {var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  10601. if (pos == 'both') {
  10602. return str.replace(/^\s+|\s+$/g, "");
  10603. } else if (pos == "left") {
  10604. return str.replace(/^\s*/, '');
  10605. } else if (pos == 'right') {
  10606. return str.replace(/(\s*$)/g, "");
  10607. } else if (pos == 'all') {
  10608. return str.replace(/\s+/g, "");
  10609. } else {
  10610. return str;
  10611. }
  10612. }var _default =
  10613. trim;exports.default = _default;
  10614. /***/ }),
  10615. /***/ 38:
  10616. /*!********************************************************************!*\
  10617. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/toast.js ***!
  10618. \********************************************************************/
  10619. /*! no static exports found */
  10620. /***/ (function(module, exports, __webpack_require__) {
  10621. "use strict";
  10622. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function toast(title) {var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1500;
  10623. uni.showToast({
  10624. title: title,
  10625. icon: 'none',
  10626. duration: duration });
  10627. }var _default =
  10628. toast;exports.default = _default;
  10629. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10630. /***/ }),
  10631. /***/ 39:
  10632. /*!************************************************************************!*\
  10633. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/getParent.js ***!
  10634. \************************************************************************/
  10635. /*! no static exports found */
  10636. /***/ (function(module, exports, __webpack_require__) {
  10637. "use strict";
  10638. Object.defineProperty(exports, "__esModule", { value: true });exports.default = getParent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  10639. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  10640. function getParent(name, keys) {
  10641. var parent = this.$parent;
  10642. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  10643. while (parent) {
  10644. // 父组件
  10645. if (parent.$options.name !== name) {
  10646. // 如果组件的name不相等,继续上一级寻找
  10647. parent = parent.$parent;
  10648. } else {var _ret = function () {
  10649. var data = {};
  10650. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  10651. if (Array.isArray(keys)) {
  10652. keys.map(function (val) {
  10653. data[val] = parent[val] ? parent[val] : '';
  10654. });
  10655. } else {
  10656. // 历遍传过来的对象参数
  10657. for (var i in keys) {
  10658. // 如果子组件有此值则用,无此值则用父组件的值
  10659. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  10660. if (Array.isArray(keys[i])) {
  10661. if (keys[i].length) {
  10662. data[i] = keys[i];
  10663. } else {
  10664. data[i] = parent[i];
  10665. }
  10666. } else if (keys[i].constructor === Object) {
  10667. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  10668. if (Object.keys(keys[i]).length) {
  10669. data[i] = keys[i];
  10670. } else {
  10671. data[i] = parent[i];
  10672. }
  10673. } else {
  10674. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  10675. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  10676. }
  10677. }
  10678. }
  10679. return { v: data };}();if (typeof _ret === "object") return _ret.v;
  10680. }
  10681. }
  10682. return {};
  10683. }
  10684. /***/ }),
  10685. /***/ 4:
  10686. /*!***********************************************!*\
  10687. !*** E:/.swdz/uni-app/baoma/mabao/pages.json ***!
  10688. \***********************************************/
  10689. /*! no static exports found */
  10690. /***/ (function(module, exports) {
  10691. /***/ }),
  10692. /***/ 40:
  10693. /*!**********************************************************************!*\
  10694. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/$parent.js ***!
  10695. \**********************************************************************/
  10696. /*! no static exports found */
  10697. /***/ (function(module, exports, __webpack_require__) {
  10698. "use strict";
  10699. Object.defineProperty(exports, "__esModule", { value: true });exports.default = $parent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  10700. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  10701. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  10702. // 值(默认为undefined),就是查找最顶层的$parent
  10703. function $parent() {var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  10704. var parent = this.$parent;
  10705. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  10706. while (parent) {
  10707. // 父组件
  10708. if (parent.$options && parent.$options.name !== name) {
  10709. // 如果组件的name不相等,继续上一级寻找
  10710. parent = parent.$parent;
  10711. } else {
  10712. return parent;
  10713. }
  10714. }
  10715. return false;
  10716. }
  10717. /***/ }),
  10718. /***/ 41:
  10719. /*!******************************************************************!*\
  10720. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/sys.js ***!
  10721. \******************************************************************/
  10722. /*! no static exports found */
  10723. /***/ (function(module, exports, __webpack_require__) {
  10724. "use strict";
  10725. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.os = os;exports.sys = sys;function os() {
  10726. return uni.getSystemInfoSync().platform;
  10727. };
  10728. function sys() {
  10729. return uni.getSystemInfoSync();
  10730. }
  10731. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10732. /***/ }),
  10733. /***/ 42:
  10734. /*!***********************************************************************!*\
  10735. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/debounce.js ***!
  10736. \***********************************************************************/
  10737. /*! no static exports found */
  10738. /***/ (function(module, exports, __webpack_require__) {
  10739. "use strict";
  10740. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeout = null;
  10741. /**
  10742. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  10743. *
  10744. * @param {Function} func 要执行的回调函数
  10745. * @param {Number} wait 延时的时间
  10746. * @param {Boolean} immediate 是否立即执行
  10747. * @return null
  10748. */
  10749. function debounce(func) {var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  10750. // 清除定时器
  10751. if (timeout !== null) clearTimeout(timeout);
  10752. // 立即执行,此类情况一般用不到
  10753. if (immediate) {
  10754. var callNow = !timeout;
  10755. timeout = setTimeout(function () {
  10756. timeout = null;
  10757. }, wait);
  10758. if (callNow) typeof func === 'function' && func();
  10759. } else {
  10760. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  10761. timeout = setTimeout(function () {
  10762. typeof func === 'function' && func();
  10763. }, wait);
  10764. }
  10765. }var _default =
  10766. debounce;exports.default = _default;
  10767. /***/ }),
  10768. /***/ 425:
  10769. /*!******************************************************************!*\
  10770. !*** E:/.swdz/uni-app/baoma/mabao/components/uni-icons/icons.js ***!
  10771. \******************************************************************/
  10772. /*! no static exports found */
  10773. /***/ (function(module, exports, __webpack_require__) {
  10774. "use strict";
  10775. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _default = {
  10776. "pulldown": "\uE588",
  10777. "refreshempty": "\uE461",
  10778. "back": "\uE471",
  10779. "forward": "\uE470",
  10780. "more": "\uE507",
  10781. "more-filled": "\uE537",
  10782. "scan": "\uE612",
  10783. "qq": "\uE264",
  10784. "weibo": "\uE260",
  10785. "weixin": "\uE261",
  10786. "pengyouquan": "\uE262",
  10787. "loop": "\uE565",
  10788. "refresh": "\uE407",
  10789. "refresh-filled": "\uE437",
  10790. "arrowthindown": "\uE585",
  10791. "arrowthinleft": "\uE586",
  10792. "arrowthinright": "\uE587",
  10793. "arrowthinup": "\uE584",
  10794. "undo-filled": "\uE7D6",
  10795. "undo": "\uE406",
  10796. "redo": "\uE405",
  10797. "redo-filled": "\uE7D9",
  10798. "bars": "\uE563",
  10799. "chatboxes": "\uE203",
  10800. "camera": "\uE301",
  10801. "chatboxes-filled": "\uE233",
  10802. "camera-filled": "\uE7EF",
  10803. "cart-filled": "\uE7F4",
  10804. "cart": "\uE7F5",
  10805. "checkbox-filled": "\uE442",
  10806. "checkbox": "\uE7FA",
  10807. "arrowleft": "\uE582",
  10808. "arrowdown": "\uE581",
  10809. "arrowright": "\uE583",
  10810. "smallcircle-filled": "\uE801",
  10811. "arrowup": "\uE580",
  10812. "circle": "\uE411",
  10813. "eye-filled": "\uE568",
  10814. "eye-slash-filled": "\uE822",
  10815. "eye-slash": "\uE823",
  10816. "eye": "\uE824",
  10817. "flag-filled": "\uE825",
  10818. "flag": "\uE508",
  10819. "gear-filled": "\uE532",
  10820. "reload": "\uE462",
  10821. "gear": "\uE502",
  10822. "hand-thumbsdown-filled": "\uE83B",
  10823. "hand-thumbsdown": "\uE83C",
  10824. "hand-thumbsup-filled": "\uE83D",
  10825. "heart-filled": "\uE83E",
  10826. "hand-thumbsup": "\uE83F",
  10827. "heart": "\uE840",
  10828. "home": "\uE500",
  10829. "info": "\uE504",
  10830. "home-filled": "\uE530",
  10831. "info-filled": "\uE534",
  10832. "circle-filled": "\uE441",
  10833. "chat-filled": "\uE847",
  10834. "chat": "\uE263",
  10835. "mail-open-filled": "\uE84D",
  10836. "email-filled": "\uE231",
  10837. "mail-open": "\uE84E",
  10838. "email": "\uE201",
  10839. "checkmarkempty": "\uE472",
  10840. "list": "\uE562",
  10841. "locked-filled": "\uE856",
  10842. "locked": "\uE506",
  10843. "map-filled": "\uE85C",
  10844. "map-pin": "\uE85E",
  10845. "map-pin-ellipse": "\uE864",
  10846. "map": "\uE364",
  10847. "minus-filled": "\uE440",
  10848. "mic-filled": "\uE332",
  10849. "minus": "\uE410",
  10850. "micoff": "\uE360",
  10851. "mic": "\uE302",
  10852. "clear": "\uE434",
  10853. "smallcircle": "\uE868",
  10854. "close": "\uE404",
  10855. "closeempty": "\uE460",
  10856. "paperclip": "\uE567",
  10857. "paperplane": "\uE503",
  10858. "paperplane-filled": "\uE86E",
  10859. "person-filled": "\uE131",
  10860. "contact-filled": "\uE130",
  10861. "person": "\uE101",
  10862. "contact": "\uE100",
  10863. "images-filled": "\uE87A",
  10864. "phone": "\uE200",
  10865. "images": "\uE87B",
  10866. "image": "\uE363",
  10867. "image-filled": "\uE877",
  10868. "location-filled": "\uE333",
  10869. "location": "\uE303",
  10870. "plus-filled": "\uE439",
  10871. "plus": "\uE409",
  10872. "plusempty": "\uE468",
  10873. "help-filled": "\uE535",
  10874. "help": "\uE505",
  10875. "navigate-filled": "\uE884",
  10876. "navigate": "\uE501",
  10877. "mic-slash-filled": "\uE892",
  10878. "search": "\uE466",
  10879. "settings": "\uE560",
  10880. "sound": "\uE590",
  10881. "sound-filled": "\uE8A1",
  10882. "spinner-cycle": "\uE465",
  10883. "download-filled": "\uE8A4",
  10884. "personadd-filled": "\uE132",
  10885. "videocam-filled": "\uE8AF",
  10886. "personadd": "\uE102",
  10887. "upload": "\uE402",
  10888. "upload-filled": "\uE8B1",
  10889. "starhalf": "\uE463",
  10890. "star-filled": "\uE438",
  10891. "star": "\uE408",
  10892. "trash": "\uE401",
  10893. "phone-filled": "\uE230",
  10894. "compose": "\uE400",
  10895. "videocam": "\uE300",
  10896. "trash-filled": "\uE8DC",
  10897. "download": "\uE403",
  10898. "chatbubble-filled": "\uE232",
  10899. "chatbubble": "\uE202",
  10900. "cloud-download": "\uE8E4",
  10901. "cloud-upload-filled": "\uE8E5",
  10902. "cloud-upload": "\uE8E6",
  10903. "cloud-download-filled": "\uE8E9",
  10904. "headphones": "\uE8BF",
  10905. "shop": "\uE609" };exports.default = _default;
  10906. /***/ }),
  10907. /***/ 43:
  10908. /*!***********************************************************************!*\
  10909. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/function/throttle.js ***!
  10910. \***********************************************************************/
  10911. /*! no static exports found */
  10912. /***/ (function(module, exports, __webpack_require__) {
  10913. "use strict";
  10914. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timer, flag;
  10915. /**
  10916. * 节流原理:在一定时间内,只能触发一次
  10917. *
  10918. * @param {Function} func 要执行的回调函数
  10919. * @param {Number} wait 延时的时间
  10920. * @param {Boolean} immediate 是否立即执行
  10921. * @return null
  10922. */
  10923. function throttle(func) {var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  10924. if (immediate) {
  10925. if (!flag) {
  10926. flag = true;
  10927. // 如果是立即执行,则在wait毫秒内开始时执行
  10928. typeof func === 'function' && func();
  10929. timer = setTimeout(function () {
  10930. flag = false;
  10931. }, wait);
  10932. }
  10933. } else {
  10934. if (!flag) {
  10935. flag = true;
  10936. // 如果是非立即执行,则在wait毫秒内的结束处执行
  10937. timer = setTimeout(function () {
  10938. flag = false;
  10939. typeof func === 'function' && func();
  10940. }, wait);
  10941. }
  10942. }
  10943. };var _default =
  10944. throttle;exports.default = _default;
  10945. /***/ }),
  10946. /***/ 44:
  10947. /*!*******************************************************************!*\
  10948. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/config/config.js ***!
  10949. \*******************************************************************/
  10950. /*! no static exports found */
  10951. /***/ (function(module, exports, __webpack_require__) {
  10952. "use strict";
  10953. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 此版本发布于2020-09-22
  10954. var version = '1.7.3';var _default =
  10955. {
  10956. v: version,
  10957. version: version,
  10958. // 主题名称
  10959. type: [
  10960. 'primary',
  10961. 'success',
  10962. 'info',
  10963. 'error',
  10964. 'warning'] };exports.default = _default;
  10965. /***/ }),
  10966. /***/ 45:
  10967. /*!*******************************************************************!*\
  10968. !*** E:/.swdz/uni-app/baoma/mabao/uview-ui/libs/config/zIndex.js ***!
  10969. \*******************************************************************/
  10970. /*! no static exports found */
  10971. /***/ (function(module, exports, __webpack_require__) {
  10972. "use strict";
  10973. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // uniapp在H5中各API的z-index值如下:
  10974. /**
  10975. * actionsheet: 999
  10976. * modal: 999
  10977. * navigate: 998
  10978. * tabbar: 998
  10979. * toast: 999
  10980. */var _default =
  10981. {
  10982. toast: 10090,
  10983. noNetwork: 10080,
  10984. // popup包含popup,actionsheet,keyboard,picker的值
  10985. popup: 10075,
  10986. mask: 10070,
  10987. navbar: 980,
  10988. topTips: 975,
  10989. sticky: 970,
  10990. indexListSticky: 965 };exports.default = _default;
  10991. /***/ }),
  10992. /***/ 52:
  10993. /*!********************************************************!*\
  10994. !*** E:/.swdz/uni-app/baoma/mabao/common/authorize.js ***!
  10995. \********************************************************/
  10996. /*! no static exports found */
  10997. /***/ (function(module, exports, __webpack_require__) {
  10998. var utilMd5 = __webpack_require__(/*! ./md5.js */ 53);
  10999. var tx_key = 'XSWBZ-TBVWD-QJ54G-HGYZW-5AWQK-M2FYS'; // 腾讯地图key
  11000. var tx_secret_key = ''; // key对应的签名
  11001. // 登录
  11002. function login() {
  11003. var promise = new Promise(function (resolve, reject) {
  11004. wx.login({
  11005. success: function success(res) {
  11006. console.log(res);
  11007. // 发送 res.code 到后台换取 openId, sessionKey, unionId
  11008. wx.request({
  11009. url: 'https://t5.9026.com/api/v1/common/wxLogin',
  11010. data: {
  11011. wechat_code: res.code },
  11012. method: "POST",
  11013. header: {
  11014. 'content-type': 'application/json' },
  11015. success: function success(res) {
  11016. resolve(res);
  11017. },
  11018. fail: function fail(e) {
  11019. reject(e);
  11020. } });
  11021. },
  11022. fail: function fail(res) {
  11023. reject('登录失败');
  11024. } });
  11025. });
  11026. return promise;
  11027. }
  11028. // 获取用户信息
  11029. function getUserInfo() {
  11030. var promise = new Promise(function (resolve, reject) {
  11031. getAuthSetting('scope.userInfo', false, '用户信息').then(function (res) {
  11032. if (res) {
  11033. // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
  11034. wx.getUserInfo({
  11035. success: function success(res) {
  11036. // 可以将 res 发送给后台解码出 unionId
  11037. resolve('获取用户信息成功', res.userInfo);
  11038. } });
  11039. } else {
  11040. resolve(false);
  11041. }
  11042. }).catch(function (res) {
  11043. reject(res);
  11044. });
  11045. });
  11046. return promise;
  11047. }
  11048. // 打开授权设置界面
  11049. function openSetting(scope, isMust, name) {// scope是权限字段,isMust表示是否必须授权, name是授权信息名,用于模态框信息展示
  11050. var promise = new Promise(function (resolve, reject) {
  11051. wx.showModal({
  11052. title: '授权提示',
  11053. content: '请先授权获取' + name,
  11054. success: function success(res) {
  11055. if (res.confirm) {
  11056. wx.openSetting({
  11057. success: function success(res) {
  11058. if (res.authSetting[scope]) {// 用户打开了授权开关
  11059. resolve(true);
  11060. } else {// 用户没有打开授权开关, 继续打开设置页面
  11061. if (isMust) {
  11062. openSetting(scope, isMust, name);
  11063. } else {
  11064. reject('获取用户授权信息失败');
  11065. }
  11066. }
  11067. },
  11068. fail: function fail(res) {} });
  11069. } else if (res.cancel) {
  11070. if (isMust) {
  11071. openSetting(scope, isMust, name);
  11072. } else {
  11073. reject('获取用户授权信息失败');
  11074. }
  11075. }
  11076. } });
  11077. });
  11078. return promise;
  11079. }
  11080. function getAuthSetting(scope, isMust, name) {// 获取用户授权信息,scope是授权的权限字段名, isMust表示是否必须授权才能进行下一步
  11081. var promise = new Promise(function (resolve, reject) {
  11082. wx.getSetting({
  11083. success: function success(res) {
  11084. if (res.authSetting[scope]) {
  11085. resolve(true); // 用户已经授权
  11086. } else {
  11087. // 用户还没有授权,向用户发起授权请求
  11088. wx.authorize({
  11089. scope: scope,
  11090. success: function success() {// 用户同意授权
  11091. resolve(true);
  11092. },
  11093. fail: function fail() {// 用户不同意授权
  11094. if (isMust) {// 如果是必须授权才能进行下一步的接口,则打开设置页面
  11095. openSetting(scope, isMust, name).then(function (res) {
  11096. resolve(true);
  11097. }).catch(function (res) {
  11098. resolve(false);
  11099. });
  11100. } else {// 如果不是必须授权的接口,则直接返回未授权状态
  11101. resolve(false);
  11102. }
  11103. } });
  11104. }
  11105. },
  11106. fail: function fail(res) {
  11107. reject('获取用户授权信息失败');
  11108. } });
  11109. });
  11110. return promise;
  11111. }
  11112. function getLocation() {var _this2 = this; // 获取地理位置信息
  11113. var promise = new Promise(function (resolve, reject) {
  11114. getAuthSetting('scope.userLocation', true, '地理位置信息').then(function (res) {// 获取用户信息,must必须授权
  11115. if (res) {
  11116. // 已经授权,可以直接获取地理位置
  11117. var _this = _this2;
  11118. wx.getLocation({
  11119. type: 'wgs84',
  11120. success: function success(res) {
  11121. console.log(res);
  11122. var locationData = { // 新建一个对象用于保存经纬度等信息
  11123. latitude: res.latitude, // 纬度
  11124. longitude: res.longitude // 经度
  11125. };
  11126. var sig = utilMd5.hexMD5("/ws/geocoder/v1?key=" + tx_key + "&location=" + res.latitude + "," + res.longitude +
  11127. tx_secret_key);
  11128. var getAddressUrl = "https://apis.map.qq.com/ws/geocoder/v1?key=" + tx_key + "&location=" + res.latitude +
  11129. "," + res.longitude + "&sig=" + sig;
  11130. wx.request({ // 请求腾讯地图接口获取地理位置
  11131. url: getAddressUrl,
  11132. success: function success(res) {
  11133. if (res.data.status == 0) {// 获取地理位置成功
  11134. locationData.address = res.data.result;
  11135. resolve(locationData);
  11136. } else {// 获取地理位置信息失败
  11137. reject('获取地理位置信息失败');
  11138. }
  11139. } });
  11140. },
  11141. fail: function fail(res) {
  11142. reject('获取地理位置信息失败');
  11143. } });
  11144. } else {
  11145. }
  11146. }).catch(function (res) {
  11147. reject(res);
  11148. });
  11149. });
  11150. return promise;
  11151. }
  11152. module.exports = {
  11153. login: login, // 登录 + 获取openID
  11154. getUserInfo: getUserInfo, // 获取用户信息
  11155. getAuthSetting: getAuthSetting, // 获取授权信息, 可选择是否必须授权
  11156. getLocation: getLocation // 获取经纬度 + 经纬度通过腾讯地图签名校验的方式换取城市位置
  11157. };
  11158. /***/ }),
  11159. /***/ 53:
  11160. /*!**************************************************!*\
  11161. !*** E:/.swdz/uni-app/baoma/mabao/common/md5.js ***!
  11162. \**************************************************/
  11163. /*! no static exports found */
  11164. /***/ (function(module, exports) {
  11165. /*
  11166. * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
  11167. * Digest Algorithm, as defined in RFC 1321.
  11168. * Version 1.1 Copyright (C) Paul Johnston 1999 - 2002.
  11169. * Code also contributed by Greg Holt
  11170. * See http://pajhome.org.uk/site/legal.html for details.
  11171. */
  11172. /*
  11173. * Add integers, wrapping at 2^32. This uses 16-bit operations internally
  11174. * to work around bugs in some JS interpreters.
  11175. */
  11176. function safe_add(x, y) {
  11177. var lsw = (x & 0xFFFF) + (y & 0xFFFF);
  11178. var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  11179. return msw << 16 | lsw & 0xFFFF;
  11180. }
  11181. /*
  11182. * Bitwise rotate a 32-bit number to the left.
  11183. */
  11184. function rol(num, cnt) {
  11185. return num << cnt | num >>> 32 - cnt;
  11186. }
  11187. /*
  11188. * These functions implement the four basic operations the algorithm uses.
  11189. */
  11190. function cmn(q, a, b, x, s, t) {
  11191. return safe_add(rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
  11192. }
  11193. function ff(a, b, c, d, x, s, t) {
  11194. return cmn(b & c | ~b & d, a, b, x, s, t);
  11195. }
  11196. function gg(a, b, c, d, x, s, t) {
  11197. return cmn(b & d | c & ~d, a, b, x, s, t);
  11198. }
  11199. function hh(a, b, c, d, x, s, t) {
  11200. return cmn(b ^ c ^ d, a, b, x, s, t);
  11201. }
  11202. function ii(a, b, c, d, x, s, t) {
  11203. return cmn(c ^ (b | ~d), a, b, x, s, t);
  11204. }
  11205. /*
  11206. * Calculate the MD5 of an array of little-endian words, producing an array
  11207. * of little-endian words.
  11208. */
  11209. function coreMD5(x) {
  11210. var a = 1732584193;
  11211. var b = -271733879;
  11212. var c = -1732584194;
  11213. var d = 271733878;
  11214. for (var i = 0; i < x.length; i += 16) {
  11215. var olda = a;
  11216. var oldb = b;
  11217. var oldc = c;
  11218. var oldd = d;
  11219. a = ff(a, b, c, d, x[i + 0], 7, -680876936);
  11220. d = ff(d, a, b, c, x[i + 1], 12, -389564586);
  11221. c = ff(c, d, a, b, x[i + 2], 17, 606105819);
  11222. b = ff(b, c, d, a, x[i + 3], 22, -1044525330);
  11223. a = ff(a, b, c, d, x[i + 4], 7, -176418897);
  11224. d = ff(d, a, b, c, x[i + 5], 12, 1200080426);
  11225. c = ff(c, d, a, b, x[i + 6], 17, -1473231341);
  11226. b = ff(b, c, d, a, x[i + 7], 22, -45705983);
  11227. a = ff(a, b, c, d, x[i + 8], 7, 1770035416);
  11228. d = ff(d, a, b, c, x[i + 9], 12, -1958414417);
  11229. c = ff(c, d, a, b, x[i + 10], 17, -42063);
  11230. b = ff(b, c, d, a, x[i + 11], 22, -1990404162);
  11231. a = ff(a, b, c, d, x[i + 12], 7, 1804603682);
  11232. d = ff(d, a, b, c, x[i + 13], 12, -40341101);
  11233. c = ff(c, d, a, b, x[i + 14], 17, -1502002290);
  11234. b = ff(b, c, d, a, x[i + 15], 22, 1236535329);
  11235. a = gg(a, b, c, d, x[i + 1], 5, -165796510);
  11236. d = gg(d, a, b, c, x[i + 6], 9, -1069501632);
  11237. c = gg(c, d, a, b, x[i + 11], 14, 643717713);
  11238. b = gg(b, c, d, a, x[i + 0], 20, -373897302);
  11239. a = gg(a, b, c, d, x[i + 5], 5, -701558691);
  11240. d = gg(d, a, b, c, x[i + 10], 9, 38016083);
  11241. c = gg(c, d, a, b, x[i + 15], 14, -660478335);
  11242. b = gg(b, c, d, a, x[i + 4], 20, -405537848);
  11243. a = gg(a, b, c, d, x[i + 9], 5, 568446438);
  11244. d = gg(d, a, b, c, x[i + 14], 9, -1019803690);
  11245. c = gg(c, d, a, b, x[i + 3], 14, -187363961);
  11246. b = gg(b, c, d, a, x[i + 8], 20, 1163531501);
  11247. a = gg(a, b, c, d, x[i + 13], 5, -1444681467);
  11248. d = gg(d, a, b, c, x[i + 2], 9, -51403784);
  11249. c = gg(c, d, a, b, x[i + 7], 14, 1735328473);
  11250. b = gg(b, c, d, a, x[i + 12], 20, -1926607734);
  11251. a = hh(a, b, c, d, x[i + 5], 4, -378558);
  11252. d = hh(d, a, b, c, x[i + 8], 11, -2022574463);
  11253. c = hh(c, d, a, b, x[i + 11], 16, 1839030562);
  11254. b = hh(b, c, d, a, x[i + 14], 23, -35309556);
  11255. a = hh(a, b, c, d, x[i + 1], 4, -1530992060);
  11256. d = hh(d, a, b, c, x[i + 4], 11, 1272893353);
  11257. c = hh(c, d, a, b, x[i + 7], 16, -155497632);
  11258. b = hh(b, c, d, a, x[i + 10], 23, -1094730640);
  11259. a = hh(a, b, c, d, x[i + 13], 4, 681279174);
  11260. d = hh(d, a, b, c, x[i + 0], 11, -358537222);
  11261. c = hh(c, d, a, b, x[i + 3], 16, -722521979);
  11262. b = hh(b, c, d, a, x[i + 6], 23, 76029189);
  11263. a = hh(a, b, c, d, x[i + 9], 4, -640364487);
  11264. d = hh(d, a, b, c, x[i + 12], 11, -421815835);
  11265. c = hh(c, d, a, b, x[i + 15], 16, 530742520);
  11266. b = hh(b, c, d, a, x[i + 2], 23, -995338651);
  11267. a = ii(a, b, c, d, x[i + 0], 6, -198630844);
  11268. d = ii(d, a, b, c, x[i + 7], 10, 1126891415);
  11269. c = ii(c, d, a, b, x[i + 14], 15, -1416354905);
  11270. b = ii(b, c, d, a, x[i + 5], 21, -57434055);
  11271. a = ii(a, b, c, d, x[i + 12], 6, 1700485571);
  11272. d = ii(d, a, b, c, x[i + 3], 10, -1894986606);
  11273. c = ii(c, d, a, b, x[i + 10], 15, -1051523);
  11274. b = ii(b, c, d, a, x[i + 1], 21, -2054922799);
  11275. a = ii(a, b, c, d, x[i + 8], 6, 1873313359);
  11276. d = ii(d, a, b, c, x[i + 15], 10, -30611744);
  11277. c = ii(c, d, a, b, x[i + 6], 15, -1560198380);
  11278. b = ii(b, c, d, a, x[i + 13], 21, 1309151649);
  11279. a = ii(a, b, c, d, x[i + 4], 6, -145523070);
  11280. d = ii(d, a, b, c, x[i + 11], 10, -1120210379);
  11281. c = ii(c, d, a, b, x[i + 2], 15, 718787259);
  11282. b = ii(b, c, d, a, x[i + 9], 21, -343485551);
  11283. a = safe_add(a, olda);
  11284. b = safe_add(b, oldb);
  11285. c = safe_add(c, oldc);
  11286. d = safe_add(d, oldd);
  11287. }
  11288. return [a, b, c, d];
  11289. }
  11290. /*
  11291. * Convert an array of little-endian words to a hex string.
  11292. */
  11293. function binl2hex(binarray) {
  11294. var hex_tab = "0123456789abcdef";
  11295. var str = "";
  11296. for (var i = 0; i < binarray.length * 4; i++) {
  11297. str += hex_tab.charAt(binarray[i >> 2] >> i % 4 * 8 + 4 & 0xF) +
  11298. hex_tab.charAt(binarray[i >> 2] >> i % 4 * 8 & 0xF);
  11299. }
  11300. return str;
  11301. }
  11302. /*
  11303. * Convert an array of little-endian words to a base64 encoded string.
  11304. */
  11305. function binl2b64(binarray) {
  11306. var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  11307. var str = "";
  11308. for (var i = 0; i < binarray.length * 32; i += 6) {
  11309. str += tab.charAt(binarray[i >> 5] << i % 32 & 0x3F |
  11310. binarray[i >> 5 + 1] >> 32 - i % 32 & 0x3F);
  11311. }
  11312. return str;
  11313. }
  11314. /*
  11315. * Convert an 8-bit character string to a sequence of 16-word blocks, stored
  11316. * as an array, and append appropriate padding for MD4/5 calculation.
  11317. * If any of the characters are >255, the high byte is silently ignored.
  11318. */
  11319. function str2binl(str) {
  11320. var nblk = (str.length + 8 >> 6) + 1; // number of 16-word blocks
  11321. var blks = new Array(nblk * 16);
  11322. for (var i = 0; i < nblk * 16; i++) {blks[i] = 0;}
  11323. for (var i = 0; i < str.length; i++) {
  11324. blks[i >> 2] |= (str.charCodeAt(i) & 0xFF) << i % 4 * 8;}
  11325. blks[i >> 2] |= 0x80 << i % 4 * 8;
  11326. blks[nblk * 16 - 2] = str.length * 8;
  11327. return blks;
  11328. }
  11329. /*
  11330. * Convert a wide-character string to a sequence of 16-word blocks, stored as
  11331. * an array, and append appropriate padding for MD4/5 calculation.
  11332. */
  11333. function strw2binl(str) {
  11334. var nblk = (str.length + 4 >> 5) + 1; // number of 16-word blocks
  11335. var blks = new Array(nblk * 16);
  11336. for (var i = 0; i < nblk * 16; i++) {blks[i] = 0;}
  11337. for (var i = 0; i < str.length; i++) {
  11338. blks[i >> 1] |= str.charCodeAt(i) << i % 2 * 16;}
  11339. blks[i >> 1] |= 0x80 << i % 2 * 16;
  11340. blks[nblk * 16 - 2] = str.length * 16;
  11341. return blks;
  11342. }
  11343. /*
  11344. * External interface
  11345. */
  11346. function hexMD5(str) {return binl2hex(coreMD5(str2binl(str)));}
  11347. function hexMD5w(str) {return binl2hex(coreMD5(strw2binl(str)));}
  11348. function b64MD5(str) {return binl2b64(coreMD5(str2binl(str)));}
  11349. function b64MD5w(str) {return binl2b64(coreMD5(strw2binl(str)));}
  11350. /* Backward compatibility */
  11351. function calcMD5(str) {return binl2hex(coreMD5(str2binl(str)));}
  11352. module.exports = {
  11353. hexMD5: hexMD5 };
  11354. /***/ })
  11355. }]);
  11356. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map