vendor.js 359 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["common/vendor"],[
  2. /* 0 */,
  3. /* 1 */
  4. /*!************************************************************!*\
  5. !*** ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js ***!
  6. \************************************************************/
  7. /*! no static exports found */
  8. /***/ (function(module, exports, __webpack_require__) {
  9. "use strict";
  10. Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 2));
  11. var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 4);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}
  12. function b64DecodeUnicode(str) {
  13. return decodeURIComponent(atob(str).split('').map(function (c) {
  14. return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
  15. }).join(''));
  16. }
  17. function getCurrentUserInfo() {
  18. var token = wx.getStorageSync('uni_id_token') || '';
  19. var tokenArr = token.split('.');
  20. if (!token || tokenArr.length !== 3) {
  21. return {
  22. uid: null,
  23. role: [],
  24. permission: [],
  25. tokenExpired: 0 };
  26. }
  27. var userInfo;
  28. try {
  29. userInfo = JSON.parse(b64DecodeUnicode(tokenArr[1]));
  30. } catch (error) {
  31. throw new Error('获取当前用户信息出错,详细错误信息为:' + error.message);
  32. }
  33. userInfo.tokenExpired = userInfo.exp * 1000;
  34. delete userInfo.exp;
  35. delete userInfo.iat;
  36. return userInfo;
  37. }
  38. function uniIdMixin(Vue) {
  39. Vue.prototype.uniIDHasRole = function (roleId) {var _getCurrentUserInfo =
  40. getCurrentUserInfo(),role = _getCurrentUserInfo.role;
  41. return role.indexOf(roleId) > -1;
  42. };
  43. Vue.prototype.uniIDHasPermission = function (permissionId) {var _getCurrentUserInfo2 =
  44. getCurrentUserInfo(),permission = _getCurrentUserInfo2.permission;
  45. return this.uniIDHasRole('admin') || permission.indexOf(permissionId) > -1;
  46. };
  47. Vue.prototype.uniIDTokenValid = function () {var _getCurrentUserInfo3 =
  48. getCurrentUserInfo(),tokenExpired = _getCurrentUserInfo3.tokenExpired;
  49. return tokenExpired > Date.now();
  50. };
  51. }
  52. var _toString = Object.prototype.toString;
  53. var hasOwnProperty = Object.prototype.hasOwnProperty;
  54. function isFn(fn) {
  55. return typeof fn === 'function';
  56. }
  57. function isStr(str) {
  58. return typeof str === 'string';
  59. }
  60. function isPlainObject(obj) {
  61. return _toString.call(obj) === '[object Object]';
  62. }
  63. function hasOwn(obj, key) {
  64. return hasOwnProperty.call(obj, key);
  65. }
  66. function noop() {}
  67. /**
  68. * Create a cached version of a pure function.
  69. */
  70. function cached(fn) {
  71. var cache = Object.create(null);
  72. return function cachedFn(str) {
  73. var hit = cache[str];
  74. return hit || (cache[str] = fn(str));
  75. };
  76. }
  77. /**
  78. * Camelize a hyphen-delimited string.
  79. */
  80. var camelizeRE = /-(\w)/g;
  81. var camelize = cached(function (str) {
  82. return str.replace(camelizeRE, function (_, c) {return c ? c.toUpperCase() : '';});
  83. });
  84. var HOOKS = [
  85. 'invoke',
  86. 'success',
  87. 'fail',
  88. 'complete',
  89. 'returnValue'];
  90. var globalInterceptors = {};
  91. var scopedInterceptors = {};
  92. function mergeHook(parentVal, childVal) {
  93. var res = childVal ?
  94. parentVal ?
  95. parentVal.concat(childVal) :
  96. Array.isArray(childVal) ?
  97. childVal : [childVal] :
  98. parentVal;
  99. return res ?
  100. dedupeHooks(res) :
  101. res;
  102. }
  103. function dedupeHooks(hooks) {
  104. var res = [];
  105. for (var i = 0; i < hooks.length; i++) {
  106. if (res.indexOf(hooks[i]) === -1) {
  107. res.push(hooks[i]);
  108. }
  109. }
  110. return res;
  111. }
  112. function removeHook(hooks, hook) {
  113. var index = hooks.indexOf(hook);
  114. if (index !== -1) {
  115. hooks.splice(index, 1);
  116. }
  117. }
  118. function mergeInterceptorHook(interceptor, option) {
  119. Object.keys(option).forEach(function (hook) {
  120. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  121. interceptor[hook] = mergeHook(interceptor[hook], option[hook]);
  122. }
  123. });
  124. }
  125. function removeInterceptorHook(interceptor, option) {
  126. if (!interceptor || !option) {
  127. return;
  128. }
  129. Object.keys(option).forEach(function (hook) {
  130. if (HOOKS.indexOf(hook) !== -1 && isFn(option[hook])) {
  131. removeHook(interceptor[hook], option[hook]);
  132. }
  133. });
  134. }
  135. function addInterceptor(method, option) {
  136. if (typeof method === 'string' && isPlainObject(option)) {
  137. mergeInterceptorHook(scopedInterceptors[method] || (scopedInterceptors[method] = {}), option);
  138. } else if (isPlainObject(method)) {
  139. mergeInterceptorHook(globalInterceptors, method);
  140. }
  141. }
  142. function removeInterceptor(method, option) {
  143. if (typeof method === 'string') {
  144. if (isPlainObject(option)) {
  145. removeInterceptorHook(scopedInterceptors[method], option);
  146. } else {
  147. delete scopedInterceptors[method];
  148. }
  149. } else if (isPlainObject(method)) {
  150. removeInterceptorHook(globalInterceptors, method);
  151. }
  152. }
  153. function wrapperHook(hook) {
  154. return function (data) {
  155. return hook(data) || data;
  156. };
  157. }
  158. function isPromise(obj) {
  159. return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
  160. }
  161. function queue(hooks, data) {
  162. var promise = false;
  163. for (var i = 0; i < hooks.length; i++) {
  164. var hook = hooks[i];
  165. if (promise) {
  166. promise = Promise.resolve(wrapperHook(hook));
  167. } else {
  168. var res = hook(data);
  169. if (isPromise(res)) {
  170. promise = Promise.resolve(res);
  171. }
  172. if (res === false) {
  173. return {
  174. then: function then() {} };
  175. }
  176. }
  177. }
  178. return promise || {
  179. then: function then(callback) {
  180. return callback(data);
  181. } };
  182. }
  183. function wrapperOptions(interceptor) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  184. ['success', 'fail', 'complete'].forEach(function (name) {
  185. if (Array.isArray(interceptor[name])) {
  186. var oldCallback = options[name];
  187. options[name] = function callbackInterceptor(res) {
  188. queue(interceptor[name], res).then(function (res) {
  189. /* eslint-disable no-mixed-operators */
  190. return isFn(oldCallback) && oldCallback(res) || res;
  191. });
  192. };
  193. }
  194. });
  195. return options;
  196. }
  197. function wrapperReturnValue(method, returnValue) {
  198. var returnValueHooks = [];
  199. if (Array.isArray(globalInterceptors.returnValue)) {
  200. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(globalInterceptors.returnValue));
  201. }
  202. var interceptor = scopedInterceptors[method];
  203. if (interceptor && Array.isArray(interceptor.returnValue)) {
  204. returnValueHooks.push.apply(returnValueHooks, _toConsumableArray(interceptor.returnValue));
  205. }
  206. returnValueHooks.forEach(function (hook) {
  207. returnValue = hook(returnValue) || returnValue;
  208. });
  209. return returnValue;
  210. }
  211. function getApiInterceptorHooks(method) {
  212. var interceptor = Object.create(null);
  213. Object.keys(globalInterceptors).forEach(function (hook) {
  214. if (hook !== 'returnValue') {
  215. interceptor[hook] = globalInterceptors[hook].slice();
  216. }
  217. });
  218. var scopedInterceptor = scopedInterceptors[method];
  219. if (scopedInterceptor) {
  220. Object.keys(scopedInterceptor).forEach(function (hook) {
  221. if (hook !== 'returnValue') {
  222. interceptor[hook] = (interceptor[hook] || []).concat(scopedInterceptor[hook]);
  223. }
  224. });
  225. }
  226. return interceptor;
  227. }
  228. 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];}
  229. var interceptor = getApiInterceptorHooks(method);
  230. if (interceptor && Object.keys(interceptor).length) {
  231. if (Array.isArray(interceptor.invoke)) {
  232. var res = queue(interceptor.invoke, options);
  233. return res.then(function (options) {
  234. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  235. });
  236. } else {
  237. return api.apply(void 0, [wrapperOptions(interceptor, options)].concat(params));
  238. }
  239. }
  240. return api.apply(void 0, [options].concat(params));
  241. }
  242. var promiseInterceptor = {
  243. returnValue: function returnValue(res) {
  244. if (!isPromise(res)) {
  245. return res;
  246. }
  247. return new Promise(function (resolve, reject) {
  248. res.then(function (res) {
  249. if (res[0]) {
  250. reject(res[0]);
  251. } else {
  252. resolve(res[1]);
  253. }
  254. });
  255. });
  256. } };
  257. var SYNC_API_RE =
  258. /^\$|Window$|WindowStyle$|sendNativeEvent|restoreGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale/;
  259. var CONTEXT_API_RE = /^create|Manager$/;
  260. // Context例外情况
  261. var CONTEXT_API_RE_EXC = ['createBLEConnection'];
  262. // 同步例外情况
  263. var ASYNC_API = ['createBLEConnection'];
  264. var CALLBACK_API_RE = /^on|^off/;
  265. function isContextApi(name) {
  266. return CONTEXT_API_RE.test(name) && CONTEXT_API_RE_EXC.indexOf(name) === -1;
  267. }
  268. function isSyncApi(name) {
  269. return SYNC_API_RE.test(name) && ASYNC_API.indexOf(name) === -1;
  270. }
  271. function isCallbackApi(name) {
  272. return CALLBACK_API_RE.test(name) && name !== 'onPush';
  273. }
  274. function handlePromise(promise) {
  275. return promise.then(function (data) {
  276. return [null, data];
  277. }).
  278. catch(function (err) {return [err];});
  279. }
  280. function shouldPromise(name) {
  281. if (
  282. isContextApi(name) ||
  283. isSyncApi(name) ||
  284. isCallbackApi(name))
  285. {
  286. return false;
  287. }
  288. return true;
  289. }
  290. /* eslint-disable no-extend-native */
  291. if (!Promise.prototype.finally) {
  292. Promise.prototype.finally = function (callback) {
  293. var promise = this.constructor;
  294. return this.then(
  295. function (value) {return promise.resolve(callback()).then(function () {return value;});},
  296. function (reason) {return promise.resolve(callback()).then(function () {
  297. throw reason;
  298. });});
  299. };
  300. }
  301. function promisify(name, api) {
  302. if (!shouldPromise(name)) {
  303. return api;
  304. }
  305. 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];}
  306. if (isFn(options.success) || isFn(options.fail) || isFn(options.complete)) {
  307. return wrapperReturnValue(name, invokeApi.apply(void 0, [name, api, options].concat(params)));
  308. }
  309. return wrapperReturnValue(name, handlePromise(new Promise(function (resolve, reject) {
  310. invokeApi.apply(void 0, [name, api, Object.assign({}, options, {
  311. success: resolve,
  312. fail: reject })].concat(
  313. params));
  314. })));
  315. };
  316. }
  317. var EPS = 1e-4;
  318. var BASE_DEVICE_WIDTH = 750;
  319. var isIOS = false;
  320. var deviceWidth = 0;
  321. var deviceDPR = 0;
  322. function checkDeviceWidth() {var _wx$getSystemInfoSync =
  323. wx.getSystemInfoSync(),platform = _wx$getSystemInfoSync.platform,pixelRatio = _wx$getSystemInfoSync.pixelRatio,windowWidth = _wx$getSystemInfoSync.windowWidth; // uni=>wx runtime 编译目标是 uni 对象,内部不允许直接使用 uni
  324. deviceWidth = windowWidth;
  325. deviceDPR = pixelRatio;
  326. isIOS = platform === 'ios';
  327. }
  328. function upx2px(number, newDeviceWidth) {
  329. if (deviceWidth === 0) {
  330. checkDeviceWidth();
  331. }
  332. number = Number(number);
  333. if (number === 0) {
  334. return 0;
  335. }
  336. var result = number / BASE_DEVICE_WIDTH * (newDeviceWidth || deviceWidth);
  337. if (result < 0) {
  338. result = -result;
  339. }
  340. result = Math.floor(result + EPS);
  341. if (result === 0) {
  342. if (deviceDPR === 1 || !isIOS) {
  343. result = 1;
  344. } else {
  345. result = 0.5;
  346. }
  347. }
  348. return number < 0 ? -result : result;
  349. }
  350. function getLocale() {
  351. // 优先使用 $locale
  352. var app = getApp({
  353. allowDefault: true });
  354. if (app && app.$vm) {
  355. return app.$vm.$locale;
  356. }
  357. return wx.getSystemInfoSync().language || 'zh-Hans';
  358. }
  359. function setLocale(locale) {
  360. var app = getApp();
  361. if (!app) {
  362. return false;
  363. }
  364. var oldLocale = app.$vm.$locale;
  365. if (oldLocale !== locale) {
  366. app.$vm.$locale = locale;
  367. onLocaleChangeCallbacks.forEach(function (fn) {return fn({
  368. locale: locale });});
  369. return true;
  370. }
  371. return false;
  372. }
  373. var onLocaleChangeCallbacks = [];
  374. function onLocaleChange(fn) {
  375. if (onLocaleChangeCallbacks.indexOf(fn) === -1) {
  376. onLocaleChangeCallbacks.push(fn);
  377. }
  378. }
  379. var interceptors = {
  380. promiseInterceptor: promiseInterceptor };
  381. var baseApi = /*#__PURE__*/Object.freeze({
  382. __proto__: null,
  383. upx2px: upx2px,
  384. getLocale: getLocale,
  385. setLocale: setLocale,
  386. onLocaleChange: onLocaleChange,
  387. addInterceptor: addInterceptor,
  388. removeInterceptor: removeInterceptor,
  389. interceptors: interceptors });
  390. function findExistsPageIndex(url) {
  391. var pages = getCurrentPages();
  392. var len = pages.length;
  393. while (len--) {
  394. var page = pages[len];
  395. if (page.$page && page.$page.fullPath === url) {
  396. return len;
  397. }
  398. }
  399. return -1;
  400. }
  401. var redirectTo = {
  402. name: function name(fromArgs) {
  403. if (fromArgs.exists === 'back' && fromArgs.delta) {
  404. return 'navigateBack';
  405. }
  406. return 'redirectTo';
  407. },
  408. args: function args(fromArgs) {
  409. if (fromArgs.exists === 'back' && fromArgs.url) {
  410. var existsPageIndex = findExistsPageIndex(fromArgs.url);
  411. if (existsPageIndex !== -1) {
  412. var delta = getCurrentPages().length - 1 - existsPageIndex;
  413. if (delta > 0) {
  414. fromArgs.delta = delta;
  415. }
  416. }
  417. }
  418. } };
  419. var previewImage = {
  420. args: function args(fromArgs) {
  421. var currentIndex = parseInt(fromArgs.current);
  422. if (isNaN(currentIndex)) {
  423. return;
  424. }
  425. var urls = fromArgs.urls;
  426. if (!Array.isArray(urls)) {
  427. return;
  428. }
  429. var len = urls.length;
  430. if (!len) {
  431. return;
  432. }
  433. if (currentIndex < 0) {
  434. currentIndex = 0;
  435. } else if (currentIndex >= len) {
  436. currentIndex = len - 1;
  437. }
  438. if (currentIndex > 0) {
  439. fromArgs.current = urls[currentIndex];
  440. fromArgs.urls = urls.filter(
  441. function (item, index) {return index < currentIndex ? item !== urls[currentIndex] : true;});
  442. } else {
  443. fromArgs.current = urls[0];
  444. }
  445. return {
  446. indicator: false,
  447. loop: false };
  448. } };
  449. var UUID_KEY = '__DC_STAT_UUID';
  450. var deviceId;
  451. function addUuid(result) {
  452. deviceId = deviceId || wx.getStorageSync(UUID_KEY);
  453. if (!deviceId) {
  454. deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7);
  455. wx.setStorage({
  456. key: UUID_KEY,
  457. data: deviceId });
  458. }
  459. result.deviceId = deviceId;
  460. }
  461. function addSafeAreaInsets(result) {
  462. if (result.safeArea) {
  463. var safeArea = result.safeArea;
  464. result.safeAreaInsets = {
  465. top: safeArea.top,
  466. left: safeArea.left,
  467. right: result.windowWidth - safeArea.right,
  468. bottom: result.windowHeight - safeArea.bottom };
  469. }
  470. }
  471. var getSystemInfo = {
  472. returnValue: function returnValue(result) {
  473. addUuid(result);
  474. addSafeAreaInsets(result);
  475. } };
  476. // import navigateTo from 'uni-helpers/navigate-to'
  477. var protocols = {
  478. redirectTo: redirectTo,
  479. // navigateTo, // 由于在微信开发者工具的页面参数,会显示__id__参数,因此暂时关闭mp-weixin对于navigateTo的AOP
  480. previewImage: previewImage,
  481. getSystemInfo: getSystemInfo,
  482. getSystemInfoSync: getSystemInfo };
  483. var todos = [
  484. 'vibrate',
  485. 'preloadPage',
  486. 'unPreloadPage',
  487. 'loadSubPackage'];
  488. var canIUses = [];
  489. var CALLBACKS = ['success', 'fail', 'cancel', 'complete'];
  490. function processCallback(methodName, method, returnValue) {
  491. return function (res) {
  492. return method(processReturnValue(methodName, res, returnValue));
  493. };
  494. }
  495. 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;
  496. if (isPlainObject(fromArgs)) {// 一般 api 的参数解析
  497. var toArgs = keepFromArgs === true ? fromArgs : {}; // returnValue 为 false 时,说明是格式化返回值,直接在返回值对象上修改赋值
  498. if (isFn(argsOption)) {
  499. argsOption = argsOption(fromArgs, toArgs) || {};
  500. }
  501. for (var key in fromArgs) {
  502. if (hasOwn(argsOption, key)) {
  503. var keyOption = argsOption[key];
  504. if (isFn(keyOption)) {
  505. keyOption = keyOption(fromArgs[key], fromArgs, toArgs);
  506. }
  507. if (!keyOption) {// 不支持的参数
  508. console.warn("The '".concat(methodName, "' method of platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support option '").concat(key, "'"));
  509. } else if (isStr(keyOption)) {// 重写参数 key
  510. toArgs[keyOption] = fromArgs[key];
  511. } else if (isPlainObject(keyOption)) {// {name:newName,value:value}可重新指定参数 key:value
  512. toArgs[keyOption.name ? keyOption.name : key] = keyOption.value;
  513. }
  514. } else if (CALLBACKS.indexOf(key) !== -1) {
  515. if (isFn(fromArgs[key])) {
  516. toArgs[key] = processCallback(methodName, fromArgs[key], returnValue);
  517. }
  518. } else {
  519. if (!keepFromArgs) {
  520. toArgs[key] = fromArgs[key];
  521. }
  522. }
  523. }
  524. return toArgs;
  525. } else if (isFn(fromArgs)) {
  526. fromArgs = processCallback(methodName, fromArgs, returnValue);
  527. }
  528. return fromArgs;
  529. }
  530. function processReturnValue(methodName, res, returnValue) {var keepReturnValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
  531. if (isFn(protocols.returnValue)) {// 处理通用 returnValue
  532. res = protocols.returnValue(methodName, res);
  533. }
  534. return processArgs(methodName, res, returnValue, {}, keepReturnValue);
  535. }
  536. function wrapper(methodName, method) {
  537. if (hasOwn(protocols, methodName)) {
  538. var protocol = protocols[methodName];
  539. if (!protocol) {// 暂不支持的 api
  540. return function () {
  541. console.error("Platform '\u5FAE\u4FE1\u5C0F\u7A0B\u5E8F' does not support '".concat(methodName, "'."));
  542. };
  543. }
  544. return function (arg1, arg2) {// 目前 api 最多两个参数
  545. var options = protocol;
  546. if (isFn(protocol)) {
  547. options = protocol(arg1);
  548. }
  549. arg1 = processArgs(methodName, arg1, options.args, options.returnValue);
  550. var args = [arg1];
  551. if (typeof arg2 !== 'undefined') {
  552. args.push(arg2);
  553. }
  554. if (isFn(options.name)) {
  555. methodName = options.name(arg1);
  556. } else if (isStr(options.name)) {
  557. methodName = options.name;
  558. }
  559. var returnValue = wx[methodName].apply(wx, args);
  560. if (isSyncApi(methodName)) {// 同步 api
  561. return processReturnValue(methodName, returnValue, options.returnValue, isContextApi(methodName));
  562. }
  563. return returnValue;
  564. };
  565. }
  566. return method;
  567. }
  568. var todoApis = Object.create(null);
  569. var TODOS = [
  570. 'onTabBarMidButtonTap',
  571. 'subscribePush',
  572. 'unsubscribePush',
  573. 'onPush',
  574. 'offPush',
  575. 'share'];
  576. function createTodoApi(name) {
  577. return function todoApi(_ref)
  578. {var fail = _ref.fail,complete = _ref.complete;
  579. var res = {
  580. errMsg: "".concat(name, ":fail method '").concat(name, "' not supported") };
  581. isFn(fail) && fail(res);
  582. isFn(complete) && complete(res);
  583. };
  584. }
  585. TODOS.forEach(function (name) {
  586. todoApis[name] = createTodoApi(name);
  587. });
  588. var providers = {
  589. oauth: ['weixin'],
  590. share: ['weixin'],
  591. payment: ['wxpay'],
  592. push: ['weixin'] };
  593. function getProvider(_ref2)
  594. {var service = _ref2.service,success = _ref2.success,fail = _ref2.fail,complete = _ref2.complete;
  595. var res = false;
  596. if (providers[service]) {
  597. res = {
  598. errMsg: 'getProvider:ok',
  599. service: service,
  600. provider: providers[service] };
  601. isFn(success) && success(res);
  602. } else {
  603. res = {
  604. errMsg: 'getProvider:fail service not found' };
  605. isFn(fail) && fail(res);
  606. }
  607. isFn(complete) && complete(res);
  608. }
  609. var extraApi = /*#__PURE__*/Object.freeze({
  610. __proto__: null,
  611. getProvider: getProvider });
  612. var getEmitter = function () {
  613. var Emitter;
  614. return function getUniEmitter() {
  615. if (!Emitter) {
  616. Emitter = new _vue.default();
  617. }
  618. return Emitter;
  619. };
  620. }();
  621. function apply(ctx, method, args) {
  622. return ctx[method].apply(ctx, args);
  623. }
  624. function $on() {
  625. return apply(getEmitter(), '$on', Array.prototype.slice.call(arguments));
  626. }
  627. function $off() {
  628. return apply(getEmitter(), '$off', Array.prototype.slice.call(arguments));
  629. }
  630. function $once() {
  631. return apply(getEmitter(), '$once', Array.prototype.slice.call(arguments));
  632. }
  633. function $emit() {
  634. return apply(getEmitter(), '$emit', Array.prototype.slice.call(arguments));
  635. }
  636. var eventApi = /*#__PURE__*/Object.freeze({
  637. __proto__: null,
  638. $on: $on,
  639. $off: $off,
  640. $once: $once,
  641. $emit: $emit });
  642. var api = /*#__PURE__*/Object.freeze({
  643. __proto__: null });
  644. var MPPage = Page;
  645. var MPComponent = Component;
  646. var customizeRE = /:/g;
  647. var customize = cached(function (str) {
  648. return camelize(str.replace(customizeRE, '-'));
  649. });
  650. function initTriggerEvent(mpInstance) {
  651. {
  652. if (!wx.canIUse || !wx.canIUse('nextTick')) {
  653. return;
  654. }
  655. }
  656. var oldTriggerEvent = mpInstance.triggerEvent;
  657. mpInstance.triggerEvent = function (event) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}
  658. return oldTriggerEvent.apply(mpInstance, [customize(event)].concat(args));
  659. };
  660. }
  661. function initHook(name, options, isComponent) {
  662. var oldHook = options[name];
  663. if (!oldHook) {
  664. options[name] = function () {
  665. initTriggerEvent(this);
  666. };
  667. } else {
  668. options[name] = function () {
  669. initTriggerEvent(this);for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}
  670. return oldHook.apply(this, args);
  671. };
  672. }
  673. }
  674. if (!MPPage.__$wrappered) {
  675. MPPage.__$wrappered = true;
  676. Page = function Page() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  677. initHook('onLoad', options);
  678. return MPPage(options);
  679. };
  680. Page.after = MPPage.after;
  681. Component = function Component() {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  682. initHook('created', options);
  683. return MPComponent(options);
  684. };
  685. }
  686. var PAGE_EVENT_HOOKS = [
  687. 'onPullDownRefresh',
  688. 'onReachBottom',
  689. 'onAddToFavorites',
  690. 'onShareTimeline',
  691. 'onShareAppMessage',
  692. 'onPageScroll',
  693. 'onResize',
  694. 'onTabItemTap'];
  695. function initMocks(vm, mocks) {
  696. var mpInstance = vm.$mp[vm.mpType];
  697. mocks.forEach(function (mock) {
  698. if (hasOwn(mpInstance, mock)) {
  699. vm[mock] = mpInstance[mock];
  700. }
  701. });
  702. }
  703. function hasHook(hook, vueOptions) {
  704. if (!vueOptions) {
  705. return true;
  706. }
  707. if (_vue.default.options && Array.isArray(_vue.default.options[hook])) {
  708. return true;
  709. }
  710. vueOptions = vueOptions.default || vueOptions;
  711. if (isFn(vueOptions)) {
  712. if (isFn(vueOptions.extendOptions[hook])) {
  713. return true;
  714. }
  715. if (vueOptions.super &&
  716. vueOptions.super.options &&
  717. Array.isArray(vueOptions.super.options[hook])) {
  718. return true;
  719. }
  720. return false;
  721. }
  722. if (isFn(vueOptions[hook])) {
  723. return true;
  724. }
  725. var mixins = vueOptions.mixins;
  726. if (Array.isArray(mixins)) {
  727. return !!mixins.find(function (mixin) {return hasHook(hook, mixin);});
  728. }
  729. }
  730. function initHooks(mpOptions, hooks, vueOptions) {
  731. hooks.forEach(function (hook) {
  732. if (hasHook(hook, vueOptions)) {
  733. mpOptions[hook] = function (args) {
  734. return this.$vm && this.$vm.__call_hook(hook, args);
  735. };
  736. }
  737. });
  738. }
  739. function initVueComponent(Vue, vueOptions) {
  740. vueOptions = vueOptions.default || vueOptions;
  741. var VueComponent;
  742. if (isFn(vueOptions)) {
  743. VueComponent = vueOptions;
  744. } else {
  745. VueComponent = Vue.extend(vueOptions);
  746. }
  747. vueOptions = VueComponent.options;
  748. return [VueComponent, vueOptions];
  749. }
  750. function initSlots(vm, vueSlots) {
  751. if (Array.isArray(vueSlots) && vueSlots.length) {
  752. var $slots = Object.create(null);
  753. vueSlots.forEach(function (slotName) {
  754. $slots[slotName] = true;
  755. });
  756. vm.$scopedSlots = vm.$slots = $slots;
  757. }
  758. }
  759. function initVueIds(vueIds, mpInstance) {
  760. vueIds = (vueIds || '').split(',');
  761. var len = vueIds.length;
  762. if (len === 1) {
  763. mpInstance._$vueId = vueIds[0];
  764. } else if (len === 2) {
  765. mpInstance._$vueId = vueIds[0];
  766. mpInstance._$vuePid = vueIds[1];
  767. }
  768. }
  769. function initData(vueOptions, context) {
  770. var data = vueOptions.data || {};
  771. var methods = vueOptions.methods || {};
  772. if (typeof data === 'function') {
  773. try {
  774. data = data.call(context); // 支持 Vue.prototype 上挂的数据
  775. } catch (e) {
  776. if (Object({"VUE_APP_NAME":"qc-luckyDraw","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  777. console.warn('根据 Vue 的 data 函数初始化小程序 data 失败,请尽量确保 data 函数中不访问 vm 对象,否则可能影响首次数据渲染速度。', data);
  778. }
  779. }
  780. } else {
  781. try {
  782. // 对 data 格式化
  783. data = JSON.parse(JSON.stringify(data));
  784. } catch (e) {}
  785. }
  786. if (!isPlainObject(data)) {
  787. data = {};
  788. }
  789. Object.keys(methods).forEach(function (methodName) {
  790. if (context.__lifecycle_hooks__.indexOf(methodName) === -1 && !hasOwn(data, methodName)) {
  791. data[methodName] = methods[methodName];
  792. }
  793. });
  794. return data;
  795. }
  796. var PROP_TYPES = [String, Number, Boolean, Object, Array, null];
  797. function createObserver(name) {
  798. return function observer(newVal, oldVal) {
  799. if (this.$vm) {
  800. this.$vm[name] = newVal; // 为了触发其他非 render watcher
  801. }
  802. };
  803. }
  804. function initBehaviors(vueOptions, initBehavior) {
  805. var vueBehaviors = vueOptions.behaviors;
  806. var vueExtends = vueOptions.extends;
  807. var vueMixins = vueOptions.mixins;
  808. var vueProps = vueOptions.props;
  809. if (!vueProps) {
  810. vueOptions.props = vueProps = [];
  811. }
  812. var behaviors = [];
  813. if (Array.isArray(vueBehaviors)) {
  814. vueBehaviors.forEach(function (behavior) {
  815. behaviors.push(behavior.replace('uni://', "wx".concat("://")));
  816. if (behavior === 'uni://form-field') {
  817. if (Array.isArray(vueProps)) {
  818. vueProps.push('name');
  819. vueProps.push('value');
  820. } else {
  821. vueProps.name = {
  822. type: String,
  823. default: '' };
  824. vueProps.value = {
  825. type: [String, Number, Boolean, Array, Object, Date],
  826. default: '' };
  827. }
  828. }
  829. });
  830. }
  831. if (isPlainObject(vueExtends) && vueExtends.props) {
  832. behaviors.push(
  833. initBehavior({
  834. properties: initProperties(vueExtends.props, true) }));
  835. }
  836. if (Array.isArray(vueMixins)) {
  837. vueMixins.forEach(function (vueMixin) {
  838. if (isPlainObject(vueMixin) && vueMixin.props) {
  839. behaviors.push(
  840. initBehavior({
  841. properties: initProperties(vueMixin.props, true) }));
  842. }
  843. });
  844. }
  845. return behaviors;
  846. }
  847. function parsePropType(key, type, defaultValue, file) {
  848. // [String]=>String
  849. if (Array.isArray(type) && type.length === 1) {
  850. return type[0];
  851. }
  852. return type;
  853. }
  854. function initProperties(props) {var isBehavior = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
  855. var properties = {};
  856. if (!isBehavior) {
  857. properties.vueId = {
  858. type: String,
  859. value: '' };
  860. // 用于字节跳动小程序模拟抽象节点
  861. properties.generic = {
  862. type: Object,
  863. value: null };
  864. // scopedSlotsCompiler auto
  865. properties.scopedSlotsCompiler = {
  866. type: String,
  867. value: '' };
  868. properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
  869. type: null,
  870. value: [],
  871. observer: function observer(newVal, oldVal) {
  872. var $slots = Object.create(null);
  873. newVal.forEach(function (slotName) {
  874. $slots[slotName] = true;
  875. });
  876. this.setData({
  877. $slots: $slots });
  878. } };
  879. }
  880. if (Array.isArray(props)) {// ['title']
  881. props.forEach(function (key) {
  882. properties[key] = {
  883. type: null,
  884. observer: createObserver(key) };
  885. });
  886. } else if (isPlainObject(props)) {// {title:{type:String,default:''},content:String}
  887. Object.keys(props).forEach(function (key) {
  888. var opts = props[key];
  889. if (isPlainObject(opts)) {// title:{type:String,default:''}
  890. var value = opts.default;
  891. if (isFn(value)) {
  892. value = value();
  893. }
  894. opts.type = parsePropType(key, opts.type);
  895. properties[key] = {
  896. type: PROP_TYPES.indexOf(opts.type) !== -1 ? opts.type : null,
  897. value: value,
  898. observer: createObserver(key) };
  899. } else {// content:String
  900. var type = parsePropType(key, opts);
  901. properties[key] = {
  902. type: PROP_TYPES.indexOf(type) !== -1 ? type : null,
  903. observer: createObserver(key) };
  904. }
  905. });
  906. }
  907. return properties;
  908. }
  909. function wrapper$1(event) {
  910. // TODO 又得兼容 mpvue 的 mp 对象
  911. try {
  912. event.mp = JSON.parse(JSON.stringify(event));
  913. } catch (e) {}
  914. event.stopPropagation = noop;
  915. event.preventDefault = noop;
  916. event.target = event.target || {};
  917. if (!hasOwn(event, 'detail')) {
  918. event.detail = {};
  919. }
  920. if (hasOwn(event, 'markerId')) {
  921. event.detail = typeof event.detail === 'object' ? event.detail : {};
  922. event.detail.markerId = event.markerId;
  923. }
  924. if (isPlainObject(event.detail)) {
  925. event.target = Object.assign({}, event.target, event.detail);
  926. }
  927. return event;
  928. }
  929. function getExtraValue(vm, dataPathsArray) {
  930. var context = vm;
  931. dataPathsArray.forEach(function (dataPathArray) {
  932. var dataPath = dataPathArray[0];
  933. var value = dataPathArray[2];
  934. if (dataPath || typeof value !== 'undefined') {// ['','',index,'disable']
  935. var propPath = dataPathArray[1];
  936. var valuePath = dataPathArray[3];
  937. var vFor;
  938. if (Number.isInteger(dataPath)) {
  939. vFor = dataPath;
  940. } else if (!dataPath) {
  941. vFor = context;
  942. } else if (typeof dataPath === 'string' && dataPath) {
  943. if (dataPath.indexOf('#s#') === 0) {
  944. vFor = dataPath.substr(3);
  945. } else {
  946. vFor = vm.__get_value(dataPath, context);
  947. }
  948. }
  949. if (Number.isInteger(vFor)) {
  950. context = value;
  951. } else if (!propPath) {
  952. context = vFor[value];
  953. } else {
  954. if (Array.isArray(vFor)) {
  955. context = vFor.find(function (vForItem) {
  956. return vm.__get_value(propPath, vForItem) === value;
  957. });
  958. } else if (isPlainObject(vFor)) {
  959. context = Object.keys(vFor).find(function (vForKey) {
  960. return vm.__get_value(propPath, vFor[vForKey]) === value;
  961. });
  962. } else {
  963. console.error('v-for 暂不支持循环数据:', vFor);
  964. }
  965. }
  966. if (valuePath) {
  967. context = vm.__get_value(valuePath, context);
  968. }
  969. }
  970. });
  971. return context;
  972. }
  973. function processEventExtra(vm, extra, event) {
  974. var extraObj = {};
  975. if (Array.isArray(extra) && extra.length) {
  976. /**
  977. *[
  978. * ['data.items', 'data.id', item.data.id],
  979. * ['metas', 'id', meta.id]
  980. *],
  981. *[
  982. * ['data.items', 'data.id', item.data.id],
  983. * ['metas', 'id', meta.id]
  984. *],
  985. *'test'
  986. */
  987. extra.forEach(function (dataPath, index) {
  988. if (typeof dataPath === 'string') {
  989. if (!dataPath) {// model,prop.sync
  990. extraObj['$' + index] = vm;
  991. } else {
  992. if (dataPath === '$event') {// $event
  993. extraObj['$' + index] = event;
  994. } else if (dataPath === 'arguments') {
  995. if (event.detail && event.detail.__args__) {
  996. extraObj['$' + index] = event.detail.__args__;
  997. } else {
  998. extraObj['$' + index] = [event];
  999. }
  1000. } else if (dataPath.indexOf('$event.') === 0) {// $event.target.value
  1001. extraObj['$' + index] = vm.__get_value(dataPath.replace('$event.', ''), event);
  1002. } else {
  1003. extraObj['$' + index] = vm.__get_value(dataPath);
  1004. }
  1005. }
  1006. } else {
  1007. extraObj['$' + index] = getExtraValue(vm, dataPath);
  1008. }
  1009. });
  1010. }
  1011. return extraObj;
  1012. }
  1013. function getObjByArray(arr) {
  1014. var obj = {};
  1015. for (var i = 1; i < arr.length; i++) {
  1016. var element = arr[i];
  1017. obj[element[0]] = element[1];
  1018. }
  1019. return obj;
  1020. }
  1021. 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;
  1022. var isCustomMPEvent = false; // wxcomponent 组件,传递原始 event 对象
  1023. if (isCustom) {// 自定义事件
  1024. isCustomMPEvent = event.currentTarget &&
  1025. event.currentTarget.dataset &&
  1026. event.currentTarget.dataset.comType === 'wx';
  1027. if (!args.length) {// 无参数,直接传入 event 或 detail 数组
  1028. if (isCustomMPEvent) {
  1029. return [event];
  1030. }
  1031. return event.detail.__args__ || event.detail;
  1032. }
  1033. }
  1034. var extraObj = processEventExtra(vm, extra, event);
  1035. var ret = [];
  1036. args.forEach(function (arg) {
  1037. if (arg === '$event') {
  1038. if (methodName === '__set_model' && !isCustom) {// input v-model value
  1039. ret.push(event.target.value);
  1040. } else {
  1041. if (isCustom && !isCustomMPEvent) {
  1042. ret.push(event.detail.__args__[0]);
  1043. } else {// wxcomponent 组件或内置组件
  1044. ret.push(event);
  1045. }
  1046. }
  1047. } else {
  1048. if (Array.isArray(arg) && arg[0] === 'o') {
  1049. ret.push(getObjByArray(arg));
  1050. } else if (typeof arg === 'string' && hasOwn(extraObj, arg)) {
  1051. ret.push(extraObj[arg]);
  1052. } else {
  1053. ret.push(arg);
  1054. }
  1055. }
  1056. });
  1057. return ret;
  1058. }
  1059. var ONCE = '~';
  1060. var CUSTOM = '^';
  1061. function isMatchEventType(eventType, optType) {
  1062. return eventType === optType ||
  1063. optType === 'regionchange' && (
  1064. eventType === 'begin' ||
  1065. eventType === 'end');
  1066. }
  1067. function getContextVm(vm) {
  1068. var $parent = vm.$parent;
  1069. // 父组件是 scoped slots 或者其他自定义组件时继续查找
  1070. while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
  1071. $parent = $parent.$parent;
  1072. }
  1073. return $parent && $parent.$parent;
  1074. }
  1075. function handleEvent(event) {var _this = this;
  1076. event = wrapper$1(event);
  1077. // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]]
  1078. var dataset = (event.currentTarget || event.target).dataset;
  1079. if (!dataset) {
  1080. return console.warn('事件信息不存在');
  1081. }
  1082. var eventOpts = dataset.eventOpts || dataset['event-opts']; // 支付宝 web-view 组件 dataset 非驼峰
  1083. if (!eventOpts) {
  1084. return console.warn('事件信息不存在');
  1085. }
  1086. // [['handle',[1,2,a]],['handle1',[1,2,a]]]
  1087. var eventType = event.type;
  1088. var ret = [];
  1089. eventOpts.forEach(function (eventOpt) {
  1090. var type = eventOpt[0];
  1091. var eventsArray = eventOpt[1];
  1092. var isCustom = type.charAt(0) === CUSTOM;
  1093. type = isCustom ? type.slice(1) : type;
  1094. var isOnce = type.charAt(0) === ONCE;
  1095. type = isOnce ? type.slice(1) : type;
  1096. if (eventsArray && isMatchEventType(eventType, type)) {
  1097. eventsArray.forEach(function (eventArray) {
  1098. var methodName = eventArray[0];
  1099. if (methodName) {
  1100. var handlerCtx = _this.$vm;
  1101. if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
  1102. handlerCtx = getContextVm(handlerCtx) || handlerCtx;
  1103. }
  1104. if (methodName === '$emit') {
  1105. handlerCtx.$emit.apply(handlerCtx,
  1106. processEventArgs(
  1107. _this.$vm,
  1108. event,
  1109. eventArray[1],
  1110. eventArray[2],
  1111. isCustom,
  1112. methodName));
  1113. return;
  1114. }
  1115. var handler = handlerCtx[methodName];
  1116. if (!isFn(handler)) {
  1117. throw new Error(" _vm.".concat(methodName, " is not a function"));
  1118. }
  1119. if (isOnce) {
  1120. if (handler.once) {
  1121. return;
  1122. }
  1123. handler.once = true;
  1124. }
  1125. var params = processEventArgs(
  1126. _this.$vm,
  1127. event,
  1128. eventArray[1],
  1129. eventArray[2],
  1130. isCustom,
  1131. methodName);
  1132. params = Array.isArray(params) ? params : [];
  1133. // 参数尾部增加原始事件对象用于复杂表达式内获取额外数据
  1134. if (/=\s*\S+\.eventParams\s*\|\|\s*\S+\[['"]event-params['"]\]/.test(handler.toString())) {
  1135. // eslint-disable-next-line no-sparse-arrays
  1136. params = params.concat([,,,,,,,,,, event]);
  1137. }
  1138. ret.push(handler.apply(handlerCtx, params));
  1139. }
  1140. });
  1141. }
  1142. });
  1143. if (
  1144. eventType === 'input' &&
  1145. ret.length === 1 &&
  1146. typeof ret[0] !== 'undefined')
  1147. {
  1148. return ret[0];
  1149. }
  1150. }
  1151. var locale;
  1152. {
  1153. locale = wx.getSystemInfoSync().language;
  1154. }
  1155. var i18n = (0, _uniI18n.initVueI18n)(
  1156. locale,
  1157. {});
  1158. var t = i18n.t;
  1159. var i18nMixin = i18n.mixin = {
  1160. beforeCreate: function beforeCreate() {var _this2 = this;
  1161. var unwatch = i18n.i18n.watchLocale(function () {
  1162. _this2.$forceUpdate();
  1163. });
  1164. this.$once('hook:beforeDestroy', function () {
  1165. unwatch();
  1166. });
  1167. },
  1168. methods: {
  1169. $$t: function $$t(key, values) {
  1170. return t(key, values);
  1171. } } };
  1172. var setLocale$1 = i18n.setLocale;
  1173. var getLocale$1 = i18n.getLocale;
  1174. function initAppLocale(Vue, appVm, locale) {
  1175. var state = Vue.observable({
  1176. locale: locale || i18n.getLocale() });
  1177. var localeWatchers = [];
  1178. appVm.$watchLocale = function (fn) {
  1179. localeWatchers.push(fn);
  1180. };
  1181. Object.defineProperty(appVm, '$locale', {
  1182. get: function get() {
  1183. return state.locale;
  1184. },
  1185. set: function set(v) {
  1186. state.locale = v;
  1187. localeWatchers.forEach(function (watch) {return watch(v);});
  1188. } });
  1189. }
  1190. var eventChannels = {};
  1191. var eventChannelStack = [];
  1192. function getEventChannel(id) {
  1193. if (id) {
  1194. var eventChannel = eventChannels[id];
  1195. delete eventChannels[id];
  1196. return eventChannel;
  1197. }
  1198. return eventChannelStack.shift();
  1199. }
  1200. var hooks = [
  1201. 'onShow',
  1202. 'onHide',
  1203. 'onError',
  1204. 'onPageNotFound',
  1205. 'onThemeChange',
  1206. 'onUnhandledRejection'];
  1207. function initEventChannel() {
  1208. _vue.default.prototype.getOpenerEventChannel = function () {
  1209. // 微信小程序使用自身getOpenerEventChannel
  1210. {
  1211. return this.$scope.getOpenerEventChannel();
  1212. }
  1213. };
  1214. var callHook = _vue.default.prototype.__call_hook;
  1215. _vue.default.prototype.__call_hook = function (hook, args) {
  1216. if (hook === 'onLoad' && args && args.__id__) {
  1217. this.__eventChannel__ = getEventChannel(args.__id__);
  1218. delete args.__id__;
  1219. }
  1220. return callHook.call(this, hook, args);
  1221. };
  1222. }
  1223. function initScopedSlotsParams() {
  1224. var center = {};
  1225. var parents = {};
  1226. _vue.default.prototype.$hasScopedSlotsParams = function (vueId) {
  1227. var has = center[vueId];
  1228. if (!has) {
  1229. parents[vueId] = this;
  1230. this.$on('hook:destory', function () {
  1231. delete parents[vueId];
  1232. });
  1233. }
  1234. return has;
  1235. };
  1236. _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) {
  1237. var data = center[vueId];
  1238. if (data) {
  1239. var object = data[name] || {};
  1240. return key ? object[key] : object;
  1241. } else {
  1242. parents[vueId] = this;
  1243. this.$on('hook:destory', function () {
  1244. delete parents[vueId];
  1245. });
  1246. }
  1247. };
  1248. _vue.default.prototype.$setScopedSlotsParams = function (name, value) {
  1249. var vueIds = this.$options.propsData.vueId;
  1250. if (vueIds) {
  1251. var vueId = vueIds.split(',')[0];
  1252. var object = center[vueId] = center[vueId] || {};
  1253. object[name] = value;
  1254. if (parents[vueId]) {
  1255. parents[vueId].$forceUpdate();
  1256. }
  1257. }
  1258. };
  1259. _vue.default.mixin({
  1260. destroyed: function destroyed() {
  1261. var propsData = this.$options.propsData;
  1262. var vueId = propsData && propsData.vueId;
  1263. if (vueId) {
  1264. delete center[vueId];
  1265. delete parents[vueId];
  1266. }
  1267. } });
  1268. }
  1269. function parseBaseApp(vm, _ref3)
  1270. {var mocks = _ref3.mocks,initRefs = _ref3.initRefs;
  1271. initEventChannel();
  1272. {
  1273. initScopedSlotsParams();
  1274. }
  1275. if (vm.$options.store) {
  1276. _vue.default.prototype.$store = vm.$options.store;
  1277. }
  1278. uniIdMixin(_vue.default);
  1279. _vue.default.prototype.mpHost = "mp-weixin";
  1280. _vue.default.mixin({
  1281. beforeCreate: function beforeCreate() {
  1282. if (!this.$options.mpType) {
  1283. return;
  1284. }
  1285. this.mpType = this.$options.mpType;
  1286. this.$mp = _defineProperty({
  1287. data: {} },
  1288. this.mpType, this.$options.mpInstance);
  1289. this.$scope = this.$options.mpInstance;
  1290. delete this.$options.mpType;
  1291. delete this.$options.mpInstance;
  1292. if (this.mpType === 'page' && typeof getApp === 'function') {// hack vue-i18n
  1293. var app = getApp();
  1294. if (app.$vm && app.$vm.$i18n) {
  1295. this._i18n = app.$vm.$i18n;
  1296. }
  1297. }
  1298. if (this.mpType !== 'app') {
  1299. initRefs(this);
  1300. initMocks(this, mocks);
  1301. }
  1302. } });
  1303. var appOptions = {
  1304. onLaunch: function onLaunch(args) {
  1305. if (this.$vm) {// 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前
  1306. return;
  1307. }
  1308. {
  1309. if (wx.canIUse && !wx.canIUse('nextTick')) {// 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断
  1310. console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上');
  1311. }
  1312. }
  1313. this.$vm = vm;
  1314. this.$vm.$mp = {
  1315. app: this };
  1316. this.$vm.$scope = this;
  1317. // vm 上也挂载 globalData
  1318. this.$vm.globalData = this.globalData;
  1319. this.$vm._isMounted = true;
  1320. this.$vm.__call_hook('mounted', args);
  1321. this.$vm.__call_hook('onLaunch', args);
  1322. } };
  1323. // 兼容旧版本 globalData
  1324. appOptions.globalData = vm.$options.globalData || {};
  1325. // 将 methods 中的方法挂在 getApp() 中
  1326. var methods = vm.$options.methods;
  1327. if (methods) {
  1328. Object.keys(methods).forEach(function (name) {
  1329. appOptions[name] = methods[name];
  1330. });
  1331. }
  1332. initAppLocale(_vue.default, vm, wx.getSystemInfoSync().language || 'zh-Hans');
  1333. initHooks(appOptions, hooks);
  1334. return appOptions;
  1335. }
  1336. var mocks = ['__route__', '__wxExparserNodeId__', '__wxWebviewId__'];
  1337. function findVmByVueId(vm, vuePid) {
  1338. var $children = vm.$children;
  1339. // 优先查找直属(反向查找:https://github.com/dcloudio/uni-app/issues/1200)
  1340. for (var i = $children.length - 1; i >= 0; i--) {
  1341. var childVm = $children[i];
  1342. if (childVm.$scope._$vueId === vuePid) {
  1343. return childVm;
  1344. }
  1345. }
  1346. // 反向递归查找
  1347. var parentVm;
  1348. for (var _i = $children.length - 1; _i >= 0; _i--) {
  1349. parentVm = findVmByVueId($children[_i], vuePid);
  1350. if (parentVm) {
  1351. return parentVm;
  1352. }
  1353. }
  1354. }
  1355. function initBehavior(options) {
  1356. return Behavior(options);
  1357. }
  1358. function isPage() {
  1359. return !!this.route;
  1360. }
  1361. function initRelation(detail) {
  1362. this.triggerEvent('__l', detail);
  1363. }
  1364. function selectAllComponents(mpInstance, selector, $refs) {
  1365. var components = mpInstance.selectAllComponents(selector);
  1366. components.forEach(function (component) {
  1367. var ref = component.dataset.ref;
  1368. $refs[ref] = component.$vm || component;
  1369. {
  1370. if (component.dataset.vueGeneric === 'scoped') {
  1371. component.selectAllComponents('.scoped-ref').forEach(function (scopedComponent) {
  1372. selectAllComponents(scopedComponent, selector, $refs);
  1373. });
  1374. }
  1375. }
  1376. });
  1377. }
  1378. function initRefs(vm) {
  1379. var mpInstance = vm.$scope;
  1380. Object.defineProperty(vm, '$refs', {
  1381. get: function get() {
  1382. var $refs = {};
  1383. selectAllComponents(mpInstance, '.vue-ref', $refs);
  1384. // TODO 暂不考虑 for 中的 scoped
  1385. var forComponents = mpInstance.selectAllComponents('.vue-ref-in-for');
  1386. forComponents.forEach(function (component) {
  1387. var ref = component.dataset.ref;
  1388. if (!$refs[ref]) {
  1389. $refs[ref] = [];
  1390. }
  1391. $refs[ref].push(component.$vm || component);
  1392. });
  1393. return $refs;
  1394. } });
  1395. }
  1396. function handleLink(event) {var _ref4 =
  1397. event.detail || event.value,vuePid = _ref4.vuePid,vueOptions = _ref4.vueOptions; // detail 是微信,value 是百度(dipatch)
  1398. var parentVm;
  1399. if (vuePid) {
  1400. parentVm = findVmByVueId(this.$vm, vuePid);
  1401. }
  1402. if (!parentVm) {
  1403. parentVm = this.$vm;
  1404. }
  1405. vueOptions.parent = parentVm;
  1406. }
  1407. function parseApp(vm) {
  1408. return parseBaseApp(vm, {
  1409. mocks: mocks,
  1410. initRefs: initRefs });
  1411. }
  1412. function createApp(vm) {
  1413. App(parseApp(vm));
  1414. return vm;
  1415. }
  1416. var encodeReserveRE = /[!'()*]/g;
  1417. var encodeReserveReplacer = function encodeReserveReplacer(c) {return '%' + c.charCodeAt(0).toString(16);};
  1418. var commaRE = /%2C/g;
  1419. // fixed encodeURIComponent which is more conformant to RFC3986:
  1420. // - escapes [!'()*]
  1421. // - preserve commas
  1422. var encode = function encode(str) {return encodeURIComponent(str).
  1423. replace(encodeReserveRE, encodeReserveReplacer).
  1424. replace(commaRE, ',');};
  1425. function stringifyQuery(obj) {var encodeStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : encode;
  1426. var res = obj ? Object.keys(obj).map(function (key) {
  1427. var val = obj[key];
  1428. if (val === undefined) {
  1429. return '';
  1430. }
  1431. if (val === null) {
  1432. return encodeStr(key);
  1433. }
  1434. if (Array.isArray(val)) {
  1435. var result = [];
  1436. val.forEach(function (val2) {
  1437. if (val2 === undefined) {
  1438. return;
  1439. }
  1440. if (val2 === null) {
  1441. result.push(encodeStr(key));
  1442. } else {
  1443. result.push(encodeStr(key) + '=' + encodeStr(val2));
  1444. }
  1445. });
  1446. return result.join('&');
  1447. }
  1448. return encodeStr(key) + '=' + encodeStr(val);
  1449. }).filter(function (x) {return x.length > 0;}).join('&') : null;
  1450. return res ? "?".concat(res) : '';
  1451. }
  1452. function parseBaseComponent(vueComponentOptions)
  1453. {var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},isPage = _ref5.isPage,initRelation = _ref5.initRelation;var _initVueComponent =
  1454. initVueComponent(_vue.default, vueComponentOptions),_initVueComponent2 = _slicedToArray(_initVueComponent, 2),VueComponent = _initVueComponent2[0],vueOptions = _initVueComponent2[1];
  1455. var options = _objectSpread({
  1456. multipleSlots: true,
  1457. addGlobalClass: true },
  1458. vueOptions.options || {});
  1459. {
  1460. // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
  1461. if (vueOptions['mp-weixin'] && vueOptions['mp-weixin'].options) {
  1462. Object.assign(options, vueOptions['mp-weixin'].options);
  1463. }
  1464. }
  1465. var componentOptions = {
  1466. options: options,
  1467. data: initData(vueOptions, _vue.default.prototype),
  1468. behaviors: initBehaviors(vueOptions, initBehavior),
  1469. properties: initProperties(vueOptions.props, false, vueOptions.__file),
  1470. lifetimes: {
  1471. attached: function attached() {
  1472. var properties = this.properties;
  1473. var options = {
  1474. mpType: isPage.call(this) ? 'page' : 'component',
  1475. mpInstance: this,
  1476. propsData: properties };
  1477. initVueIds(properties.vueId, this);
  1478. // 处理父子关系
  1479. initRelation.call(this, {
  1480. vuePid: this._$vuePid,
  1481. vueOptions: options });
  1482. // 初始化 vue 实例
  1483. this.$vm = new VueComponent(options);
  1484. // 处理$slots,$scopedSlots(暂不支持动态变化$slots)
  1485. initSlots(this.$vm, properties.vueSlots);
  1486. // 触发首次 setData
  1487. this.$vm.$mount();
  1488. },
  1489. ready: function ready() {
  1490. // 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
  1491. // https://developers.weixin.qq.com/community/develop/doc/00066ae2844cc0f8eb883e2a557800
  1492. if (this.$vm) {
  1493. this.$vm._isMounted = true;
  1494. this.$vm.__call_hook('mounted');
  1495. this.$vm.__call_hook('onReady');
  1496. }
  1497. },
  1498. detached: function detached() {
  1499. this.$vm && this.$vm.$destroy();
  1500. } },
  1501. pageLifetimes: {
  1502. show: function show(args) {
  1503. this.$vm && this.$vm.__call_hook('onPageShow', args);
  1504. },
  1505. hide: function hide() {
  1506. this.$vm && this.$vm.__call_hook('onPageHide');
  1507. },
  1508. resize: function resize(size) {
  1509. this.$vm && this.$vm.__call_hook('onPageResize', size);
  1510. } },
  1511. methods: {
  1512. __l: handleLink,
  1513. __e: handleEvent } };
  1514. // externalClasses
  1515. if (vueOptions.externalClasses) {
  1516. componentOptions.externalClasses = vueOptions.externalClasses;
  1517. }
  1518. if (Array.isArray(vueOptions.wxsCallMethods)) {
  1519. vueOptions.wxsCallMethods.forEach(function (callMethod) {
  1520. componentOptions.methods[callMethod] = function (args) {
  1521. return this.$vm[callMethod](args);
  1522. };
  1523. });
  1524. }
  1525. if (isPage) {
  1526. return componentOptions;
  1527. }
  1528. return [componentOptions, VueComponent];
  1529. }
  1530. function parseComponent(vueComponentOptions) {
  1531. return parseBaseComponent(vueComponentOptions, {
  1532. isPage: isPage,
  1533. initRelation: initRelation });
  1534. }
  1535. var hooks$1 = [
  1536. 'onShow',
  1537. 'onHide',
  1538. 'onUnload'];
  1539. hooks$1.push.apply(hooks$1, PAGE_EVENT_HOOKS);
  1540. function parseBasePage(vuePageOptions, _ref6)
  1541. {var isPage = _ref6.isPage,initRelation = _ref6.initRelation;
  1542. var pageOptions = parseComponent(vuePageOptions);
  1543. initHooks(pageOptions.methods, hooks$1, vuePageOptions);
  1544. pageOptions.methods.onLoad = function (query) {
  1545. this.options = query;
  1546. var copyQuery = Object.assign({}, query);
  1547. delete copyQuery.__id__;
  1548. this.$page = {
  1549. fullPath: '/' + (this.route || this.is) + stringifyQuery(copyQuery) };
  1550. this.$vm.$mp.query = query; // 兼容 mpvue
  1551. this.$vm.__call_hook('onLoad', query);
  1552. };
  1553. return pageOptions;
  1554. }
  1555. function parsePage(vuePageOptions) {
  1556. return parseBasePage(vuePageOptions, {
  1557. isPage: isPage,
  1558. initRelation: initRelation });
  1559. }
  1560. function createPage(vuePageOptions) {
  1561. {
  1562. return Component(parsePage(vuePageOptions));
  1563. }
  1564. }
  1565. function createComponent(vueOptions) {
  1566. {
  1567. return Component(parseComponent(vueOptions));
  1568. }
  1569. }
  1570. function createSubpackageApp(vm) {
  1571. var appOptions = parseApp(vm);
  1572. var app = getApp({
  1573. allowDefault: true });
  1574. vm.$scope = app;
  1575. var globalData = app.globalData;
  1576. if (globalData) {
  1577. Object.keys(appOptions.globalData).forEach(function (name) {
  1578. if (!hasOwn(globalData, name)) {
  1579. globalData[name] = appOptions.globalData[name];
  1580. }
  1581. });
  1582. }
  1583. Object.keys(appOptions).forEach(function (name) {
  1584. if (!hasOwn(app, name)) {
  1585. app[name] = appOptions[name];
  1586. }
  1587. });
  1588. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1589. wx.onAppShow(function () {for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {args[_key5] = arguments[_key5];}
  1590. vm.__call_hook('onShow', args);
  1591. });
  1592. }
  1593. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1594. wx.onAppHide(function () {for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {args[_key6] = arguments[_key6];}
  1595. vm.__call_hook('onHide', args);
  1596. });
  1597. }
  1598. if (isFn(appOptions.onLaunch)) {
  1599. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1600. vm.__call_hook('onLaunch', args);
  1601. }
  1602. return vm;
  1603. }
  1604. function createPlugin(vm) {
  1605. var appOptions = parseApp(vm);
  1606. if (isFn(appOptions.onShow) && wx.onAppShow) {
  1607. wx.onAppShow(function () {for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {args[_key7] = arguments[_key7];}
  1608. appOptions.onShow.apply(vm, args);
  1609. });
  1610. }
  1611. if (isFn(appOptions.onHide) && wx.onAppHide) {
  1612. wx.onAppHide(function () {for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {args[_key8] = arguments[_key8];}
  1613. appOptions.onHide.apply(vm, args);
  1614. });
  1615. }
  1616. if (isFn(appOptions.onLaunch)) {
  1617. var args = wx.getLaunchOptionsSync && wx.getLaunchOptionsSync();
  1618. appOptions.onLaunch.call(vm, args);
  1619. }
  1620. return vm;
  1621. }
  1622. todos.forEach(function (todoApi) {
  1623. protocols[todoApi] = false;
  1624. });
  1625. canIUses.forEach(function (canIUseApi) {
  1626. var apiName = protocols[canIUseApi] && protocols[canIUseApi].name ? protocols[canIUseApi].name :
  1627. canIUseApi;
  1628. if (!wx.canIUse(apiName)) {
  1629. protocols[canIUseApi] = false;
  1630. }
  1631. });
  1632. var uni = {};
  1633. if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
  1634. uni = new Proxy({}, {
  1635. get: function get(target, name) {
  1636. if (hasOwn(target, name)) {
  1637. return target[name];
  1638. }
  1639. if (baseApi[name]) {
  1640. return baseApi[name];
  1641. }
  1642. if (api[name]) {
  1643. return promisify(name, api[name]);
  1644. }
  1645. {
  1646. if (extraApi[name]) {
  1647. return promisify(name, extraApi[name]);
  1648. }
  1649. if (todoApis[name]) {
  1650. return promisify(name, todoApis[name]);
  1651. }
  1652. }
  1653. if (eventApi[name]) {
  1654. return eventApi[name];
  1655. }
  1656. if (!hasOwn(wx, name) && !hasOwn(protocols, name)) {
  1657. return;
  1658. }
  1659. return promisify(name, wrapper(name, wx[name]));
  1660. },
  1661. set: function set(target, name, value) {
  1662. target[name] = value;
  1663. return true;
  1664. } });
  1665. } else {
  1666. Object.keys(baseApi).forEach(function (name) {
  1667. uni[name] = baseApi[name];
  1668. });
  1669. {
  1670. Object.keys(todoApis).forEach(function (name) {
  1671. uni[name] = promisify(name, todoApis[name]);
  1672. });
  1673. Object.keys(extraApi).forEach(function (name) {
  1674. uni[name] = promisify(name, todoApis[name]);
  1675. });
  1676. }
  1677. Object.keys(eventApi).forEach(function (name) {
  1678. uni[name] = eventApi[name];
  1679. });
  1680. Object.keys(api).forEach(function (name) {
  1681. uni[name] = promisify(name, api[name]);
  1682. });
  1683. Object.keys(wx).forEach(function (name) {
  1684. if (hasOwn(wx, name) || hasOwn(protocols, name)) {
  1685. uni[name] = promisify(name, wrapper(name, wx[name]));
  1686. }
  1687. });
  1688. }
  1689. wx.createApp = createApp;
  1690. wx.createPage = createPage;
  1691. wx.createComponent = createComponent;
  1692. wx.createSubpackageApp = createSubpackageApp;
  1693. wx.createPlugin = createPlugin;
  1694. var uni$1 = uni;var _default =
  1695. uni$1;exports.default = _default;
  1696. /***/ }),
  1697. /* 2 */
  1698. /*!******************************************************************************************!*\
  1699. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***!
  1700. \******************************************************************************************/
  1701. /*! exports provided: default */
  1702. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1703. "use strict";
  1704. __webpack_require__.r(__webpack_exports__);
  1705. /* WEBPACK VAR INJECTION */(function(global) {/*!
  1706. * Vue.js v2.6.11
  1707. * (c) 2014-2021 Evan You
  1708. * Released under the MIT License.
  1709. */
  1710. /* */
  1711. var emptyObject = Object.freeze({});
  1712. // These helpers produce better VM code in JS engines due to their
  1713. // explicitness and function inlining.
  1714. function isUndef (v) {
  1715. return v === undefined || v === null
  1716. }
  1717. function isDef (v) {
  1718. return v !== undefined && v !== null
  1719. }
  1720. function isTrue (v) {
  1721. return v === true
  1722. }
  1723. function isFalse (v) {
  1724. return v === false
  1725. }
  1726. /**
  1727. * Check if value is primitive.
  1728. */
  1729. function isPrimitive (value) {
  1730. return (
  1731. typeof value === 'string' ||
  1732. typeof value === 'number' ||
  1733. // $flow-disable-line
  1734. typeof value === 'symbol' ||
  1735. typeof value === 'boolean'
  1736. )
  1737. }
  1738. /**
  1739. * Quick object check - this is primarily used to tell
  1740. * Objects from primitive values when we know the value
  1741. * is a JSON-compliant type.
  1742. */
  1743. function isObject (obj) {
  1744. return obj !== null && typeof obj === 'object'
  1745. }
  1746. /**
  1747. * Get the raw type string of a value, e.g., [object Object].
  1748. */
  1749. var _toString = Object.prototype.toString;
  1750. function toRawType (value) {
  1751. return _toString.call(value).slice(8, -1)
  1752. }
  1753. /**
  1754. * Strict object type check. Only returns true
  1755. * for plain JavaScript objects.
  1756. */
  1757. function isPlainObject (obj) {
  1758. return _toString.call(obj) === '[object Object]'
  1759. }
  1760. function isRegExp (v) {
  1761. return _toString.call(v) === '[object RegExp]'
  1762. }
  1763. /**
  1764. * Check if val is a valid array index.
  1765. */
  1766. function isValidArrayIndex (val) {
  1767. var n = parseFloat(String(val));
  1768. return n >= 0 && Math.floor(n) === n && isFinite(val)
  1769. }
  1770. function isPromise (val) {
  1771. return (
  1772. isDef(val) &&
  1773. typeof val.then === 'function' &&
  1774. typeof val.catch === 'function'
  1775. )
  1776. }
  1777. /**
  1778. * Convert a value to a string that is actually rendered.
  1779. */
  1780. function toString (val) {
  1781. return val == null
  1782. ? ''
  1783. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  1784. ? JSON.stringify(val, null, 2)
  1785. : String(val)
  1786. }
  1787. /**
  1788. * Convert an input value to a number for persistence.
  1789. * If the conversion fails, return original string.
  1790. */
  1791. function toNumber (val) {
  1792. var n = parseFloat(val);
  1793. return isNaN(n) ? val : n
  1794. }
  1795. /**
  1796. * Make a map and return a function for checking if a key
  1797. * is in that map.
  1798. */
  1799. function makeMap (
  1800. str,
  1801. expectsLowerCase
  1802. ) {
  1803. var map = Object.create(null);
  1804. var list = str.split(',');
  1805. for (var i = 0; i < list.length; i++) {
  1806. map[list[i]] = true;
  1807. }
  1808. return expectsLowerCase
  1809. ? function (val) { return map[val.toLowerCase()]; }
  1810. : function (val) { return map[val]; }
  1811. }
  1812. /**
  1813. * Check if a tag is a built-in tag.
  1814. */
  1815. var isBuiltInTag = makeMap('slot,component', true);
  1816. /**
  1817. * Check if an attribute is a reserved attribute.
  1818. */
  1819. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  1820. /**
  1821. * Remove an item from an array.
  1822. */
  1823. function remove (arr, item) {
  1824. if (arr.length) {
  1825. var index = arr.indexOf(item);
  1826. if (index > -1) {
  1827. return arr.splice(index, 1)
  1828. }
  1829. }
  1830. }
  1831. /**
  1832. * Check whether an object has the property.
  1833. */
  1834. var hasOwnProperty = Object.prototype.hasOwnProperty;
  1835. function hasOwn (obj, key) {
  1836. return hasOwnProperty.call(obj, key)
  1837. }
  1838. /**
  1839. * Create a cached version of a pure function.
  1840. */
  1841. function cached (fn) {
  1842. var cache = Object.create(null);
  1843. return (function cachedFn (str) {
  1844. var hit = cache[str];
  1845. return hit || (cache[str] = fn(str))
  1846. })
  1847. }
  1848. /**
  1849. * Camelize a hyphen-delimited string.
  1850. */
  1851. var camelizeRE = /-(\w)/g;
  1852. var camelize = cached(function (str) {
  1853. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  1854. });
  1855. /**
  1856. * Capitalize a string.
  1857. */
  1858. var capitalize = cached(function (str) {
  1859. return str.charAt(0).toUpperCase() + str.slice(1)
  1860. });
  1861. /**
  1862. * Hyphenate a camelCase string.
  1863. */
  1864. var hyphenateRE = /\B([A-Z])/g;
  1865. var hyphenate = cached(function (str) {
  1866. return str.replace(hyphenateRE, '-$1').toLowerCase()
  1867. });
  1868. /**
  1869. * Simple bind polyfill for environments that do not support it,
  1870. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  1871. * since native bind is now performant enough in most browsers.
  1872. * But removing it would mean breaking code that was able to run in
  1873. * PhantomJS 1.x, so this must be kept for backward compatibility.
  1874. */
  1875. /* istanbul ignore next */
  1876. function polyfillBind (fn, ctx) {
  1877. function boundFn (a) {
  1878. var l = arguments.length;
  1879. return l
  1880. ? l > 1
  1881. ? fn.apply(ctx, arguments)
  1882. : fn.call(ctx, a)
  1883. : fn.call(ctx)
  1884. }
  1885. boundFn._length = fn.length;
  1886. return boundFn
  1887. }
  1888. function nativeBind (fn, ctx) {
  1889. return fn.bind(ctx)
  1890. }
  1891. var bind = Function.prototype.bind
  1892. ? nativeBind
  1893. : polyfillBind;
  1894. /**
  1895. * Convert an Array-like object to a real Array.
  1896. */
  1897. function toArray (list, start) {
  1898. start = start || 0;
  1899. var i = list.length - start;
  1900. var ret = new Array(i);
  1901. while (i--) {
  1902. ret[i] = list[i + start];
  1903. }
  1904. return ret
  1905. }
  1906. /**
  1907. * Mix properties into target object.
  1908. */
  1909. function extend (to, _from) {
  1910. for (var key in _from) {
  1911. to[key] = _from[key];
  1912. }
  1913. return to
  1914. }
  1915. /**
  1916. * Merge an Array of Objects into a single Object.
  1917. */
  1918. function toObject (arr) {
  1919. var res = {};
  1920. for (var i = 0; i < arr.length; i++) {
  1921. if (arr[i]) {
  1922. extend(res, arr[i]);
  1923. }
  1924. }
  1925. return res
  1926. }
  1927. /* eslint-disable no-unused-vars */
  1928. /**
  1929. * Perform no operation.
  1930. * Stubbing args to make Flow happy without leaving useless transpiled code
  1931. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  1932. */
  1933. function noop (a, b, c) {}
  1934. /**
  1935. * Always return false.
  1936. */
  1937. var no = function (a, b, c) { return false; };
  1938. /* eslint-enable no-unused-vars */
  1939. /**
  1940. * Return the same value.
  1941. */
  1942. var identity = function (_) { return _; };
  1943. /**
  1944. * Check if two values are loosely equal - that is,
  1945. * if they are plain objects, do they have the same shape?
  1946. */
  1947. function looseEqual (a, b) {
  1948. if (a === b) { return true }
  1949. var isObjectA = isObject(a);
  1950. var isObjectB = isObject(b);
  1951. if (isObjectA && isObjectB) {
  1952. try {
  1953. var isArrayA = Array.isArray(a);
  1954. var isArrayB = Array.isArray(b);
  1955. if (isArrayA && isArrayB) {
  1956. return a.length === b.length && a.every(function (e, i) {
  1957. return looseEqual(e, b[i])
  1958. })
  1959. } else if (a instanceof Date && b instanceof Date) {
  1960. return a.getTime() === b.getTime()
  1961. } else if (!isArrayA && !isArrayB) {
  1962. var keysA = Object.keys(a);
  1963. var keysB = Object.keys(b);
  1964. return keysA.length === keysB.length && keysA.every(function (key) {
  1965. return looseEqual(a[key], b[key])
  1966. })
  1967. } else {
  1968. /* istanbul ignore next */
  1969. return false
  1970. }
  1971. } catch (e) {
  1972. /* istanbul ignore next */
  1973. return false
  1974. }
  1975. } else if (!isObjectA && !isObjectB) {
  1976. return String(a) === String(b)
  1977. } else {
  1978. return false
  1979. }
  1980. }
  1981. /**
  1982. * Return the first index at which a loosely equal value can be
  1983. * found in the array (if value is a plain object, the array must
  1984. * contain an object of the same shape), or -1 if it is not present.
  1985. */
  1986. function looseIndexOf (arr, val) {
  1987. for (var i = 0; i < arr.length; i++) {
  1988. if (looseEqual(arr[i], val)) { return i }
  1989. }
  1990. return -1
  1991. }
  1992. /**
  1993. * Ensure a function is called only once.
  1994. */
  1995. function once (fn) {
  1996. var called = false;
  1997. return function () {
  1998. if (!called) {
  1999. called = true;
  2000. fn.apply(this, arguments);
  2001. }
  2002. }
  2003. }
  2004. var ASSET_TYPES = [
  2005. 'component',
  2006. 'directive',
  2007. 'filter'
  2008. ];
  2009. var LIFECYCLE_HOOKS = [
  2010. 'beforeCreate',
  2011. 'created',
  2012. 'beforeMount',
  2013. 'mounted',
  2014. 'beforeUpdate',
  2015. 'updated',
  2016. 'beforeDestroy',
  2017. 'destroyed',
  2018. 'activated',
  2019. 'deactivated',
  2020. 'errorCaptured',
  2021. 'serverPrefetch'
  2022. ];
  2023. /* */
  2024. var config = ({
  2025. /**
  2026. * Option merge strategies (used in core/util/options)
  2027. */
  2028. // $flow-disable-line
  2029. optionMergeStrategies: Object.create(null),
  2030. /**
  2031. * Whether to suppress warnings.
  2032. */
  2033. silent: false,
  2034. /**
  2035. * Show production mode tip message on boot?
  2036. */
  2037. productionTip: "development" !== 'production',
  2038. /**
  2039. * Whether to enable devtools
  2040. */
  2041. devtools: "development" !== 'production',
  2042. /**
  2043. * Whether to record perf
  2044. */
  2045. performance: false,
  2046. /**
  2047. * Error handler for watcher errors
  2048. */
  2049. errorHandler: null,
  2050. /**
  2051. * Warn handler for watcher warns
  2052. */
  2053. warnHandler: null,
  2054. /**
  2055. * Ignore certain custom elements
  2056. */
  2057. ignoredElements: [],
  2058. /**
  2059. * Custom user key aliases for v-on
  2060. */
  2061. // $flow-disable-line
  2062. keyCodes: Object.create(null),
  2063. /**
  2064. * Check if a tag is reserved so that it cannot be registered as a
  2065. * component. This is platform-dependent and may be overwritten.
  2066. */
  2067. isReservedTag: no,
  2068. /**
  2069. * Check if an attribute is reserved so that it cannot be used as a component
  2070. * prop. This is platform-dependent and may be overwritten.
  2071. */
  2072. isReservedAttr: no,
  2073. /**
  2074. * Check if a tag is an unknown element.
  2075. * Platform-dependent.
  2076. */
  2077. isUnknownElement: no,
  2078. /**
  2079. * Get the namespace of an element
  2080. */
  2081. getTagNamespace: noop,
  2082. /**
  2083. * Parse the real tag name for the specific platform.
  2084. */
  2085. parsePlatformTagName: identity,
  2086. /**
  2087. * Check if an attribute must be bound using property, e.g. value
  2088. * Platform-dependent.
  2089. */
  2090. mustUseProp: no,
  2091. /**
  2092. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  2093. * This will significantly reduce performance if set to false.
  2094. */
  2095. async: true,
  2096. /**
  2097. * Exposed for legacy reasons
  2098. */
  2099. _lifecycleHooks: LIFECYCLE_HOOKS
  2100. });
  2101. /* */
  2102. /**
  2103. * unicode letters used for parsing html tags, component names and property paths.
  2104. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  2105. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  2106. */
  2107. 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/;
  2108. /**
  2109. * Check if a string starts with $ or _
  2110. */
  2111. function isReserved (str) {
  2112. var c = (str + '').charCodeAt(0);
  2113. return c === 0x24 || c === 0x5F
  2114. }
  2115. /**
  2116. * Define a property.
  2117. */
  2118. function def (obj, key, val, enumerable) {
  2119. Object.defineProperty(obj, key, {
  2120. value: val,
  2121. enumerable: !!enumerable,
  2122. writable: true,
  2123. configurable: true
  2124. });
  2125. }
  2126. /**
  2127. * Parse simple path.
  2128. */
  2129. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  2130. function parsePath (path) {
  2131. if (bailRE.test(path)) {
  2132. return
  2133. }
  2134. var segments = path.split('.');
  2135. return function (obj) {
  2136. for (var i = 0; i < segments.length; i++) {
  2137. if (!obj) { return }
  2138. obj = obj[segments[i]];
  2139. }
  2140. return obj
  2141. }
  2142. }
  2143. /* */
  2144. // can we use __proto__?
  2145. var hasProto = '__proto__' in {};
  2146. // Browser environment sniffing
  2147. var inBrowser = typeof window !== 'undefined';
  2148. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  2149. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  2150. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  2151. var isIE = UA && /msie|trident/.test(UA);
  2152. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  2153. var isEdge = UA && UA.indexOf('edge/') > 0;
  2154. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  2155. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  2156. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  2157. var isPhantomJS = UA && /phantomjs/.test(UA);
  2158. var isFF = UA && UA.match(/firefox\/(\d+)/);
  2159. // Firefox has a "watch" function on Object.prototype...
  2160. var nativeWatch = ({}).watch;
  2161. if (inBrowser) {
  2162. try {
  2163. var opts = {};
  2164. Object.defineProperty(opts, 'passive', ({
  2165. get: function get () {
  2166. }
  2167. })); // https://github.com/facebook/flow/issues/285
  2168. window.addEventListener('test-passive', null, opts);
  2169. } catch (e) {}
  2170. }
  2171. // this needs to be lazy-evaled because vue may be required before
  2172. // vue-server-renderer can set VUE_ENV
  2173. var _isServer;
  2174. var isServerRendering = function () {
  2175. if (_isServer === undefined) {
  2176. /* istanbul ignore if */
  2177. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  2178. // detect presence of vue-server-renderer and avoid
  2179. // Webpack shimming the process
  2180. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  2181. } else {
  2182. _isServer = false;
  2183. }
  2184. }
  2185. return _isServer
  2186. };
  2187. // detect devtools
  2188. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  2189. /* istanbul ignore next */
  2190. function isNative (Ctor) {
  2191. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  2192. }
  2193. var hasSymbol =
  2194. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  2195. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  2196. var _Set;
  2197. /* istanbul ignore if */ // $flow-disable-line
  2198. if (typeof Set !== 'undefined' && isNative(Set)) {
  2199. // use native Set when available.
  2200. _Set = Set;
  2201. } else {
  2202. // a non-standard Set polyfill that only works with primitive keys.
  2203. _Set = /*@__PURE__*/(function () {
  2204. function Set () {
  2205. this.set = Object.create(null);
  2206. }
  2207. Set.prototype.has = function has (key) {
  2208. return this.set[key] === true
  2209. };
  2210. Set.prototype.add = function add (key) {
  2211. this.set[key] = true;
  2212. };
  2213. Set.prototype.clear = function clear () {
  2214. this.set = Object.create(null);
  2215. };
  2216. return Set;
  2217. }());
  2218. }
  2219. /* */
  2220. var warn = noop;
  2221. var tip = noop;
  2222. var generateComponentTrace = (noop); // work around flow check
  2223. var formatComponentName = (noop);
  2224. if (true) {
  2225. var hasConsole = typeof console !== 'undefined';
  2226. var classifyRE = /(?:^|[-_])(\w)/g;
  2227. var classify = function (str) { return str
  2228. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  2229. .replace(/[-_]/g, ''); };
  2230. warn = function (msg, vm) {
  2231. var trace = vm ? generateComponentTrace(vm) : '';
  2232. if (config.warnHandler) {
  2233. config.warnHandler.call(null, msg, vm, trace);
  2234. } else if (hasConsole && (!config.silent)) {
  2235. console.error(("[Vue warn]: " + msg + trace));
  2236. }
  2237. };
  2238. tip = function (msg, vm) {
  2239. if (hasConsole && (!config.silent)) {
  2240. console.warn("[Vue tip]: " + msg + (
  2241. vm ? generateComponentTrace(vm) : ''
  2242. ));
  2243. }
  2244. };
  2245. formatComponentName = function (vm, includeFile) {
  2246. if (vm.$root === vm) {
  2247. if (vm.$options && vm.$options.__file) { // fixed by xxxxxx
  2248. return ('') + vm.$options.__file
  2249. }
  2250. return '<Root>'
  2251. }
  2252. var options = typeof vm === 'function' && vm.cid != null
  2253. ? vm.options
  2254. : vm._isVue
  2255. ? vm.$options || vm.constructor.options
  2256. : vm;
  2257. var name = options.name || options._componentTag;
  2258. var file = options.__file;
  2259. if (!name && file) {
  2260. var match = file.match(/([^/\\]+)\.vue$/);
  2261. name = match && match[1];
  2262. }
  2263. return (
  2264. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  2265. (file && includeFile !== false ? (" at " + file) : '')
  2266. )
  2267. };
  2268. var repeat = function (str, n) {
  2269. var res = '';
  2270. while (n) {
  2271. if (n % 2 === 1) { res += str; }
  2272. if (n > 1) { str += str; }
  2273. n >>= 1;
  2274. }
  2275. return res
  2276. };
  2277. generateComponentTrace = function (vm) {
  2278. if (vm._isVue && vm.$parent) {
  2279. var tree = [];
  2280. var currentRecursiveSequence = 0;
  2281. while (vm && vm.$options.name !== 'PageBody') {
  2282. if (tree.length > 0) {
  2283. var last = tree[tree.length - 1];
  2284. if (last.constructor === vm.constructor) {
  2285. currentRecursiveSequence++;
  2286. vm = vm.$parent;
  2287. continue
  2288. } else if (currentRecursiveSequence > 0) {
  2289. tree[tree.length - 1] = [last, currentRecursiveSequence];
  2290. currentRecursiveSequence = 0;
  2291. }
  2292. }
  2293. !vm.$options.isReserved && tree.push(vm);
  2294. vm = vm.$parent;
  2295. }
  2296. return '\n\nfound in\n\n' + tree
  2297. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  2298. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  2299. : formatComponentName(vm))); })
  2300. .join('\n')
  2301. } else {
  2302. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  2303. }
  2304. };
  2305. }
  2306. /* */
  2307. var uid = 0;
  2308. /**
  2309. * A dep is an observable that can have multiple
  2310. * directives subscribing to it.
  2311. */
  2312. var Dep = function Dep () {
  2313. this.id = uid++;
  2314. this.subs = [];
  2315. };
  2316. Dep.prototype.addSub = function addSub (sub) {
  2317. this.subs.push(sub);
  2318. };
  2319. Dep.prototype.removeSub = function removeSub (sub) {
  2320. remove(this.subs, sub);
  2321. };
  2322. Dep.prototype.depend = function depend () {
  2323. if (Dep.SharedObject.target) {
  2324. Dep.SharedObject.target.addDep(this);
  2325. }
  2326. };
  2327. Dep.prototype.notify = function notify () {
  2328. // stabilize the subscriber list first
  2329. var subs = this.subs.slice();
  2330. if ( true && !config.async) {
  2331. // subs aren't sorted in scheduler if not running async
  2332. // we need to sort them now to make sure they fire in correct
  2333. // order
  2334. subs.sort(function (a, b) { return a.id - b.id; });
  2335. }
  2336. for (var i = 0, l = subs.length; i < l; i++) {
  2337. subs[i].update();
  2338. }
  2339. };
  2340. // The current target watcher being evaluated.
  2341. // This is globally unique because only one watcher
  2342. // can be evaluated at a time.
  2343. // fixed by xxxxxx (nvue shared vuex)
  2344. /* eslint-disable no-undef */
  2345. Dep.SharedObject = {};
  2346. Dep.SharedObject.target = null;
  2347. Dep.SharedObject.targetStack = [];
  2348. function pushTarget (target) {
  2349. Dep.SharedObject.targetStack.push(target);
  2350. Dep.SharedObject.target = target;
  2351. Dep.target = target;
  2352. }
  2353. function popTarget () {
  2354. Dep.SharedObject.targetStack.pop();
  2355. Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1];
  2356. Dep.target = Dep.SharedObject.target;
  2357. }
  2358. /* */
  2359. var VNode = function VNode (
  2360. tag,
  2361. data,
  2362. children,
  2363. text,
  2364. elm,
  2365. context,
  2366. componentOptions,
  2367. asyncFactory
  2368. ) {
  2369. this.tag = tag;
  2370. this.data = data;
  2371. this.children = children;
  2372. this.text = text;
  2373. this.elm = elm;
  2374. this.ns = undefined;
  2375. this.context = context;
  2376. this.fnContext = undefined;
  2377. this.fnOptions = undefined;
  2378. this.fnScopeId = undefined;
  2379. this.key = data && data.key;
  2380. this.componentOptions = componentOptions;
  2381. this.componentInstance = undefined;
  2382. this.parent = undefined;
  2383. this.raw = false;
  2384. this.isStatic = false;
  2385. this.isRootInsert = true;
  2386. this.isComment = false;
  2387. this.isCloned = false;
  2388. this.isOnce = false;
  2389. this.asyncFactory = asyncFactory;
  2390. this.asyncMeta = undefined;
  2391. this.isAsyncPlaceholder = false;
  2392. };
  2393. var prototypeAccessors = { child: { configurable: true } };
  2394. // DEPRECATED: alias for componentInstance for backwards compat.
  2395. /* istanbul ignore next */
  2396. prototypeAccessors.child.get = function () {
  2397. return this.componentInstance
  2398. };
  2399. Object.defineProperties( VNode.prototype, prototypeAccessors );
  2400. var createEmptyVNode = function (text) {
  2401. if ( text === void 0 ) text = '';
  2402. var node = new VNode();
  2403. node.text = text;
  2404. node.isComment = true;
  2405. return node
  2406. };
  2407. function createTextVNode (val) {
  2408. return new VNode(undefined, undefined, undefined, String(val))
  2409. }
  2410. // optimized shallow clone
  2411. // used for static nodes and slot nodes because they may be reused across
  2412. // multiple renders, cloning them avoids errors when DOM manipulations rely
  2413. // on their elm reference.
  2414. function cloneVNode (vnode) {
  2415. var cloned = new VNode(
  2416. vnode.tag,
  2417. vnode.data,
  2418. // #7975
  2419. // clone children array to avoid mutating original in case of cloning
  2420. // a child.
  2421. vnode.children && vnode.children.slice(),
  2422. vnode.text,
  2423. vnode.elm,
  2424. vnode.context,
  2425. vnode.componentOptions,
  2426. vnode.asyncFactory
  2427. );
  2428. cloned.ns = vnode.ns;
  2429. cloned.isStatic = vnode.isStatic;
  2430. cloned.key = vnode.key;
  2431. cloned.isComment = vnode.isComment;
  2432. cloned.fnContext = vnode.fnContext;
  2433. cloned.fnOptions = vnode.fnOptions;
  2434. cloned.fnScopeId = vnode.fnScopeId;
  2435. cloned.asyncMeta = vnode.asyncMeta;
  2436. cloned.isCloned = true;
  2437. return cloned
  2438. }
  2439. /*
  2440. * not type checking this file because flow doesn't play well with
  2441. * dynamically accessing methods on Array prototype
  2442. */
  2443. var arrayProto = Array.prototype;
  2444. var arrayMethods = Object.create(arrayProto);
  2445. var methodsToPatch = [
  2446. 'push',
  2447. 'pop',
  2448. 'shift',
  2449. 'unshift',
  2450. 'splice',
  2451. 'sort',
  2452. 'reverse'
  2453. ];
  2454. /**
  2455. * Intercept mutating methods and emit events
  2456. */
  2457. methodsToPatch.forEach(function (method) {
  2458. // cache original method
  2459. var original = arrayProto[method];
  2460. def(arrayMethods, method, function mutator () {
  2461. var args = [], len = arguments.length;
  2462. while ( len-- ) args[ len ] = arguments[ len ];
  2463. var result = original.apply(this, args);
  2464. var ob = this.__ob__;
  2465. var inserted;
  2466. switch (method) {
  2467. case 'push':
  2468. case 'unshift':
  2469. inserted = args;
  2470. break
  2471. case 'splice':
  2472. inserted = args.slice(2);
  2473. break
  2474. }
  2475. if (inserted) { ob.observeArray(inserted); }
  2476. // notify change
  2477. ob.dep.notify();
  2478. return result
  2479. });
  2480. });
  2481. /* */
  2482. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  2483. /**
  2484. * In some cases we may want to disable observation inside a component's
  2485. * update computation.
  2486. */
  2487. var shouldObserve = true;
  2488. function toggleObserving (value) {
  2489. shouldObserve = value;
  2490. }
  2491. /**
  2492. * Observer class that is attached to each observed
  2493. * object. Once attached, the observer converts the target
  2494. * object's property keys into getter/setters that
  2495. * collect dependencies and dispatch updates.
  2496. */
  2497. var Observer = function Observer (value) {
  2498. this.value = value;
  2499. this.dep = new Dep();
  2500. this.vmCount = 0;
  2501. def(value, '__ob__', this);
  2502. if (Array.isArray(value)) {
  2503. if (hasProto) {
  2504. {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑
  2505. if(value.push !== value.__proto__.push){
  2506. copyAugment(value, arrayMethods, arrayKeys);
  2507. } else {
  2508. protoAugment(value, arrayMethods);
  2509. }
  2510. }
  2511. } else {
  2512. copyAugment(value, arrayMethods, arrayKeys);
  2513. }
  2514. this.observeArray(value);
  2515. } else {
  2516. this.walk(value);
  2517. }
  2518. };
  2519. /**
  2520. * Walk through all properties and convert them into
  2521. * getter/setters. This method should only be called when
  2522. * value type is Object.
  2523. */
  2524. Observer.prototype.walk = function walk (obj) {
  2525. var keys = Object.keys(obj);
  2526. for (var i = 0; i < keys.length; i++) {
  2527. defineReactive$$1(obj, keys[i]);
  2528. }
  2529. };
  2530. /**
  2531. * Observe a list of Array items.
  2532. */
  2533. Observer.prototype.observeArray = function observeArray (items) {
  2534. for (var i = 0, l = items.length; i < l; i++) {
  2535. observe(items[i]);
  2536. }
  2537. };
  2538. // helpers
  2539. /**
  2540. * Augment a target Object or Array by intercepting
  2541. * the prototype chain using __proto__
  2542. */
  2543. function protoAugment (target, src) {
  2544. /* eslint-disable no-proto */
  2545. target.__proto__ = src;
  2546. /* eslint-enable no-proto */
  2547. }
  2548. /**
  2549. * Augment a target Object or Array by defining
  2550. * hidden properties.
  2551. */
  2552. /* istanbul ignore next */
  2553. function copyAugment (target, src, keys) {
  2554. for (var i = 0, l = keys.length; i < l; i++) {
  2555. var key = keys[i];
  2556. def(target, key, src[key]);
  2557. }
  2558. }
  2559. /**
  2560. * Attempt to create an observer instance for a value,
  2561. * returns the new observer if successfully observed,
  2562. * or the existing observer if the value already has one.
  2563. */
  2564. function observe (value, asRootData) {
  2565. if (!isObject(value) || value instanceof VNode) {
  2566. return
  2567. }
  2568. var ob;
  2569. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  2570. ob = value.__ob__;
  2571. } else if (
  2572. shouldObserve &&
  2573. !isServerRendering() &&
  2574. (Array.isArray(value) || isPlainObject(value)) &&
  2575. Object.isExtensible(value) &&
  2576. !value._isVue
  2577. ) {
  2578. ob = new Observer(value);
  2579. }
  2580. if (asRootData && ob) {
  2581. ob.vmCount++;
  2582. }
  2583. return ob
  2584. }
  2585. /**
  2586. * Define a reactive property on an Object.
  2587. */
  2588. function defineReactive$$1 (
  2589. obj,
  2590. key,
  2591. val,
  2592. customSetter,
  2593. shallow
  2594. ) {
  2595. var dep = new Dep();
  2596. var property = Object.getOwnPropertyDescriptor(obj, key);
  2597. if (property && property.configurable === false) {
  2598. return
  2599. }
  2600. // cater for pre-defined getter/setters
  2601. var getter = property && property.get;
  2602. var setter = property && property.set;
  2603. if ((!getter || setter) && arguments.length === 2) {
  2604. val = obj[key];
  2605. }
  2606. var childOb = !shallow && observe(val);
  2607. Object.defineProperty(obj, key, {
  2608. enumerable: true,
  2609. configurable: true,
  2610. get: function reactiveGetter () {
  2611. var value = getter ? getter.call(obj) : val;
  2612. if (Dep.SharedObject.target) { // fixed by xxxxxx
  2613. dep.depend();
  2614. if (childOb) {
  2615. childOb.dep.depend();
  2616. if (Array.isArray(value)) {
  2617. dependArray(value);
  2618. }
  2619. }
  2620. }
  2621. return value
  2622. },
  2623. set: function reactiveSetter (newVal) {
  2624. var value = getter ? getter.call(obj) : val;
  2625. /* eslint-disable no-self-compare */
  2626. if (newVal === value || (newVal !== newVal && value !== value)) {
  2627. return
  2628. }
  2629. /* eslint-enable no-self-compare */
  2630. if ( true && customSetter) {
  2631. customSetter();
  2632. }
  2633. // #7981: for accessor properties without setter
  2634. if (getter && !setter) { return }
  2635. if (setter) {
  2636. setter.call(obj, newVal);
  2637. } else {
  2638. val = newVal;
  2639. }
  2640. childOb = !shallow && observe(newVal);
  2641. dep.notify();
  2642. }
  2643. });
  2644. }
  2645. /**
  2646. * Set a property on an object. Adds the new property and
  2647. * triggers change notification if the property doesn't
  2648. * already exist.
  2649. */
  2650. function set (target, key, val) {
  2651. if ( true &&
  2652. (isUndef(target) || isPrimitive(target))
  2653. ) {
  2654. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  2655. }
  2656. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2657. target.length = Math.max(target.length, key);
  2658. target.splice(key, 1, val);
  2659. return val
  2660. }
  2661. if (key in target && !(key in Object.prototype)) {
  2662. target[key] = val;
  2663. return val
  2664. }
  2665. var ob = (target).__ob__;
  2666. if (target._isVue || (ob && ob.vmCount)) {
  2667. true && warn(
  2668. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  2669. 'at runtime - declare it upfront in the data option.'
  2670. );
  2671. return val
  2672. }
  2673. if (!ob) {
  2674. target[key] = val;
  2675. return val
  2676. }
  2677. defineReactive$$1(ob.value, key, val);
  2678. ob.dep.notify();
  2679. return val
  2680. }
  2681. /**
  2682. * Delete a property and trigger change if necessary.
  2683. */
  2684. function del (target, key) {
  2685. if ( true &&
  2686. (isUndef(target) || isPrimitive(target))
  2687. ) {
  2688. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  2689. }
  2690. if (Array.isArray(target) && isValidArrayIndex(key)) {
  2691. target.splice(key, 1);
  2692. return
  2693. }
  2694. var ob = (target).__ob__;
  2695. if (target._isVue || (ob && ob.vmCount)) {
  2696. true && warn(
  2697. 'Avoid deleting properties on a Vue instance or its root $data ' +
  2698. '- just set it to null.'
  2699. );
  2700. return
  2701. }
  2702. if (!hasOwn(target, key)) {
  2703. return
  2704. }
  2705. delete target[key];
  2706. if (!ob) {
  2707. return
  2708. }
  2709. ob.dep.notify();
  2710. }
  2711. /**
  2712. * Collect dependencies on array elements when the array is touched, since
  2713. * we cannot intercept array element access like property getters.
  2714. */
  2715. function dependArray (value) {
  2716. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  2717. e = value[i];
  2718. e && e.__ob__ && e.__ob__.dep.depend();
  2719. if (Array.isArray(e)) {
  2720. dependArray(e);
  2721. }
  2722. }
  2723. }
  2724. /* */
  2725. /**
  2726. * Option overwriting strategies are functions that handle
  2727. * how to merge a parent option value and a child option
  2728. * value into the final value.
  2729. */
  2730. var strats = config.optionMergeStrategies;
  2731. /**
  2732. * Options with restrictions
  2733. */
  2734. if (true) {
  2735. strats.el = strats.propsData = function (parent, child, vm, key) {
  2736. if (!vm) {
  2737. warn(
  2738. "option \"" + key + "\" can only be used during instance " +
  2739. 'creation with the `new` keyword.'
  2740. );
  2741. }
  2742. return defaultStrat(parent, child)
  2743. };
  2744. }
  2745. /**
  2746. * Helper that recursively merges two data objects together.
  2747. */
  2748. function mergeData (to, from) {
  2749. if (!from) { return to }
  2750. var key, toVal, fromVal;
  2751. var keys = hasSymbol
  2752. ? Reflect.ownKeys(from)
  2753. : Object.keys(from);
  2754. for (var i = 0; i < keys.length; i++) {
  2755. key = keys[i];
  2756. // in case the object is already observed...
  2757. if (key === '__ob__') { continue }
  2758. toVal = to[key];
  2759. fromVal = from[key];
  2760. if (!hasOwn(to, key)) {
  2761. set(to, key, fromVal);
  2762. } else if (
  2763. toVal !== fromVal &&
  2764. isPlainObject(toVal) &&
  2765. isPlainObject(fromVal)
  2766. ) {
  2767. mergeData(toVal, fromVal);
  2768. }
  2769. }
  2770. return to
  2771. }
  2772. /**
  2773. * Data
  2774. */
  2775. function mergeDataOrFn (
  2776. parentVal,
  2777. childVal,
  2778. vm
  2779. ) {
  2780. if (!vm) {
  2781. // in a Vue.extend merge, both should be functions
  2782. if (!childVal) {
  2783. return parentVal
  2784. }
  2785. if (!parentVal) {
  2786. return childVal
  2787. }
  2788. // when parentVal & childVal are both present,
  2789. // we need to return a function that returns the
  2790. // merged result of both functions... no need to
  2791. // check if parentVal is a function here because
  2792. // it has to be a function to pass previous merges.
  2793. return function mergedDataFn () {
  2794. return mergeData(
  2795. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  2796. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  2797. )
  2798. }
  2799. } else {
  2800. return function mergedInstanceDataFn () {
  2801. // instance merge
  2802. var instanceData = typeof childVal === 'function'
  2803. ? childVal.call(vm, vm)
  2804. : childVal;
  2805. var defaultData = typeof parentVal === 'function'
  2806. ? parentVal.call(vm, vm)
  2807. : parentVal;
  2808. if (instanceData) {
  2809. return mergeData(instanceData, defaultData)
  2810. } else {
  2811. return defaultData
  2812. }
  2813. }
  2814. }
  2815. }
  2816. strats.data = function (
  2817. parentVal,
  2818. childVal,
  2819. vm
  2820. ) {
  2821. if (!vm) {
  2822. if (childVal && typeof childVal !== 'function') {
  2823. true && warn(
  2824. 'The "data" option should be a function ' +
  2825. 'that returns a per-instance value in component ' +
  2826. 'definitions.',
  2827. vm
  2828. );
  2829. return parentVal
  2830. }
  2831. return mergeDataOrFn(parentVal, childVal)
  2832. }
  2833. return mergeDataOrFn(parentVal, childVal, vm)
  2834. };
  2835. /**
  2836. * Hooks and props are merged as arrays.
  2837. */
  2838. function mergeHook (
  2839. parentVal,
  2840. childVal
  2841. ) {
  2842. var res = childVal
  2843. ? parentVal
  2844. ? parentVal.concat(childVal)
  2845. : Array.isArray(childVal)
  2846. ? childVal
  2847. : [childVal]
  2848. : parentVal;
  2849. return res
  2850. ? dedupeHooks(res)
  2851. : res
  2852. }
  2853. function dedupeHooks (hooks) {
  2854. var res = [];
  2855. for (var i = 0; i < hooks.length; i++) {
  2856. if (res.indexOf(hooks[i]) === -1) {
  2857. res.push(hooks[i]);
  2858. }
  2859. }
  2860. return res
  2861. }
  2862. LIFECYCLE_HOOKS.forEach(function (hook) {
  2863. strats[hook] = mergeHook;
  2864. });
  2865. /**
  2866. * Assets
  2867. *
  2868. * When a vm is present (instance creation), we need to do
  2869. * a three-way merge between constructor options, instance
  2870. * options and parent options.
  2871. */
  2872. function mergeAssets (
  2873. parentVal,
  2874. childVal,
  2875. vm,
  2876. key
  2877. ) {
  2878. var res = Object.create(parentVal || null);
  2879. if (childVal) {
  2880. true && assertObjectType(key, childVal, vm);
  2881. return extend(res, childVal)
  2882. } else {
  2883. return res
  2884. }
  2885. }
  2886. ASSET_TYPES.forEach(function (type) {
  2887. strats[type + 's'] = mergeAssets;
  2888. });
  2889. /**
  2890. * Watchers.
  2891. *
  2892. * Watchers hashes should not overwrite one
  2893. * another, so we merge them as arrays.
  2894. */
  2895. strats.watch = function (
  2896. parentVal,
  2897. childVal,
  2898. vm,
  2899. key
  2900. ) {
  2901. // work around Firefox's Object.prototype.watch...
  2902. if (parentVal === nativeWatch) { parentVal = undefined; }
  2903. if (childVal === nativeWatch) { childVal = undefined; }
  2904. /* istanbul ignore if */
  2905. if (!childVal) { return Object.create(parentVal || null) }
  2906. if (true) {
  2907. assertObjectType(key, childVal, vm);
  2908. }
  2909. if (!parentVal) { return childVal }
  2910. var ret = {};
  2911. extend(ret, parentVal);
  2912. for (var key$1 in childVal) {
  2913. var parent = ret[key$1];
  2914. var child = childVal[key$1];
  2915. if (parent && !Array.isArray(parent)) {
  2916. parent = [parent];
  2917. }
  2918. ret[key$1] = parent
  2919. ? parent.concat(child)
  2920. : Array.isArray(child) ? child : [child];
  2921. }
  2922. return ret
  2923. };
  2924. /**
  2925. * Other object hashes.
  2926. */
  2927. strats.props =
  2928. strats.methods =
  2929. strats.inject =
  2930. strats.computed = function (
  2931. parentVal,
  2932. childVal,
  2933. vm,
  2934. key
  2935. ) {
  2936. if (childVal && "development" !== 'production') {
  2937. assertObjectType(key, childVal, vm);
  2938. }
  2939. if (!parentVal) { return childVal }
  2940. var ret = Object.create(null);
  2941. extend(ret, parentVal);
  2942. if (childVal) { extend(ret, childVal); }
  2943. return ret
  2944. };
  2945. strats.provide = mergeDataOrFn;
  2946. /**
  2947. * Default strategy.
  2948. */
  2949. var defaultStrat = function (parentVal, childVal) {
  2950. return childVal === undefined
  2951. ? parentVal
  2952. : childVal
  2953. };
  2954. /**
  2955. * Validate component names
  2956. */
  2957. function checkComponents (options) {
  2958. for (var key in options.components) {
  2959. validateComponentName(key);
  2960. }
  2961. }
  2962. function validateComponentName (name) {
  2963. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  2964. warn(
  2965. 'Invalid component name: "' + name + '". Component names ' +
  2966. 'should conform to valid custom element name in html5 specification.'
  2967. );
  2968. }
  2969. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  2970. warn(
  2971. 'Do not use built-in or reserved HTML elements as component ' +
  2972. 'id: ' + name
  2973. );
  2974. }
  2975. }
  2976. /**
  2977. * Ensure all props option syntax are normalized into the
  2978. * Object-based format.
  2979. */
  2980. function normalizeProps (options, vm) {
  2981. var props = options.props;
  2982. if (!props) { return }
  2983. var res = {};
  2984. var i, val, name;
  2985. if (Array.isArray(props)) {
  2986. i = props.length;
  2987. while (i--) {
  2988. val = props[i];
  2989. if (typeof val === 'string') {
  2990. name = camelize(val);
  2991. res[name] = { type: null };
  2992. } else if (true) {
  2993. warn('props must be strings when using array syntax.');
  2994. }
  2995. }
  2996. } else if (isPlainObject(props)) {
  2997. for (var key in props) {
  2998. val = props[key];
  2999. name = camelize(key);
  3000. res[name] = isPlainObject(val)
  3001. ? val
  3002. : { type: val };
  3003. }
  3004. } else if (true) {
  3005. warn(
  3006. "Invalid value for option \"props\": expected an Array or an Object, " +
  3007. "but got " + (toRawType(props)) + ".",
  3008. vm
  3009. );
  3010. }
  3011. options.props = res;
  3012. }
  3013. /**
  3014. * Normalize all injections into Object-based format
  3015. */
  3016. function normalizeInject (options, vm) {
  3017. var inject = options.inject;
  3018. if (!inject) { return }
  3019. var normalized = options.inject = {};
  3020. if (Array.isArray(inject)) {
  3021. for (var i = 0; i < inject.length; i++) {
  3022. normalized[inject[i]] = { from: inject[i] };
  3023. }
  3024. } else if (isPlainObject(inject)) {
  3025. for (var key in inject) {
  3026. var val = inject[key];
  3027. normalized[key] = isPlainObject(val)
  3028. ? extend({ from: key }, val)
  3029. : { from: val };
  3030. }
  3031. } else if (true) {
  3032. warn(
  3033. "Invalid value for option \"inject\": expected an Array or an Object, " +
  3034. "but got " + (toRawType(inject)) + ".",
  3035. vm
  3036. );
  3037. }
  3038. }
  3039. /**
  3040. * Normalize raw function directives into object format.
  3041. */
  3042. function normalizeDirectives (options) {
  3043. var dirs = options.directives;
  3044. if (dirs) {
  3045. for (var key in dirs) {
  3046. var def$$1 = dirs[key];
  3047. if (typeof def$$1 === 'function') {
  3048. dirs[key] = { bind: def$$1, update: def$$1 };
  3049. }
  3050. }
  3051. }
  3052. }
  3053. function assertObjectType (name, value, vm) {
  3054. if (!isPlainObject(value)) {
  3055. warn(
  3056. "Invalid value for option \"" + name + "\": expected an Object, " +
  3057. "but got " + (toRawType(value)) + ".",
  3058. vm
  3059. );
  3060. }
  3061. }
  3062. /**
  3063. * Merge two option objects into a new one.
  3064. * Core utility used in both instantiation and inheritance.
  3065. */
  3066. function mergeOptions (
  3067. parent,
  3068. child,
  3069. vm
  3070. ) {
  3071. if (true) {
  3072. checkComponents(child);
  3073. }
  3074. if (typeof child === 'function') {
  3075. child = child.options;
  3076. }
  3077. normalizeProps(child, vm);
  3078. normalizeInject(child, vm);
  3079. normalizeDirectives(child);
  3080. // Apply extends and mixins on the child options,
  3081. // but only if it is a raw options object that isn't
  3082. // the result of another mergeOptions call.
  3083. // Only merged options has the _base property.
  3084. if (!child._base) {
  3085. if (child.extends) {
  3086. parent = mergeOptions(parent, child.extends, vm);
  3087. }
  3088. if (child.mixins) {
  3089. for (var i = 0, l = child.mixins.length; i < l; i++) {
  3090. parent = mergeOptions(parent, child.mixins[i], vm);
  3091. }
  3092. }
  3093. }
  3094. var options = {};
  3095. var key;
  3096. for (key in parent) {
  3097. mergeField(key);
  3098. }
  3099. for (key in child) {
  3100. if (!hasOwn(parent, key)) {
  3101. mergeField(key);
  3102. }
  3103. }
  3104. function mergeField (key) {
  3105. var strat = strats[key] || defaultStrat;
  3106. options[key] = strat(parent[key], child[key], vm, key);
  3107. }
  3108. return options
  3109. }
  3110. /**
  3111. * Resolve an asset.
  3112. * This function is used because child instances need access
  3113. * to assets defined in its ancestor chain.
  3114. */
  3115. function resolveAsset (
  3116. options,
  3117. type,
  3118. id,
  3119. warnMissing
  3120. ) {
  3121. /* istanbul ignore if */
  3122. if (typeof id !== 'string') {
  3123. return
  3124. }
  3125. var assets = options[type];
  3126. // check local registration variations first
  3127. if (hasOwn(assets, id)) { return assets[id] }
  3128. var camelizedId = camelize(id);
  3129. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  3130. var PascalCaseId = capitalize(camelizedId);
  3131. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  3132. // fallback to prototype chain
  3133. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  3134. if ( true && warnMissing && !res) {
  3135. warn(
  3136. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  3137. options
  3138. );
  3139. }
  3140. return res
  3141. }
  3142. /* */
  3143. function validateProp (
  3144. key,
  3145. propOptions,
  3146. propsData,
  3147. vm
  3148. ) {
  3149. var prop = propOptions[key];
  3150. var absent = !hasOwn(propsData, key);
  3151. var value = propsData[key];
  3152. // boolean casting
  3153. var booleanIndex = getTypeIndex(Boolean, prop.type);
  3154. if (booleanIndex > -1) {
  3155. if (absent && !hasOwn(prop, 'default')) {
  3156. value = false;
  3157. } else if (value === '' || value === hyphenate(key)) {
  3158. // only cast empty string / same name to boolean if
  3159. // boolean has higher priority
  3160. var stringIndex = getTypeIndex(String, prop.type);
  3161. if (stringIndex < 0 || booleanIndex < stringIndex) {
  3162. value = true;
  3163. }
  3164. }
  3165. }
  3166. // check default value
  3167. if (value === undefined) {
  3168. value = getPropDefaultValue(vm, prop, key);
  3169. // since the default value is a fresh copy,
  3170. // make sure to observe it.
  3171. var prevShouldObserve = shouldObserve;
  3172. toggleObserving(true);
  3173. observe(value);
  3174. toggleObserving(prevShouldObserve);
  3175. }
  3176. if (
  3177. true
  3178. ) {
  3179. assertProp(prop, key, value, vm, absent);
  3180. }
  3181. return value
  3182. }
  3183. /**
  3184. * Get the default value of a prop.
  3185. */
  3186. function getPropDefaultValue (vm, prop, key) {
  3187. // no default, return undefined
  3188. if (!hasOwn(prop, 'default')) {
  3189. return undefined
  3190. }
  3191. var def = prop.default;
  3192. // warn against non-factory defaults for Object & Array
  3193. if ( true && isObject(def)) {
  3194. warn(
  3195. 'Invalid default value for prop "' + key + '": ' +
  3196. 'Props with type Object/Array must use a factory function ' +
  3197. 'to return the default value.',
  3198. vm
  3199. );
  3200. }
  3201. // the raw prop value was also undefined from previous render,
  3202. // return previous default value to avoid unnecessary watcher trigger
  3203. if (vm && vm.$options.propsData &&
  3204. vm.$options.propsData[key] === undefined &&
  3205. vm._props[key] !== undefined
  3206. ) {
  3207. return vm._props[key]
  3208. }
  3209. // call factory function for non-Function types
  3210. // a value is Function if its prototype is function even across different execution context
  3211. return typeof def === 'function' && getType(prop.type) !== 'Function'
  3212. ? def.call(vm)
  3213. : def
  3214. }
  3215. /**
  3216. * Assert whether a prop is valid.
  3217. */
  3218. function assertProp (
  3219. prop,
  3220. name,
  3221. value,
  3222. vm,
  3223. absent
  3224. ) {
  3225. if (prop.required && absent) {
  3226. warn(
  3227. 'Missing required prop: "' + name + '"',
  3228. vm
  3229. );
  3230. return
  3231. }
  3232. if (value == null && !prop.required) {
  3233. return
  3234. }
  3235. var type = prop.type;
  3236. var valid = !type || type === true;
  3237. var expectedTypes = [];
  3238. if (type) {
  3239. if (!Array.isArray(type)) {
  3240. type = [type];
  3241. }
  3242. for (var i = 0; i < type.length && !valid; i++) {
  3243. var assertedType = assertType(value, type[i]);
  3244. expectedTypes.push(assertedType.expectedType || '');
  3245. valid = assertedType.valid;
  3246. }
  3247. }
  3248. if (!valid) {
  3249. warn(
  3250. getInvalidTypeMessage(name, value, expectedTypes),
  3251. vm
  3252. );
  3253. return
  3254. }
  3255. var validator = prop.validator;
  3256. if (validator) {
  3257. if (!validator(value)) {
  3258. warn(
  3259. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  3260. vm
  3261. );
  3262. }
  3263. }
  3264. }
  3265. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  3266. function assertType (value, type) {
  3267. var valid;
  3268. var expectedType = getType(type);
  3269. if (simpleCheckRE.test(expectedType)) {
  3270. var t = typeof value;
  3271. valid = t === expectedType.toLowerCase();
  3272. // for primitive wrapper objects
  3273. if (!valid && t === 'object') {
  3274. valid = value instanceof type;
  3275. }
  3276. } else if (expectedType === 'Object') {
  3277. valid = isPlainObject(value);
  3278. } else if (expectedType === 'Array') {
  3279. valid = Array.isArray(value);
  3280. } else {
  3281. valid = value instanceof type;
  3282. }
  3283. return {
  3284. valid: valid,
  3285. expectedType: expectedType
  3286. }
  3287. }
  3288. /**
  3289. * Use function string name to check built-in types,
  3290. * because a simple equality check will fail when running
  3291. * across different vms / iframes.
  3292. */
  3293. function getType (fn) {
  3294. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  3295. return match ? match[1] : ''
  3296. }
  3297. function isSameType (a, b) {
  3298. return getType(a) === getType(b)
  3299. }
  3300. function getTypeIndex (type, expectedTypes) {
  3301. if (!Array.isArray(expectedTypes)) {
  3302. return isSameType(expectedTypes, type) ? 0 : -1
  3303. }
  3304. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  3305. if (isSameType(expectedTypes[i], type)) {
  3306. return i
  3307. }
  3308. }
  3309. return -1
  3310. }
  3311. function getInvalidTypeMessage (name, value, expectedTypes) {
  3312. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  3313. " Expected " + (expectedTypes.map(capitalize).join(', '));
  3314. var expectedType = expectedTypes[0];
  3315. var receivedType = toRawType(value);
  3316. var expectedValue = styleValue(value, expectedType);
  3317. var receivedValue = styleValue(value, receivedType);
  3318. // check if we need to specify expected value
  3319. if (expectedTypes.length === 1 &&
  3320. isExplicable(expectedType) &&
  3321. !isBoolean(expectedType, receivedType)) {
  3322. message += " with value " + expectedValue;
  3323. }
  3324. message += ", got " + receivedType + " ";
  3325. // check if we need to specify received value
  3326. if (isExplicable(receivedType)) {
  3327. message += "with value " + receivedValue + ".";
  3328. }
  3329. return message
  3330. }
  3331. function styleValue (value, type) {
  3332. if (type === 'String') {
  3333. return ("\"" + value + "\"")
  3334. } else if (type === 'Number') {
  3335. return ("" + (Number(value)))
  3336. } else {
  3337. return ("" + value)
  3338. }
  3339. }
  3340. function isExplicable (value) {
  3341. var explicitTypes = ['string', 'number', 'boolean'];
  3342. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  3343. }
  3344. function isBoolean () {
  3345. var args = [], len = arguments.length;
  3346. while ( len-- ) args[ len ] = arguments[ len ];
  3347. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  3348. }
  3349. /* */
  3350. function handleError (err, vm, info) {
  3351. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  3352. // See: https://github.com/vuejs/vuex/issues/1505
  3353. pushTarget();
  3354. try {
  3355. if (vm) {
  3356. var cur = vm;
  3357. while ((cur = cur.$parent)) {
  3358. var hooks = cur.$options.errorCaptured;
  3359. if (hooks) {
  3360. for (var i = 0; i < hooks.length; i++) {
  3361. try {
  3362. var capture = hooks[i].call(cur, err, vm, info) === false;
  3363. if (capture) { return }
  3364. } catch (e) {
  3365. globalHandleError(e, cur, 'errorCaptured hook');
  3366. }
  3367. }
  3368. }
  3369. }
  3370. }
  3371. globalHandleError(err, vm, info);
  3372. } finally {
  3373. popTarget();
  3374. }
  3375. }
  3376. function invokeWithErrorHandling (
  3377. handler,
  3378. context,
  3379. args,
  3380. vm,
  3381. info
  3382. ) {
  3383. var res;
  3384. try {
  3385. res = args ? handler.apply(context, args) : handler.call(context);
  3386. if (res && !res._isVue && isPromise(res) && !res._handled) {
  3387. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  3388. // issue #9511
  3389. // avoid catch triggering multiple times when nested calls
  3390. res._handled = true;
  3391. }
  3392. } catch (e) {
  3393. handleError(e, vm, info);
  3394. }
  3395. return res
  3396. }
  3397. function globalHandleError (err, vm, info) {
  3398. if (config.errorHandler) {
  3399. try {
  3400. return config.errorHandler.call(null, err, vm, info)
  3401. } catch (e) {
  3402. // if the user intentionally throws the original error in the handler,
  3403. // do not log it twice
  3404. if (e !== err) {
  3405. logError(e, null, 'config.errorHandler');
  3406. }
  3407. }
  3408. }
  3409. logError(err, vm, info);
  3410. }
  3411. function logError (err, vm, info) {
  3412. if (true) {
  3413. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  3414. }
  3415. /* istanbul ignore else */
  3416. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  3417. console.error(err);
  3418. } else {
  3419. throw err
  3420. }
  3421. }
  3422. /* */
  3423. var callbacks = [];
  3424. var pending = false;
  3425. function flushCallbacks () {
  3426. pending = false;
  3427. var copies = callbacks.slice(0);
  3428. callbacks.length = 0;
  3429. for (var i = 0; i < copies.length; i++) {
  3430. copies[i]();
  3431. }
  3432. }
  3433. // Here we have async deferring wrappers using microtasks.
  3434. // In 2.5 we used (macro) tasks (in combination with microtasks).
  3435. // However, it has subtle problems when state is changed right before repaint
  3436. // (e.g. #6813, out-in transitions).
  3437. // Also, using (macro) tasks in event handler would cause some weird behaviors
  3438. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  3439. // So we now use microtasks everywhere, again.
  3440. // A major drawback of this tradeoff is that there are some scenarios
  3441. // where microtasks have too high a priority and fire in between supposedly
  3442. // sequential events (e.g. #4521, #6690, which have workarounds)
  3443. // or even between bubbling of the same event (#6566).
  3444. var timerFunc;
  3445. // The nextTick behavior leverages the microtask queue, which can be accessed
  3446. // via either native Promise.then or MutationObserver.
  3447. // MutationObserver has wider support, however it is seriously bugged in
  3448. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  3449. // completely stops working after triggering a few times... so, if native
  3450. // Promise is available, we will use it:
  3451. /* istanbul ignore next, $flow-disable-line */
  3452. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  3453. var p = Promise.resolve();
  3454. timerFunc = function () {
  3455. p.then(flushCallbacks);
  3456. // In problematic UIWebViews, Promise.then doesn't completely break, but
  3457. // it can get stuck in a weird state where callbacks are pushed into the
  3458. // microtask queue but the queue isn't being flushed, until the browser
  3459. // needs to do some other work, e.g. handle a timer. Therefore we can
  3460. // "force" the microtask queue to be flushed by adding an empty timer.
  3461. if (isIOS) { setTimeout(noop); }
  3462. };
  3463. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  3464. isNative(MutationObserver) ||
  3465. // PhantomJS and iOS 7.x
  3466. MutationObserver.toString() === '[object MutationObserverConstructor]'
  3467. )) {
  3468. // Use MutationObserver where native Promise is not available,
  3469. // e.g. PhantomJS, iOS7, Android 4.4
  3470. // (#6466 MutationObserver is unreliable in IE11)
  3471. var counter = 1;
  3472. var observer = new MutationObserver(flushCallbacks);
  3473. var textNode = document.createTextNode(String(counter));
  3474. observer.observe(textNode, {
  3475. characterData: true
  3476. });
  3477. timerFunc = function () {
  3478. counter = (counter + 1) % 2;
  3479. textNode.data = String(counter);
  3480. };
  3481. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  3482. // Fallback to setImmediate.
  3483. // Technically it leverages the (macro) task queue,
  3484. // but it is still a better choice than setTimeout.
  3485. timerFunc = function () {
  3486. setImmediate(flushCallbacks);
  3487. };
  3488. } else {
  3489. // Fallback to setTimeout.
  3490. timerFunc = function () {
  3491. setTimeout(flushCallbacks, 0);
  3492. };
  3493. }
  3494. function nextTick (cb, ctx) {
  3495. var _resolve;
  3496. callbacks.push(function () {
  3497. if (cb) {
  3498. try {
  3499. cb.call(ctx);
  3500. } catch (e) {
  3501. handleError(e, ctx, 'nextTick');
  3502. }
  3503. } else if (_resolve) {
  3504. _resolve(ctx);
  3505. }
  3506. });
  3507. if (!pending) {
  3508. pending = true;
  3509. timerFunc();
  3510. }
  3511. // $flow-disable-line
  3512. if (!cb && typeof Promise !== 'undefined') {
  3513. return new Promise(function (resolve) {
  3514. _resolve = resolve;
  3515. })
  3516. }
  3517. }
  3518. /* */
  3519. /* not type checking this file because flow doesn't play well with Proxy */
  3520. var initProxy;
  3521. if (true) {
  3522. var allowedGlobals = makeMap(
  3523. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  3524. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  3525. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  3526. 'require' // for Webpack/Browserify
  3527. );
  3528. var warnNonPresent = function (target, key) {
  3529. warn(
  3530. "Property or method \"" + key + "\" is not defined on the instance but " +
  3531. 'referenced during render. Make sure that this property is reactive, ' +
  3532. 'either in the data option, or for class-based components, by ' +
  3533. 'initializing the property. ' +
  3534. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  3535. target
  3536. );
  3537. };
  3538. var warnReservedPrefix = function (target, key) {
  3539. warn(
  3540. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  3541. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  3542. 'prevent conflicts with Vue internals. ' +
  3543. 'See: https://vuejs.org/v2/api/#data',
  3544. target
  3545. );
  3546. };
  3547. var hasProxy =
  3548. typeof Proxy !== 'undefined' && isNative(Proxy);
  3549. if (hasProxy) {
  3550. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  3551. config.keyCodes = new Proxy(config.keyCodes, {
  3552. set: function set (target, key, value) {
  3553. if (isBuiltInModifier(key)) {
  3554. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  3555. return false
  3556. } else {
  3557. target[key] = value;
  3558. return true
  3559. }
  3560. }
  3561. });
  3562. }
  3563. var hasHandler = {
  3564. has: function has (target, key) {
  3565. var has = key in target;
  3566. var isAllowed = allowedGlobals(key) ||
  3567. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  3568. if (!has && !isAllowed) {
  3569. if (key in target.$data) { warnReservedPrefix(target, key); }
  3570. else { warnNonPresent(target, key); }
  3571. }
  3572. return has || !isAllowed
  3573. }
  3574. };
  3575. var getHandler = {
  3576. get: function get (target, key) {
  3577. if (typeof key === 'string' && !(key in target)) {
  3578. if (key in target.$data) { warnReservedPrefix(target, key); }
  3579. else { warnNonPresent(target, key); }
  3580. }
  3581. return target[key]
  3582. }
  3583. };
  3584. initProxy = function initProxy (vm) {
  3585. if (hasProxy) {
  3586. // determine which proxy handler to use
  3587. var options = vm.$options;
  3588. var handlers = options.render && options.render._withStripped
  3589. ? getHandler
  3590. : hasHandler;
  3591. vm._renderProxy = new Proxy(vm, handlers);
  3592. } else {
  3593. vm._renderProxy = vm;
  3594. }
  3595. };
  3596. }
  3597. /* */
  3598. var seenObjects = new _Set();
  3599. /**
  3600. * Recursively traverse an object to evoke all converted
  3601. * getters, so that every nested property inside the object
  3602. * is collected as a "deep" dependency.
  3603. */
  3604. function traverse (val) {
  3605. _traverse(val, seenObjects);
  3606. seenObjects.clear();
  3607. }
  3608. function _traverse (val, seen) {
  3609. var i, keys;
  3610. var isA = Array.isArray(val);
  3611. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  3612. return
  3613. }
  3614. if (val.__ob__) {
  3615. var depId = val.__ob__.dep.id;
  3616. if (seen.has(depId)) {
  3617. return
  3618. }
  3619. seen.add(depId);
  3620. }
  3621. if (isA) {
  3622. i = val.length;
  3623. while (i--) { _traverse(val[i], seen); }
  3624. } else {
  3625. keys = Object.keys(val);
  3626. i = keys.length;
  3627. while (i--) { _traverse(val[keys[i]], seen); }
  3628. }
  3629. }
  3630. var mark;
  3631. var measure;
  3632. if (true) {
  3633. var perf = inBrowser && window.performance;
  3634. /* istanbul ignore if */
  3635. if (
  3636. perf &&
  3637. perf.mark &&
  3638. perf.measure &&
  3639. perf.clearMarks &&
  3640. perf.clearMeasures
  3641. ) {
  3642. mark = function (tag) { return perf.mark(tag); };
  3643. measure = function (name, startTag, endTag) {
  3644. perf.measure(name, startTag, endTag);
  3645. perf.clearMarks(startTag);
  3646. perf.clearMarks(endTag);
  3647. // perf.clearMeasures(name)
  3648. };
  3649. }
  3650. }
  3651. /* */
  3652. var normalizeEvent = cached(function (name) {
  3653. var passive = name.charAt(0) === '&';
  3654. name = passive ? name.slice(1) : name;
  3655. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  3656. name = once$$1 ? name.slice(1) : name;
  3657. var capture = name.charAt(0) === '!';
  3658. name = capture ? name.slice(1) : name;
  3659. return {
  3660. name: name,
  3661. once: once$$1,
  3662. capture: capture,
  3663. passive: passive
  3664. }
  3665. });
  3666. function createFnInvoker (fns, vm) {
  3667. function invoker () {
  3668. var arguments$1 = arguments;
  3669. var fns = invoker.fns;
  3670. if (Array.isArray(fns)) {
  3671. var cloned = fns.slice();
  3672. for (var i = 0; i < cloned.length; i++) {
  3673. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  3674. }
  3675. } else {
  3676. // return handler return value for single handlers
  3677. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  3678. }
  3679. }
  3680. invoker.fns = fns;
  3681. return invoker
  3682. }
  3683. function updateListeners (
  3684. on,
  3685. oldOn,
  3686. add,
  3687. remove$$1,
  3688. createOnceHandler,
  3689. vm
  3690. ) {
  3691. var name, def$$1, cur, old, event;
  3692. for (name in on) {
  3693. def$$1 = cur = on[name];
  3694. old = oldOn[name];
  3695. event = normalizeEvent(name);
  3696. if (isUndef(cur)) {
  3697. true && warn(
  3698. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  3699. vm
  3700. );
  3701. } else if (isUndef(old)) {
  3702. if (isUndef(cur.fns)) {
  3703. cur = on[name] = createFnInvoker(cur, vm);
  3704. }
  3705. if (isTrue(event.once)) {
  3706. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  3707. }
  3708. add(event.name, cur, event.capture, event.passive, event.params);
  3709. } else if (cur !== old) {
  3710. old.fns = cur;
  3711. on[name] = old;
  3712. }
  3713. }
  3714. for (name in oldOn) {
  3715. if (isUndef(on[name])) {
  3716. event = normalizeEvent(name);
  3717. remove$$1(event.name, oldOn[name], event.capture);
  3718. }
  3719. }
  3720. }
  3721. /* */
  3722. /* */
  3723. // fixed by xxxxxx (mp properties)
  3724. function extractPropertiesFromVNodeData(data, Ctor, res, context) {
  3725. var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties;
  3726. if (isUndef(propOptions)) {
  3727. return res
  3728. }
  3729. var externalClasses = Ctor.options.mpOptions.externalClasses || [];
  3730. var attrs = data.attrs;
  3731. var props = data.props;
  3732. if (isDef(attrs) || isDef(props)) {
  3733. for (var key in propOptions) {
  3734. var altKey = hyphenate(key);
  3735. var result = checkProp(res, props, key, altKey, true) ||
  3736. checkProp(res, attrs, key, altKey, false);
  3737. // externalClass
  3738. if (
  3739. result &&
  3740. res[key] &&
  3741. externalClasses.indexOf(altKey) !== -1 &&
  3742. context[camelize(res[key])]
  3743. ) {
  3744. // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串)
  3745. res[key] = context[camelize(res[key])];
  3746. }
  3747. }
  3748. }
  3749. return res
  3750. }
  3751. function extractPropsFromVNodeData (
  3752. data,
  3753. Ctor,
  3754. tag,
  3755. context// fixed by xxxxxx
  3756. ) {
  3757. // we are only extracting raw values here.
  3758. // validation and default values are handled in the child
  3759. // component itself.
  3760. var propOptions = Ctor.options.props;
  3761. if (isUndef(propOptions)) {
  3762. // fixed by xxxxxx
  3763. return extractPropertiesFromVNodeData(data, Ctor, {}, context)
  3764. }
  3765. var res = {};
  3766. var attrs = data.attrs;
  3767. var props = data.props;
  3768. if (isDef(attrs) || isDef(props)) {
  3769. for (var key in propOptions) {
  3770. var altKey = hyphenate(key);
  3771. if (true) {
  3772. var keyInLowerCase = key.toLowerCase();
  3773. if (
  3774. key !== keyInLowerCase &&
  3775. attrs && hasOwn(attrs, keyInLowerCase)
  3776. ) {
  3777. tip(
  3778. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  3779. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  3780. " \"" + key + "\". " +
  3781. "Note that HTML attributes are case-insensitive and camelCased " +
  3782. "props need to use their kebab-case equivalents when using in-DOM " +
  3783. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  3784. );
  3785. }
  3786. }
  3787. checkProp(res, props, key, altKey, true) ||
  3788. checkProp(res, attrs, key, altKey, false);
  3789. }
  3790. }
  3791. // fixed by xxxxxx
  3792. return extractPropertiesFromVNodeData(data, Ctor, res, context)
  3793. }
  3794. function checkProp (
  3795. res,
  3796. hash,
  3797. key,
  3798. altKey,
  3799. preserve
  3800. ) {
  3801. if (isDef(hash)) {
  3802. if (hasOwn(hash, key)) {
  3803. res[key] = hash[key];
  3804. if (!preserve) {
  3805. delete hash[key];
  3806. }
  3807. return true
  3808. } else if (hasOwn(hash, altKey)) {
  3809. res[key] = hash[altKey];
  3810. if (!preserve) {
  3811. delete hash[altKey];
  3812. }
  3813. return true
  3814. }
  3815. }
  3816. return false
  3817. }
  3818. /* */
  3819. // The template compiler attempts to minimize the need for normalization by
  3820. // statically analyzing the template at compile time.
  3821. //
  3822. // For plain HTML markup, normalization can be completely skipped because the
  3823. // generated render function is guaranteed to return Array<VNode>. There are
  3824. // two cases where extra normalization is needed:
  3825. // 1. When the children contains components - because a functional component
  3826. // may return an Array instead of a single root. In this case, just a simple
  3827. // normalization is needed - if any child is an Array, we flatten the whole
  3828. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  3829. // because functional components already normalize their own children.
  3830. function simpleNormalizeChildren (children) {
  3831. for (var i = 0; i < children.length; i++) {
  3832. if (Array.isArray(children[i])) {
  3833. return Array.prototype.concat.apply([], children)
  3834. }
  3835. }
  3836. return children
  3837. }
  3838. // 2. When the children contains constructs that always generated nested Arrays,
  3839. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  3840. // with hand-written render functions / JSX. In such cases a full normalization
  3841. // is needed to cater to all possible types of children values.
  3842. function normalizeChildren (children) {
  3843. return isPrimitive(children)
  3844. ? [createTextVNode(children)]
  3845. : Array.isArray(children)
  3846. ? normalizeArrayChildren(children)
  3847. : undefined
  3848. }
  3849. function isTextNode (node) {
  3850. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  3851. }
  3852. function normalizeArrayChildren (children, nestedIndex) {
  3853. var res = [];
  3854. var i, c, lastIndex, last;
  3855. for (i = 0; i < children.length; i++) {
  3856. c = children[i];
  3857. if (isUndef(c) || typeof c === 'boolean') { continue }
  3858. lastIndex = res.length - 1;
  3859. last = res[lastIndex];
  3860. // nested
  3861. if (Array.isArray(c)) {
  3862. if (c.length > 0) {
  3863. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  3864. // merge adjacent text nodes
  3865. if (isTextNode(c[0]) && isTextNode(last)) {
  3866. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  3867. c.shift();
  3868. }
  3869. res.push.apply(res, c);
  3870. }
  3871. } else if (isPrimitive(c)) {
  3872. if (isTextNode(last)) {
  3873. // merge adjacent text nodes
  3874. // this is necessary for SSR hydration because text nodes are
  3875. // essentially merged when rendered to HTML strings
  3876. res[lastIndex] = createTextVNode(last.text + c);
  3877. } else if (c !== '') {
  3878. // convert primitive to vnode
  3879. res.push(createTextVNode(c));
  3880. }
  3881. } else {
  3882. if (isTextNode(c) && isTextNode(last)) {
  3883. // merge adjacent text nodes
  3884. res[lastIndex] = createTextVNode(last.text + c.text);
  3885. } else {
  3886. // default key for nested array children (likely generated by v-for)
  3887. if (isTrue(children._isVList) &&
  3888. isDef(c.tag) &&
  3889. isUndef(c.key) &&
  3890. isDef(nestedIndex)) {
  3891. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  3892. }
  3893. res.push(c);
  3894. }
  3895. }
  3896. }
  3897. return res
  3898. }
  3899. /* */
  3900. function initProvide (vm) {
  3901. var provide = vm.$options.provide;
  3902. if (provide) {
  3903. vm._provided = typeof provide === 'function'
  3904. ? provide.call(vm)
  3905. : provide;
  3906. }
  3907. }
  3908. function initInjections (vm) {
  3909. var result = resolveInject(vm.$options.inject, vm);
  3910. if (result) {
  3911. toggleObserving(false);
  3912. Object.keys(result).forEach(function (key) {
  3913. /* istanbul ignore else */
  3914. if (true) {
  3915. defineReactive$$1(vm, key, result[key], function () {
  3916. warn(
  3917. "Avoid mutating an injected value directly since the changes will be " +
  3918. "overwritten whenever the provided component re-renders. " +
  3919. "injection being mutated: \"" + key + "\"",
  3920. vm
  3921. );
  3922. });
  3923. } else {}
  3924. });
  3925. toggleObserving(true);
  3926. }
  3927. }
  3928. function resolveInject (inject, vm) {
  3929. if (inject) {
  3930. // inject is :any because flow is not smart enough to figure out cached
  3931. var result = Object.create(null);
  3932. var keys = hasSymbol
  3933. ? Reflect.ownKeys(inject)
  3934. : Object.keys(inject);
  3935. for (var i = 0; i < keys.length; i++) {
  3936. var key = keys[i];
  3937. // #6574 in case the inject object is observed...
  3938. if (key === '__ob__') { continue }
  3939. var provideKey = inject[key].from;
  3940. var source = vm;
  3941. while (source) {
  3942. if (source._provided && hasOwn(source._provided, provideKey)) {
  3943. result[key] = source._provided[provideKey];
  3944. break
  3945. }
  3946. source = source.$parent;
  3947. }
  3948. if (!source) {
  3949. if ('default' in inject[key]) {
  3950. var provideDefault = inject[key].default;
  3951. result[key] = typeof provideDefault === 'function'
  3952. ? provideDefault.call(vm)
  3953. : provideDefault;
  3954. } else if (true) {
  3955. warn(("Injection \"" + key + "\" not found"), vm);
  3956. }
  3957. }
  3958. }
  3959. return result
  3960. }
  3961. }
  3962. /* */
  3963. /**
  3964. * Runtime helper for resolving raw children VNodes into a slot object.
  3965. */
  3966. function resolveSlots (
  3967. children,
  3968. context
  3969. ) {
  3970. if (!children || !children.length) {
  3971. return {}
  3972. }
  3973. var slots = {};
  3974. for (var i = 0, l = children.length; i < l; i++) {
  3975. var child = children[i];
  3976. var data = child.data;
  3977. // remove slot attribute if the node is resolved as a Vue slot node
  3978. if (data && data.attrs && data.attrs.slot) {
  3979. delete data.attrs.slot;
  3980. }
  3981. // named slots should only be respected if the vnode was rendered in the
  3982. // same context.
  3983. if ((child.context === context || child.fnContext === context) &&
  3984. data && data.slot != null
  3985. ) {
  3986. var name = data.slot;
  3987. var slot = (slots[name] || (slots[name] = []));
  3988. if (child.tag === 'template') {
  3989. slot.push.apply(slot, child.children || []);
  3990. } else {
  3991. slot.push(child);
  3992. }
  3993. } else {
  3994. // fixed by xxxxxx 临时 hack 掉 uni-app 中的异步 name slot page
  3995. if(child.asyncMeta && child.asyncMeta.data && child.asyncMeta.data.slot === 'page'){
  3996. (slots['page'] || (slots['page'] = [])).push(child);
  3997. }else{
  3998. (slots.default || (slots.default = [])).push(child);
  3999. }
  4000. }
  4001. }
  4002. // ignore slots that contains only whitespace
  4003. for (var name$1 in slots) {
  4004. if (slots[name$1].every(isWhitespace)) {
  4005. delete slots[name$1];
  4006. }
  4007. }
  4008. return slots
  4009. }
  4010. function isWhitespace (node) {
  4011. return (node.isComment && !node.asyncFactory) || node.text === ' '
  4012. }
  4013. /* */
  4014. function normalizeScopedSlots (
  4015. slots,
  4016. normalSlots,
  4017. prevSlots
  4018. ) {
  4019. var res;
  4020. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  4021. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  4022. var key = slots && slots.$key;
  4023. if (!slots) {
  4024. res = {};
  4025. } else if (slots._normalized) {
  4026. // fast path 1: child component re-render only, parent did not change
  4027. return slots._normalized
  4028. } else if (
  4029. isStable &&
  4030. prevSlots &&
  4031. prevSlots !== emptyObject &&
  4032. key === prevSlots.$key &&
  4033. !hasNormalSlots &&
  4034. !prevSlots.$hasNormal
  4035. ) {
  4036. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  4037. // only need to normalize once
  4038. return prevSlots
  4039. } else {
  4040. res = {};
  4041. for (var key$1 in slots) {
  4042. if (slots[key$1] && key$1[0] !== '$') {
  4043. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  4044. }
  4045. }
  4046. }
  4047. // expose normal slots on scopedSlots
  4048. for (var key$2 in normalSlots) {
  4049. if (!(key$2 in res)) {
  4050. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  4051. }
  4052. }
  4053. // avoriaz seems to mock a non-extensible $scopedSlots object
  4054. // and when that is passed down this would cause an error
  4055. if (slots && Object.isExtensible(slots)) {
  4056. (slots)._normalized = res;
  4057. }
  4058. def(res, '$stable', isStable);
  4059. def(res, '$key', key);
  4060. def(res, '$hasNormal', hasNormalSlots);
  4061. return res
  4062. }
  4063. function normalizeScopedSlot(normalSlots, key, fn) {
  4064. var normalized = function () {
  4065. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  4066. res = res && typeof res === 'object' && !Array.isArray(res)
  4067. ? [res] // single vnode
  4068. : normalizeChildren(res);
  4069. return res && (
  4070. res.length === 0 ||
  4071. (res.length === 1 && res[0].isComment) // #9658
  4072. ) ? undefined
  4073. : res
  4074. };
  4075. // this is a slot using the new v-slot syntax without scope. although it is
  4076. // compiled as a scoped slot, render fn users would expect it to be present
  4077. // on this.$slots because the usage is semantically a normal slot.
  4078. if (fn.proxy) {
  4079. Object.defineProperty(normalSlots, key, {
  4080. get: normalized,
  4081. enumerable: true,
  4082. configurable: true
  4083. });
  4084. }
  4085. return normalized
  4086. }
  4087. function proxyNormalSlot(slots, key) {
  4088. return function () { return slots[key]; }
  4089. }
  4090. /* */
  4091. /**
  4092. * Runtime helper for rendering v-for lists.
  4093. */
  4094. function renderList (
  4095. val,
  4096. render
  4097. ) {
  4098. var ret, i, l, keys, key;
  4099. if (Array.isArray(val) || typeof val === 'string') {
  4100. ret = new Array(val.length);
  4101. for (i = 0, l = val.length; i < l; i++) {
  4102. ret[i] = render(val[i], i, i, i); // fixed by xxxxxx
  4103. }
  4104. } else if (typeof val === 'number') {
  4105. ret = new Array(val);
  4106. for (i = 0; i < val; i++) {
  4107. ret[i] = render(i + 1, i, i, i); // fixed by xxxxxx
  4108. }
  4109. } else if (isObject(val)) {
  4110. if (hasSymbol && val[Symbol.iterator]) {
  4111. ret = [];
  4112. var iterator = val[Symbol.iterator]();
  4113. var result = iterator.next();
  4114. while (!result.done) {
  4115. ret.push(render(result.value, ret.length, i, i++)); // fixed by xxxxxx
  4116. result = iterator.next();
  4117. }
  4118. } else {
  4119. keys = Object.keys(val);
  4120. ret = new Array(keys.length);
  4121. for (i = 0, l = keys.length; i < l; i++) {
  4122. key = keys[i];
  4123. ret[i] = render(val[key], key, i, i); // fixed by xxxxxx
  4124. }
  4125. }
  4126. }
  4127. if (!isDef(ret)) {
  4128. ret = [];
  4129. }
  4130. (ret)._isVList = true;
  4131. return ret
  4132. }
  4133. /* */
  4134. /**
  4135. * Runtime helper for rendering <slot>
  4136. */
  4137. function renderSlot (
  4138. name,
  4139. fallback,
  4140. props,
  4141. bindObject
  4142. ) {
  4143. var scopedSlotFn = this.$scopedSlots[name];
  4144. var nodes;
  4145. if (scopedSlotFn) { // scoped slot
  4146. props = props || {};
  4147. if (bindObject) {
  4148. if ( true && !isObject(bindObject)) {
  4149. warn(
  4150. 'slot v-bind without argument expects an Object',
  4151. this
  4152. );
  4153. }
  4154. props = extend(extend({}, bindObject), props);
  4155. }
  4156. // fixed by xxxxxx app-plus scopedSlot
  4157. nodes = scopedSlotFn(props, this, props._i) || fallback;
  4158. } else {
  4159. nodes = this.$slots[name] || fallback;
  4160. }
  4161. var target = props && props.slot;
  4162. if (target) {
  4163. return this.$createElement('template', { slot: target }, nodes)
  4164. } else {
  4165. return nodes
  4166. }
  4167. }
  4168. /* */
  4169. /**
  4170. * Runtime helper for resolving filters
  4171. */
  4172. function resolveFilter (id) {
  4173. return resolveAsset(this.$options, 'filters', id, true) || identity
  4174. }
  4175. /* */
  4176. function isKeyNotMatch (expect, actual) {
  4177. if (Array.isArray(expect)) {
  4178. return expect.indexOf(actual) === -1
  4179. } else {
  4180. return expect !== actual
  4181. }
  4182. }
  4183. /**
  4184. * Runtime helper for checking keyCodes from config.
  4185. * exposed as Vue.prototype._k
  4186. * passing in eventKeyName as last argument separately for backwards compat
  4187. */
  4188. function checkKeyCodes (
  4189. eventKeyCode,
  4190. key,
  4191. builtInKeyCode,
  4192. eventKeyName,
  4193. builtInKeyName
  4194. ) {
  4195. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  4196. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  4197. return isKeyNotMatch(builtInKeyName, eventKeyName)
  4198. } else if (mappedKeyCode) {
  4199. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  4200. } else if (eventKeyName) {
  4201. return hyphenate(eventKeyName) !== key
  4202. }
  4203. }
  4204. /* */
  4205. /**
  4206. * Runtime helper for merging v-bind="object" into a VNode's data.
  4207. */
  4208. function bindObjectProps (
  4209. data,
  4210. tag,
  4211. value,
  4212. asProp,
  4213. isSync
  4214. ) {
  4215. if (value) {
  4216. if (!isObject(value)) {
  4217. true && warn(
  4218. 'v-bind without argument expects an Object or Array value',
  4219. this
  4220. );
  4221. } else {
  4222. if (Array.isArray(value)) {
  4223. value = toObject(value);
  4224. }
  4225. var hash;
  4226. var loop = function ( key ) {
  4227. if (
  4228. key === 'class' ||
  4229. key === 'style' ||
  4230. isReservedAttribute(key)
  4231. ) {
  4232. hash = data;
  4233. } else {
  4234. var type = data.attrs && data.attrs.type;
  4235. hash = asProp || config.mustUseProp(tag, type, key)
  4236. ? data.domProps || (data.domProps = {})
  4237. : data.attrs || (data.attrs = {});
  4238. }
  4239. var camelizedKey = camelize(key);
  4240. var hyphenatedKey = hyphenate(key);
  4241. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  4242. hash[key] = value[key];
  4243. if (isSync) {
  4244. var on = data.on || (data.on = {});
  4245. on[("update:" + key)] = function ($event) {
  4246. value[key] = $event;
  4247. };
  4248. }
  4249. }
  4250. };
  4251. for (var key in value) loop( key );
  4252. }
  4253. }
  4254. return data
  4255. }
  4256. /* */
  4257. /**
  4258. * Runtime helper for rendering static trees.
  4259. */
  4260. function renderStatic (
  4261. index,
  4262. isInFor
  4263. ) {
  4264. var cached = this._staticTrees || (this._staticTrees = []);
  4265. var tree = cached[index];
  4266. // if has already-rendered static tree and not inside v-for,
  4267. // we can reuse the same tree.
  4268. if (tree && !isInFor) {
  4269. return tree
  4270. }
  4271. // otherwise, render a fresh tree.
  4272. tree = cached[index] = this.$options.staticRenderFns[index].call(
  4273. this._renderProxy,
  4274. null,
  4275. this // for render fns generated for functional component templates
  4276. );
  4277. markStatic(tree, ("__static__" + index), false);
  4278. return tree
  4279. }
  4280. /**
  4281. * Runtime helper for v-once.
  4282. * Effectively it means marking the node as static with a unique key.
  4283. */
  4284. function markOnce (
  4285. tree,
  4286. index,
  4287. key
  4288. ) {
  4289. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  4290. return tree
  4291. }
  4292. function markStatic (
  4293. tree,
  4294. key,
  4295. isOnce
  4296. ) {
  4297. if (Array.isArray(tree)) {
  4298. for (var i = 0; i < tree.length; i++) {
  4299. if (tree[i] && typeof tree[i] !== 'string') {
  4300. markStaticNode(tree[i], (key + "_" + i), isOnce);
  4301. }
  4302. }
  4303. } else {
  4304. markStaticNode(tree, key, isOnce);
  4305. }
  4306. }
  4307. function markStaticNode (node, key, isOnce) {
  4308. node.isStatic = true;
  4309. node.key = key;
  4310. node.isOnce = isOnce;
  4311. }
  4312. /* */
  4313. function bindObjectListeners (data, value) {
  4314. if (value) {
  4315. if (!isPlainObject(value)) {
  4316. true && warn(
  4317. 'v-on without argument expects an Object value',
  4318. this
  4319. );
  4320. } else {
  4321. var on = data.on = data.on ? extend({}, data.on) : {};
  4322. for (var key in value) {
  4323. var existing = on[key];
  4324. var ours = value[key];
  4325. on[key] = existing ? [].concat(existing, ours) : ours;
  4326. }
  4327. }
  4328. }
  4329. return data
  4330. }
  4331. /* */
  4332. function resolveScopedSlots (
  4333. fns, // see flow/vnode
  4334. res,
  4335. // the following are added in 2.6
  4336. hasDynamicKeys,
  4337. contentHashKey
  4338. ) {
  4339. res = res || { $stable: !hasDynamicKeys };
  4340. for (var i = 0; i < fns.length; i++) {
  4341. var slot = fns[i];
  4342. if (Array.isArray(slot)) {
  4343. resolveScopedSlots(slot, res, hasDynamicKeys);
  4344. } else if (slot) {
  4345. // marker for reverse proxying v-slot without scope on this.$slots
  4346. if (slot.proxy) {
  4347. slot.fn.proxy = true;
  4348. }
  4349. res[slot.key] = slot.fn;
  4350. }
  4351. }
  4352. if (contentHashKey) {
  4353. (res).$key = contentHashKey;
  4354. }
  4355. return res
  4356. }
  4357. /* */
  4358. function bindDynamicKeys (baseObj, values) {
  4359. for (var i = 0; i < values.length; i += 2) {
  4360. var key = values[i];
  4361. if (typeof key === 'string' && key) {
  4362. baseObj[values[i]] = values[i + 1];
  4363. } else if ( true && key !== '' && key !== null) {
  4364. // null is a special value for explicitly removing a binding
  4365. warn(
  4366. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  4367. this
  4368. );
  4369. }
  4370. }
  4371. return baseObj
  4372. }
  4373. // helper to dynamically append modifier runtime markers to event names.
  4374. // ensure only append when value is already string, otherwise it will be cast
  4375. // to string and cause the type check to miss.
  4376. function prependModifier (value, symbol) {
  4377. return typeof value === 'string' ? symbol + value : value
  4378. }
  4379. /* */
  4380. function installRenderHelpers (target) {
  4381. target._o = markOnce;
  4382. target._n = toNumber;
  4383. target._s = toString;
  4384. target._l = renderList;
  4385. target._t = renderSlot;
  4386. target._q = looseEqual;
  4387. target._i = looseIndexOf;
  4388. target._m = renderStatic;
  4389. target._f = resolveFilter;
  4390. target._k = checkKeyCodes;
  4391. target._b = bindObjectProps;
  4392. target._v = createTextVNode;
  4393. target._e = createEmptyVNode;
  4394. target._u = resolveScopedSlots;
  4395. target._g = bindObjectListeners;
  4396. target._d = bindDynamicKeys;
  4397. target._p = prependModifier;
  4398. }
  4399. /* */
  4400. function FunctionalRenderContext (
  4401. data,
  4402. props,
  4403. children,
  4404. parent,
  4405. Ctor
  4406. ) {
  4407. var this$1 = this;
  4408. var options = Ctor.options;
  4409. // ensure the createElement function in functional components
  4410. // gets a unique context - this is necessary for correct named slot check
  4411. var contextVm;
  4412. if (hasOwn(parent, '_uid')) {
  4413. contextVm = Object.create(parent);
  4414. // $flow-disable-line
  4415. contextVm._original = parent;
  4416. } else {
  4417. // the context vm passed in is a functional context as well.
  4418. // in this case we want to make sure we are able to get a hold to the
  4419. // real context instance.
  4420. contextVm = parent;
  4421. // $flow-disable-line
  4422. parent = parent._original;
  4423. }
  4424. var isCompiled = isTrue(options._compiled);
  4425. var needNormalization = !isCompiled;
  4426. this.data = data;
  4427. this.props = props;
  4428. this.children = children;
  4429. this.parent = parent;
  4430. this.listeners = data.on || emptyObject;
  4431. this.injections = resolveInject(options.inject, parent);
  4432. this.slots = function () {
  4433. if (!this$1.$slots) {
  4434. normalizeScopedSlots(
  4435. data.scopedSlots,
  4436. this$1.$slots = resolveSlots(children, parent)
  4437. );
  4438. }
  4439. return this$1.$slots
  4440. };
  4441. Object.defineProperty(this, 'scopedSlots', ({
  4442. enumerable: true,
  4443. get: function get () {
  4444. return normalizeScopedSlots(data.scopedSlots, this.slots())
  4445. }
  4446. }));
  4447. // support for compiled functional template
  4448. if (isCompiled) {
  4449. // exposing $options for renderStatic()
  4450. this.$options = options;
  4451. // pre-resolve slots for renderSlot()
  4452. this.$slots = this.slots();
  4453. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  4454. }
  4455. if (options._scopeId) {
  4456. this._c = function (a, b, c, d) {
  4457. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  4458. if (vnode && !Array.isArray(vnode)) {
  4459. vnode.fnScopeId = options._scopeId;
  4460. vnode.fnContext = parent;
  4461. }
  4462. return vnode
  4463. };
  4464. } else {
  4465. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  4466. }
  4467. }
  4468. installRenderHelpers(FunctionalRenderContext.prototype);
  4469. function createFunctionalComponent (
  4470. Ctor,
  4471. propsData,
  4472. data,
  4473. contextVm,
  4474. children
  4475. ) {
  4476. var options = Ctor.options;
  4477. var props = {};
  4478. var propOptions = options.props;
  4479. if (isDef(propOptions)) {
  4480. for (var key in propOptions) {
  4481. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  4482. }
  4483. } else {
  4484. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  4485. if (isDef(data.props)) { mergeProps(props, data.props); }
  4486. }
  4487. var renderContext = new FunctionalRenderContext(
  4488. data,
  4489. props,
  4490. children,
  4491. contextVm,
  4492. Ctor
  4493. );
  4494. var vnode = options.render.call(null, renderContext._c, renderContext);
  4495. if (vnode instanceof VNode) {
  4496. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  4497. } else if (Array.isArray(vnode)) {
  4498. var vnodes = normalizeChildren(vnode) || [];
  4499. var res = new Array(vnodes.length);
  4500. for (var i = 0; i < vnodes.length; i++) {
  4501. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  4502. }
  4503. return res
  4504. }
  4505. }
  4506. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  4507. // #7817 clone node before setting fnContext, otherwise if the node is reused
  4508. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  4509. // that should not be matched to match.
  4510. var clone = cloneVNode(vnode);
  4511. clone.fnContext = contextVm;
  4512. clone.fnOptions = options;
  4513. if (true) {
  4514. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  4515. }
  4516. if (data.slot) {
  4517. (clone.data || (clone.data = {})).slot = data.slot;
  4518. }
  4519. return clone
  4520. }
  4521. function mergeProps (to, from) {
  4522. for (var key in from) {
  4523. to[camelize(key)] = from[key];
  4524. }
  4525. }
  4526. /* */
  4527. /* */
  4528. /* */
  4529. /* */
  4530. // inline hooks to be invoked on component VNodes during patch
  4531. var componentVNodeHooks = {
  4532. init: function init (vnode, hydrating) {
  4533. if (
  4534. vnode.componentInstance &&
  4535. !vnode.componentInstance._isDestroyed &&
  4536. vnode.data.keepAlive
  4537. ) {
  4538. // kept-alive components, treat as a patch
  4539. var mountedNode = vnode; // work around flow
  4540. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  4541. } else {
  4542. var child = vnode.componentInstance = createComponentInstanceForVnode(
  4543. vnode,
  4544. activeInstance
  4545. );
  4546. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  4547. }
  4548. },
  4549. prepatch: function prepatch (oldVnode, vnode) {
  4550. var options = vnode.componentOptions;
  4551. var child = vnode.componentInstance = oldVnode.componentInstance;
  4552. updateChildComponent(
  4553. child,
  4554. options.propsData, // updated props
  4555. options.listeners, // updated listeners
  4556. vnode, // new parent vnode
  4557. options.children // new children
  4558. );
  4559. },
  4560. insert: function insert (vnode) {
  4561. var context = vnode.context;
  4562. var componentInstance = vnode.componentInstance;
  4563. if (!componentInstance._isMounted) {
  4564. callHook(componentInstance, 'onServiceCreated');
  4565. callHook(componentInstance, 'onServiceAttached');
  4566. componentInstance._isMounted = true;
  4567. callHook(componentInstance, 'mounted');
  4568. }
  4569. if (vnode.data.keepAlive) {
  4570. if (context._isMounted) {
  4571. // vue-router#1212
  4572. // During updates, a kept-alive component's child components may
  4573. // change, so directly walking the tree here may call activated hooks
  4574. // on incorrect children. Instead we push them into a queue which will
  4575. // be processed after the whole patch process ended.
  4576. queueActivatedComponent(componentInstance);
  4577. } else {
  4578. activateChildComponent(componentInstance, true /* direct */);
  4579. }
  4580. }
  4581. },
  4582. destroy: function destroy (vnode) {
  4583. var componentInstance = vnode.componentInstance;
  4584. if (!componentInstance._isDestroyed) {
  4585. if (!vnode.data.keepAlive) {
  4586. componentInstance.$destroy();
  4587. } else {
  4588. deactivateChildComponent(componentInstance, true /* direct */);
  4589. }
  4590. }
  4591. }
  4592. };
  4593. var hooksToMerge = Object.keys(componentVNodeHooks);
  4594. function createComponent (
  4595. Ctor,
  4596. data,
  4597. context,
  4598. children,
  4599. tag
  4600. ) {
  4601. if (isUndef(Ctor)) {
  4602. return
  4603. }
  4604. var baseCtor = context.$options._base;
  4605. // plain options object: turn it into a constructor
  4606. if (isObject(Ctor)) {
  4607. Ctor = baseCtor.extend(Ctor);
  4608. }
  4609. // if at this stage it's not a constructor or an async component factory,
  4610. // reject.
  4611. if (typeof Ctor !== 'function') {
  4612. if (true) {
  4613. warn(("Invalid Component definition: " + (String(Ctor))), context);
  4614. }
  4615. return
  4616. }
  4617. // async component
  4618. var asyncFactory;
  4619. if (isUndef(Ctor.cid)) {
  4620. asyncFactory = Ctor;
  4621. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  4622. if (Ctor === undefined) {
  4623. // return a placeholder node for async component, which is rendered
  4624. // as a comment node but preserves all the raw information for the node.
  4625. // the information will be used for async server-rendering and hydration.
  4626. return createAsyncPlaceholder(
  4627. asyncFactory,
  4628. data,
  4629. context,
  4630. children,
  4631. tag
  4632. )
  4633. }
  4634. }
  4635. data = data || {};
  4636. // resolve constructor options in case global mixins are applied after
  4637. // component constructor creation
  4638. resolveConstructorOptions(Ctor);
  4639. // transform component v-model data into props & events
  4640. if (isDef(data.model)) {
  4641. transformModel(Ctor.options, data);
  4642. }
  4643. // extract props
  4644. var propsData = extractPropsFromVNodeData(data, Ctor, tag, context); // fixed by xxxxxx
  4645. // functional component
  4646. if (isTrue(Ctor.options.functional)) {
  4647. return createFunctionalComponent(Ctor, propsData, data, context, children)
  4648. }
  4649. // extract listeners, since these needs to be treated as
  4650. // child component listeners instead of DOM listeners
  4651. var listeners = data.on;
  4652. // replace with listeners with .native modifier
  4653. // so it gets processed during parent component patch.
  4654. data.on = data.nativeOn;
  4655. if (isTrue(Ctor.options.abstract)) {
  4656. // abstract components do not keep anything
  4657. // other than props & listeners & slot
  4658. // work around flow
  4659. var slot = data.slot;
  4660. data = {};
  4661. if (slot) {
  4662. data.slot = slot;
  4663. }
  4664. }
  4665. // install component management hooks onto the placeholder node
  4666. installComponentHooks(data);
  4667. // return a placeholder vnode
  4668. var name = Ctor.options.name || tag;
  4669. var vnode = new VNode(
  4670. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  4671. data, undefined, undefined, undefined, context,
  4672. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  4673. asyncFactory
  4674. );
  4675. return vnode
  4676. }
  4677. function createComponentInstanceForVnode (
  4678. vnode, // we know it's MountedComponentVNode but flow doesn't
  4679. parent // activeInstance in lifecycle state
  4680. ) {
  4681. var options = {
  4682. _isComponent: true,
  4683. _parentVnode: vnode,
  4684. parent: parent
  4685. };
  4686. // check inline-template render functions
  4687. var inlineTemplate = vnode.data.inlineTemplate;
  4688. if (isDef(inlineTemplate)) {
  4689. options.render = inlineTemplate.render;
  4690. options.staticRenderFns = inlineTemplate.staticRenderFns;
  4691. }
  4692. return new vnode.componentOptions.Ctor(options)
  4693. }
  4694. function installComponentHooks (data) {
  4695. var hooks = data.hook || (data.hook = {});
  4696. for (var i = 0; i < hooksToMerge.length; i++) {
  4697. var key = hooksToMerge[i];
  4698. var existing = hooks[key];
  4699. var toMerge = componentVNodeHooks[key];
  4700. if (existing !== toMerge && !(existing && existing._merged)) {
  4701. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  4702. }
  4703. }
  4704. }
  4705. function mergeHook$1 (f1, f2) {
  4706. var merged = function (a, b) {
  4707. // flow complains about extra args which is why we use any
  4708. f1(a, b);
  4709. f2(a, b);
  4710. };
  4711. merged._merged = true;
  4712. return merged
  4713. }
  4714. // transform component v-model info (value and callback) into
  4715. // prop and event handler respectively.
  4716. function transformModel (options, data) {
  4717. var prop = (options.model && options.model.prop) || 'value';
  4718. var event = (options.model && options.model.event) || 'input'
  4719. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  4720. var on = data.on || (data.on = {});
  4721. var existing = on[event];
  4722. var callback = data.model.callback;
  4723. if (isDef(existing)) {
  4724. if (
  4725. Array.isArray(existing)
  4726. ? existing.indexOf(callback) === -1
  4727. : existing !== callback
  4728. ) {
  4729. on[event] = [callback].concat(existing);
  4730. }
  4731. } else {
  4732. on[event] = callback;
  4733. }
  4734. }
  4735. /* */
  4736. var SIMPLE_NORMALIZE = 1;
  4737. var ALWAYS_NORMALIZE = 2;
  4738. // wrapper function for providing a more flexible interface
  4739. // without getting yelled at by flow
  4740. function createElement (
  4741. context,
  4742. tag,
  4743. data,
  4744. children,
  4745. normalizationType,
  4746. alwaysNormalize
  4747. ) {
  4748. if (Array.isArray(data) || isPrimitive(data)) {
  4749. normalizationType = children;
  4750. children = data;
  4751. data = undefined;
  4752. }
  4753. if (isTrue(alwaysNormalize)) {
  4754. normalizationType = ALWAYS_NORMALIZE;
  4755. }
  4756. return _createElement(context, tag, data, children, normalizationType)
  4757. }
  4758. function _createElement (
  4759. context,
  4760. tag,
  4761. data,
  4762. children,
  4763. normalizationType
  4764. ) {
  4765. if (isDef(data) && isDef((data).__ob__)) {
  4766. true && warn(
  4767. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  4768. 'Always create fresh vnode data objects in each render!',
  4769. context
  4770. );
  4771. return createEmptyVNode()
  4772. }
  4773. // object syntax in v-bind
  4774. if (isDef(data) && isDef(data.is)) {
  4775. tag = data.is;
  4776. }
  4777. if (!tag) {
  4778. // in case of component :is set to falsy value
  4779. return createEmptyVNode()
  4780. }
  4781. // warn against non-primitive key
  4782. if ( true &&
  4783. isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  4784. ) {
  4785. {
  4786. warn(
  4787. 'Avoid using non-primitive value as key, ' +
  4788. 'use string/number value instead.',
  4789. context
  4790. );
  4791. }
  4792. }
  4793. // support single function children as default scoped slot
  4794. if (Array.isArray(children) &&
  4795. typeof children[0] === 'function'
  4796. ) {
  4797. data = data || {};
  4798. data.scopedSlots = { default: children[0] };
  4799. children.length = 0;
  4800. }
  4801. if (normalizationType === ALWAYS_NORMALIZE) {
  4802. children = normalizeChildren(children);
  4803. } else if (normalizationType === SIMPLE_NORMALIZE) {
  4804. children = simpleNormalizeChildren(children);
  4805. }
  4806. var vnode, ns;
  4807. if (typeof tag === 'string') {
  4808. var Ctor;
  4809. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  4810. if (config.isReservedTag(tag)) {
  4811. // platform built-in elements
  4812. if ( true && isDef(data) && isDef(data.nativeOn)) {
  4813. warn(
  4814. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  4815. context
  4816. );
  4817. }
  4818. vnode = new VNode(
  4819. config.parsePlatformTagName(tag), data, children,
  4820. undefined, undefined, context
  4821. );
  4822. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  4823. // component
  4824. vnode = createComponent(Ctor, data, context, children, tag);
  4825. } else {
  4826. // unknown or unlisted namespaced elements
  4827. // check at runtime because it may get assigned a namespace when its
  4828. // parent normalizes children
  4829. vnode = new VNode(
  4830. tag, data, children,
  4831. undefined, undefined, context
  4832. );
  4833. }
  4834. } else {
  4835. // direct component options / constructor
  4836. vnode = createComponent(tag, data, context, children);
  4837. }
  4838. if (Array.isArray(vnode)) {
  4839. return vnode
  4840. } else if (isDef(vnode)) {
  4841. if (isDef(ns)) { applyNS(vnode, ns); }
  4842. if (isDef(data)) { registerDeepBindings(data); }
  4843. return vnode
  4844. } else {
  4845. return createEmptyVNode()
  4846. }
  4847. }
  4848. function applyNS (vnode, ns, force) {
  4849. vnode.ns = ns;
  4850. if (vnode.tag === 'foreignObject') {
  4851. // use default namespace inside foreignObject
  4852. ns = undefined;
  4853. force = true;
  4854. }
  4855. if (isDef(vnode.children)) {
  4856. for (var i = 0, l = vnode.children.length; i < l; i++) {
  4857. var child = vnode.children[i];
  4858. if (isDef(child.tag) && (
  4859. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  4860. applyNS(child, ns, force);
  4861. }
  4862. }
  4863. }
  4864. }
  4865. // ref #5318
  4866. // necessary to ensure parent re-render when deep bindings like :style and
  4867. // :class are used on slot nodes
  4868. function registerDeepBindings (data) {
  4869. if (isObject(data.style)) {
  4870. traverse(data.style);
  4871. }
  4872. if (isObject(data.class)) {
  4873. traverse(data.class);
  4874. }
  4875. }
  4876. /* */
  4877. function initRender (vm) {
  4878. vm._vnode = null; // the root of the child tree
  4879. vm._staticTrees = null; // v-once cached trees
  4880. var options = vm.$options;
  4881. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  4882. var renderContext = parentVnode && parentVnode.context;
  4883. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  4884. vm.$scopedSlots = emptyObject;
  4885. // bind the createElement fn to this instance
  4886. // so that we get proper render context inside it.
  4887. // args order: tag, data, children, normalizationType, alwaysNormalize
  4888. // internal version is used by render functions compiled from templates
  4889. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  4890. // normalization is always applied for the public version, used in
  4891. // user-written render functions.
  4892. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  4893. // $attrs & $listeners are exposed for easier HOC creation.
  4894. // they need to be reactive so that HOCs using them are always updated
  4895. var parentData = parentVnode && parentVnode.data;
  4896. /* istanbul ignore else */
  4897. if (true) {
  4898. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  4899. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  4900. }, true);
  4901. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  4902. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  4903. }, true);
  4904. } else {}
  4905. }
  4906. var currentRenderingInstance = null;
  4907. function renderMixin (Vue) {
  4908. // install runtime convenience helpers
  4909. installRenderHelpers(Vue.prototype);
  4910. Vue.prototype.$nextTick = function (fn) {
  4911. return nextTick(fn, this)
  4912. };
  4913. Vue.prototype._render = function () {
  4914. var vm = this;
  4915. var ref = vm.$options;
  4916. var render = ref.render;
  4917. var _parentVnode = ref._parentVnode;
  4918. if (_parentVnode) {
  4919. vm.$scopedSlots = normalizeScopedSlots(
  4920. _parentVnode.data.scopedSlots,
  4921. vm.$slots,
  4922. vm.$scopedSlots
  4923. );
  4924. }
  4925. // set parent vnode. this allows render functions to have access
  4926. // to the data on the placeholder node.
  4927. vm.$vnode = _parentVnode;
  4928. // render self
  4929. var vnode;
  4930. try {
  4931. // There's no need to maintain a stack because all render fns are called
  4932. // separately from one another. Nested component's render fns are called
  4933. // when parent component is patched.
  4934. currentRenderingInstance = vm;
  4935. vnode = render.call(vm._renderProxy, vm.$createElement);
  4936. } catch (e) {
  4937. handleError(e, vm, "render");
  4938. // return error render result,
  4939. // or previous vnode to prevent render error causing blank component
  4940. /* istanbul ignore else */
  4941. if ( true && vm.$options.renderError) {
  4942. try {
  4943. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  4944. } catch (e) {
  4945. handleError(e, vm, "renderError");
  4946. vnode = vm._vnode;
  4947. }
  4948. } else {
  4949. vnode = vm._vnode;
  4950. }
  4951. } finally {
  4952. currentRenderingInstance = null;
  4953. }
  4954. // if the returned array contains only a single node, allow it
  4955. if (Array.isArray(vnode) && vnode.length === 1) {
  4956. vnode = vnode[0];
  4957. }
  4958. // return empty vnode in case the render function errored out
  4959. if (!(vnode instanceof VNode)) {
  4960. if ( true && Array.isArray(vnode)) {
  4961. warn(
  4962. 'Multiple root nodes returned from render function. Render function ' +
  4963. 'should return a single root node.',
  4964. vm
  4965. );
  4966. }
  4967. vnode = createEmptyVNode();
  4968. }
  4969. // set parent
  4970. vnode.parent = _parentVnode;
  4971. return vnode
  4972. };
  4973. }
  4974. /* */
  4975. function ensureCtor (comp, base) {
  4976. if (
  4977. comp.__esModule ||
  4978. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  4979. ) {
  4980. comp = comp.default;
  4981. }
  4982. return isObject(comp)
  4983. ? base.extend(comp)
  4984. : comp
  4985. }
  4986. function createAsyncPlaceholder (
  4987. factory,
  4988. data,
  4989. context,
  4990. children,
  4991. tag
  4992. ) {
  4993. var node = createEmptyVNode();
  4994. node.asyncFactory = factory;
  4995. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  4996. return node
  4997. }
  4998. function resolveAsyncComponent (
  4999. factory,
  5000. baseCtor
  5001. ) {
  5002. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  5003. return factory.errorComp
  5004. }
  5005. if (isDef(factory.resolved)) {
  5006. return factory.resolved
  5007. }
  5008. var owner = currentRenderingInstance;
  5009. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  5010. // already pending
  5011. factory.owners.push(owner);
  5012. }
  5013. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  5014. return factory.loadingComp
  5015. }
  5016. if (owner && !isDef(factory.owners)) {
  5017. var owners = factory.owners = [owner];
  5018. var sync = true;
  5019. var timerLoading = null;
  5020. var timerTimeout = null
  5021. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  5022. var forceRender = function (renderCompleted) {
  5023. for (var i = 0, l = owners.length; i < l; i++) {
  5024. (owners[i]).$forceUpdate();
  5025. }
  5026. if (renderCompleted) {
  5027. owners.length = 0;
  5028. if (timerLoading !== null) {
  5029. clearTimeout(timerLoading);
  5030. timerLoading = null;
  5031. }
  5032. if (timerTimeout !== null) {
  5033. clearTimeout(timerTimeout);
  5034. timerTimeout = null;
  5035. }
  5036. }
  5037. };
  5038. var resolve = once(function (res) {
  5039. // cache resolved
  5040. factory.resolved = ensureCtor(res, baseCtor);
  5041. // invoke callbacks only if this is not a synchronous resolve
  5042. // (async resolves are shimmed as synchronous during SSR)
  5043. if (!sync) {
  5044. forceRender(true);
  5045. } else {
  5046. owners.length = 0;
  5047. }
  5048. });
  5049. var reject = once(function (reason) {
  5050. true && warn(
  5051. "Failed to resolve async component: " + (String(factory)) +
  5052. (reason ? ("\nReason: " + reason) : '')
  5053. );
  5054. if (isDef(factory.errorComp)) {
  5055. factory.error = true;
  5056. forceRender(true);
  5057. }
  5058. });
  5059. var res = factory(resolve, reject);
  5060. if (isObject(res)) {
  5061. if (isPromise(res)) {
  5062. // () => Promise
  5063. if (isUndef(factory.resolved)) {
  5064. res.then(resolve, reject);
  5065. }
  5066. } else if (isPromise(res.component)) {
  5067. res.component.then(resolve, reject);
  5068. if (isDef(res.error)) {
  5069. factory.errorComp = ensureCtor(res.error, baseCtor);
  5070. }
  5071. if (isDef(res.loading)) {
  5072. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  5073. if (res.delay === 0) {
  5074. factory.loading = true;
  5075. } else {
  5076. timerLoading = setTimeout(function () {
  5077. timerLoading = null;
  5078. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  5079. factory.loading = true;
  5080. forceRender(false);
  5081. }
  5082. }, res.delay || 200);
  5083. }
  5084. }
  5085. if (isDef(res.timeout)) {
  5086. timerTimeout = setTimeout(function () {
  5087. timerTimeout = null;
  5088. if (isUndef(factory.resolved)) {
  5089. reject(
  5090. true
  5091. ? ("timeout (" + (res.timeout) + "ms)")
  5092. : undefined
  5093. );
  5094. }
  5095. }, res.timeout);
  5096. }
  5097. }
  5098. }
  5099. sync = false;
  5100. // return in case resolved synchronously
  5101. return factory.loading
  5102. ? factory.loadingComp
  5103. : factory.resolved
  5104. }
  5105. }
  5106. /* */
  5107. function isAsyncPlaceholder (node) {
  5108. return node.isComment && node.asyncFactory
  5109. }
  5110. /* */
  5111. function getFirstComponentChild (children) {
  5112. if (Array.isArray(children)) {
  5113. for (var i = 0; i < children.length; i++) {
  5114. var c = children[i];
  5115. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  5116. return c
  5117. }
  5118. }
  5119. }
  5120. }
  5121. /* */
  5122. /* */
  5123. function initEvents (vm) {
  5124. vm._events = Object.create(null);
  5125. vm._hasHookEvent = false;
  5126. // init parent attached events
  5127. var listeners = vm.$options._parentListeners;
  5128. if (listeners) {
  5129. updateComponentListeners(vm, listeners);
  5130. }
  5131. }
  5132. var target;
  5133. function add (event, fn) {
  5134. target.$on(event, fn);
  5135. }
  5136. function remove$1 (event, fn) {
  5137. target.$off(event, fn);
  5138. }
  5139. function createOnceHandler (event, fn) {
  5140. var _target = target;
  5141. return function onceHandler () {
  5142. var res = fn.apply(null, arguments);
  5143. if (res !== null) {
  5144. _target.$off(event, onceHandler);
  5145. }
  5146. }
  5147. }
  5148. function updateComponentListeners (
  5149. vm,
  5150. listeners,
  5151. oldListeners
  5152. ) {
  5153. target = vm;
  5154. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  5155. target = undefined;
  5156. }
  5157. function eventsMixin (Vue) {
  5158. var hookRE = /^hook:/;
  5159. Vue.prototype.$on = function (event, fn) {
  5160. var vm = this;
  5161. if (Array.isArray(event)) {
  5162. for (var i = 0, l = event.length; i < l; i++) {
  5163. vm.$on(event[i], fn);
  5164. }
  5165. } else {
  5166. (vm._events[event] || (vm._events[event] = [])).push(fn);
  5167. // optimize hook:event cost by using a boolean flag marked at registration
  5168. // instead of a hash lookup
  5169. if (hookRE.test(event)) {
  5170. vm._hasHookEvent = true;
  5171. }
  5172. }
  5173. return vm
  5174. };
  5175. Vue.prototype.$once = function (event, fn) {
  5176. var vm = this;
  5177. function on () {
  5178. vm.$off(event, on);
  5179. fn.apply(vm, arguments);
  5180. }
  5181. on.fn = fn;
  5182. vm.$on(event, on);
  5183. return vm
  5184. };
  5185. Vue.prototype.$off = function (event, fn) {
  5186. var vm = this;
  5187. // all
  5188. if (!arguments.length) {
  5189. vm._events = Object.create(null);
  5190. return vm
  5191. }
  5192. // array of events
  5193. if (Array.isArray(event)) {
  5194. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  5195. vm.$off(event[i$1], fn);
  5196. }
  5197. return vm
  5198. }
  5199. // specific event
  5200. var cbs = vm._events[event];
  5201. if (!cbs) {
  5202. return vm
  5203. }
  5204. if (!fn) {
  5205. vm._events[event] = null;
  5206. return vm
  5207. }
  5208. // specific handler
  5209. var cb;
  5210. var i = cbs.length;
  5211. while (i--) {
  5212. cb = cbs[i];
  5213. if (cb === fn || cb.fn === fn) {
  5214. cbs.splice(i, 1);
  5215. break
  5216. }
  5217. }
  5218. return vm
  5219. };
  5220. Vue.prototype.$emit = function (event) {
  5221. var vm = this;
  5222. if (true) {
  5223. var lowerCaseEvent = event.toLowerCase();
  5224. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  5225. tip(
  5226. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  5227. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  5228. "Note that HTML attributes are case-insensitive and you cannot use " +
  5229. "v-on to listen to camelCase events when using in-DOM templates. " +
  5230. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  5231. );
  5232. }
  5233. }
  5234. var cbs = vm._events[event];
  5235. if (cbs) {
  5236. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  5237. var args = toArray(arguments, 1);
  5238. var info = "event handler for \"" + event + "\"";
  5239. for (var i = 0, l = cbs.length; i < l; i++) {
  5240. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  5241. }
  5242. }
  5243. return vm
  5244. };
  5245. }
  5246. /* */
  5247. var activeInstance = null;
  5248. var isUpdatingChildComponent = false;
  5249. function setActiveInstance(vm) {
  5250. var prevActiveInstance = activeInstance;
  5251. activeInstance = vm;
  5252. return function () {
  5253. activeInstance = prevActiveInstance;
  5254. }
  5255. }
  5256. function initLifecycle (vm) {
  5257. var options = vm.$options;
  5258. // locate first non-abstract parent
  5259. var parent = options.parent;
  5260. if (parent && !options.abstract) {
  5261. while (parent.$options.abstract && parent.$parent) {
  5262. parent = parent.$parent;
  5263. }
  5264. parent.$children.push(vm);
  5265. }
  5266. vm.$parent = parent;
  5267. vm.$root = parent ? parent.$root : vm;
  5268. vm.$children = [];
  5269. vm.$refs = {};
  5270. vm._watcher = null;
  5271. vm._inactive = null;
  5272. vm._directInactive = false;
  5273. vm._isMounted = false;
  5274. vm._isDestroyed = false;
  5275. vm._isBeingDestroyed = false;
  5276. }
  5277. function lifecycleMixin (Vue) {
  5278. Vue.prototype._update = function (vnode, hydrating) {
  5279. var vm = this;
  5280. var prevEl = vm.$el;
  5281. var prevVnode = vm._vnode;
  5282. var restoreActiveInstance = setActiveInstance(vm);
  5283. vm._vnode = vnode;
  5284. // Vue.prototype.__patch__ is injected in entry points
  5285. // based on the rendering backend used.
  5286. if (!prevVnode) {
  5287. // initial render
  5288. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  5289. } else {
  5290. // updates
  5291. vm.$el = vm.__patch__(prevVnode, vnode);
  5292. }
  5293. restoreActiveInstance();
  5294. // update __vue__ reference
  5295. if (prevEl) {
  5296. prevEl.__vue__ = null;
  5297. }
  5298. if (vm.$el) {
  5299. vm.$el.__vue__ = vm;
  5300. }
  5301. // if parent is an HOC, update its $el as well
  5302. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  5303. vm.$parent.$el = vm.$el;
  5304. }
  5305. // updated hook is called by the scheduler to ensure that children are
  5306. // updated in a parent's updated hook.
  5307. };
  5308. Vue.prototype.$forceUpdate = function () {
  5309. var vm = this;
  5310. if (vm._watcher) {
  5311. vm._watcher.update();
  5312. }
  5313. };
  5314. Vue.prototype.$destroy = function () {
  5315. var vm = this;
  5316. if (vm._isBeingDestroyed) {
  5317. return
  5318. }
  5319. callHook(vm, 'beforeDestroy');
  5320. vm._isBeingDestroyed = true;
  5321. // remove self from parent
  5322. var parent = vm.$parent;
  5323. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  5324. remove(parent.$children, vm);
  5325. }
  5326. // teardown watchers
  5327. if (vm._watcher) {
  5328. vm._watcher.teardown();
  5329. }
  5330. var i = vm._watchers.length;
  5331. while (i--) {
  5332. vm._watchers[i].teardown();
  5333. }
  5334. // remove reference from data ob
  5335. // frozen object may not have observer.
  5336. if (vm._data.__ob__) {
  5337. vm._data.__ob__.vmCount--;
  5338. }
  5339. // call the last hook...
  5340. vm._isDestroyed = true;
  5341. // invoke destroy hooks on current rendered tree
  5342. vm.__patch__(vm._vnode, null);
  5343. // fire destroyed hook
  5344. callHook(vm, 'destroyed');
  5345. // turn off all instance listeners.
  5346. vm.$off();
  5347. // remove __vue__ reference
  5348. if (vm.$el) {
  5349. vm.$el.__vue__ = null;
  5350. }
  5351. // release circular reference (#6759)
  5352. if (vm.$vnode) {
  5353. vm.$vnode.parent = null;
  5354. }
  5355. };
  5356. }
  5357. function updateChildComponent (
  5358. vm,
  5359. propsData,
  5360. listeners,
  5361. parentVnode,
  5362. renderChildren
  5363. ) {
  5364. if (true) {
  5365. isUpdatingChildComponent = true;
  5366. }
  5367. // determine whether component has slot children
  5368. // we need to do this before overwriting $options._renderChildren.
  5369. // check if there are dynamic scopedSlots (hand-written or compiled but with
  5370. // dynamic slot names). Static scoped slots compiled from template has the
  5371. // "$stable" marker.
  5372. var newScopedSlots = parentVnode.data.scopedSlots;
  5373. var oldScopedSlots = vm.$scopedSlots;
  5374. var hasDynamicScopedSlot = !!(
  5375. (newScopedSlots && !newScopedSlots.$stable) ||
  5376. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  5377. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  5378. );
  5379. // Any static slot children from the parent may have changed during parent's
  5380. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  5381. // update is necessary to ensure correctness.
  5382. var needsForceUpdate = !!(
  5383. renderChildren || // has new static slots
  5384. vm.$options._renderChildren || // has old static slots
  5385. hasDynamicScopedSlot
  5386. );
  5387. vm.$options._parentVnode = parentVnode;
  5388. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  5389. if (vm._vnode) { // update child tree's parent
  5390. vm._vnode.parent = parentVnode;
  5391. }
  5392. vm.$options._renderChildren = renderChildren;
  5393. // update $attrs and $listeners hash
  5394. // these are also reactive so they may trigger child update if the child
  5395. // used them during render
  5396. vm.$attrs = parentVnode.data.attrs || emptyObject;
  5397. vm.$listeners = listeners || emptyObject;
  5398. // update props
  5399. if (propsData && vm.$options.props) {
  5400. toggleObserving(false);
  5401. var props = vm._props;
  5402. var propKeys = vm.$options._propKeys || [];
  5403. for (var i = 0; i < propKeys.length; i++) {
  5404. var key = propKeys[i];
  5405. var propOptions = vm.$options.props; // wtf flow?
  5406. props[key] = validateProp(key, propOptions, propsData, vm);
  5407. }
  5408. toggleObserving(true);
  5409. // keep a copy of raw propsData
  5410. vm.$options.propsData = propsData;
  5411. }
  5412. // fixed by xxxxxx update properties(mp runtime)
  5413. vm._$updateProperties && vm._$updateProperties(vm);
  5414. // update listeners
  5415. listeners = listeners || emptyObject;
  5416. var oldListeners = vm.$options._parentListeners;
  5417. vm.$options._parentListeners = listeners;
  5418. updateComponentListeners(vm, listeners, oldListeners);
  5419. // resolve slots + force update if has children
  5420. if (needsForceUpdate) {
  5421. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  5422. vm.$forceUpdate();
  5423. }
  5424. if (true) {
  5425. isUpdatingChildComponent = false;
  5426. }
  5427. }
  5428. function isInInactiveTree (vm) {
  5429. while (vm && (vm = vm.$parent)) {
  5430. if (vm._inactive) { return true }
  5431. }
  5432. return false
  5433. }
  5434. function activateChildComponent (vm, direct) {
  5435. if (direct) {
  5436. vm._directInactive = false;
  5437. if (isInInactiveTree(vm)) {
  5438. return
  5439. }
  5440. } else if (vm._directInactive) {
  5441. return
  5442. }
  5443. if (vm._inactive || vm._inactive === null) {
  5444. vm._inactive = false;
  5445. for (var i = 0; i < vm.$children.length; i++) {
  5446. activateChildComponent(vm.$children[i]);
  5447. }
  5448. callHook(vm, 'activated');
  5449. }
  5450. }
  5451. function deactivateChildComponent (vm, direct) {
  5452. if (direct) {
  5453. vm._directInactive = true;
  5454. if (isInInactiveTree(vm)) {
  5455. return
  5456. }
  5457. }
  5458. if (!vm._inactive) {
  5459. vm._inactive = true;
  5460. for (var i = 0; i < vm.$children.length; i++) {
  5461. deactivateChildComponent(vm.$children[i]);
  5462. }
  5463. callHook(vm, 'deactivated');
  5464. }
  5465. }
  5466. function callHook (vm, hook) {
  5467. // #7573 disable dep collection when invoking lifecycle hooks
  5468. pushTarget();
  5469. var handlers = vm.$options[hook];
  5470. var info = hook + " hook";
  5471. if (handlers) {
  5472. for (var i = 0, j = handlers.length; i < j; i++) {
  5473. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  5474. }
  5475. }
  5476. if (vm._hasHookEvent) {
  5477. vm.$emit('hook:' + hook);
  5478. }
  5479. popTarget();
  5480. }
  5481. /* */
  5482. var MAX_UPDATE_COUNT = 100;
  5483. var queue = [];
  5484. var activatedChildren = [];
  5485. var has = {};
  5486. var circular = {};
  5487. var waiting = false;
  5488. var flushing = false;
  5489. var index = 0;
  5490. /**
  5491. * Reset the scheduler's state.
  5492. */
  5493. function resetSchedulerState () {
  5494. index = queue.length = activatedChildren.length = 0;
  5495. has = {};
  5496. if (true) {
  5497. circular = {};
  5498. }
  5499. waiting = flushing = false;
  5500. }
  5501. // Async edge case #6566 requires saving the timestamp when event listeners are
  5502. // attached. However, calling performance.now() has a perf overhead especially
  5503. // if the page has thousands of event listeners. Instead, we take a timestamp
  5504. // every time the scheduler flushes and use that for all event listeners
  5505. // attached during that flush.
  5506. var currentFlushTimestamp = 0;
  5507. // Async edge case fix requires storing an event listener's attach timestamp.
  5508. var getNow = Date.now;
  5509. // Determine what event timestamp the browser is using. Annoyingly, the
  5510. // timestamp can either be hi-res (relative to page load) or low-res
  5511. // (relative to UNIX epoch), so in order to compare time we have to use the
  5512. // same timestamp type when saving the flush timestamp.
  5513. // All IE versions use low-res event timestamps, and have problematic clock
  5514. // implementations (#9632)
  5515. if (inBrowser && !isIE) {
  5516. var performance = window.performance;
  5517. if (
  5518. performance &&
  5519. typeof performance.now === 'function' &&
  5520. getNow() > document.createEvent('Event').timeStamp
  5521. ) {
  5522. // if the event timestamp, although evaluated AFTER the Date.now(), is
  5523. // smaller than it, it means the event is using a hi-res timestamp,
  5524. // and we need to use the hi-res version for event listener timestamps as
  5525. // well.
  5526. getNow = function () { return performance.now(); };
  5527. }
  5528. }
  5529. /**
  5530. * Flush both queues and run the watchers.
  5531. */
  5532. function flushSchedulerQueue () {
  5533. currentFlushTimestamp = getNow();
  5534. flushing = true;
  5535. var watcher, id;
  5536. // Sort queue before flush.
  5537. // This ensures that:
  5538. // 1. Components are updated from parent to child. (because parent is always
  5539. // created before the child)
  5540. // 2. A component's user watchers are run before its render watcher (because
  5541. // user watchers are created before the render watcher)
  5542. // 3. If a component is destroyed during a parent component's watcher run,
  5543. // its watchers can be skipped.
  5544. queue.sort(function (a, b) { return a.id - b.id; });
  5545. // do not cache length because more watchers might be pushed
  5546. // as we run existing watchers
  5547. for (index = 0; index < queue.length; index++) {
  5548. watcher = queue[index];
  5549. if (watcher.before) {
  5550. watcher.before();
  5551. }
  5552. id = watcher.id;
  5553. has[id] = null;
  5554. watcher.run();
  5555. // in dev build, check and stop circular updates.
  5556. if ( true && has[id] != null) {
  5557. circular[id] = (circular[id] || 0) + 1;
  5558. if (circular[id] > MAX_UPDATE_COUNT) {
  5559. warn(
  5560. 'You may have an infinite update loop ' + (
  5561. watcher.user
  5562. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  5563. : "in a component render function."
  5564. ),
  5565. watcher.vm
  5566. );
  5567. break
  5568. }
  5569. }
  5570. }
  5571. // keep copies of post queues before resetting state
  5572. var activatedQueue = activatedChildren.slice();
  5573. var updatedQueue = queue.slice();
  5574. resetSchedulerState();
  5575. // call component updated and activated hooks
  5576. callActivatedHooks(activatedQueue);
  5577. callUpdatedHooks(updatedQueue);
  5578. // devtool hook
  5579. /* istanbul ignore if */
  5580. if (devtools && config.devtools) {
  5581. devtools.emit('flush');
  5582. }
  5583. }
  5584. function callUpdatedHooks (queue) {
  5585. var i = queue.length;
  5586. while (i--) {
  5587. var watcher = queue[i];
  5588. var vm = watcher.vm;
  5589. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  5590. callHook(vm, 'updated');
  5591. }
  5592. }
  5593. }
  5594. /**
  5595. * Queue a kept-alive component that was activated during patch.
  5596. * The queue will be processed after the entire tree has been patched.
  5597. */
  5598. function queueActivatedComponent (vm) {
  5599. // setting _inactive to false here so that a render function can
  5600. // rely on checking whether it's in an inactive tree (e.g. router-view)
  5601. vm._inactive = false;
  5602. activatedChildren.push(vm);
  5603. }
  5604. function callActivatedHooks (queue) {
  5605. for (var i = 0; i < queue.length; i++) {
  5606. queue[i]._inactive = true;
  5607. activateChildComponent(queue[i], true /* true */);
  5608. }
  5609. }
  5610. /**
  5611. * Push a watcher into the watcher queue.
  5612. * Jobs with duplicate IDs will be skipped unless it's
  5613. * pushed when the queue is being flushed.
  5614. */
  5615. function queueWatcher (watcher) {
  5616. var id = watcher.id;
  5617. if (has[id] == null) {
  5618. has[id] = true;
  5619. if (!flushing) {
  5620. queue.push(watcher);
  5621. } else {
  5622. // if already flushing, splice the watcher based on its id
  5623. // if already past its id, it will be run next immediately.
  5624. var i = queue.length - 1;
  5625. while (i > index && queue[i].id > watcher.id) {
  5626. i--;
  5627. }
  5628. queue.splice(i + 1, 0, watcher);
  5629. }
  5630. // queue the flush
  5631. if (!waiting) {
  5632. waiting = true;
  5633. if ( true && !config.async) {
  5634. flushSchedulerQueue();
  5635. return
  5636. }
  5637. nextTick(flushSchedulerQueue);
  5638. }
  5639. }
  5640. }
  5641. /* */
  5642. var uid$2 = 0;
  5643. /**
  5644. * A watcher parses an expression, collects dependencies,
  5645. * and fires callback when the expression value changes.
  5646. * This is used for both the $watch() api and directives.
  5647. */
  5648. var Watcher = function Watcher (
  5649. vm,
  5650. expOrFn,
  5651. cb,
  5652. options,
  5653. isRenderWatcher
  5654. ) {
  5655. this.vm = vm;
  5656. if (isRenderWatcher) {
  5657. vm._watcher = this;
  5658. }
  5659. vm._watchers.push(this);
  5660. // options
  5661. if (options) {
  5662. this.deep = !!options.deep;
  5663. this.user = !!options.user;
  5664. this.lazy = !!options.lazy;
  5665. this.sync = !!options.sync;
  5666. this.before = options.before;
  5667. } else {
  5668. this.deep = this.user = this.lazy = this.sync = false;
  5669. }
  5670. this.cb = cb;
  5671. this.id = ++uid$2; // uid for batching
  5672. this.active = true;
  5673. this.dirty = this.lazy; // for lazy watchers
  5674. this.deps = [];
  5675. this.newDeps = [];
  5676. this.depIds = new _Set();
  5677. this.newDepIds = new _Set();
  5678. this.expression = true
  5679. ? expOrFn.toString()
  5680. : undefined;
  5681. // parse expression for getter
  5682. if (typeof expOrFn === 'function') {
  5683. this.getter = expOrFn;
  5684. } else {
  5685. this.getter = parsePath(expOrFn);
  5686. if (!this.getter) {
  5687. this.getter = noop;
  5688. true && warn(
  5689. "Failed watching path: \"" + expOrFn + "\" " +
  5690. 'Watcher only accepts simple dot-delimited paths. ' +
  5691. 'For full control, use a function instead.',
  5692. vm
  5693. );
  5694. }
  5695. }
  5696. this.value = this.lazy
  5697. ? undefined
  5698. : this.get();
  5699. };
  5700. /**
  5701. * Evaluate the getter, and re-collect dependencies.
  5702. */
  5703. Watcher.prototype.get = function get () {
  5704. pushTarget(this);
  5705. var value;
  5706. var vm = this.vm;
  5707. try {
  5708. value = this.getter.call(vm, vm);
  5709. } catch (e) {
  5710. if (this.user) {
  5711. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  5712. } else {
  5713. throw e
  5714. }
  5715. } finally {
  5716. // "touch" every property so they are all tracked as
  5717. // dependencies for deep watching
  5718. if (this.deep) {
  5719. traverse(value);
  5720. }
  5721. popTarget();
  5722. this.cleanupDeps();
  5723. }
  5724. return value
  5725. };
  5726. /**
  5727. * Add a dependency to this directive.
  5728. */
  5729. Watcher.prototype.addDep = function addDep (dep) {
  5730. var id = dep.id;
  5731. if (!this.newDepIds.has(id)) {
  5732. this.newDepIds.add(id);
  5733. this.newDeps.push(dep);
  5734. if (!this.depIds.has(id)) {
  5735. dep.addSub(this);
  5736. }
  5737. }
  5738. };
  5739. /**
  5740. * Clean up for dependency collection.
  5741. */
  5742. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  5743. var i = this.deps.length;
  5744. while (i--) {
  5745. var dep = this.deps[i];
  5746. if (!this.newDepIds.has(dep.id)) {
  5747. dep.removeSub(this);
  5748. }
  5749. }
  5750. var tmp = this.depIds;
  5751. this.depIds = this.newDepIds;
  5752. this.newDepIds = tmp;
  5753. this.newDepIds.clear();
  5754. tmp = this.deps;
  5755. this.deps = this.newDeps;
  5756. this.newDeps = tmp;
  5757. this.newDeps.length = 0;
  5758. };
  5759. /**
  5760. * Subscriber interface.
  5761. * Will be called when a dependency changes.
  5762. */
  5763. Watcher.prototype.update = function update () {
  5764. /* istanbul ignore else */
  5765. if (this.lazy) {
  5766. this.dirty = true;
  5767. } else if (this.sync) {
  5768. this.run();
  5769. } else {
  5770. queueWatcher(this);
  5771. }
  5772. };
  5773. /**
  5774. * Scheduler job interface.
  5775. * Will be called by the scheduler.
  5776. */
  5777. Watcher.prototype.run = function run () {
  5778. if (this.active) {
  5779. var value = this.get();
  5780. if (
  5781. value !== this.value ||
  5782. // Deep watchers and watchers on Object/Arrays should fire even
  5783. // when the value is the same, because the value may
  5784. // have mutated.
  5785. isObject(value) ||
  5786. this.deep
  5787. ) {
  5788. // set new value
  5789. var oldValue = this.value;
  5790. this.value = value;
  5791. if (this.user) {
  5792. try {
  5793. this.cb.call(this.vm, value, oldValue);
  5794. } catch (e) {
  5795. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  5796. }
  5797. } else {
  5798. this.cb.call(this.vm, value, oldValue);
  5799. }
  5800. }
  5801. }
  5802. };
  5803. /**
  5804. * Evaluate the value of the watcher.
  5805. * This only gets called for lazy watchers.
  5806. */
  5807. Watcher.prototype.evaluate = function evaluate () {
  5808. this.value = this.get();
  5809. this.dirty = false;
  5810. };
  5811. /**
  5812. * Depend on all deps collected by this watcher.
  5813. */
  5814. Watcher.prototype.depend = function depend () {
  5815. var i = this.deps.length;
  5816. while (i--) {
  5817. this.deps[i].depend();
  5818. }
  5819. };
  5820. /**
  5821. * Remove self from all dependencies' subscriber list.
  5822. */
  5823. Watcher.prototype.teardown = function teardown () {
  5824. if (this.active) {
  5825. // remove self from vm's watcher list
  5826. // this is a somewhat expensive operation so we skip it
  5827. // if the vm is being destroyed.
  5828. if (!this.vm._isBeingDestroyed) {
  5829. remove(this.vm._watchers, this);
  5830. }
  5831. var i = this.deps.length;
  5832. while (i--) {
  5833. this.deps[i].removeSub(this);
  5834. }
  5835. this.active = false;
  5836. }
  5837. };
  5838. /* */
  5839. var sharedPropertyDefinition = {
  5840. enumerable: true,
  5841. configurable: true,
  5842. get: noop,
  5843. set: noop
  5844. };
  5845. function proxy (target, sourceKey, key) {
  5846. sharedPropertyDefinition.get = function proxyGetter () {
  5847. return this[sourceKey][key]
  5848. };
  5849. sharedPropertyDefinition.set = function proxySetter (val) {
  5850. this[sourceKey][key] = val;
  5851. };
  5852. Object.defineProperty(target, key, sharedPropertyDefinition);
  5853. }
  5854. function initState (vm) {
  5855. vm._watchers = [];
  5856. var opts = vm.$options;
  5857. if (opts.props) { initProps(vm, opts.props); }
  5858. if (opts.methods) { initMethods(vm, opts.methods); }
  5859. if (opts.data) {
  5860. initData(vm);
  5861. } else {
  5862. observe(vm._data = {}, true /* asRootData */);
  5863. }
  5864. if (opts.computed) { initComputed(vm, opts.computed); }
  5865. if (opts.watch && opts.watch !== nativeWatch) {
  5866. initWatch(vm, opts.watch);
  5867. }
  5868. }
  5869. function initProps (vm, propsOptions) {
  5870. var propsData = vm.$options.propsData || {};
  5871. var props = vm._props = {};
  5872. // cache prop keys so that future props updates can iterate using Array
  5873. // instead of dynamic object key enumeration.
  5874. var keys = vm.$options._propKeys = [];
  5875. var isRoot = !vm.$parent;
  5876. // root instance props should be converted
  5877. if (!isRoot) {
  5878. toggleObserving(false);
  5879. }
  5880. var loop = function ( key ) {
  5881. keys.push(key);
  5882. var value = validateProp(key, propsOptions, propsData, vm);
  5883. /* istanbul ignore else */
  5884. if (true) {
  5885. var hyphenatedKey = hyphenate(key);
  5886. if (isReservedAttribute(hyphenatedKey) ||
  5887. config.isReservedAttr(hyphenatedKey)) {
  5888. warn(
  5889. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  5890. vm
  5891. );
  5892. }
  5893. defineReactive$$1(props, key, value, function () {
  5894. if (!isRoot && !isUpdatingChildComponent) {
  5895. {
  5896. if(vm.mpHost === 'mp-baidu' || vm.mpHost === 'mp-kuaishou'){//百度、快手 observer 在 setData callback 之后触发,直接忽略该 warn
  5897. return
  5898. }
  5899. //fixed by xxxxxx __next_tick_pending,uni://form-field 时不告警
  5900. if(
  5901. key === 'value' &&
  5902. Array.isArray(vm.$options.behaviors) &&
  5903. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  5904. ){
  5905. return
  5906. }
  5907. if(vm._getFormData){
  5908. return
  5909. }
  5910. var $parent = vm.$parent;
  5911. while($parent){
  5912. if($parent.__next_tick_pending){
  5913. return
  5914. }
  5915. $parent = $parent.$parent;
  5916. }
  5917. }
  5918. warn(
  5919. "Avoid mutating a prop directly since the value will be " +
  5920. "overwritten whenever the parent component re-renders. " +
  5921. "Instead, use a data or computed property based on the prop's " +
  5922. "value. Prop being mutated: \"" + key + "\"",
  5923. vm
  5924. );
  5925. }
  5926. });
  5927. } else {}
  5928. // static props are already proxied on the component's prototype
  5929. // during Vue.extend(). We only need to proxy props defined at
  5930. // instantiation here.
  5931. if (!(key in vm)) {
  5932. proxy(vm, "_props", key);
  5933. }
  5934. };
  5935. for (var key in propsOptions) loop( key );
  5936. toggleObserving(true);
  5937. }
  5938. function initData (vm) {
  5939. var data = vm.$options.data;
  5940. data = vm._data = typeof data === 'function'
  5941. ? getData(data, vm)
  5942. : data || {};
  5943. if (!isPlainObject(data)) {
  5944. data = {};
  5945. true && warn(
  5946. 'data functions should return an object:\n' +
  5947. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  5948. vm
  5949. );
  5950. }
  5951. // proxy data on instance
  5952. var keys = Object.keys(data);
  5953. var props = vm.$options.props;
  5954. var methods = vm.$options.methods;
  5955. var i = keys.length;
  5956. while (i--) {
  5957. var key = keys[i];
  5958. if (true) {
  5959. if (methods && hasOwn(methods, key)) {
  5960. warn(
  5961. ("Method \"" + key + "\" has already been defined as a data property."),
  5962. vm
  5963. );
  5964. }
  5965. }
  5966. if (props && hasOwn(props, key)) {
  5967. true && warn(
  5968. "The data property \"" + key + "\" is already declared as a prop. " +
  5969. "Use prop default value instead.",
  5970. vm
  5971. );
  5972. } else if (!isReserved(key)) {
  5973. proxy(vm, "_data", key);
  5974. }
  5975. }
  5976. // observe data
  5977. observe(data, true /* asRootData */);
  5978. }
  5979. function getData (data, vm) {
  5980. // #7573 disable dep collection when invoking data getters
  5981. pushTarget();
  5982. try {
  5983. return data.call(vm, vm)
  5984. } catch (e) {
  5985. handleError(e, vm, "data()");
  5986. return {}
  5987. } finally {
  5988. popTarget();
  5989. }
  5990. }
  5991. var computedWatcherOptions = { lazy: true };
  5992. function initComputed (vm, computed) {
  5993. // $flow-disable-line
  5994. var watchers = vm._computedWatchers = Object.create(null);
  5995. // computed properties are just getters during SSR
  5996. var isSSR = isServerRendering();
  5997. for (var key in computed) {
  5998. var userDef = computed[key];
  5999. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  6000. if ( true && getter == null) {
  6001. warn(
  6002. ("Getter is missing for computed property \"" + key + "\"."),
  6003. vm
  6004. );
  6005. }
  6006. if (!isSSR) {
  6007. // create internal watcher for the computed property.
  6008. watchers[key] = new Watcher(
  6009. vm,
  6010. getter || noop,
  6011. noop,
  6012. computedWatcherOptions
  6013. );
  6014. }
  6015. // component-defined computed properties are already defined on the
  6016. // component prototype. We only need to define computed properties defined
  6017. // at instantiation here.
  6018. if (!(key in vm)) {
  6019. defineComputed(vm, key, userDef);
  6020. } else if (true) {
  6021. if (key in vm.$data) {
  6022. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  6023. } else if (vm.$options.props && key in vm.$options.props) {
  6024. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  6025. }
  6026. }
  6027. }
  6028. }
  6029. function defineComputed (
  6030. target,
  6031. key,
  6032. userDef
  6033. ) {
  6034. var shouldCache = !isServerRendering();
  6035. if (typeof userDef === 'function') {
  6036. sharedPropertyDefinition.get = shouldCache
  6037. ? createComputedGetter(key)
  6038. : createGetterInvoker(userDef);
  6039. sharedPropertyDefinition.set = noop;
  6040. } else {
  6041. sharedPropertyDefinition.get = userDef.get
  6042. ? shouldCache && userDef.cache !== false
  6043. ? createComputedGetter(key)
  6044. : createGetterInvoker(userDef.get)
  6045. : noop;
  6046. sharedPropertyDefinition.set = userDef.set || noop;
  6047. }
  6048. if ( true &&
  6049. sharedPropertyDefinition.set === noop) {
  6050. sharedPropertyDefinition.set = function () {
  6051. warn(
  6052. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  6053. this
  6054. );
  6055. };
  6056. }
  6057. Object.defineProperty(target, key, sharedPropertyDefinition);
  6058. }
  6059. function createComputedGetter (key) {
  6060. return function computedGetter () {
  6061. var watcher = this._computedWatchers && this._computedWatchers[key];
  6062. if (watcher) {
  6063. if (watcher.dirty) {
  6064. watcher.evaluate();
  6065. }
  6066. if (Dep.SharedObject.target) {// fixed by xxxxxx
  6067. watcher.depend();
  6068. }
  6069. return watcher.value
  6070. }
  6071. }
  6072. }
  6073. function createGetterInvoker(fn) {
  6074. return function computedGetter () {
  6075. return fn.call(this, this)
  6076. }
  6077. }
  6078. function initMethods (vm, methods) {
  6079. var props = vm.$options.props;
  6080. for (var key in methods) {
  6081. if (true) {
  6082. if (typeof methods[key] !== 'function') {
  6083. warn(
  6084. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  6085. "Did you reference the function correctly?",
  6086. vm
  6087. );
  6088. }
  6089. if (props && hasOwn(props, key)) {
  6090. warn(
  6091. ("Method \"" + key + "\" has already been defined as a prop."),
  6092. vm
  6093. );
  6094. }
  6095. if ((key in vm) && isReserved(key)) {
  6096. warn(
  6097. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  6098. "Avoid defining component methods that start with _ or $."
  6099. );
  6100. }
  6101. }
  6102. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  6103. }
  6104. }
  6105. function initWatch (vm, watch) {
  6106. for (var key in watch) {
  6107. var handler = watch[key];
  6108. if (Array.isArray(handler)) {
  6109. for (var i = 0; i < handler.length; i++) {
  6110. createWatcher(vm, key, handler[i]);
  6111. }
  6112. } else {
  6113. createWatcher(vm, key, handler);
  6114. }
  6115. }
  6116. }
  6117. function createWatcher (
  6118. vm,
  6119. expOrFn,
  6120. handler,
  6121. options
  6122. ) {
  6123. if (isPlainObject(handler)) {
  6124. options = handler;
  6125. handler = handler.handler;
  6126. }
  6127. if (typeof handler === 'string') {
  6128. handler = vm[handler];
  6129. }
  6130. return vm.$watch(expOrFn, handler, options)
  6131. }
  6132. function stateMixin (Vue) {
  6133. // flow somehow has problems with directly declared definition object
  6134. // when using Object.defineProperty, so we have to procedurally build up
  6135. // the object here.
  6136. var dataDef = {};
  6137. dataDef.get = function () { return this._data };
  6138. var propsDef = {};
  6139. propsDef.get = function () { return this._props };
  6140. if (true) {
  6141. dataDef.set = function () {
  6142. warn(
  6143. 'Avoid replacing instance root $data. ' +
  6144. 'Use nested data properties instead.',
  6145. this
  6146. );
  6147. };
  6148. propsDef.set = function () {
  6149. warn("$props is readonly.", this);
  6150. };
  6151. }
  6152. Object.defineProperty(Vue.prototype, '$data', dataDef);
  6153. Object.defineProperty(Vue.prototype, '$props', propsDef);
  6154. Vue.prototype.$set = set;
  6155. Vue.prototype.$delete = del;
  6156. Vue.prototype.$watch = function (
  6157. expOrFn,
  6158. cb,
  6159. options
  6160. ) {
  6161. var vm = this;
  6162. if (isPlainObject(cb)) {
  6163. return createWatcher(vm, expOrFn, cb, options)
  6164. }
  6165. options = options || {};
  6166. options.user = true;
  6167. var watcher = new Watcher(vm, expOrFn, cb, options);
  6168. if (options.immediate) {
  6169. try {
  6170. cb.call(vm, watcher.value);
  6171. } catch (error) {
  6172. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  6173. }
  6174. }
  6175. return function unwatchFn () {
  6176. watcher.teardown();
  6177. }
  6178. };
  6179. }
  6180. /* */
  6181. var uid$3 = 0;
  6182. function initMixin (Vue) {
  6183. Vue.prototype._init = function (options) {
  6184. var vm = this;
  6185. // a uid
  6186. vm._uid = uid$3++;
  6187. var startTag, endTag;
  6188. /* istanbul ignore if */
  6189. if ( true && config.performance && mark) {
  6190. startTag = "vue-perf-start:" + (vm._uid);
  6191. endTag = "vue-perf-end:" + (vm._uid);
  6192. mark(startTag);
  6193. }
  6194. // a flag to avoid this being observed
  6195. vm._isVue = true;
  6196. // merge options
  6197. if (options && options._isComponent) {
  6198. // optimize internal component instantiation
  6199. // since dynamic options merging is pretty slow, and none of the
  6200. // internal component options needs special treatment.
  6201. initInternalComponent(vm, options);
  6202. } else {
  6203. vm.$options = mergeOptions(
  6204. resolveConstructorOptions(vm.constructor),
  6205. options || {},
  6206. vm
  6207. );
  6208. }
  6209. /* istanbul ignore else */
  6210. if (true) {
  6211. initProxy(vm);
  6212. } else {}
  6213. // expose real self
  6214. vm._self = vm;
  6215. initLifecycle(vm);
  6216. initEvents(vm);
  6217. initRender(vm);
  6218. callHook(vm, 'beforeCreate');
  6219. !vm._$fallback && initInjections(vm); // resolve injections before data/props
  6220. initState(vm);
  6221. !vm._$fallback && initProvide(vm); // resolve provide after data/props
  6222. !vm._$fallback && callHook(vm, 'created');
  6223. /* istanbul ignore if */
  6224. if ( true && config.performance && mark) {
  6225. vm._name = formatComponentName(vm, false);
  6226. mark(endTag);
  6227. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  6228. }
  6229. if (vm.$options.el) {
  6230. vm.$mount(vm.$options.el);
  6231. }
  6232. };
  6233. }
  6234. function initInternalComponent (vm, options) {
  6235. var opts = vm.$options = Object.create(vm.constructor.options);
  6236. // doing this because it's faster than dynamic enumeration.
  6237. var parentVnode = options._parentVnode;
  6238. opts.parent = options.parent;
  6239. opts._parentVnode = parentVnode;
  6240. var vnodeComponentOptions = parentVnode.componentOptions;
  6241. opts.propsData = vnodeComponentOptions.propsData;
  6242. opts._parentListeners = vnodeComponentOptions.listeners;
  6243. opts._renderChildren = vnodeComponentOptions.children;
  6244. opts._componentTag = vnodeComponentOptions.tag;
  6245. if (options.render) {
  6246. opts.render = options.render;
  6247. opts.staticRenderFns = options.staticRenderFns;
  6248. }
  6249. }
  6250. function resolveConstructorOptions (Ctor) {
  6251. var options = Ctor.options;
  6252. if (Ctor.super) {
  6253. var superOptions = resolveConstructorOptions(Ctor.super);
  6254. var cachedSuperOptions = Ctor.superOptions;
  6255. if (superOptions !== cachedSuperOptions) {
  6256. // super option changed,
  6257. // need to resolve new options.
  6258. Ctor.superOptions = superOptions;
  6259. // check if there are any late-modified/attached options (#4976)
  6260. var modifiedOptions = resolveModifiedOptions(Ctor);
  6261. // update base extend options
  6262. if (modifiedOptions) {
  6263. extend(Ctor.extendOptions, modifiedOptions);
  6264. }
  6265. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  6266. if (options.name) {
  6267. options.components[options.name] = Ctor;
  6268. }
  6269. }
  6270. }
  6271. return options
  6272. }
  6273. function resolveModifiedOptions (Ctor) {
  6274. var modified;
  6275. var latest = Ctor.options;
  6276. var sealed = Ctor.sealedOptions;
  6277. for (var key in latest) {
  6278. if (latest[key] !== sealed[key]) {
  6279. if (!modified) { modified = {}; }
  6280. modified[key] = latest[key];
  6281. }
  6282. }
  6283. return modified
  6284. }
  6285. function Vue (options) {
  6286. if ( true &&
  6287. !(this instanceof Vue)
  6288. ) {
  6289. warn('Vue is a constructor and should be called with the `new` keyword');
  6290. }
  6291. this._init(options);
  6292. }
  6293. initMixin(Vue);
  6294. stateMixin(Vue);
  6295. eventsMixin(Vue);
  6296. lifecycleMixin(Vue);
  6297. renderMixin(Vue);
  6298. /* */
  6299. function initUse (Vue) {
  6300. Vue.use = function (plugin) {
  6301. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  6302. if (installedPlugins.indexOf(plugin) > -1) {
  6303. return this
  6304. }
  6305. // additional parameters
  6306. var args = toArray(arguments, 1);
  6307. args.unshift(this);
  6308. if (typeof plugin.install === 'function') {
  6309. plugin.install.apply(plugin, args);
  6310. } else if (typeof plugin === 'function') {
  6311. plugin.apply(null, args);
  6312. }
  6313. installedPlugins.push(plugin);
  6314. return this
  6315. };
  6316. }
  6317. /* */
  6318. function initMixin$1 (Vue) {
  6319. Vue.mixin = function (mixin) {
  6320. this.options = mergeOptions(this.options, mixin);
  6321. return this
  6322. };
  6323. }
  6324. /* */
  6325. function initExtend (Vue) {
  6326. /**
  6327. * Each instance constructor, including Vue, has a unique
  6328. * cid. This enables us to create wrapped "child
  6329. * constructors" for prototypal inheritance and cache them.
  6330. */
  6331. Vue.cid = 0;
  6332. var cid = 1;
  6333. /**
  6334. * Class inheritance
  6335. */
  6336. Vue.extend = function (extendOptions) {
  6337. extendOptions = extendOptions || {};
  6338. var Super = this;
  6339. var SuperId = Super.cid;
  6340. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  6341. if (cachedCtors[SuperId]) {
  6342. return cachedCtors[SuperId]
  6343. }
  6344. var name = extendOptions.name || Super.options.name;
  6345. if ( true && name) {
  6346. validateComponentName(name);
  6347. }
  6348. var Sub = function VueComponent (options) {
  6349. this._init(options);
  6350. };
  6351. Sub.prototype = Object.create(Super.prototype);
  6352. Sub.prototype.constructor = Sub;
  6353. Sub.cid = cid++;
  6354. Sub.options = mergeOptions(
  6355. Super.options,
  6356. extendOptions
  6357. );
  6358. Sub['super'] = Super;
  6359. // For props and computed properties, we define the proxy getters on
  6360. // the Vue instances at extension time, on the extended prototype. This
  6361. // avoids Object.defineProperty calls for each instance created.
  6362. if (Sub.options.props) {
  6363. initProps$1(Sub);
  6364. }
  6365. if (Sub.options.computed) {
  6366. initComputed$1(Sub);
  6367. }
  6368. // allow further extension/mixin/plugin usage
  6369. Sub.extend = Super.extend;
  6370. Sub.mixin = Super.mixin;
  6371. Sub.use = Super.use;
  6372. // create asset registers, so extended classes
  6373. // can have their private assets too.
  6374. ASSET_TYPES.forEach(function (type) {
  6375. Sub[type] = Super[type];
  6376. });
  6377. // enable recursive self-lookup
  6378. if (name) {
  6379. Sub.options.components[name] = Sub;
  6380. }
  6381. // keep a reference to the super options at extension time.
  6382. // later at instantiation we can check if Super's options have
  6383. // been updated.
  6384. Sub.superOptions = Super.options;
  6385. Sub.extendOptions = extendOptions;
  6386. Sub.sealedOptions = extend({}, Sub.options);
  6387. // cache constructor
  6388. cachedCtors[SuperId] = Sub;
  6389. return Sub
  6390. };
  6391. }
  6392. function initProps$1 (Comp) {
  6393. var props = Comp.options.props;
  6394. for (var key in props) {
  6395. proxy(Comp.prototype, "_props", key);
  6396. }
  6397. }
  6398. function initComputed$1 (Comp) {
  6399. var computed = Comp.options.computed;
  6400. for (var key in computed) {
  6401. defineComputed(Comp.prototype, key, computed[key]);
  6402. }
  6403. }
  6404. /* */
  6405. function initAssetRegisters (Vue) {
  6406. /**
  6407. * Create asset registration methods.
  6408. */
  6409. ASSET_TYPES.forEach(function (type) {
  6410. Vue[type] = function (
  6411. id,
  6412. definition
  6413. ) {
  6414. if (!definition) {
  6415. return this.options[type + 's'][id]
  6416. } else {
  6417. /* istanbul ignore if */
  6418. if ( true && type === 'component') {
  6419. validateComponentName(id);
  6420. }
  6421. if (type === 'component' && isPlainObject(definition)) {
  6422. definition.name = definition.name || id;
  6423. definition = this.options._base.extend(definition);
  6424. }
  6425. if (type === 'directive' && typeof definition === 'function') {
  6426. definition = { bind: definition, update: definition };
  6427. }
  6428. this.options[type + 's'][id] = definition;
  6429. return definition
  6430. }
  6431. };
  6432. });
  6433. }
  6434. /* */
  6435. function getComponentName (opts) {
  6436. return opts && (opts.Ctor.options.name || opts.tag)
  6437. }
  6438. function matches (pattern, name) {
  6439. if (Array.isArray(pattern)) {
  6440. return pattern.indexOf(name) > -1
  6441. } else if (typeof pattern === 'string') {
  6442. return pattern.split(',').indexOf(name) > -1
  6443. } else if (isRegExp(pattern)) {
  6444. return pattern.test(name)
  6445. }
  6446. /* istanbul ignore next */
  6447. return false
  6448. }
  6449. function pruneCache (keepAliveInstance, filter) {
  6450. var cache = keepAliveInstance.cache;
  6451. var keys = keepAliveInstance.keys;
  6452. var _vnode = keepAliveInstance._vnode;
  6453. for (var key in cache) {
  6454. var cachedNode = cache[key];
  6455. if (cachedNode) {
  6456. var name = getComponentName(cachedNode.componentOptions);
  6457. if (name && !filter(name)) {
  6458. pruneCacheEntry(cache, key, keys, _vnode);
  6459. }
  6460. }
  6461. }
  6462. }
  6463. function pruneCacheEntry (
  6464. cache,
  6465. key,
  6466. keys,
  6467. current
  6468. ) {
  6469. var cached$$1 = cache[key];
  6470. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  6471. cached$$1.componentInstance.$destroy();
  6472. }
  6473. cache[key] = null;
  6474. remove(keys, key);
  6475. }
  6476. var patternTypes = [String, RegExp, Array];
  6477. var KeepAlive = {
  6478. name: 'keep-alive',
  6479. abstract: true,
  6480. props: {
  6481. include: patternTypes,
  6482. exclude: patternTypes,
  6483. max: [String, Number]
  6484. },
  6485. created: function created () {
  6486. this.cache = Object.create(null);
  6487. this.keys = [];
  6488. },
  6489. destroyed: function destroyed () {
  6490. for (var key in this.cache) {
  6491. pruneCacheEntry(this.cache, key, this.keys);
  6492. }
  6493. },
  6494. mounted: function mounted () {
  6495. var this$1 = this;
  6496. this.$watch('include', function (val) {
  6497. pruneCache(this$1, function (name) { return matches(val, name); });
  6498. });
  6499. this.$watch('exclude', function (val) {
  6500. pruneCache(this$1, function (name) { return !matches(val, name); });
  6501. });
  6502. },
  6503. render: function render () {
  6504. var slot = this.$slots.default;
  6505. var vnode = getFirstComponentChild(slot);
  6506. var componentOptions = vnode && vnode.componentOptions;
  6507. if (componentOptions) {
  6508. // check pattern
  6509. var name = getComponentName(componentOptions);
  6510. var ref = this;
  6511. var include = ref.include;
  6512. var exclude = ref.exclude;
  6513. if (
  6514. // not included
  6515. (include && (!name || !matches(include, name))) ||
  6516. // excluded
  6517. (exclude && name && matches(exclude, name))
  6518. ) {
  6519. return vnode
  6520. }
  6521. var ref$1 = this;
  6522. var cache = ref$1.cache;
  6523. var keys = ref$1.keys;
  6524. var key = vnode.key == null
  6525. // same constructor may get registered as different local components
  6526. // so cid alone is not enough (#3269)
  6527. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  6528. : vnode.key;
  6529. if (cache[key]) {
  6530. vnode.componentInstance = cache[key].componentInstance;
  6531. // make current key freshest
  6532. remove(keys, key);
  6533. keys.push(key);
  6534. } else {
  6535. cache[key] = vnode;
  6536. keys.push(key);
  6537. // prune oldest entry
  6538. if (this.max && keys.length > parseInt(this.max)) {
  6539. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  6540. }
  6541. }
  6542. vnode.data.keepAlive = true;
  6543. }
  6544. return vnode || (slot && slot[0])
  6545. }
  6546. };
  6547. var builtInComponents = {
  6548. KeepAlive: KeepAlive
  6549. };
  6550. /* */
  6551. function initGlobalAPI (Vue) {
  6552. // config
  6553. var configDef = {};
  6554. configDef.get = function () { return config; };
  6555. if (true) {
  6556. configDef.set = function () {
  6557. warn(
  6558. 'Do not replace the Vue.config object, set individual fields instead.'
  6559. );
  6560. };
  6561. }
  6562. Object.defineProperty(Vue, 'config', configDef);
  6563. // exposed util methods.
  6564. // NOTE: these are not considered part of the public API - avoid relying on
  6565. // them unless you are aware of the risk.
  6566. Vue.util = {
  6567. warn: warn,
  6568. extend: extend,
  6569. mergeOptions: mergeOptions,
  6570. defineReactive: defineReactive$$1
  6571. };
  6572. Vue.set = set;
  6573. Vue.delete = del;
  6574. Vue.nextTick = nextTick;
  6575. // 2.6 explicit observable API
  6576. Vue.observable = function (obj) {
  6577. observe(obj);
  6578. return obj
  6579. };
  6580. Vue.options = Object.create(null);
  6581. ASSET_TYPES.forEach(function (type) {
  6582. Vue.options[type + 's'] = Object.create(null);
  6583. });
  6584. // this is used to identify the "base" constructor to extend all plain-object
  6585. // components with in Weex's multi-instance scenarios.
  6586. Vue.options._base = Vue;
  6587. extend(Vue.options.components, builtInComponents);
  6588. initUse(Vue);
  6589. initMixin$1(Vue);
  6590. initExtend(Vue);
  6591. initAssetRegisters(Vue);
  6592. }
  6593. initGlobalAPI(Vue);
  6594. Object.defineProperty(Vue.prototype, '$isServer', {
  6595. get: isServerRendering
  6596. });
  6597. Object.defineProperty(Vue.prototype, '$ssrContext', {
  6598. get: function get () {
  6599. /* istanbul ignore next */
  6600. return this.$vnode && this.$vnode.ssrContext
  6601. }
  6602. });
  6603. // expose FunctionalRenderContext for ssr runtime helper installation
  6604. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  6605. value: FunctionalRenderContext
  6606. });
  6607. Vue.version = '2.6.11';
  6608. /**
  6609. * https://raw.githubusercontent.com/Tencent/westore/master/packages/westore/utils/diff.js
  6610. */
  6611. var ARRAYTYPE = '[object Array]';
  6612. var OBJECTTYPE = '[object Object]';
  6613. // const FUNCTIONTYPE = '[object Function]'
  6614. function diff(current, pre) {
  6615. var result = {};
  6616. syncKeys(current, pre);
  6617. _diff(current, pre, '', result);
  6618. return result
  6619. }
  6620. function syncKeys(current, pre) {
  6621. if (current === pre) { return }
  6622. var rootCurrentType = type(current);
  6623. var rootPreType = type(pre);
  6624. if (rootCurrentType == OBJECTTYPE && rootPreType == OBJECTTYPE) {
  6625. if(Object.keys(current).length >= Object.keys(pre).length){
  6626. for (var key in pre) {
  6627. var currentValue = current[key];
  6628. if (currentValue === undefined) {
  6629. current[key] = null;
  6630. } else {
  6631. syncKeys(currentValue, pre[key]);
  6632. }
  6633. }
  6634. }
  6635. } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {
  6636. if (current.length >= pre.length) {
  6637. pre.forEach(function (item, index) {
  6638. syncKeys(current[index], item);
  6639. });
  6640. }
  6641. }
  6642. }
  6643. function _diff(current, pre, path, result) {
  6644. if (current === pre) { return }
  6645. var rootCurrentType = type(current);
  6646. var rootPreType = type(pre);
  6647. if (rootCurrentType == OBJECTTYPE) {
  6648. if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {
  6649. setResult(result, path, current);
  6650. } else {
  6651. var loop = function ( key ) {
  6652. var currentValue = current[key];
  6653. var preValue = pre[key];
  6654. var currentType = type(currentValue);
  6655. var preType = type(preValue);
  6656. if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {
  6657. // NOTE 此处将 != 修改为 !==。涉及地方太多恐怕测试不到,如果出现数据对比问题,将其修改回来。
  6658. if (currentValue !== pre[key]) {
  6659. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6660. }
  6661. } else if (currentType == ARRAYTYPE) {
  6662. if (preType != ARRAYTYPE) {
  6663. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6664. } else {
  6665. if (currentValue.length < preValue.length) {
  6666. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6667. } else {
  6668. currentValue.forEach(function (item, index) {
  6669. _diff(item, preValue[index], (path == '' ? '' : path + ".") + key + '[' + index + ']', result);
  6670. });
  6671. }
  6672. }
  6673. } else if (currentType == OBJECTTYPE) {
  6674. if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {
  6675. setResult(result, (path == '' ? '' : path + ".") + key, currentValue);
  6676. } else {
  6677. for (var subKey in currentValue) {
  6678. _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + ".") + key + '.' + subKey, result);
  6679. }
  6680. }
  6681. }
  6682. };
  6683. for (var key in current) loop( key );
  6684. }
  6685. } else if (rootCurrentType == ARRAYTYPE) {
  6686. if (rootPreType != ARRAYTYPE) {
  6687. setResult(result, path, current);
  6688. } else {
  6689. if (current.length < pre.length) {
  6690. setResult(result, path, current);
  6691. } else {
  6692. current.forEach(function (item, index) {
  6693. _diff(item, pre[index], path + '[' + index + ']', result);
  6694. });
  6695. }
  6696. }
  6697. } else {
  6698. setResult(result, path, current);
  6699. }
  6700. }
  6701. function setResult(result, k, v) {
  6702. // if (type(v) != FUNCTIONTYPE) {
  6703. result[k] = v;
  6704. // }
  6705. }
  6706. function type(obj) {
  6707. return Object.prototype.toString.call(obj)
  6708. }
  6709. /* */
  6710. function flushCallbacks$1(vm) {
  6711. if (vm.__next_tick_callbacks && vm.__next_tick_callbacks.length) {
  6712. if (Object({"VUE_APP_NAME":"qc-luckyDraw","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6713. var mpInstance = vm.$scope;
  6714. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6715. ']:flushCallbacks[' + vm.__next_tick_callbacks.length + ']');
  6716. }
  6717. var copies = vm.__next_tick_callbacks.slice(0);
  6718. vm.__next_tick_callbacks.length = 0;
  6719. for (var i = 0; i < copies.length; i++) {
  6720. copies[i]();
  6721. }
  6722. }
  6723. }
  6724. function hasRenderWatcher(vm) {
  6725. return queue.find(function (watcher) { return vm._watcher === watcher; })
  6726. }
  6727. function nextTick$1(vm, cb) {
  6728. //1.nextTick 之前 已 setData 且 setData 还未回调完成
  6729. //2.nextTick 之前存在 render watcher
  6730. if (!vm.__next_tick_pending && !hasRenderWatcher(vm)) {
  6731. if(Object({"VUE_APP_NAME":"qc-luckyDraw","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  6732. var mpInstance = vm.$scope;
  6733. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + vm._uid +
  6734. ']:nextVueTick');
  6735. }
  6736. return nextTick(cb, vm)
  6737. }else{
  6738. if(Object({"VUE_APP_NAME":"qc-luckyDraw","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG){
  6739. var mpInstance$1 = vm.$scope;
  6740. console.log('[' + (+new Date) + '][' + (mpInstance$1.is || mpInstance$1.route) + '][' + vm._uid +
  6741. ']:nextMPTick');
  6742. }
  6743. }
  6744. var _resolve;
  6745. if (!vm.__next_tick_callbacks) {
  6746. vm.__next_tick_callbacks = [];
  6747. }
  6748. vm.__next_tick_callbacks.push(function () {
  6749. if (cb) {
  6750. try {
  6751. cb.call(vm);
  6752. } catch (e) {
  6753. handleError(e, vm, 'nextTick');
  6754. }
  6755. } else if (_resolve) {
  6756. _resolve(vm);
  6757. }
  6758. });
  6759. // $flow-disable-line
  6760. if (!cb && typeof Promise !== 'undefined') {
  6761. return new Promise(function (resolve) {
  6762. _resolve = resolve;
  6763. })
  6764. }
  6765. }
  6766. /* */
  6767. function cloneWithData(vm) {
  6768. // 确保当前 vm 所有数据被同步
  6769. var ret = Object.create(null);
  6770. var dataKeys = [].concat(
  6771. Object.keys(vm._data || {}),
  6772. Object.keys(vm._computedWatchers || {}));
  6773. dataKeys.reduce(function(ret, key) {
  6774. ret[key] = vm[key];
  6775. return ret
  6776. }, ret);
  6777. // vue-composition-api
  6778. var compositionApiState = vm.__composition_api_state__ || vm.__secret_vfa_state__;
  6779. var rawBindings = compositionApiState && compositionApiState.rawBindings;
  6780. if (rawBindings) {
  6781. Object.keys(rawBindings).forEach(function (key) {
  6782. ret[key] = vm[key];
  6783. });
  6784. }
  6785. //TODO 需要把无用数据处理掉,比如 list=>l0 则 list 需要移除,否则多传输一份数据
  6786. Object.assign(ret, vm.$mp.data || {});
  6787. if (
  6788. Array.isArray(vm.$options.behaviors) &&
  6789. vm.$options.behaviors.indexOf('uni://form-field') !== -1
  6790. ) { //form-field
  6791. ret['name'] = vm.name;
  6792. ret['value'] = vm.value;
  6793. }
  6794. return JSON.parse(JSON.stringify(ret))
  6795. }
  6796. var patch = function(oldVnode, vnode) {
  6797. var this$1 = this;
  6798. if (vnode === null) { //destroy
  6799. return
  6800. }
  6801. if (this.mpType === 'page' || this.mpType === 'component') {
  6802. var mpInstance = this.$scope;
  6803. var data = Object.create(null);
  6804. try {
  6805. data = cloneWithData(this);
  6806. } catch (err) {
  6807. console.error(err);
  6808. }
  6809. data.__webviewId__ = mpInstance.data.__webviewId__;
  6810. var mpData = Object.create(null);
  6811. Object.keys(data).forEach(function (key) { //仅同步 data 中有的数据
  6812. mpData[key] = mpInstance.data[key];
  6813. });
  6814. var diffData = this.$shouldDiffData === false ? data : diff(data, mpData);
  6815. if (Object.keys(diffData).length) {
  6816. if (Object({"VUE_APP_NAME":"qc-luckyDraw","VUE_APP_PLATFORM":"mp-weixin","NODE_ENV":"development","BASE_URL":"/"}).VUE_APP_DEBUG) {
  6817. console.log('[' + (+new Date) + '][' + (mpInstance.is || mpInstance.route) + '][' + this._uid +
  6818. ']差量更新',
  6819. JSON.stringify(diffData));
  6820. }
  6821. this.__next_tick_pending = true;
  6822. mpInstance.setData(diffData, function () {
  6823. this$1.__next_tick_pending = false;
  6824. flushCallbacks$1(this$1);
  6825. });
  6826. } else {
  6827. flushCallbacks$1(this);
  6828. }
  6829. }
  6830. };
  6831. /* */
  6832. function createEmptyRender() {
  6833. }
  6834. function mountComponent$1(
  6835. vm,
  6836. el,
  6837. hydrating
  6838. ) {
  6839. if (!vm.mpType) {//main.js 中的 new Vue
  6840. return vm
  6841. }
  6842. if (vm.mpType === 'app') {
  6843. vm.$options.render = createEmptyRender;
  6844. }
  6845. if (!vm.$options.render) {
  6846. vm.$options.render = createEmptyRender;
  6847. if (true) {
  6848. /* istanbul ignore if */
  6849. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  6850. vm.$options.el || el) {
  6851. warn(
  6852. 'You are using the runtime-only build of Vue where the template ' +
  6853. 'compiler is not available. Either pre-compile the templates into ' +
  6854. 'render functions, or use the compiler-included build.',
  6855. vm
  6856. );
  6857. } else {
  6858. warn(
  6859. 'Failed to mount component: template or render function not defined.',
  6860. vm
  6861. );
  6862. }
  6863. }
  6864. }
  6865. !vm._$fallback && callHook(vm, 'beforeMount');
  6866. var updateComponent = function () {
  6867. vm._update(vm._render(), hydrating);
  6868. };
  6869. // we set this to vm._watcher inside the watcher's constructor
  6870. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  6871. // component's mounted hook), which relies on vm._watcher being already defined
  6872. new Watcher(vm, updateComponent, noop, {
  6873. before: function before() {
  6874. if (vm._isMounted && !vm._isDestroyed) {
  6875. callHook(vm, 'beforeUpdate');
  6876. }
  6877. }
  6878. }, true /* isRenderWatcher */);
  6879. hydrating = false;
  6880. return vm
  6881. }
  6882. /* */
  6883. function renderClass (
  6884. staticClass,
  6885. dynamicClass
  6886. ) {
  6887. if (isDef(staticClass) || isDef(dynamicClass)) {
  6888. return concat(staticClass, stringifyClass(dynamicClass))
  6889. }
  6890. /* istanbul ignore next */
  6891. return ''
  6892. }
  6893. function concat (a, b) {
  6894. return a ? b ? (a + ' ' + b) : a : (b || '')
  6895. }
  6896. function stringifyClass (value) {
  6897. if (Array.isArray(value)) {
  6898. return stringifyArray(value)
  6899. }
  6900. if (isObject(value)) {
  6901. return stringifyObject(value)
  6902. }
  6903. if (typeof value === 'string') {
  6904. return value
  6905. }
  6906. /* istanbul ignore next */
  6907. return ''
  6908. }
  6909. function stringifyArray (value) {
  6910. var res = '';
  6911. var stringified;
  6912. for (var i = 0, l = value.length; i < l; i++) {
  6913. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  6914. if (res) { res += ' '; }
  6915. res += stringified;
  6916. }
  6917. }
  6918. return res
  6919. }
  6920. function stringifyObject (value) {
  6921. var res = '';
  6922. for (var key in value) {
  6923. if (value[key]) {
  6924. if (res) { res += ' '; }
  6925. res += key;
  6926. }
  6927. }
  6928. return res
  6929. }
  6930. /* */
  6931. var parseStyleText = cached(function (cssText) {
  6932. var res = {};
  6933. var listDelimiter = /;(?![^(]*\))/g;
  6934. var propertyDelimiter = /:(.+)/;
  6935. cssText.split(listDelimiter).forEach(function (item) {
  6936. if (item) {
  6937. var tmp = item.split(propertyDelimiter);
  6938. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  6939. }
  6940. });
  6941. return res
  6942. });
  6943. // normalize possible array / string values into Object
  6944. function normalizeStyleBinding (bindingStyle) {
  6945. if (Array.isArray(bindingStyle)) {
  6946. return toObject(bindingStyle)
  6947. }
  6948. if (typeof bindingStyle === 'string') {
  6949. return parseStyleText(bindingStyle)
  6950. }
  6951. return bindingStyle
  6952. }
  6953. /* */
  6954. var MP_METHODS = ['createSelectorQuery', 'createIntersectionObserver', 'selectAllComponents', 'selectComponent'];
  6955. function getTarget(obj, path) {
  6956. var parts = path.split('.');
  6957. var key = parts[0];
  6958. if (key.indexOf('__$n') === 0) { //number index
  6959. key = parseInt(key.replace('__$n', ''));
  6960. }
  6961. if (parts.length === 1) {
  6962. return obj[key]
  6963. }
  6964. return getTarget(obj[key], parts.slice(1).join('.'))
  6965. }
  6966. function internalMixin(Vue) {
  6967. Vue.config.errorHandler = function(err, vm, info) {
  6968. Vue.util.warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  6969. console.error(err);
  6970. /* eslint-disable no-undef */
  6971. var app = typeof getApp === 'function' && getApp();
  6972. if (app && app.onError) {
  6973. app.onError(err);
  6974. }
  6975. };
  6976. var oldEmit = Vue.prototype.$emit;
  6977. Vue.prototype.$emit = function(event) {
  6978. if (this.$scope && event) {
  6979. this.$scope['triggerEvent'](event, {
  6980. __args__: toArray(arguments, 1)
  6981. });
  6982. }
  6983. return oldEmit.apply(this, arguments)
  6984. };
  6985. Vue.prototype.$nextTick = function(fn) {
  6986. return nextTick$1(this, fn)
  6987. };
  6988. MP_METHODS.forEach(function (method) {
  6989. Vue.prototype[method] = function(args) {
  6990. if (this.$scope && this.$scope[method]) {
  6991. return this.$scope[method](args)
  6992. }
  6993. // mp-alipay
  6994. if (typeof my === 'undefined') {
  6995. return
  6996. }
  6997. if (method === 'createSelectorQuery') {
  6998. /* eslint-disable no-undef */
  6999. return my.createSelectorQuery(args)
  7000. } else if (method === 'createIntersectionObserver') {
  7001. /* eslint-disable no-undef */
  7002. return my.createIntersectionObserver(args)
  7003. }
  7004. // TODO mp-alipay 暂不支持 selectAllComponents,selectComponent
  7005. };
  7006. });
  7007. Vue.prototype.__init_provide = initProvide;
  7008. Vue.prototype.__init_injections = initInjections;
  7009. Vue.prototype.__call_hook = function(hook, args) {
  7010. var vm = this;
  7011. // #7573 disable dep collection when invoking lifecycle hooks
  7012. pushTarget();
  7013. var handlers = vm.$options[hook];
  7014. var info = hook + " hook";
  7015. var ret;
  7016. if (handlers) {
  7017. for (var i = 0, j = handlers.length; i < j; i++) {
  7018. ret = invokeWithErrorHandling(handlers[i], vm, args ? [args] : null, vm, info);
  7019. }
  7020. }
  7021. if (vm._hasHookEvent) {
  7022. vm.$emit('hook:' + hook, args);
  7023. }
  7024. popTarget();
  7025. return ret
  7026. };
  7027. Vue.prototype.__set_model = function(target, key, value, modifiers) {
  7028. if (Array.isArray(modifiers)) {
  7029. if (modifiers.indexOf('trim') !== -1) {
  7030. value = value.trim();
  7031. }
  7032. if (modifiers.indexOf('number') !== -1) {
  7033. value = this._n(value);
  7034. }
  7035. }
  7036. if (!target) {
  7037. target = this;
  7038. }
  7039. target[key] = value;
  7040. };
  7041. Vue.prototype.__set_sync = function(target, key, value) {
  7042. if (!target) {
  7043. target = this;
  7044. }
  7045. target[key] = value;
  7046. };
  7047. Vue.prototype.__get_orig = function(item) {
  7048. if (isPlainObject(item)) {
  7049. return item['$orig'] || item
  7050. }
  7051. return item
  7052. };
  7053. Vue.prototype.__get_value = function(dataPath, target) {
  7054. return getTarget(target || this, dataPath)
  7055. };
  7056. Vue.prototype.__get_class = function(dynamicClass, staticClass) {
  7057. return renderClass(staticClass, dynamicClass)
  7058. };
  7059. Vue.prototype.__get_style = function(dynamicStyle, staticStyle) {
  7060. if (!dynamicStyle && !staticStyle) {
  7061. return ''
  7062. }
  7063. var dynamicStyleObj = normalizeStyleBinding(dynamicStyle);
  7064. var styleObj = staticStyle ? extend(staticStyle, dynamicStyleObj) : dynamicStyleObj;
  7065. return Object.keys(styleObj).map(function (name) { return ((hyphenate(name)) + ":" + (styleObj[name])); }).join(';')
  7066. };
  7067. Vue.prototype.__map = function(val, iteratee) {
  7068. //TODO 暂不考虑 string
  7069. var ret, i, l, keys, key;
  7070. if (Array.isArray(val)) {
  7071. ret = new Array(val.length);
  7072. for (i = 0, l = val.length; i < l; i++) {
  7073. ret[i] = iteratee(val[i], i);
  7074. }
  7075. return ret
  7076. } else if (isObject(val)) {
  7077. keys = Object.keys(val);
  7078. ret = Object.create(null);
  7079. for (i = 0, l = keys.length; i < l; i++) {
  7080. key = keys[i];
  7081. ret[key] = iteratee(val[key], key, i);
  7082. }
  7083. return ret
  7084. } else if (typeof val === 'number') {
  7085. ret = new Array(val);
  7086. for (i = 0, l = val; i < l; i++) {
  7087. // 第一个参数暂时仍和小程序一致
  7088. ret[i] = iteratee(i, i);
  7089. }
  7090. return ret
  7091. }
  7092. return []
  7093. };
  7094. }
  7095. /* */
  7096. var LIFECYCLE_HOOKS$1 = [
  7097. //App
  7098. 'onLaunch',
  7099. 'onShow',
  7100. 'onHide',
  7101. 'onUniNViewMessage',
  7102. 'onPageNotFound',
  7103. 'onThemeChange',
  7104. 'onError',
  7105. 'onUnhandledRejection',
  7106. //Page
  7107. 'onInit',
  7108. 'onLoad',
  7109. // 'onShow',
  7110. 'onReady',
  7111. // 'onHide',
  7112. 'onUnload',
  7113. 'onPullDownRefresh',
  7114. 'onReachBottom',
  7115. 'onTabItemTap',
  7116. 'onAddToFavorites',
  7117. 'onShareTimeline',
  7118. 'onShareAppMessage',
  7119. 'onResize',
  7120. 'onPageScroll',
  7121. 'onNavigationBarButtonTap',
  7122. 'onBackPress',
  7123. 'onNavigationBarSearchInputChanged',
  7124. 'onNavigationBarSearchInputConfirmed',
  7125. 'onNavigationBarSearchInputClicked',
  7126. //Component
  7127. // 'onReady', // 兼容旧版本,应该移除该事件
  7128. 'onPageShow',
  7129. 'onPageHide',
  7130. 'onPageResize'
  7131. ];
  7132. function lifecycleMixin$1(Vue) {
  7133. //fixed vue-class-component
  7134. var oldExtend = Vue.extend;
  7135. Vue.extend = function(extendOptions) {
  7136. extendOptions = extendOptions || {};
  7137. var methods = extendOptions.methods;
  7138. if (methods) {
  7139. Object.keys(methods).forEach(function (methodName) {
  7140. if (LIFECYCLE_HOOKS$1.indexOf(methodName)!==-1) {
  7141. extendOptions[methodName] = methods[methodName];
  7142. delete methods[methodName];
  7143. }
  7144. });
  7145. }
  7146. return oldExtend.call(this, extendOptions)
  7147. };
  7148. var strategies = Vue.config.optionMergeStrategies;
  7149. var mergeHook = strategies.created;
  7150. LIFECYCLE_HOOKS$1.forEach(function (hook) {
  7151. strategies[hook] = mergeHook;
  7152. });
  7153. Vue.prototype.__lifecycle_hooks__ = LIFECYCLE_HOOKS$1;
  7154. }
  7155. /* */
  7156. // install platform patch function
  7157. Vue.prototype.__patch__ = patch;
  7158. // public mount method
  7159. Vue.prototype.$mount = function(
  7160. el ,
  7161. hydrating
  7162. ) {
  7163. return mountComponent$1(this, el, hydrating)
  7164. };
  7165. lifecycleMixin$1(Vue);
  7166. internalMixin(Vue);
  7167. /* */
  7168. /* harmony default export */ __webpack_exports__["default"] = (Vue);
  7169. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ 3)))
  7170. /***/ }),
  7171. /* 3 */
  7172. /*!***********************************!*\
  7173. !*** (webpack)/buildin/global.js ***!
  7174. \***********************************/
  7175. /*! no static exports found */
  7176. /***/ (function(module, exports) {
  7177. var g;
  7178. // This works in non-strict mode
  7179. g = (function() {
  7180. return this;
  7181. })();
  7182. try {
  7183. // This works if eval is allowed (see CSP)
  7184. g = g || new Function("return this")();
  7185. } catch (e) {
  7186. // This works if the window reference is available
  7187. if (typeof window === "object") g = window;
  7188. }
  7189. // g can still be undefined, but nothing to do about it...
  7190. // We return undefined, instead of nothing here, so it's
  7191. // easier to handle this case. if(!global) { ...}
  7192. module.exports = g;
  7193. /***/ }),
  7194. /* 4 */
  7195. /*!*************************************************************!*\
  7196. !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***!
  7197. \*************************************************************/
  7198. /*! no static exports found */
  7199. /***/ (function(module, exports, __webpack_require__) {
  7200. "use strict";
  7201. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.compileI18nJsonStr = compileI18nJsonStr;exports.hasI18nJson = hasI18nJson;exports.initVueI18n = initVueI18n;exports.isI18nStr = isI18nStr;exports.normalizeLocale = normalizeLocale;exports.parseI18nJson = parseI18nJson;exports.isString = exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var isArray = Array.isArray;
  7202. var isObject = function isObject(val) {return val !== null && typeof val === 'object';};
  7203. var defaultDelimiters = ['{', '}'];var
  7204. BaseFormatter = /*#__PURE__*/function () {
  7205. function BaseFormatter() {_classCallCheck(this, BaseFormatter);
  7206. this._caches = Object.create(null);
  7207. }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate(
  7208. message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters;
  7209. if (!values) {
  7210. return [message];
  7211. }
  7212. var tokens = this._caches[message];
  7213. if (!tokens) {
  7214. tokens = parse(message, delimiters);
  7215. this._caches[message] = tokens;
  7216. }
  7217. return compile(tokens, values);
  7218. } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter;
  7219. var RE_TOKEN_LIST_VALUE = /^(?:\d)+/;
  7220. var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/;
  7221. function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1];
  7222. var tokens = [];
  7223. var position = 0;
  7224. var text = '';
  7225. while (position < format.length) {
  7226. var char = format[position++];
  7227. if (char === startDelimiter) {
  7228. if (text) {
  7229. tokens.push({ type: 'text', value: text });
  7230. }
  7231. text = '';
  7232. var sub = '';
  7233. char = format[position++];
  7234. while (char !== undefined && char !== endDelimiter) {
  7235. sub += char;
  7236. char = format[position++];
  7237. }
  7238. var isClosed = char === endDelimiter;
  7239. var type = RE_TOKEN_LIST_VALUE.test(sub) ?
  7240. 'list' :
  7241. isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ?
  7242. 'named' :
  7243. 'unknown';
  7244. tokens.push({ value: sub, type: type });
  7245. }
  7246. // else if (char === '%') {
  7247. // // when found rails i18n syntax, skip text capture
  7248. // if (format[position] !== '{') {
  7249. // text += char
  7250. // }
  7251. // }
  7252. else {
  7253. text += char;
  7254. }
  7255. }
  7256. text && tokens.push({ type: 'text', value: text });
  7257. return tokens;
  7258. }
  7259. function compile(tokens, values) {
  7260. var compiled = [];
  7261. var index = 0;
  7262. var mode = isArray(values) ?
  7263. 'list' :
  7264. isObject(values) ?
  7265. 'named' :
  7266. 'unknown';
  7267. if (mode === 'unknown') {
  7268. return compiled;
  7269. }
  7270. while (index < tokens.length) {
  7271. var token = tokens[index];
  7272. switch (token.type) {
  7273. case 'text':
  7274. compiled.push(token.value);
  7275. break;
  7276. case 'list':
  7277. compiled.push(values[parseInt(token.value, 10)]);
  7278. break;
  7279. case 'named':
  7280. if (mode === 'named') {
  7281. compiled.push(values[token.value]);
  7282. } else
  7283. {
  7284. if (true) {
  7285. console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!"));
  7286. }
  7287. }
  7288. break;
  7289. case 'unknown':
  7290. if (true) {
  7291. console.warn("Detect 'unknown' type of token!");
  7292. }
  7293. break;}
  7294. index++;
  7295. }
  7296. return compiled;
  7297. }
  7298. var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS;
  7299. var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT;
  7300. var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN;
  7301. var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR;
  7302. var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES;
  7303. var hasOwnProperty = Object.prototype.hasOwnProperty;
  7304. var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);};
  7305. var defaultFormatter = new BaseFormatter();
  7306. function include(str, parts) {
  7307. return !!parts.find(function (part) {return str.indexOf(part) !== -1;});
  7308. }
  7309. function startsWith(str, parts) {
  7310. return parts.find(function (part) {return str.indexOf(part) === 0;});
  7311. }
  7312. function normalizeLocale(locale, messages) {
  7313. if (!locale) {
  7314. return;
  7315. }
  7316. locale = locale.trim().replace(/_/g, '-');
  7317. if (messages && messages[locale]) {
  7318. return locale;
  7319. }
  7320. locale = locale.toLowerCase();
  7321. if (locale.indexOf('zh') === 0) {
  7322. if (locale.indexOf('-hans') !== -1) {
  7323. return LOCALE_ZH_HANS;
  7324. }
  7325. if (locale.indexOf('-hant') !== -1) {
  7326. return LOCALE_ZH_HANT;
  7327. }
  7328. if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) {
  7329. return LOCALE_ZH_HANT;
  7330. }
  7331. return LOCALE_ZH_HANS;
  7332. }
  7333. var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]);
  7334. if (lang) {
  7335. return lang;
  7336. }
  7337. }var
  7338. I18n = /*#__PURE__*/function () {
  7339. function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n);
  7340. this.locale = LOCALE_EN;
  7341. this.fallbackLocale = LOCALE_EN;
  7342. this.message = {};
  7343. this.messages = {};
  7344. this.watchers = [];
  7345. if (fallbackLocale) {
  7346. this.fallbackLocale = fallbackLocale;
  7347. }
  7348. this.formater = formater || defaultFormatter;
  7349. this.messages = messages || {};
  7350. this.setLocale(locale || LOCALE_EN);
  7351. if (watcher) {
  7352. this.watchLocale(watcher);
  7353. }
  7354. }_createClass(I18n, [{ key: "setLocale", value: function setLocale(
  7355. locale) {var _this = this;
  7356. var oldLocale = this.locale;
  7357. this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale;
  7358. if (!this.messages[this.locale]) {
  7359. // 可能初始化时不存在
  7360. this.messages[this.locale] = {};
  7361. }
  7362. this.message = this.messages[this.locale];
  7363. // 仅发生变化时,通知
  7364. if (oldLocale !== this.locale) {
  7365. this.watchers.forEach(function (watcher) {
  7366. watcher(_this.locale, oldLocale);
  7367. });
  7368. }
  7369. } }, { key: "getLocale", value: function getLocale()
  7370. {
  7371. return this.locale;
  7372. } }, { key: "watchLocale", value: function watchLocale(
  7373. fn) {var _this2 = this;
  7374. var index = this.watchers.push(fn) - 1;
  7375. return function () {
  7376. _this2.watchers.splice(index, 1);
  7377. };
  7378. } }, { key: "add", value: function add(
  7379. locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  7380. var curMessages = this.messages[locale];
  7381. if (curMessages) {
  7382. if (override) {
  7383. Object.assign(curMessages, message);
  7384. } else
  7385. {
  7386. Object.keys(message).forEach(function (key) {
  7387. if (!hasOwn(curMessages, key)) {
  7388. curMessages[key] = message[key];
  7389. }
  7390. });
  7391. }
  7392. } else
  7393. {
  7394. this.messages[locale] = message;
  7395. }
  7396. } }, { key: "f", value: function f(
  7397. message, values, delimiters) {
  7398. return this.formater.interpolate(message, values, delimiters).join('');
  7399. } }, { key: "t", value: function t(
  7400. key, locale, values) {
  7401. var message = this.message;
  7402. if (typeof locale === 'string') {
  7403. locale = normalizeLocale(locale, this.messages);
  7404. locale && (message = this.messages[locale]);
  7405. } else
  7406. {
  7407. values = locale;
  7408. }
  7409. if (!hasOwn(message, key)) {
  7410. console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default."));
  7411. return key;
  7412. }
  7413. return this.formater.interpolate(message[key], values).join('');
  7414. } }]);return I18n;}();exports.I18n = I18n;
  7415. var ignoreVueI18n = true;
  7416. function watchAppLocale(appVm, i18n) {
  7417. appVm.$watch(function () {return appVm.$locale;}, function (newLocale) {
  7418. i18n.setLocale(newLocale);
  7419. });
  7420. }
  7421. function initVueI18n(locale) {var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;var watcher = arguments.length > 3 ? arguments[3] : undefined;
  7422. // 兼容旧版本入参
  7423. if (typeof locale !== 'string') {var _ref4 =
  7424. [
  7425. messages,
  7426. locale];locale = _ref4[0];messages = _ref4[1];
  7427. }
  7428. if (typeof locale !== 'string') {
  7429. locale =
  7430. typeof uni !== 'undefined' && uni.getLocale && uni.getLocale() ||
  7431. LOCALE_EN;
  7432. }
  7433. if (typeof fallbackLocale !== 'string') {
  7434. fallbackLocale =
  7435. typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale ||
  7436. LOCALE_EN;
  7437. }
  7438. var i18n = new I18n({
  7439. locale: locale,
  7440. fallbackLocale: fallbackLocale,
  7441. messages: messages,
  7442. watcher: watcher });
  7443. var _t = function t(key, values) {
  7444. if (typeof getApp !== 'function') {
  7445. // app view
  7446. /* eslint-disable no-func-assign */
  7447. _t = function t(key, values) {
  7448. return i18n.t(key, values);
  7449. };
  7450. } else
  7451. {
  7452. var appVm = getApp().$vm;
  7453. watchAppLocale(appVm, i18n);
  7454. if (!appVm.$t || !appVm.$i18n || ignoreVueI18n) {
  7455. // if (!locale) {
  7456. // i18n.setLocale(getDefaultLocale())
  7457. // }
  7458. /* eslint-disable no-func-assign */
  7459. _t = function t(key, values) {
  7460. // 触发响应式
  7461. appVm.$locale;
  7462. return i18n.t(key, values);
  7463. };
  7464. } else
  7465. {
  7466. /* eslint-disable no-func-assign */
  7467. _t = function t(key, values) {
  7468. var $i18n = appVm.$i18n;
  7469. var silentTranslationWarn = $i18n.silentTranslationWarn;
  7470. $i18n.silentTranslationWarn = true;
  7471. var msg = appVm.$t(key, values);
  7472. $i18n.silentTranslationWarn = silentTranslationWarn;
  7473. if (msg !== key) {
  7474. return msg;
  7475. }
  7476. return i18n.t(key, $i18n.locale, values);
  7477. };
  7478. }
  7479. }
  7480. return _t(key, values);
  7481. };
  7482. return {
  7483. i18n: i18n,
  7484. f: function f(message, values, delimiters) {
  7485. return i18n.f(message, values, delimiters);
  7486. },
  7487. t: function t(key, values) {
  7488. return _t(key, values);
  7489. },
  7490. add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
  7491. return i18n.add(locale, message, override);
  7492. },
  7493. watch: function watch(fn) {
  7494. return i18n.watchLocale(fn);
  7495. },
  7496. getLocale: function getLocale() {
  7497. return i18n.getLocale();
  7498. },
  7499. setLocale: function setLocale(newLocale) {
  7500. return i18n.setLocale(newLocale);
  7501. } };
  7502. }
  7503. var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString;
  7504. var formater;
  7505. function hasI18nJson(jsonObj, delimiters) {
  7506. if (!formater) {
  7507. formater = new BaseFormatter();
  7508. }
  7509. return walkJsonObj(jsonObj, function (jsonObj, key) {
  7510. var value = jsonObj[key];
  7511. if (isString(value)) {
  7512. if (isI18nStr(value, delimiters)) {
  7513. return true;
  7514. }
  7515. } else
  7516. {
  7517. return hasI18nJson(value, delimiters);
  7518. }
  7519. });
  7520. }
  7521. function parseI18nJson(jsonObj, values, delimiters) {
  7522. if (!formater) {
  7523. formater = new BaseFormatter();
  7524. }
  7525. walkJsonObj(jsonObj, function (jsonObj, key) {
  7526. var value = jsonObj[key];
  7527. if (isString(value)) {
  7528. if (isI18nStr(value, delimiters)) {
  7529. jsonObj[key] = compileStr(value, values, delimiters);
  7530. }
  7531. } else
  7532. {
  7533. parseI18nJson(value, values, delimiters);
  7534. }
  7535. });
  7536. return jsonObj;
  7537. }
  7538. function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters;
  7539. if (!isI18nStr(jsonStr, delimiters)) {
  7540. return jsonStr;
  7541. }
  7542. if (!formater) {
  7543. formater = new BaseFormatter();
  7544. }
  7545. var localeValues = [];
  7546. Object.keys(locales).forEach(function (name) {
  7547. if (name !== locale) {
  7548. localeValues.push({
  7549. locale: name,
  7550. values: locales[name] });
  7551. }
  7552. });
  7553. localeValues.unshift({ locale: locale, values: locales[locale] });
  7554. try {
  7555. return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2);
  7556. }
  7557. catch (e) {}
  7558. return jsonStr;
  7559. }
  7560. function isI18nStr(value, delimiters) {
  7561. return value.indexOf(delimiters[0]) > -1;
  7562. }
  7563. function compileStr(value, values, delimiters) {
  7564. return formater.interpolate(value, values, delimiters).join('');
  7565. }
  7566. function compileValue(jsonObj, key, localeValues, delimiters) {
  7567. var value = jsonObj[key];
  7568. if (isString(value)) {
  7569. // 存在国际化
  7570. if (isI18nStr(value, delimiters)) {
  7571. jsonObj[key] = compileStr(value, localeValues[0].values, delimiters);
  7572. if (localeValues.length > 1) {
  7573. // 格式化国际化语言
  7574. var valueLocales = jsonObj[key + 'Locales'] = {};
  7575. localeValues.forEach(function (localValue) {
  7576. valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters);
  7577. });
  7578. }
  7579. }
  7580. } else
  7581. {
  7582. compileJsonObj(value, localeValues, delimiters);
  7583. }
  7584. }
  7585. function compileJsonObj(jsonObj, localeValues, delimiters) {
  7586. walkJsonObj(jsonObj, function (jsonObj, key) {
  7587. compileValue(jsonObj, key, localeValues, delimiters);
  7588. });
  7589. return jsonObj;
  7590. }
  7591. function walkJsonObj(jsonObj, walk) {
  7592. if (isArray(jsonObj)) {
  7593. for (var i = 0; i < jsonObj.length; i++) {
  7594. if (walk(jsonObj, i)) {
  7595. return true;
  7596. }
  7597. }
  7598. } else
  7599. if (isObject(jsonObj)) {
  7600. for (var key in jsonObj) {
  7601. if (walk(jsonObj, key)) {
  7602. return true;
  7603. }
  7604. }
  7605. }
  7606. return false;
  7607. }
  7608. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  7609. /***/ }),
  7610. /* 5 */
  7611. /*!*************************************************************************!*\
  7612. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/pages.json ***!
  7613. \*************************************************************************/
  7614. /*! no static exports found */
  7615. /***/ (function(module, exports) {
  7616. /***/ }),
  7617. /* 6 */,
  7618. /* 7 */,
  7619. /* 8 */,
  7620. /* 9 */,
  7621. /* 10 */,
  7622. /* 11 */
  7623. /*!**********************************************************************************************************!*\
  7624. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js ***!
  7625. \**********************************************************************************************************/
  7626. /*! exports provided: default */
  7627. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  7628. "use strict";
  7629. __webpack_require__.r(__webpack_exports__);
  7630. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; });
  7631. /* globals __VUE_SSR_CONTEXT__ */
  7632. // IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
  7633. // This module is a runtime utility for cleaner component module output and will
  7634. // be included in the final webpack user bundle.
  7635. function normalizeComponent (
  7636. scriptExports,
  7637. render,
  7638. staticRenderFns,
  7639. functionalTemplate,
  7640. injectStyles,
  7641. scopeId,
  7642. moduleIdentifier, /* server only */
  7643. shadowMode, /* vue-cli only */
  7644. components, // fixed by xxxxxx auto components
  7645. renderjs // fixed by xxxxxx renderjs
  7646. ) {
  7647. // Vue.extend constructor export interop
  7648. var options = typeof scriptExports === 'function'
  7649. ? scriptExports.options
  7650. : scriptExports
  7651. // fixed by xxxxxx auto components
  7652. if (components) {
  7653. if (!options.components) {
  7654. options.components = {}
  7655. }
  7656. var hasOwn = Object.prototype.hasOwnProperty
  7657. for (var name in components) {
  7658. if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) {
  7659. options.components[name] = components[name]
  7660. }
  7661. }
  7662. }
  7663. // fixed by xxxxxx renderjs
  7664. if (renderjs) {
  7665. (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() {
  7666. this[renderjs.__module] = this
  7667. });
  7668. (options.mixins || (options.mixins = [])).push(renderjs)
  7669. }
  7670. // render functions
  7671. if (render) {
  7672. options.render = render
  7673. options.staticRenderFns = staticRenderFns
  7674. options._compiled = true
  7675. }
  7676. // functional template
  7677. if (functionalTemplate) {
  7678. options.functional = true
  7679. }
  7680. // scopedId
  7681. if (scopeId) {
  7682. options._scopeId = 'data-v-' + scopeId
  7683. }
  7684. var hook
  7685. if (moduleIdentifier) { // server build
  7686. hook = function (context) {
  7687. // 2.3 injection
  7688. context =
  7689. context || // cached call
  7690. (this.$vnode && this.$vnode.ssrContext) || // stateful
  7691. (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
  7692. // 2.2 with runInNewContext: true
  7693. if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
  7694. context = __VUE_SSR_CONTEXT__
  7695. }
  7696. // inject component styles
  7697. if (injectStyles) {
  7698. injectStyles.call(this, context)
  7699. }
  7700. // register component module identifier for async chunk inferrence
  7701. if (context && context._registeredComponents) {
  7702. context._registeredComponents.add(moduleIdentifier)
  7703. }
  7704. }
  7705. // used by ssr in case component is cached and beforeCreate
  7706. // never gets called
  7707. options._ssrRegister = hook
  7708. } else if (injectStyles) {
  7709. hook = shadowMode
  7710. ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) }
  7711. : injectStyles
  7712. }
  7713. if (hook) {
  7714. if (options.functional) {
  7715. // for template-only hot-reload because in that case the render fn doesn't
  7716. // go through the normalizer
  7717. options._injectStyles = hook
  7718. // register for functioal component in vue file
  7719. var originalRender = options.render
  7720. options.render = function renderWithStyleInjection (h, context) {
  7721. hook.call(context)
  7722. return originalRender(h, context)
  7723. }
  7724. } else {
  7725. // inject component registration as beforeCreate hook
  7726. var existing = options.beforeCreate
  7727. options.beforeCreate = existing
  7728. ? [].concat(existing, hook)
  7729. : [hook]
  7730. }
  7731. }
  7732. return {
  7733. exports: scriptExports,
  7734. options: options
  7735. }
  7736. }
  7737. /***/ }),
  7738. /* 12 */
  7739. /*!********************************************************************************!*\
  7740. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/index.js ***!
  7741. \********************************************************************************/
  7742. /*! no static exports found */
  7743. /***/ (function(module, exports, __webpack_require__) {
  7744. "use strict";
  7745. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;
  7746. var _mixin = _interopRequireDefault(__webpack_require__(/*! ./libs/mixin/mixin.js */ 13));
  7747. var _request = _interopRequireDefault(__webpack_require__(/*! ./libs/request */ 14));
  7748. var _queryParams = _interopRequireDefault(__webpack_require__(/*! ./libs/function/queryParams.js */ 18));
  7749. var _route = _interopRequireDefault(__webpack_require__(/*! ./libs/function/route.js */ 19));
  7750. var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFormat.js */ 23));
  7751. var _timeFrom = _interopRequireDefault(__webpack_require__(/*! ./libs/function/timeFrom.js */ 24));
  7752. var _colorGradient = _interopRequireDefault(__webpack_require__(/*! ./libs/function/colorGradient.js */ 25));
  7753. var _guid = _interopRequireDefault(__webpack_require__(/*! ./libs/function/guid.js */ 26));
  7754. var _color = _interopRequireDefault(__webpack_require__(/*! ./libs/function/color.js */ 27));
  7755. var _type2icon = _interopRequireDefault(__webpack_require__(/*! ./libs/function/type2icon.js */ 28));
  7756. var _randomArray = _interopRequireDefault(__webpack_require__(/*! ./libs/function/randomArray.js */ 29));
  7757. var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepClone.js */ 16));
  7758. var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ./libs/function/deepMerge.js */ 15));
  7759. var _addUnit = _interopRequireDefault(__webpack_require__(/*! ./libs/function/addUnit.js */ 30));
  7760. var _test = _interopRequireDefault(__webpack_require__(/*! ./libs/function/test.js */ 17));
  7761. var _random = _interopRequireDefault(__webpack_require__(/*! ./libs/function/random.js */ 31));
  7762. var _trim = _interopRequireDefault(__webpack_require__(/*! ./libs/function/trim.js */ 32));
  7763. var _toast = _interopRequireDefault(__webpack_require__(/*! ./libs/function/toast.js */ 33));
  7764. var _getParent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/getParent.js */ 34));
  7765. var _$parent = _interopRequireDefault(__webpack_require__(/*! ./libs/function/$parent.js */ 35));
  7766. var _sys = __webpack_require__(/*! ./libs/function/sys.js */ 36);
  7767. var _debounce = _interopRequireDefault(__webpack_require__(/*! ./libs/function/debounce.js */ 37));
  7768. var _throttle = _interopRequireDefault(__webpack_require__(/*! ./libs/function/throttle.js */ 38));
  7769. var _config = _interopRequireDefault(__webpack_require__(/*! ./libs/config/config.js */ 39));
  7770. var _zIndex = _interopRequireDefault(__webpack_require__(/*! ./libs/config/zIndex.js */ 40));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };} // 引入全局mixin
  7771. // 引入关于是否mixin集成小程序分享的配置
  7772. // import wxshare from './libs/mixin/mpShare.js'
  7773. // 全局挂载引入http相关请求拦截插件
  7774. function wranning(str) {// 开发环境进行信息输出,主要是一些报错信息
  7775. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  7776. // 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
  7777. if (true) {console.warn(str);}} // 尝试判断在根目录的/store中是否有$u.mixin.js,此文件uView默认为需要挂在到全局的vuex的state变量
  7778. // HX2.6.11版本,放到try中,控制台依然会警告,暂时不用此方式,
  7779. // let vuexStore = {};
  7780. // try {
  7781. // vuexStore = require("@/store/$u.mixin.js");
  7782. // } catch (e) {
  7783. // //TODO handle the exception
  7784. // }
  7785. // post类型对象参数转为get类型url参数
  7786. var $u = { queryParams: _queryParams.default, route: _route.default, timeFormat: _timeFormat.default, date: _timeFormat.default, // 另名date
  7787. timeFrom: _timeFrom.default, colorGradient: _colorGradient.default.colorGradient, colorToRgba: _colorGradient.default.colorToRgba, guid: _guid.default, color: _color.default, sys: _sys.sys, os: _sys.os, type2icon: _type2icon.default, randomArray: _randomArray.default, wranning: wranning, get: _request.default.get,
  7788. post: _request.default.post,
  7789. put: _request.default.put,
  7790. 'delete': _request.default.delete,
  7791. hexToRgb: _colorGradient.default.hexToRgb,
  7792. rgbToHex: _colorGradient.default.rgbToHex,
  7793. test: _test.default,
  7794. random: _random.default,
  7795. deepClone: _deepClone.default,
  7796. deepMerge: _deepMerge.default,
  7797. getParent: _getParent.default,
  7798. $parent: _$parent.default,
  7799. addUnit: _addUnit.default,
  7800. trim: _trim.default,
  7801. type: ['primary', 'success', 'error', 'warning', 'info'],
  7802. http: _request.default,
  7803. toast: _toast.default,
  7804. config: _config.default, // uView配置信息相关,比如版本号
  7805. zIndex: _zIndex.default,
  7806. debounce: _debounce.default,
  7807. throttle: _throttle.default };
  7808. // $u挂载到uni对象上
  7809. uni.$u = $u;
  7810. var install = function install(Vue) {
  7811. Vue.mixin(_mixin.default);
  7812. if (Vue.prototype.openShare) {
  7813. Vue.mixin(mpShare);
  7814. }
  7815. // Vue.mixin(vuexStore);
  7816. // 时间格式化,同时两个名称,date和timeFormat
  7817. Vue.filter('timeFormat', function (timestamp, format) {
  7818. return (0, _timeFormat.default)(timestamp, format);
  7819. });
  7820. Vue.filter('date', function (timestamp, format) {
  7821. return (0, _timeFormat.default)(timestamp, format);
  7822. });
  7823. // 将多久以前的方法,注入到全局过滤器
  7824. Vue.filter('timeFrom', function (timestamp, format) {
  7825. return (0, _timeFrom.default)(timestamp, format);
  7826. });
  7827. Vue.prototype.$u = $u;
  7828. };var _default =
  7829. {
  7830. install: install };exports.default = _default;
  7831. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  7832. /***/ }),
  7833. /* 13 */
  7834. /*!*******************************************************************************************!*\
  7835. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/mixin/mixin.js ***!
  7836. \*******************************************************************************************/
  7837. /*! no static exports found */
  7838. /***/ (function(module, exports, __webpack_require__) {
  7839. /* WEBPACK VAR INJECTION */(function(uni) {module.exports = {
  7840. data: function data() {
  7841. return {};
  7842. },
  7843. onLoad: function onLoad() {
  7844. // getRect挂载到$u上,因为这方法需要使用in(this),所以无法把它独立成一个单独的文件导出
  7845. this.$u.getRect = this.$uGetRect;
  7846. },
  7847. methods: {
  7848. // 查询节点信息
  7849. // 目前此方法在支付宝小程序中无法获取组件跟接点的尺寸,为支付宝的bug(2020-07-21)
  7850. // 解决办法为在组件根部再套一个没有任何作用的view元素
  7851. $uGetRect: function $uGetRect(selector, all) {var _this = this;
  7852. return new Promise(function (resolve) {
  7853. uni.createSelectorQuery().
  7854. in(_this)[all ? 'selectAll' : 'select'](selector).
  7855. boundingClientRect(function (rect) {
  7856. if (all && Array.isArray(rect) && rect.length) {
  7857. resolve(rect);
  7858. }
  7859. if (!all && rect) {
  7860. resolve(rect);
  7861. }
  7862. }).
  7863. exec();
  7864. });
  7865. },
  7866. getParentData: function getParentData() {var _this2 = this;var parentName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  7867. // 避免在created中去定义parent变量
  7868. if (!this.parent) this.parent = false;
  7869. // 这里的本质原理是,通过获取父组件实例(也即u-radio-group的this)
  7870. // 将父组件this中对应的参数,赋值给本组件(u-radio的this)的parentData对象中对应的属性
  7871. // 之所以需要这么做,是因为所有端中,头条小程序不支持通过this.parent.xxx去监听父组件参数的变化
  7872. this.parent = this.$u.$parent.call(this, parentName);
  7873. if (this.parent) {
  7874. // 历遍parentData中的属性,将parent中的同名属性赋值给parentData
  7875. Object.keys(this.parentData).map(function (key) {
  7876. _this2.parentData[key] = _this2.parent[key];
  7877. });
  7878. }
  7879. },
  7880. // 阻止事件冒泡
  7881. preventEvent: function preventEvent(e) {
  7882. e && e.stopPropagation && e.stopPropagation();
  7883. } },
  7884. onReachBottom: function onReachBottom() {
  7885. uni.$emit('uOnReachBottom');
  7886. },
  7887. beforeDestroy: function beforeDestroy() {var _this3 = this;
  7888. // 判断当前页面是否存在parent和chldren,一般在checkbox和checkbox-group父子联动的场景会有此情况
  7889. // 组件销毁时,移除子组件在父组件children数组中的实例,释放资源,避免数据混乱
  7890. if (this.parent && uni.$u.test.array(this.parent.children)) {
  7891. // 组件销毁时,移除父组件中的children数组中对应的实例
  7892. var childrenList = this.parent.children;
  7893. childrenList.map(function (child, index) {
  7894. // 如果相等,则移除
  7895. if (child === _this3) {
  7896. childrenList.splice(index, 1);
  7897. }
  7898. });
  7899. }
  7900. } };
  7901. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  7902. /***/ }),
  7903. /* 14 */
  7904. /*!*********************************************************************************************!*\
  7905. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/request/index.js ***!
  7906. \*********************************************************************************************/
  7907. /*! no static exports found */
  7908. /***/ (function(module, exports, __webpack_require__) {
  7909. "use strict";
  7910. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepMerge = _interopRequireDefault(__webpack_require__(/*! ../function/deepMerge */ 15));
  7911. var _test = _interopRequireDefault(__webpack_require__(/*! ../function/test */ 17));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
  7912. Request = /*#__PURE__*/function () {_createClass(Request, [{ key: "setConfig",
  7913. // 设置全局默认配置
  7914. value: function setConfig(customConfig) {
  7915. // 深度合并对象,否则会造成对象深层属性丢失
  7916. this.config = (0, _deepMerge.default)(this.config, customConfig);
  7917. }
  7918. // 主要请求部分
  7919. }, { key: "request", value: function request() {var _this = this;var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  7920. // 检查请求拦截
  7921. if (this.interceptor.request && typeof this.interceptor.request === 'function') {
  7922. var tmpConfig = {};
  7923. var interceptorRequest = this.interceptor.request(options);
  7924. if (interceptorRequest === false) {
  7925. // 返回一个处于pending状态中的Promise,来取消原promise,避免进入then()回调
  7926. return new Promise(function () {});
  7927. }
  7928. this.options = interceptorRequest;
  7929. }
  7930. options.dataType = options.dataType || this.config.dataType;
  7931. options.responseType = options.responseType || this.config.responseType;
  7932. options.url = options.url || '';
  7933. options.params = options.params || {};
  7934. options.header = Object.assign({}, this.config.header, options.header);
  7935. options.method = options.method || this.config.method;
  7936. return new Promise(function (resolve, reject) {
  7937. options.complete = function (response) {
  7938. // 请求返回后,隐藏loading(如果请求返回快的话,可能会没有loading)
  7939. uni.hideLoading();
  7940. // 清除定时器,如果请求回来了,就无需loading
  7941. clearTimeout(_this.config.timer);
  7942. _this.config.timer = null;
  7943. // 判断用户对拦截返回数据的要求,如果originalData为true,返回所有的数据(response)到拦截器,否则只返回response.data
  7944. if (_this.config.originalData) {
  7945. // 判断是否存在拦截器
  7946. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  7947. var resInterceptors = _this.interceptor.response(response);
  7948. // 如果拦截器不返回false,就将拦截器返回的内容给this.$u.post的then回调
  7949. if (resInterceptors !== false) {
  7950. resolve(resInterceptors);
  7951. } else {
  7952. // 如果拦截器返回false,意味着拦截器定义者认为返回有问题,直接接入catch回调
  7953. reject(response);
  7954. }
  7955. } else {
  7956. // 如果要求返回原始数据,就算没有拦截器,也返回最原始的数据
  7957. resolve(response);
  7958. }
  7959. } else {
  7960. if (response.statusCode == 200) {
  7961. if (_this.interceptor.response && typeof _this.interceptor.response === 'function') {
  7962. var _resInterceptors = _this.interceptor.response(response.data);
  7963. if (_resInterceptors !== false) {
  7964. resolve(_resInterceptors);
  7965. } else {
  7966. reject(response.data);
  7967. }
  7968. } else {
  7969. // 如果不是返回原始数据(originalData=false),且没有拦截器的情况下,返回纯数据给then回调
  7970. resolve(response.data);
  7971. }
  7972. } else {
  7973. // 不返回原始数据的情况下,服务器状态码不为200,modal弹框提示
  7974. // if(response.errMsg) {
  7975. // uni.showModal({
  7976. // title: response.errMsg
  7977. // });
  7978. // }
  7979. reject(response);
  7980. }
  7981. }
  7982. };
  7983. // 判断用户传递的URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
  7984. options.url = _test.default.url(options.url) ? options.url : _this.config.baseUrl + (options.url.indexOf('/') == 0 ?
  7985. options.url : '/' + options.url);
  7986. // 是否显示loading
  7987. // 加一个是否已有timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id
  7988. // 而没有清除前者的定时器,导致前者超时,一直显示loading
  7989. if (_this.config.showLoading && !_this.config.timer) {
  7990. _this.config.timer = setTimeout(function () {
  7991. uni.showLoading({
  7992. title: _this.config.loadingText,
  7993. mask: _this.config.loadingMask });
  7994. _this.config.timer = null;
  7995. }, _this.config.loadingTime);
  7996. }
  7997. uni.request(options);
  7998. });
  7999. // .catch(res => {
  8000. // // 如果返回reject(),不让其进入this.$u.post().then().catch()后面的catct()
  8001. // // 因为很多人都会忘了写后面的catch(),导致报错捕获不到catch
  8002. // return new Promise(()=>{});
  8003. // })
  8004. } }]);
  8005. function Request() {var _this2 = this;_classCallCheck(this, Request);
  8006. this.config = {
  8007. baseUrl: '', // 请求的根域名
  8008. // 默认的请求头
  8009. header: {},
  8010. method: 'POST',
  8011. // 设置为json,返回后uni.request会对数据进行一次JSON.parse
  8012. dataType: 'json',
  8013. // 此参数无需处理,因为5+和支付宝小程序不支持,默认为text即可
  8014. responseType: 'text',
  8015. showLoading: true, // 是否显示请求中的loading
  8016. loadingText: '请求中...',
  8017. loadingTime: 800, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
  8018. timer: null, // 定时器
  8019. originalData: false, // 是否在拦截器中返回服务端的原始数据,见文档说明
  8020. loadingMask: true // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
  8021. };
  8022. // 拦截器
  8023. this.interceptor = {
  8024. // 请求前的拦截
  8025. request: null,
  8026. // 请求后的拦截
  8027. response: null };
  8028. // get请求
  8029. this.get = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  8030. return _this2.request({
  8031. method: 'GET',
  8032. url: url,
  8033. header: header,
  8034. data: data });
  8035. };
  8036. // post请求
  8037. this.post = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  8038. return _this2.request({
  8039. url: url,
  8040. method: 'POST',
  8041. header: header,
  8042. data: data });
  8043. };
  8044. // put请求,不支持支付宝小程序(HX2.6.15)
  8045. this.put = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  8046. return _this2.request({
  8047. url: url,
  8048. method: 'PUT',
  8049. header: header,
  8050. data: data });
  8051. };
  8052. // delete请求,不支持支付宝和头条小程序(HX2.6.15)
  8053. this.delete = function (url) {var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var header = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  8054. return _this2.request({
  8055. url: url,
  8056. method: 'DELETE',
  8057. header: header,
  8058. data: data });
  8059. };
  8060. }return Request;}();var _default =
  8061. new Request();exports.default = _default;
  8062. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8063. /***/ }),
  8064. /* 15 */
  8065. /*!**************************************************************************************************!*\
  8066. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/deepMerge.js ***!
  8067. \**************************************************************************************************/
  8068. /*! no static exports found */
  8069. /***/ (function(module, exports, __webpack_require__) {
  8070. "use strict";
  8071. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _deepClone = _interopRequireDefault(__webpack_require__(/*! ./deepClone */ 16));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  8072. // JS对象深度合并
  8073. function deepMerge() {var target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  8074. target = (0, _deepClone.default)(target);
  8075. if (typeof target !== 'object' || typeof source !== 'object') return false;
  8076. for (var prop in source) {
  8077. if (!source.hasOwnProperty(prop)) continue;
  8078. if (prop in target) {
  8079. if (typeof target[prop] !== 'object') {
  8080. target[prop] = source[prop];
  8081. } else {
  8082. if (typeof source[prop] !== 'object') {
  8083. target[prop] = source[prop];
  8084. } else {
  8085. if (target[prop].concat && source[prop].concat) {
  8086. target[prop] = target[prop].concat(source[prop]);
  8087. } else {
  8088. target[prop] = deepMerge(target[prop], source[prop]);
  8089. }
  8090. }
  8091. }
  8092. } else {
  8093. target[prop] = source[prop];
  8094. }
  8095. }
  8096. return target;
  8097. }var _default =
  8098. deepMerge;exports.default = _default;
  8099. /***/ }),
  8100. /* 16 */
  8101. /*!**************************************************************************************************!*\
  8102. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/deepClone.js ***!
  8103. \**************************************************************************************************/
  8104. /*! no static exports found */
  8105. /***/ (function(module, exports, __webpack_require__) {
  8106. "use strict";
  8107. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 判断arr是否为一个数组,返回一个bool值
  8108. function isArray(arr) {
  8109. return Object.prototype.toString.call(arr) === '[object Array]';
  8110. }
  8111. // 深度克隆
  8112. function deepClone(obj) {
  8113. // 对常见的“非”值,直接返回原来值
  8114. if ([null, undefined, NaN, false].includes(obj)) return obj;
  8115. if (typeof obj !== "object" && typeof obj !== 'function') {
  8116. //原始类型直接返回
  8117. return obj;
  8118. }
  8119. var o = isArray(obj) ? [] : {};
  8120. for (var i in obj) {
  8121. if (obj.hasOwnProperty(i)) {
  8122. o[i] = typeof obj[i] === "object" ? deepClone(obj[i]) : obj[i];
  8123. }
  8124. }
  8125. return o;
  8126. }var _default =
  8127. deepClone;exports.default = _default;
  8128. /***/ }),
  8129. /* 17 */
  8130. /*!*********************************************************************************************!*\
  8131. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/test.js ***!
  8132. \*********************************************************************************************/
  8133. /*! no static exports found */
  8134. /***/ (function(module, exports, __webpack_require__) {
  8135. "use strict";
  8136. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  8137. * 验证电子邮箱格式
  8138. */
  8139. function email(value) {
  8140. return /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(value);
  8141. }
  8142. /**
  8143. * 验证手机格式
  8144. */
  8145. function mobile(value) {
  8146. return /^1[3-9]\d{9}$/.test(value);
  8147. }
  8148. /**
  8149. * 验证URL格式
  8150. */
  8151. function url(value) {
  8152. return /http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w-.\/?%&=]*)?/.test(value);
  8153. }
  8154. /**
  8155. * 验证日期格式
  8156. */
  8157. function date(value) {
  8158. return !/Invalid|NaN/.test(new Date(value).toString());
  8159. }
  8160. /**
  8161. * 验证ISO类型的日期格式
  8162. */
  8163. function dateISO(value) {
  8164. return /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
  8165. }
  8166. /**
  8167. * 验证十进制数字
  8168. */
  8169. function number(value) {
  8170. return /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
  8171. }
  8172. /**
  8173. * 验证整数
  8174. */
  8175. function digits(value) {
  8176. return /^\d+$/.test(value);
  8177. }
  8178. /**
  8179. * 验证身份证号码
  8180. */
  8181. function idCard(value) {
  8182. 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(
  8183. value);
  8184. }
  8185. /**
  8186. * 是否车牌号
  8187. */
  8188. function carNo(value) {
  8189. // 新能源车牌
  8190. var xreg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/;
  8191. // 旧车牌
  8192. var creg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
  8193. if (value.length === 7) {
  8194. return creg.test(value);
  8195. } else if (value.length === 8) {
  8196. return xreg.test(value);
  8197. } else {
  8198. return false;
  8199. }
  8200. }
  8201. /**
  8202. * 金额,只允许2位小数
  8203. */
  8204. function amount(value) {
  8205. //金额,只允许保留两位小数
  8206. return /^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(value);
  8207. }
  8208. /**
  8209. * 中文
  8210. */
  8211. function chinese(value) {
  8212. var reg = /^[\u4e00-\u9fa5]+$/gi;
  8213. return reg.test(value);
  8214. }
  8215. /**
  8216. * 只能输入字母
  8217. */
  8218. function letter(value) {
  8219. return /^[a-zA-Z]*$/.test(value);
  8220. }
  8221. /**
  8222. * 只能是字母或者数字
  8223. */
  8224. function enOrNum(value) {
  8225. //英文或者数字
  8226. var reg = /^[0-9a-zA-Z]*$/g;
  8227. return reg.test(value);
  8228. }
  8229. /**
  8230. * 验证是否包含某个值
  8231. */
  8232. function contains(value, param) {
  8233. return value.indexOf(param) >= 0;
  8234. }
  8235. /**
  8236. * 验证一个值范围[min, max]
  8237. */
  8238. function range(value, param) {
  8239. return value >= param[0] && value <= param[1];
  8240. }
  8241. /**
  8242. * 验证一个长度范围[min, max]
  8243. */
  8244. function rangeLength(value, param) {
  8245. return value.length >= param[0] && value.length <= param[1];
  8246. }
  8247. /**
  8248. * 是否固定电话
  8249. */
  8250. function landline(value) {
  8251. var reg = /^\d{3,4}-\d{7,8}(-\d{3,4})?$/;
  8252. return reg.test(value);
  8253. }
  8254. /**
  8255. * 判断是否为空
  8256. */
  8257. function empty(value) {
  8258. switch (typeof value) {
  8259. case 'undefined':
  8260. return true;
  8261. case 'string':
  8262. if (value.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g, '').length == 0) return true;
  8263. break;
  8264. case 'boolean':
  8265. if (!value) return true;
  8266. break;
  8267. case 'number':
  8268. if (0 === value || isNaN(value)) return true;
  8269. break;
  8270. case 'object':
  8271. if (null === value || value.length === 0) return true;
  8272. for (var i in value) {
  8273. return false;
  8274. }
  8275. return true;}
  8276. return false;
  8277. }
  8278. /**
  8279. * 是否json字符串
  8280. */
  8281. function jsonString(value) {
  8282. if (typeof value == 'string') {
  8283. try {
  8284. var obj = JSON.parse(value);
  8285. if (typeof obj == 'object' && obj) {
  8286. return true;
  8287. } else {
  8288. return false;
  8289. }
  8290. } catch (e) {
  8291. return false;
  8292. }
  8293. }
  8294. return false;
  8295. }
  8296. /**
  8297. * 是否数组
  8298. */
  8299. function array(value) {
  8300. if (typeof Array.isArray === "function") {
  8301. return Array.isArray(value);
  8302. } else {
  8303. return Object.prototype.toString.call(value) === "[object Array]";
  8304. }
  8305. }
  8306. /**
  8307. * 是否对象
  8308. */
  8309. function object(value) {
  8310. return Object.prototype.toString.call(value) === '[object Object]';
  8311. }
  8312. /**
  8313. * 是否短信验证码
  8314. */
  8315. function code(value) {var len = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6;
  8316. return new RegExp("^\\d{".concat(len, "}$")).test(value);
  8317. }var _default =
  8318. {
  8319. email: email,
  8320. mobile: mobile,
  8321. url: url,
  8322. date: date,
  8323. dateISO: dateISO,
  8324. number: number,
  8325. digits: digits,
  8326. idCard: idCard,
  8327. carNo: carNo,
  8328. amount: amount,
  8329. chinese: chinese,
  8330. letter: letter,
  8331. enOrNum: enOrNum,
  8332. contains: contains,
  8333. range: range,
  8334. rangeLength: rangeLength,
  8335. empty: empty,
  8336. isEmpty: empty,
  8337. jsonString: jsonString,
  8338. landline: landline,
  8339. object: object,
  8340. array: array,
  8341. code: code };exports.default = _default;
  8342. /***/ }),
  8343. /* 18 */
  8344. /*!****************************************************************************************************!*\
  8345. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/queryParams.js ***!
  8346. \****************************************************************************************************/
  8347. /*! no static exports found */
  8348. /***/ (function(module, exports, __webpack_require__) {
  8349. "use strict";
  8350. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  8351. * 对象转url参数
  8352. * @param {*} data,对象
  8353. * @param {*} isPrefix,是否自动加上"?"
  8354. */
  8355. 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';
  8356. var prefix = isPrefix ? '?' : '';
  8357. var _result = [];
  8358. if (['indices', 'brackets', 'repeat', 'comma'].indexOf(arrayFormat) == -1) arrayFormat = 'brackets';var _loop = function _loop(
  8359. key) {
  8360. var value = data[key];
  8361. // 去掉为空的参数
  8362. if (['', undefined, null].indexOf(value) >= 0) {
  8363. return "continue";
  8364. }
  8365. // 如果值为数组,另行处理
  8366. if (value.constructor === Array) {
  8367. // e.g. {ids: [1, 2, 3]}
  8368. switch (arrayFormat) {
  8369. case 'indices':
  8370. // 结果: ids[0]=1&ids[1]=2&ids[2]=3
  8371. for (var i = 0; i < value.length; i++) {
  8372. _result.push(key + '[' + i + ']=' + value[i]);
  8373. }
  8374. break;
  8375. case 'brackets':
  8376. // 结果: ids[]=1&ids[]=2&ids[]=3
  8377. value.forEach(function (_value) {
  8378. _result.push(key + '[]=' + _value);
  8379. });
  8380. break;
  8381. case 'repeat':
  8382. // 结果: ids=1&ids=2&ids=3
  8383. value.forEach(function (_value) {
  8384. _result.push(key + '=' + _value);
  8385. });
  8386. break;
  8387. case 'comma':
  8388. // 结果: ids=1,2,3
  8389. var commaStr = "";
  8390. value.forEach(function (_value) {
  8391. commaStr += (commaStr ? "," : "") + _value;
  8392. });
  8393. _result.push(key + '=' + commaStr);
  8394. break;
  8395. default:
  8396. value.forEach(function (_value) {
  8397. _result.push(key + '[]=' + _value);
  8398. });}
  8399. } else {
  8400. _result.push(key + '=' + value);
  8401. }};for (var key in data) {var _ret = _loop(key);if (_ret === "continue") continue;
  8402. }
  8403. return _result.length ? prefix + _result.join('&') : '';
  8404. }var _default =
  8405. queryParams;exports.default = _default;
  8406. /***/ }),
  8407. /* 19 */
  8408. /*!**********************************************************************************************!*\
  8409. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/route.js ***!
  8410. \**********************************************************************************************/
  8411. /*! no static exports found */
  8412. /***/ (function(module, exports, __webpack_require__) {
  8413. "use strict";
  8414. /* 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 */ 20));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {try {var info = gen[key](arg);var value = info.value;} catch (error) {reject(error);return;}if (info.done) {resolve(value);} else {Promise.resolve(value).then(_next, _throw);}}function _asyncToGenerator(fn) {return function () {var self = this,args = arguments;return new Promise(function (resolve, reject) {var gen = fn.apply(self, args);function _next(value) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);}function _throw(err) {asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);}_next(undefined);});};}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;} /**
  8415. * 路由跳转方法,该方法相对于直接使用uni.xxx的好处是使用更加简单快捷
  8416. * 并且带有路由拦截功能
  8417. */var
  8418. Router = /*#__PURE__*/function () {
  8419. function Router() {_classCallCheck(this, Router);
  8420. // 原始属性定义
  8421. this.config = {
  8422. type: 'navigateTo',
  8423. url: '',
  8424. delta: 1, // navigateBack页面后退时,回退的层数
  8425. params: {}, // 传递的参数
  8426. animationType: 'pop-in', // 窗口动画,只在APP有效
  8427. animationDuration: 300, // 窗口动画持续时间,单位毫秒,只在APP有效
  8428. intercept: false // 是否需要拦截
  8429. };
  8430. // 因为route方法是需要对外赋值给另外的对象使用,同时route内部有使用this,会导致route失去上下文
  8431. // 这里在构造函数中进行this绑定
  8432. this.route = this.route.bind(this);
  8433. }
  8434. // 判断url前面是否有"/",如果没有则加上,否则无法跳转
  8435. _createClass(Router, [{ key: "addRootPath", value: function addRootPath(url) {
  8436. return url[0] === '/' ? url : "/".concat(url);
  8437. }
  8438. // 整合路由参数
  8439. }, { key: "mixinParam", value: function mixinParam(url, params) {
  8440. url = url && this.addRootPath(url);
  8441. // 使用正则匹配,主要依据是判断是否有"/","?","="等,如“/page/index/index?name=mary"
  8442. // 如果有url中有get参数,转换后无需带上"?"
  8443. var query = '';
  8444. if (/.*\/.*\?.*=.*/.test(url)) {
  8445. // object对象转为get类型的参数
  8446. query = uni.$u.queryParams(params, false);
  8447. // 因为已有get参数,所以后面拼接的参数需要带上"&"隔开
  8448. return url += "&" + query;
  8449. } else {
  8450. // 直接拼接参数,因为此处url中没有后面的query参数,也就没有"?/&"之类的符号
  8451. query = uni.$u.queryParams(params);
  8452. return url += query;
  8453. }
  8454. }
  8455. // 对外的方法名称
  8456. }, { key: "route", value: function () {var _route = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee() {var options,params,mergeConfig,isNext,_args = arguments;return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:options = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};params = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
  8457. // 合并用户的配置和内部的默认配置
  8458. mergeConfig = {};
  8459. if (typeof options === 'string') {
  8460. // 如果options为字符串,则为route(url, params)的形式
  8461. mergeConfig.url = this.mixinParam(options, params);
  8462. mergeConfig.type = 'navigateTo';
  8463. } else {
  8464. mergeConfig = uni.$u.deepClone(options, this.config);
  8465. // 否则正常使用mergeConfig中的url和params进行拼接
  8466. mergeConfig.url = this.mixinParam(options.url, options.params);
  8467. }
  8468. if (params.intercept) {
  8469. this.config.intercept = params.intercept;
  8470. }
  8471. // params参数也带给拦截器
  8472. mergeConfig.params = params;
  8473. // 合并内外部参数
  8474. mergeConfig = uni.$u.deepMerge(this.config, mergeConfig);
  8475. // 判断用户是否定义了拦截器
  8476. if (!(typeof uni.$u.routeIntercept === 'function')) {_context.next = 14;break;}_context.next = 10;return (
  8477. new Promise(function (resolve, reject) {
  8478. uni.$u.routeIntercept(mergeConfig, resolve);
  8479. }));case 10:isNext = _context.sent;
  8480. // 如果isNext为true,则执行路由跳转
  8481. isNext && this.openPage(mergeConfig);_context.next = 15;break;case 14:
  8482. this.openPage(mergeConfig);case 15:case "end":return _context.stop();}}}, _callee, this);}));function route() {return _route.apply(this, arguments);}return route;}()
  8483. // 执行路由跳转
  8484. }, { key: "openPage", value: function openPage(config) {
  8485. // 解构参数
  8486. var
  8487. url =
  8488. config.url,type = config.type,delta = config.delta,animationType = config.animationType,animationDuration = config.animationDuration;
  8489. if (config.type == 'navigateTo' || config.type == 'to') {
  8490. uni.navigateTo({
  8491. url: url,
  8492. animationType: animationType,
  8493. animationDuration: animationDuration });
  8494. }
  8495. if (config.type == 'redirectTo' || config.type == 'redirect') {
  8496. uni.redirectTo({
  8497. url: url });
  8498. }
  8499. if (config.type == 'switchTab' || config.type == 'tab') {
  8500. uni.switchTab({
  8501. url: url });
  8502. }
  8503. if (config.type == 'reLaunch' || config.type == 'launch') {
  8504. uni.reLaunch({
  8505. url: url });
  8506. }
  8507. if (config.type == 'navigateBack' || config.type == 'back') {
  8508. uni.navigateBack({
  8509. delta: delta });
  8510. }
  8511. } }]);return Router;}();var _default =
  8512. new Router().route;exports.default = _default;
  8513. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  8514. /***/ }),
  8515. /* 20 */
  8516. /*!**********************************************************!*\
  8517. !*** ./node_modules/@babel/runtime/regenerator/index.js ***!
  8518. \**********************************************************/
  8519. /*! no static exports found */
  8520. /***/ (function(module, exports, __webpack_require__) {
  8521. module.exports = __webpack_require__(/*! regenerator-runtime */ 21);
  8522. /***/ }),
  8523. /* 21 */
  8524. /*!************************************************************!*\
  8525. !*** ./node_modules/regenerator-runtime/runtime-module.js ***!
  8526. \************************************************************/
  8527. /*! no static exports found */
  8528. /***/ (function(module, exports, __webpack_require__) {
  8529. /**
  8530. * Copyright (c) 2014-present, Facebook, Inc.
  8531. *
  8532. * This source code is licensed under the MIT license found in the
  8533. * LICENSE file in the root directory of this source tree.
  8534. */
  8535. // This method of obtaining a reference to the global object needs to be
  8536. // kept identical to the way it is obtained in runtime.js
  8537. var g = (function() {
  8538. return this || (typeof self === "object" && self);
  8539. })() || Function("return this")();
  8540. // Use `getOwnPropertyNames` because not all browsers support calling
  8541. // `hasOwnProperty` on the global `self` object in a worker. See #183.
  8542. var hadRuntime = g.regeneratorRuntime &&
  8543. Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
  8544. // Save the old regeneratorRuntime in case it needs to be restored later.
  8545. var oldRuntime = hadRuntime && g.regeneratorRuntime;
  8546. // Force reevalutation of runtime.js.
  8547. g.regeneratorRuntime = undefined;
  8548. module.exports = __webpack_require__(/*! ./runtime */ 22);
  8549. if (hadRuntime) {
  8550. // Restore the original runtime.
  8551. g.regeneratorRuntime = oldRuntime;
  8552. } else {
  8553. // Remove the global property added by runtime.js.
  8554. try {
  8555. delete g.regeneratorRuntime;
  8556. } catch(e) {
  8557. g.regeneratorRuntime = undefined;
  8558. }
  8559. }
  8560. /***/ }),
  8561. /* 22 */
  8562. /*!*****************************************************!*\
  8563. !*** ./node_modules/regenerator-runtime/runtime.js ***!
  8564. \*****************************************************/
  8565. /*! no static exports found */
  8566. /***/ (function(module, exports) {
  8567. /**
  8568. * Copyright (c) 2014-present, Facebook, Inc.
  8569. *
  8570. * This source code is licensed under the MIT license found in the
  8571. * LICENSE file in the root directory of this source tree.
  8572. */
  8573. !(function(global) {
  8574. "use strict";
  8575. var Op = Object.prototype;
  8576. var hasOwn = Op.hasOwnProperty;
  8577. var undefined; // More compressible than void 0.
  8578. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  8579. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  8580. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  8581. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  8582. var inModule = typeof module === "object";
  8583. var runtime = global.regeneratorRuntime;
  8584. if (runtime) {
  8585. if (inModule) {
  8586. // If regeneratorRuntime is defined globally and we're in a module,
  8587. // make the exports object identical to regeneratorRuntime.
  8588. module.exports = runtime;
  8589. }
  8590. // Don't bother evaluating the rest of this file if the runtime was
  8591. // already defined globally.
  8592. return;
  8593. }
  8594. // Define the runtime globally (as expected by generated code) as either
  8595. // module.exports (if we're in a module) or a new, empty object.
  8596. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  8597. function wrap(innerFn, outerFn, self, tryLocsList) {
  8598. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  8599. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  8600. var generator = Object.create(protoGenerator.prototype);
  8601. var context = new Context(tryLocsList || []);
  8602. // The ._invoke method unifies the implementations of the .next,
  8603. // .throw, and .return methods.
  8604. generator._invoke = makeInvokeMethod(innerFn, self, context);
  8605. return generator;
  8606. }
  8607. runtime.wrap = wrap;
  8608. // Try/catch helper to minimize deoptimizations. Returns a completion
  8609. // record like context.tryEntries[i].completion. This interface could
  8610. // have been (and was previously) designed to take a closure to be
  8611. // invoked without arguments, but in all the cases we care about we
  8612. // already have an existing method we want to call, so there's no need
  8613. // to create a new function object. We can even get away with assuming
  8614. // the method takes exactly one argument, since that happens to be true
  8615. // in every case, so we don't have to touch the arguments object. The
  8616. // only additional allocation required is the completion record, which
  8617. // has a stable shape and so hopefully should be cheap to allocate.
  8618. function tryCatch(fn, obj, arg) {
  8619. try {
  8620. return { type: "normal", arg: fn.call(obj, arg) };
  8621. } catch (err) {
  8622. return { type: "throw", arg: err };
  8623. }
  8624. }
  8625. var GenStateSuspendedStart = "suspendedStart";
  8626. var GenStateSuspendedYield = "suspendedYield";
  8627. var GenStateExecuting = "executing";
  8628. var GenStateCompleted = "completed";
  8629. // Returning this object from the innerFn has the same effect as
  8630. // breaking out of the dispatch switch statement.
  8631. var ContinueSentinel = {};
  8632. // Dummy constructor functions that we use as the .constructor and
  8633. // .constructor.prototype properties for functions that return Generator
  8634. // objects. For full spec compliance, you may wish to configure your
  8635. // minifier not to mangle the names of these two functions.
  8636. function Generator() {}
  8637. function GeneratorFunction() {}
  8638. function GeneratorFunctionPrototype() {}
  8639. // This is a polyfill for %IteratorPrototype% for environments that
  8640. // don't natively support it.
  8641. var IteratorPrototype = {};
  8642. IteratorPrototype[iteratorSymbol] = function () {
  8643. return this;
  8644. };
  8645. var getProto = Object.getPrototypeOf;
  8646. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  8647. if (NativeIteratorPrototype &&
  8648. NativeIteratorPrototype !== Op &&
  8649. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  8650. // This environment has a native %IteratorPrototype%; use it instead
  8651. // of the polyfill.
  8652. IteratorPrototype = NativeIteratorPrototype;
  8653. }
  8654. var Gp = GeneratorFunctionPrototype.prototype =
  8655. Generator.prototype = Object.create(IteratorPrototype);
  8656. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  8657. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  8658. GeneratorFunctionPrototype[toStringTagSymbol] =
  8659. GeneratorFunction.displayName = "GeneratorFunction";
  8660. // Helper for defining the .next, .throw, and .return methods of the
  8661. // Iterator interface in terms of a single ._invoke method.
  8662. function defineIteratorMethods(prototype) {
  8663. ["next", "throw", "return"].forEach(function(method) {
  8664. prototype[method] = function(arg) {
  8665. return this._invoke(method, arg);
  8666. };
  8667. });
  8668. }
  8669. runtime.isGeneratorFunction = function(genFun) {
  8670. var ctor = typeof genFun === "function" && genFun.constructor;
  8671. return ctor
  8672. ? ctor === GeneratorFunction ||
  8673. // For the native GeneratorFunction constructor, the best we can
  8674. // do is to check its .name property.
  8675. (ctor.displayName || ctor.name) === "GeneratorFunction"
  8676. : false;
  8677. };
  8678. runtime.mark = function(genFun) {
  8679. if (Object.setPrototypeOf) {
  8680. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  8681. } else {
  8682. genFun.__proto__ = GeneratorFunctionPrototype;
  8683. if (!(toStringTagSymbol in genFun)) {
  8684. genFun[toStringTagSymbol] = "GeneratorFunction";
  8685. }
  8686. }
  8687. genFun.prototype = Object.create(Gp);
  8688. return genFun;
  8689. };
  8690. // Within the body of any async function, `await x` is transformed to
  8691. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  8692. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  8693. // meant to be awaited.
  8694. runtime.awrap = function(arg) {
  8695. return { __await: arg };
  8696. };
  8697. function AsyncIterator(generator) {
  8698. function invoke(method, arg, resolve, reject) {
  8699. var record = tryCatch(generator[method], generator, arg);
  8700. if (record.type === "throw") {
  8701. reject(record.arg);
  8702. } else {
  8703. var result = record.arg;
  8704. var value = result.value;
  8705. if (value &&
  8706. typeof value === "object" &&
  8707. hasOwn.call(value, "__await")) {
  8708. return Promise.resolve(value.__await).then(function(value) {
  8709. invoke("next", value, resolve, reject);
  8710. }, function(err) {
  8711. invoke("throw", err, resolve, reject);
  8712. });
  8713. }
  8714. return Promise.resolve(value).then(function(unwrapped) {
  8715. // When a yielded Promise is resolved, its final value becomes
  8716. // the .value of the Promise<{value,done}> result for the
  8717. // current iteration.
  8718. result.value = unwrapped;
  8719. resolve(result);
  8720. }, function(error) {
  8721. // If a rejected Promise was yielded, throw the rejection back
  8722. // into the async generator function so it can be handled there.
  8723. return invoke("throw", error, resolve, reject);
  8724. });
  8725. }
  8726. }
  8727. var previousPromise;
  8728. function enqueue(method, arg) {
  8729. function callInvokeWithMethodAndArg() {
  8730. return new Promise(function(resolve, reject) {
  8731. invoke(method, arg, resolve, reject);
  8732. });
  8733. }
  8734. return previousPromise =
  8735. // If enqueue has been called before, then we want to wait until
  8736. // all previous Promises have been resolved before calling invoke,
  8737. // so that results are always delivered in the correct order. If
  8738. // enqueue has not been called before, then it is important to
  8739. // call invoke immediately, without waiting on a callback to fire,
  8740. // so that the async generator function has the opportunity to do
  8741. // any necessary setup in a predictable way. This predictability
  8742. // is why the Promise constructor synchronously invokes its
  8743. // executor callback, and why async functions synchronously
  8744. // execute code before the first await. Since we implement simple
  8745. // async functions in terms of async generators, it is especially
  8746. // important to get this right, even though it requires care.
  8747. previousPromise ? previousPromise.then(
  8748. callInvokeWithMethodAndArg,
  8749. // Avoid propagating failures to Promises returned by later
  8750. // invocations of the iterator.
  8751. callInvokeWithMethodAndArg
  8752. ) : callInvokeWithMethodAndArg();
  8753. }
  8754. // Define the unified helper method that is used to implement .next,
  8755. // .throw, and .return (see defineIteratorMethods).
  8756. this._invoke = enqueue;
  8757. }
  8758. defineIteratorMethods(AsyncIterator.prototype);
  8759. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  8760. return this;
  8761. };
  8762. runtime.AsyncIterator = AsyncIterator;
  8763. // Note that simple async functions are implemented on top of
  8764. // AsyncIterator objects; they just return a Promise for the value of
  8765. // the final result produced by the iterator.
  8766. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  8767. var iter = new AsyncIterator(
  8768. wrap(innerFn, outerFn, self, tryLocsList)
  8769. );
  8770. return runtime.isGeneratorFunction(outerFn)
  8771. ? iter // If outerFn is a generator, return the full iterator.
  8772. : iter.next().then(function(result) {
  8773. return result.done ? result.value : iter.next();
  8774. });
  8775. };
  8776. function makeInvokeMethod(innerFn, self, context) {
  8777. var state = GenStateSuspendedStart;
  8778. return function invoke(method, arg) {
  8779. if (state === GenStateExecuting) {
  8780. throw new Error("Generator is already running");
  8781. }
  8782. if (state === GenStateCompleted) {
  8783. if (method === "throw") {
  8784. throw arg;
  8785. }
  8786. // Be forgiving, per 25.3.3.3.3 of the spec:
  8787. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  8788. return doneResult();
  8789. }
  8790. context.method = method;
  8791. context.arg = arg;
  8792. while (true) {
  8793. var delegate = context.delegate;
  8794. if (delegate) {
  8795. var delegateResult = maybeInvokeDelegate(delegate, context);
  8796. if (delegateResult) {
  8797. if (delegateResult === ContinueSentinel) continue;
  8798. return delegateResult;
  8799. }
  8800. }
  8801. if (context.method === "next") {
  8802. // Setting context._sent for legacy support of Babel's
  8803. // function.sent implementation.
  8804. context.sent = context._sent = context.arg;
  8805. } else if (context.method === "throw") {
  8806. if (state === GenStateSuspendedStart) {
  8807. state = GenStateCompleted;
  8808. throw context.arg;
  8809. }
  8810. context.dispatchException(context.arg);
  8811. } else if (context.method === "return") {
  8812. context.abrupt("return", context.arg);
  8813. }
  8814. state = GenStateExecuting;
  8815. var record = tryCatch(innerFn, self, context);
  8816. if (record.type === "normal") {
  8817. // If an exception is thrown from innerFn, we leave state ===
  8818. // GenStateExecuting and loop back for another invocation.
  8819. state = context.done
  8820. ? GenStateCompleted
  8821. : GenStateSuspendedYield;
  8822. if (record.arg === ContinueSentinel) {
  8823. continue;
  8824. }
  8825. return {
  8826. value: record.arg,
  8827. done: context.done
  8828. };
  8829. } else if (record.type === "throw") {
  8830. state = GenStateCompleted;
  8831. // Dispatch the exception by looping back around to the
  8832. // context.dispatchException(context.arg) call above.
  8833. context.method = "throw";
  8834. context.arg = record.arg;
  8835. }
  8836. }
  8837. };
  8838. }
  8839. // Call delegate.iterator[context.method](context.arg) and handle the
  8840. // result, either by returning a { value, done } result from the
  8841. // delegate iterator, or by modifying context.method and context.arg,
  8842. // setting context.delegate to null, and returning the ContinueSentinel.
  8843. function maybeInvokeDelegate(delegate, context) {
  8844. var method = delegate.iterator[context.method];
  8845. if (method === undefined) {
  8846. // A .throw or .return when the delegate iterator has no .throw
  8847. // method always terminates the yield* loop.
  8848. context.delegate = null;
  8849. if (context.method === "throw") {
  8850. if (delegate.iterator.return) {
  8851. // If the delegate iterator has a return method, give it a
  8852. // chance to clean up.
  8853. context.method = "return";
  8854. context.arg = undefined;
  8855. maybeInvokeDelegate(delegate, context);
  8856. if (context.method === "throw") {
  8857. // If maybeInvokeDelegate(context) changed context.method from
  8858. // "return" to "throw", let that override the TypeError below.
  8859. return ContinueSentinel;
  8860. }
  8861. }
  8862. context.method = "throw";
  8863. context.arg = new TypeError(
  8864. "The iterator does not provide a 'throw' method");
  8865. }
  8866. return ContinueSentinel;
  8867. }
  8868. var record = tryCatch(method, delegate.iterator, context.arg);
  8869. if (record.type === "throw") {
  8870. context.method = "throw";
  8871. context.arg = record.arg;
  8872. context.delegate = null;
  8873. return ContinueSentinel;
  8874. }
  8875. var info = record.arg;
  8876. if (! info) {
  8877. context.method = "throw";
  8878. context.arg = new TypeError("iterator result is not an object");
  8879. context.delegate = null;
  8880. return ContinueSentinel;
  8881. }
  8882. if (info.done) {
  8883. // Assign the result of the finished delegate to the temporary
  8884. // variable specified by delegate.resultName (see delegateYield).
  8885. context[delegate.resultName] = info.value;
  8886. // Resume execution at the desired location (see delegateYield).
  8887. context.next = delegate.nextLoc;
  8888. // If context.method was "throw" but the delegate handled the
  8889. // exception, let the outer generator proceed normally. If
  8890. // context.method was "next", forget context.arg since it has been
  8891. // "consumed" by the delegate iterator. If context.method was
  8892. // "return", allow the original .return call to continue in the
  8893. // outer generator.
  8894. if (context.method !== "return") {
  8895. context.method = "next";
  8896. context.arg = undefined;
  8897. }
  8898. } else {
  8899. // Re-yield the result returned by the delegate method.
  8900. return info;
  8901. }
  8902. // The delegate iterator is finished, so forget it and continue with
  8903. // the outer generator.
  8904. context.delegate = null;
  8905. return ContinueSentinel;
  8906. }
  8907. // Define Generator.prototype.{next,throw,return} in terms of the
  8908. // unified ._invoke helper method.
  8909. defineIteratorMethods(Gp);
  8910. Gp[toStringTagSymbol] = "Generator";
  8911. // A Generator should always return itself as the iterator object when the
  8912. // @@iterator function is called on it. Some browsers' implementations of the
  8913. // iterator prototype chain incorrectly implement this, causing the Generator
  8914. // object to not be returned from this call. This ensures that doesn't happen.
  8915. // See https://github.com/facebook/regenerator/issues/274 for more details.
  8916. Gp[iteratorSymbol] = function() {
  8917. return this;
  8918. };
  8919. Gp.toString = function() {
  8920. return "[object Generator]";
  8921. };
  8922. function pushTryEntry(locs) {
  8923. var entry = { tryLoc: locs[0] };
  8924. if (1 in locs) {
  8925. entry.catchLoc = locs[1];
  8926. }
  8927. if (2 in locs) {
  8928. entry.finallyLoc = locs[2];
  8929. entry.afterLoc = locs[3];
  8930. }
  8931. this.tryEntries.push(entry);
  8932. }
  8933. function resetTryEntry(entry) {
  8934. var record = entry.completion || {};
  8935. record.type = "normal";
  8936. delete record.arg;
  8937. entry.completion = record;
  8938. }
  8939. function Context(tryLocsList) {
  8940. // The root entry object (effectively a try statement without a catch
  8941. // or a finally block) gives us a place to store values thrown from
  8942. // locations where there is no enclosing try statement.
  8943. this.tryEntries = [{ tryLoc: "root" }];
  8944. tryLocsList.forEach(pushTryEntry, this);
  8945. this.reset(true);
  8946. }
  8947. runtime.keys = function(object) {
  8948. var keys = [];
  8949. for (var key in object) {
  8950. keys.push(key);
  8951. }
  8952. keys.reverse();
  8953. // Rather than returning an object with a next method, we keep
  8954. // things simple and return the next function itself.
  8955. return function next() {
  8956. while (keys.length) {
  8957. var key = keys.pop();
  8958. if (key in object) {
  8959. next.value = key;
  8960. next.done = false;
  8961. return next;
  8962. }
  8963. }
  8964. // To avoid creating an additional object, we just hang the .value
  8965. // and .done properties off the next function object itself. This
  8966. // also ensures that the minifier will not anonymize the function.
  8967. next.done = true;
  8968. return next;
  8969. };
  8970. };
  8971. function values(iterable) {
  8972. if (iterable) {
  8973. var iteratorMethod = iterable[iteratorSymbol];
  8974. if (iteratorMethod) {
  8975. return iteratorMethod.call(iterable);
  8976. }
  8977. if (typeof iterable.next === "function") {
  8978. return iterable;
  8979. }
  8980. if (!isNaN(iterable.length)) {
  8981. var i = -1, next = function next() {
  8982. while (++i < iterable.length) {
  8983. if (hasOwn.call(iterable, i)) {
  8984. next.value = iterable[i];
  8985. next.done = false;
  8986. return next;
  8987. }
  8988. }
  8989. next.value = undefined;
  8990. next.done = true;
  8991. return next;
  8992. };
  8993. return next.next = next;
  8994. }
  8995. }
  8996. // Return an iterator with no values.
  8997. return { next: doneResult };
  8998. }
  8999. runtime.values = values;
  9000. function doneResult() {
  9001. return { value: undefined, done: true };
  9002. }
  9003. Context.prototype = {
  9004. constructor: Context,
  9005. reset: function(skipTempReset) {
  9006. this.prev = 0;
  9007. this.next = 0;
  9008. // Resetting context._sent for legacy support of Babel's
  9009. // function.sent implementation.
  9010. this.sent = this._sent = undefined;
  9011. this.done = false;
  9012. this.delegate = null;
  9013. this.method = "next";
  9014. this.arg = undefined;
  9015. this.tryEntries.forEach(resetTryEntry);
  9016. if (!skipTempReset) {
  9017. for (var name in this) {
  9018. // Not sure about the optimal order of these conditions:
  9019. if (name.charAt(0) === "t" &&
  9020. hasOwn.call(this, name) &&
  9021. !isNaN(+name.slice(1))) {
  9022. this[name] = undefined;
  9023. }
  9024. }
  9025. }
  9026. },
  9027. stop: function() {
  9028. this.done = true;
  9029. var rootEntry = this.tryEntries[0];
  9030. var rootRecord = rootEntry.completion;
  9031. if (rootRecord.type === "throw") {
  9032. throw rootRecord.arg;
  9033. }
  9034. return this.rval;
  9035. },
  9036. dispatchException: function(exception) {
  9037. if (this.done) {
  9038. throw exception;
  9039. }
  9040. var context = this;
  9041. function handle(loc, caught) {
  9042. record.type = "throw";
  9043. record.arg = exception;
  9044. context.next = loc;
  9045. if (caught) {
  9046. // If the dispatched exception was caught by a catch block,
  9047. // then let that catch block handle the exception normally.
  9048. context.method = "next";
  9049. context.arg = undefined;
  9050. }
  9051. return !! caught;
  9052. }
  9053. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9054. var entry = this.tryEntries[i];
  9055. var record = entry.completion;
  9056. if (entry.tryLoc === "root") {
  9057. // Exception thrown outside of any try block that could handle
  9058. // it, so set the completion value of the entire function to
  9059. // throw the exception.
  9060. return handle("end");
  9061. }
  9062. if (entry.tryLoc <= this.prev) {
  9063. var hasCatch = hasOwn.call(entry, "catchLoc");
  9064. var hasFinally = hasOwn.call(entry, "finallyLoc");
  9065. if (hasCatch && hasFinally) {
  9066. if (this.prev < entry.catchLoc) {
  9067. return handle(entry.catchLoc, true);
  9068. } else if (this.prev < entry.finallyLoc) {
  9069. return handle(entry.finallyLoc);
  9070. }
  9071. } else if (hasCatch) {
  9072. if (this.prev < entry.catchLoc) {
  9073. return handle(entry.catchLoc, true);
  9074. }
  9075. } else if (hasFinally) {
  9076. if (this.prev < entry.finallyLoc) {
  9077. return handle(entry.finallyLoc);
  9078. }
  9079. } else {
  9080. throw new Error("try statement without catch or finally");
  9081. }
  9082. }
  9083. }
  9084. },
  9085. abrupt: function(type, arg) {
  9086. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9087. var entry = this.tryEntries[i];
  9088. if (entry.tryLoc <= this.prev &&
  9089. hasOwn.call(entry, "finallyLoc") &&
  9090. this.prev < entry.finallyLoc) {
  9091. var finallyEntry = entry;
  9092. break;
  9093. }
  9094. }
  9095. if (finallyEntry &&
  9096. (type === "break" ||
  9097. type === "continue") &&
  9098. finallyEntry.tryLoc <= arg &&
  9099. arg <= finallyEntry.finallyLoc) {
  9100. // Ignore the finally entry if control is not jumping to a
  9101. // location outside the try/catch block.
  9102. finallyEntry = null;
  9103. }
  9104. var record = finallyEntry ? finallyEntry.completion : {};
  9105. record.type = type;
  9106. record.arg = arg;
  9107. if (finallyEntry) {
  9108. this.method = "next";
  9109. this.next = finallyEntry.finallyLoc;
  9110. return ContinueSentinel;
  9111. }
  9112. return this.complete(record);
  9113. },
  9114. complete: function(record, afterLoc) {
  9115. if (record.type === "throw") {
  9116. throw record.arg;
  9117. }
  9118. if (record.type === "break" ||
  9119. record.type === "continue") {
  9120. this.next = record.arg;
  9121. } else if (record.type === "return") {
  9122. this.rval = this.arg = record.arg;
  9123. this.method = "return";
  9124. this.next = "end";
  9125. } else if (record.type === "normal" && afterLoc) {
  9126. this.next = afterLoc;
  9127. }
  9128. return ContinueSentinel;
  9129. },
  9130. finish: function(finallyLoc) {
  9131. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9132. var entry = this.tryEntries[i];
  9133. if (entry.finallyLoc === finallyLoc) {
  9134. this.complete(entry.completion, entry.afterLoc);
  9135. resetTryEntry(entry);
  9136. return ContinueSentinel;
  9137. }
  9138. }
  9139. },
  9140. "catch": function(tryLoc) {
  9141. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  9142. var entry = this.tryEntries[i];
  9143. if (entry.tryLoc === tryLoc) {
  9144. var record = entry.completion;
  9145. if (record.type === "throw") {
  9146. var thrown = record.arg;
  9147. resetTryEntry(entry);
  9148. }
  9149. return thrown;
  9150. }
  9151. }
  9152. // The context.catch method must only be called with a location
  9153. // argument that corresponds to a known catch block.
  9154. throw new Error("illegal catch attempt");
  9155. },
  9156. delegateYield: function(iterable, resultName, nextLoc) {
  9157. this.delegate = {
  9158. iterator: values(iterable),
  9159. resultName: resultName,
  9160. nextLoc: nextLoc
  9161. };
  9162. if (this.method === "next") {
  9163. // Deliberately forget the last sent value so that we don't
  9164. // accidentally pass it on to the delegate.
  9165. this.arg = undefined;
  9166. }
  9167. return ContinueSentinel;
  9168. }
  9169. };
  9170. })(
  9171. // In sloppy mode, unbound `this` refers to the global object, fallback to
  9172. // Function constructor if we're in global strict mode. That is sadly a form
  9173. // of indirect eval which violates Content Security Policy.
  9174. (function() {
  9175. return this || (typeof self === "object" && self);
  9176. })() || Function("return this")()
  9177. );
  9178. /***/ }),
  9179. /* 23 */
  9180. /*!***************************************************************************************************!*\
  9181. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/timeFormat.js ***!
  9182. \***************************************************************************************************/
  9183. /*! no static exports found */
  9184. /***/ (function(module, exports, __webpack_require__) {
  9185. "use strict";
  9186. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // padStart 的 polyfill,因为某些机型或情况,还无法支持es7的padStart,比如电脑版的微信小程序
  9187. // 所以这里做一个兼容polyfill的兼容处理
  9188. if (!String.prototype.padStart) {
  9189. // 为了方便表示这里 fillString 用了ES6 的默认参数,不影响理解
  9190. String.prototype.padStart = function (maxLength) {var fillString = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ' ';
  9191. if (Object.prototype.toString.call(fillString) !== "[object String]") throw new TypeError(
  9192. 'fillString must be String');
  9193. var str = this;
  9194. // 返回 String(str) 这里是为了使返回的值是字符串字面量,在控制台中更符合直觉
  9195. if (str.length >= maxLength) return String(str);
  9196. var fillLength = maxLength - str.length,
  9197. times = Math.ceil(fillLength / fillString.length);
  9198. while (times >>= 1) {
  9199. fillString += fillString;
  9200. if (times === 1) {
  9201. fillString += fillString;
  9202. }
  9203. }
  9204. return fillString.slice(0, fillLength) + str;
  9205. };
  9206. }
  9207. // 其他更多是格式化有如下:
  9208. // yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合
  9209. function timeFormat() {var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var fmt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  9210. // 如果为null,则格式化当前时间
  9211. if (!dateTime) dateTime = Number(new Date());
  9212. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  9213. if (dateTime.toString().length == 10) dateTime *= 1000;
  9214. var date = new Date(dateTime);
  9215. var ret;
  9216. var opt = {
  9217. "y+": date.getFullYear().toString(), // 年
  9218. "m+": (date.getMonth() + 1).toString(), // 月
  9219. "d+": date.getDate().toString(), // 日
  9220. "h+": date.getHours().toString(), // 时
  9221. "M+": date.getMinutes().toString(), // 分
  9222. "s+": date.getSeconds().toString() // 秒
  9223. // 有其他格式化字符需求可以继续添加,必须转化成字符串
  9224. };
  9225. for (var k in opt) {
  9226. ret = new RegExp("(" + k + ")").exec(fmt);
  9227. if (ret) {
  9228. fmt = fmt.replace(ret[1], ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, "0"));
  9229. };
  9230. };
  9231. return fmt;
  9232. }var _default =
  9233. timeFormat;exports.default = _default;
  9234. /***/ }),
  9235. /* 24 */
  9236. /*!*************************************************************************************************!*\
  9237. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/timeFrom.js ***!
  9238. \*************************************************************************************************/
  9239. /*! no static exports found */
  9240. /***/ (function(module, exports, __webpack_require__) {
  9241. "use strict";
  9242. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var _timeFormat = _interopRequireDefault(__webpack_require__(/*! ../../libs/function/timeFormat.js */ 23));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9243. /**
  9244. * 时间戳转为多久之前
  9245. * @param String timestamp 时间戳
  9246. * @param String | Boolean format 如果为时间格式字符串,超出一定时间范围,返回固定的时间格式;
  9247. * 如果为布尔值false,无论什么时间,都返回多久以前的格式
  9248. */
  9249. function timeFrom() {var dateTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;var format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'yyyy-mm-dd';
  9250. // 如果为null,则格式化当前时间
  9251. if (!dateTime) dateTime = Number(new Date());
  9252. // 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
  9253. if (dateTime.toString().length == 10) dateTime *= 1000;
  9254. var timestamp = +new Date(Number(dateTime));
  9255. var timer = (Number(new Date()) - timestamp) / 1000;
  9256. // 如果小于5分钟,则返回"刚刚",其他以此类推
  9257. var tips = '';
  9258. switch (true) {
  9259. case timer < 300:
  9260. tips = '刚刚';
  9261. break;
  9262. case timer >= 300 && timer < 3600:
  9263. tips = parseInt(timer / 60) + '分钟前';
  9264. break;
  9265. case timer >= 3600 && timer < 86400:
  9266. tips = parseInt(timer / 3600) + '小时前';
  9267. break;
  9268. case timer >= 86400 && timer < 2592000:
  9269. tips = parseInt(timer / 86400) + '天前';
  9270. break;
  9271. default:
  9272. // 如果format为false,则无论什么时间戳,都显示xx之前
  9273. if (format === false) {
  9274. if (timer >= 2592000 && timer < 365 * 86400) {
  9275. tips = parseInt(timer / (86400 * 30)) + '个月前';
  9276. } else {
  9277. tips = parseInt(timer / (86400 * 365)) + '年前';
  9278. }
  9279. } else {
  9280. tips = (0, _timeFormat.default)(timestamp, format);
  9281. }}
  9282. return tips;
  9283. }var _default =
  9284. timeFrom;exports.default = _default;
  9285. /***/ }),
  9286. /* 25 */
  9287. /*!******************************************************************************************************!*\
  9288. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/colorGradient.js ***!
  9289. \******************************************************************************************************/
  9290. /*! no static exports found */
  9291. /***/ (function(module, exports, __webpack_require__) {
  9292. "use strict";
  9293. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  9294. * 求两个颜色之间的渐变值
  9295. * @param {string} startColor 开始的颜色
  9296. * @param {string} endColor 结束的颜色
  9297. * @param {number} step 颜色等分的份额
  9298. * */
  9299. 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;
  9300. var startRGB = hexToRgb(startColor, false); //转换为rgb数组模式
  9301. var startR = startRGB[0];
  9302. var startG = startRGB[1];
  9303. var startB = startRGB[2];
  9304. var endRGB = hexToRgb(endColor, false);
  9305. var endR = endRGB[0];
  9306. var endG = endRGB[1];
  9307. var endB = endRGB[2];
  9308. var sR = (endR - startR) / step; //总差值
  9309. var sG = (endG - startG) / step;
  9310. var sB = (endB - startB) / step;
  9311. var colorArr = [];
  9312. for (var i = 0; i < step; i++) {
  9313. //计算每一步的hex值
  9314. var hex = rgbToHex('rgb(' + Math.round(sR * i + startR) + ',' + Math.round(sG * i + startG) + ',' + Math.round(sB *
  9315. i + startB) + ')');
  9316. colorArr.push(hex);
  9317. }
  9318. return colorArr;
  9319. }
  9320. // 将hex表示方式转换为rgb表示方式(这里返回rgb数组模式)
  9321. function hexToRgb(sColor) {var str = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
  9322. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  9323. sColor = sColor.toLowerCase();
  9324. if (sColor && reg.test(sColor)) {
  9325. if (sColor.length === 4) {
  9326. var sColorNew = "#";
  9327. for (var i = 1; i < 4; i += 1) {
  9328. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  9329. }
  9330. sColor = sColorNew;
  9331. }
  9332. //处理六位的颜色值
  9333. var sColorChange = [];
  9334. for (var _i = 1; _i < 7; _i += 2) {
  9335. sColorChange.push(parseInt("0x" + sColor.slice(_i, _i + 2)));
  9336. }
  9337. if (!str) {
  9338. return sColorChange;
  9339. } else {
  9340. return "rgb(".concat(sColorChange[0], ",").concat(sColorChange[1], ",").concat(sColorChange[2], ")");
  9341. }
  9342. } else if (/^(rgb|RGB)/.test(sColor)) {
  9343. var arr = sColor.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  9344. return arr.map(function (val) {return Number(val);});
  9345. } else {
  9346. return sColor;
  9347. }
  9348. };
  9349. // 将rgb表示方式转换为hex表示方式
  9350. function rgbToHex(rgb) {
  9351. var _this = rgb;
  9352. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  9353. if (/^(rgb|RGB)/.test(_this)) {
  9354. var aColor = _this.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
  9355. var strHex = "#";
  9356. for (var i = 0; i < aColor.length; i++) {
  9357. var hex = Number(aColor[i]).toString(16);
  9358. hex = String(hex).length == 1 ? 0 + '' + hex : hex; // 保证每个rgb的值为2位
  9359. if (hex === "0") {
  9360. hex += hex;
  9361. }
  9362. strHex += hex;
  9363. }
  9364. if (strHex.length !== 7) {
  9365. strHex = _this;
  9366. }
  9367. return strHex;
  9368. } else if (reg.test(_this)) {
  9369. var aNum = _this.replace(/#/, "").split("");
  9370. if (aNum.length === 6) {
  9371. return _this;
  9372. } else if (aNum.length === 3) {
  9373. var numHex = "#";
  9374. for (var _i2 = 0; _i2 < aNum.length; _i2 += 1) {
  9375. numHex += aNum[_i2] + aNum[_i2];
  9376. }
  9377. return numHex;
  9378. }
  9379. } else {
  9380. return _this;
  9381. }
  9382. }
  9383. /**
  9384. * JS颜色十六进制转换为rgb或rgba,返回的格式为 rgba(255,255,255,0.5)字符串
  9385. * sHex为传入的十六进制的色值
  9386. * alpha为rgba的透明度
  9387. */
  9388. function colorToRgba(color) {var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.3;
  9389. color = rgbToHex(color);
  9390. // 十六进制颜色值的正则表达式
  9391. var reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
  9392. /* 16进制颜色转为RGB格式 */
  9393. var sColor = color.toLowerCase();
  9394. if (sColor && reg.test(sColor)) {
  9395. if (sColor.length === 4) {
  9396. var sColorNew = '#';
  9397. for (var i = 1; i < 4; i += 1) {
  9398. sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1));
  9399. }
  9400. sColor = sColorNew;
  9401. }
  9402. // 处理六位的颜色值
  9403. var sColorChange = [];
  9404. for (var _i3 = 1; _i3 < 7; _i3 += 2) {
  9405. sColorChange.push(parseInt('0x' + sColor.slice(_i3, _i3 + 2)));
  9406. }
  9407. // return sColorChange.join(',')
  9408. return 'rgba(' + sColorChange.join(',') + ',' + alpha + ')';
  9409. } else
  9410. {
  9411. return sColor;
  9412. }
  9413. }var _default =
  9414. {
  9415. colorGradient: colorGradient,
  9416. hexToRgb: hexToRgb,
  9417. rgbToHex: rgbToHex,
  9418. colorToRgba: colorToRgba };exports.default = _default;
  9419. /***/ }),
  9420. /* 26 */
  9421. /*!*********************************************************************************************!*\
  9422. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/guid.js ***!
  9423. \*********************************************************************************************/
  9424. /*! no static exports found */
  9425. /***/ (function(module, exports, __webpack_require__) {
  9426. "use strict";
  9427. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  9428. * 本算法来源于简书开源代码,详见:https://www.jianshu.com/p/fdbf293d0a85
  9429. * 全局唯一标识符(uuid,Globally Unique Identifier),也称作 uuid(Universally Unique IDentifier)
  9430. * 一般用于多个组件之间,给它一个唯一的标识符,或者v-for循环的时候,如果使用数组的index可能会导致更新列表出现问题
  9431. * 最可能的情况是左滑删除item或者对某条信息流"不喜欢"并去掉它的时候,会导致组件内的数据可能出现错乱
  9432. * v-for的时候,推荐使用后端返回的id而不是循环的index
  9433. * @param {Number} len uuid的长度
  9434. * @param {Boolean} firstU 将返回的首字母置为"u"
  9435. * @param {Nubmer} radix 生成uuid的基数(意味着返回的字符串都是这个基数),2-二进制,8-八进制,10-十进制,16-十六进制
  9436. */
  9437. 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;
  9438. var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
  9439. var uuid = [];
  9440. radix = radix || chars.length;
  9441. if (len) {
  9442. // 如果指定uuid长度,只是取随机的字符,0|x为位运算,能去掉x的小数位,返回整数位
  9443. for (var i = 0; i < len; i++) {uuid[i] = chars[0 | Math.random() * radix];}
  9444. } else {
  9445. var r;
  9446. // rfc4122标准要求返回的uuid中,某些位为固定的字符
  9447. uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
  9448. uuid[14] = '4';
  9449. for (var _i = 0; _i < 36; _i++) {
  9450. if (!uuid[_i]) {
  9451. r = 0 | Math.random() * 16;
  9452. uuid[_i] = chars[_i == 19 ? r & 0x3 | 0x8 : r];
  9453. }
  9454. }
  9455. }
  9456. // 移除第一个字符,并用u替代,因为第一个字符为数值时,该guuid不能用作id或者class
  9457. if (firstU) {
  9458. uuid.shift();
  9459. return 'u' + uuid.join('');
  9460. } else {
  9461. return uuid.join('');
  9462. }
  9463. }var _default =
  9464. guid;exports.default = _default;
  9465. /***/ }),
  9466. /* 27 */
  9467. /*!**********************************************************************************************!*\
  9468. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/color.js ***!
  9469. \**********************************************************************************************/
  9470. /*! no static exports found */
  9471. /***/ (function(module, exports, __webpack_require__) {
  9472. "use strict";
  9473. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 为了让用户能够自定义主题,会逐步弃用此文件,各颜色通过css提供
  9474. // 为了给某些特殊场景使用和向后兼容,无需删除此文件(2020-06-20)
  9475. var color = {
  9476. primary: "#2979ff",
  9477. primaryDark: "#2b85e4",
  9478. primaryDisabled: "#a0cfff",
  9479. primaryLight: "#ecf5ff",
  9480. bgColor: "#f3f4f6",
  9481. info: "#909399",
  9482. infoDark: "#82848a",
  9483. infoDisabled: "#c8c9cc",
  9484. infoLight: "#f4f4f5",
  9485. warning: "#ff9900",
  9486. warningDark: "#f29100",
  9487. warningDisabled: "#fcbd71",
  9488. warningLight: "#fdf6ec",
  9489. error: "#fa3534",
  9490. errorDark: "#dd6161",
  9491. errorDisabled: "#fab6b6",
  9492. errorLight: "#fef0f0",
  9493. success: "#19be6b",
  9494. successDark: "#18b566",
  9495. successDisabled: "#71d5a1",
  9496. successLight: "#dbf1e1",
  9497. mainColor: "#303133",
  9498. contentColor: "#606266",
  9499. tipsColor: "#909399",
  9500. lightColor: "#c0c4cc",
  9501. borderColor: "#e4e7ed" };var _default =
  9502. color;exports.default = _default;
  9503. /***/ }),
  9504. /* 28 */
  9505. /*!**************************************************************************************************!*\
  9506. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/type2icon.js ***!
  9507. \**************************************************************************************************/
  9508. /*! no static exports found */
  9509. /***/ (function(module, exports, __webpack_require__) {
  9510. "use strict";
  9511. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; /**
  9512. * 根据主题type值,获取对应的图标
  9513. * @param String type 主题名称,primary|info|error|warning|success
  9514. * @param String fill 是否使用fill填充实体的图标
  9515. */
  9516. function type2icon() {var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'success';var fill = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  9517. // 如果非预置值,默认为success
  9518. if (['primary', 'info', 'error', 'warning', 'success'].indexOf(type) == -1) type = 'success';
  9519. var iconName = '';
  9520. // 目前(2019-12-12),info和primary使用同一个图标
  9521. switch (type) {
  9522. case 'primary':
  9523. iconName = 'info-circle';
  9524. break;
  9525. case 'info':
  9526. iconName = 'info-circle';
  9527. break;
  9528. case 'error':
  9529. iconName = 'close-circle';
  9530. break;
  9531. case 'warning':
  9532. iconName = 'error-circle';
  9533. break;
  9534. case 'success':
  9535. iconName = 'checkmark-circle';
  9536. break;
  9537. default:
  9538. iconName = 'checkmark-circle';}
  9539. // 是否是实体类型,加上-fill,在icon组件库中,实体的类名是后面加-fill的
  9540. if (fill) iconName += '-fill';
  9541. return iconName;
  9542. }var _default =
  9543. type2icon;exports.default = _default;
  9544. /***/ }),
  9545. /* 29 */
  9546. /*!****************************************************************************************************!*\
  9547. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/randomArray.js ***!
  9548. \****************************************************************************************************/
  9549. /*! no static exports found */
  9550. /***/ (function(module, exports, __webpack_require__) {
  9551. "use strict";
  9552. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 打乱数组
  9553. function randomArray() {var array = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
  9554. // 原理是sort排序,Math.random()产生0<= x < 1之间的数,会导致x-0.05大于或者小于0
  9555. return array.sort(function () {return Math.random() - 0.5;});
  9556. }var _default =
  9557. randomArray;exports.default = _default;
  9558. /***/ }),
  9559. /* 30 */
  9560. /*!************************************************************************************************!*\
  9561. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/addUnit.js ***!
  9562. \************************************************************************************************/
  9563. /*! no static exports found */
  9564. /***/ (function(module, exports, __webpack_require__) {
  9565. "use strict";
  9566. Object.defineProperty(exports, "__esModule", { value: true });exports.default = addUnit;var _test = _interopRequireDefault(__webpack_require__(/*! ./test.js */ 17));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  9567. // 添加单位,如果有rpx,%,px等单位结尾或者值为auto,直接返回,否则加上rpx单位结尾
  9568. function addUnit() {var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'auto';var unit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'rpx';
  9569. value = String(value);
  9570. // 用uView内置验证规则中的number判断是否为数值
  9571. return _test.default.number(value) ? "".concat(value).concat(unit) : value;
  9572. }
  9573. /***/ }),
  9574. /* 31 */
  9575. /*!***********************************************************************************************!*\
  9576. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/random.js ***!
  9577. \***********************************************************************************************/
  9578. /*! no static exports found */
  9579. /***/ (function(module, exports, __webpack_require__) {
  9580. "use strict";
  9581. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function random(min, max) {
  9582. if (min >= 0 && max > 0 && max >= min) {
  9583. var gab = max - min + 1;
  9584. return Math.floor(Math.random() * gab + min);
  9585. } else {
  9586. return 0;
  9587. }
  9588. }var _default =
  9589. random;exports.default = _default;
  9590. /***/ }),
  9591. /* 32 */
  9592. /*!*********************************************************************************************!*\
  9593. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/trim.js ***!
  9594. \*********************************************************************************************/
  9595. /*! no static exports found */
  9596. /***/ (function(module, exports, __webpack_require__) {
  9597. "use strict";
  9598. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;function trim(str) {var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'both';
  9599. if (pos == 'both') {
  9600. return str.replace(/^\s+|\s+$/g, "");
  9601. } else if (pos == "left") {
  9602. return str.replace(/^\s*/, '');
  9603. } else if (pos == 'right') {
  9604. return str.replace(/(\s*$)/g, "");
  9605. } else if (pos == 'all') {
  9606. return str.replace(/\s+/g, "");
  9607. } else {
  9608. return str;
  9609. }
  9610. }var _default =
  9611. trim;exports.default = _default;
  9612. /***/ }),
  9613. /* 33 */
  9614. /*!**********************************************************************************************!*\
  9615. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/toast.js ***!
  9616. \**********************************************************************************************/
  9617. /*! no static exports found */
  9618. /***/ (function(module, exports, __webpack_require__) {
  9619. "use strict";
  9620. /* 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;
  9621. uni.showToast({
  9622. title: title,
  9623. icon: 'none',
  9624. duration: duration });
  9625. }var _default =
  9626. toast;exports.default = _default;
  9627. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9628. /***/ }),
  9629. /* 34 */
  9630. /*!**************************************************************************************************!*\
  9631. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/getParent.js ***!
  9632. \**************************************************************************************************/
  9633. /*! no static exports found */
  9634. /***/ (function(module, exports, __webpack_require__) {
  9635. "use strict";
  9636. Object.defineProperty(exports, "__esModule", { value: true });exports.default = getParent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  9637. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  9638. function getParent(name, keys) {
  9639. var parent = this.$parent;
  9640. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  9641. while (parent) {
  9642. // 父组件
  9643. if (parent.$options.name !== name) {
  9644. // 如果组件的name不相等,继续上一级寻找
  9645. parent = parent.$parent;
  9646. } else {var _ret = function () {
  9647. var data = {};
  9648. // 判断keys是否数组,如果传过来的是一个数组,那么直接使用数组元素值当做键值去父组件寻找
  9649. if (Array.isArray(keys)) {
  9650. keys.map(function (val) {
  9651. data[val] = parent[val] ? parent[val] : '';
  9652. });
  9653. } else {
  9654. // 历遍传过来的对象参数
  9655. for (var i in keys) {
  9656. // 如果子组件有此值则用,无此值则用父组件的值
  9657. // 判断是否空数组,如果是,则用父组件的值,否则用子组件的值
  9658. if (Array.isArray(keys[i])) {
  9659. if (keys[i].length) {
  9660. data[i] = keys[i];
  9661. } else {
  9662. data[i] = parent[i];
  9663. }
  9664. } else if (keys[i].constructor === Object) {
  9665. // 判断是否对象,如果是对象,且有属性,那么使用子组件的值,否则使用父组件的值
  9666. if (Object.keys(keys[i]).length) {
  9667. data[i] = keys[i];
  9668. } else {
  9669. data[i] = parent[i];
  9670. }
  9671. } else {
  9672. // 只要子组件有传值,即使是false值,也是“传值”了,也需要覆盖父组件的同名参数
  9673. data[i] = keys[i] || keys[i] === false ? keys[i] : parent[i];
  9674. }
  9675. }
  9676. }
  9677. return { v: data };}();if (typeof _ret === "object") return _ret.v;
  9678. }
  9679. }
  9680. return {};
  9681. }
  9682. /***/ }),
  9683. /* 35 */
  9684. /*!************************************************************************************************!*\
  9685. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/$parent.js ***!
  9686. \************************************************************************************************/
  9687. /*! no static exports found */
  9688. /***/ (function(module, exports, __webpack_require__) {
  9689. "use strict";
  9690. Object.defineProperty(exports, "__esModule", { value: true });exports.default = $parent; // 获取父组件的参数,因为支付宝小程序不支持provide/inject的写法
  9691. // this.$parent在非H5中,可以准确获取到父组件,但是在H5中,需要多次this.$parent.$parent.xxx
  9692. // 这里默认值等于undefined有它的含义,因为最顶层元素(组件)的$parent就是undefined,意味着不传name
  9693. // 值(默认为undefined),就是查找最顶层的$parent
  9694. function $parent() {var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  9695. var parent = this.$parent;
  9696. // 通过while历遍,这里主要是为了H5需要多层解析的问题
  9697. while (parent) {
  9698. // 父组件
  9699. if (parent.$options && parent.$options.name !== name) {
  9700. // 如果组件的name不相等,继续上一级寻找
  9701. parent = parent.$parent;
  9702. } else {
  9703. return parent;
  9704. }
  9705. }
  9706. return false;
  9707. }
  9708. /***/ }),
  9709. /* 36 */
  9710. /*!********************************************************************************************!*\
  9711. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/sys.js ***!
  9712. \********************************************************************************************/
  9713. /*! no static exports found */
  9714. /***/ (function(module, exports, __webpack_require__) {
  9715. "use strict";
  9716. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.os = os;exports.sys = sys;function os() {
  9717. return uni.getSystemInfoSync().platform;
  9718. };
  9719. function sys() {
  9720. return uni.getSystemInfoSync();
  9721. }
  9722. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9723. /***/ }),
  9724. /* 37 */
  9725. /*!*************************************************************************************************!*\
  9726. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/debounce.js ***!
  9727. \*************************************************************************************************/
  9728. /*! no static exports found */
  9729. /***/ (function(module, exports, __webpack_require__) {
  9730. "use strict";
  9731. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timeout = null;
  9732. /**
  9733. * 防抖原理:一定时间内,只有最后一次操作,再过wait毫秒后才执行函数
  9734. *
  9735. * @param {Function} func 要执行的回调函数
  9736. * @param {Number} wait 延时的时间
  9737. * @param {Boolean} immediate 是否立即执行
  9738. * @return null
  9739. */
  9740. 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;
  9741. // 清除定时器
  9742. if (timeout !== null) clearTimeout(timeout);
  9743. // 立即执行,此类情况一般用不到
  9744. if (immediate) {
  9745. var callNow = !timeout;
  9746. timeout = setTimeout(function () {
  9747. timeout = null;
  9748. }, wait);
  9749. if (callNow) typeof func === 'function' && func();
  9750. } else {
  9751. // 设置定时器,当最后一次操作后,timeout不会再被清除,所以在延时wait毫秒后执行func回调方法
  9752. timeout = setTimeout(function () {
  9753. typeof func === 'function' && func();
  9754. }, wait);
  9755. }
  9756. }var _default =
  9757. debounce;exports.default = _default;
  9758. /***/ }),
  9759. /* 38 */
  9760. /*!*************************************************************************************************!*\
  9761. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/function/throttle.js ***!
  9762. \*************************************************************************************************/
  9763. /*! no static exports found */
  9764. /***/ (function(module, exports, __webpack_require__) {
  9765. "use strict";
  9766. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0;var timer, flag;
  9767. /**
  9768. * 节流原理:在一定时间内,只能触发一次
  9769. *
  9770. * @param {Function} func 要执行的回调函数
  9771. * @param {Number} wait 延时的时间
  9772. * @param {Boolean} immediate 是否立即执行
  9773. * @return null
  9774. */
  9775. 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;
  9776. if (immediate) {
  9777. if (!flag) {
  9778. flag = true;
  9779. // 如果是立即执行,则在wait毫秒内开始时执行
  9780. typeof func === 'function' && func();
  9781. timer = setTimeout(function () {
  9782. flag = false;
  9783. }, wait);
  9784. }
  9785. } else {
  9786. if (!flag) {
  9787. flag = true;
  9788. // 如果是非立即执行,则在wait毫秒内的结束处执行
  9789. timer = setTimeout(function () {
  9790. flag = false;
  9791. typeof func === 'function' && func();
  9792. }, wait);
  9793. }
  9794. }
  9795. };var _default =
  9796. throttle;exports.default = _default;
  9797. /***/ }),
  9798. /* 39 */
  9799. /*!*********************************************************************************************!*\
  9800. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/config/config.js ***!
  9801. \*********************************************************************************************/
  9802. /*! no static exports found */
  9803. /***/ (function(module, exports, __webpack_require__) {
  9804. "use strict";
  9805. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // 此版本发布于2020-03-17
  9806. var version = '1.8.4';var _default =
  9807. {
  9808. v: version,
  9809. version: version,
  9810. // 主题名称
  9811. type: [
  9812. 'primary',
  9813. 'success',
  9814. 'info',
  9815. 'error',
  9816. 'warning'] };exports.default = _default;
  9817. /***/ }),
  9818. /* 40 */
  9819. /*!*********************************************************************************************!*\
  9820. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uview-ui/libs/config/zIndex.js ***!
  9821. \*********************************************************************************************/
  9822. /*! no static exports found */
  9823. /***/ (function(module, exports, __webpack_require__) {
  9824. "use strict";
  9825. Object.defineProperty(exports, "__esModule", { value: true });exports.default = void 0; // uniapp在H5中各API的z-index值如下:
  9826. /**
  9827. * actionsheet: 999
  9828. * modal: 999
  9829. * navigate: 998
  9830. * tabbar: 998
  9831. * toast: 999
  9832. */var _default =
  9833. {
  9834. toast: 10090,
  9835. noNetwork: 10080,
  9836. // popup包含popup,actionsheet,keyboard,picker的值
  9837. popup: 10075,
  9838. mask: 10070,
  9839. navbar: 980,
  9840. topTips: 975,
  9841. sticky: 970,
  9842. indexListSticky: 965 };exports.default = _default;
  9843. /***/ }),
  9844. /* 41 */,
  9845. /* 42 */,
  9846. /* 43 */,
  9847. /* 44 */,
  9848. /* 45 */,
  9849. /* 46 */,
  9850. /* 47 */
  9851. /*!*************************************************************************!*\
  9852. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/api/api.js ***!
  9853. \*************************************************************************/
  9854. /*! no static exports found */
  9855. /***/ (function(module, exports, __webpack_require__) {
  9856. "use strict";
  9857. Object.defineProperty(exports, "__esModule", { value: true });exports.getHome = getHome;exports.getPond = getPond;exports.getOpenId = getOpenId;exports.getBanner = getBanner;exports.getSignList = getSignList;exports.setReClaim = setReClaim;exports.setDrawGain = setDrawGain;exports.getUrl = getUrl;exports.setReceive = setReceive;exports.getVersion = getVersion;exports.config = void 0;var _regenerator = _interopRequireDefault(__webpack_require__(/*! ./node_modules/@babel/runtime/regenerator */ 20));var _request = __webpack_require__(/*! @/utils/request */ 48);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);});};}
  9858. /**
  9859. * 大转盘小程序
  9860. * wx021e792baf529aff 好运赢书券
  9861. * wxe1b04d1d8f6df382 书币礼包送不停(转盘抽奖)
  9862. * wx4e8c3f946c06c519 书币礼包领不停(转盘抽奖)
  9863. */
  9864. var config = {
  9865. appid: 'wx021e792baf529aff',
  9866. version: '1.1.4' };exports.config = config;function
  9867. getHome(_x) {return _getHome.apply(this, arguments);}
  9868. // 获取公众号将此
  9869. function _getHome() {_getHome = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee(data) {return _regenerator.default.wrap(function _callee$(_context) {while (1) {switch (_context.prev = _context.next) {case 0:return _context.abrupt("return", (0, _request.request)({ url: "/luck/draw/home", data: data }));case 1:case "end":return _context.stop();}}}, _callee);}));return _getHome.apply(this, arguments);}function getPond(_x2) {return _getPond.apply(this, arguments);}
  9870. // 获取openId
  9871. function _getPond() {_getPond = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee2(data) {return _regenerator.default.wrap(function _callee2$(_context2) {while (1) {switch (_context2.prev = _context2.next) {case 0:return _context2.abrupt("return", (0, _request.request)({ url: "/luck/draw/prize/pond", data: data }));case 1:case "end":return _context2.stop();}}}, _callee2);}));return _getPond.apply(this, arguments);}function getOpenId(_x3) {return _getOpenId.apply(this, arguments);}
  9872. // 获取轮播消息
  9873. function _getOpenId() {_getOpenId = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee3(data) {return _regenerator.default.wrap(function _callee3$(_context3) {while (1) {switch (_context3.prev = _context3.next) {case 0:return _context3.abrupt("return", (0, _request.request)({ url: "/applet/openId", data: data }));case 1:case "end":return _context3.stop();}}}, _callee3);}));return _getOpenId.apply(this, arguments);}function getBanner(_x4) {return _getBanner.apply(this, arguments);}
  9874. // 获取中奖记录列表
  9875. function _getBanner() {_getBanner = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee4(data) {return _regenerator.default.wrap(function _callee4$(_context4) {while (1) {switch (_context4.prev = _context4.next) {case 0:return _context4.abrupt("return", (0, _request.request)({ url: "/luck/draw/home/banner", data: data }));case 1:case "end":return _context4.stop();}}}, _callee4);}));return _getBanner.apply(this, arguments);}function getSignList(_x5) {return _getSignList.apply(this, arguments);}
  9876. // 书币充值失败重新领取
  9877. function _getSignList() {_getSignList = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee5(data) {return _regenerator.default.wrap(function _callee5$(_context5) {while (1) {switch (_context5.prev = _context5.next) {case 0:return _context5.abrupt("return", (0, _request.request)({ url: "/luck/draw/record", data: data }));case 1:case "end":return _context5.stop();}}}, _callee5);}));return _getSignList.apply(this, arguments);}function setReClaim(_x6) {return _setReClaim.apply(this, arguments);}
  9878. // 抽奖
  9879. function _setReClaim() {_setReClaim = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee6(data) {return _regenerator.default.wrap(function _callee6$(_context6) {while (1) {switch (_context6.prev = _context6.next) {case 0:return _context6.abrupt("return", (0, _request.request)({ url: "/luck/draw/reClaim", data: data }));case 1:case "end":return _context6.stop();}}}, _callee6);}));return _setReClaim.apply(this, arguments);}function setDrawGain(_x7) {return _setDrawGain.apply(this, arguments);}
  9880. // 获取公众号文章
  9881. function _setDrawGain() {_setDrawGain = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee7(data) {return _regenerator.default.wrap(function _callee7$(_context7) {while (1) {switch (_context7.prev = _context7.next) {case 0:return _context7.abrupt("return", (0, _request.request)({ url: "/luck/draw/gain", data: data }));case 1:case "end":return _context7.stop();}}}, _callee7);}));return _setDrawGain.apply(this, arguments);}function getUrl(_x8) {return _getUrl.apply(this, arguments);}
  9882. // 头两次领取
  9883. function _getUrl() {_getUrl = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee8(data) {return _regenerator.default.wrap(function _callee8$(_context8) {while (1) {switch (_context8.prev = _context8.next) {case 0:return _context8.abrupt("return", (0, _request.request)({ url: "/applet/mp/url", data: data }));case 1:case "end":return _context8.stop();}}}, _callee8);}));return _getUrl.apply(this, arguments);}function setReceive(_x9) {return _setReceive.apply(this, arguments);}
  9884. // 获取版本
  9885. function _setReceive() {_setReceive = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee9(data) {return _regenerator.default.wrap(function _callee9$(_context9) {while (1) {switch (_context9.prev = _context9.next) {case 0:return _context9.abrupt("return", (0, _request.request)({ url: "/luck/draw/gain/receive", data: data }));case 1:case "end":return _context9.stop();}}}, _callee9);}));return _setReceive.apply(this, arguments);}function getVersion(_x10) {return _getVersion.apply(this, arguments);}function _getVersion() {_getVersion = _asyncToGenerator( /*#__PURE__*/_regenerator.default.mark(function _callee10(data) {return _regenerator.default.wrap(function _callee10$(_context10) {while (1) {switch (_context10.prev = _context10.next) {case 0:return _context10.abrupt("return",
  9886. (0, _request.request)({ url: "/applet/version", data: data }));case 1:case "end":return _context10.stop();}}}, _callee10);}));return _getVersion.apply(this, arguments);}
  9887. /***/ }),
  9888. /* 48 */
  9889. /*!*******************************************************************************!*\
  9890. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/utils/request.js ***!
  9891. \*******************************************************************************/
  9892. /*! no static exports found */
  9893. /***/ (function(module, exports, __webpack_require__) {
  9894. "use strict";
  9895. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.request = request; // let apiUrl = 'https://test.api.zanxiangnet.com/miniapp'
  9896. var apiUrl = 'https://api.zanxiangnet.com/miniapp';
  9897. var isopen = false; // 控制loading
  9898. var openLoading = function openLoading() {
  9899. if (!isopen) {
  9900. isopen = true;
  9901. uni.showLoading({
  9902. title: '加载中' });
  9903. }
  9904. };
  9905. var hiddenLoading = function hiddenLoading() {
  9906. isopen = false;
  9907. uni.hideLoading();
  9908. };
  9909. function request(props) {var
  9910. url =
  9911. props.url,data = props.data,config = props.config,method = props.method,_props$backspace = props.backspace,backspace = _props$backspace === void 0 ? false : _props$backspace,_props$isLoading = props.isLoading,isLoading = _props$isLoading === void 0 ? true : _props$isLoading,_props$isToast = props.isToast,isToast = _props$isToast === void 0 ? true : _props$isToast;
  9912. var _loading = false;
  9913. var reqTimer = null;
  9914. if (isLoading) {
  9915. reqTimer = setTimeout(function () {
  9916. openLoading();
  9917. _loading = true;
  9918. }, 500);
  9919. }
  9920. return new Promise(function (resolve, reject) {
  9921. uni.request({
  9922. url: "".concat(apiUrl).concat(url),
  9923. data: data,
  9924. method: method || 'GET',
  9925. success: function success(res) {
  9926. console.log("请求返回数据---》", res);
  9927. reqTimer && clearTimeout(reqTimer);
  9928. if (_loading) {
  9929. hiddenLoading();
  9930. }
  9931. if (res.data.code === 500) {
  9932. uni.showToast({
  9933. title: res.data.msg || "".concat(apiUrl).concat(url, "\u8BF7\u6C42\u9519\u8BEF"),
  9934. icon: 'none',
  9935. duration: 2000 });
  9936. return;
  9937. }
  9938. resolve(res.data);
  9939. },
  9940. fail: function fail(err) {
  9941. reqTimer && clearTimeout(reqTimer);
  9942. if (_loading) {
  9943. hiddenLoading();
  9944. }
  9945. reject("".concat(url, "\u63A5\u53E3\u8C03\u7528\u5931\u8D25").concat(err));
  9946. } });
  9947. });
  9948. }
  9949. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  9950. /***/ }),
  9951. /* 49 */
  9952. /*!***************************************************************************************************************!*\
  9953. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/uni_modules/almost-lottery/utils/almost-utils.js ***!
  9954. \***************************************************************************************************************/
  9955. /*! no static exports found */
  9956. /***/ (function(module, exports, __webpack_require__) {
  9957. "use strict";
  9958. /* WEBPACK VAR INJECTION */(function(uni) {Object.defineProperty(exports, "__esModule", { value: true });exports.base64ToPath = exports.pathToBase64 = exports.clearCacheFile = exports.downloadFile = exports.clacTextLen = exports.clearStore = exports.getStore = exports.setStore = void 0; /**
  9959. * 存储 localStorage 数据
  9960. * @param {String} name - 缓存数据的标识
  9961. * @param {any} content - 缓存的数据内容
  9962. */
  9963. var setStore = function setStore(name, content) {
  9964. if (!name) return;
  9965. if (typeof content !== 'string') {
  9966. content = JSON.stringify(content);
  9967. }
  9968. uni.setStorageSync(name, content);
  9969. };
  9970. /**
  9971. * 获取 localStorage 数据
  9972. * @param {String} name - 缓存数据的标识
  9973. */exports.setStore = setStore;
  9974. var getStore = function getStore(name) {
  9975. if (!name) return;
  9976. return uni.getStorageSync(name);
  9977. };
  9978. /**
  9979. * 清除 localStorage 数据
  9980. * @param {String} name - 缓存数据的标识
  9981. */exports.getStore = getStore;
  9982. var clearStore = function clearStore(name) {
  9983. if (name) {
  9984. uni.removeStorageSync(name);
  9985. } else {
  9986. console.log('清理本地全部缓存');
  9987. uni.clearStorageSync();
  9988. }
  9989. };
  9990. /**
  9991. * 计算文本的长度
  9992. * @param {String} text - 文本内容
  9993. */exports.clearStore = clearStore;
  9994. var clacTextLen = function clacTextLen(text) {
  9995. if (!text) return { byteLen: 0, realLen: 0 };
  9996. text += '';
  9997. var clacLen = 0;
  9998. for (var i = 0; i < text.length; i++) {
  9999. if (text.charCodeAt(i) < 0 || text.charCodeAt(i) > 255) {
  10000. clacLen += 2;
  10001. } else {
  10002. clacLen += 1;
  10003. }
  10004. }
  10005. // console.log(`当前文本 ${text} 的长度为 ${clacLen / 2}`)
  10006. return {
  10007. byteLen: clacLen,
  10008. realLen: clacLen / 2 };
  10009. };
  10010. /**
  10011. * 下载文件,并返回临时路径
  10012. * @return {String} 临时路径
  10013. * @param {String} fileUrl - 网络地址
  10014. */exports.clacTextLen = clacTextLen;
  10015. var downloadFile = function downloadFile(fileUrl) {
  10016. return new Promise(function (resolve) {
  10017. uni.downloadFile({
  10018. url: fileUrl,
  10019. success: function success(res) {
  10020. if (res.statusCode === 200) {
  10021. resolve({
  10022. ok: true,
  10023. data: res.errMsg,
  10024. tempFilePath: res.tempFilePath });
  10025. } else {
  10026. resolve({
  10027. ok: false,
  10028. data: res.errMsg,
  10029. msg: '图片下载失败' });
  10030. }
  10031. },
  10032. fail: function fail(err) {
  10033. resolve({
  10034. ok: false,
  10035. data: err.errMsg,
  10036. msg: '图片下载失败' });
  10037. } });
  10038. });
  10039. };
  10040. /**
  10041. * 清理应用已缓存的文件
  10042. */exports.downloadFile = downloadFile;
  10043. var clearCacheFile = function clearCacheFile() {
  10044. uni.getSavedFileList({
  10045. success: function success(res) {
  10046. var fileList = res.fileList;
  10047. if (fileList.length) {
  10048. for (var i = 0; i < fileList.length; i++) {
  10049. uni.removeSavedFile({
  10050. filePath: fileList[i].filePath,
  10051. complete: function complete() {
  10052. console.log('清除缓存已完成');
  10053. } });
  10054. }
  10055. }
  10056. },
  10057. fail: function fail(err) {
  10058. console.log('getSavedFileList Fail');
  10059. } });
  10060. };
  10061. // 图像转换工具,可用于图像和base64的转换
  10062. // https://ext.dcloud.net.cn/plugin?id=123
  10063. exports.clearCacheFile = clearCacheFile;var getLocalFilePath = function getLocalFilePath(path) {
  10064. if (
  10065. path.indexOf('_www') === 0 ||
  10066. path.indexOf('_doc') === 0 ||
  10067. path.indexOf('_documents') === 0 ||
  10068. path.indexOf('_downloads') === 0)
  10069. return path;
  10070. if (path.indexOf('/storage/emulated/0/') === 0) return path;
  10071. if (path.indexOf('/storage/sdcard0/') === 0) return path;
  10072. if (path.indexOf('/var/mobile/') === 0) return path;
  10073. if (path.indexOf('file://') === 0) return path;
  10074. if (path.indexOf('/') === 0) {
  10075. // ios 无法获取本地路径
  10076. var localFilePath = plus.os.name === 'iOS' ? path : plus.io.convertLocalFileSystemURL(path);
  10077. if (localFilePath !== path) {
  10078. return localFilePath;
  10079. } else {
  10080. path = path.substring(1);
  10081. }
  10082. }
  10083. return '_www/' + path;
  10084. };
  10085. var pathToBase64 = function pathToBase64(path) {
  10086. return new Promise(function (resolve, reject) {
  10087. if (typeof window === 'object' && 'document' in window) {
  10088. if (typeof FileReader === 'function') {
  10089. var xhr = new XMLHttpRequest();
  10090. xhr.open('GET', path, true);
  10091. xhr.responseType = 'blob';
  10092. xhr.onload = function () {
  10093. if (this.status === 200) {
  10094. var fileReader = new FileReader();
  10095. fileReader.onload = function (e) {
  10096. resolve(e.target.result);
  10097. };
  10098. fileReader.onerror = reject;
  10099. fileReader.readAsDataURL(this.response);
  10100. }
  10101. };
  10102. xhr.onerror = reject;
  10103. xhr.send();
  10104. return;
  10105. }
  10106. var canvas = document.createElement('canvas');
  10107. var c2x = canvas.getContext('2d');
  10108. var img = new Image();
  10109. img.onload = function () {
  10110. canvas.width = img.width;
  10111. canvas.height = img.height;
  10112. c2x.drawImage(img, 0, 0);
  10113. resolve(canvas.toDataURL());
  10114. canvas.height = canvas.width = 0;
  10115. };
  10116. img.onerror = reject;
  10117. img.src = path;
  10118. return;
  10119. }
  10120. if (typeof plus === 'object') {
  10121. var tempPath = getLocalFilePath(path);
  10122. plus.io.resolveLocalFileSystemURL(tempPath, function (entry) {
  10123. entry.file(function (file) {
  10124. var fileReader = new plus.io.FileReader();
  10125. fileReader.onload = function (data) {
  10126. resolve(data.target.result);
  10127. };
  10128. fileReader.onerror = function (error) {
  10129. console.log(error);
  10130. reject(error);
  10131. };
  10132. fileReader.readAsDataURL(file);
  10133. }, function (error) {
  10134. reject(error);
  10135. });
  10136. }, function (error) {
  10137. reject(error);
  10138. });
  10139. return;
  10140. }
  10141. if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
  10142. wx.getFileSystemManager().readFile({
  10143. filePath: path,
  10144. encoding: 'base64',
  10145. success: function success(res) {
  10146. resolve('data:image/png;base64,' + res.data);
  10147. },
  10148. fail: function fail(error) {
  10149. reject(error);
  10150. } });
  10151. return;
  10152. }
  10153. reject(new Error('not support'));
  10154. });
  10155. };exports.pathToBase64 = pathToBase64;
  10156. var base64ToPath = function base64ToPath(base64) {
  10157. return new Promise(function (resolve, reject) {
  10158. if (typeof window === 'object' && 'document' in window) {
  10159. base64 = base64.split(',');
  10160. var type = base64[0].match(/:(.*?);/)[1];
  10161. var str = atob(base64[1]);
  10162. var n = str.length;
  10163. var array = new Uint8Array(n);
  10164. while (n--) {
  10165. array[n] = str.charCodeAt(n);
  10166. }
  10167. return resolve((window.URL || window.webkitURL).createObjectURL(new Blob([array], {
  10168. type: type })));
  10169. }
  10170. var extName = base64.match(/data\:\S+\/(\S+);/);
  10171. if (extName) {
  10172. extName = extName[1];
  10173. } else {
  10174. reject(new Error('base64 error'));
  10175. }
  10176. var fileName = Date.now() + '.' + extName;
  10177. if (typeof plus === 'object') {
  10178. var bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now());
  10179. bitmap.loadBase64Data(base64, function () {
  10180. var filePath = '_doc/uniapp_temp/' + fileName;
  10181. bitmap.save(filePath, {}, function () {
  10182. bitmap.clear();
  10183. resolve(filePath);
  10184. }, function (error) {
  10185. bitmap.clear();
  10186. reject(error);
  10187. });
  10188. }, function (error) {
  10189. bitmap.clear();
  10190. reject(error);
  10191. });
  10192. return;
  10193. }
  10194. if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
  10195. var filePath = wx.env.USER_DATA_PATH + '/' + fileName;
  10196. wx.getFileSystemManager().writeFile({
  10197. filePath: filePath,
  10198. data: base64.replace(/^data:\S+\/\S+;base64,/, ''),
  10199. encoding: 'base64',
  10200. success: function success() {
  10201. resolve(filePath);
  10202. },
  10203. fail: function fail(error) {
  10204. reject(error);
  10205. } });
  10206. return;
  10207. }
  10208. reject(new Error('not support'));
  10209. });
  10210. };exports.base64ToPath = base64ToPath;
  10211. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 1)["default"]))
  10212. /***/ }),
  10213. /* 50 */
  10214. /*!*********************************************************************************!*\
  10215. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/utils/ad_config.js ***!
  10216. \*********************************************************************************/
  10217. /*! no static exports found */
  10218. /***/ (function(module, exports, __webpack_require__) {
  10219. "use strict";
  10220. Object.defineProperty(exports, "__esModule", { value: true });exports.videoAd = exports.singleLatticeAd = exports.insertScreenAd = exports.urgeVideoAd = exports.bannerAd = void 0;var bannerAd = 'adunit-ad6b8eee5ffc4bba'; // banner 广告
  10221. exports.bannerAd = bannerAd;var urgeVideoAd = 'adunit-5ccff810acfd0c38'; // 激励视频广告
  10222. exports.urgeVideoAd = urgeVideoAd;var insertScreenAd = 'adunit-10723ce2718cb2c0'; // 插屏广告
  10223. exports.insertScreenAd = insertScreenAd;var singleLatticeAd = 'adunit-0ba7116ef6341a6a'; // 单格子广告
  10224. exports.singleLatticeAd = singleLatticeAd;var videoAd = 'adunit-9f3ce24d199e991e'; // 领取记录视频广告
  10225. exports.videoAd = videoAd;
  10226. /***/ }),
  10227. /* 51 */,
  10228. /* 52 */,
  10229. /* 53 */,
  10230. /* 54 */,
  10231. /* 55 */,
  10232. /* 56 */,
  10233. /* 57 */,
  10234. /* 58 */,
  10235. /* 59 */,
  10236. /* 60 */,
  10237. /* 61 */,
  10238. /* 62 */,
  10239. /* 63 */,
  10240. /* 64 */,
  10241. /* 65 */,
  10242. /* 66 */,
  10243. /* 67 */,
  10244. /* 68 */,
  10245. /* 69 */,
  10246. /* 70 */,
  10247. /* 71 */,
  10248. /* 72 */,
  10249. /* 73 */,
  10250. /* 74 */,
  10251. /* 75 */,
  10252. /* 76 */,
  10253. /* 77 */,
  10254. /* 78 */,
  10255. /* 79 */,
  10256. /* 80 */,
  10257. /* 81 */,
  10258. /* 82 */,
  10259. /* 83 */,
  10260. /* 84 */,
  10261. /* 85 */,
  10262. /* 86 */,
  10263. /* 87 */,
  10264. /* 88 */,
  10265. /* 89 */,
  10266. /* 90 */,
  10267. /* 91 */,
  10268. /* 92 */,
  10269. /* 93 */,
  10270. /* 94 */,
  10271. /* 95 */,
  10272. /* 96 */,
  10273. /* 97 */,
  10274. /* 98 */,
  10275. /* 99 */,
  10276. /* 100 */,
  10277. /* 101 */,
  10278. /* 102 */,
  10279. /* 103 */,
  10280. /* 104 */,
  10281. /* 105 */,
  10282. /* 106 */,
  10283. /* 107 */,
  10284. /* 108 */,
  10285. /* 109 */,
  10286. /* 110 */,
  10287. /* 111 */,
  10288. /* 112 */,
  10289. /* 113 */,
  10290. /* 114 */,
  10291. /* 115 */,
  10292. /* 116 */,
  10293. /* 117 */,
  10294. /* 118 */,
  10295. /* 119 */,
  10296. /* 120 */,
  10297. /* 121 */,
  10298. /* 122 */,
  10299. /* 123 */
  10300. /*!******************************************************************************!*\
  10301. !*** C:/Users/77876/Documents/HBuilderProjects/qc-luckyDraw/static/bczp.png ***!
  10302. \******************************************************************************/
  10303. /*! no static exports found */
  10304. /***/ (function(module, exports) {
  10305. module.exports = "/static/bczp.png";
  10306. /***/ })
  10307. ]]);
  10308. //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map